/* gcp-source-location.c generated by valac 0.19.0, the Vala compiler
 * generated from gcp-source-location.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 <gio/gio.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <string.h>
#include <stdlib.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;

#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;
typedef struct _GcpSourceLocationPrivate GcpSourceLocationPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

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

struct _GcpSourceLocation {
	GObject parent_instance;
	GcpSourceLocationPrivate * priv;
};

struct _GcpSourceLocationClass {
	GObjectClass parent_class;
};

struct _GcpSourceLocationPrivate {
	GFile* d_file;
	gint d_line;
	gint d_column;
};


static gpointer gcp_source_location_parent_class = NULL;
static GcpSourceRangeSupportIface* gcp_source_location_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_LOCATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GCP_TYPE_SOURCE_LOCATION, GcpSourceLocationPrivate))
enum  {
	GCP_SOURCE_LOCATION_DUMMY_PROPERTY,
	GCP_SOURCE_LOCATION_FILE,
	GCP_SOURCE_LOCATION_LINE,
	GCP_SOURCE_LOCATION_COLUMN,
	GCP_SOURCE_LOCATION_RANGE
};
GcpSourceLocation* gcp_source_location_new (GFile* file, gint line, gint column);
GcpSourceLocation* gcp_source_location_construct (GType object_type, GFile* file, gint line, gint column);
GcpSourceLocation* gcp_source_location_new_iter (GtkTextIter* iter);
GcpSourceLocation* gcp_source_location_construct_iter (GType object_type, GtkTextIter* iter);
GcpSourceLocation* gcp_source_location_copy (GcpSourceLocation* self);
static gint gcp_source_location_compare_int (GcpSourceLocation* self, gint a, gint b);
gint gcp_source_location_compare_to (GcpSourceLocation* self, GcpSourceLocation* other);
gboolean gcp_source_location_get_iter (GcpSourceLocation* self, GtkTextBuffer* buffer, GtkTextIter* iter);
gboolean gcp_source_location_buffer_coordinates (GcpSourceLocation* self, GtkTextView* view, GdkRectangle* rect);
gchar* gcp_source_location_to_string (GcpSourceLocation* self);
gint gcp_source_location_get_line (GcpSourceLocation* self);
gint gcp_source_location_get_column (GcpSourceLocation* self);
GFile* gcp_source_location_get_file (GcpSourceLocation* self);
void gcp_source_location_set_line (GcpSourceLocation* self, gint value);
GcpSourceRange* gcp_source_range_new (GcpSourceLocation* start, GcpSourceLocation* end);
GcpSourceRange* gcp_source_range_construct (GType object_type, GcpSourceLocation* start, GcpSourceLocation* end);
GcpSourceRange* gcp_source_range_support_get_range (GcpSourceRangeSupport* self);
static void gcp_source_location_finalize (GObject* obj);
static void _vala_gcp_source_location_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gcp_source_location_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


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


GcpSourceLocation* gcp_source_location_construct (GType object_type, GFile* file, gint line, gint column) {
	GcpSourceLocation * self = NULL;
	GFile* _tmp0_;
	GFile* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	self = (GcpSourceLocation*) g_object_new (object_type, NULL);
	_tmp0_ = file;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->d_file);
	self->priv->d_file = _tmp1_;
	_tmp2_ = line;
	self->priv->d_line = _tmp2_;
	_tmp3_ = column;
	self->priv->d_column = _tmp3_;
	return self;
}


GcpSourceLocation* gcp_source_location_new (GFile* file, gint line, gint column) {
	return gcp_source_location_construct (GCP_TYPE_SOURCE_LOCATION, file, line, column);
}


GcpSourceLocation* gcp_source_location_construct_iter (GType object_type, GtkTextIter* iter) {
	GcpSourceLocation * self = NULL;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	g_return_val_if_fail (iter != NULL, NULL);
	_tmp0_ = gtk_text_iter_get_line (iter);
	_tmp1_ = gtk_text_iter_get_line_offset (iter);
	self = (GcpSourceLocation*) gcp_source_location_construct (object_type, NULL, _tmp0_ + 1, _tmp1_ + 1);
	return self;
}


GcpSourceLocation* gcp_source_location_new_iter (GtkTextIter* iter) {
	return gcp_source_location_construct_iter (GCP_TYPE_SOURCE_LOCATION, iter);
}


GcpSourceLocation* gcp_source_location_copy (GcpSourceLocation* self) {
	GcpSourceLocation* result = NULL;
	GFile* _tmp0_;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	GcpSourceLocation* _tmp5_;
	GcpSourceLocation* _tmp6_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_file;
	_tmp1_ = g_file_dup (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->d_line;
	_tmp4_ = self->priv->d_column;
	_tmp5_ = gcp_source_location_new (_tmp2_, _tmp3_, _tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp2_);
	result = _tmp6_;
	return result;
}


static gint gcp_source_location_compare_int (GcpSourceLocation* self, gint a, gint b) {
	gint result = 0;
	gint _tmp0_ = 0;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp7_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp1_ = a;
	_tmp2_ = b;
	if (_tmp1_ < _tmp2_) {
		_tmp0_ = -1;
	} else {
		gint _tmp3_ = 0;
		gint _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		_tmp4_ = a;
		_tmp5_ = b;
		if (_tmp4_ == _tmp5_) {
			_tmp3_ = 0;
		} else {
			_tmp3_ = 1;
		}
		_tmp6_ = _tmp3_;
		_tmp0_ = _tmp6_;
	}
	_tmp7_ = _tmp0_;
	result = _tmp7_;
	return result;
}


gint gcp_source_location_compare_to (GcpSourceLocation* self, GcpSourceLocation* other) {
	gint result = 0;
	gint _tmp0_;
	GcpSourceLocation* _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (other != NULL, 0);
	_tmp0_ = self->priv->d_line;
	_tmp1_ = other;
	_tmp2_ = _tmp1_->priv->d_line;
	if (_tmp0_ == _tmp2_) {
		gint _tmp3_;
		GcpSourceLocation* _tmp4_;
		gint _tmp5_;
		gint _tmp6_ = 0;
		_tmp3_ = self->priv->d_column;
		_tmp4_ = other;
		_tmp5_ = _tmp4_->priv->d_column;
		_tmp6_ = gcp_source_location_compare_int (self, _tmp3_, _tmp5_);
		result = _tmp6_;
		return result;
	} else {
		gint _tmp7_ = 0;
		gint _tmp8_;
		GcpSourceLocation* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		_tmp8_ = self->priv->d_line;
		_tmp9_ = other;
		_tmp10_ = _tmp9_->priv->d_line;
		if (_tmp8_ < _tmp10_) {
			_tmp7_ = -1;
		} else {
			_tmp7_ = 1;
		}
		_tmp11_ = _tmp7_;
		result = _tmp11_;
		return result;
	}
}


gboolean gcp_source_location_get_iter (GcpSourceLocation* self, GtkTextBuffer* buffer, GtkTextIter* iter) {
	GtkTextIter _vala_iter = {0};
	gboolean result = FALSE;
	GtkTextBuffer* _tmp0_;
	gint _tmp1_;
	GtkTextIter _tmp2_ = {0};
	gint _tmp3_ = 0;
	gint _tmp4_;
	gint _tmp6_;
	gint _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean ret;
	gboolean _tmp9_ = FALSE;
	gboolean _tmp10_;
	gboolean _tmp12_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (buffer != NULL, FALSE);
	_tmp0_ = buffer;
	_tmp1_ = self->priv->d_line;
	gtk_text_buffer_get_iter_at_line (_tmp0_, &_tmp2_, _tmp1_ - 1);
	_vala_iter = _tmp2_;
	_tmp3_ = gtk_text_iter_get_line (&_vala_iter);
	_tmp4_ = self->priv->d_line;
	if (_tmp3_ != (_tmp4_ - 1)) {
		gboolean _tmp5_ = FALSE;
		_tmp5_ = gtk_text_iter_is_end (&_vala_iter);
		if (_tmp5_) {
			result = TRUE;
			if (iter) {
				*iter = _vala_iter;
			}
			return result;
		}
		result = FALSE;
		if (iter) {
			*iter = _vala_iter;
		}
		return result;
	}
	_tmp6_ = self->priv->d_column;
	if (_tmp6_ <= 1) {
		result = TRUE;
		if (iter) {
			*iter = _vala_iter;
		}
		return result;
	}
	_tmp7_ = self->priv->d_column;
	_tmp8_ = gtk_text_iter_forward_chars (&_vala_iter, _tmp7_ - 1);
	ret = _tmp8_;
	_tmp10_ = ret;
	if (!_tmp10_) {
		gboolean _tmp11_ = FALSE;
		_tmp11_ = gtk_text_iter_is_end (&_vala_iter);
		_tmp9_ = _tmp11_;
	} else {
		_tmp9_ = FALSE;
	}
	_tmp12_ = _tmp9_;
	if (_tmp12_) {
		ret = TRUE;
	}
	result = ret;
	if (iter) {
		*iter = _vala_iter;
	}
	return result;
}


gboolean gcp_source_location_buffer_coordinates (GcpSourceLocation* self, GtkTextView* view, GdkRectangle* rect) {
	GdkRectangle _vala_rect = {0};
	gboolean result = FALSE;
	GtkTextIter iter = {0};
	GtkTextView* _tmp0_;
	GtkTextBuffer* _tmp1_;
	GtkTextBuffer* _tmp2_;
	GtkTextIter _tmp3_ = {0};
	gboolean _tmp4_ = FALSE;
	GtkTextView* _tmp5_;
	GtkTextIter _tmp6_;
	GdkRectangle _tmp7_ = {0};
	GtkTextView* _tmp8_;
	GtkTextIter _tmp9_;
	gint _tmp10_ = 0;
	gint _tmp11_ = 0;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (view != NULL, FALSE);
	memset (&_vala_rect, 0, sizeof (GdkRectangle));
	_tmp0_ = view;
	_tmp1_ = gtk_text_view_get_buffer (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = gcp_source_location_get_iter (self, _tmp2_, &_tmp3_);
	iter = _tmp3_;
	if (!_tmp4_) {
		result = FALSE;
		if (rect) {
			*rect = _vala_rect;
		}
		return result;
	}
	_tmp5_ = view;
	_tmp6_ = iter;
	gtk_text_view_get_iter_location (_tmp5_, &_tmp6_, &_tmp7_);
	_vala_rect = _tmp7_;
	_tmp8_ = view;
	_tmp9_ = iter;
	gtk_text_view_get_line_yrange (_tmp8_, &_tmp9_, &_tmp10_, &_tmp11_);
	_vala_rect.y = _tmp10_;
	_vala_rect.height = _tmp11_;
	result = TRUE;
	if (rect) {
		*rect = _vala_rect;
	}
	return result;
}


gchar* gcp_source_location_to_string (GcpSourceLocation* self) {
	gchar* result = NULL;
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gcp_source_location_get_line (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gcp_source_location_get_column (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf ("(%d.%d)", _tmp1_, _tmp3_);
	result = _tmp4_;
	return result;
}


GFile* gcp_source_location_get_file (GcpSourceLocation* self) {
	GFile* result;
	GFile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_file;
	result = _tmp0_;
	return result;
}


gint gcp_source_location_get_line (GcpSourceLocation* self) {
	gint result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->d_line;
	result = _tmp0_;
	return result;
}


void gcp_source_location_set_line (GcpSourceLocation* self, gint value) {
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->d_line = _tmp0_;
	g_object_notify ((GObject *) self, "line");
}


gint gcp_source_location_get_column (GcpSourceLocation* self) {
	gint result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->d_column;
	result = _tmp0_;
	return result;
}


static GcpSourceRange* gcp_source_location_real_get_range (GcpSourceRangeSupport* base) {
	GcpSourceRange* result;
	GcpSourceLocation* self;
	GFile* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GcpSourceLocation* _tmp3_;
	GcpSourceLocation* _tmp4_;
	GFile* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	GcpSourceLocation* _tmp8_;
	GcpSourceLocation* _tmp9_;
	GcpSourceRange* _tmp10_;
	GcpSourceRange* _tmp11_;
	GcpSourceRange* r;
	GcpSourceRange* _tmp12_;
	self = (GcpSourceLocation*) base;
	_tmp0_ = self->priv->d_file;
	_tmp1_ = self->priv->d_line;
	_tmp2_ = self->priv->d_column;
	_tmp3_ = gcp_source_location_new (_tmp0_, _tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->d_file;
	_tmp6_ = self->priv->d_line;
	_tmp7_ = self->priv->d_column;
	_tmp8_ = gcp_source_location_new (_tmp5_, _tmp6_, _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = gcp_source_range_new (_tmp4_, _tmp9_);
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp9_);
	_g_object_unref0 (_tmp4_);
	r = _tmp11_;
	_tmp12_ = r;
	r = NULL;
	result = _tmp12_;
	_g_object_unref0 (r);
	return result;
}


static GcpSourceRange** gcp_source_location_real_get_ranges (GcpSourceRangeSupport* base, int* result_length1) {
	GcpSourceRange** result;
	GcpSourceLocation* self;
	GcpSourceRange* _tmp0_;
	GcpSourceRange* _tmp1_;
	GcpSourceRange** _tmp2_ = NULL;
	GcpSourceRange** _tmp3_;
	gint _tmp3__length1;
	self = (GcpSourceLocation*) base;
	_tmp0_ = gcp_source_range_support_get_range ((GcpSourceRangeSupport*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_new0 (GcpSourceRange*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 1;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}


static void gcp_source_location_class_init (GcpSourceLocationClass * klass) {
	gcp_source_location_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GcpSourceLocationPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gcp_source_location_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gcp_source_location_set_property;
	G_OBJECT_CLASS (klass)->finalize = gcp_source_location_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCP_SOURCE_LOCATION_FILE, g_param_spec_object ("file", "file", "file", G_TYPE_FILE, 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_LOCATION_LINE, g_param_spec_int ("line", "line", "line", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCP_SOURCE_LOCATION_COLUMN, g_param_spec_int ("column", "column", "column", G_MININT, G_MAXINT, 0, 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_LOCATION_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));
}


static void gcp_source_location_gcp_source_range_support_interface_init (GcpSourceRangeSupportIface * iface) {
	gcp_source_location_gcp_source_range_support_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_range = gcp_source_location_real_get_range;
	iface->get_ranges = gcp_source_location_real_get_ranges;
}


static void gcp_source_location_instance_init (GcpSourceLocation * self) {
	self->priv = GCP_SOURCE_LOCATION_GET_PRIVATE (self);
}


static void gcp_source_location_finalize (GObject* obj) {
	GcpSourceLocation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCP_TYPE_SOURCE_LOCATION, GcpSourceLocation);
	_g_object_unref0 (self->priv->d_file);
	G_OBJECT_CLASS (gcp_source_location_parent_class)->finalize (obj);
}


GType gcp_source_location_get_type (void) {
	static volatile gsize gcp_source_location_type_id__volatile = 0;
	if (g_once_init_enter (&gcp_source_location_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GcpSourceLocationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gcp_source_location_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GcpSourceLocation), 0, (GInstanceInitFunc) gcp_source_location_instance_init, NULL };
		static const GInterfaceInfo gcp_source_range_support_info = { (GInterfaceInitFunc) gcp_source_location_gcp_source_range_support_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gcp_source_location_type_id;
		gcp_source_location_type_id = g_type_register_static (G_TYPE_OBJECT, "GcpSourceLocation", &g_define_type_info, 0);
		g_type_add_interface_static (gcp_source_location_type_id, GCP_TYPE_SOURCE_RANGE_SUPPORT, &gcp_source_range_support_info);
		g_once_init_leave (&gcp_source_location_type_id__volatile, gcp_source_location_type_id);
	}
	return gcp_source_location_type_id__volatile;
}


static void _vala_gcp_source_location_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GcpSourceLocation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GCP_TYPE_SOURCE_LOCATION, GcpSourceLocation);
	switch (property_id) {
		case GCP_SOURCE_LOCATION_FILE:
		g_value_set_object (value, gcp_source_location_get_file (self));
		break;
		case GCP_SOURCE_LOCATION_LINE:
		g_value_set_int (value, gcp_source_location_get_line (self));
		break;
		case GCP_SOURCE_LOCATION_COLUMN:
		g_value_set_int (value, gcp_source_location_get_column (self));
		break;
		case GCP_SOURCE_LOCATION_RANGE:
		g_value_take_object (value, gcp_source_range_support_get_range ((GcpSourceRangeSupport*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gcp_source_location_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GcpSourceLocation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GCP_TYPE_SOURCE_LOCATION, GcpSourceLocation);
	switch (property_id) {
		case GCP_SOURCE_LOCATION_LINE:
		gcp_source_location_set_line (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



