/* gcp-backend.c generated by valac 0.19.0, the Vala compiler
 * generated from gcp-backend.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 <gedit/gedit-document.h>


#define GCP_TYPE_BACKEND (gcp_backend_get_type ())
#define GCP_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_BACKEND, GcpBackend))
#define GCP_IS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_BACKEND))
#define GCP_BACKEND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GCP_TYPE_BACKEND, GcpBackendIface))

typedef struct _GcpBackend GcpBackend;
typedef struct _GcpBackendIface GcpBackendIface;

#define GCP_TYPE_DOCUMENT (gcp_document_get_type ())
#define GCP_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_DOCUMENT, GcpDocument))
#define GCP_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_DOCUMENT, GcpDocumentClass))
#define GCP_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_DOCUMENT))
#define GCP_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_DOCUMENT))
#define GCP_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_DOCUMENT, GcpDocumentClass))

typedef struct _GcpDocument GcpDocument;
typedef struct _GcpDocumentClass GcpDocumentClass;

struct _GcpBackendIface {
	GTypeInterface parent_iface;
	GcpDocument* (*get) (GcpBackend* self, gint idx);
	GcpDocument* (*register_document) (GcpBackend* self, GeditDocument* document);
	void (*unregister_document) (GcpBackend* self, GcpDocument* document);
	gint (*get_size) (GcpBackend* self);
};



GType gcp_document_get_type (void) G_GNUC_CONST;
GType gcp_backend_get_type (void) G_GNUC_CONST;
GcpDocument* gcp_backend_get (GcpBackend* self, gint idx);
GcpDocument* gcp_backend_register_document (GcpBackend* self, GeditDocument* document);
void gcp_backend_unregister_document (GcpBackend* self, GcpDocument* document);
gint gcp_backend_get_size (GcpBackend* self);


GcpDocument* gcp_backend_get (GcpBackend* self, gint idx) {
	g_return_val_if_fail (self != NULL, NULL);
	return GCP_BACKEND_GET_INTERFACE (self)->get (self, idx);
}


GcpDocument* gcp_backend_register_document (GcpBackend* self, GeditDocument* document) {
	g_return_val_if_fail (self != NULL, NULL);
	return GCP_BACKEND_GET_INTERFACE (self)->register_document (self, document);
}


void gcp_backend_unregister_document (GcpBackend* self, GcpDocument* document) {
	g_return_if_fail (self != NULL);
	GCP_BACKEND_GET_INTERFACE (self)->unregister_document (self, document);
}


gint gcp_backend_get_size (GcpBackend* self) {
	g_return_val_if_fail (self != NULL, 0);
	return GCP_BACKEND_GET_INTERFACE (self)->get_size (self);
}


static void gcp_backend_base_init (GcpBackendIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		g_object_interface_install_property (iface, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	}
}


GType gcp_backend_get_type (void) {
	static volatile gsize gcp_backend_type_id__volatile = 0;
	if (g_once_init_enter (&gcp_backend_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GcpBackendIface), (GBaseInitFunc) gcp_backend_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType gcp_backend_type_id;
		gcp_backend_type_id = g_type_register_static (G_TYPE_INTERFACE, "GcpBackend", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (gcp_backend_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&gcp_backend_type_id__volatile, gcp_backend_type_id);
	}
	return gcp_backend_type_id__volatile;
}



