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

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
/* Html.vala
 *
 * Copyright (C) 2017  Daniel Espinosa <esodan@gmail.com>
 *
 * 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, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *      Yannick Inizan <inizan.yannick@gmail.com>
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include "gxml/gxml.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "gxml.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

static GType gxml_dom_html_document_get_type_once (void);

/**
 * This method reads HTML documents using default parser
 */
void
gxml_dom_html_document_read_from_string (GXmlDomHtmlDocument* self,
                                         const gchar* str,
                                         GError** error)
{
	GXmlDomHtmlDocumentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_HTML_DOCUMENT_GET_INTERFACE (self);
	if (_iface_->read_from_string) {
		_iface_->read_from_string (self, str, error);
	}
}

/**
 * This method reads HTML documents using default a very tolerant parser
 */
void
gxml_dom_html_document_read_from_string_tolerant (GXmlDomHtmlDocument* self,
                                                  const gchar* str,
                                                  GError** error)
{
	GXmlDomHtmlDocumentIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_HTML_DOCUMENT_GET_INTERFACE (self);
	if (_iface_->read_from_string_tolerant) {
		_iface_->read_from_string_tolerant (self, str, error);
	}
}

/**
 * This method dump to HTML string.
 */
gchar*
gxml_dom_html_document_to_html (GXmlDomHtmlDocument* self,
                                GError** error)
{
	GXmlDomHtmlDocumentIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_DOM_HTML_DOCUMENT_GET_INTERFACE (self);
	if (_iface_->to_html) {
		return _iface_->to_html (self, error);
	}
	return NULL;
}

static void
gxml_dom_html_document_default_init (GXmlDomHtmlDocumentIface * iface,
                                     gpointer iface_data)
{
}

/**
 * Interface for HTML handling implementation
 */
static GType
gxml_dom_html_document_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlDomHtmlDocumentIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_dom_html_document_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gxml_dom_html_document_type_id;
	gxml_dom_html_document_type_id = g_type_register_static (G_TYPE_INTERFACE, "GXmlDomHtmlDocument", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (gxml_dom_html_document_type_id, G_TYPE_OBJECT);
	g_type_interface_add_prerequisite (gxml_dom_html_document_type_id, GXML_TYPE_DOM_DOCUMENT);
	return gxml_dom_html_document_type_id;
}

GType
gxml_dom_html_document_get_type (void)
{
	static volatile gsize gxml_dom_html_document_type_id__once = 0;
	if (g_once_init_enter (&gxml_dom_html_document_type_id__once)) {
		GType gxml_dom_html_document_type_id;
		gxml_dom_html_document_type_id = gxml_dom_html_document_get_type_once ();
		g_once_init_leave (&gxml_dom_html_document_type_id__once, gxml_dom_html_document_type_id);
	}
	return gxml_dom_html_document_type_id__once;
}

