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

/* valagircomment.vala
 *
 * Copyright (C) 2011  Florian Brosch
 *
 * This library 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.1 of the License, or (at your option) any later version.
 *
 * This library 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 library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Florian Brosch <flo.brosch@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <valagee.h>
#include <stdlib.h>
#include <string.h>


#define VALA_TYPE_COMMENT (vala_comment_get_type ())
#define VALA_COMMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_COMMENT, ValaComment))
#define VALA_COMMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_COMMENT, ValaCommentClass))
#define VALA_IS_COMMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_COMMENT))
#define VALA_IS_COMMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_COMMENT))
#define VALA_COMMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_COMMENT, ValaCommentClass))

typedef struct _ValaComment ValaComment;
typedef struct _ValaCommentClass ValaCommentClass;
typedef struct _ValaCommentPrivate ValaCommentPrivate;

#define VALA_TYPE_GIR_COMMENT (vala_gir_comment_get_type ())
#define VALA_GIR_COMMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_GIR_COMMENT, ValaGirComment))
#define VALA_GIR_COMMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_GIR_COMMENT, ValaGirCommentClass))
#define VALA_IS_GIR_COMMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_GIR_COMMENT))
#define VALA_IS_GIR_COMMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_GIR_COMMENT))
#define VALA_GIR_COMMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_GIR_COMMENT, ValaGirCommentClass))

typedef struct _ValaGirComment ValaGirComment;
typedef struct _ValaGirCommentClass ValaGirCommentClass;
typedef struct _ValaGirCommentPrivate ValaGirCommentPrivate;
#define _vala_map_unref0(var) ((var == NULL) ? NULL : (var = (vala_map_unref (var), NULL)))
#define _vala_comment_unref0(var) ((var == NULL) ? NULL : (var = (vala_comment_unref (var), NULL)))

#define VALA_TYPE_SOURCE_REFERENCE (vala_source_reference_get_type ())
#define VALA_SOURCE_REFERENCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_SOURCE_REFERENCE, ValaSourceReference))
#define VALA_SOURCE_REFERENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_SOURCE_REFERENCE, ValaSourceReferenceClass))
#define VALA_IS_SOURCE_REFERENCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_SOURCE_REFERENCE))
#define VALA_IS_SOURCE_REFERENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_SOURCE_REFERENCE))
#define VALA_SOURCE_REFERENCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_SOURCE_REFERENCE, ValaSourceReferenceClass))

typedef struct _ValaSourceReference ValaSourceReference;
typedef struct _ValaSourceReferenceClass ValaSourceReferenceClass;

struct _ValaComment {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ValaCommentPrivate * priv;
};

struct _ValaCommentClass {
	GTypeClass parent_class;
	void (*finalize) (ValaComment *self);
};

struct _ValaGirComment {
	ValaComment parent_instance;
	ValaGirCommentPrivate * priv;
};

struct _ValaGirCommentClass {
	ValaCommentClass parent_class;
};

struct _ValaGirCommentPrivate {
	ValaHashMap* parameter_content;
	ValaComment* _return_content;
};


static gpointer vala_gir_comment_parent_class = NULL;

gpointer vala_comment_ref (gpointer instance);
void vala_comment_unref (gpointer instance);
GParamSpec* vala_param_spec_comment (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vala_value_set_comment (GValue* value, gpointer v_object);
void vala_value_take_comment (GValue* value, gpointer v_object);
gpointer vala_value_get_comment (const GValue* value);
GType vala_comment_get_type (void) G_GNUC_CONST;
GType vala_gir_comment_get_type (void) G_GNUC_CONST;
#define VALA_GIR_COMMENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_GIR_COMMENT, ValaGirCommentPrivate))
enum  {
	VALA_GIR_COMMENT_DUMMY_PROPERTY
};
ValaMapIterator* vala_gir_comment_parameter_iterator (ValaGirComment* self);
gpointer vala_source_reference_ref (gpointer instance);
void vala_source_reference_unref (gpointer instance);
GParamSpec* vala_param_spec_source_reference (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vala_value_set_source_reference (GValue* value, gpointer v_object);
void vala_value_take_source_reference (GValue* value, gpointer v_object);
gpointer vala_value_get_source_reference (const GValue* value);
GType vala_source_reference_get_type (void) G_GNUC_CONST;
ValaGirComment* vala_gir_comment_new (const gchar* comment, ValaSourceReference* _source_reference);
ValaGirComment* vala_gir_comment_construct (GType object_type, const gchar* comment, ValaSourceReference* _source_reference);
ValaComment* vala_comment_new (const gchar* comment, ValaSourceReference* _source_reference);
ValaComment* vala_comment_construct (GType object_type, const gchar* comment, ValaSourceReference* _source_reference);
G_GNUC_INTERNAL void vala_gir_comment_add_content_for_parameter (ValaGirComment* self, const gchar* name, ValaComment* comment);
ValaComment* vala_gir_comment_get_content_for_parameter (ValaGirComment* self, const gchar* name);
ValaComment* vala_gir_comment_get_return_content (ValaGirComment* self);
void vala_gir_comment_set_return_content (ValaGirComment* self, ValaComment* value);
static void vala_gir_comment_finalize (ValaComment * obj);


ValaMapIterator* vala_gir_comment_parameter_iterator (ValaGirComment* self) {
	ValaMapIterator* result = NULL;
	ValaHashMap* _tmp0_;
	ValaMapIterator* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->parameter_content;
	_tmp1_ = vala_map_map_iterator ((ValaMap*) _tmp0_);
	result = _tmp1_;
	return result;
}


ValaGirComment* vala_gir_comment_construct (GType object_type, const gchar* comment, ValaSourceReference* _source_reference) {
	ValaGirComment* self = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_val_if_fail (_source_reference != NULL, NULL);
	_tmp1_ = comment;
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp2_ = _source_reference;
	self = (ValaGirComment*) vala_comment_construct (object_type, _tmp0_, _tmp2_);
	return self;
}


ValaGirComment* vala_gir_comment_new (const gchar* comment, ValaSourceReference* _source_reference) {
	return vala_gir_comment_construct (VALA_TYPE_GIR_COMMENT, comment, _source_reference);
}


G_GNUC_INTERNAL void vala_gir_comment_add_content_for_parameter (ValaGirComment* self, const gchar* name, ValaComment* comment) {
	ValaHashMap* _tmp0_;
	const gchar* _tmp1_;
	ValaComment* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (comment != NULL);
	_tmp0_ = self->priv->parameter_content;
	_tmp1_ = name;
	_tmp2_ = comment;
	vala_map_set ((ValaMap*) _tmp0_, _tmp1_, _tmp2_);
}


ValaComment* vala_gir_comment_get_content_for_parameter (ValaGirComment* self, const gchar* name) {
	ValaComment* result = NULL;
	ValaHashMap* _tmp0_;
	const gchar* _tmp1_;
	gpointer _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->parameter_content;
	_tmp1_ = name;
	_tmp2_ = vala_map_get ((ValaMap*) _tmp0_, _tmp1_);
	result = (ValaComment*) _tmp2_;
	return result;
}


ValaComment* vala_gir_comment_get_return_content (ValaGirComment* self) {
	ValaComment* result;
	ValaComment* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_return_content;
	result = _tmp0_;
	return result;
}


static gpointer _vala_comment_ref0 (gpointer self) {
	return self ? vala_comment_ref (self) : NULL;
}


void vala_gir_comment_set_return_content (ValaGirComment* self, ValaComment* value) {
	ValaComment* _tmp0_;
	ValaComment* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_comment_ref0 (_tmp0_);
	_vala_comment_unref0 (self->priv->_return_content);
	self->priv->_return_content = _tmp1_;
}


static void vala_gir_comment_class_init (ValaGirCommentClass * klass) {
	vala_gir_comment_parent_class = g_type_class_peek_parent (klass);
	((ValaCommentClass *) klass)->finalize = vala_gir_comment_finalize;
	g_type_class_add_private (klass, sizeof (ValaGirCommentPrivate));
}


static void vala_gir_comment_instance_init (ValaGirComment * self) {
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GEqualFunc _tmp2_;
	ValaHashMap* _tmp3_;
	self->priv = VALA_GIR_COMMENT_GET_PRIVATE (self);
	_tmp0_ = g_direct_hash;
	_tmp1_ = g_direct_equal;
	_tmp2_ = g_direct_equal;
	_tmp3_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, VALA_TYPE_COMMENT, (GBoxedCopyFunc) vala_comment_ref, (GDestroyNotify) vala_comment_unref, _tmp0_, _tmp1_, _tmp2_);
	self->priv->parameter_content = _tmp3_;
}


static void vala_gir_comment_finalize (ValaComment * obj) {
	ValaGirComment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_GIR_COMMENT, ValaGirComment);
	_vala_map_unref0 (self->priv->parameter_content);
	_vala_comment_unref0 (self->priv->_return_content);
	VALA_COMMENT_CLASS (vala_gir_comment_parent_class)->finalize (obj);
}


/**
 * A documentation comment used by valadoc
 */
GType vala_gir_comment_get_type (void) {
	static volatile gsize vala_gir_comment_type_id__volatile = 0;
	if (g_once_init_enter (&vala_gir_comment_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValaGirCommentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_gir_comment_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaGirComment), 0, (GInstanceInitFunc) vala_gir_comment_instance_init, NULL };
		GType vala_gir_comment_type_id;
		vala_gir_comment_type_id = g_type_register_static (VALA_TYPE_COMMENT, "ValaGirComment", &g_define_type_info, 0);
		g_once_init_leave (&vala_gir_comment_type_id__volatile, vala_gir_comment_type_id);
	}
	return vala_gir_comment_type_id__volatile;
}



