/* rygel-icon-info.c generated by valac 0.17.2.19-5f50d, the Vala compiler
 * generated from rygel-icon-info.vala, do not modify */

/*
 * Copyright (C) 2008 Nokia Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>


#define RYGEL_TYPE_ICON_INFO (rygel_icon_info_get_type ())
#define RYGEL_ICON_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_ICON_INFO, RygelIconInfo))
#define RYGEL_ICON_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_ICON_INFO, RygelIconInfoClass))
#define RYGEL_IS_ICON_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_ICON_INFO))
#define RYGEL_IS_ICON_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_ICON_INFO))
#define RYGEL_ICON_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_ICON_INFO, RygelIconInfoClass))

typedef struct _RygelIconInfo RygelIconInfo;
typedef struct _RygelIconInfoClass RygelIconInfoClass;
typedef struct _RygelIconInfoPrivate RygelIconInfoPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _RygelParamSpecIconInfo RygelParamSpecIconInfo;

struct _RygelIconInfo {
	GTypeInstance parent_instance;
	volatile int ref_count;
	RygelIconInfoPrivate * priv;
	gchar* mime_type;
	gchar* uri;
	gchar* file_extension;
	gint64 size;
	gint width;
	gint height;
	gint depth;
};

struct _RygelIconInfoClass {
	GTypeClass parent_class;
	void (*finalize) (RygelIconInfo *self);
};

struct _RygelParamSpecIconInfo {
	GParamSpec parent_instance;
};


static gpointer rygel_icon_info_parent_class = NULL;

gpointer rygel_icon_info_ref (gpointer instance);
void rygel_icon_info_unref (gpointer instance);
GParamSpec* rygel_param_spec_icon_info (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_value_set_icon_info (GValue* value, gpointer v_object);
void rygel_value_take_icon_info (GValue* value, gpointer v_object);
gpointer rygel_value_get_icon_info (const GValue* value);
GType rygel_icon_info_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_ICON_INFO_DUMMY_PROPERTY
};
RygelIconInfo* rygel_icon_info_new (const gchar* mime_type, const gchar* file_extension);
RygelIconInfo* rygel_icon_info_construct (GType object_type, const gchar* mime_type, const gchar* file_extension);
static void rygel_icon_info_finalize (RygelIconInfo* obj);


RygelIconInfo* rygel_icon_info_construct (GType object_type, const gchar* mime_type, const gchar* file_extension) {
	RygelIconInfo* self = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
#line 37 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	g_return_val_if_fail (mime_type != NULL, NULL);
#line 37 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	g_return_val_if_fail (file_extension != NULL, NULL);
#line 37 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self = (RygelIconInfo*) g_type_create_instance (object_type);
#line 38 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_tmp0_ = mime_type;
#line 38 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 38 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_g_free0 (self->mime_type);
#line 38 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self->mime_type = _tmp1_;
#line 39 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_tmp2_ = file_extension;
#line 39 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_tmp3_ = g_strdup (_tmp2_);
#line 39 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_g_free0 (self->file_extension);
#line 39 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self->file_extension = _tmp3_;
#line 37 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	return self;
#line 118 "rygel-icon-info.c"
}


RygelIconInfo* rygel_icon_info_new (const gchar* mime_type, const gchar* file_extension) {
#line 37 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	return rygel_icon_info_construct (RYGEL_TYPE_ICON_INFO, mime_type, file_extension);
#line 125 "rygel-icon-info.c"
}


static void rygel_value_icon_info_init (GValue* value) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	value->data[0].v_pointer = NULL;
#line 132 "rygel-icon-info.c"
}


static void rygel_value_icon_info_free_value (GValue* value) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (value->data[0].v_pointer) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		rygel_icon_info_unref (value->data[0].v_pointer);
#line 141 "rygel-icon-info.c"
	}
}


static void rygel_value_icon_info_copy_value (const GValue* src_value, GValue* dest_value) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (src_value->data[0].v_pointer) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		dest_value->data[0].v_pointer = rygel_icon_info_ref (src_value->data[0].v_pointer);
#line 151 "rygel-icon-info.c"
	} else {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		dest_value->data[0].v_pointer = NULL;
#line 155 "rygel-icon-info.c"
	}
}


static gpointer rygel_value_icon_info_peek_pointer (const GValue* value) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	return value->data[0].v_pointer;
#line 163 "rygel-icon-info.c"
}


static gchar* rygel_value_icon_info_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (collect_values[0].v_pointer) {
#line 170 "rygel-icon-info.c"
		RygelIconInfo* object;
		object = collect_values[0].v_pointer;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		if (object->parent_instance.g_class == NULL) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 177 "rygel-icon-info.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 181 "rygel-icon-info.c"
		}
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		value->data[0].v_pointer = rygel_icon_info_ref (object);
#line 185 "rygel-icon-info.c"
	} else {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		value->data[0].v_pointer = NULL;
#line 189 "rygel-icon-info.c"
	}
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	return NULL;
#line 193 "rygel-icon-info.c"
}


static gchar* rygel_value_icon_info_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	RygelIconInfo** object_p;
	object_p = collect_values[0].v_pointer;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (!object_p) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 204 "rygel-icon-info.c"
	}
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (!value->data[0].v_pointer) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		*object_p = NULL;
#line 210 "rygel-icon-info.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		*object_p = value->data[0].v_pointer;
#line 214 "rygel-icon-info.c"
	} else {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		*object_p = rygel_icon_info_ref (value->data[0].v_pointer);
#line 218 "rygel-icon-info.c"
	}
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	return NULL;
#line 222 "rygel-icon-info.c"
}


GParamSpec* rygel_param_spec_icon_info (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	RygelParamSpecIconInfo* spec;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	g_return_val_if_fail (g_type_is_a (object_type, RYGEL_TYPE_ICON_INFO), NULL);
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	return G_PARAM_SPEC (spec);
#line 236 "rygel-icon-info.c"
}


gpointer rygel_value_get_icon_info (const GValue* value) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_TYPE_ICON_INFO), NULL);
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	return value->data[0].v_pointer;
#line 245 "rygel-icon-info.c"
}


void rygel_value_set_icon_info (GValue* value, gpointer v_object) {
	RygelIconInfo* old;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_TYPE_ICON_INFO));
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	old = value->data[0].v_pointer;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (v_object) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_TYPE_ICON_INFO));
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		value->data[0].v_pointer = v_object;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		rygel_icon_info_ref (value->data[0].v_pointer);
#line 265 "rygel-icon-info.c"
	} else {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		value->data[0].v_pointer = NULL;
#line 269 "rygel-icon-info.c"
	}
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (old) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		rygel_icon_info_unref (old);
#line 275 "rygel-icon-info.c"
	}
}


void rygel_value_take_icon_info (GValue* value, gpointer v_object) {
	RygelIconInfo* old;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_TYPE_ICON_INFO));
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	old = value->data[0].v_pointer;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (v_object) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_TYPE_ICON_INFO));
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		value->data[0].v_pointer = v_object;
#line 294 "rygel-icon-info.c"
	} else {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		value->data[0].v_pointer = NULL;
#line 298 "rygel-icon-info.c"
	}
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (old) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		rygel_icon_info_unref (old);
#line 304 "rygel-icon-info.c"
	}
}


static void rygel_icon_info_class_init (RygelIconInfoClass * klass) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	rygel_icon_info_parent_class = g_type_class_peek_parent (klass);
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	RYGEL_ICON_INFO_CLASS (klass)->finalize = rygel_icon_info_finalize;
#line 314 "rygel-icon-info.c"
}


static void rygel_icon_info_instance_init (RygelIconInfo * self) {
#line 32 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self->size = (gint64) (-1);
#line 33 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self->width = -1;
#line 34 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self->height = -1;
#line 35 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self->depth = -1;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self->ref_count = 1;
#line 329 "rygel-icon-info.c"
}


static void rygel_icon_info_finalize (RygelIconInfo* obj) {
	RygelIconInfo * self;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_ICON_INFO, RygelIconInfo);
#line 28 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_g_free0 (self->mime_type);
#line 29 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_g_free0 (self->uri);
#line 30 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	_g_free0 (self->file_extension);
#line 343 "rygel-icon-info.c"
}


/**
 * Holds information about an icon.
 */
GType rygel_icon_info_get_type (void) {
	static volatile gsize rygel_icon_info_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_icon_info_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { rygel_value_icon_info_init, rygel_value_icon_info_free_value, rygel_value_icon_info_copy_value, rygel_value_icon_info_peek_pointer, "p", rygel_value_icon_info_collect_value, "p", rygel_value_icon_info_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (RygelIconInfoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_icon_info_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelIconInfo), 0, (GInstanceInitFunc) rygel_icon_info_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType rygel_icon_info_type_id;
		rygel_icon_info_type_id = g_type_register_fundamental (g_type_fundamental_next (), "RygelIconInfo", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&rygel_icon_info_type_id__volatile, rygel_icon_info_type_id);
	}
	return rygel_icon_info_type_id__volatile;
}


gpointer rygel_icon_info_ref (gpointer instance) {
	RygelIconInfo* self;
	self = instance;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	g_atomic_int_inc (&self->ref_count);
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	return instance;
#line 371 "rygel-icon-info.c"
}


void rygel_icon_info_unref (gpointer instance) {
	RygelIconInfo* self;
	self = instance;
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		RYGEL_ICON_INFO_GET_CLASS (self)->finalize (self);
#line 27 "/home/jens/Source/rygel/tests/rygel-icon-info.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 384 "rygel-icon-info.c"
	}
}



