anjuta r3913 - in trunk: . libanjuta/interfaces plugins/project-manager plugins/symbol-browser



Author: jhs
Date: Fri May  2 13:00:26 2008
New Revision: 3913
URL: http://svn.gnome.org/viewvc/anjuta?rev=3913&view=rev

Log:
2008-05-02  Johannes Schmid  <jhs gnome org>

	* configure.in: changed gnome-build requirement, bumped version to 2.5.0
	* libanjuta/interfaces/libanjuta.idl:
	* plugins/project-manager/plugin.c (iproject_manager_get_packages),
	(iproject_manager_iface_init):
	Add an interface method to access the pkg-config data from gnome-build.
	
	* plugins/symbol-browser/plugin.c (project_root_added):
	Automatically load symbol from project configuration (proof-of-concept)

Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/libanjuta/interfaces/libanjuta.idl
   trunk/plugins/project-manager/plugin.c
   trunk/plugins/symbol-browser/plugin.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Fri May  2 13:00:26 2008
@@ -3,7 +3,7 @@
 AC_PREREQ(2.59)
 
 m4_define(anjuta_major_version,  2)
-m4_define(anjuta_minor_version, 4)
+m4_define(anjuta_minor_version, 5)
 m4_define(anjuta_micro_version,  0)
 m4_define(anjuta_version, anjuta_major_version.anjuta_minor_version.anjuta_micro_version)
 
@@ -41,7 +41,7 @@
 PCRE_REQUIRED=3.9
 LIBDEVHELP_REQUIRED=0.13
 GDL_REQUIRED=0.7.3
-GNOMEBUILD_REQUIRED=0.2.0
+GNOMEBUILD_REQUIRED=0.3.0
 GLADEUI_REQUIRED=3.2.0
 LIBGRAPHVIZ_REQUIRED=1.0
 NEON_REQUIRED=0.24.5

Modified: trunk/libanjuta/interfaces/libanjuta.idl
==============================================================================
--- trunk/libanjuta/interfaces/libanjuta.idl	(original)
+++ trunk/libanjuta/interfaces/libanjuta.idl	Fri May  2 13:00:26 2008
@@ -2844,6 +2844,16 @@
 	* fixme
 	*/ 
 	gboolean is_open ();
+	
+	/*
+	 * ianjuta_project_manager_get_packages
+	 * @obj: Self
+	 * @err: Error propagation and reporting.
+	 *
+	 * Returns: the list of pkg-config packages that this projects
+	 * requires in it's configure.ac or NULL
+	 */
+	List<gchar*> get_packages();
 }
 
 /**

Modified: trunk/plugins/project-manager/plugin.c
==============================================================================
--- trunk/plugins/project-manager/plugin.c	(original)
+++ trunk/plugins/project-manager/plugin.c	Fri May  2 13:00:26 2008
@@ -2217,6 +2217,28 @@
 	return GBF_IS_PROJECT (plugin->project);
 }
 
+static GList*
+iproject_manager_get_packages (IAnjutaProjectManager *project_manager, GError **err)
+{
+	ProjectManagerPlugin *plugin;
+	GList *modules = NULL;
+	GList *packages = NULL;
+	GList* node;
+	
+	plugin = ANJUTA_PLUGIN_PROJECT_MANAGER (G_OBJECT (project_manager));
+	
+	modules = gbf_project_get_config_modules (plugin->project, NULL);
+	for (node = modules; node != NULL; node = g_list_next (node))
+	{
+		GList* mod_pkgs = gbf_project_get_config_packages (plugin->project,
+														   node->data, NULL);
+		packages = g_list_concat (packages, mod_pkgs);
+	}
+	g_list_foreach (modules, (GFunc)g_free, NULL);
+	g_list_free (modules);
+	return packages;
+}
+
 static void
 iproject_manager_iface_init(IAnjutaProjectManagerIface *iface)
 {
@@ -2233,6 +2255,7 @@
 	iface->add_target = iproject_manager_add_target;
 	iface->add_group = iproject_manager_add_group;
 	iface->is_open = iproject_manager_is_open;
+	iface->get_packages = iproject_manager_get_packages;
 }
 
 static void

Modified: trunk/plugins/symbol-browser/plugin.c
==============================================================================
--- trunk/plugins/symbol-browser/plugin.c	(original)
+++ trunk/plugins/symbol-browser/plugin.c	Fri May  2 13:00:26 2008
@@ -45,6 +45,7 @@
 #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-symbol-browser-plugin.ui"
 #define PREFS_GLADE PACKAGE_DATA_DIR"/glade/anjuta-symbol-browser-plugin.glade"
 #define ICON_FILE "anjuta-symbol-browser-plugin-48.png"
+#define SYMBOL_BROWSER_TAGS "symbol.browser.tags"
 
 #define TIMEOUT_INTERVAL_SYMBOLS_UPDATE		10000
 
@@ -350,6 +351,8 @@
 	}
 }
 
+#define LOCAL_TAGS_DIR ".anjuta/tags"
+
 // add a new project
 static void
 project_root_added (AnjutaPlugin *plugin, const gchar *name,
@@ -359,6 +362,7 @@
 	IAnjutaProjectManager *pm;
 	SymbolBrowserPlugin *sv_plugin;
 	const gchar *root_uri;
+	gchar* tags;
 
 	sv_plugin = ANJUTA_PLUGIN_SYMBOL_BROWSER (plugin);
 	  
@@ -393,7 +397,28 @@
 					  G_CALLBACK (on_project_element_added), sv_plugin);
 	g_signal_connect (G_OBJECT (pm), "element_removed",
 					  G_CALLBACK (on_project_element_removed), sv_plugin);
-}
+	/* Load from project */
+	{
+		gchar* dirname = g_build_filename (g_get_home_dir (), LOCAL_TAGS_DIR, NULL);
+		GList* packages = ianjuta_project_manager_get_packages (pm, NULL);
+		GList* node;
+		GString* str = g_string_new ("");
+		for (node = packages; node != NULL; node = g_list_next (node))
+		{
+			gchar* pathname = g_build_filename (dirname, node->data, NULL);
+			if (str->len)
+				g_string_append_c (str, ':');
+			g_string_append (str, pathname);
+			g_string_append (str, ".anjutatags.gz");
+			g_free (pathname);
+		}
+		g_list_foreach (packages, (GFunc) g_free, NULL);
+		g_list_free (packages);
+		anjuta_preferences_set (sv_plugin->prefs, SYMBOL_BROWSER_TAGS, str->str);
+		g_string_free (str, TRUE);
+		g_free (dirname);
+	}
+}	   
 
 static void
 project_root_removed (AnjutaPlugin *plugin, const gchar *name,



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