Add scope completion for namespaces
[geany-mirror.git] / tagmanager / src / tm_workspace.h
blobf134eec5452a0cdbe5e808d9855be42bde51edfe
1 /*
3 * Copyright (c) 2001-2002, Biswapesh Chattopadhyay
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 */
11 #ifndef TM_WORKSPACE_H
12 #define TM_WORKSPACE_H
14 #include <glib.h>
16 #include "tm_tag.h"
18 #ifdef __cplusplus
19 extern "C"
21 #endif
24 /** The Tag Manager Workspace. This is a singleton object containing a list
25 of individual source files. There is also a global tag list
26 which can be loaded or created. This contains global tags gleaned from
27 /usr/include, etc. and should be used for autocompletion, calltips, etc.
29 typedef struct
31 GPtrArray *global_tags; /**< Global tags loaded at startup */
32 GPtrArray *source_files; /**< An array of TMSourceFile pointers */
33 GPtrArray *tags_array; /**< Sorted tags from all source files
34 (just pointers to source file tags, the tag objects are owned by the source files) */
35 GPtrArray *typename_array; /* Typename tags for syntax highlighting (pointers owned by source files) */
36 GPtrArray *global_typename_array; /* Like above for global tags */
37 } TMWorkspace;
40 void tm_workspace_add_source_file(TMSourceFile *source_file);
42 void tm_workspace_remove_source_file(TMSourceFile *source_file);
44 void tm_workspace_add_source_files(GPtrArray *source_files);
46 void tm_workspace_remove_source_files(GPtrArray *source_files);
49 #ifdef GEANY_PRIVATE
51 const TMWorkspace *tm_get_workspace(void);
53 gboolean tm_workspace_load_global_tags(const char *tags_file, gint mode);
55 gboolean tm_workspace_create_global_tags(const char *pre_process, const char **includes,
56 int includes_count, const char *tags_file, int lang);
58 GPtrArray *tm_workspace_find(const char *name, const char *scope, TMTagType type,
59 TMTagAttrType *attrs, langType lang);
61 GPtrArray *tm_workspace_find_prefix(const char *prefix, langType lang, guint max_num);
63 GPtrArray *tm_workspace_find_scope_members (TMSourceFile *source_file, const char *name,
64 gboolean function, gboolean member, const gchar *current_scope, gboolean search_namespace);
67 void tm_workspace_add_source_file_noupdate(TMSourceFile *source_file);
69 void tm_workspace_update_source_file_buffer(TMSourceFile *source_file, guchar* text_buf,
70 gsize buf_size);
72 void tm_workspace_free(void);
75 #ifdef TM_DEBUG
76 void tm_workspace_dump(void);
77 #endif /* TM_DEBUG */
80 #endif /* GEANY_PRIVATE */
82 #ifdef __cplusplus
84 #endif
86 #endif /* TM_WORKSPACE_H */