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

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
/*
 *
 * Copyright (C) 2016  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:
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include "gxml/gxml.h"
#include <glib.h>
#include <stdlib.h>
#include <string.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_range_get_type_once (void);

static GType
gxml_dom_range_boundary_points_get_type_once (void)
{
	static const GEnumValue values[] = {{GXML_DOM_RANGE_BOUNDARY_POINTS_START_TO_START, "GXML_DOM_RANGE_BOUNDARY_POINTS_START_TO_START", "start-to-start"}, {GXML_DOM_RANGE_BOUNDARY_POINTS_START_TO_END, "GXML_DOM_RANGE_BOUNDARY_POINTS_START_TO_END", "start-to-end"}, {GXML_DOM_RANGE_BOUNDARY_POINTS_END_TO_END, "GXML_DOM_RANGE_BOUNDARY_POINTS_END_TO_END", "end-to-end"}, {GXML_DOM_RANGE_BOUNDARY_POINTS_END_TO_START, "GXML_DOM_RANGE_BOUNDARY_POINTS_END_TO_START", "end-to-start"}, {0, NULL, NULL}};
	GType gxml_dom_range_boundary_points_type_id;
	gxml_dom_range_boundary_points_type_id = g_enum_register_static ("GXmlDomRangeBoundaryPoints", values);
	return gxml_dom_range_boundary_points_type_id;
}

GType
gxml_dom_range_boundary_points_get_type (void)
{
	static volatile gsize gxml_dom_range_boundary_points_type_id__once = 0;
	if (g_once_init_enter (&gxml_dom_range_boundary_points_type_id__once)) {
		GType gxml_dom_range_boundary_points_type_id;
		gxml_dom_range_boundary_points_type_id = gxml_dom_range_boundary_points_get_type_once ();
		g_once_init_leave (&gxml_dom_range_boundary_points_type_id__once, gxml_dom_range_boundary_points_type_id);
	}
	return gxml_dom_range_boundary_points_type_id__once;
}

GXmlDomNode*
gxml_dom_range_get_start_container (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->get_start_container) {
		return _iface_->get_start_container (self);
	}
	return NULL;
}

gint
gxml_dom_range_get_start_offset (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->get_start_offset) {
		return _iface_->get_start_offset (self);
	}
	return -1;
}

GXmlDomNode*
gxml_dom_range_get_end_container (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->get_end_container) {
		return _iface_->get_end_container (self);
	}
	return NULL;
}

gint
gxml_dom_range_get_end_offset (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->get_end_offset) {
		return _iface_->get_end_offset (self);
	}
	return -1;
}

gboolean
gxml_dom_range_get_collapsed (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->get_collapsed) {
		return _iface_->get_collapsed (self);
	}
	return FALSE;
}

GXmlDomNode*
gxml_dom_range_get_common_ancestor_container (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->get_common_ancestor_container) {
		return _iface_->get_common_ancestor_container (self);
	}
	return NULL;
}

void
gxml_dom_range_set_start (GXmlDomRange* self,
                          GXmlDomNode* node,
                          gint offset,
                          GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->set_start) {
		_iface_->set_start (self, node, offset, error);
	}
}

void
gxml_dom_range_set_end (GXmlDomRange* self,
                        GXmlDomNode* node,
                        gint offset,
                        GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->set_end) {
		_iface_->set_end (self, node, offset, error);
	}
}

void
gxml_dom_range_set_start_before (GXmlDomRange* self,
                                 GXmlDomNode* node,
                                 GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->set_start_before) {
		_iface_->set_start_before (self, node, error);
	}
}

void
gxml_dom_range_set_start_after (GXmlDomRange* self,
                                GXmlDomNode* node,
                                GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->set_start_after) {
		_iface_->set_start_after (self, node, error);
	}
}

void
gxml_dom_range_set_end_before (GXmlDomRange* self,
                               GXmlDomNode* node,
                               GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->set_end_before) {
		_iface_->set_end_before (self, node, error);
	}
}

void
gxml_dom_range_set_end_after (GXmlDomRange* self,
                              GXmlDomNode* node,
                              GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->set_end_after) {
		_iface_->set_end_after (self, node, error);
	}
}

void
gxml_dom_range_collapse (GXmlDomRange* self,
                         gboolean to_start,
                         GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->collapse) {
		_iface_->collapse (self, to_start, error);
	}
}

void
gxml_dom_range_select_node (GXmlDomRange* self,
                            GXmlDomNode* node,
                            GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->select_node) {
		_iface_->select_node (self, node, error);
	}
}

void
gxml_dom_range_select_node_contents (GXmlDomRange* self,
                                     GXmlDomNode* node,
                                     GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->select_node_contents) {
		_iface_->select_node_contents (self, node, error);
	}
}

gint
gxml_dom_range_compare_boundary_points (GXmlDomRange* self,
                                        GXmlDomRangeBoundaryPoints how,
                                        GXmlDomRange* sourceRange,
                                        GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->compare_boundary_points) {
		return _iface_->compare_boundary_points (self, how, sourceRange, error);
	}
	return -1;
}

void
gxml_dom_range_delete_contents (GXmlDomRange* self,
                                GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->delete_contents) {
		_iface_->delete_contents (self, error);
	}
}

GXmlDomDocumentFragment*
gxml_dom_range_extract_contents (GXmlDomRange* self,
                                 GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->extract_contents) {
		return _iface_->extract_contents (self, error);
	}
	return NULL;
}

GXmlDomDocumentFragment*
gxml_dom_range_clone_contents (GXmlDomRange* self,
                               GError** error)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->clone_contents) {
		return _iface_->clone_contents (self, error);
	}
	return NULL;
}

void
gxml_dom_range_insert_node (GXmlDomRange* self,
                            GXmlDomNode* node)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->insert_node) {
		_iface_->insert_node (self, node);
	}
}

void
gxml_dom_range_surround_contents (GXmlDomRange* self,
                                  GXmlDomNode* newParent)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->surround_contents) {
		_iface_->surround_contents (self, newParent);
	}
}

GXmlDomRange*
gxml_dom_range_clone_range (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->clone_range) {
		return _iface_->clone_range (self);
	}
	return NULL;
}

void
gxml_dom_range_detach (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->detach) {
		_iface_->detach (self);
	}
}

gboolean
gxml_dom_range_is_point_in_range (GXmlDomRange* self,
                                  GXmlDomNode* node,
                                  gint offset)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->is_point_in_range) {
		return _iface_->is_point_in_range (self, node, offset);
	}
	return FALSE;
}

gshort
gxml_dom_range_compare_point (GXmlDomRange* self,
                              GXmlDomNode* node,
                              gint offset)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->compare_point) {
		return _iface_->compare_point (self, node, offset);
	}
	return -1;
}

gboolean
gxml_dom_range_intersects_node (GXmlDomRange* self,
                                GXmlDomNode* node)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->intersects_node) {
		return _iface_->intersects_node (self, node);
	}
	return FALSE;
}

gchar*
gxml_dom_range_to_string (GXmlDomRange* self)
{
	GXmlDomRangeIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_DOM_RANGE_GET_INTERFACE (self);
	if (_iface_->to_string) {
		return _iface_->to_string (self);
	}
	return NULL;
}

static void
gxml_dom_range_default_init (GXmlDomRangeIface * iface,
                             gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_object ("start-container", "start-container", "start-container", GXML_TYPE_DOM_NODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_int ("start-offset", "start-offset", "start-offset", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_object ("end-container", "end-container", "end-container", GXML_TYPE_DOM_NODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_int ("end-offset", "end-offset", "end-offset", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_boolean ("collapsed", "collapsed", "collapsed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_object ("common-ancestor-container", "common-ancestor-container", "common-ancestor-container", GXML_TYPE_DOM_NODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static GType
gxml_dom_range_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlDomRangeIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_dom_range_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gxml_dom_range_type_id;
	gxml_dom_range_type_id = g_type_register_static (G_TYPE_INTERFACE, "GXmlDomRange", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (gxml_dom_range_type_id, G_TYPE_OBJECT);
	return gxml_dom_range_type_id;
}

GType
gxml_dom_range_get_type (void)
{
	static volatile gsize gxml_dom_range_type_id__once = 0;
	if (g_once_init_enter (&gxml_dom_range_type_id__once)) {
		GType gxml_dom_range_type_id;
		gxml_dom_range_type_id = gxml_dom_range_get_type_once ();
		g_once_init_leave (&gxml_dom_range_type_id__once, gxml_dom_range_type_id);
	}
	return gxml_dom_range_type_id__once;
}

