1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) 2004 Naba Kumar
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef AN_SYMBOL_VIEW_H
21 #define AN_SYMBOL_VIEW_H
24 #include "an_symbol_info.h"
28 #define ANJUTA_TYPE_SYMBOL_VIEW (anjuta_symbol_view_get_type ())
29 #define ANJUTA_SYMBOL_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJUTA_TYPE_SYMBOL_VIEW, AnjutaSymbolView))
30 #define ANJUTA_SYMBOL_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ANJUTA_TYPE_SYMBOL_VIEW, AnjutaSymbolViewClass))
31 #define ANJUTA_IS_SYMBOL_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_SYMBOL_VIEW))
32 #define ANJUTA_IS_SYMBOL_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJUTA_TYPE_SYMBOL_VIEW))
34 typedef struct _AnjutaSymbolViewPriv AnjutaSymbolViewPriv
;
36 typedef struct _AnjutaSymbolView
39 AnjutaSymbolViewPriv
*priv
;
42 typedef struct _AnjutaSymbolViewClass
44 GtkTreeViewClass parent_class
;
45 } AnjutaSymbolViewClass
;
48 COMPLETION_ACCESS_NONE
,
49 COMPLETION_ACCESS_DIRECT
,
50 COMPLETION_ACCESS_POINTER
,
51 COMPLETION_ACCESS_STATIC
56 COL_PIX
, COL_NAME
, COL_LINE
, N_COLS
59 GType
anjuta_symbol_view_get_type (void);
60 GtkWidget
*anjuta_symbol_view_new (void);
62 void anjuta_symbol_view_open (AnjutaSymbolView
*sv
, const gchar
*dir
);
63 void anjuta_symbol_view_clear (AnjutaSymbolView
*sv
);
64 void anjuta_symbol_view_update (AnjutaSymbolView
*sv
, GList
*source_files
);
65 void anjuta_symbol_view_save (AnjutaSymbolView
*sv
);
67 GList
* anjuta_symbol_view_get_node_expansion_states (AnjutaSymbolView
*sv
);
68 void anjuta_symbol_view_set_node_expansion_states (AnjutaSymbolView
*sv
,
69 GList
*expansion_states
);
71 gchar
* anjuta_symbol_view_get_current_symbol (AnjutaSymbolView
*sv
);
73 void anjuta_symbol_view_add_source (AnjutaSymbolView
*sv
, const gchar
*filename
);
74 void anjuta_symbol_view_remove_source (AnjutaSymbolView
*sv
, const gchar
*filename
);
75 void anjuta_symbol_view_update_source_from_buffer (AnjutaSymbolView
*sv
, const gchar
*uri
,
76 gchar
* text_buffer
, gint buffer_size
);
77 TMSourceFile
*anjuta_symbol_view_get_tm_file (AnjutaSymbolView
* sv
, const gchar
* uri
);
79 /* expr: the expression you want to complete.
81 * func_scope_tag: the TMTag of the line into expr, which define the scope of the tag to return.
83 * returns the TMTag type of expression you want to complete. Usually it is a struct
85 * returns the access_method detected which you wanna complete.
87 TMTag
* anjuta_symbol_view_get_type_of_expression(AnjutaSymbolView
* sv
,
88 const gchar
* expr
, int expr_len
, const TMTag
*func_scope_tag
, gint
*access_method
);
90 /* TMTag* klass_tag: a tag for a struct/union/class
91 * include_parents_tags: in the final array do you want to include the parent classes? Works
94 * returns the public/protected members of parent classes within the ones of the class you
97 GPtrArray
* anjuta_symbol_view_get_completable_members (TMTag
* klass_tag
, gboolean include_parents_tags
);
99 /* Returns TRUE if file and line are updated */
100 gboolean
anjuta_symbol_view_get_current_symbol_def (AnjutaSymbolView
*sv
,
103 gboolean
anjuta_symbol_view_get_current_symbol_decl (AnjutaSymbolView
*sv
,
106 GtkTreeModel
*anjuta_symbol_view_get_file_symbol_model (AnjutaSymbolView
*sv
);
108 void anjuta_symbol_view_workspace_add_file (AnjutaSymbolView
*sv
,
110 void anjuta_symbol_view_workspace_remove_file (AnjutaSymbolView
*sv
,
112 void anjuta_symbol_view_workspace_update_file (AnjutaSymbolView
*sv
,
113 const gchar
*old_file_uri
,
114 const gchar
*new_file_uri
);
116 gint
anjuta_symbol_view_workspace_get_line (AnjutaSymbolView
*sv
,
118 gboolean
anjuta_symbol_view_get_file_symbol (AnjutaSymbolView
*sv
,
120 gboolean prefer_definition
,
121 const gchar
** const filename
,
125 #endif /* AN_SYMBOL_VIEW_H */