/* vala-image-record.c generated by valac 0.56.17, the Vala compiler
 * generated from vala-image-record.vala, do not modify */

/*   FILE: vala-dmap-image-record.vala -- A DMAP.ImageRecord implementation in Vala
 * AUTHOR: W. Michael Petullo <mike@flyn.org>
 *   DATE: 21 December 2010
 *
 * Copyright (c) 2010 W. Michael Petullo <new@flyn.org>
 * All rights reserved.
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <glib-object.h>
#include <libdmapsharing/dmap.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <glib/gstdio.h>
#include <stdio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_VALA_IMAGE_RECORD (vala_image_record_get_type ())
#define VALA_IMAGE_RECORD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VALA_IMAGE_RECORD, ValaImageRecord))
#define VALA_IMAGE_RECORD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VALA_IMAGE_RECORD, ValaImageRecordClass))
#define IS_VALA_IMAGE_RECORD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VALA_IMAGE_RECORD))
#define IS_VALA_IMAGE_RECORD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VALA_IMAGE_RECORD))
#define VALA_IMAGE_RECORD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VALA_IMAGE_RECORD, ValaImageRecordClass))

typedef struct _ValaImageRecord ValaImageRecord;
typedef struct _ValaImageRecordClass ValaImageRecordClass;
typedef struct _ValaImageRecordPrivate ValaImageRecordPrivate;
enum  {
	VALA_IMAGE_RECORD_0_PROPERTY,
	VALA_IMAGE_RECORD_LOCATION_PROPERTY,
	VALA_IMAGE_RECORD_FILENAME_PROPERTY,
	VALA_IMAGE_RECORD_ASPECT_RATIO_PROPERTY,
	VALA_IMAGE_RECORD_FORMAT_PROPERTY,
	VALA_IMAGE_RECORD_HASH_PROPERTY,
	VALA_IMAGE_RECORD_THUMBNAIL_PROPERTY,
	VALA_IMAGE_RECORD_COMMENTS_PROPERTY,
	VALA_IMAGE_RECORD_LARGE_FILESIZE_PROPERTY,
	VALA_IMAGE_RECORD_PIXEL_HEIGHT_PROPERTY,
	VALA_IMAGE_RECORD_PIXEL_WIDTH_PROPERTY,
	VALA_IMAGE_RECORD_RATING_PROPERTY,
	VALA_IMAGE_RECORD_CREATION_DATE_PROPERTY,
	VALA_IMAGE_RECORD_NUM_PROPERTIES
};
static GParamSpec* vala_image_record_properties[VALA_IMAGE_RECORD_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_VALA_IMAGE_RECORD_FACTORY (vala_image_record_factory_get_type ())
#define VALA_IMAGE_RECORD_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VALA_IMAGE_RECORD_FACTORY, ValaImageRecordFactory))
#define VALA_IMAGE_RECORD_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VALA_IMAGE_RECORD_FACTORY, ValaImageRecordFactoryClass))
#define IS_VALA_IMAGE_RECORD_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VALA_IMAGE_RECORD_FACTORY))
#define IS_VALA_IMAGE_RECORD_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VALA_IMAGE_RECORD_FACTORY))
#define VALA_IMAGE_RECORD_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VALA_IMAGE_RECORD_FACTORY, ValaImageRecordFactoryClass))

typedef struct _ValaImageRecordFactory ValaImageRecordFactory;
typedef struct _ValaImageRecordFactoryClass ValaImageRecordFactoryClass;
typedef struct _ValaImageRecordFactoryPrivate ValaImageRecordFactoryPrivate;
enum  {
	VALA_IMAGE_RECORD_FACTORY_0_PROPERTY,
	VALA_IMAGE_RECORD_FACTORY_NUM_PROPERTIES
};
static GParamSpec* vala_image_record_factory_properties[VALA_IMAGE_RECORD_FACTORY_NUM_PROPERTIES];

struct _ValaImageRecord {
	GObject parent_instance;
	ValaImageRecordPrivate * priv;
};

struct _ValaImageRecordClass {
	GObjectClass parent_class;
};

struct _ValaImageRecordPrivate {
	gchar* _location;
	gchar* _filename;
	gchar* _aspect_ratio;
	gchar* _format;
	GArray* _hash;
	gchar* _comments;
	GArray* _thumbnail;
	gint _large_filesize;
	gint _pixel_height;
	gint _pixel_width;
	gint _rating;
	gint _creation_date;
};

struct _ValaImageRecordFactory {
	GObject parent_instance;
	ValaImageRecordFactoryPrivate * priv;
};

struct _ValaImageRecordFactoryClass {
	GObjectClass parent_class;
};

static gint ValaImageRecord_private_offset;
static gpointer vala_image_record_parent_class = NULL;
static DmapRecordInterface * vala_image_record_dmap_record_parent_iface = NULL;
static DmapImageRecordInterface * vala_image_record_dmap_image_record_parent_iface = NULL;
static gpointer vala_image_record_factory_parent_class = NULL;
static DmapRecordFactoryInterface * vala_image_record_factory_dmap_record_factory_parent_iface = NULL;

VALA_EXTERN GType vala_image_record_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaImageRecord, g_object_unref)
static GInputStream* vala_image_record_real_read (DmapImageRecord* base,
                                           GError** error);
static gboolean vala_image_record_real_set_from_blob (DmapRecord* base,
                                               GArray* blob);
static GArray* vala_image_record_real_to_blob (DmapRecord* base);
VALA_EXTERN ValaImageRecord* vala_image_record_new (void);
VALA_EXTERN ValaImageRecord* vala_image_record_construct (GType object_type);
static void vala_image_record_finalize (GObject * obj);
static GType vala_image_record_get_type_once (void);
static void _vala_vala_image_record_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec);
static void _vala_vala_image_record_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec);
VALA_EXTERN GType vala_image_record_factory_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValaImageRecordFactory, g_object_unref)
static DmapRecord* vala_image_record_factory_real_create (DmapRecordFactory* base,
                                                   GError** error);
VALA_EXTERN ValaImageRecordFactory* vala_image_record_factory_new (void);
VALA_EXTERN ValaImageRecordFactory* vala_image_record_factory_construct (GType object_type);
static GType vala_image_record_factory_get_type_once (void);

static inline gpointer
vala_image_record_get_instance_private (ValaImageRecord* self)
{
	return G_STRUCT_MEMBER_P (self, ValaImageRecord_private_offset);
}

static GInputStream*
vala_image_record_real_read (DmapImageRecord* base,
                             GError** error)
{
	ValaImageRecord * self;
	self = (ValaImageRecord*) base;
	g_error ("vala-image-record.vala:104: read not implemented");
}

static gboolean
vala_image_record_real_set_from_blob (DmapRecord* base,
                                      GArray* blob)
{
	ValaImageRecord * self;
	self = (ValaImageRecord*) base;
	g_return_val_if_fail (blob != NULL, FALSE);
	g_error ("vala-image-record.vala:108: set_from_blob not implemented");
}

static GArray*
vala_image_record_real_to_blob (DmapRecord* base)
{
	ValaImageRecord * self;
	self = (ValaImageRecord*) base;
	g_error ("vala-image-record.vala:112: to_blob not implemented");
}

ValaImageRecord*
vala_image_record_construct (GType object_type)
{
	ValaImageRecord * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* path = NULL;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	guint8* data = NULL;
	gint data_length1 = 0;
	gint _data_size_ = 0;
	GArray* _tmp19_;
	GArray* _tmp20_;
	GError* _inner_error0_ = NULL;
	self = (ValaImageRecord*) g_object_new (object_type, NULL);
	_tmp0_ = g_get_current_dir ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strconcat ("file://", _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strconcat (_tmp3_, "/media/test.jpeg", NULL);
	_g_free0 (self->priv->_location);
	self->priv->_location = _tmp4_;
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	_tmp5_ = g_strdup ("1.333");
	_g_free0 (self->priv->_aspect_ratio);
	self->priv->_aspect_ratio = _tmp5_;
	_tmp6_ = self->priv->_location;
	_tmp7_ = g_path_get_basename (_tmp6_);
	_g_free0 (self->priv->_filename);
	self->priv->_filename = _tmp7_;
	_tmp8_ = g_strdup ("JPEG");
	_g_free0 (self->priv->_format);
	self->priv->_format = _tmp8_;
	_tmp9_ = g_strdup ("Comments");
	_g_free0 (self->priv->_comments);
	self->priv->_comments = _tmp9_;
	self->priv->_large_filesize = 13953;
	self->priv->_pixel_height = 480;
	self->priv->_pixel_width = 640;
	self->priv->_rating = 5;
	self->priv->_creation_date = 0;
	_tmp10_ = g_get_current_dir ();
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strconcat (_tmp11_, "/media/test.jpeg", NULL);
	_tmp13_ = _tmp12_;
	_g_free0 (_tmp11_);
	path = _tmp13_;
	{
		guint8* _tmp14_ = NULL;
		gsize _tmp15_ = 0;
		g_file_get_contents (path, (gchar**) (&_tmp14_), &_tmp15_, &_inner_error0_);
		data = (g_free (data), NULL);
		data = _tmp14_;
		data_length1 = _tmp15_;
		_data_size_ = data_length1;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		FILE* _tmp16_;
		GError* _tmp17_;
		const gchar* _tmp18_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp16_ = stderr;
		_tmp17_ = e;
		_tmp18_ = _tmp17_->message;
		fprintf (_tmp16_, "Error: %s\n", _tmp18_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		data = (g_free (data), NULL);
		_g_free0 (path);
		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 NULL;
	}
	_tmp19_ = g_array_new (FALSE, FALSE, (gulong) 1);
	_g_array_unref0 (self->priv->_thumbnail);
	self->priv->_thumbnail = _tmp19_;
	_tmp20_ = self->priv->_thumbnail;
	g_array_append_vals (_tmp20_, data, (guint) data_length1);
	data = (g_free (data), NULL);
	_g_free0 (path);
	return self;
}

ValaImageRecord*
vala_image_record_new (void)
{
	return vala_image_record_construct (TYPE_VALA_IMAGE_RECORD);
}

static gchar*
vala_image_record_real_get_location (DmapImageRecord* base)
{
	gchar* result;
	ValaImageRecord* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (ValaImageRecord*) base;
	_tmp0_ = self->priv->_location;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
vala_image_record_real_set_location (DmapImageRecord* base,
                                     const gchar* value)
{
	ValaImageRecord* self;
	gchar* _tmp0_;
	self = (ValaImageRecord*) base;
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_location);
	self->priv->_location = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_LOCATION_PROPERTY]);
}

static gchar*
vala_image_record_real_get_filename (DmapImageRecord* base)
{
	gchar* result;
	ValaImageRecord* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (ValaImageRecord*) base;
	_tmp0_ = self->priv->_filename;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
vala_image_record_real_set_filename (DmapImageRecord* base,
                                     const gchar* value)
{
	ValaImageRecord* self;
	gchar* _tmp0_;
	self = (ValaImageRecord*) base;
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_filename);
	self->priv->_filename = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_FILENAME_PROPERTY]);
}

static gchar*
vala_image_record_real_get_aspect_ratio (DmapImageRecord* base)
{
	gchar* result;
	ValaImageRecord* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (ValaImageRecord*) base;
	_tmp0_ = self->priv->_aspect_ratio;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
vala_image_record_real_set_aspect_ratio (DmapImageRecord* base,
                                         const gchar* value)
{
	ValaImageRecord* self;
	gchar* _tmp0_;
	self = (ValaImageRecord*) base;
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_aspect_ratio);
	self->priv->_aspect_ratio = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_ASPECT_RATIO_PROPERTY]);
}

static gchar*
vala_image_record_real_get_format (DmapImageRecord* base)
{
	gchar* result;
	ValaImageRecord* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (ValaImageRecord*) base;
	_tmp0_ = self->priv->_format;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
vala_image_record_real_set_format (DmapImageRecord* base,
                                   const gchar* value)
{
	ValaImageRecord* self;
	gchar* _tmp0_;
	self = (ValaImageRecord*) base;
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_format);
	self->priv->_format = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_FORMAT_PROPERTY]);
}

static gpointer
_g_array_ref0 (gpointer self)
{
	return self ? g_array_ref (self) : NULL;
}

static GArray*
vala_image_record_real_get_hash (DmapImageRecord* base)
{
	GArray* result;
	ValaImageRecord* self;
	GArray* _tmp0_;
	GArray* _tmp1_;
	self = (ValaImageRecord*) base;
	_tmp0_ = self->priv->_hash;
	_tmp1_ = _g_array_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
vala_image_record_real_set_hash (DmapImageRecord* base,
                                 GArray* value)
{
	ValaImageRecord* self;
	GArray* _tmp0_;
	GArray* _tmp1_;
	gpointer* _tmp2_;
	gint _tmp2__length1;
	gpointer* _tmp3_;
	gint _tmp3__length1;
	self = (ValaImageRecord*) base;
	_tmp0_ = g_array_new (FALSE, FALSE, (gulong) 1);
	_g_array_unref0 (self->priv->_hash);
	self->priv->_hash = _tmp0_;
	_tmp1_ = self->priv->_hash;
	_tmp2_ = value->data;
	_tmp2__length1 = value->len;
	_tmp3_ = value->data;
	_tmp3__length1 = value->len;
	g_array_append_vals (_tmp1_, _tmp2_, (guint) _tmp3__length1);
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_HASH_PROPERTY]);
}

static GArray*
vala_image_record_real_get_thumbnail (DmapImageRecord* base)
{
	GArray* result;
	ValaImageRecord* self;
	GArray* _tmp0_;
	GArray* _tmp1_;
	self = (ValaImageRecord*) base;
	_tmp0_ = self->priv->_thumbnail;
	_tmp1_ = _g_array_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
vala_image_record_real_set_thumbnail (DmapImageRecord* base,
                                      GArray* value)
{
	ValaImageRecord* self;
	GArray* _tmp0_;
	GArray* _tmp1_;
	gpointer* _tmp2_;
	gint _tmp2__length1;
	gpointer* _tmp3_;
	gint _tmp3__length1;
	self = (ValaImageRecord*) base;
	_tmp0_ = g_array_new (FALSE, FALSE, (gulong) 1);
	_g_array_unref0 (self->priv->_thumbnail);
	self->priv->_thumbnail = _tmp0_;
	_tmp1_ = self->priv->_thumbnail;
	_tmp2_ = value->data;
	_tmp2__length1 = value->len;
	_tmp3_ = value->data;
	_tmp3__length1 = value->len;
	g_array_append_vals (_tmp1_, _tmp2_, (guint) _tmp3__length1);
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_THUMBNAIL_PROPERTY]);
}

static gchar*
vala_image_record_real_get_comments (DmapImageRecord* base)
{
	gchar* result;
	ValaImageRecord* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (ValaImageRecord*) base;
	_tmp0_ = self->priv->_comments;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
vala_image_record_real_set_comments (DmapImageRecord* base,
                                     const gchar* value)
{
	ValaImageRecord* self;
	gchar* _tmp0_;
	self = (ValaImageRecord*) base;
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_comments);
	self->priv->_comments = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_COMMENTS_PROPERTY]);
}

static gint
vala_image_record_real_get_large_filesize (DmapImageRecord* base)
{
	gint result;
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	result = self->priv->_large_filesize;
	return result;
}

static void
vala_image_record_real_set_large_filesize (DmapImageRecord* base,
                                           gint value)
{
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	self->priv->_large_filesize = value;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_LARGE_FILESIZE_PROPERTY]);
}

static gint
vala_image_record_real_get_pixel_height (DmapImageRecord* base)
{
	gint result;
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	result = self->priv->_pixel_height;
	return result;
}

static void
vala_image_record_real_set_pixel_height (DmapImageRecord* base,
                                         gint value)
{
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	self->priv->_pixel_height = value;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_PIXEL_HEIGHT_PROPERTY]);
}

static gint
vala_image_record_real_get_pixel_width (DmapImageRecord* base)
{
	gint result;
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	result = self->priv->_pixel_width;
	return result;
}

static void
vala_image_record_real_set_pixel_width (DmapImageRecord* base,
                                        gint value)
{
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	self->priv->_pixel_width = value;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_PIXEL_WIDTH_PROPERTY]);
}

static gint
vala_image_record_real_get_rating (DmapImageRecord* base)
{
	gint result;
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	result = self->priv->_rating;
	return result;
}

static void
vala_image_record_real_set_rating (DmapImageRecord* base,
                                   gint value)
{
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	self->priv->_rating = value;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_RATING_PROPERTY]);
}

static gint
vala_image_record_real_get_creation_date (DmapImageRecord* base)
{
	gint result;
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	result = self->priv->_creation_date;
	return result;
}

static void
vala_image_record_real_set_creation_date (DmapImageRecord* base,
                                          gint value)
{
	ValaImageRecord* self;
	self = (ValaImageRecord*) base;
	self->priv->_creation_date = value;
	g_object_notify_by_pspec ((GObject *) self, vala_image_record_properties[VALA_IMAGE_RECORD_CREATION_DATE_PROPERTY]);
}

static void
vala_image_record_class_init (ValaImageRecordClass * klass,
                              gpointer klass_data)
{
	vala_image_record_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ValaImageRecord_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_vala_image_record_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_vala_image_record_set_property;
	G_OBJECT_CLASS (klass)->finalize = vala_image_record_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_LOCATION_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_LOCATION_PROPERTY] = g_param_spec_string ("location", "location", "location", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_FILENAME_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_FILENAME_PROPERTY] = g_param_spec_string ("filename", "filename", "filename", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_ASPECT_RATIO_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_ASPECT_RATIO_PROPERTY] = g_param_spec_string ("aspect-ratio", "aspect-ratio", "aspect-ratio", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_FORMAT_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_FORMAT_PROPERTY] = g_param_spec_string ("format", "format", "format", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_HASH_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_HASH_PROPERTY] = g_param_spec_boxed ("hash", "hash", "hash", G_TYPE_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_THUMBNAIL_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_THUMBNAIL_PROPERTY] = g_param_spec_boxed ("thumbnail", "thumbnail", "thumbnail", G_TYPE_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_COMMENTS_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_COMMENTS_PROPERTY] = g_param_spec_string ("comments", "comments", "comments", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_LARGE_FILESIZE_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_LARGE_FILESIZE_PROPERTY] = g_param_spec_int ("large-filesize", "large-filesize", "large-filesize", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_PIXEL_HEIGHT_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_PIXEL_HEIGHT_PROPERTY] = g_param_spec_int ("pixel-height", "pixel-height", "pixel-height", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_PIXEL_WIDTH_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_PIXEL_WIDTH_PROPERTY] = g_param_spec_int ("pixel-width", "pixel-width", "pixel-width", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_RATING_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_RATING_PROPERTY] = g_param_spec_int ("rating", "rating", "rating", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_IMAGE_RECORD_CREATION_DATE_PROPERTY, vala_image_record_properties[VALA_IMAGE_RECORD_CREATION_DATE_PROPERTY] = g_param_spec_int ("creation-date", "creation-date", "creation-date", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
vala_image_record_dmap_record_interface_init (DmapRecordInterface * iface,
                                              gpointer iface_data)
{
	vala_image_record_dmap_record_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_from_blob = (gboolean (*) (DmapRecord*, GArray*)) vala_image_record_real_set_from_blob;
	iface->to_blob = (GArray* (*) (DmapRecord*)) vala_image_record_real_to_blob;
}

static void
vala_image_record_dmap_image_record_interface_init (DmapImageRecordInterface * iface,
                                                    gpointer iface_data)
{
	vala_image_record_dmap_image_record_parent_iface = g_type_interface_peek_parent (iface);
	iface->read = (GInputStream* (*) (DmapImageRecord*, GError**)) vala_image_record_real_read;
}

static void
vala_image_record_instance_init (ValaImageRecord * self,
                                 gpointer klass)
{
	self->priv = vala_image_record_get_instance_private (self);
}

static void
vala_image_record_finalize (GObject * obj)
{
	ValaImageRecord * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_VALA_IMAGE_RECORD, ValaImageRecord);
	_g_free0 (self->priv->_location);
	_g_free0 (self->priv->_filename);
	_g_free0 (self->priv->_aspect_ratio);
	_g_free0 (self->priv->_format);
	_g_array_unref0 (self->priv->_hash);
	_g_free0 (self->priv->_comments);
	_g_array_unref0 (self->priv->_thumbnail);
	G_OBJECT_CLASS (vala_image_record_parent_class)->finalize (obj);
}

static GType
vala_image_record_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValaImageRecordClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_image_record_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaImageRecord), 0, (GInstanceInitFunc) vala_image_record_instance_init, NULL };
	static const GInterfaceInfo dmap_record_info = { (GInterfaceInitFunc) vala_image_record_dmap_record_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo dmap_image_record_info = { (GInterfaceInitFunc) vala_image_record_dmap_image_record_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType vala_image_record_type_id;
	vala_image_record_type_id = g_type_register_static (G_TYPE_OBJECT, "ValaImageRecord", &g_define_type_info, 0);
	g_type_add_interface_static (vala_image_record_type_id, dmap_record_get_type (), &dmap_record_info);
	g_type_add_interface_static (vala_image_record_type_id, dmap_image_record_get_type (), &dmap_image_record_info);
	ValaImageRecord_private_offset = g_type_add_instance_private (vala_image_record_type_id, sizeof (ValaImageRecordPrivate));
	return vala_image_record_type_id;
}

GType
vala_image_record_get_type (void)
{
	static volatile gsize vala_image_record_type_id__once = 0;
	if (g_once_init_enter (&vala_image_record_type_id__once)) {
		GType vala_image_record_type_id;
		vala_image_record_type_id = vala_image_record_get_type_once ();
		g_once_init_leave (&vala_image_record_type_id__once, vala_image_record_type_id);
	}
	return vala_image_record_type_id__once;
}

static void
_vala_vala_image_record_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec)
{
	ValaImageRecord * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_VALA_IMAGE_RECORD, ValaImageRecord);
	switch (property_id) {
		case VALA_IMAGE_RECORD_LOCATION_PROPERTY:
		g_value_take_string (value, vala_image_record_real_get_location ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_FILENAME_PROPERTY:
		g_value_take_string (value, vala_image_record_real_get_filename ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_ASPECT_RATIO_PROPERTY:
		g_value_take_string (value, vala_image_record_real_get_aspect_ratio ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_FORMAT_PROPERTY:
		g_value_take_string (value, vala_image_record_real_get_format ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_HASH_PROPERTY:
		g_value_take_boxed (value, vala_image_record_real_get_hash ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_THUMBNAIL_PROPERTY:
		g_value_take_boxed (value, vala_image_record_real_get_thumbnail ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_COMMENTS_PROPERTY:
		g_value_take_string (value, vala_image_record_real_get_comments ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_LARGE_FILESIZE_PROPERTY:
		g_value_set_int (value, vala_image_record_real_get_large_filesize ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_PIXEL_HEIGHT_PROPERTY:
		g_value_set_int (value, vala_image_record_real_get_pixel_height ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_PIXEL_WIDTH_PROPERTY:
		g_value_set_int (value, vala_image_record_real_get_pixel_width ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_RATING_PROPERTY:
		g_value_set_int (value, vala_image_record_real_get_rating ((DmapImageRecord*) self));
		break;
		case VALA_IMAGE_RECORD_CREATION_DATE_PROPERTY:
		g_value_set_int (value, vala_image_record_real_get_creation_date ((DmapImageRecord*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_vala_image_record_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec)
{
	ValaImageRecord * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_VALA_IMAGE_RECORD, ValaImageRecord);
	switch (property_id) {
		case VALA_IMAGE_RECORD_LOCATION_PROPERTY:
		vala_image_record_real_set_location ((DmapImageRecord*) self, g_value_get_string (value));
		break;
		case VALA_IMAGE_RECORD_FILENAME_PROPERTY:
		vala_image_record_real_set_filename ((DmapImageRecord*) self, g_value_get_string (value));
		break;
		case VALA_IMAGE_RECORD_ASPECT_RATIO_PROPERTY:
		vala_image_record_real_set_aspect_ratio ((DmapImageRecord*) self, g_value_get_string (value));
		break;
		case VALA_IMAGE_RECORD_FORMAT_PROPERTY:
		vala_image_record_real_set_format ((DmapImageRecord*) self, g_value_get_string (value));
		break;
		case VALA_IMAGE_RECORD_HASH_PROPERTY:
		vala_image_record_real_set_hash ((DmapImageRecord*) self, g_value_get_boxed (value));
		break;
		case VALA_IMAGE_RECORD_THUMBNAIL_PROPERTY:
		vala_image_record_real_set_thumbnail ((DmapImageRecord*) self, g_value_get_boxed (value));
		break;
		case VALA_IMAGE_RECORD_COMMENTS_PROPERTY:
		vala_image_record_real_set_comments ((DmapImageRecord*) self, g_value_get_string (value));
		break;
		case VALA_IMAGE_RECORD_LARGE_FILESIZE_PROPERTY:
		vala_image_record_real_set_large_filesize ((DmapImageRecord*) self, g_value_get_int (value));
		break;
		case VALA_IMAGE_RECORD_PIXEL_HEIGHT_PROPERTY:
		vala_image_record_real_set_pixel_height ((DmapImageRecord*) self, g_value_get_int (value));
		break;
		case VALA_IMAGE_RECORD_PIXEL_WIDTH_PROPERTY:
		vala_image_record_real_set_pixel_width ((DmapImageRecord*) self, g_value_get_int (value));
		break;
		case VALA_IMAGE_RECORD_RATING_PROPERTY:
		vala_image_record_real_set_rating ((DmapImageRecord*) self, g_value_get_int (value));
		break;
		case VALA_IMAGE_RECORD_CREATION_DATE_PROPERTY:
		vala_image_record_real_set_creation_date ((DmapImageRecord*) self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static DmapRecord*
vala_image_record_factory_real_create (DmapRecordFactory* base,
                                       GError** error)
{
	ValaImageRecordFactory * self;
	ValaImageRecord* _tmp0_;
	DmapRecord* result;
	self = (ValaImageRecordFactory*) base;
	_tmp0_ = vala_image_record_new ();
	result = (DmapRecord*) _tmp0_;
	return result;
}

ValaImageRecordFactory*
vala_image_record_factory_construct (GType object_type)
{
	ValaImageRecordFactory * self = NULL;
	self = (ValaImageRecordFactory*) g_object_new (object_type, NULL);
	return self;
}

ValaImageRecordFactory*
vala_image_record_factory_new (void)
{
	return vala_image_record_factory_construct (TYPE_VALA_IMAGE_RECORD_FACTORY);
}

static void
vala_image_record_factory_class_init (ValaImageRecordFactoryClass * klass,
                                      gpointer klass_data)
{
	vala_image_record_factory_parent_class = g_type_class_peek_parent (klass);
}

static void
vala_image_record_factory_dmap_record_factory_interface_init (DmapRecordFactoryInterface * iface,
                                                              gpointer iface_data)
{
	vala_image_record_factory_dmap_record_factory_parent_iface = g_type_interface_peek_parent (iface);
	iface->create = (DmapRecord* (*) (DmapRecordFactory*, GError**)) vala_image_record_factory_real_create;
}

static void
vala_image_record_factory_instance_init (ValaImageRecordFactory * self,
                                         gpointer klass)
{
}

static GType
vala_image_record_factory_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValaImageRecordFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_image_record_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaImageRecordFactory), 0, (GInstanceInitFunc) vala_image_record_factory_instance_init, NULL };
	static const GInterfaceInfo dmap_record_factory_info = { (GInterfaceInitFunc) vala_image_record_factory_dmap_record_factory_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType vala_image_record_factory_type_id;
	vala_image_record_factory_type_id = g_type_register_static (G_TYPE_OBJECT, "ValaImageRecordFactory", &g_define_type_info, 0);
	g_type_add_interface_static (vala_image_record_factory_type_id, dmap_record_factory_get_type (), &dmap_record_factory_info);
	return vala_image_record_factory_type_id;
}

GType
vala_image_record_factory_get_type (void)
{
	static volatile gsize vala_image_record_factory_type_id__once = 0;
	if (g_once_init_enter (&vala_image_record_factory_type_id__once)) {
		GType vala_image_record_factory_type_id;
		vala_image_record_factory_type_id = vala_image_record_factory_get_type_once ();
		g_once_init_leave (&vala_image_record_factory_type_id__once, vala_image_record_factory_type_id);
	}
	return vala_image_record_factory_type_id__once;
}

