[anjuta] project-manager: Allow to change project backend



commit a7269b08852a39ae1051c979f80a4e40f8509d01
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Sat Jan 5 15:56:27 2013 +0100

    project-manager: Allow to change project backend

 .../C/autotools-project-root-edit.page             |    7 +
 manuals/anjuta-manual/C/project-manager.page       |    7 +
 plugins/project-import/plugin.c                    |    5 +-
 plugins/project-manager/dialogs.c                  |  146 +++++++++++++++++++-
 plugins/project-manager/plugin.c                   |   79 +++++++++++
 plugins/project-manager/plugin.h                   |    2 +
 plugins/project-manager/project-view.c             |   18 +--
 plugins/project-manager/project.c                  |  110 +++++++++-------
 plugins/project-manager/project.h                  |    6 +-
 9 files changed, 312 insertions(+), 68 deletions(-)
---
diff --git a/manuals/anjuta-manual/C/autotools-project-root-edit.page b/manuals/anjuta-manual/C/autotools-project-root-edit.page
index 531ce77..0ec20b4 100644
--- a/manuals/anjuta-manual/C/autotools-project-root-edit.page
+++ b/manuals/anjuta-manual/C/autotools-project-root-edit.page
@@ -22,6 +22,13 @@
 
   <terms>
     <item>
+      <title><gui>Backend</gui></title>
+      <p>This the project backend used by the project: Autotools.
+      Another backend can be selected by clicking on this button. It can be
+      useful if the current backend has some troubles to parse your project
+      files.</p>
+    </item>
+    <item>
       <title><gui>Name</gui></title>
       <p>The name of your project. It can contains space.</p>
     </item>
diff --git a/manuals/anjuta-manual/C/project-manager.page b/manuals/anjuta-manual/C/project-manager.page
index 17f6c2c..f52aabd 100644
--- a/manuals/anjuta-manual/C/project-manager.page
+++ b/manuals/anjuta-manual/C/project-manager.page
@@ -4,6 +4,7 @@
 
   <info xmlns:facet="http://projectmallard.org/facet/1.0/";>
     <facet:tag key="all-pages" value="whatever"/> <!--Include page in index-->
+    <link type="seealso" xref="project-manager-root"/>
     <desc>
       Project manager.
     </desc>
@@ -26,6 +27,12 @@
   </p>
 
   <p>
+    The project backend to use is choosen when creating or importing a new
+    project in <app>Anjuta</app>. It is displayed in the properties of the
+    project root node and can be changed at any time.
+  </p>
+
+  <p>
     Whatever the underlying backend, the graphical interface is the same
     but some functions might be disabled.
   </p>
diff --git a/plugins/project-import/plugin.c b/plugins/project-import/plugin.c
index e5455a0..60f16e1 100644
--- a/plugins/project-import/plugin.c
+++ b/plugins/project-import/plugin.c
@@ -165,9 +165,12 @@ project_import_generate_file (AnjutaPluginDescription *backend, ProjectImportDia
 				str = g_string_new (NULL);
 				g_string_printf (str, "<plugin name= \"%s\"\n"
 				                 "            mandatory=\"yes\">\n"
-				             	 "         <require group=\"Anjuta Plugin\"\n"
+				                 "         <require group=\"Anjuta Plugin\"\n"
 				                 "                  attribute=\"Location\"\n"
 				                 "                  value=\"%s\"/>\n"
+				                 "         <require group=\"Anjuta Plugin\"\n"
+				                 "                  attribute=\"Interfaces\"\n"
+				                 "                  value=\"IAnjutaProjectBackend\"/>\n"
 				                 "    ", name, plugin_id);
 					
 				g_string_erase (buffer, plugin - buffer->str, end_plugin - plugin);
diff --git a/plugins/project-manager/dialogs.c b/plugins/project-manager/dialogs.c
index cd0bd7c..45d96f7 100644
--- a/plugins/project-manager/dialogs.c
+++ b/plugins/project-manager/dialogs.c
@@ -36,6 +36,7 @@
 #include <libanjuta/anjuta-pkg-config-chooser.h>
 #include <libanjuta/anjuta-tree-combo.h>
 #include <libanjuta/interfaces/ianjuta-project-chooser.h>
+#include <libanjuta/interfaces/ianjuta-project-backend.h>
 
 #define ICON_SIZE 16
 
@@ -55,6 +56,7 @@
 typedef struct _PropertiesTable
 {
 	AnjutaPmProject *project;
+	AnjutaPluginDescription *new_backend;
 	GtkWidget *dialog;
 	GtkWidget *table;
 	GtkWidget *head;
@@ -539,6 +541,31 @@ add_label (const gchar *display_name, const gchar *value, GtkWidget *table, gint
 }
 
 static void
+add_button (const gchar *display_name, const gchar *value, GCallback on_clicked, PropertiesTable *properties, GtkWidget *table, gint *position)
+{
+	GtkWidget *label;
+	GtkWidget *button;
+
+	label = gtk_label_new (display_name);
+	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+	gtk_widget_show (label);
+	gtk_table_attach (GTK_TABLE (table), label, 0, 1, *position, *position+1,
+			  GTK_FILL, GTK_FILL, 5, 3);
+
+	button = gtk_button_new_with_label (value);
+	gtk_button_set_alignment (GTK_BUTTON (button), 0, 0.5);
+	gtk_widget_show (button);
+	gtk_table_attach (GTK_TABLE (table), button, 1, 2, *position, *position+1,
+			  GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
+	if (on_clicked != NULL)
+	{
+		g_signal_connect (G_OBJECT (button), "clicked", on_clicked, properties);
+	}
+
+	*position = *position + 1;
+}
+
+static void
 pm_project_resize_properties_dialog (PropertiesTable *table)
 {
 	gint border_width, maximum_width, maximum_height;
@@ -569,6 +596,78 @@ pm_project_resize_properties_dialog (PropertiesTable *table)
 }
 
 static void
+on_change_project_backend (GtkButton *button,
+                           gpointer user_data)
+{
+	PropertiesTable *table = (PropertiesTable *)user_data;
+	AnjutaPluginManager *plugin_manager;
+	GList *descs = NULL;
+	GList *desc;
+	AnjutaPluginDescription *backend;
+
+	/* Search for all valid project backend */
+	plugin_manager = anjuta_shell_get_plugin_manager (ANJUTA_PLUGIN(table->project->plugin)->shell, NULL);
+	descs = anjuta_plugin_manager_query (plugin_manager,
+										 "Anjuta Plugin",
+										 "Interfaces",
+										 "IAnjutaProjectBackend",
+										 NULL);	
+	for (desc = g_list_first (descs); desc != NULL;) {
+		IAnjutaProjectBackend *plugin;
+		gchar *location = NULL;
+		GList *next;
+		
+		backend = (AnjutaPluginDescription *)desc->data;
+		anjuta_plugin_description_get_string (backend, "Anjuta Plugin", "Location", &location);
+		plugin = (IAnjutaProjectBackend *)anjuta_plugin_manager_get_plugin_by_id (plugin_manager, location);
+		g_free (location);
+
+		next = g_list_next (desc);
+		
+		/* Probe the project directory to find if the backend can handle it */
+		if (ianjuta_project_backend_probe (plugin, anjuta_project_node_get_file (table->node), NULL) <= 0)
+		{
+			/* Remove invalid backend */
+			descs = g_list_delete_link (descs, desc);
+		}
+
+		desc = next;
+	}
+
+	if (descs != NULL)
+	{
+		/* Move the current backend at the beginning of the list */
+		backend = anjuta_pm_project_get_backend (table->project);
+		for (desc = g_list_first (descs); desc != NULL; desc = g_list_next (desc)) {
+			if (desc->data == backend)
+			{
+				descs = g_list_remove_link (descs, desc);
+				descs = g_list_concat (desc, descs);
+				break;
+			}
+		}
+		     
+		/* Several backend are possible, ask the user to select one */
+		gchar* message = g_strdup_printf (_("Please select a project backend to use."));
+		
+		backend = anjuta_plugin_manager_select (plugin_manager,
+		    _("Open With"),
+		    message,
+		    descs);
+		g_free (message);
+		g_list_free (descs);
+
+		if (backend != NULL)
+		{
+			const gchar *name;
+			anjuta_plugin_description_get_locale_string (backend, "Anjuta Plugin", "Name", &name);
+			gtk_button_set_label (button, name);
+			table->new_backend = backend;
+		}
+	}
+}
+
+static void
 update_properties (PropertiesTable *table)
 {
 	GFile *file;
@@ -634,6 +733,22 @@ update_properties (PropertiesTable *table)
 	g_list_free (table->properties);
 	table->properties = NULL;
 
+	/* Display project backend if the root node is selected */
+	if ((anjuta_project_node_get_node_type (table->node) == ANJUTA_PROJECT_ROOT) ||
+		((anjuta_project_node_get_full_type (table->node) & ANJUTA_PROJECT_ID_MASK) == ANJUTA_PROJECT_ROOT_GROUP))
+	{
+		AnjutaPluginDescription *backend;
+
+		backend = anjuta_pm_project_get_backend (table->project);
+		if (backend)
+		{
+			const gchar *name;
+			
+			anjuta_plugin_description_get_locale_string (backend, "Anjuta Plugin", "Name", &name);
+			add_button (_("Backend:"), name, on_change_project_backend, table, table->head, &head_pos);
+		}
+	}
+
 	/* Update node name */
 	file = anjuta_project_node_get_file (table->node);
 	if (file != NULL)
@@ -649,13 +764,6 @@ update_properties (PropertiesTable *table)
 		add_label (_("Name:"), anjuta_project_node_get_name (table->node), table->head, &head_pos);
 	}
 
-	/* Display project backend if the root node is selected */
-	if ((anjuta_project_node_get_node_type (table->node) == ANJUTA_PROJECT_ROOT) ||
-		((anjuta_project_node_get_full_type (table->node) & ANJUTA_PROJECT_ID_MASK) == ANJUTA_PROJECT_ROOT_GROUP))
-	{
-		add_label (_("Backend:"), anjuta_pm_project_get_backend_name (table->project), table->main, &main_pos);
-	}
-
 	/* Display node type only if several types are possible */
 	node_info = NULL;
 	single = TRUE;
@@ -814,6 +922,29 @@ on_properties_dialog_response (GtkWidget *dialog,
 				break;
 			}
 		}
+
+		/* Update backend if needed */
+		if ((table->new_backend != NULL) && (table->new_backend != anjuta_pm_project_get_backend (table->project)))
+		{
+			GFile *root;
+			AnjutaStatus *status;
+			gchar *path;
+
+			change_project_backend (ANJUTA_PLUGIN_PROJECT_MANAGER (table->project->plugin), table->new_backend);
+			
+			root = g_object_ref (anjuta_project_node_get_file (table->node));
+			path = g_file_get_path (root);
+			
+			status = anjuta_shell_get_status (table->project->plugin->shell, NULL);
+			anjuta_status_progress_add_ticks (status, 1);
+			anjuta_status_push (status, _("Reloading project: %s"), path);
+			g_free (path);
+			anjuta_status_busy_push (status);
+			ANJUTA_PLUGIN_PROJECT_MANAGER (table->project->plugin)->busy = TRUE;
+			anjuta_pm_project_unload (table->project, NULL);
+			anjuta_pm_project_load_with_backend (table->project, root, table->new_backend, NULL);
+			g_object_unref (root);
+		}
 	}
 	else if (id == GTK_RESPONSE_HELP)
 	{
@@ -882,6 +1013,7 @@ pm_project_create_properties_dialog (AnjutaPmProject *project, GtkWindow *parent
 	table->data = data;
 	table->node = gbf_tree_data_get_node (data);
 	table->project = project;
+	table->new_backend = NULL;
 	anjuta_util_builder_get_objects (bxml,
 	                                "property_dialog", &table->dialog,
 									"properties", &table->table,
diff --git a/plugins/project-manager/plugin.c b/plugins/project-manager/plugin.c
index 8218245..c5502c9 100644
--- a/plugins/project-manager/plugin.c
+++ b/plugins/project-manager/plugin.c
@@ -29,6 +29,7 @@
 #include <libanjuta/interfaces/ianjuta-project-backend.h>
 #include <libanjuta/interfaces/ianjuta-project.h>
 #include <libanjuta/anjuta-profile-manager.h>
+#include <libanjuta/anjuta-profile.h>
 #include <libanjuta/anjuta-debug.h>
 #include <libanjuta/anjuta-status.h>
 #include <libanjuta/anjuta-project.h>
@@ -377,6 +378,84 @@ get_plugin_parent_window (ProjectManagerPlugin *plugin)
 	return win;
 }
 
+gboolean
+change_project_backend (ProjectManagerPlugin *plugin, AnjutaPluginDescription *backend)
+{
+	gchar *content;
+	gsize length;
+	GError *error = NULL;
+
+	if (g_file_load_contents (plugin->project_file, NULL, &content, &length, NULL, &error))
+	{
+		GString *buffer;
+		const gchar *pos;
+		const gchar *start_plugin;
+		const gchar *end_plugin;
+		gssize len;
+
+		buffer = g_string_new_len (content, length);
+		pos = buffer->str;
+		len = buffer->len;
+		for (;;)
+		{
+			start_plugin = g_strstr_len (pos, len, "<plugin ");
+			if (start_plugin == NULL) break;
+				
+			end_plugin = g_strstr_len (start_plugin, len - (start_plugin - pos), "</plugin>");
+			if (end_plugin == NULL) break;
+				
+			if (g_strstr_len (start_plugin, end_plugin - start_plugin, "\"IAnjutaProjectBackend\"") != NULL) break;
+
+			pos = end_plugin + 9;
+			len -= (end_plugin + 9 - pos);
+		}
+
+		if ((start_plugin == NULL) || (end_plugin == NULL))
+		{
+			g_set_error (&error, ianjuta_project_backend_error_quark(),0, "Unable to find backend plugin");
+		}
+		else
+		{
+			/* Replace plugin implementing IAnjutaProjectBackend with the right one */
+			GString *str;
+			GFileOutputStream *stream;
+			gchar *name = NULL;
+			gchar *plugin_id = NULL;
+
+			anjuta_plugin_description_get_string (backend, "Anjuta Plugin", "Name", &name);
+			anjuta_plugin_description_get_string (backend, "Anjuta Plugin", "Location", &plugin_id);
+
+			str = g_string_new (NULL);
+			g_string_printf (str, "<plugin name= \"%s\"\n"
+			                      "            mandatory=\"yes\">\n"
+			                      "         <require group=\"Anjuta Plugin\"\n"
+			                      "                  attribute=\"Location\"\n"
+			                      "                  value=\"%s\"/>\n"
+			                      "         <require group=\"Anjuta Plugin\"\n"
+			                      "                  attribute=\"Interfaces\"\n"
+			                      "                  value=\"IAnjutaProjectBackend\"/>\n"
+			                      "    ", name, plugin_id);
+
+			g_string_erase (buffer, start_plugin - buffer->str, end_plugin - start_plugin);
+			g_string_insert_len (buffer, start_plugin - buffer->str, str->str, str->len);
+
+			g_string_free (str, TRUE);
+
+			stream = g_file_replace (plugin->project_file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, NULL, &error);
+			if (stream != NULL)
+			{
+				gsize written;
+
+				g_output_stream_write_all (G_OUTPUT_STREAM (stream), buffer->str, buffer->len, &written, NULL, &error);
+				g_output_stream_close (G_OUTPUT_STREAM (stream), NULL, NULL);
+			}
+		}
+		g_string_free (buffer, TRUE);
+		g_free (content);
+	}
+
+	return error == NULL;
+}
 
 /* GUI callbacks
  *---------------------------------------------------------------------------*/
diff --git a/plugins/project-manager/plugin.h b/plugins/project-manager/plugin.h
index 85e387c..9ada095 100644
--- a/plugins/project-manager/plugin.h
+++ b/plugins/project-manager/plugin.h
@@ -23,6 +23,7 @@
 
 #include <libanjuta/anjuta-plugin.h>
 #include <libanjuta/anjuta-project.h>
+#include <libanjuta/anjuta-plugin-description.h>
 #include <libanjuta/interfaces/ianjuta-project.h>
 #include "project-model.h"
 #include "project-view.h"
@@ -84,6 +85,7 @@ struct _ProjectManagerPluginClass{
 };
 
 GtkWindow* get_plugin_parent_window (ProjectManagerPlugin *plugin);
+gboolean change_project_backend (ProjectManagerPlugin *plugin, AnjutaPluginDescription *backend);
 
 
 #endif
diff --git a/plugins/project-manager/project-view.c b/plugins/project-manager/project-view.c
index 876d127..924c802 100644
--- a/plugins/project-manager/project-view.c
+++ b/plugins/project-manager/project-view.c
@@ -1422,21 +1422,17 @@ on_node_loaded (AnjutaPmProject *sender, AnjutaProjectNode *node, gboolean compl
 				else
 				{
 					GbfTreeData *data;
+					GbfTreeData *new_data;
 
+					/* Replace with new node */
 					gtk_tree_model_get (GTK_TREE_MODEL (view->model), &iter,
 						GBF_PROJECT_MODEL_COLUMN_DATA, &data,
 						-1);
-					if (data->type == GBF_TREE_NODE_UNKNOWN)
-					{
-						/* Replace with real node */
-						GbfTreeData *new_data;
-
-						new_data = gbf_tree_data_new_node (node);
-						gtk_tree_store_set (GTK_TREE_STORE (view->model), &iter,
-									GBF_PROJECT_MODEL_COLUMN_DATA, new_data,
-									-1);
-						gbf_tree_data_free (data);
-					}
+					new_data = gbf_tree_data_new_node (node);
+					gtk_tree_store_set (GTK_TREE_STORE (view->model), &iter,
+								GBF_PROJECT_MODEL_COLUMN_DATA, new_data,
+								-1);
+					gbf_tree_data_free (data);
 					gbf_project_view_update_tree (view, node, &iter);
 				}
 
diff --git a/plugins/project-manager/project.c b/plugins/project-manager/project.c
index feee40b..6444f76 100644
--- a/plugins/project-manager/project.c
+++ b/plugins/project-manager/project.c
@@ -119,6 +119,64 @@ on_node_changed (IAnjutaProject *sender, AnjutaProjectNode *node, GError *error,
 /* Public functions
  *---------------------------------------------------------------------------*/
 
+gboolean
+anjuta_pm_project_load_with_backend (AnjutaPmProject *project, GFile *file, AnjutaPluginDescription *backend, GError **error)
+{
+	AnjutaPluginManager *plugin_manager;
+	gchar *location = NULL;
+	IAnjutaProjectBackend *plugin;
+	GValue value = {0, };
+
+	anjuta_plugin_description_get_string (backend, "Anjuta Plugin", "Location", &location);
+	plugin_manager = anjuta_shell_get_plugin_manager (project->plugin->shell, NULL);
+	plugin = (IAnjutaProjectBackend *)anjuta_plugin_manager_get_plugin_by_id (plugin_manager, location);
+	g_free (location);
+
+	
+	DEBUG_PRINT ("%s", "Creating new gbf project\n");
+	project->project = ianjuta_project_backend_new_project (plugin, file, NULL);
+	if (!project->project)
+	{
+		/* FIXME: Set err */
+		g_warning ("project creation failed\n");
+
+		return FALSE;
+	}
+	project->backend =backend;
+
+	g_signal_connect (G_OBJECT (project->project),
+						"file-changed",
+						G_CALLBACK (on_file_changed),
+						project);
+	g_signal_connect (G_OBJECT (project->project),
+						"node-loaded",
+						G_CALLBACK (on_node_loaded),
+						project);
+	g_signal_connect (G_OBJECT (project->project),
+						"node-changed",
+						G_CALLBACK (on_node_changed),
+						project);
+
+	/* Export project root shell variable */
+	g_value_init (&value, G_TYPE_OBJECT);
+	g_value_set_object (&value, project->project);
+	anjuta_shell_add_value (project->plugin->shell,
+	                        IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT,
+	                        &value, NULL);
+	g_value_unset(&value);
+	g_value_init (&value, G_TYPE_STRING);
+	g_value_set_string (&value, ANJUTA_PLUGIN_PROJECT_MANAGER (project->plugin)->project_root_uri);
+	anjuta_shell_add_value (project->plugin->shell,
+							IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI,
+							&value, NULL);
+	g_value_unset(&value);
+
+	project->root = ianjuta_project_get_root (project->project, NULL);
+	ianjuta_project_load_node (project->project, project->root, NULL);
+
+	return TRUE;
+}
+
 
 gboolean
 anjuta_pm_project_load (AnjutaPmProject *project, GFile *file, GError **error)
@@ -128,7 +186,6 @@ anjuta_pm_project_load (AnjutaPmProject *project, GFile *file, GError **error)
 	IAnjutaProjectBackend *backend;
 	AnjutaPluginDescription *backend_desc;
 	gint found = 0;
-	GValue value = {0, };
 
 	g_return_val_if_fail (file != NULL, FALSE);
 
@@ -181,51 +238,10 @@ anjuta_pm_project_load (AnjutaPmProject *project, GFile *file, GError **error)
 
 		return FALSE;
 	}
-
-	DEBUG_PRINT ("%s", "Creating new gbf project\n");
-	project->project = ianjuta_project_backend_new_project (backend, file, NULL);
-	if (!project->project)
-	{
-		/* FIXME: Set err */
-		g_warning ("project creation failed\n");
-
-		return FALSE;
-	}
+	
 	backend_desc = anjuta_plugin_manager_get_plugin_description (plugin_manager, G_OBJECT(backend));
-	if (backend_desc) anjuta_plugin_description_get_locale_string (backend_desc, "Anjuta Plugin", "Name", &project->backend);
 
-	g_signal_connect (G_OBJECT (project->project),
-						"file-changed",
-						G_CALLBACK (on_file_changed),
-						project);
-	g_signal_connect (G_OBJECT (project->project),
-						"node-loaded",
-						G_CALLBACK (on_node_loaded),
-						project);
-	g_signal_connect (G_OBJECT (project->project),
-						"node-changed",
-						G_CALLBACK (on_node_changed),
-						project);
-
-	project->root = ianjuta_project_get_root (project->project, NULL);
-
-	/* Export project root shell variable */
-	g_value_init (&value, G_TYPE_OBJECT);
-	g_value_set_object (&value, project->project);
-	anjuta_shell_add_value (project->plugin->shell,
-	                        IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT,
-	                        &value, NULL);
-	g_value_unset(&value);
-	g_value_init (&value, G_TYPE_STRING);
-	g_value_set_string (&value, ANJUTA_PLUGIN_PROJECT_MANAGER (project->plugin)->project_root_uri);
-	anjuta_shell_add_value (project->plugin->shell,
-							IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI,
-							&value, NULL);
-	g_value_unset(&value);
-
-	ianjuta_project_load_node (project->project, project->root, NULL);
-
-	return TRUE;
+	return anjuta_pm_project_load_with_backend (project, file, backend_desc, error);
 }
 
 gboolean
@@ -399,11 +415,11 @@ anjuta_pm_project_remove (AnjutaPmProject *project, AnjutaProjectNode *node, GEr
 gboolean
 anjuta_pm_project_is_open (AnjutaPmProject *project)
 {
-	return project->project != NULL;
+	return (project->project != NULL) && (project->root != NULL);
 }
 
-const gchar *
-anjuta_pm_project_get_backend_name (AnjutaPmProject *project)
+AnjutaPluginDescription *
+anjuta_pm_project_get_backend (AnjutaPmProject *project)
 {
 	return project->backend;
 }
diff --git a/plugins/project-manager/project.h b/plugins/project-manager/project.h
index 8c9a94f..4c4f031 100644
--- a/plugins/project-manager/project.h
+++ b/plugins/project-manager/project.h
@@ -26,6 +26,7 @@
 #include <glib-object.h>
 #include <libanjuta/anjuta-plugin.h>
 #include <libanjuta/anjuta-project.h>
+#include <libanjuta/anjuta-plugin-description.h>
 #include <libanjuta/interfaces/ianjuta-project.h>
 
 #include "project-model.h"
@@ -57,7 +58,7 @@ struct _AnjutaPmProject
 	AnjutaPlugin *plugin;
 
 	IAnjutaProject *project;
-	const gchar *backend;
+	AnjutaPluginDescription *backend;
 
 	AnjutaProjectNode *root;
 
@@ -77,6 +78,7 @@ AnjutaPmProject* anjuta_pm_project_new (AnjutaPlugin *plugin);
 void anjuta_pm_project_free (AnjutaPmProject* project);
 
 gboolean anjuta_pm_project_load (AnjutaPmProject *project, GFile *file, GError **error);
+gboolean anjuta_pm_project_load_with_backend (AnjutaPmProject *project, GFile *file, AnjutaPluginDescription *backend, GError **error);
 gboolean anjuta_pm_project_unload (AnjutaPmProject *project, GError **error);
 gboolean anjuta_pm_project_refresh (AnjutaPmProject *project, GError **error);
 
@@ -94,7 +96,7 @@ gboolean anjuta_pm_project_remove_data (AnjutaPmProject *project, GbfTreeData *d
 
 
 gboolean anjuta_pm_project_is_open (AnjutaPmProject *project);
-const gchar *anjuta_pm_project_get_backend_name (AnjutaPmProject *project);
+AnjutaPluginDescription *anjuta_pm_project_get_backend (AnjutaPmProject *project);
 
 IAnjutaProject *anjuta_pm_project_get_project (AnjutaPmProject *project);
 GbfProjectModel *anjuta_pm_project_get_model (AnjutaPmProject *project);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]