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

/* resourcelocator.vala
 *
 * Copyright (C) 2008-2009 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 "valadoc.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.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

enum  {
	VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_0_PROPERTY,
	VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_FILE_EXTENSION_PROPERTY,
	VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_NUM_PROPERTIES
};
static GParamSpec* valadoc_importer_documentation_importer_properties[VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _valadoc_api_tree_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_tree_unref (var), NULL)))

static gpointer valadoc_importer_documentation_importer_parent_class = NULL;
static ValadocResourceLocatorIface * valadoc_importer_documentation_importer_valadoc_resource_locator_parent_iface = NULL;

static gchar* valadoc_importer_documentation_importer_real_resolve (ValadocImporterDocumentationImporter* self,
                                                             const gchar* path);
static void valadoc_importer_documentation_importer_real_process (ValadocImporterDocumentationImporter* self,
                                                           const gchar* filename);
static void valadoc_importer_documentation_importer_finalize (GObject * obj);
static GType valadoc_importer_documentation_importer_get_type_once (void);
static void _vala_valadoc_importer_documentation_importer_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec);

const gchar*
valadoc_importer_documentation_importer_get_file_extension (ValadocImporterDocumentationImporter* self)
{
	ValadocImporterDocumentationImporterClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_GET_CLASS (self);
	if (_klass_->get_file_extension) {
		return _klass_->get_file_extension (self);
	}
	return NULL;
}

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

static gpointer
_valadoc_api_tree_ref0 (gpointer self)
{
	return self ? valadoc_api_tree_ref (self) : NULL;
}

ValadocImporterDocumentationImporter*
valadoc_importer_documentation_importer_construct (GType object_type,
                                                   ValadocApiTree* tree,
                                                   ValadocModuleLoader* modules,
                                                   ValadocSettings* settings)
{
	ValadocImporterDocumentationImporter * self = NULL;
	ValadocSettings* _tmp0_;
	ValadocApiTree* _tmp1_;
	g_return_val_if_fail (tree != NULL, NULL);
	g_return_val_if_fail (modules != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	self = (ValadocImporterDocumentationImporter*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (settings);
	_g_object_unref0 (self->settings);
	self->settings = _tmp0_;
	_g_object_unref0 (self->modules);
	self->modules = NULL;
	_tmp1_ = _valadoc_api_tree_ref0 (tree);
	_valadoc_api_tree_unref0 (self->tree);
	self->tree = _tmp1_;
	return self;
}

static gchar*
valadoc_importer_documentation_importer_real_resolve (ValadocImporterDocumentationImporter* self,
                                                      const gchar* path)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = g_strdup (path);
	result = _tmp0_;
	return result;
}

gchar*
valadoc_importer_documentation_importer_resolve (ValadocImporterDocumentationImporter* self,
                                                 const gchar* path)
{
	ValadocImporterDocumentationImporterClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_GET_CLASS (self);
	if (_klass_->resolve) {
		return _klass_->resolve (self, path);
	}
	return NULL;
}

static void
valadoc_importer_documentation_importer_real_process (ValadocImporterDocumentationImporter* self,
                                                      const gchar* filename)
{
	g_critical ("Type `%s' does not implement abstract method `valadoc_importer_documentation_importer_process'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
valadoc_importer_documentation_importer_process (ValadocImporterDocumentationImporter* self,
                                                 const gchar* filename)
{
	ValadocImporterDocumentationImporterClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_GET_CLASS (self);
	if (_klass_->process) {
		_klass_->process (self, filename);
	}
}

static void
valadoc_importer_documentation_importer_class_init (ValadocImporterDocumentationImporterClass * klass,
                                                    gpointer klass_data)
{
	valadoc_importer_documentation_importer_parent_class = g_type_class_peek_parent (klass);
	((ValadocImporterDocumentationImporterClass *) klass)->resolve = (gchar* (*) (ValadocImporterDocumentationImporter*, const gchar*)) valadoc_importer_documentation_importer_real_resolve;
	((ValadocImporterDocumentationImporterClass *) klass)->process = (void (*) (ValadocImporterDocumentationImporter*, const gchar*)) valadoc_importer_documentation_importer_real_process;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_importer_documentation_importer_get_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_importer_documentation_importer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_FILE_EXTENSION_PROPERTY, valadoc_importer_documentation_importer_properties[VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_FILE_EXTENSION_PROPERTY] = g_param_spec_string ("file-extension", "file-extension", "file-extension", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
valadoc_importer_documentation_importer_valadoc_resource_locator_interface_init (ValadocResourceLocatorIface * iface,
                                                                                 gpointer iface_data)
{
	valadoc_importer_documentation_importer_valadoc_resource_locator_parent_iface = g_type_interface_peek_parent (iface);
	iface->resolve = (gchar* (*) (ValadocResourceLocator*, const gchar*)) valadoc_importer_documentation_importer_resolve;
}

static void
valadoc_importer_documentation_importer_instance_init (ValadocImporterDocumentationImporter * self,
                                                       gpointer klass)
{
}

static void
valadoc_importer_documentation_importer_finalize (GObject * obj)
{
	ValadocImporterDocumentationImporter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_IMPORTER_TYPE_DOCUMENTATION_IMPORTER, ValadocImporterDocumentationImporter);
	_g_object_unref0 (self->modules);
	_g_object_unref0 (self->settings);
	_valadoc_api_tree_unref0 (self->tree);
	G_OBJECT_CLASS (valadoc_importer_documentation_importer_parent_class)->finalize (obj);
}

static GType
valadoc_importer_documentation_importer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValadocImporterDocumentationImporterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_importer_documentation_importer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocImporterDocumentationImporter), 0, (GInstanceInitFunc) valadoc_importer_documentation_importer_instance_init, NULL };
	static const GInterfaceInfo valadoc_resource_locator_info = { (GInterfaceInitFunc) valadoc_importer_documentation_importer_valadoc_resource_locator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType valadoc_importer_documentation_importer_type_id;
	valadoc_importer_documentation_importer_type_id = g_type_register_static (G_TYPE_OBJECT, "ValadocImporterDocumentationImporter", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (valadoc_importer_documentation_importer_type_id, VALADOC_TYPE_RESOURCE_LOCATOR, &valadoc_resource_locator_info);
	return valadoc_importer_documentation_importer_type_id;
}

GType
valadoc_importer_documentation_importer_get_type (void)
{
	static volatile gsize valadoc_importer_documentation_importer_type_id__once = 0;
	if (g_once_init_enter (&valadoc_importer_documentation_importer_type_id__once)) {
		GType valadoc_importer_documentation_importer_type_id;
		valadoc_importer_documentation_importer_type_id = valadoc_importer_documentation_importer_get_type_once ();
		g_once_init_leave (&valadoc_importer_documentation_importer_type_id__once, valadoc_importer_documentation_importer_type_id);
	}
	return valadoc_importer_documentation_importer_type_id__once;
}

static void
_vala_valadoc_importer_documentation_importer_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec)
{
	ValadocImporterDocumentationImporter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_IMPORTER_TYPE_DOCUMENTATION_IMPORTER, ValadocImporterDocumentationImporter);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

