/* gca-remote-service.c generated by valac 0.27.1, the Vala compiler
 * generated from gca-remote-service.vala, do not modify */

/*
 * This file is part of gedit-code-assistant.
 *
 * Copyright (C) 2013 - 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 <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>


#define GCA_TYPE_REMOTE_SERVICES (gca_remote_services_get_type ())

#define GCA_TYPE_REMOTE_DOCUMENT (gca_remote_document_get_type ())
#define GCA_REMOTE_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCA_TYPE_REMOTE_DOCUMENT, GcaRemoteDocument))
#define GCA_REMOTE_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCA_TYPE_REMOTE_DOCUMENT, GcaRemoteDocumentClass))
#define GCA_IS_REMOTE_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCA_TYPE_REMOTE_DOCUMENT))
#define GCA_IS_REMOTE_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCA_TYPE_REMOTE_DOCUMENT))
#define GCA_REMOTE_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCA_TYPE_REMOTE_DOCUMENT, GcaRemoteDocumentClass))

typedef struct _GcaRemoteDocument GcaRemoteDocument;
typedef struct _GcaRemoteDocumentClass GcaRemoteDocumentClass;
typedef struct _GcaRemoteDocumentPrivate GcaRemoteDocumentPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gca_remote_document_unref0(var) ((var == NULL) ? NULL : (var = (gca_remote_document_unref (var), NULL)))
typedef struct _GcaRemoteDocumentGetProxyData GcaRemoteDocumentGetProxyData;
typedef struct _GcaParamSpecRemoteDocument GcaParamSpecRemoteDocument;

#define GCA_TYPE_REMOTE_SERVICE (gca_remote_service_get_type ())
#define GCA_REMOTE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCA_TYPE_REMOTE_SERVICE, GcaRemoteService))
#define GCA_IS_REMOTE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCA_TYPE_REMOTE_SERVICE))
#define GCA_REMOTE_SERVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GCA_TYPE_REMOTE_SERVICE, GcaRemoteServiceIface))

typedef struct _GcaRemoteService GcaRemoteService;
typedef struct _GcaRemoteServiceIface GcaRemoteServiceIface;

#define GCA_TYPE_VIEW (gca_view_get_type ())
#define GCA_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCA_TYPE_VIEW, GcaView))
#define GCA_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCA_TYPE_VIEW, GcaViewClass))
#define GCA_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCA_TYPE_VIEW))
#define GCA_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCA_TYPE_VIEW))
#define GCA_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCA_TYPE_VIEW, GcaViewClass))

typedef struct _GcaView GcaView;
typedef struct _GcaViewClass GcaViewClass;

typedef enum  {
	GCA_REMOTE_SERVICES_DIAGNOSTICS = 1 << 0,
	GCA_REMOTE_SERVICES_SEMANTIC_VALUES = 1 << 1,
	GCA_REMOTE_SERVICES_SYMBOLS = 1 << 2
} GcaRemoteServices;

struct _GcaRemoteDocument {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GcaRemoteDocumentPrivate * priv;
};

struct _GcaRemoteDocumentClass {
	GTypeClass parent_class;
	void (*finalize) (GcaRemoteDocument *self);
};

struct _GcaRemoteDocumentPrivate {
	gchar* d_service;
	char* d_path;
};

struct _GcaRemoteDocumentGetProxyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	GcaRemoteDocument* self;
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	gpointer result;
	gpointer _tmp0_;
	const gchar* _tmp1_;
	const char* _tmp2_;
	gpointer _tmp3_;
	gpointer _tmp4_;
	GError * _inner_error_;
};

struct _GcaParamSpecRemoteDocument {
	GParamSpec parent_instance;
};

struct _GcaRemoteServiceIface {
	GTypeInterface parent_iface;
	GcaRemoteServices (*services) (GcaRemoteService* self);
	void (*update) (GcaRemoteService* self, GcaView* view, GcaRemoteDocument* document);
	void (*destroy) (GcaRemoteService* self);
};


static gpointer gca_remote_document_parent_class = NULL;

GType gca_remote_services_get_type (void) G_GNUC_CONST;
GcaRemoteServices gca_remote_services_parse (const gchar* s);
gpointer gca_remote_document_ref (gpointer instance);
void gca_remote_document_unref (gpointer instance);
GParamSpec* gca_param_spec_remote_document (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gca_value_set_remote_document (GValue* value, gpointer v_object);
void gca_value_take_remote_document (GValue* value, gpointer v_object);
gpointer gca_value_get_remote_document (const GValue* value);
GType gca_remote_document_get_type (void) G_GNUC_CONST;
#define GCA_REMOTE_DOCUMENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GCA_TYPE_REMOTE_DOCUMENT, GcaRemoteDocumentPrivate))
enum  {
	GCA_REMOTE_DOCUMENT_DUMMY_PROPERTY
};
GcaRemoteDocument* gca_remote_document_new (const gchar* service, const char* path);
GcaRemoteDocument* gca_remote_document_construct (GType object_type, const gchar* service, const char* path);
static void gca_remote_document_get_proxy_data_free (gpointer _data);
void gca_remote_document_get_proxy (GcaRemoteDocument* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GAsyncReadyCallback _callback_, gpointer _user_data_);
gpointer gca_remote_document_get_proxy_finish (GcaRemoteDocument* self, GAsyncResult* _res_, GError** error);
static gboolean gca_remote_document_get_proxy_co (GcaRemoteDocumentGetProxyData* _data_);
static void gca_remote_document_get_proxy_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
const char* gca_remote_document_get_path (GcaRemoteDocument* self);
static void gca_remote_document_finalize (GcaRemoteDocument* obj);
GType gca_view_get_type (void) G_GNUC_CONST;
GType gca_remote_service_get_type (void) G_GNUC_CONST;
GcaRemoteServices gca_remote_service_services (GcaRemoteService* self);
void gca_remote_service_update (GcaRemoteService* self, GcaView* view, GcaRemoteDocument* document);
void gca_remote_service_destroy (GcaRemoteService* self);


GcaRemoteServices gca_remote_services_parse (const gchar* s) {
	GcaRemoteServices result = 0;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	g_return_val_if_fail (s != NULL, 0);
	_tmp0_ = s;
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("org.gnome.CodeAssist.v1.Diagnostics")))) {
		switch (0) {
			default:
			{
				result = GCA_REMOTE_SERVICES_DIAGNOSTICS;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("org.gnome.CodeAssist.v1.SemanticValues")))) {
		switch (0) {
			default:
			{
				result = GCA_REMOTE_SERVICES_SEMANTIC_VALUES;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("org.gnome.CodeAssist.v1.Symbols")))) {
		switch (0) {
			default:
			{
				result = GCA_REMOTE_SERVICES_SYMBOLS;
				return result;
			}
		}
	}
	result = 0;
	return result;
}


GType gca_remote_services_get_type (void) {
	static volatile gsize gca_remote_services_type_id__volatile = 0;
	if (g_once_init_enter (&gca_remote_services_type_id__volatile)) {
		static const GFlagsValue values[] = {{GCA_REMOTE_SERVICES_DIAGNOSTICS, "GCA_REMOTE_SERVICES_DIAGNOSTICS", "diagnostics"}, {GCA_REMOTE_SERVICES_SEMANTIC_VALUES, "GCA_REMOTE_SERVICES_SEMANTIC_VALUES", "semantic-values"}, {GCA_REMOTE_SERVICES_SYMBOLS, "GCA_REMOTE_SERVICES_SYMBOLS", "symbols"}, {0, NULL, NULL}};
		GType gca_remote_services_type_id;
		gca_remote_services_type_id = g_flags_register_static ("GcaRemoteServices", values);
		g_once_init_leave (&gca_remote_services_type_id__volatile, gca_remote_services_type_id);
	}
	return gca_remote_services_type_id__volatile;
}


GcaRemoteDocument* gca_remote_document_construct (GType object_type, const gchar* service, const char* path) {
	GcaRemoteDocument* self = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const char* _tmp2_ = NULL;
	char* _tmp3_ = NULL;
	g_return_val_if_fail (service != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	self = (GcaRemoteDocument*) g_type_create_instance (object_type);
	_tmp0_ = service;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->d_service);
	self->priv->d_service = _tmp1_;
	_tmp2_ = path;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (self->priv->d_path);
	self->priv->d_path = _tmp3_;
	return self;
}


GcaRemoteDocument* gca_remote_document_new (const gchar* service, const char* path) {
	return gca_remote_document_construct (GCA_TYPE_REMOTE_DOCUMENT, service, path);
}


static void gca_remote_document_get_proxy_data_free (gpointer _data) {
	GcaRemoteDocumentGetProxyData* _data_;
	_data_ = _data;
	((_data_->result == NULL) || (_data_->t_destroy_func == NULL)) ? NULL : (_data_->result = (_data_->t_destroy_func (_data_->result), NULL));
	_gca_remote_document_unref0 (_data_->self);
	g_slice_free (GcaRemoteDocumentGetProxyData, _data_);
}


static gpointer _gca_remote_document_ref0 (gpointer self) {
	return self ? gca_remote_document_ref (self) : NULL;
}


void gca_remote_document_get_proxy (GcaRemoteDocument* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	GcaRemoteDocumentGetProxyData* _data_;
	GcaRemoteDocument* _tmp0_ = NULL;
	_data_ = g_slice_new0 (GcaRemoteDocumentGetProxyData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, gca_remote_document_get_proxy);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, gca_remote_document_get_proxy_data_free);
	_tmp0_ = _gca_remote_document_ref0 (self);
	_data_->self = _tmp0_;
	_data_->t_type = t_type;
	_data_->t_dup_func = t_dup_func;
	_data_->t_destroy_func = t_destroy_func;
	gca_remote_document_get_proxy_co (_data_);
}


gpointer gca_remote_document_get_proxy_finish (GcaRemoteDocument* self, GAsyncResult* _res_, GError** error) {
	gpointer result;
	GcaRemoteDocumentGetProxyData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void gca_remote_document_get_proxy_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	GcaRemoteDocumentGetProxyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gca_remote_document_get_proxy_co (_data_);
}


static gboolean gca_remote_document_get_proxy_co (GcaRemoteDocumentGetProxyData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->self->priv->d_service;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _data_->self->priv->d_path;
	_data_->_state_ = 1;
	g_async_initable_new_async (((GType (*) (void)) g_type_get_qdata (_data_->t_type, g_quark_from_static_string ("vala-dbus-proxy-type"))) (), 0, NULL, gca_remote_document_get_proxy_ready, _data_, "g-flags", 0, "g-name", _data_->_tmp1_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", (const gchar*) _data_->_tmp2_, "g-interface-name", g_type_get_qdata (_data_->t_type, g_quark_from_static_string ("vala-dbus-interface-name")), "g-interface-info", g_type_get_qdata (_data_->t_type, g_quark_from_static_string ("vala-dbus-interface-info")), NULL);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_async_initable_new_finish (_data_->_source_object_, _data_->_res_, &_data_->_inner_error_);
	_data_->_tmp0_ = _data_->_tmp3_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == G_IO_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp4_;
	((_data_->_tmp0_ == NULL) || (_data_->t_destroy_func == NULL)) ? NULL : (_data_->_tmp0_ = (_data_->t_destroy_func (_data_->_tmp0_), NULL));
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	((_data_->_tmp0_ == NULL) || (_data_->t_destroy_func == NULL)) ? NULL : (_data_->_tmp0_ = (_data_->t_destroy_func (_data_->_tmp0_), NULL));
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


const char* gca_remote_document_get_path (GcaRemoteDocument* self) {
	const char* result;
	const char* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_path;
	result = _tmp0_;
	return result;
}


static void gca_value_remote_document_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void gca_value_remote_document_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		gca_remote_document_unref (value->data[0].v_pointer);
	}
}


static void gca_value_remote_document_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gca_remote_document_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer gca_value_remote_document_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* gca_value_remote_document_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		GcaRemoteDocument* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gca_remote_document_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* gca_value_remote_document_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GcaRemoteDocument** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gca_remote_document_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* gca_param_spec_remote_document (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GcaParamSpecRemoteDocument* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GCA_TYPE_REMOTE_DOCUMENT), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer gca_value_get_remote_document (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCA_TYPE_REMOTE_DOCUMENT), NULL);
	return value->data[0].v_pointer;
}


void gca_value_set_remote_document (GValue* value, gpointer v_object) {
	GcaRemoteDocument* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCA_TYPE_REMOTE_DOCUMENT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GCA_TYPE_REMOTE_DOCUMENT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gca_remote_document_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gca_remote_document_unref (old);
	}
}


void gca_value_take_remote_document (GValue* value, gpointer v_object) {
	GcaRemoteDocument* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCA_TYPE_REMOTE_DOCUMENT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GCA_TYPE_REMOTE_DOCUMENT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gca_remote_document_unref (old);
	}
}


static void gca_remote_document_class_init (GcaRemoteDocumentClass * klass) {
	gca_remote_document_parent_class = g_type_class_peek_parent (klass);
	((GcaRemoteDocumentClass *) klass)->finalize = gca_remote_document_finalize;
	g_type_class_add_private (klass, sizeof (GcaRemoteDocumentPrivate));
}


static void gca_remote_document_instance_init (GcaRemoteDocument * self) {
	self->priv = GCA_REMOTE_DOCUMENT_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void gca_remote_document_finalize (GcaRemoteDocument* obj) {
	GcaRemoteDocument * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCA_TYPE_REMOTE_DOCUMENT, GcaRemoteDocument);
	g_signal_handlers_destroy (self);
	_g_free0 (self->priv->d_service);
	_g_free0 (self->priv->d_path);
}


GType gca_remote_document_get_type (void) {
	static volatile gsize gca_remote_document_type_id__volatile = 0;
	if (g_once_init_enter (&gca_remote_document_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gca_value_remote_document_init, gca_value_remote_document_free_value, gca_value_remote_document_copy_value, gca_value_remote_document_peek_pointer, "p", gca_value_remote_document_collect_value, "p", gca_value_remote_document_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GcaRemoteDocumentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gca_remote_document_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GcaRemoteDocument), 0, (GInstanceInitFunc) gca_remote_document_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType gca_remote_document_type_id;
		gca_remote_document_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GcaRemoteDocument", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&gca_remote_document_type_id__volatile, gca_remote_document_type_id);
	}
	return gca_remote_document_type_id__volatile;
}


gpointer gca_remote_document_ref (gpointer instance) {
	GcaRemoteDocument* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void gca_remote_document_unref (gpointer instance) {
	GcaRemoteDocument* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GCA_REMOTE_DOCUMENT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


GcaRemoteServices gca_remote_service_services (GcaRemoteService* self) {
	g_return_val_if_fail (self != NULL, 0);
	return GCA_REMOTE_SERVICE_GET_INTERFACE (self)->services (self);
}


void gca_remote_service_update (GcaRemoteService* self, GcaView* view, GcaRemoteDocument* document) {
	g_return_if_fail (self != NULL);
	GCA_REMOTE_SERVICE_GET_INTERFACE (self)->update (self, view, document);
}


void gca_remote_service_destroy (GcaRemoteService* self) {
	g_return_if_fail (self != NULL);
	GCA_REMOTE_SERVICE_GET_INTERFACE (self)->destroy (self);
}


static void gca_remote_service_base_init (GcaRemoteServiceIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
	}
}


GType gca_remote_service_get_type (void) {
	static volatile gsize gca_remote_service_type_id__volatile = 0;
	if (g_once_init_enter (&gca_remote_service_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GcaRemoteServiceIface), (GBaseInitFunc) gca_remote_service_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType gca_remote_service_type_id;
		gca_remote_service_type_id = g_type_register_static (G_TYPE_INTERFACE, "GcaRemoteService", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (gca_remote_service_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&gca_remote_service_type_id__volatile, gca_remote_service_type_id);
	}
	return gca_remote_service_type_id__volatile;
}



