/* gcp-source-range.c generated by valac 0.19.0, the Vala compiler
 * generated from gcp-source-range.vala, do not modify */

/*
 * This file is part of gedit-code-assistant.
 *
 * Copyright (C) 2011 - Jesse van den Kieboom
 *
 * gedit-code-assistant is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * gedit-code-assistant 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gedit-code-assistant.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>


#define GCP_TYPE_SOURCE_RANGE_SUPPORT (gcp_source_range_support_get_type ())
#define GCP_SOURCE_RANGE_SUPPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_SOURCE_RANGE_SUPPORT, GcpSourceRangeSupport))
#define GCP_IS_SOURCE_RANGE_SUPPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_SOURCE_RANGE_SUPPORT))
#define GCP_SOURCE_RANGE_SUPPORT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GCP_TYPE_SOURCE_RANGE_SUPPORT, GcpSourceRangeSupportIface))

typedef struct _GcpSourceRangeSupport GcpSourceRangeSupport;
typedef struct _GcpSourceRangeSupportIface GcpSourceRangeSupportIface;

#define GCP_TYPE_SOURCE_RANGE (gcp_source_range_get_type ())
#define GCP_SOURCE_RANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_SOURCE_RANGE, GcpSourceRange))
#define GCP_SOURCE_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_SOURCE_RANGE, GcpSourceRangeClass))
#define GCP_IS_SOURCE_RANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_SOURCE_RANGE))
#define GCP_IS_SOURCE_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_SOURCE_RANGE))
#define GCP_SOURCE_RANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_SOURCE_RANGE, GcpSourceRangeClass))

typedef struct _GcpSourceRange GcpSourceRange;
typedef struct _GcpSourceRangeClass GcpSourceRangeClass;
typedef struct _GcpSourceRangePrivate GcpSourceRangePrivate;

#define GCP_TYPE_SOURCE_LOCATION (gcp_source_location_get_type ())
#define GCP_SOURCE_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_SOURCE_LOCATION, GcpSourceLocation))
#define GCP_SOURCE_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_SOURCE_LOCATION, GcpSourceLocationClass))
#define GCP_IS_SOURCE_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_SOURCE_LOCATION))
#define GCP_IS_SOURCE_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_SOURCE_LOCATION))
#define GCP_SOURCE_LOCATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_SOURCE_LOCATION, GcpSourceLocationClass))

typedef struct _GcpSourceLocation GcpSourceLocation;
typedef struct _GcpSourceLocationClass GcpSourceLocationClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GcpSourceRangeSupportIface {
	GTypeInterface parent_iface;
	GcpSourceRange* (*get_range) (GcpSourceRangeSupport* self);
	GcpSourceRange** (*get_ranges) (GcpSourceRangeSupport* self, int* result_length1);
};

struct _GcpSourceRange {
	GObject parent_instance;
	GcpSourceRangePrivate * priv;
};

struct _GcpSourceRangeClass {
	GObjectClass parent_class;
};

struct _GcpSourceRangePrivate {
	GcpSourceLocation* d_start;
	GcpSourceLocation* d_end;
};


static gpointer gcp_source_range_parent_class = NULL;
static GcpSourceRangeSupportIface* gcp_source_range_gcp_source_range_support_parent_iface = NULL;

GType gcp_source_range_get_type (void) G_GNUC_CONST;
GType gcp_source_range_support_get_type (void) G_GNUC_CONST;
GType gcp_source_location_get_type (void) G_GNUC_CONST;
#define GCP_SOURCE_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GCP_TYPE_SOURCE_RANGE, GcpSourceRangePrivate))
enum  {
	GCP_SOURCE_RANGE_DUMMY_PROPERTY,
	GCP_SOURCE_RANGE_RANGE,
	GCP_SOURCE_RANGE_START,
	GCP_SOURCE_RANGE_END
};
GcpSourceRange* gcp_source_range_new (GcpSourceLocation* start, GcpSourceLocation* end);
GcpSourceRange* gcp_source_range_construct (GType object_type, GcpSourceLocation* start, GcpSourceLocation* end);
gint gcp_source_range_compare_to (GcpSourceRange* self, GcpSourceRange* other);
gint gcp_source_location_compare_to (GcpSourceLocation* self, GcpSourceLocation* other);
gboolean gcp_source_range_get_iters (GcpSourceRange* self, GtkTextBuffer* buffer, GtkTextIter* start, GtkTextIter* end);
gboolean gcp_source_location_get_iter (GcpSourceLocation* self, GtkTextBuffer* buffer, GtkTextIter* iter);
gboolean gcp_source_range_contains_range (GcpSourceRange* self, GcpSourceRange* range);
gboolean gcp_source_range_contains_location (GcpSourceRange* self, GcpSourceLocation* location);
GcpSourceLocation* gcp_source_range_get_start (GcpSourceRange* self);
GcpSourceLocation* gcp_source_range_get_end (GcpSourceRange* self);
gboolean gcp_source_range_contains (GcpSourceRange* self, gint line, gint column);
gint gcp_source_location_get_line (GcpSourceLocation* self);
gint gcp_source_location_get_column (GcpSourceLocation* self);
gboolean gcp_source_range_contains_line (GcpSourceRange* self, gint line);
gchar* gcp_source_range_to_string (GcpSourceRange* self);
gchar* gcp_source_location_to_string (GcpSourceLocation* self);
static void gcp_source_range_finalize (GObject* obj);
GcpSourceRange* gcp_source_range_support_get_range (GcpSourceRangeSupport* self);
static void _vala_gcp_source_range_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


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


GcpSourceRange* gcp_source_range_construct (GType object_type, GcpSourceLocation* start, GcpSourceLocation* end) {
	GcpSourceRange * self = NULL;
	GcpSourceLocation* _tmp0_;
	GcpSourceLocation* _tmp1_;
	GcpSourceLocation* _tmp2_;
	GcpSourceLocation* _tmp3_;
	g_return_val_if_fail (start != NULL, NULL);
	g_return_val_if_fail (end != NULL, NULL);
	self = (GcpSourceRange*) g_object_new (object_type, NULL);
	_tmp0_ = start;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->d_start);
	self->priv->d_start = _tmp1_;
	_tmp2_ = end;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->d_end);
	self->priv->d_end = _tmp3_;
	return self;
}


GcpSourceRange* gcp_source_range_new (GcpSourceLocation* start, GcpSourceLocation* end) {
	return gcp_source_range_construct (GCP_TYPE_SOURCE_RANGE, start, end);
}


gint gcp_source_range_compare_to (GcpSourceRange* self, GcpSourceRange* other) {
	gint result = 0;
	GcpSourceLocation* _tmp0_;
	GcpSourceRange* _tmp1_;
	GcpSourceLocation* _tmp2_;
	gint _tmp3_ = 0;
	gint st;
	gint _tmp4_;
	GcpSourceRange* _tmp5_;
	GcpSourceLocation* _tmp6_;
	GcpSourceLocation* _tmp7_;
	gint _tmp8_ = 0;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (other != NULL, 0);
	_tmp0_ = self->priv->d_start;
	_tmp1_ = other;
	_tmp2_ = _tmp1_->priv->d_start;
	_tmp3_ = gcp_source_location_compare_to (_tmp0_, _tmp2_);
	st = _tmp3_;
	_tmp4_ = st;
	if (_tmp4_ != 0) {
		result = st;
		return result;
	}
	_tmp5_ = other;
	_tmp6_ = _tmp5_->priv->d_end;
	_tmp7_ = self->priv->d_end;
	_tmp8_ = gcp_source_location_compare_to (_tmp6_, _tmp7_);
	result = _tmp8_;
	return result;
}


gboolean gcp_source_range_get_iters (GcpSourceRange* self, GtkTextBuffer* buffer, GtkTextIter* start, GtkTextIter* end) {
	GtkTextIter _vala_start = {0};
	GtkTextIter _vala_end = {0};
	gboolean result = FALSE;
	gboolean rets = FALSE;
	gboolean rete = FALSE;
	GcpSourceLocation* _tmp0_;
	GtkTextBuffer* _tmp1_;
	GtkTextIter _tmp2_ = {0};
	gboolean _tmp3_ = FALSE;
	GcpSourceLocation* _tmp4_;
	GtkTextBuffer* _tmp5_;
	GtkTextIter _tmp6_ = {0};
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_;
	gboolean _tmp11_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (buffer != NULL, FALSE);
	_tmp0_ = self->priv->d_start;
	_tmp1_ = buffer;
	_tmp3_ = gcp_source_location_get_iter (_tmp0_, _tmp1_, &_tmp2_);
	_vala_start = _tmp2_;
	rets = _tmp3_;
	_tmp4_ = self->priv->d_end;
	_tmp5_ = buffer;
	_tmp7_ = gcp_source_location_get_iter (_tmp4_, _tmp5_, &_tmp6_);
	_vala_end = _tmp6_;
	rete = _tmp7_;
	_tmp9_ = rets;
	if (_tmp9_) {
		gboolean _tmp10_;
		_tmp10_ = rete;
		_tmp8_ = _tmp10_;
	} else {
		_tmp8_ = FALSE;
	}
	_tmp11_ = _tmp8_;
	result = _tmp11_;
	if (start) {
		*start = _vala_start;
	}
	if (end) {
		*end = _vala_end;
	}
	return result;
}


gboolean gcp_source_range_contains_range (GcpSourceRange* self, GcpSourceRange* range) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GcpSourceRange* _tmp1_;
	GcpSourceLocation* _tmp2_;
	GcpSourceLocation* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp9_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (range != NULL, FALSE);
	_tmp1_ = range;
	_tmp2_ = gcp_source_range_get_start (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = gcp_source_range_contains_location (self, _tmp3_);
	if (_tmp4_) {
		GcpSourceRange* _tmp5_;
		GcpSourceLocation* _tmp6_;
		GcpSourceLocation* _tmp7_;
		gboolean _tmp8_ = FALSE;
		_tmp5_ = range;
		_tmp6_ = gcp_source_range_get_end (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = gcp_source_range_contains_location (self, _tmp7_);
		_tmp0_ = _tmp8_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp9_ = _tmp0_;
	result = _tmp9_;
	return result;
}


gboolean gcp_source_range_contains_location (GcpSourceRange* self, GcpSourceLocation* location) {
	gboolean result = FALSE;
	GcpSourceLocation* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GcpSourceLocation* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gboolean _tmp6_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (location != NULL, FALSE);
	_tmp0_ = location;
	_tmp1_ = gcp_source_location_get_line (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = location;
	_tmp4_ = gcp_source_location_get_column (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = gcp_source_range_contains (self, _tmp2_, _tmp5_);
	result = _tmp6_;
	return result;
}


gboolean gcp_source_range_contains (GcpSourceRange* self, gint line, gint column) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GcpSourceLocation* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gboolean _tmp16_;
	gboolean _tmp33_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp2_ = self->priv->d_start;
	_tmp3_ = gcp_source_location_get_line (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = line;
	if (_tmp4_ < _tmp5_) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp6_ = FALSE;
		GcpSourceLocation* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gboolean _tmp15_;
		_tmp7_ = self->priv->d_start;
		_tmp8_ = gcp_source_location_get_line (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = line;
		if (_tmp9_ == _tmp10_) {
			GcpSourceLocation* _tmp11_;
			gint _tmp12_;
			gint _tmp13_;
			gint _tmp14_;
			_tmp11_ = self->priv->d_start;
			_tmp12_ = gcp_source_location_get_column (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = column;
			_tmp6_ = _tmp13_ <= _tmp14_;
		} else {
			_tmp6_ = FALSE;
		}
		_tmp15_ = _tmp6_;
		_tmp1_ = _tmp15_;
	}
	_tmp16_ = _tmp1_;
	if (_tmp16_) {
		gboolean _tmp17_ = FALSE;
		GcpSourceLocation* _tmp18_;
		gint _tmp19_;
		gint _tmp20_;
		gint _tmp21_;
		gboolean _tmp32_;
		_tmp18_ = self->priv->d_end;
		_tmp19_ = gcp_source_location_get_line (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = line;
		if (_tmp20_ > _tmp21_) {
			_tmp17_ = TRUE;
		} else {
			gboolean _tmp22_ = FALSE;
			GcpSourceLocation* _tmp23_;
			gint _tmp24_;
			gint _tmp25_;
			gint _tmp26_;
			gboolean _tmp31_;
			_tmp23_ = self->priv->d_end;
			_tmp24_ = gcp_source_location_get_line (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = line;
			if (_tmp25_ == _tmp26_) {
				GcpSourceLocation* _tmp27_;
				gint _tmp28_;
				gint _tmp29_;
				gint _tmp30_;
				_tmp27_ = self->priv->d_end;
				_tmp28_ = gcp_source_location_get_column (_tmp27_);
				_tmp29_ = _tmp28_;
				_tmp30_ = column;
				_tmp22_ = _tmp29_ >= _tmp30_;
			} else {
				_tmp22_ = FALSE;
			}
			_tmp31_ = _tmp22_;
			_tmp17_ = _tmp31_;
		}
		_tmp32_ = _tmp17_;
		_tmp0_ = _tmp32_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp33_ = _tmp0_;
	result = _tmp33_;
	return result;
}


gboolean gcp_source_range_contains_line (GcpSourceRange* self, gint line) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GcpSourceLocation* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gboolean _tmp9_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->d_start;
	_tmp2_ = gcp_source_location_get_line (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = line;
	if (_tmp3_ <= _tmp4_) {
		GcpSourceLocation* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp5_ = self->priv->d_end;
		_tmp6_ = gcp_source_location_get_line (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = line;
		_tmp0_ = _tmp7_ >= _tmp8_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp9_ = _tmp0_;
	result = _tmp9_;
	return result;
}


gchar* gcp_source_range_to_string (GcpSourceRange* self) {
	gchar* result = NULL;
	gboolean _tmp0_ = FALSE;
	GcpSourceLocation* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	GcpSourceLocation* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gboolean _tmp13_;
	GcpSourceLocation* _tmp16_;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_;
	GcpSourceLocation* _tmp19_;
	gchar* _tmp20_ = NULL;
	gchar* _tmp21_;
	gchar* _tmp22_ = NULL;
	gchar* _tmp23_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->d_start;
	_tmp2_ = gcp_source_location_get_line (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->d_end;
	_tmp5_ = gcp_source_location_get_line (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp3_ == _tmp6_) {
		GcpSourceLocation* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		GcpSourceLocation* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		_tmp7_ = self->priv->d_end;
		_tmp8_ = gcp_source_location_get_column (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = self->priv->d_start;
		_tmp11_ = gcp_source_location_get_column (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp0_ = (_tmp9_ - _tmp12_) <= 1;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp13_ = _tmp0_;
	if (_tmp13_) {
		GcpSourceLocation* _tmp14_;
		gchar* _tmp15_ = NULL;
		_tmp14_ = self->priv->d_start;
		_tmp15_ = gcp_source_location_to_string (_tmp14_);
		result = _tmp15_;
		return result;
	}
	_tmp16_ = self->priv->d_start;
	_tmp17_ = gcp_source_location_to_string (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = self->priv->d_end;
	_tmp20_ = gcp_source_location_to_string (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = g_strdup_printf ("%s-%s", _tmp18_, _tmp21_);
	_tmp23_ = _tmp22_;
	_g_free0 (_tmp21_);
	_g_free0 (_tmp18_);
	result = _tmp23_;
	return result;
}


static GcpSourceRange* gcp_source_range_real_get_range (GcpSourceRangeSupport* base) {
	GcpSourceRange* result;
	GcpSourceRange* self;
	GcpSourceRange* _tmp0_;
	self = (GcpSourceRange*) base;
	_tmp0_ = _g_object_ref0 (self);
	result = _tmp0_;
	return result;
}


static GcpSourceRange** gcp_source_range_real_get_ranges (GcpSourceRangeSupport* base, int* result_length1) {
	GcpSourceRange** result;
	GcpSourceRange* self;
	GcpSourceRange* _tmp0_;
	GcpSourceRange** _tmp1_ = NULL;
	GcpSourceRange** _tmp2_;
	gint _tmp2__length1;
	self = (GcpSourceRange*) base;
	_tmp0_ = _g_object_ref0 (self);
	_tmp1_ = g_new0 (GcpSourceRange*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}


GcpSourceLocation* gcp_source_range_get_start (GcpSourceRange* self) {
	GcpSourceLocation* result;
	GcpSourceLocation* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_start;
	result = _tmp0_;
	return result;
}


GcpSourceLocation* gcp_source_range_get_end (GcpSourceRange* self) {
	GcpSourceLocation* result;
	GcpSourceLocation* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_end;
	result = _tmp0_;
	return result;
}


static void gcp_source_range_class_init (GcpSourceRangeClass * klass) {
	gcp_source_range_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GcpSourceRangePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gcp_source_range_get_property;
	G_OBJECT_CLASS (klass)->finalize = gcp_source_range_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCP_SOURCE_RANGE_RANGE, g_param_spec_object ("range", "range", "range", GCP_TYPE_SOURCE_RANGE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCP_SOURCE_RANGE_START, g_param_spec_object ("start", "start", "start", GCP_TYPE_SOURCE_LOCATION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCP_SOURCE_RANGE_END, g_param_spec_object ("end", "end", "end", GCP_TYPE_SOURCE_LOCATION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gcp_source_range_gcp_source_range_support_interface_init (GcpSourceRangeSupportIface * iface) {
	gcp_source_range_gcp_source_range_support_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_range = gcp_source_range_real_get_range;
	iface->get_ranges = gcp_source_range_real_get_ranges;
}


static void gcp_source_range_instance_init (GcpSourceRange * self) {
	self->priv = GCP_SOURCE_RANGE_GET_PRIVATE (self);
}


static void gcp_source_range_finalize (GObject* obj) {
	GcpSourceRange * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCP_TYPE_SOURCE_RANGE, GcpSourceRange);
	_g_object_unref0 (self->priv->d_start);
	_g_object_unref0 (self->priv->d_end);
	G_OBJECT_CLASS (gcp_source_range_parent_class)->finalize (obj);
}


GType gcp_source_range_get_type (void) {
	static volatile gsize gcp_source_range_type_id__volatile = 0;
	if (g_once_init_enter (&gcp_source_range_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GcpSourceRangeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gcp_source_range_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GcpSourceRange), 0, (GInstanceInitFunc) gcp_source_range_instance_init, NULL };
		static const GInterfaceInfo gcp_source_range_support_info = { (GInterfaceInitFunc) gcp_source_range_gcp_source_range_support_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gcp_source_range_type_id;
		gcp_source_range_type_id = g_type_register_static (G_TYPE_OBJECT, "GcpSourceRange", &g_define_type_info, 0);
		g_type_add_interface_static (gcp_source_range_type_id, GCP_TYPE_SOURCE_RANGE_SUPPORT, &gcp_source_range_support_info);
		g_once_init_leave (&gcp_source_range_type_id__volatile, gcp_source_range_type_id);
	}
	return gcp_source_range_type_id__volatile;
}


static void _vala_gcp_source_range_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GcpSourceRange * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GCP_TYPE_SOURCE_RANGE, GcpSourceRange);
	switch (property_id) {
		case GCP_SOURCE_RANGE_RANGE:
		g_value_take_object (value, gcp_source_range_support_get_range ((GcpSourceRangeSupport*) self));
		break;
		case GCP_SOURCE_RANGE_START:
		g_value_set_object (value, gcp_source_range_get_start (self));
		break;
		case GCP_SOURCE_RANGE_END:
		g_value_set_object (value, gcp_source_range_get_end (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



