/* vbfiprojectbackend.c generated by valac 0.12.1.1-323029-dirty, the Vala compiler
 * generated from vbfiprojectbackend.vala, do not modify */

/*
 *  vbfiprojectbackend.vala - Vala Build Framework library
 *  
 *  Copyright (C) 2008 - Andrea Del Signore <sejerpz@tin.it>
 *  
 *  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, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */

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


#define VBF_TYPE_IPROJECT_BACKEND (vbf_iproject_backend_get_type ())
#define VBF_IPROJECT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TYPE_IPROJECT_BACKEND, VbfIProjectBackend))
#define VBF_IS_IPROJECT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TYPE_IPROJECT_BACKEND))
#define VBF_IPROJECT_BACKEND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), VBF_TYPE_IPROJECT_BACKEND, VbfIProjectBackendIface))

typedef struct _VbfIProjectBackend VbfIProjectBackend;
typedef struct _VbfIProjectBackendIface VbfIProjectBackendIface;

#define VBF_TYPE_CONFIG_NODE (vbf_config_node_get_type ())
#define VBF_CONFIG_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TYPE_CONFIG_NODE, VbfConfigNode))
#define VBF_CONFIG_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_TYPE_CONFIG_NODE, VbfConfigNodeClass))
#define VBF_IS_CONFIG_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TYPE_CONFIG_NODE))
#define VBF_IS_CONFIG_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_TYPE_CONFIG_NODE))
#define VBF_CONFIG_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_TYPE_CONFIG_NODE, VbfConfigNodeClass))

typedef struct _VbfConfigNode VbfConfigNode;
typedef struct _VbfConfigNodeClass VbfConfigNodeClass;

#define VBF_TYPE_PROJECT (vbf_project_get_type ())
#define VBF_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TYPE_PROJECT, VbfProject))
#define VBF_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_TYPE_PROJECT, VbfProjectClass))
#define VBF_IS_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TYPE_PROJECT))
#define VBF_IS_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_TYPE_PROJECT))
#define VBF_PROJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_TYPE_PROJECT, VbfProjectClass))

typedef struct _VbfProject VbfProject;
typedef struct _VbfProjectClass VbfProjectClass;

#define VBF_BACKENDS_TYPE_AUTOTOOLS (vbf_backends_autotools_get_type ())
#define VBF_BACKENDS_AUTOTOOLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_BACKENDS_TYPE_AUTOTOOLS, VbfBackendsAutotools))
#define VBF_BACKENDS_AUTOTOOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_BACKENDS_TYPE_AUTOTOOLS, VbfBackendsAutotoolsClass))
#define VBF_BACKENDS_IS_AUTOTOOLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_BACKENDS_TYPE_AUTOTOOLS))
#define VBF_BACKENDS_IS_AUTOTOOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_BACKENDS_TYPE_AUTOTOOLS))
#define VBF_BACKENDS_AUTOTOOLS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_BACKENDS_TYPE_AUTOTOOLS, VbfBackendsAutotoolsClass))

typedef struct _VbfBackendsAutotools VbfBackendsAutotools;
typedef struct _VbfBackendsAutotoolsClass VbfBackendsAutotoolsClass;

#define VBF_BACKENDS_TYPE_SMART_FOLDER (vbf_backends_smart_folder_get_type ())
#define VBF_BACKENDS_SMART_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_BACKENDS_TYPE_SMART_FOLDER, VbfBackendsSmartFolder))
#define VBF_BACKENDS_SMART_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_BACKENDS_TYPE_SMART_FOLDER, VbfBackendsSmartFolderClass))
#define VBF_BACKENDS_IS_SMART_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_BACKENDS_TYPE_SMART_FOLDER))
#define VBF_BACKENDS_IS_SMART_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_BACKENDS_TYPE_SMART_FOLDER))
#define VBF_BACKENDS_SMART_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_BACKENDS_TYPE_SMART_FOLDER, VbfBackendsSmartFolderClass))

typedef struct _VbfBackendsSmartFolder VbfBackendsSmartFolder;
typedef struct _VbfBackendsSmartFolderClass VbfBackendsSmartFolderClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _VbfIProjectBackendIface {
	GTypeInterface parent_iface;
	gboolean (*probe) (VbfIProjectBackend* self, const gchar* project_file);
	VbfProject* (*open) (VbfIProjectBackend* self, const gchar* project_file);
	void (*refresh) (VbfIProjectBackend* self, VbfProject* project);
	gchar* (*get_configure_command) (VbfIProjectBackend* self);
	gchar* (*get_build_command) (VbfIProjectBackend* self);
	gchar* (*get_clean_command) (VbfIProjectBackend* self);
};



GType vbf_config_node_get_type (void) G_GNUC_CONST;
GType vbf_project_get_type (void) G_GNUC_CONST;
GType vbf_iproject_backend_get_type (void) G_GNUC_CONST;
gboolean vbf_probe (const gchar* path, VbfIProjectBackend** backend);
VbfBackendsAutotools* vbf_backends_autotools_new (void);
VbfBackendsAutotools* vbf_backends_autotools_construct (GType object_type);
GType vbf_backends_autotools_get_type (void) G_GNUC_CONST;
gboolean vbf_iproject_backend_probe (VbfIProjectBackend* self, const gchar* project_file);
VbfBackendsSmartFolder* vbf_backends_smart_folder_new (void);
VbfBackendsSmartFolder* vbf_backends_smart_folder_construct (GType object_type);
GType vbf_backends_smart_folder_get_type (void) G_GNUC_CONST;
VbfProject* vbf_iproject_backend_open (VbfIProjectBackend* self, const gchar* project_file);
void vbf_iproject_backend_refresh (VbfIProjectBackend* self, VbfProject* project);
gchar* vbf_iproject_backend_get_configure_command (VbfIProjectBackend* self);
gchar* vbf_iproject_backend_get_build_command (VbfIProjectBackend* self);
gchar* vbf_iproject_backend_get_clean_command (VbfIProjectBackend* self);


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


gboolean vbf_probe (const gchar* path, VbfIProjectBackend** backend) {
	VbfIProjectBackend* _backend = NULL;
	gboolean result = FALSE;
	VbfBackendsAutotools* _tmp0_ = NULL;
	VbfIProjectBackend* pb;
	gboolean _tmp1_;
	gboolean res;
	g_return_val_if_fail (path != NULL, FALSE);
	_tmp0_ = vbf_backends_autotools_new ();
	pb = (VbfIProjectBackend*) _tmp0_;
	_tmp1_ = vbf_iproject_backend_probe (pb, path);
	res = _tmp1_;
	if (!res) {
		VbfBackendsSmartFolder* _tmp2_ = NULL;
		gboolean _tmp3_;
		_tmp2_ = vbf_backends_smart_folder_new ();
		_g_object_unref0 (pb);
		pb = (VbfIProjectBackend*) _tmp2_;
		_tmp3_ = vbf_iproject_backend_probe (pb, path);
		res = _tmp3_;
	}
	if (res) {
		VbfIProjectBackend* _tmp4_;
		_tmp4_ = _g_object_ref0 (pb);
		_g_object_unref0 (_backend);
		_backend = _tmp4_;
	} else {
		_g_object_unref0 (_backend);
		_backend = NULL;
	}
	result = res;
	_g_object_unref0 (pb);
	if (backend) {
		*backend = _backend;
	} else {
		_g_object_unref0 (_backend);
	}
	return result;
}


gboolean vbf_iproject_backend_probe (VbfIProjectBackend* self, const gchar* project_file) {
	return VBF_IPROJECT_BACKEND_GET_INTERFACE (self)->probe (self, project_file);
}


VbfProject* vbf_iproject_backend_open (VbfIProjectBackend* self, const gchar* project_file) {
	return VBF_IPROJECT_BACKEND_GET_INTERFACE (self)->open (self, project_file);
}


void vbf_iproject_backend_refresh (VbfIProjectBackend* self, VbfProject* project) {
	VBF_IPROJECT_BACKEND_GET_INTERFACE (self)->refresh (self, project);
}


gchar* vbf_iproject_backend_get_configure_command (VbfIProjectBackend* self) {
	return VBF_IPROJECT_BACKEND_GET_INTERFACE (self)->get_configure_command (self);
}


gchar* vbf_iproject_backend_get_build_command (VbfIProjectBackend* self) {
	return VBF_IPROJECT_BACKEND_GET_INTERFACE (self)->get_build_command (self);
}


gchar* vbf_iproject_backend_get_clean_command (VbfIProjectBackend* self) {
	return VBF_IPROJECT_BACKEND_GET_INTERFACE (self)->get_clean_command (self);
}


static void vbf_iproject_backend_base_init (VbfIProjectBackendIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		g_object_interface_install_property (iface, g_param_spec_string ("configure-command", "configure-command", "configure-command", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
		g_object_interface_install_property (iface, g_param_spec_string ("build-command", "build-command", "build-command", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
		g_object_interface_install_property (iface, g_param_spec_string ("clean-command", "clean-command", "clean-command", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	}
}


GType vbf_iproject_backend_get_type (void) {
	static volatile gsize vbf_iproject_backend_type_id__volatile = 0;
	if (g_once_init_enter (&vbf_iproject_backend_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (VbfIProjectBackendIface), (GBaseInitFunc) vbf_iproject_backend_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType vbf_iproject_backend_type_id;
		vbf_iproject_backend_type_id = g_type_register_static (G_TYPE_INTERFACE, "VbfIProjectBackend", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (vbf_iproject_backend_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&vbf_iproject_backend_type_id__volatile, vbf_iproject_backend_type_id);
	}
	return vbf_iproject_backend_type_id__volatile;
}



