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

/*
 * Copyright 2025 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authored by: Leonhard Kargl <leo.kargl@proton.me>
 */

#include "gala.h"
#include <glib.h>
#include <float.h>
#include <math.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <clutter/clutter.h>
#include <gio/gio.h>
#include <gtk/gtk.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

#define GALA_ICON_TYPE_ICON_SOURCE (gala_icon_icon_source_get_type ())
#define GALA_ICON_ICON_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_ICON_TYPE_ICON_SOURCE, GalaIconIconSource))
#define GALA_ICON_IS_ICON_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_ICON_TYPE_ICON_SOURCE))
#define GALA_ICON_ICON_SOURCE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GALA_ICON_TYPE_ICON_SOURCE, GalaIconIconSourceIface))

typedef struct _GalaIconIconSource GalaIconIconSource;
typedef struct _GalaIconIconSourceIface GalaIconIconSourceIface;
enum  {
	GALA_ICON_0_PROPERTY,
	GALA_ICON_ICON_SIZE_PROPERTY,
	GALA_ICON_MONITOR_SCALE_PROPERTY,
	GALA_ICON_RESOURCE_PATH_PROPERTY,
	GALA_ICON_GICON_PROPERTY,
	GALA_ICON_NUM_PROPERTIES
};
static GParamSpec* gala_icon_properties[GALA_ICON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define GALA_ICON_TYPE_RESOURCE_ICON_SOURCE (gala_icon_resource_icon_source_get_type ())
#define GALA_ICON_RESOURCE_ICON_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_ICON_TYPE_RESOURCE_ICON_SOURCE, GalaIconResourceIconSource))
#define GALA_ICON_RESOURCE_ICON_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_ICON_TYPE_RESOURCE_ICON_SOURCE, GalaIconResourceIconSourceClass))
#define GALA_ICON_IS_RESOURCE_ICON_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_ICON_TYPE_RESOURCE_ICON_SOURCE))
#define GALA_ICON_IS_RESOURCE_ICON_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_ICON_TYPE_RESOURCE_ICON_SOURCE))
#define GALA_ICON_RESOURCE_ICON_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_ICON_TYPE_RESOURCE_ICON_SOURCE, GalaIconResourceIconSourceClass))

typedef struct _GalaIconResourceIconSource GalaIconResourceIconSource;
typedef struct _GalaIconResourceIconSourceClass GalaIconResourceIconSourceClass;

#define GALA_ICON_TYPE_GICON_SOURCE (gala_icon_gicon_source_get_type ())
#define GALA_ICON_GICON_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_ICON_TYPE_GICON_SOURCE, GalaIconGIconSource))
#define GALA_ICON_GICON_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_ICON_TYPE_GICON_SOURCE, GalaIconGIconSourceClass))
#define GALA_ICON_IS_GICON_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_ICON_TYPE_GICON_SOURCE))
#define GALA_ICON_IS_GICON_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_ICON_TYPE_GICON_SOURCE))
#define GALA_ICON_GICON_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_ICON_TYPE_GICON_SOURCE, GalaIconGIconSourceClass))

typedef struct _GalaIconGIconSource GalaIconGIconSource;
typedef struct _GalaIconGIconSourceClass GalaIconGIconSourceClass;
typedef struct _GalaIconGIconSourcePrivate GalaIconGIconSourcePrivate;
enum  {
	GALA_ICON_GICON_SOURCE_0_PROPERTY,
	GALA_ICON_GICON_SOURCE_GICON_PROPERTY,
	GALA_ICON_GICON_SOURCE_NUM_PROPERTIES
};
static GParamSpec* gala_icon_gicon_source_properties[GALA_ICON_GICON_SOURCE_NUM_PROPERTIES];
typedef struct _GalaIconResourceIconSourcePrivate GalaIconResourceIconSourcePrivate;
enum  {
	GALA_ICON_RESOURCE_ICON_SOURCE_0_PROPERTY,
	GALA_ICON_RESOURCE_ICON_SOURCE_PATH_PROPERTY,
	GALA_ICON_RESOURCE_ICON_SOURCE_NUM_PROPERTIES
};
static GParamSpec* gala_icon_resource_icon_source_properties[GALA_ICON_RESOURCE_ICON_SOURCE_NUM_PROPERTIES];

struct _GalaIconIconSourceIface {
	GTypeInterface parent_iface;
	gchar* (*get_cache_key) (GalaIconIconSource* self, gint size, gfloat scale);
	GdkPixbuf* (*create_pixbuf) (GalaIconIconSource* self, gint size, gfloat scale, GError** error);
};

struct _GalaIconPrivate {
	gint _icon_size;
	gfloat _monitor_scale;
	GalaIconIconSource* _source;
};

struct _GalaIconGIconSource {
	GObject parent_instance;
	GalaIconGIconSourcePrivate * priv;
};

struct _GalaIconGIconSourceClass {
	GObjectClass parent_class;
};

struct _GalaIconGIconSourcePrivate {
	GIcon* _gicon;
};

struct _GalaIconResourceIconSource {
	GObject parent_instance;
	GalaIconResourceIconSourcePrivate * priv;
};

struct _GalaIconResourceIconSourceClass {
	GObjectClass parent_class;
};

struct _GalaIconResourceIconSourcePrivate {
	gchar* _path;
};

static gint GalaIcon_private_offset;
static gpointer gala_icon_parent_class = NULL;
static GHashTable* gala_icon_icon_pixbufs;
static GHashTable* gala_icon_icon_pixbufs = NULL;
static gint GalaIconGIconSource_private_offset;
static gpointer gala_icon_gicon_source_parent_class = NULL;
static GtkIconTheme* gala_icon_gicon_source_icon_theme;
static GtkIconTheme* gala_icon_gicon_source_icon_theme = NULL;
static GalaIconIconSourceIface * gala_icon_gicon_source_gala_icon_icon_source_parent_iface = NULL;
static gint GalaIconResourceIconSource_private_offset;
static gpointer gala_icon_resource_icon_source_parent_class = NULL;
static GalaIconIconSourceIface * gala_icon_resource_icon_source_gala_icon_icon_source_parent_iface = NULL;

static GType gala_icon_icon_source_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void _g_free0_ (gpointer var);
static void _g_object_unref0_ (gpointer var);
static void gala_icon_load_pixbuf (GalaIcon* self);
static GdkPixbuf* gala_icon_get_pixbuf (GalaIcon* self,
                                 gint size,
                                 gfloat scale,
                                 GError** error);
static GalaIconIconSource* gala_icon_get_source (GalaIcon* self);
static gchar* gala_icon_icon_source_get_cache_key (GalaIconIconSource* self,
                                            gint size,
                                            gfloat scale);
static GdkPixbuf* gala_icon_icon_source_create_pixbuf (GalaIconIconSource* self,
                                                gint size,
                                                gfloat scale,
                                                GError** error);
static GalaIconResourceIconSource* gala_icon_resource_icon_source_new (const gchar* path);
static GalaIconResourceIconSource* gala_icon_resource_icon_source_construct (GType object_type,
                                                                      const gchar* path);
static GType gala_icon_resource_icon_source_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void gala_icon_set_source (GalaIcon* self,
                           GalaIconIconSource* value);
static GalaIconGIconSource* gala_icon_gicon_source_new (GIcon* gicon);
static GalaIconGIconSource* gala_icon_gicon_source_construct (GType object_type,
                                                       GIcon* gicon);
static GType gala_icon_gicon_source_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gchar* gala_icon_gicon_source_real_get_cache_key (GalaIconIconSource* base,
                                                  gint size,
                                                  gfloat scale);
static GIcon* gala_icon_gicon_source_get_gicon (GalaIconGIconSource* self);
static GdkPixbuf* gala_icon_gicon_source_real_create_pixbuf (GalaIconIconSource* base,
                                                      gint size,
                                                      gfloat scale,
                                                      GError** error);
static gint gala_icon_icon_source_get_texture_size (gint size,
                                             gfloat scale);
static void gala_icon_gicon_source_set_gicon (GalaIconGIconSource* self,
                                       GIcon* value);
static void gala_icon_gicon_source_finalize (GObject * obj);
static GType gala_icon_gicon_source_get_type_once (void);
static void _vala_gala_icon_gicon_source_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_gala_icon_gicon_source_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec);
static gchar* gala_icon_resource_icon_source_real_get_cache_key (GalaIconIconSource* base,
                                                          gint size,
                                                          gfloat scale);
static const gchar* gala_icon_resource_icon_source_get_path (GalaIconResourceIconSource* self);
static GdkPixbuf* gala_icon_resource_icon_source_real_create_pixbuf (GalaIconIconSource* base,
                                                              gint size,
                                                              gfloat scale,
                                                              GError** error);
static void gala_icon_resource_icon_source_set_path (GalaIconResourceIconSource* self,
                                              const gchar* value);
static void gala_icon_resource_icon_source_finalize (GObject * obj);
static GType gala_icon_resource_icon_source_get_type_once (void);
static void _vala_gala_icon_resource_icon_source_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_gala_icon_resource_icon_source_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static GType gala_icon_icon_source_get_type_once (void);
static GObject * gala_icon_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties);
static void _gala_icon_load_pixbuf_g_object_notify (GObject* _sender,
                                             GParamSpec* pspec,
                                             gpointer self);
static void _gala_icon_load_pixbuf_clutter_actor_resource_scale_changed (ClutterActor* _sender,
                                                                  gpointer self);
static void gala_icon_finalize (GObject * obj);
static GType gala_icon_get_type_once (void);
static void _vala_gala_icon_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec);
static void _vala_gala_icon_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec);

static inline gpointer
gala_icon_get_instance_private (GalaIcon* self)
{
	return G_STRUCT_MEMBER_P (self, GalaIcon_private_offset);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

GalaIcon*
gala_icon_construct (GType object_type,
                     gint icon_size,
                     gfloat monitor_scale)
{
	GalaIcon * self = NULL;
	self = (GalaIcon*) g_object_new (object_type, "icon-size", icon_size, "monitor-scale", monitor_scale, NULL);
	return self;
}

GalaIcon*
gala_icon_new (gint icon_size,
               gfloat monitor_scale)
{
	return gala_icon_construct (GALA_TYPE_ICON, icon_size, monitor_scale);
}

GalaIcon*
gala_icon_construct_from_resource (GType object_type,
                                   gint icon_size,
                                   gfloat monitor_scale,
                                   const gchar* resource_path)
{
	GalaIcon * self = NULL;
	g_return_val_if_fail (resource_path != NULL, NULL);
	self = (GalaIcon*) g_object_new (object_type, "icon-size", icon_size, "monitor-scale", monitor_scale, "resource-path", resource_path, NULL);
	return self;
}

GalaIcon*
gala_icon_new_from_resource (gint icon_size,
                             gfloat monitor_scale,
                             const gchar* resource_path)
{
	return gala_icon_construct_from_resource (GALA_TYPE_ICON, icon_size, monitor_scale, resource_path);
}

static void
gala_icon_load_pixbuf (GalaIcon* self)
{
	gint actor_size = 0;
	gint _tmp0_;
	gfloat _tmp1_;
	gfloat scale = 0.0F;
	gfloat _tmp2_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_icon_size;
	_tmp1_ = self->priv->_monitor_scale;
	actor_size = gala_utils_scale_to_int (_tmp0_, _tmp1_);
	clutter_actor_set_size ((ClutterActor*) self, (gfloat) actor_size, (gfloat) actor_size);
	_tmp2_ = self->priv->_monitor_scale;
	scale = _tmp2_ * clutter_actor_get_resource_scale ((ClutterActor*) self);
	{
		GdkPixbuf* pixbuf = NULL;
		gint _tmp3_;
		GdkPixbuf* _tmp4_;
		GalaImage* _tmp5_;
		GalaImage* _tmp6_;
		_tmp3_ = self->priv->_icon_size;
		_tmp4_ = gala_icon_get_pixbuf (self, _tmp3_, scale, &_inner_error0_);
		pixbuf = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp5_ = gala_image_new_from_pixbuf_with_size (actor_size, actor_size, pixbuf);
		_tmp6_ = _tmp5_;
		clutter_actor_set_content ((ClutterActor*) self, (ClutterContent*) _tmp6_);
		_g_object_unref0 (_tmp6_);
		clutter_actor_set_background_color ((ClutterActor*) self, NULL);
		_g_object_unref0 (pixbuf);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		ClutterColor _tmp9_ = {0};
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		g_critical ("Icon.vala:109: Could not load icon pixbuf: %s", _tmp8_);
		_tmp9_.red = (guint8) 255;
		_tmp9_.green = (guint8) 0;
		_tmp9_.blue = (guint8) 0;
		_tmp9_.alpha = (guint8) 255;
		clutter_actor_set_background_color ((ClutterActor*) self, &_tmp9_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

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

static GdkPixbuf*
gala_icon_get_pixbuf (GalaIcon* self,
                      gint size,
                      gfloat scale,
                      GError** error)
{
	gchar* cache_key = NULL;
	GalaIconIconSource* _tmp0_;
	GalaIconIconSource* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	GHashTable* _tmp9_;
	const gchar* _tmp10_;
	GHashTable* _tmp19_;
	const gchar* _tmp20_;
	gconstpointer _tmp21_;
	GdkPixbuf* _tmp22_;
	GError* _inner_error0_ = NULL;
	GdkPixbuf* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gala_icon_get_source (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gala_icon_icon_source_get_cache_key (_tmp1_, size, scale);
	cache_key = _tmp2_;
	_tmp3_ = cache_key;
	if (_tmp3_ == NULL) {
		GdkPixbuf* _tmp4_ = NULL;
		GalaIconIconSource* _tmp5_;
		GalaIconIconSource* _tmp6_;
		GdkPixbuf* _tmp7_;
		GdkPixbuf* _tmp8_;
		_tmp5_ = gala_icon_get_source (self);
		_tmp6_ = _tmp5_;
		_tmp7_ = gala_icon_icon_source_create_pixbuf (_tmp6_, size, scale, &_inner_error0_);
		_tmp4_ = _tmp7_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (cache_key);
			return NULL;
		}
		_tmp8_ = _tmp4_;
		_tmp4_ = NULL;
		result = _tmp8_;
		_g_object_unref0 (_tmp4_);
		_g_free0 (cache_key);
		return result;
	}
	_tmp9_ = gala_icon_icon_pixbufs;
	_tmp10_ = cache_key;
	if (!g_hash_table_contains (_tmp9_, _tmp10_)) {
		GdkPixbuf* _tmp11_ = NULL;
		GalaIconIconSource* _tmp12_;
		GalaIconIconSource* _tmp13_;
		GdkPixbuf* _tmp14_;
		GHashTable* _tmp15_;
		const gchar* _tmp16_;
		gchar* _tmp17_;
		GdkPixbuf* _tmp18_;
		_tmp12_ = gala_icon_get_source (self);
		_tmp13_ = _tmp12_;
		_tmp14_ = gala_icon_icon_source_create_pixbuf (_tmp13_, size, scale, &_inner_error0_);
		_tmp11_ = _tmp14_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (cache_key);
			return NULL;
		}
		_tmp15_ = gala_icon_icon_pixbufs;
		_tmp16_ = cache_key;
		_tmp17_ = g_strdup (_tmp16_);
		_tmp18_ = _tmp11_;
		_tmp11_ = NULL;
		g_hash_table_insert (_tmp15_, _tmp17_, _tmp18_);
		_g_object_unref0 (_tmp11_);
	}
	_tmp19_ = gala_icon_icon_pixbufs;
	_tmp20_ = cache_key;
	_tmp21_ = g_hash_table_lookup (_tmp19_, _tmp20_);
	_tmp22_ = _g_object_ref0 ((GdkPixbuf*) _tmp21_);
	result = _tmp22_;
	_g_free0 (cache_key);
	return result;
}

gint
gala_icon_get_icon_size (GalaIcon* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_icon_size;
	return result;
}

void
gala_icon_set_icon_size (GalaIcon* self,
                         gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_icon_get_icon_size (self);
	if (old_value != value) {
		self->priv->_icon_size = value;
		g_object_notify_by_pspec ((GObject *) self, gala_icon_properties[GALA_ICON_ICON_SIZE_PROPERTY]);
	}
}

gfloat
gala_icon_get_monitor_scale (GalaIcon* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, 0.0F);
	result = self->priv->_monitor_scale;
	return result;
}

void
gala_icon_set_monitor_scale (GalaIcon* self,
                             gfloat value)
{
	gfloat old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_icon_get_monitor_scale (self);
	if (old_value != value) {
		self->priv->_monitor_scale = value;
		g_object_notify_by_pspec ((GObject *) self, gala_icon_properties[GALA_ICON_MONITOR_SCALE_PROPERTY]);
	}
}

void
gala_icon_set_resource_path (GalaIcon* self,
                             const gchar* value)
{
	GalaIconResourceIconSource* _tmp0_;
	GalaIconResourceIconSource* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gala_icon_resource_icon_source_new (value);
	_tmp1_ = _tmp0_;
	gala_icon_set_source (self, (GalaIconIconSource*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	g_object_notify_by_pspec ((GObject *) self, gala_icon_properties[GALA_ICON_RESOURCE_PATH_PROPERTY]);
}

void
gala_icon_set_gicon (GalaIcon* self,
                     GIcon* value)
{
	GalaIconGIconSource* _tmp0_;
	GalaIconGIconSource* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gala_icon_gicon_source_new (value);
	_tmp1_ = _tmp0_;
	gala_icon_set_source (self, (GalaIconIconSource*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	g_object_notify_by_pspec ((GObject *) self, gala_icon_properties[GALA_ICON_GICON_PROPERTY]);
}

static GalaIconIconSource*
gala_icon_get_source (GalaIcon* self)
{
	GalaIconIconSource* result;
	GalaIconIconSource* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source;
	result = _tmp0_;
	return result;
}

static void
gala_icon_set_source (GalaIcon* self,
                      GalaIconIconSource* value)
{
	GalaIconIconSource* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_source);
	self->priv->_source = _tmp0_;
	gala_icon_load_pixbuf (self);
}

static inline gpointer
gala_icon_gicon_source_get_instance_private (GalaIconGIconSource* self)
{
	return G_STRUCT_MEMBER_P (self, GalaIconGIconSource_private_offset);
}

static GalaIconGIconSource*
gala_icon_gicon_source_construct (GType object_type,
                                  GIcon* gicon)
{
	GalaIconGIconSource * self = NULL;
	g_return_val_if_fail (gicon != NULL, NULL);
	self = (GalaIconGIconSource*) g_object_new (object_type, "gicon", gicon, NULL);
	return self;
}

static GalaIconGIconSource*
gala_icon_gicon_source_new (GIcon* gicon)
{
	return gala_icon_gicon_source_construct (GALA_ICON_TYPE_GICON_SOURCE, gicon);
}

static gchar*
gala_icon_gicon_source_real_get_cache_key (GalaIconIconSource* base,
                                           gint size,
                                           gfloat scale)
{
	GalaIconGIconSource * self;
	gchar* gicon_str = NULL;
	GIcon* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_;
	gchar* result;
	self = (GalaIconGIconSource*) base;
	_tmp0_ = self->priv->_gicon;
	_tmp1_ = g_icon_to_string (_tmp0_);
	gicon_str = _tmp1_;
	_tmp3_ = gicon_str;
	if (_tmp3_ != NULL) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = gicon_str;
		_tmp5_ = g_strdup_printf ("gicon-%s-%d-%f", _tmp4_, size, (gdouble) scale);
		_g_free0 (_tmp2_);
		_tmp2_ = _tmp5_;
	} else {
		_g_free0 (_tmp2_);
		_tmp2_ = NULL;
	}
	result = _tmp2_;
	_g_free0 (gicon_str);
	return result;
}

static GdkPixbuf*
gala_icon_gicon_source_real_create_pixbuf (GalaIconIconSource* base,
                                           gint size,
                                           gfloat scale,
                                           GError** error)
{
	GalaIconGIconSource * self;
	GtkIconPaintable* icon_paintable = NULL;
	GtkIconTheme* _tmp0_;
	GIcon* _tmp1_;
	GtkIconPaintable* _tmp2_;
	GtkIconPaintable* _tmp3_ = NULL;
	GtkIconPaintable* _tmp4_;
	GFile* _tmp5_ = NULL;
	GFile* file = NULL;
	GFile* _tmp8_;
	GFile* _tmp9_;
	GFileInputStream* _tmp11_ = NULL;
	GFile* _tmp12_;
	GFileInputStream* _tmp13_;
	GdkPixbuf* _tmp14_ = NULL;
	GdkPixbuf* _tmp15_;
	GdkPixbuf* _tmp16_;
	GError* _inner_error0_ = NULL;
	GdkPixbuf* result;
	self = (GalaIconGIconSource*) base;
	_tmp0_ = gala_icon_gicon_source_icon_theme;
	_tmp1_ = self->priv->_gicon;
	_tmp2_ = gtk_icon_theme_lookup_by_gicon (_tmp0_, _tmp1_, size, (gint) ceilf (scale), GTK_TEXT_DIR_NONE, 0);
	icon_paintable = _tmp2_;
	_tmp4_ = icon_paintable;
	_tmp3_ = _tmp4_;
	_tmp5_ = NULL;
	if (_tmp3_ != NULL) {
		GFile* _tmp6_;
		GFile* _tmp7_;
		_tmp6_ = gtk_icon_paintable_get_file (_tmp3_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		_tmp5_ = _tmp7_;
	}
	_tmp8_ = _tmp5_;
	_tmp5_ = NULL;
	file = _tmp8_;
	_tmp9_ = file;
	if (_tmp9_ == NULL) {
		GError* _tmp10_;
		_tmp10_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, "Icon paintable has no file");
		_inner_error0_ = _tmp10_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (file);
		_g_object_unref0 (_tmp5_);
		_g_object_unref0 (icon_paintable);
		return NULL;
	}
	_tmp12_ = file;
	_tmp13_ = g_file_read (_tmp12_, NULL, &_inner_error0_);
	_tmp11_ = _tmp13_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (file);
		_g_object_unref0 (_tmp5_);
		_g_object_unref0 (icon_paintable);
		return NULL;
	}
	_tmp15_ = gdk_pixbuf_new_from_stream_at_scale ((GInputStream*) _tmp11_, -1, gala_icon_icon_source_get_texture_size (size, scale), TRUE, NULL, &_inner_error0_);
	_tmp14_ = _tmp15_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (file);
		_g_object_unref0 (_tmp5_);
		_g_object_unref0 (icon_paintable);
		return NULL;
	}
	_tmp16_ = _tmp14_;
	_tmp14_ = NULL;
	result = _tmp16_;
	_g_object_unref0 (_tmp14_);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (file);
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (icon_paintable);
	return result;
}

static GIcon*
gala_icon_gicon_source_get_gicon (GalaIconGIconSource* self)
{
	GIcon* result;
	GIcon* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_gicon;
	result = _tmp0_;
	return result;
}

static void
gala_icon_gicon_source_set_gicon (GalaIconGIconSource* self,
                                  GIcon* value)
{
	GIcon* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_icon_gicon_source_get_gicon (self);
	if (old_value != value) {
		GIcon* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_gicon);
		self->priv->_gicon = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_icon_gicon_source_properties[GALA_ICON_GICON_SOURCE_GICON_PROPERTY]);
	}
}

static void
gala_icon_gicon_source_class_init (GalaIconGIconSourceClass * klass,
                                   gpointer klass_data)
{
	gchar* _tmp0_;
	GtkIconTheme* _tmp1_ = NULL;
	gala_icon_gicon_source_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaIconGIconSource_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_icon_gicon_source_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_icon_gicon_source_set_property;
	G_OBJECT_CLASS (klass)->finalize = gala_icon_gicon_source_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_ICON_GICON_SOURCE_GICON_PROPERTY, gala_icon_gicon_source_properties[GALA_ICON_GICON_SOURCE_GICON_PROPERTY] = g_param_spec_object ("gicon", "gicon", "gicon", g_icon_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	_tmp0_ = g_strdup ("elementary");
	_tmp1_ = gtk_icon_theme_new ();
	gtk_icon_theme_set_theme_name (_tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	gala_icon_gicon_source_icon_theme = _tmp1_;
}

static void
gala_icon_gicon_source_gala_icon_icon_source_interface_init (GalaIconIconSourceIface * iface,
                                                             gpointer iface_data)
{
	gala_icon_gicon_source_gala_icon_icon_source_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_cache_key = (gchar* (*) (GalaIconIconSource*, gint, gfloat)) gala_icon_gicon_source_real_get_cache_key;
	iface->create_pixbuf = (GdkPixbuf* (*) (GalaIconIconSource*, gint, gfloat, GError**)) gala_icon_gicon_source_real_create_pixbuf;
}

static void
gala_icon_gicon_source_instance_init (GalaIconGIconSource * self,
                                      gpointer klass)
{
	self->priv = gala_icon_gicon_source_get_instance_private (self);
}

static void
gala_icon_gicon_source_finalize (GObject * obj)
{
	GalaIconGIconSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_ICON_TYPE_GICON_SOURCE, GalaIconGIconSource);
	_g_object_unref0 (self->priv->_gicon);
	G_OBJECT_CLASS (gala_icon_gicon_source_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_icon_gicon_source_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaIconGIconSourceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_icon_gicon_source_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaIconGIconSource), 0, (GInstanceInitFunc) gala_icon_gicon_source_instance_init, NULL };
	static const GInterfaceInfo gala_icon_icon_source_info = { (GInterfaceInitFunc) gala_icon_gicon_source_gala_icon_icon_source_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gala_icon_gicon_source_type_id;
	gala_icon_gicon_source_type_id = g_type_register_static (G_TYPE_OBJECT, "GalaIconGIconSource", &g_define_type_info, 0);
	g_type_add_interface_static (gala_icon_gicon_source_type_id, GALA_ICON_TYPE_ICON_SOURCE, &gala_icon_icon_source_info);
	GalaIconGIconSource_private_offset = g_type_add_instance_private (gala_icon_gicon_source_type_id, sizeof (GalaIconGIconSourcePrivate));
	return gala_icon_gicon_source_type_id;
}

static GType
gala_icon_gicon_source_get_type (void)
{
	static gsize gala_icon_gicon_source_type_id__once = 0;
	if (g_once_init_enter (&gala_icon_gicon_source_type_id__once)) {
		GType gala_icon_gicon_source_type_id;
		gala_icon_gicon_source_type_id = gala_icon_gicon_source_get_type_once ();
		g_once_init_leave (&gala_icon_gicon_source_type_id__once, gala_icon_gicon_source_type_id);
	}
	return gala_icon_gicon_source_type_id__once;
}

static void
_vala_gala_icon_gicon_source_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	GalaIconGIconSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_ICON_TYPE_GICON_SOURCE, GalaIconGIconSource);
	switch (property_id) {
		case GALA_ICON_GICON_SOURCE_GICON_PROPERTY:
		g_value_set_object (value, gala_icon_gicon_source_get_gicon (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_icon_gicon_source_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	GalaIconGIconSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_ICON_TYPE_GICON_SOURCE, GalaIconGIconSource);
	switch (property_id) {
		case GALA_ICON_GICON_SOURCE_GICON_PROPERTY:
		gala_icon_gicon_source_set_gicon (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
gala_icon_resource_icon_source_get_instance_private (GalaIconResourceIconSource* self)
{
	return G_STRUCT_MEMBER_P (self, GalaIconResourceIconSource_private_offset);
}

static GalaIconResourceIconSource*
gala_icon_resource_icon_source_construct (GType object_type,
                                          const gchar* path)
{
	GalaIconResourceIconSource * self = NULL;
	g_return_val_if_fail (path != NULL, NULL);
	self = (GalaIconResourceIconSource*) g_object_new (object_type, "path", path, NULL);
	return self;
}

static GalaIconResourceIconSource*
gala_icon_resource_icon_source_new (const gchar* path)
{
	return gala_icon_resource_icon_source_construct (GALA_ICON_TYPE_RESOURCE_ICON_SOURCE, path);
}

static gchar*
gala_icon_resource_icon_source_real_get_cache_key (GalaIconIconSource* base,
                                                   gint size,
                                                   gfloat scale)
{
	GalaIconResourceIconSource * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = (GalaIconResourceIconSource*) base;
	_tmp0_ = self->priv->_path;
	_tmp1_ = g_strdup_printf ("%s-%d", _tmp0_, gala_icon_icon_source_get_texture_size (size, scale));
	result = _tmp1_;
	return result;
}

static GdkPixbuf*
gala_icon_resource_icon_source_real_create_pixbuf (GalaIconIconSource* base,
                                                   gint size,
                                                   gfloat scale,
                                                   GError** error)
{
	GalaIconResourceIconSource * self;
	GdkPixbuf* _tmp0_ = NULL;
	const gchar* _tmp1_;
	GdkPixbuf* _tmp2_;
	GdkPixbuf* _tmp3_;
	GError* _inner_error0_ = NULL;
	GdkPixbuf* result;
	self = (GalaIconResourceIconSource*) base;
	_tmp1_ = self->priv->_path;
	_tmp2_ = gdk_pixbuf_new_from_resource_at_scale (_tmp1_, -1, gala_icon_icon_source_get_texture_size (size, scale), TRUE, &_inner_error0_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp3_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static const gchar*
gala_icon_resource_icon_source_get_path (GalaIconResourceIconSource* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_path;
	result = _tmp0_;
	return result;
}

static void
gala_icon_resource_icon_source_set_path (GalaIconResourceIconSource* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_icon_resource_icon_source_get_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_path);
		self->priv->_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_icon_resource_icon_source_properties[GALA_ICON_RESOURCE_ICON_SOURCE_PATH_PROPERTY]);
	}
}

static void
gala_icon_resource_icon_source_class_init (GalaIconResourceIconSourceClass * klass,
                                           gpointer klass_data)
{
	gala_icon_resource_icon_source_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaIconResourceIconSource_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_icon_resource_icon_source_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_icon_resource_icon_source_set_property;
	G_OBJECT_CLASS (klass)->finalize = gala_icon_resource_icon_source_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_ICON_RESOURCE_ICON_SOURCE_PATH_PROPERTY, gala_icon_resource_icon_source_properties[GALA_ICON_RESOURCE_ICON_SOURCE_PATH_PROPERTY] = g_param_spec_string ("path", "path", "path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
gala_icon_resource_icon_source_gala_icon_icon_source_interface_init (GalaIconIconSourceIface * iface,
                                                                     gpointer iface_data)
{
	gala_icon_resource_icon_source_gala_icon_icon_source_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_cache_key = (gchar* (*) (GalaIconIconSource*, gint, gfloat)) gala_icon_resource_icon_source_real_get_cache_key;
	iface->create_pixbuf = (GdkPixbuf* (*) (GalaIconIconSource*, gint, gfloat, GError**)) gala_icon_resource_icon_source_real_create_pixbuf;
}

static void
gala_icon_resource_icon_source_instance_init (GalaIconResourceIconSource * self,
                                              gpointer klass)
{
	self->priv = gala_icon_resource_icon_source_get_instance_private (self);
}

static void
gala_icon_resource_icon_source_finalize (GObject * obj)
{
	GalaIconResourceIconSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_ICON_TYPE_RESOURCE_ICON_SOURCE, GalaIconResourceIconSource);
	_g_free0 (self->priv->_path);
	G_OBJECT_CLASS (gala_icon_resource_icon_source_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_icon_resource_icon_source_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaIconResourceIconSourceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_icon_resource_icon_source_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaIconResourceIconSource), 0, (GInstanceInitFunc) gala_icon_resource_icon_source_instance_init, NULL };
	static const GInterfaceInfo gala_icon_icon_source_info = { (GInterfaceInitFunc) gala_icon_resource_icon_source_gala_icon_icon_source_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gala_icon_resource_icon_source_type_id;
	gala_icon_resource_icon_source_type_id = g_type_register_static (G_TYPE_OBJECT, "GalaIconResourceIconSource", &g_define_type_info, 0);
	g_type_add_interface_static (gala_icon_resource_icon_source_type_id, GALA_ICON_TYPE_ICON_SOURCE, &gala_icon_icon_source_info);
	GalaIconResourceIconSource_private_offset = g_type_add_instance_private (gala_icon_resource_icon_source_type_id, sizeof (GalaIconResourceIconSourcePrivate));
	return gala_icon_resource_icon_source_type_id;
}

static GType
gala_icon_resource_icon_source_get_type (void)
{
	static gsize gala_icon_resource_icon_source_type_id__once = 0;
	if (g_once_init_enter (&gala_icon_resource_icon_source_type_id__once)) {
		GType gala_icon_resource_icon_source_type_id;
		gala_icon_resource_icon_source_type_id = gala_icon_resource_icon_source_get_type_once ();
		g_once_init_leave (&gala_icon_resource_icon_source_type_id__once, gala_icon_resource_icon_source_type_id);
	}
	return gala_icon_resource_icon_source_type_id__once;
}

static void
_vala_gala_icon_resource_icon_source_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	GalaIconResourceIconSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_ICON_TYPE_RESOURCE_ICON_SOURCE, GalaIconResourceIconSource);
	switch (property_id) {
		case GALA_ICON_RESOURCE_ICON_SOURCE_PATH_PROPERTY:
		g_value_set_string (value, gala_icon_resource_icon_source_get_path (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_icon_resource_icon_source_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	GalaIconResourceIconSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_ICON_TYPE_RESOURCE_ICON_SOURCE, GalaIconResourceIconSource);
	switch (property_id) {
		case GALA_ICON_RESOURCE_ICON_SOURCE_PATH_PROPERTY:
		gala_icon_resource_icon_source_set_path (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

gchar*
gala_icon_icon_source_get_cache_key (GalaIconIconSource* self,
                                     gint size,
                                     gfloat scale)
{
	GalaIconIconSourceIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GALA_ICON_ICON_SOURCE_GET_INTERFACE (self);
	if (_iface_->get_cache_key) {
		return _iface_->get_cache_key (self, size, scale);
	}
	return NULL;
}

/**
         * Should look up the icon for the given size (e.g. if there are more detailed icons
         * for larger sizes) and return a texture of size * scale.
         */
GdkPixbuf*
gala_icon_icon_source_create_pixbuf (GalaIconIconSource* self,
                                     gint size,
                                     gfloat scale,
                                     GError** error)
{
	GalaIconIconSourceIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GALA_ICON_ICON_SOURCE_GET_INTERFACE (self);
	if (_iface_->create_pixbuf) {
		return _iface_->create_pixbuf (self, size, scale, error);
	}
	return NULL;
}

static gint
gala_icon_icon_source_get_texture_size (gint size,
                                        gfloat scale)
{
	gint result;
	result = (gint) ceilf (size * scale);
	return result;
}

static void
gala_icon_icon_source_default_init (GalaIconIconSourceIface * iface,
                                    gpointer iface_data)
{
}

 G_GNUC_NO_INLINE static GType
gala_icon_icon_source_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaIconIconSourceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_icon_icon_source_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gala_icon_icon_source_type_id;
	gala_icon_icon_source_type_id = g_type_register_static (G_TYPE_INTERFACE, "GalaIconIconSource", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (gala_icon_icon_source_type_id, G_TYPE_OBJECT);
	return gala_icon_icon_source_type_id;
}

static GType
gala_icon_icon_source_get_type (void)
{
	static gsize gala_icon_icon_source_type_id__once = 0;
	if (g_once_init_enter (&gala_icon_icon_source_type_id__once)) {
		GType gala_icon_icon_source_type_id;
		gala_icon_icon_source_type_id = gala_icon_icon_source_get_type_once ();
		g_once_init_leave (&gala_icon_icon_source_type_id__once, gala_icon_icon_source_type_id);
	}
	return gala_icon_icon_source_type_id__once;
}

static void
_gala_icon_load_pixbuf_g_object_notify (GObject* _sender,
                                        GParamSpec* pspec,
                                        gpointer self)
{
	gala_icon_load_pixbuf ((GalaIcon*) self);
}

static void
_gala_icon_load_pixbuf_clutter_actor_resource_scale_changed (ClutterActor* _sender,
                                                             gpointer self)
{
	gala_icon_load_pixbuf ((GalaIcon*) self);
}

static GObject *
gala_icon_constructor (GType type,
                       guint n_construct_properties,
                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaIcon * self;
	parent_class = G_OBJECT_CLASS (gala_icon_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_ICON, GalaIcon);
	g_signal_connect_object ((GObject*) self, "notify::icon-size", (GCallback) _gala_icon_load_pixbuf_g_object_notify, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::monitor-scale", (GCallback) _gala_icon_load_pixbuf_g_object_notify, self, 0);
	g_signal_connect_object ((ClutterActor*) self, "resource-scale-changed", (GCallback) _gala_icon_load_pixbuf_clutter_actor_resource_scale_changed, self, 0);
	return obj;
}

static void
gala_icon_class_init (GalaIconClass * klass,
                      gpointer klass_data)
{
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	gala_icon_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaIcon_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_icon_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_icon_set_property;
	G_OBJECT_CLASS (klass)->constructor = gala_icon_constructor;
	G_OBJECT_CLASS (klass)->finalize = gala_icon_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_ICON_ICON_SIZE_PROPERTY, gala_icon_properties[GALA_ICON_ICON_SIZE_PROPERTY] = g_param_spec_int ("icon-size", "icon-size", "icon-size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_ICON_MONITOR_SCALE_PROPERTY, gala_icon_properties[GALA_ICON_MONITOR_SCALE_PROPERTY] = g_param_spec_float ("monitor-scale", "monitor-scale", "monitor-scale", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_ICON_RESOURCE_PATH_PROPERTY, gala_icon_properties[GALA_ICON_RESOURCE_PATH_PROPERTY] = g_param_spec_string ("resource-path", "resource-path", "resource-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_ICON_GICON_PROPERTY, gala_icon_properties[GALA_ICON_GICON_PROPERTY] = g_param_spec_object ("gicon", "gicon", "gicon", g_icon_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_object_unref0_);
	gala_icon_icon_pixbufs = _tmp2_;
}

static void
gala_icon_instance_init (GalaIcon * self,
                         gpointer klass)
{
	self->priv = gala_icon_get_instance_private (self);
}

static void
gala_icon_finalize (GObject * obj)
{
	GalaIcon * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_ICON, GalaIcon);
	_g_object_unref0 (self->priv->_source);
	G_OBJECT_CLASS (gala_icon_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_icon_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaIconClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_icon_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaIcon), 0, (GInstanceInitFunc) gala_icon_instance_init, NULL };
	GType gala_icon_type_id;
	gala_icon_type_id = g_type_register_static (clutter_actor_get_type (), "GalaIcon", &g_define_type_info, 0);
	GalaIcon_private_offset = g_type_add_instance_private (gala_icon_type_id, sizeof (GalaIconPrivate));
	return gala_icon_type_id;
}

GType
gala_icon_get_type (void)
{
	static gsize gala_icon_type_id__once = 0;
	if (g_once_init_enter (&gala_icon_type_id__once)) {
		GType gala_icon_type_id;
		gala_icon_type_id = gala_icon_get_type_once ();
		g_once_init_leave (&gala_icon_type_id__once, gala_icon_type_id);
	}
	return gala_icon_type_id__once;
}

static void
_vala_gala_icon_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec)
{
	GalaIcon * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_ICON, GalaIcon);
	switch (property_id) {
		case GALA_ICON_ICON_SIZE_PROPERTY:
		g_value_set_int (value, gala_icon_get_icon_size (self));
		break;
		case GALA_ICON_MONITOR_SCALE_PROPERTY:
		g_value_set_float (value, gala_icon_get_monitor_scale (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_icon_set_property (GObject * object,
                              guint property_id,
                              const GValue * value,
                              GParamSpec * pspec)
{
	GalaIcon * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_ICON, GalaIcon);
	switch (property_id) {
		case GALA_ICON_ICON_SIZE_PROPERTY:
		gala_icon_set_icon_size (self, g_value_get_int (value));
		break;
		case GALA_ICON_MONITOR_SCALE_PROPERTY:
		gala_icon_set_monitor_scale (self, g_value_get_float (value));
		break;
		case GALA_ICON_RESOURCE_PATH_PROPERTY:
		gala_icon_set_resource_path (self, g_value_get_string (value));
		break;
		case GALA_ICON_GICON_PROPERTY:
		gala_icon_set_gicon (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

