1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) Massimo Cora' 2007-2008 <maxcvs@email.it>
6 * plugin.h is free software.
8 * You may redistribute it and/or modify it under the terms of the
9 * GNU General Public License, as published by the Free Software
10 * Foundation; either version 2 of the License, or (at your option)
13 * plugin.h is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with plugin.h. If not, write to:
20 * The Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02110-1301, USA.
28 #include <libanjuta/anjuta-plugin.h>
29 #include <libanjuta/anjuta-launcher.h>
30 #include "symbol-db-engine.h"
35 extern GType
symbol_db_get_type (GTypeModule
*module
);
36 #define ANJUTA_TYPE_PLUGIN_SYMBOL_DB (symbol_db_get_type (NULL))
37 #define ANJUTA_PLUGIN_SYMBOL_DB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJUTA_TYPE_PLUGIN_SYMBOL_DB, SymbolDBPlugin))
38 #define ANJUTA_PLUGIN_SYMBOL_DB_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), ANJUTA_TYPE_PLUGIN_SYMBOL_DB, SymbolDBPluginClass))
39 #define ANJUTA_IS_PLUGIN_SYMBOL_DB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_PLUGIN_SYMBOL_DB))
40 #define ANJUTA_IS_PLUGIN_SYMBOL_DB_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJUTA_TYPE_PLUGIN_SYMBOL_DB))
41 #define ANJUTA_PLUGIN_SYMBOL_DB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ANJUTA_TYPE_PLUGIN_SYMBOL_DB, SymbolDBPluginClass))
44 typedef struct _SymbolDBPlugin SymbolDBPlugin
;
45 typedef struct _SymbolDBPluginClass SymbolDBPluginClass
;
48 #include "symbol-db-system.h"
49 #include "symbol-db-query.h"
51 /* default value for ctags executable. User must have it installed. This is a
52 * personalized version of ctags for Anjuta.
54 #define CTAGS_PATH PACKAGE_BIN_DIR"/anjuta-tags"
57 typedef struct _PackageScanData
{
59 gchar
*package_version
;
66 struct _SymbolDBPlugin
{
75 GtkActionGroup
*popup_action_group
;
76 GtkActionGroup
*menu_action_group
;
80 GtkBuilder
*prefs_bxml
;
83 guint buf_update_timeout_id
;
84 gboolean need_symbols_update
;
86 GPtrArray
*buffer_update_files
;
87 GPtrArray
*buffer_update_ids
;
88 gboolean buffer_update_semaphore
; /* it monitors the update status of the
89 * buffer _and_ the editor switching.
90 * A new page cannot be updated with the
91 * new view-locals symbols if a scanning
94 guint editor_watch_id
;
95 gchar
*project_root_uri
;
96 gchar
*project_root_dir
;
97 gchar
*project_opened
;
98 gboolean needs_sources_scan
;
100 /* Symbol's engine connection to database. Instance for local project */
101 SymbolDBEngine
*sdbe_project
;
104 SymbolDBEngine
*sdbe_globals
;
105 GAsyncQueue
*global_scan_aqueue
;
106 PackageScanData
*current_pkg_scanned
;
109 /* system's population object */
110 SymbolDBSystem
*sdbs
;
112 GtkWidget
*dbv_main
; /* symbol main window [gtk_box] */
113 GtkWidget
*dbv_notebook
; /* main notebook */
114 GtkWidget
*dbv_hbox
; /* hbox for notebook buttons */
116 GtkWidget *scrolled_global; */ /* symbol view scrolledwindow for global
121 /* GtkWidget *scrolled_locals; */
122 GtkWidget
*scrolled_search
;
123 GtkWidget
*progress_bar_project
; /* symbol db progress bar - project */
124 GtkWidget
*progress_bar_system
; /* symbol db progress bar - system (globals) */
126 GtkTreeModel
*file_model
; /* File symbols model */
127 GtkWidget
*search_entry
; /* The search entry box */
128 GtkWidget
*pref_tree_view
; /* Preferences treeview */
131 GObject
*current_editor
;
132 GHashTable
*editor_connected
;
135 /* In session loading? */
136 gboolean session_loading
;
138 gint files_count_project
;
139 gint files_count_project_done
;
141 gint files_count_system
;
142 gint files_count_system_done
;
143 gchar
*current_scanned_package
;
145 IAnjutaSymbolQuery
*search_query
;
147 GTree
*proc_id_tree
; /* the scan processes'll receive an id from
148 * the symbol engine when scan-end happens.
151 gboolean is_project_importing
; /* refreshes or resumes after abort */
152 gboolean is_project_updating
; /* makes up to date symbols of the project's files */
153 gboolean is_offline_scanning
; /* detects offline changes to makefile.am */
154 gboolean is_adding_element
; /* we're adding an element */
157 struct _SymbolDBPluginClass
{
158 AnjutaPluginClass parent_class
;
161 void (* project_import_end
) (void);
162 void (* globals_import_end
) (void);