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

/*
 * This file is part of budgie-desktop
 *
 * Copyright © 2018-2022 Budgie Desktop Developers
 *
 * 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 2 of the License, or
 * (at your option) any later version.
 */

#include "abomination.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gdesktopappinfo.h>
#include <libwnck/libwnck.h>
#include "appsys.h"
#include <glib-object.h>

enum  {
	BUDGIE_ABOMINATION_RUNNING_APP_0_PROPERTY,
	BUDGIE_ABOMINATION_RUNNING_APP_ID_PROPERTY,
	BUDGIE_ABOMINATION_RUNNING_APP_NAME_PROPERTY,
	BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_PROPERTY,
	BUDGIE_ABOMINATION_RUNNING_APP_ICON_PROPERTY,
	BUDGIE_ABOMINATION_RUNNING_APP_GROUP_OBJECT_PROPERTY,
	BUDGIE_ABOMINATION_RUNNING_APP_NUM_PROPERTIES
};
static GParamSpec* budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	BUDGIE_ABOMINATION_RUNNING_APP_ICON_CHANGED_SIGNAL,
	BUDGIE_ABOMINATION_RUNNING_APP_RENAMED_APP_SIGNAL,
	BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_CHANGED_SIGNAL,
	BUDGIE_ABOMINATION_RUNNING_APP_NUM_SIGNALS
};
static guint budgie_abomination_running_app_signals[BUDGIE_ABOMINATION_RUNNING_APP_NUM_SIGNALS] = {0};

struct _BudgieAbominationRunningAppPrivate {
	gulong _id;
	gchar* _name;
	GDesktopAppInfo* _app_info;
	gchar* _icon;
	BudgieAbominationAppGroup* _group_object;
	WnckWindow* window;
	BudgieAppSystem* app_system;
};

static gint BudgieAbominationRunningApp_private_offset;
static gpointer budgie_abomination_running_app_parent_class = NULL;

VALA_EXTERN BudgieAbominationRunningApp* budgie_abomination_running_app_new (BudgieAppSystem* app_system,
                                                                 WnckWindow* window,
                                                                 BudgieAbominationAppGroup* group);
VALA_EXTERN BudgieAbominationRunningApp* budgie_abomination_running_app_construct (GType object_type,
                                                                       BudgieAppSystem* app_system,
                                                                       WnckWindow* window,
                                                                       BudgieAbominationAppGroup* group);
static void budgie_abomination_running_app_set_window (BudgieAbominationRunningApp* self,
                                                WnckWindow* window);
static void budgie_abomination_running_app_set_id (BudgieAbominationRunningApp* self,
                                            gulong value);
static void budgie_abomination_running_app_set_name (BudgieAbominationRunningApp* self,
                                              const gchar* value);
static void budgie_abomination_running_app_set_group_object (BudgieAbominationRunningApp* self,
                                                      BudgieAbominationAppGroup* value);
static void budgie_abomination_running_app_update_app_info (BudgieAbominationRunningApp* self);
static void budgie_abomination_running_app_update_icon (BudgieAbominationRunningApp* self);
static void budgie_abomination_running_app_update_name (BudgieAbominationRunningApp* self);
static void __lambda7_ (BudgieAbominationRunningApp* self);
static void ___lambda7__wnck_window_class_changed (WnckWindow* _sender,
                                            gpointer self);
static void __lambda8_ (BudgieAbominationRunningApp* self);
static void ___lambda8__wnck_window_icon_changed (WnckWindow* _sender,
                                           gpointer self);
static void __lambda9_ (BudgieAbominationRunningApp* self);
static void ___lambda9__wnck_window_name_changed (WnckWindow* _sender,
                                           gpointer self);
static void __lambda10_ (BudgieAbominationRunningApp* self);
static void ___lambda10__wnck_window_state_changed (WnckWindow* _sender,
                                             WnckWindowState changed_mask,
                                             WnckWindowState new_state,
                                             gpointer self);
static void budgie_abomination_running_app_set_app_info (BudgieAbominationRunningApp* self,
                                                  GDesktopAppInfo* value);
static void budgie_abomination_running_app_set_icon (BudgieAbominationRunningApp* self,
                                              const gchar* value);
static void g_cclosure_user_marshal_VOID__STRING_STRING (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void budgie_abomination_running_app_finalize (GObject * obj);
static GType budgie_abomination_running_app_get_type_once (void);
static void _vala_budgie_abomination_running_app_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_budgie_abomination_running_app_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);

static inline gpointer
budgie_abomination_running_app_get_instance_private (BudgieAbominationRunningApp* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieAbominationRunningApp_private_offset);
}

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

BudgieAbominationRunningApp*
budgie_abomination_running_app_construct (GType object_type,
                                          BudgieAppSystem* app_system,
                                          WnckWindow* window,
                                          BudgieAbominationAppGroup* group)
{
	BudgieAbominationRunningApp * self = NULL;
	WnckWindow* _tmp0_;
	WnckWindow* _tmp1_;
	const gchar* _tmp2_;
	BudgieAppSystem* _tmp3_;
	const gchar* _tmp4_;
	g_return_val_if_fail (app_system != NULL, NULL);
	g_return_val_if_fail (window != NULL, NULL);
	g_return_val_if_fail (group != NULL, NULL);
	self = (BudgieAbominationRunningApp*) g_object_new (object_type, NULL);
	budgie_abomination_running_app_set_window (self, window);
	_tmp0_ = self->priv->window;
	budgie_abomination_running_app_set_id (self, wnck_window_get_xid (_tmp0_));
	_tmp1_ = self->priv->window;
	_tmp2_ = wnck_window_get_name (_tmp1_);
	budgie_abomination_running_app_set_name (self, _tmp2_);
	budgie_abomination_running_app_set_group_object (self, group);
	_tmp3_ = _g_object_ref0 (app_system);
	_g_object_unref0 (self->priv->app_system);
	self->priv->app_system = _tmp3_;
	budgie_abomination_running_app_update_app_info (self);
	_tmp4_ = self->priv->_name;
	g_debug ("RunningApp.vala:44: Created app: %s", _tmp4_);
	return self;
}

BudgieAbominationRunningApp*
budgie_abomination_running_app_new (BudgieAppSystem* app_system,
                                    WnckWindow* window,
                                    BudgieAbominationAppGroup* group)
{
	return budgie_abomination_running_app_construct (BUDGIE_ABOMINATION_TYPE_RUNNING_APP, app_system, window, group);
}

gchar*
budgie_abomination_running_app_get_group_name (BudgieAbominationRunningApp* self)
{
	BudgieAbominationAppGroup* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group_object;
	_tmp1_ = budgie_abomination_app_group_get_name (_tmp0_);
	result = _tmp1_;
	return result;
}

WnckWindow*
budgie_abomination_running_app_get_window (BudgieAbominationRunningApp* self)
{
	WnckWindow* _tmp0_;
	WnckWindow* _tmp1_;
	WnckWindow* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

/**
 * set_window will handle setting our window and its bindings
 */
static void
__lambda7_ (BudgieAbominationRunningApp* self)
{
	budgie_abomination_running_app_update_app_info (self);
	budgie_abomination_running_app_update_icon (self);
	budgie_abomination_running_app_update_name (self);
}

static void
___lambda7__wnck_window_class_changed (WnckWindow* _sender,
                                       gpointer self)
{
	__lambda7_ ((BudgieAbominationRunningApp*) self);
}

static void
__lambda8_ (BudgieAbominationRunningApp* self)
{
	budgie_abomination_running_app_update_icon (self);
}

static void
___lambda8__wnck_window_icon_changed (WnckWindow* _sender,
                                      gpointer self)
{
	__lambda8_ ((BudgieAbominationRunningApp*) self);
}

static void
__lambda9_ (BudgieAbominationRunningApp* self)
{
	budgie_abomination_running_app_update_name (self);
}

static void
___lambda9__wnck_window_name_changed (WnckWindow* _sender,
                                      gpointer self)
{
	__lambda9_ ((BudgieAbominationRunningApp*) self);
}

static void
__lambda10_ (BudgieAbominationRunningApp* self)
{
	budgie_abomination_running_app_update_name (self);
}

static void
___lambda10__wnck_window_state_changed (WnckWindow* _sender,
                                        WnckWindowState changed_mask,
                                        WnckWindowState new_state,
                                        gpointer self)
{
	__lambda10_ ((BudgieAbominationRunningApp*) self);
}

static void
budgie_abomination_running_app_set_window (BudgieAbominationRunningApp* self,
                                           WnckWindow* window)
{
	WnckWindow* _tmp0_;
	WnckWindow* _tmp1_;
	WnckWindow* _tmp2_;
	WnckWindow* _tmp3_;
	WnckWindow* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (window != NULL);
	if (window == NULL) {
		return;
	}
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (self->priv->window);
	self->priv->window = _tmp0_;
	budgie_abomination_running_app_update_icon (self);
	budgie_abomination_running_app_update_name (self);
	_tmp1_ = self->priv->window;
	g_signal_connect_object (_tmp1_, "class-changed", (GCallback) ___lambda7__wnck_window_class_changed, self, 0);
	_tmp2_ = self->priv->window;
	g_signal_connect_object (_tmp2_, "icon-changed", (GCallback) ___lambda8__wnck_window_icon_changed, self, 0);
	_tmp3_ = self->priv->window;
	g_signal_connect_object (_tmp3_, "name-changed", (GCallback) ___lambda9__wnck_window_name_changed, self, 0);
	_tmp4_ = self->priv->window;
	g_signal_connect_object (_tmp4_, "state-changed", (GCallback) ___lambda10__wnck_window_state_changed, self, 0);
}

/**
 * update_app_info will update our app information based on the window
 * associated with the app.
 */
static void
budgie_abomination_running_app_update_app_info (BudgieAbominationRunningApp* self)
{
	BudgieAppSystem* _tmp0_;
	WnckWindow* _tmp1_;
	GDesktopAppInfo* _tmp2_;
	GDesktopAppInfo* _tmp3_;
	GDesktopAppInfo* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app_system;
	_tmp1_ = self->priv->window;
	_tmp2_ = budgie_app_system_query_window (_tmp0_, _tmp1_);
	_tmp3_ = _tmp2_;
	budgie_abomination_running_app_set_app_info (self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = self->priv->_app_info;
	g_signal_emit (self, budgie_abomination_running_app_signals[BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_CHANGED_SIGNAL], 0, _tmp4_);
}

/**
 * update_icon will update our icon and notify that it changed
 */
static void
budgie_abomination_running_app_update_icon (BudgieAbominationRunningApp* self)
{
	gboolean _tmp0_ = FALSE;
	GDesktopAppInfo* _tmp1_;
	gchar* old_icon = NULL;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GDesktopAppInfo* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_app_info;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		GDesktopAppInfo* _tmp2_;
		_tmp2_ = self->priv->_app_info;
		_tmp0_ = !g_desktop_app_info_has_key (_tmp2_, "Icon");
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = self->priv->_icon;
	_tmp4_ = g_strdup (_tmp3_);
	old_icon = _tmp4_;
	_tmp5_ = self->priv->_app_info;
	_tmp6_ = g_desktop_app_info_get_string (_tmp5_, "Icon");
	_tmp7_ = _tmp6_;
	budgie_abomination_running_app_set_icon (self, _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = self->priv->_icon;
	_tmp9_ = old_icon;
	if (g_strcmp0 (_tmp8_, _tmp9_) != 0) {
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		_tmp10_ = self->priv->_name;
		g_debug ("RunningApp.vala:102: Icon changed for app %s", _tmp10_);
		_tmp11_ = self->priv->_icon;
		g_signal_emit (self, budgie_abomination_running_app_signals[BUDGIE_ABOMINATION_RUNNING_APP_ICON_CHANGED_SIGNAL], 0, _tmp11_);
	}
	_g_free0 (old_icon);
}

/**
 * update_name will update the window name
 */
static void
budgie_abomination_running_app_update_name (BudgieAbominationRunningApp* self)
{
	WnckWindow* _tmp0_;
	gchar* old_name = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	WnckWindow* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_name;
	_tmp2_ = g_strdup (_tmp1_);
	old_name = _tmp2_;
	_tmp3_ = self->priv->window;
	_tmp4_ = wnck_window_get_name (_tmp3_);
	budgie_abomination_running_app_set_name (self, _tmp4_);
	_tmp5_ = self->priv->_name;
	_tmp6_ = old_name;
	if (g_strcmp0 (_tmp5_, _tmp6_) != 0) {
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp7_ = old_name;
		_tmp8_ = self->priv->_name;
		g_debug ("RunningApp.vala:119: Renamed app %s into %s", _tmp7_, _tmp8_);
		_tmp9_ = old_name;
		_tmp10_ = self->priv->_name;
		g_signal_emit (self, budgie_abomination_running_app_signals[BUDGIE_ABOMINATION_RUNNING_APP_RENAMED_APP_SIGNAL], 0, _tmp9_, _tmp10_);
	}
	_g_free0 (old_name);
}

gulong
budgie_abomination_running_app_get_id (BudgieAbominationRunningApp* self)
{
	gulong result;
	g_return_val_if_fail (self != NULL, 0UL);
	result = self->priv->_id;
	return result;
}

static void
budgie_abomination_running_app_set_id (BudgieAbominationRunningApp* self,
                                       gulong value)
{
	gulong old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_abomination_running_app_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_ID_PROPERTY]);
	}
}

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

static void
budgie_abomination_running_app_set_name (BudgieAbominationRunningApp* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_abomination_running_app_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, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_NAME_PROPERTY]);
	}
}

GDesktopAppInfo*
budgie_abomination_running_app_get_app_info (BudgieAbominationRunningApp* self)
{
	GDesktopAppInfo* result;
	GDesktopAppInfo* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_app_info;
	result = _tmp0_;
	return result;
}

static void
budgie_abomination_running_app_set_app_info (BudgieAbominationRunningApp* self,
                                             GDesktopAppInfo* value)
{
	GDesktopAppInfo* old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_abomination_running_app_get_app_info (self);
	if (old_value != value) {
		GDesktopAppInfo* _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, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_PROPERTY]);
	}
}

const gchar*
budgie_abomination_running_app_get_icon (BudgieAbominationRunningApp* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon;
	result = _tmp0_;
	return result;
}

static void
budgie_abomination_running_app_set_icon (BudgieAbominationRunningApp* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_abomination_running_app_get_icon (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_icon);
		self->priv->_icon = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_ICON_PROPERTY]);
	}
}

BudgieAbominationAppGroup*
budgie_abomination_running_app_get_group_object (BudgieAbominationRunningApp* self)
{
	BudgieAbominationAppGroup* result;
	BudgieAbominationAppGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group_object;
	result = _tmp0_;
	return result;
}

static void
budgie_abomination_running_app_set_group_object (BudgieAbominationRunningApp* self,
                                                 BudgieAbominationAppGroup* value)
{
	BudgieAbominationAppGroup* old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_abomination_running_app_get_group_object (self);
	if (old_value != value) {
		self->priv->_group_object = value;
		g_object_notify_by_pspec ((GObject *) self, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_GROUP_OBJECT_PROPERTY]);
	}
}

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

static void
budgie_abomination_running_app_class_init (BudgieAbominationRunningAppClass * klass,
                                           gpointer klass_data)
{
	budgie_abomination_running_app_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieAbominationRunningApp_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_budgie_abomination_running_app_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_budgie_abomination_running_app_set_property;
	G_OBJECT_CLASS (klass)->finalize = budgie_abomination_running_app_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_ABOMINATION_RUNNING_APP_ID_PROPERTY, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_ID_PROPERTY] = g_param_spec_ulong ("id", "id", "id", 0, G_MAXULONG, 0UL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_ABOMINATION_RUNNING_APP_NAME_PROPERTY, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_PROPERTY, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_PROPERTY] = g_param_spec_object ("app-info", "app-info", "app-info", G_TYPE_DESKTOP_APP_INFO, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_ABOMINATION_RUNNING_APP_ICON_PROPERTY, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_ICON_PROPERTY] = g_param_spec_string ("icon", "icon", "icon", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_ABOMINATION_RUNNING_APP_GROUP_OBJECT_PROPERTY, budgie_abomination_running_app_properties[BUDGIE_ABOMINATION_RUNNING_APP_GROUP_OBJECT_PROPERTY] = g_param_spec_object ("group-object", "group-object", "group-object", BUDGIE_ABOMINATION_TYPE_APP_GROUP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * Signals
	 */
	budgie_abomination_running_app_signals[BUDGIE_ABOMINATION_RUNNING_APP_ICON_CHANGED_SIGNAL] = g_signal_new ("icon-changed", BUDGIE_ABOMINATION_TYPE_RUNNING_APP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	budgie_abomination_running_app_signals[BUDGIE_ABOMINATION_RUNNING_APP_RENAMED_APP_SIGNAL] = g_signal_new ("renamed-app", BUDGIE_ABOMINATION_TYPE_RUNNING_APP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
	budgie_abomination_running_app_signals[BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_CHANGED_SIGNAL] = g_signal_new ("app-info-changed", BUDGIE_ABOMINATION_TYPE_RUNNING_APP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_DESKTOP_APP_INFO);
}

static void
budgie_abomination_running_app_instance_init (BudgieAbominationRunningApp * self,
                                              gpointer klass)
{
	self->priv = budgie_abomination_running_app_get_instance_private (self);
	self->priv->_app_info = NULL;
	self->priv->app_system = NULL;
}

static void
budgie_abomination_running_app_finalize (GObject * obj)
{
	BudgieAbominationRunningApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_ABOMINATION_TYPE_RUNNING_APP, BudgieAbominationRunningApp);
	_g_free0 (self->priv->_name);
	_g_object_unref0 (self->priv->_app_info);
	_g_free0 (self->priv->_icon);
	_g_object_unref0 (self->priv->window);
	_g_object_unref0 (self->priv->app_system);
	G_OBJECT_CLASS (budgie_abomination_running_app_parent_class)->finalize (obj);
}

/**
 * RunningApp is our wrapper for Wnck.Window with information
 * needed by Budgie components.
 */
static GType
budgie_abomination_running_app_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieAbominationRunningAppClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_abomination_running_app_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieAbominationRunningApp), 0, (GInstanceInitFunc) budgie_abomination_running_app_instance_init, NULL };
	GType budgie_abomination_running_app_type_id;
	budgie_abomination_running_app_type_id = g_type_register_static (G_TYPE_OBJECT, "BudgieAbominationRunningApp", &g_define_type_info, 0);
	BudgieAbominationRunningApp_private_offset = g_type_add_instance_private (budgie_abomination_running_app_type_id, sizeof (BudgieAbominationRunningAppPrivate));
	return budgie_abomination_running_app_type_id;
}

GType
budgie_abomination_running_app_get_type (void)
{
	static volatile gsize budgie_abomination_running_app_type_id__once = 0;
	if (g_once_init_enter (&budgie_abomination_running_app_type_id__once)) {
		GType budgie_abomination_running_app_type_id;
		budgie_abomination_running_app_type_id = budgie_abomination_running_app_get_type_once ();
		g_once_init_leave (&budgie_abomination_running_app_type_id__once, budgie_abomination_running_app_type_id);
	}
	return budgie_abomination_running_app_type_id__once;
}

static void
_vala_budgie_abomination_running_app_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	BudgieAbominationRunningApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_ABOMINATION_TYPE_RUNNING_APP, BudgieAbominationRunningApp);
	switch (property_id) {
		case BUDGIE_ABOMINATION_RUNNING_APP_ID_PROPERTY:
		g_value_set_ulong (value, budgie_abomination_running_app_get_id (self));
		break;
		case BUDGIE_ABOMINATION_RUNNING_APP_NAME_PROPERTY:
		g_value_set_string (value, budgie_abomination_running_app_get_name (self));
		break;
		case BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_PROPERTY:
		g_value_set_object (value, budgie_abomination_running_app_get_app_info (self));
		break;
		case BUDGIE_ABOMINATION_RUNNING_APP_ICON_PROPERTY:
		g_value_set_string (value, budgie_abomination_running_app_get_icon (self));
		break;
		case BUDGIE_ABOMINATION_RUNNING_APP_GROUP_OBJECT_PROPERTY:
		g_value_set_object (value, budgie_abomination_running_app_get_group_object (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_budgie_abomination_running_app_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	BudgieAbominationRunningApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_ABOMINATION_TYPE_RUNNING_APP, BudgieAbominationRunningApp);
	switch (property_id) {
		case BUDGIE_ABOMINATION_RUNNING_APP_ID_PROPERTY:
		budgie_abomination_running_app_set_id (self, g_value_get_ulong (value));
		break;
		case BUDGIE_ABOMINATION_RUNNING_APP_NAME_PROPERTY:
		budgie_abomination_running_app_set_name (self, g_value_get_string (value));
		break;
		case BUDGIE_ABOMINATION_RUNNING_APP_APP_INFO_PROPERTY:
		budgie_abomination_running_app_set_app_info (self, g_value_get_object (value));
		break;
		case BUDGIE_ABOMINATION_RUNNING_APP_ICON_PROPERTY:
		budgie_abomination_running_app_set_icon (self, g_value_get_string (value));
		break;
		case BUDGIE_ABOMINATION_RUNNING_APP_GROUP_OBJECT_PROPERTY:
		budgie_abomination_running_app_set_group_object (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

