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

/* girwriter.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 <valacodegen.h>
#include <glib-object.h>
#include <valadoc.h>
#include <vala.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <valagee.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 VALADOC_TYPE_GIR_WRITER (valadoc_gir_writer_get_type ())
#define VALADOC_GIR_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_TYPE_GIR_WRITER, ValadocGirWriter))
#define VALADOC_GIR_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_TYPE_GIR_WRITER, ValadocGirWriterClass))
#define VALADOC_IS_GIR_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_TYPE_GIR_WRITER))
#define VALADOC_IS_GIR_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_TYPE_GIR_WRITER))
#define VALADOC_GIR_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_TYPE_GIR_WRITER, ValadocGirWriterClass))

typedef struct _ValadocGirWriter ValadocGirWriter;
typedef struct _ValadocGirWriterClass ValadocGirWriterClass;
typedef struct _ValadocGirWriterPrivate ValadocGirWriterPrivate;

#define VALADOC_TYPE_SYMBOL_RESOLVER (valadoc_symbol_resolver_get_type ())
#define VALADOC_SYMBOL_RESOLVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_TYPE_SYMBOL_RESOLVER, ValadocSymbolResolver))
#define VALADOC_SYMBOL_RESOLVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_TYPE_SYMBOL_RESOLVER, ValadocSymbolResolverClass))
#define VALADOC_IS_SYMBOL_RESOLVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_TYPE_SYMBOL_RESOLVER))
#define VALADOC_IS_SYMBOL_RESOLVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_TYPE_SYMBOL_RESOLVER))
#define VALADOC_SYMBOL_RESOLVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_TYPE_SYMBOL_RESOLVER, ValadocSymbolResolverClass))

typedef struct _ValadocSymbolResolver ValadocSymbolResolver;
typedef struct _ValadocSymbolResolverClass ValadocSymbolResolverClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))

struct _ValadocGirWriter {
	ValaGIRWriter parent_instance;
	ValadocGirWriterPrivate * priv;
};

struct _ValadocGirWriterClass {
	ValaGIRWriterClass parent_class;
};

struct _ValadocGirWriterPrivate {
	ValadocGtkdocRenderer* renderer;
	ValadocSymbolResolver* resolver;
};

static gint ValadocGirWriter_private_offset;
static gpointer valadoc_gir_writer_parent_class = NULL;

VALA_EXTERN GType valadoc_gir_writer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValadocGirWriter, vala_code_visitor_unref)
VALA_EXTERN GType valadoc_symbol_resolver_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValadocSymbolResolver, g_object_unref)
VALA_EXTERN ValadocGirWriter* valadoc_gir_writer_new (ValadocSymbolResolver* resolver);
VALA_EXTERN ValadocGirWriter* valadoc_gir_writer_construct (GType object_type,
                                                ValadocSymbolResolver* resolver);
static gchar* valadoc_gir_writer_translate (ValadocGirWriter* self,
                                     ValadocContentComment* documentation);
static gchar* valadoc_gir_writer_translate_taglet (ValadocGirWriter* self,
                                            ValadocContentTaglet* taglet);
static gchar* valadoc_gir_writer_real_get_interface_comment (ValaGIRWriter* base,
                                                      ValaInterface* viface);
VALA_EXTERN ValadocApiSymbol* valadoc_symbol_resolver_resolve (ValadocSymbolResolver* self,
                                                   ValaSymbol* symbol);
static gchar* valadoc_gir_writer_real_get_struct_comment (ValaGIRWriter* base,
                                                   ValaStruct* vst);
static gchar* valadoc_gir_writer_real_get_enum_comment (ValaGIRWriter* base,
                                                 ValaEnum* ven);
static gchar* valadoc_gir_writer_real_get_class_comment (ValaGIRWriter* base,
                                                  ValaClass* vc);
static gchar* valadoc_gir_writer_real_get_error_code_comment (ValaGIRWriter* base,
                                                       ValaErrorCode* vecode);
static gchar* valadoc_gir_writer_real_get_enum_value_comment (ValaGIRWriter* base,
                                                       ValaEnumValue* vev);
static gchar* valadoc_gir_writer_real_get_constant_comment (ValaGIRWriter* base,
                                                     ValaConstant* vc);
static gchar* valadoc_gir_writer_real_get_error_domain_comment (ValaGIRWriter* base,
                                                         ValaErrorDomain* vedomain);
static gchar* valadoc_gir_writer_real_get_field_comment (ValaGIRWriter* base,
                                                  ValaField* vf);
static gchar* valadoc_gir_writer_real_get_delegate_comment (ValaGIRWriter* base,
                                                     ValaDelegate* vcb);
static gchar* valadoc_gir_writer_real_get_method_comment (ValaGIRWriter* base,
                                                   ValaMethod* vm);
static gchar* valadoc_gir_writer_real_get_property_comment (ValaGIRWriter* base,
                                                     ValaProperty* vprop);
static gchar* valadoc_gir_writer_real_get_delegate_return_comment (ValaGIRWriter* base,
                                                            ValaDelegate* vcb);
static gchar* valadoc_gir_writer_real_get_signal_return_comment (ValaGIRWriter* base,
                                                          ValaSignal* vsig);
static gchar* valadoc_gir_writer_real_get_method_return_comment (ValaGIRWriter* base,
                                                          ValaMethod* vm);
static gchar* valadoc_gir_writer_real_get_signal_comment (ValaGIRWriter* base,
                                                   ValaSignal* vsig);
static gchar* valadoc_gir_writer_real_get_parameter_comment (ValaGIRWriter* base,
                                                      ValaParameter* param);
static void valadoc_gir_writer_finalize (ValaCodeVisitor * obj);
static GType valadoc_gir_writer_get_type_once (void);

static inline gpointer
valadoc_gir_writer_get_instance_private (ValadocGirWriter* self)
{
	return G_STRUCT_MEMBER_P (self, ValadocGirWriter_private_offset);
}

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

ValadocGirWriter*
valadoc_gir_writer_construct (GType object_type,
                              ValadocSymbolResolver* resolver)
{
	ValadocGirWriter* self = NULL;
	ValadocGtkdocRenderer* _tmp0_;
	ValadocSymbolResolver* _tmp1_;
	g_return_val_if_fail (resolver != NULL, NULL);
	self = (ValadocGirWriter*) vala_gir_writer_construct (object_type);
	_tmp0_ = valadoc_gtkdoc_renderer_new ();
	_g_object_unref0 (self->priv->renderer);
	self->priv->renderer = _tmp0_;
	_tmp1_ = _g_object_ref0 (resolver);
	_g_object_unref0 (self->priv->resolver);
	self->priv->resolver = _tmp1_;
	return self;
}

ValadocGirWriter*
valadoc_gir_writer_new (ValadocSymbolResolver* resolver)
{
	return valadoc_gir_writer_construct (VALADOC_TYPE_GIR_WRITER, resolver);
}

static gchar*
valadoc_gir_writer_translate (ValadocGirWriter* self,
                              ValadocContentComment* documentation)
{
	ValadocGtkdocRenderer* _tmp0_;
	ValadocGtkdocRenderer* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (documentation == NULL) {
		result = NULL;
		return result;
	}
	_tmp0_ = self->priv->renderer;
	valadoc_gtkdoc_renderer_render_symbol (_tmp0_, documentation);
	_tmp1_ = self->priv->renderer;
	_tmp2_ = valadoc_gtkdoc_renderer_get_content (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = valadoc_markup_writer_escape (_tmp3_);
	result = _tmp4_;
	return result;
}

static gchar*
valadoc_gir_writer_translate_taglet (ValadocGirWriter* self,
                                     ValadocContentTaglet* taglet)
{
	ValadocGtkdocRenderer* _tmp0_;
	ValadocGtkdocRenderer* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (taglet == NULL) {
		result = NULL;
		return result;
	}
	_tmp0_ = self->priv->renderer;
	valadoc_content_content_renderer_render_children ((ValadocContentContentRenderer*) _tmp0_, (ValadocContentContentElement*) taglet);
	_tmp1_ = self->priv->renderer;
	_tmp2_ = valadoc_gtkdoc_renderer_get_content (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = valadoc_markup_writer_escape (_tmp3_);
	result = _tmp4_;
	return result;
}

static gchar*
valadoc_gir_writer_real_get_interface_comment (ValaGIRWriter* base,
                                               ValaInterface* viface)
{
	ValadocGirWriter * self;
	ValadocApiInterface* iface = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiInterface* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (viface != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) viface);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_INTERFACE) ? ((ValadocApiInterface*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	iface = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) iface);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (iface);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_struct_comment (ValaGIRWriter* base,
                                            ValaStruct* vst)
{
	ValadocGirWriter * self;
	ValadocApiStruct* st = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiStruct* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vst != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vst);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_STRUCT) ? ((ValadocApiStruct*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	st = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) st);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (st);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_enum_comment (ValaGIRWriter* base,
                                          ValaEnum* ven)
{
	ValadocGirWriter * self;
	ValadocApiEnum* en = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiEnum* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (ven != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) ven);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_ENUM) ? ((ValadocApiEnum*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	en = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) en);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (en);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_class_comment (ValaGIRWriter* base,
                                           ValaClass* vc)
{
	ValadocGirWriter * self;
	ValadocApiClass* c = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiClass* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vc != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vc);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_CLASS) ? ((ValadocApiClass*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	c = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) c);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (c);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_error_code_comment (ValaGIRWriter* base,
                                                ValaErrorCode* vecode)
{
	ValadocGirWriter * self;
	ValadocApiErrorCode* ecode = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiErrorCode* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vecode != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vecode);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_ERROR_CODE) ? ((ValadocApiErrorCode*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	ecode = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) ecode);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (ecode);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_enum_value_comment (ValaGIRWriter* base,
                                                ValaEnumValue* vev)
{
	ValadocGirWriter * self;
	ValadocApiEnumValue* ev = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiEnumValue* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vev != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vev);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_ENUM_VALUE) ? ((ValadocApiEnumValue*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	ev = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) ev);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (ev);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_constant_comment (ValaGIRWriter* base,
                                              ValaConstant* vc)
{
	ValadocGirWriter * self;
	ValadocApiConstant* c = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiConstant* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vc != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vc);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_CONSTANT) ? ((ValadocApiConstant*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	c = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) c);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (c);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_error_domain_comment (ValaGIRWriter* base,
                                                  ValaErrorDomain* vedomain)
{
	ValadocGirWriter * self;
	ValadocApiErrorDomain* edomain = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiErrorDomain* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vedomain != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vedomain);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_ERROR_DOMAIN) ? ((ValadocApiErrorDomain*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	edomain = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) edomain);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (edomain);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_field_comment (ValaGIRWriter* base,
                                           ValaField* vf)
{
	ValadocGirWriter * self;
	ValadocApiField* f = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiField* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vf != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vf);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_FIELD) ? ((ValadocApiField*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	f = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) f);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (f);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_delegate_comment (ValaGIRWriter* base,
                                              ValaDelegate* vcb)
{
	ValadocGirWriter * self;
	ValadocApiDelegate* cb = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiDelegate* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vcb != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vcb);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_DELEGATE) ? ((ValadocApiDelegate*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	cb = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) cb);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (cb);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_method_comment (ValaGIRWriter* base,
                                            ValaMethod* vm)
{
	ValadocGirWriter * self;
	ValadocApiMethod* m = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiMethod* _tmp2_;
	ValadocApiMethod* _tmp3_;
	ValadocApiMethod* _tmp4_;
	ValadocContentComment* _tmp5_;
	ValadocContentComment* _tmp6_;
	gchar* _tmp7_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vm != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vm);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_METHOD) ? ((ValadocApiMethod*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	m = _tmp2_;
	_tmp3_ = m;
	if (_tmp3_ == NULL) {
		result = NULL;
		_g_object_unref0 (m);
		return result;
	}
	_tmp4_ = m;
	_tmp5_ = valadoc_api_node_get_documentation ((ValadocApiNode*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = valadoc_gir_writer_translate (self, _tmp6_);
	result = _tmp7_;
	_g_object_unref0 (m);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_property_comment (ValaGIRWriter* base,
                                              ValaProperty* vprop)
{
	ValadocGirWriter * self;
	ValadocApiProperty* prop = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiProperty* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vprop != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vprop);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_PROPERTY) ? ((ValadocApiProperty*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	prop = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) prop);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (prop);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_delegate_return_comment (ValaGIRWriter* base,
                                                     ValaDelegate* vcb)
{
	ValadocGirWriter * self;
	ValadocApiDelegate* cb = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiDelegate* _tmp2_;
	ValadocApiDelegate* _tmp3_;
	ValadocContentComment* documentation = NULL;
	ValadocApiDelegate* _tmp4_;
	ValadocContentComment* _tmp5_;
	ValadocContentComment* _tmp6_;
	ValadocContentComment* _tmp7_;
	ValadocContentComment* _tmp8_;
	ValaList* taglets = NULL;
	ValadocContentComment* _tmp9_;
	ValadocApiDelegate* _tmp10_;
	ValaList* _tmp11_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vcb != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vcb);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_DELEGATE) ? ((ValadocApiDelegate*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	cb = _tmp2_;
	_tmp3_ = cb;
	if (_tmp3_ == NULL) {
		result = NULL;
		_g_object_unref0 (cb);
		return result;
	}
	_tmp4_ = cb;
	_tmp5_ = valadoc_api_node_get_documentation ((ValadocApiNode*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	documentation = _tmp7_;
	_tmp8_ = documentation;
	if (_tmp8_ == NULL) {
		result = NULL;
		_g_object_unref0 (documentation);
		_g_object_unref0 (cb);
		return result;
	}
	_tmp9_ = documentation;
	_tmp10_ = cb;
	_tmp11_ = valadoc_content_comment_find_taglets (_tmp9_, (ValadocApiNode*) _tmp10_, VALADOC_TAGLETS_TYPE_RETURN);
	taglets = _tmp11_;
	{
		ValaList* _taglet_list = NULL;
		ValaList* _tmp12_;
		gint _taglet_size = 0;
		ValaList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _taglet_index = 0;
		_tmp12_ = taglets;
		_taglet_list = _tmp12_;
		_tmp13_ = _taglet_list;
		_tmp14_ = vala_collection_get_size ((ValaCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_taglet_size = _tmp15_;
		_taglet_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			ValadocContentTaglet* taglet = NULL;
			ValaList* _tmp18_;
			gpointer _tmp19_;
			ValadocContentTaglet* _tmp20_;
			gchar* _tmp21_;
			_taglet_index = _taglet_index + 1;
			_tmp16_ = _taglet_index;
			_tmp17_ = _taglet_size;
			if (!(_tmp16_ < _tmp17_)) {
				break;
			}
			_tmp18_ = _taglet_list;
			_tmp19_ = vala_list_get (_tmp18_, _taglet_index);
			taglet = (ValadocContentTaglet*) _tmp19_;
			_tmp20_ = taglet;
			_tmp21_ = valadoc_gir_writer_translate_taglet (self, _tmp20_);
			result = _tmp21_;
			_g_object_unref0 (taglet);
			_vala_iterable_unref0 (taglets);
			_g_object_unref0 (documentation);
			_g_object_unref0 (cb);
			return result;
		}
	}
	result = NULL;
	_vala_iterable_unref0 (taglets);
	_g_object_unref0 (documentation);
	_g_object_unref0 (cb);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_signal_return_comment (ValaGIRWriter* base,
                                                   ValaSignal* vsig)
{
	ValadocGirWriter * self;
	ValadocApiSignal* sig = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiSignal* _tmp2_;
	ValadocApiSignal* _tmp3_;
	ValadocContentComment* documentation = NULL;
	ValadocApiSignal* _tmp4_;
	ValadocContentComment* _tmp5_;
	ValadocContentComment* _tmp6_;
	ValadocContentComment* _tmp7_;
	ValadocContentComment* _tmp8_;
	ValaList* taglets = NULL;
	ValadocContentComment* _tmp9_;
	ValadocApiSignal* _tmp10_;
	ValaList* _tmp11_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vsig != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vsig);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_SIGNAL) ? ((ValadocApiSignal*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	sig = _tmp2_;
	_tmp3_ = sig;
	if (_tmp3_ == NULL) {
		result = NULL;
		_g_object_unref0 (sig);
		return result;
	}
	_tmp4_ = sig;
	_tmp5_ = valadoc_api_node_get_documentation ((ValadocApiNode*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	documentation = _tmp7_;
	_tmp8_ = documentation;
	if (_tmp8_ == NULL) {
		result = NULL;
		_g_object_unref0 (documentation);
		_g_object_unref0 (sig);
		return result;
	}
	_tmp9_ = documentation;
	_tmp10_ = sig;
	_tmp11_ = valadoc_content_comment_find_taglets (_tmp9_, (ValadocApiNode*) _tmp10_, VALADOC_TAGLETS_TYPE_RETURN);
	taglets = _tmp11_;
	{
		ValaList* _taglet_list = NULL;
		ValaList* _tmp12_;
		gint _taglet_size = 0;
		ValaList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _taglet_index = 0;
		_tmp12_ = taglets;
		_taglet_list = _tmp12_;
		_tmp13_ = _taglet_list;
		_tmp14_ = vala_collection_get_size ((ValaCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_taglet_size = _tmp15_;
		_taglet_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			ValadocContentTaglet* taglet = NULL;
			ValaList* _tmp18_;
			gpointer _tmp19_;
			ValadocContentTaglet* _tmp20_;
			gchar* _tmp21_;
			_taglet_index = _taglet_index + 1;
			_tmp16_ = _taglet_index;
			_tmp17_ = _taglet_size;
			if (!(_tmp16_ < _tmp17_)) {
				break;
			}
			_tmp18_ = _taglet_list;
			_tmp19_ = vala_list_get (_tmp18_, _taglet_index);
			taglet = (ValadocContentTaglet*) _tmp19_;
			_tmp20_ = taglet;
			_tmp21_ = valadoc_gir_writer_translate_taglet (self, _tmp20_);
			result = _tmp21_;
			_g_object_unref0 (taglet);
			_vala_iterable_unref0 (taglets);
			_g_object_unref0 (documentation);
			_g_object_unref0 (sig);
			return result;
		}
	}
	result = NULL;
	_vala_iterable_unref0 (taglets);
	_g_object_unref0 (documentation);
	_g_object_unref0 (sig);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_method_return_comment (ValaGIRWriter* base,
                                                   ValaMethod* vm)
{
	ValadocGirWriter * self;
	ValadocApiMethod* m = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiMethod* _tmp2_;
	ValadocApiMethod* _tmp3_;
	ValadocContentComment* documentation = NULL;
	ValadocApiMethod* _tmp4_;
	ValadocContentComment* _tmp5_;
	ValadocContentComment* _tmp6_;
	ValadocContentComment* _tmp7_;
	ValadocContentComment* _tmp8_;
	ValaList* taglets = NULL;
	ValadocContentComment* _tmp9_;
	ValadocApiMethod* _tmp10_;
	ValaList* _tmp11_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vm != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vm);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_METHOD) ? ((ValadocApiMethod*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	m = _tmp2_;
	_tmp3_ = m;
	if (_tmp3_ == NULL) {
		result = NULL;
		_g_object_unref0 (m);
		return result;
	}
	_tmp4_ = m;
	_tmp5_ = valadoc_api_node_get_documentation ((ValadocApiNode*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	documentation = _tmp7_;
	_tmp8_ = documentation;
	if (_tmp8_ == NULL) {
		result = NULL;
		_g_object_unref0 (documentation);
		_g_object_unref0 (m);
		return result;
	}
	_tmp9_ = documentation;
	_tmp10_ = m;
	_tmp11_ = valadoc_content_comment_find_taglets (_tmp9_, (ValadocApiNode*) _tmp10_, VALADOC_TAGLETS_TYPE_RETURN);
	taglets = _tmp11_;
	{
		ValaList* _taglet_list = NULL;
		ValaList* _tmp12_;
		gint _taglet_size = 0;
		ValaList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _taglet_index = 0;
		_tmp12_ = taglets;
		_taglet_list = _tmp12_;
		_tmp13_ = _taglet_list;
		_tmp14_ = vala_collection_get_size ((ValaCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_taglet_size = _tmp15_;
		_taglet_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			ValadocContentTaglet* taglet = NULL;
			ValaList* _tmp18_;
			gpointer _tmp19_;
			ValadocContentTaglet* _tmp20_;
			gchar* _tmp21_;
			_taglet_index = _taglet_index + 1;
			_tmp16_ = _taglet_index;
			_tmp17_ = _taglet_size;
			if (!(_tmp16_ < _tmp17_)) {
				break;
			}
			_tmp18_ = _taglet_list;
			_tmp19_ = vala_list_get (_tmp18_, _taglet_index);
			taglet = (ValadocContentTaglet*) _tmp19_;
			_tmp20_ = taglet;
			_tmp21_ = valadoc_gir_writer_translate_taglet (self, _tmp20_);
			result = _tmp21_;
			_g_object_unref0 (taglet);
			_vala_iterable_unref0 (taglets);
			_g_object_unref0 (documentation);
			_g_object_unref0 (m);
			return result;
		}
	}
	result = NULL;
	_vala_iterable_unref0 (taglets);
	_g_object_unref0 (documentation);
	_g_object_unref0 (m);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_signal_comment (ValaGIRWriter* base,
                                            ValaSignal* vsig)
{
	ValadocGirWriter * self;
	ValadocApiSignal* sig = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValadocApiSymbol* _tmp1_;
	ValadocApiSignal* _tmp2_;
	ValadocContentComment* _tmp3_;
	ValadocContentComment* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (vsig != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = valadoc_symbol_resolver_resolve (_tmp0_, (ValaSymbol*) vsig);
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_API_TYPE_SIGNAL) ? ((ValadocApiSignal*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	sig = _tmp2_;
	_tmp3_ = valadoc_api_node_get_documentation ((ValadocApiNode*) sig);
	_tmp4_ = _tmp3_;
	_tmp5_ = valadoc_gir_writer_translate (self, _tmp4_);
	result = _tmp5_;
	_g_object_unref0 (sig);
	return result;
}

static gchar*
valadoc_gir_writer_real_get_parameter_comment (ValaGIRWriter* base,
                                               ValaParameter* param)
{
	ValadocGirWriter * self;
	ValadocApiSymbol* symbol = NULL;
	ValadocSymbolResolver* _tmp0_;
	ValaSymbol* _tmp1_;
	ValaSymbol* _tmp2_;
	ValadocApiSymbol* _tmp3_;
	ValadocApiSymbol* _tmp4_;
	ValadocContentComment* documentation = NULL;
	ValadocApiSymbol* _tmp5_;
	ValadocContentComment* _tmp6_;
	ValadocContentComment* _tmp7_;
	ValadocContentComment* _tmp8_;
	ValadocContentComment* _tmp9_;
	ValaList* taglets = NULL;
	ValadocContentComment* _tmp10_;
	ValadocApiSymbol* _tmp11_;
	ValaList* _tmp12_;
	gchar* result;
	self = (ValadocGirWriter*) base;
	g_return_val_if_fail (param != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = vala_symbol_get_parent_symbol ((ValaSymbol*) param);
	_tmp2_ = _tmp1_;
	_tmp3_ = valadoc_symbol_resolver_resolve (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, VALA_TYPE_SYMBOL, ValaSymbol));
	symbol = _tmp3_;
	_tmp4_ = symbol;
	if (_tmp4_ == NULL) {
		result = NULL;
		_g_object_unref0 (symbol);
		return result;
	}
	_tmp5_ = symbol;
	_tmp6_ = valadoc_api_node_get_documentation ((ValadocApiNode*) _tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	documentation = _tmp8_;
	_tmp9_ = documentation;
	if (_tmp9_ == NULL) {
		result = NULL;
		_g_object_unref0 (documentation);
		_g_object_unref0 (symbol);
		return result;
	}
	_tmp10_ = documentation;
	_tmp11_ = symbol;
	_tmp12_ = valadoc_content_comment_find_taglets (_tmp10_, (ValadocApiNode*) _tmp11_, VALADOC_TAGLETS_TYPE_PARAM);
	taglets = _tmp12_;
	{
		ValaList* __taglet_list = NULL;
		ValaList* _tmp13_;
		gint __taglet_size = 0;
		ValaList* _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		gint __taglet_index = 0;
		_tmp13_ = taglets;
		__taglet_list = _tmp13_;
		_tmp14_ = __taglet_list;
		_tmp15_ = vala_collection_get_size ((ValaCollection*) _tmp14_);
		_tmp16_ = _tmp15_;
		__taglet_size = _tmp16_;
		__taglet_index = -1;
		while (TRUE) {
			gint _tmp17_;
			gint _tmp18_;
			ValadocContentTaglet* _taglet = NULL;
			ValaList* _tmp19_;
			gpointer _tmp20_;
			ValadocTagletsParam* taglet = NULL;
			ValadocContentTaglet* _tmp21_;
			ValadocTagletsParam* _tmp22_;
			ValadocTagletsParam* _tmp23_;
			const gchar* _tmp24_;
			const gchar* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			__taglet_index = __taglet_index + 1;
			_tmp17_ = __taglet_index;
			_tmp18_ = __taglet_size;
			if (!(_tmp17_ < _tmp18_)) {
				break;
			}
			_tmp19_ = __taglet_list;
			_tmp20_ = vala_list_get (_tmp19_, __taglet_index);
			_taglet = (ValadocContentTaglet*) _tmp20_;
			_tmp21_ = _taglet;
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, VALADOC_TAGLETS_TYPE_PARAM, ValadocTagletsParam));
			taglet = _tmp22_;
			_tmp23_ = taglet;
			_tmp24_ = valadoc_taglets_param_get_parameter_name (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = vala_symbol_get_name ((ValaSymbol*) param);
			_tmp27_ = _tmp26_;
			if (g_strcmp0 (_tmp25_, _tmp27_) == 0) {
				ValadocTagletsParam* _tmp28_;
				gchar* _tmp29_;
				_tmp28_ = taglet;
				_tmp29_ = valadoc_gir_writer_translate_taglet (self, (ValadocContentTaglet*) _tmp28_);
				result = _tmp29_;
				_g_object_unref0 (taglet);
				_g_object_unref0 (_taglet);
				_vala_iterable_unref0 (taglets);
				_g_object_unref0 (documentation);
				_g_object_unref0 (symbol);
				return result;
			}
			_g_object_unref0 (taglet);
			_g_object_unref0 (_taglet);
		}
	}
	result = NULL;
	_vala_iterable_unref0 (taglets);
	_g_object_unref0 (documentation);
	_g_object_unref0 (symbol);
	return result;
}

static void
valadoc_gir_writer_class_init (ValadocGirWriterClass * klass,
                               gpointer klass_data)
{
	valadoc_gir_writer_parent_class = g_type_class_peek_parent (klass);
	((ValaCodeVisitorClass *) klass)->finalize = valadoc_gir_writer_finalize;
	g_type_class_adjust_private_offset (klass, &ValadocGirWriter_private_offset);
	((ValaGIRWriterClass *) klass)->get_interface_comment = (gchar* (*) (ValaGIRWriter*, ValaInterface*)) valadoc_gir_writer_real_get_interface_comment;
	((ValaGIRWriterClass *) klass)->get_struct_comment = (gchar* (*) (ValaGIRWriter*, ValaStruct*)) valadoc_gir_writer_real_get_struct_comment;
	((ValaGIRWriterClass *) klass)->get_enum_comment = (gchar* (*) (ValaGIRWriter*, ValaEnum*)) valadoc_gir_writer_real_get_enum_comment;
	((ValaGIRWriterClass *) klass)->get_class_comment = (gchar* (*) (ValaGIRWriter*, ValaClass*)) valadoc_gir_writer_real_get_class_comment;
	((ValaGIRWriterClass *) klass)->get_error_code_comment = (gchar* (*) (ValaGIRWriter*, ValaErrorCode*)) valadoc_gir_writer_real_get_error_code_comment;
	((ValaGIRWriterClass *) klass)->get_enum_value_comment = (gchar* (*) (ValaGIRWriter*, ValaEnumValue*)) valadoc_gir_writer_real_get_enum_value_comment;
	((ValaGIRWriterClass *) klass)->get_constant_comment = (gchar* (*) (ValaGIRWriter*, ValaConstant*)) valadoc_gir_writer_real_get_constant_comment;
	((ValaGIRWriterClass *) klass)->get_error_domain_comment = (gchar* (*) (ValaGIRWriter*, ValaErrorDomain*)) valadoc_gir_writer_real_get_error_domain_comment;
	((ValaGIRWriterClass *) klass)->get_field_comment = (gchar* (*) (ValaGIRWriter*, ValaField*)) valadoc_gir_writer_real_get_field_comment;
	((ValaGIRWriterClass *) klass)->get_delegate_comment = (gchar* (*) (ValaGIRWriter*, ValaDelegate*)) valadoc_gir_writer_real_get_delegate_comment;
	((ValaGIRWriterClass *) klass)->get_method_comment = (gchar* (*) (ValaGIRWriter*, ValaMethod*)) valadoc_gir_writer_real_get_method_comment;
	((ValaGIRWriterClass *) klass)->get_property_comment = (gchar* (*) (ValaGIRWriter*, ValaProperty*)) valadoc_gir_writer_real_get_property_comment;
	((ValaGIRWriterClass *) klass)->get_delegate_return_comment = (gchar* (*) (ValaGIRWriter*, ValaDelegate*)) valadoc_gir_writer_real_get_delegate_return_comment;
	((ValaGIRWriterClass *) klass)->get_signal_return_comment = (gchar* (*) (ValaGIRWriter*, ValaSignal*)) valadoc_gir_writer_real_get_signal_return_comment;
	((ValaGIRWriterClass *) klass)->get_method_return_comment = (gchar* (*) (ValaGIRWriter*, ValaMethod*)) valadoc_gir_writer_real_get_method_return_comment;
	((ValaGIRWriterClass *) klass)->get_signal_comment = (gchar* (*) (ValaGIRWriter*, ValaSignal*)) valadoc_gir_writer_real_get_signal_comment;
	((ValaGIRWriterClass *) klass)->get_parameter_comment = (gchar* (*) (ValaGIRWriter*, ValaParameter*)) valadoc_gir_writer_real_get_parameter_comment;
}

static void
valadoc_gir_writer_instance_init (ValadocGirWriter * self,
                                  gpointer klass)
{
	self->priv = valadoc_gir_writer_get_instance_private (self);
}

static void
valadoc_gir_writer_finalize (ValaCodeVisitor * obj)
{
	ValadocGirWriter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_TYPE_GIR_WRITER, ValadocGirWriter);
	_g_object_unref0 (self->priv->renderer);
	_g_object_unref0 (self->priv->resolver);
	VALA_CODE_VISITOR_CLASS (valadoc_gir_writer_parent_class)->finalize (obj);
}

/**
 * Code visitor generating .gir file for the public interface.
 */
static GType
valadoc_gir_writer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValadocGirWriterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_gir_writer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocGirWriter), 0, (GInstanceInitFunc) valadoc_gir_writer_instance_init, NULL };
	GType valadoc_gir_writer_type_id;
	valadoc_gir_writer_type_id = g_type_register_static (VALA_TYPE_GIR_WRITER, "ValadocGirWriter", &g_define_type_info, 0);
	ValadocGirWriter_private_offset = g_type_add_instance_private (valadoc_gir_writer_type_id, sizeof (ValadocGirWriterPrivate));
	return valadoc_gir_writer_type_id;
}

GType
valadoc_gir_writer_get_type (void)
{
	static volatile gsize valadoc_gir_writer_type_id__once = 0;
	if (g_once_init_enter (&valadoc_gir_writer_type_id__once)) {
		GType valadoc_gir_writer_type_id;
		valadoc_gir_writer_type_id = valadoc_gir_writer_get_type_once ();
		g_once_init_leave (&valadoc_gir_writer_type_id__once, valadoc_gir_writer_type_id);
	}
	return valadoc_gir_writer_type_id__once;
}

