/* desktop-icon.c generated by valac 0.36.9, the Vala compiler
 * generated from desktop-icon.vala, do not modify */

/* This file is part of GNOME Games. License: GPL-3.0+.*/

#include <glib.h>
#include <glib-object.h>
#include <libgnome-games.h>
#include <gio/gdesktopappinfo.h>
#include <gio/gio.h>


#define GAMES_TYPE_DESKTOP_ICON (games_desktop_icon_get_type ())
#define GAMES_DESKTOP_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_DESKTOP_ICON, GamesDesktopIcon))
#define GAMES_DESKTOP_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_DESKTOP_ICON, GamesDesktopIconClass))
#define GAMES_IS_DESKTOP_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_DESKTOP_ICON))
#define GAMES_IS_DESKTOP_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_DESKTOP_ICON))
#define GAMES_DESKTOP_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_DESKTOP_ICON, GamesDesktopIconClass))

typedef struct _GamesDesktopIcon GamesDesktopIcon;
typedef struct _GamesDesktopIconClass GamesDesktopIconClass;
typedef struct _GamesDesktopIconPrivate GamesDesktopIconPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GamesDesktopIcon {
	GObject parent_instance;
	GamesDesktopIconPrivate * priv;
};

struct _GamesDesktopIconClass {
	GObjectClass parent_class;
};

struct _GamesDesktopIconPrivate {
	GDesktopAppInfo* app_info;
};


static gpointer games_desktop_icon_parent_class = NULL;
static GamesIconIface * games_desktop_icon_games_icon_parent_iface = NULL;
static GType games_desktop_icon_type_id = 0;

GType games_desktop_icon_get_type (void) G_GNUC_CONST;
#define GAMES_DESKTOP_ICON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_DESKTOP_ICON, GamesDesktopIconPrivate))
enum  {
	GAMES_DESKTOP_ICON_0_PROPERTY
};
GamesDesktopIcon* games_desktop_icon_new (GDesktopAppInfo* app_info);
GamesDesktopIcon* games_desktop_icon_construct (GType object_type, GDesktopAppInfo* app_info);
static GIcon* games_desktop_icon_real_get_icon (GamesIcon* base);
static void games_desktop_icon_finalize (GObject * obj);


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


GamesDesktopIcon* games_desktop_icon_construct (GType object_type, GDesktopAppInfo* app_info) {
	GamesDesktopIcon * self = NULL;
	GDesktopAppInfo* _tmp0_;
	GDesktopAppInfo* _tmp1_;
	g_return_val_if_fail (app_info != NULL, NULL);
	self = (GamesDesktopIcon*) g_object_new (object_type, NULL);
	_tmp0_ = app_info;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->app_info);
	self->priv->app_info = _tmp1_;
	return self;
}


GamesDesktopIcon* games_desktop_icon_new (GDesktopAppInfo* app_info) {
	return games_desktop_icon_construct (GAMES_TYPE_DESKTOP_ICON, app_info);
}


static GIcon* games_desktop_icon_real_get_icon (GamesIcon* base) {
	GamesDesktopIcon * self;
	GIcon* result = NULL;
	GDesktopAppInfo* _tmp0_;
	GIcon* _tmp1_;
	GIcon* _tmp2_;
	self = (GamesDesktopIcon*) base;
	_tmp0_ = self->priv->app_info;
	_tmp1_ = g_app_info_get_icon ((GAppInfo*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	result = _tmp2_;
	return result;
}


static void games_desktop_icon_class_init (GamesDesktopIconClass * klass) {
	games_desktop_icon_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesDesktopIconPrivate));
	G_OBJECT_CLASS (klass)->finalize = games_desktop_icon_finalize;
}


static void games_desktop_icon_games_icon_interface_init (GamesIconIface * iface) {
	games_desktop_icon_games_icon_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_icon = (GIcon* (*) (GamesIcon *)) games_desktop_icon_real_get_icon;
}


static void games_desktop_icon_instance_init (GamesDesktopIcon * self) {
	self->priv = GAMES_DESKTOP_ICON_GET_PRIVATE (self);
}


static void games_desktop_icon_finalize (GObject * obj) {
	GamesDesktopIcon * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_DESKTOP_ICON, GamesDesktopIcon);
	_g_object_unref0 (self->priv->app_info);
	G_OBJECT_CLASS (games_desktop_icon_parent_class)->finalize (obj);
}


GType games_desktop_icon_get_type (void) {
	return games_desktop_icon_type_id;
}


GType games_desktop_icon_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (GamesDesktopIconClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_desktop_icon_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesDesktopIcon), 0, (GInstanceInitFunc) games_desktop_icon_instance_init, NULL };
	static const GInterfaceInfo games_icon_info = { (GInterfaceInitFunc) games_desktop_icon_games_icon_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	games_desktop_icon_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "GamesDesktopIcon", &g_define_type_info, 0);
	g_type_module_add_interface (module, games_desktop_icon_type_id, GAMES_TYPE_ICON, &games_icon_info);
	return games_desktop_icon_type_id;
}



