[anjuta] libanjuta, symbol-db, language-support-cpp-java: compilable cxxparser inside lsp.



commit a51d4a73b2f8b7eb923550e7711b93d6ad94357a
Author: Massimo Corà <mcora src gnome org>
Date:   Tue Dec 8 01:25:43 2009 +0100

    libanjuta, symbol-db, language-support-cpp-java: compilable cxxparser inside lsp.
    
    Translated all the symbol_db_engine_* functions to ianjuta_symbol_manager_*
    and similar. Added two functions to IAnjutaSymbolManager iface to have
    compatibility with latest queries on symbol-db.

 configure.in                                  |    1 +
 libanjuta/interfaces/libanjuta.idl            |   14 ++++++-
 plugins/language-support-cpp-java/Makefile.am |    1 +
 plugins/symbol-db/symbol-db-iface.c           |   53 +++++++++++++++++++++++++
 plugins/symbol-db/symbol-db-iface.h           |   18 ++++++++
 5 files changed, 86 insertions(+), 1 deletions(-)
---
diff --git a/configure.in b/configure.in
index 30280a4..e0882c4 100644
--- a/configure.in
+++ b/configure.in
@@ -819,6 +819,7 @@ plugins/project-wizard/templates/library/src/Makefile
 plugins/project-wizard/templates/library/po/Makefile
 plugins/project-wizard/templates/m4/Makefile
 plugins/language-support-cpp-java/Makefile
+plugins/language-support-cpp-java/cxxparser/Makefile
 plugins/run-program/Makefile
 plugins/starter/Makefile
 anjuta.desktop.in
diff --git a/libanjuta/interfaces/libanjuta.idl b/libanjuta/interfaces/libanjuta.idl
index 4cb2b4c..ae48fc1 100644
--- a/libanjuta/interfaces/libanjuta.idl
+++ b/libanjuta/interfaces/libanjuta.idl
@@ -5535,6 +5535,7 @@ interface IAnjutaSymbolManager
 	* @err: Error propagation and reporting.
 	* 
 	* Database query. The returned #IAnjutaIterable object must be unreffed after use.
+	* The query is performed in the project db.
 	* 
 	* Returns: if the passed symbol is a class then this function tries to catch its parents.
 	*
@@ -5567,7 +5568,7 @@ interface IAnjutaSymbolManager
 	* @err: Error propagation and reporting.
 	*
 	* Database query. The returned #IAnjutaIterable object must be unreffed after use.
-	* Find the parent scope given a symbol
+	* Find the parent scope given a symbol. The query is performed in the project db.
 	* 
 	* Returns: The returned #IAnjutaIterable object should contain just one element if the 
 	* query is successful, no element or NULL is returned if function went wrong.	
@@ -5576,6 +5577,17 @@ interface IAnjutaSymbolManager
 	IAnjutaIterable* get_parent_scope (const IAnjutaSymbol *symbol, const gchar *filename, IAnjutaSymbolField info_fields);
 
 	/**
+	 * FIXME COMMENTS.
+	 */
+	IAnjutaIterable* get_scope_chain (const gchar* filename, gulong line, IAnjutaSymbolField info_fields);
+
+	/**
+	 * FIXME COMMENTS.
+	 */	
+	IAnjutaIterable* search_symbol_in_scope (const gchar *pattern, IAnjutaSymbol *container_symbol, IAnjutaSymbolType match_types, gboolean include_types, gint results_limit, gint results_offset, IAnjutaSymbolField info_fields);
+	
+	
+	/**
 	* ianjuta_symbol_manager_get_symbol_more_info:
 	* @obj: Self
 	* @symbol symbol of which you want to know more infos about.
diff --git a/plugins/language-support-cpp-java/Makefile.am b/plugins/language-support-cpp-java/Makefile.am
index 5d9bd70..fa131ae 100644
--- a/plugins/language-support-cpp-java/Makefile.am
+++ b/plugins/language-support-cpp-java/Makefile.am
@@ -1,3 +1,4 @@
+SUBDIRS = cxxparser
 
 # Plugin glade file
 cpp_java_gladedir = $(anjuta_glade_dir)
diff --git a/plugins/symbol-db/symbol-db-iface.c b/plugins/symbol-db/symbol-db-iface.c
index 51f9215..9e91839 100644
--- a/plugins/symbol-db/symbol-db-iface.c
+++ b/plugins/symbol-db/symbol-db-iface.c
@@ -180,6 +180,58 @@ isymbol_manager_get_parent_scope (IAnjutaSymbolManager *sm,
 }
 
 IAnjutaIterable*
+isymbol_manager_get_scope_chain (IAnjutaSymbolManager *sm,                                 
+                                 const gchar* filename, 
+                                 gulong line,
+                                 IAnjutaSymbolField info_fields,
+                                 GError **err)
+{
+	SymbolDBPlugin *sdb_plugin;
+	SymbolDBEngine *dbe;
+	SymbolDBEngineIterator *iterator;
+
+	sdb_plugin = ANJUTA_PLUGIN_SYMBOL_DB (sm);
+	dbe = SYMBOL_DB_ENGINE (sdb_plugin->sdbe_project);
+
+	iterator = symbol_db_engine_get_scope_chain_by_file_line (dbe, filename, 
+	                                                          line, info_fields);
+
+	return IANJUTA_ITERABLE (iterator);
+}
+
+IAnjutaIterable* 
+isymbol_manager_search_symbol_in_scope (IAnjutaSymbolManager *sm,
+                                        const gchar *pattern, 
+                                        IAnjutaSymbol *container_symbol, 
+                                        IAnjutaSymbolType match_types, 
+                                        gboolean include_types, 
+                                        gint results_limit, 
+                                        gint results_offset, 
+                                        IAnjutaSymbolField info_fields,
+                                        GError **err)
+{
+	SymbolDBPlugin *sdb_plugin;
+	SymbolDBEngine *dbe;
+	SymbolDBEngineIterator *iterator;
+	SymbolDBEngineIteratorNode *node;
+	gint container_sym_id;
+
+	sdb_plugin = ANJUTA_PLUGIN_SYMBOL_DB (sm);
+	dbe = SYMBOL_DB_ENGINE (sdb_plugin->sdbe_project);
+	node = SYMBOL_DB_ENGINE_ITERATOR_NODE (container_symbol);
+
+	container_sym_id = symbol_db_engine_iterator_node_get_symbol_id (node);
+	
+	iterator = 	symbol_db_engine_find_symbol_in_scope (dbe, pattern, container_sym_id ,
+		                                                  match_types, include_types,
+		                                                  results_limit,
+		                                                  results_offset,
+		                                                  info_fields);		                                                  
+
+	return IANJUTA_ITERABLE (iterator);
+}
+
+IAnjutaIterable*
 isymbol_manager_get_symbol_more_info (IAnjutaSymbolManager *sm,
 								  const IAnjutaSymbol *symbol, 
 								  IAnjutaSymbolField info_fields,
@@ -571,6 +623,7 @@ isymbol_manager_iface_init (IAnjutaSymbolManagerIface *iface)
 	iface->get_class_parents = isymbol_manager_get_class_parents;
 	iface->get_scope = isymbol_manager_get_scope;
 	iface->get_parent_scope = isymbol_manager_get_parent_scope;
+	iface->get_scope_chain = isymbol_manager_get_scope_chain;
 	iface->get_symbol_more_info = isymbol_manager_get_symbol_more_info;
 	iface->get_symbol_by_id = isymbol_manager_get_symbol_by_id;
 	iface->search_system = isymbol_manager_search_system;
diff --git a/plugins/symbol-db/symbol-db-iface.h b/plugins/symbol-db/symbol-db-iface.h
index f6811c4..cddda88 100644
--- a/plugins/symbol-db/symbol-db-iface.h
+++ b/plugins/symbol-db/symbol-db-iface.h
@@ -95,6 +95,24 @@ isymbol_manager_get_parent_scope (IAnjutaSymbolManager *sm,
 								  IAnjutaSymbolField info_fields,
 								  GError **err);
 
+IAnjutaIterable* 
+isymbol_manager_search_symbol_in_scope (IAnjutaSymbolManager *sm,
+                                        const gchar *pattern, 
+                                        IAnjutaSymbol *container_symbol, 
+                                        IAnjutaSymbolType match_types, 
+                                        gboolean include_types, 
+                                        gint results_limit, 
+                                        gint results_offset, 
+                                        IAnjutaSymbolField info_fields,
+                                        GError **err);
+
+IAnjutaIterable*
+isymbol_manager_get_scope_chain (IAnjutaSymbolManager *sm,                                 
+                                 const gchar* filename, 
+                                 gulong line,
+                                 IAnjutaSymbolField info_fields,
+                                 GError **err);
+
 IAnjutaIterable*
 isymbol_manager_get_scope (IAnjutaSymbolManager *sm,
 						   const gchar* filename,  



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