|
[anjuta/cxxparser] symbol-db: added engines signals to interface.: msg#08231svn-commits-list
commit 00272f509e5a3161f70a1dffddcb0a6a340006b0 Author: Massimo Corà <mcora@xxxxxxxxxxxxx> Date: Sat Aug 1 00:13:36 2009 +0200 symbol-db: added engines signals to interface. Now it's possible to listen for signals like symbol-inserted, symbol-removed, symbol-updated, scan-end for both the engines: the system's one and the project's one. libanjuta/interfaces/libanjuta.idl | 96 +++++++++++++++++++++++++++++ plugins/symbol-db/plugin.c | 28 ++++++++- plugins/symbol-db/symbol-db-engine-core.c | 2 +- plugins/symbol-db/symbol-db-iface.c | 64 +++++++++++++++++++ plugins/symbol-db/symbol-db-iface.h | 40 ++++++++++++ 5 files changed, 228 insertions(+), 2 deletions(-) --- diff --git a/libanjuta/interfaces/libanjuta.idl b/libanjuta/interfaces/libanjuta.idl index 549eb9f..a4813f4 100644 --- a/libanjuta/interfaces/libanjuta.idl +++ b/libanjuta/interfaces/libanjuta.idl @@ -5118,6 +5118,102 @@ interface IAnjutaSymbolManager #include "ianjuta-iterable.h" #include "ianjuta-symbol.h" + /** + * IAnjutaSymbolManager::prj_scan_end: + * @obj: Self + * + * This signal is emitted when a scanning of one or more files on project db + * ends. + */ + void ::prj_scan_end (gint process_id); + + /** + * IAnjutaSymbolManager::prj_symbol_inserted: + * @obj: Self + * + * This signal is emitted when a new symbol is added to project db. + * The chain of symbols emitted is inserted, scan-end, removed. + */ + void ::prj_symbol_inserted (gint symbol_id); + + + /** + * IAnjutaSymbolManager::prj_symbol_removed: + * @obj: Self + * + * This signal is emitted when a new symbol is removed from project db. + * The chain of symbols emitted is inserted, scan-end, removed. + */ + void ::prj_symbol_removed (gint symbol_id); + + /** + * IAnjutaSymbolManager::prj_symbol_updated: + * @obj: Self + * + * This signal is emitted when a new symbol is updated on project db. + * For 'update' we mean updating on all the fields which are not its primary key. + * Be sure to consider the following cases (comment from the core): + * + * #1. The symbol remains the same [at least on unique index key]. We will + * perform only a simple update. + * #2. The symbol has changed: at least on name/type/file. We will insert a + * new symbol on table 'symbol'. Deletion of old one will take place + * at a second stage, when a delete of all symbols with + * 'tmp_flag = 0' will be done. + * #3. The symbol has been deleted. As above it will be deleted at + * a second stage because of the 'tmp_flag = 0'. Triggers will remove + * also scope_ids and other things. + */ + void ::prj_symbol_updated (gint symbol_id); + + /** + * IAnjutaSymbolManager::sys_scan_end: + * @obj: Self + * + * This signal is emitted when a scanning of one or more packages on system db + * ends. This signal doesn't mean that all the scan process for the packages + * is ended, but that just one (or more) is (are). + */ + void ::sys_scan_end (gint process_id); + + /** + * IAnjutaSymbolManager::sys_symbol_inserted: + * @obj: Self + * + * This signal is emitted when a new symbol is added to system db. + * The chain of symbols emitted is inserted, scan-end, removed. + */ + void ::sys_symbol_inserted (gint symbol_id); + + /** + * IAnjutaSymbolManager::sys_symbol_removed: + * @obj: Self + * + * This signal is emitted when a new symbol is removed from system db. + * The chain of symbols emitted is inserted, scan-end, removed. + */ + void ::sys_symbol_removed (gint symbol_id); + + /** + * IAnjutaSymbolManager::sys_symbol_updated: + * @obj: Self + * + * This signal is emitted when a new symbol is updated on system db. + * For 'update' we mean updating on all the fields which are not its primary key. + * Be sure to consider the following cases (comment from the core): + * + * #1. The symbol remains the same [at least on unique index key]. We will + * perform only a simple update. + * #2. The symbol has changed: at least on name/type/file. We will insert a + * new symbol on table 'symbol'. Deletion of old one will take place + * at a second stage, when a delete of all symbols with + * 'tmp_flag = 0' will be done. + * #3. The symbol has been deleted. As above it will be deleted at + * a second stage because of the 'tmp_flag = 0'. Triggers will remove + * also scope_ids and other things. + */ + void ::sys_symbol_updated (gint symbol_id); + /** * IAnjutaSymbolManagerSearchFileScope: * You cannot use bitwise OR in this parameter. diff --git a/plugins/symbol-db/plugin.c b/plugins/symbol-db/plugin.c index 4910205..09f70b7 100644 --- a/plugins/symbol-db/plugin.c +++ b/plugins/symbol-db/plugin.c @@ -2293,8 +2293,34 @@ symbol_db_activate (AnjutaPlugin *plugin) g_signal_connect (G_OBJECT (sdb_plugin->sdbe_project), "scan-end", G_CALLBACK (on_scan_end_manager), sdb_plugin); + + /* connect signals for interface to receive them */ + g_signal_connect (G_OBJECT (sdb_plugin->sdbe_globals), "symbol-inserted", + G_CALLBACK (on_isymbol_manager_sys_symbol_inserted), sdb_plugin); + + g_signal_connect (G_OBJECT (sdb_plugin->sdbe_globals), "symbol-updated", + G_CALLBACK (on_isymbol_manager_sys_symbol_updated), sdb_plugin); + + g_signal_connect (G_OBJECT (sdb_plugin->sdbe_globals), "symbol-removed", + G_CALLBACK (on_isymbol_manager_sys_symbol_removed), sdb_plugin); + + g_signal_connect (G_OBJECT (sdb_plugin->sdbe_globals), "scan-end", + G_CALLBACK (on_isymbol_manager_sys_scan_end), sdb_plugin); + + g_signal_connect (G_OBJECT (sdb_plugin->sdbe_project), "symbol-inserted", + G_CALLBACK (on_isymbol_manager_prj_symbol_inserted), sdb_plugin); + + g_signal_connect (G_OBJECT (sdb_plugin->sdbe_project), "symbol-updated", + G_CALLBACK (on_isymbol_manager_prj_symbol_updated), sdb_plugin); + + g_signal_connect (G_OBJECT (sdb_plugin->sdbe_project), "symbol-removed", + G_CALLBACK (on_isymbol_manager_prj_symbol_inserted), sdb_plugin); + + g_signal_connect (G_OBJECT (sdb_plugin->sdbe_project), "scan-end", + G_CALLBACK (on_isymbol_manager_prj_scan_end), sdb_plugin); + - /* sets preferences to NULL, it'll be instantiated when required.\ */ + /* sets preferences to NULL, it'll be instantiated when required. */ sdb_plugin->sdbp = NULL; /* Create widgets */ diff --git a/plugins/symbol-db/symbol-db-engine-core.c b/plugins/symbol-db/symbol-db-engine-core.c index 651ef1c..40e3752 100644 --- a/plugins/symbol-db/symbol-db-engine-core.c +++ b/plugins/symbol-db/symbol-db-engine-core.c @@ -5025,7 +5025,7 @@ sdb_engine_add_new_symbol (SymbolDBEngine * dbe, const tagEntry * tag_entry, /* ok: was the symbol updated [at least on it's type_id/name]? * There are 3 cases: - * #1. The symbol remain the same [at least on unique index key]. We will + * #1. The symbol remains the same [at least on unique index key]. We will * perform only a simple update. * #2. The symbol has changed: at least on name/type/file. We will insert a * new symbol on table 'symbol'. Deletion of old one will take place diff --git a/plugins/symbol-db/symbol-db-iface.c b/plugins/symbol-db/symbol-db-iface.c index c86b34f..42ca57a 100644 --- a/plugins/symbol-db/symbol-db-iface.c +++ b/plugins/symbol-db/symbol-db-iface.c @@ -571,3 +571,67 @@ isymbol_manager_iface_init (IAnjutaSymbolManagerIface *iface) iface->search_file = isymbol_manager_search_file; iface->search_file_async = isymbol_manager_search_file_async; } + +void +on_isymbol_manager_prj_symbol_inserted (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm) +{ + g_signal_emit_by_name (sm, "prj-symbol-inserted", symbol_id); +} + +void +on_isymbol_manager_prj_symbol_removed (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm) +{ + g_signal_emit_by_name (sm, "prj-symbol-removed", symbol_id); +} + +void +on_isymbol_manager_prj_symbol_updated (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm) +{ + g_signal_emit_by_name (sm, "prj-symbol-updated", symbol_id); +} + +void +on_isymbol_manager_prj_scan_end (SymbolDBEngine *dbe, + gint process_id, + IAnjutaSymbolManager *sm) +{ + g_signal_emit_by_name (sm, "prj-scan-end", process_id); +} + +void +on_isymbol_manager_sys_symbol_inserted (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm) +{ + g_signal_emit_by_name (sm, "sys-symbol-inserted", symbol_id); +} + +void +on_isymbol_manager_sys_symbol_removed (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm) +{ + g_signal_emit_by_name (sm, "sys-symbol-removed", symbol_id); +} + +void +on_isymbol_manager_sys_symbol_updated (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm) +{ + g_signal_emit_by_name (sm, "sys-symbol-updated", symbol_id); +} + +void +on_isymbol_manager_sys_scan_end (SymbolDBEngine *dbe, + gint process_id, + IAnjutaSymbolManager *sm) +{ + g_signal_emit_by_name (sm, "sys-scan-end", process_id); +} diff --git a/plugins/symbol-db/symbol-db-iface.h b/plugins/symbol-db/symbol-db-iface.h index 92f9b0d..4366894 100644 --- a/plugins/symbol-db/symbol-db-iface.h +++ b/plugins/symbol-db/symbol-db-iface.h @@ -123,6 +123,46 @@ isymbol_manager_search (IAnjutaSymbolManager *sm, gint results_offset, GError **err); +void +on_isymbol_manager_prj_symbol_inserted (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm); + +void +on_isymbol_manager_prj_symbol_removed (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm); + +void +on_isymbol_manager_prj_symbol_updated (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm); + +void +on_isymbol_manager_prj_scan_end (SymbolDBEngine *dbe, + gint process_id, + IAnjutaSymbolManager *sm); + +void +on_isymbol_manager_sys_symbol_inserted (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm); + +void +on_isymbol_manager_sys_symbol_removed (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm); + +void +on_isymbol_manager_sys_symbol_updated (SymbolDBEngine *dbe, + gint symbol_id, + IAnjutaSymbolManager *sm); + +void +on_isymbol_manager_sys_scan_end (SymbolDBEngine *dbe, + gint process_id, + IAnjutaSymbolManager *sm); + #endif /* _SYMBOL_DB_IFACE_H_ */ _______________________________________________ SVN-commits-list mailing list (read only) http://mail.gnome.org/mailman/listinfo/svn-commits-list Want to limit the commits to a few modules? Go to above URL, log in to edit your options and select the modules ('topics') you want.
|
|
||||||||||||||||||||||||||
|
|
|
| News | Mail Home | sitemap | FAQ | advertise |