129 if (g_file_get_contents(path, &content,
NULL,
NULL))
132 SETPTR(content, g_strconcat(
"G_BEGIN_DECLS G_END_DECLS\n", content,
NULL));
151 gsize
count = tags ? tags->len : 0;
194 switch (file_type_idx)
219 if ((typedefs) && (typedefs->len > 0))
221 const gchar *last_name =
"";
223 s = g_string_sized_new(typedefs->len * 10);
224 for (j = 0; j < typedefs->len; ++j)
226 tag =
TM_TAG(typedefs->pdata[j]);
227 tag_lang = tag->
lang;
230 strcmp(tag->
name, last_name) != 0)
233 g_string_append_c(s,
' ');
234 g_string_append(s, tag->
name);
235 last_name = tag->
name;
269 return -(tag_a->
name != tag_b->
name);
274 ret = strcmp(tag_a->
name, tag_b->
name);
309 GList *tag_names =
NULL;
312 g_return_val_if_fail(doc,
NULL);
321 if (G_UNLIKELY(tag ==
NULL))
324 if (tag->
type & tag_types)
326 tag_names = g_list_prepend(tag_names, tag);
335#define MAX_SYMBOL_TYPES (sizeof(tv_iters) / sizeof(GtkTreeIter))
373 static GtkIconTheme *icon_theme =
NULL;
376 if (G_UNLIKELY(x < 0))
379 icon_theme = gtk_icon_theme_get_default();
380 gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &x, &
dummy);
382 return gtk_icon_theme_load_icon(icon_theme,
icon_name, x, 0,
NULL);
388 GtkTreeModel *model = GTK_TREE_MODEL(store);
390 if (!gtk_tree_model_get_iter_first(model, iter))
407 while (gtk_tree_model_iter_next(model, iter));
415static void G_GNUC_NULL_TERMINATED
423 va_start(args, tree_store);
424 for (; iter = va_arg(args, GtkTreeIter*), iter !=
NULL;)
426 gchar *title = va_arg(args, gchar*);
427 guint icon_id = va_arg(args, guint);
428 GdkPixbuf *icon =
NULL;
433 g_assert(title !=
NULL);
437 gtk_tree_store_append(tree_store, iter,
NULL);
870 gboolean cont = TRUE;
872 if (! gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter))
877 if (! gtk_tree_model_iter_has_child(GTK_TREE_MODEL(store), &iter))
878 cont = gtk_tree_store_remove(store, &iter);
880 cont = gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter);
889 static GString *buffer =
NULL;
890 gboolean doc_is_utf8 = FALSE;
899 doc_is_utf8 = g_utf8_validate(tag->
name, -1,
NULL);
905 utf8_name = tag->
name;
907 if (utf8_name ==
NULL)
911 buffer = g_string_new(
NULL);
913 g_string_truncate(buffer, 0);
916 if (!found_parent &&
scope &&
921 g_string_append(buffer,
scope);
922 g_string_append(buffer, sep);
924 g_string_append(buffer, utf8_name);
929 g_string_append_printf(buffer,
" [%lu]", tag->
line);
942 if (tag->
lang != TM_PARSER_PASCAL && tag->
lang != TM_PARSER_GO)
946 const gchar *sep = tag->
lang == TM_PARSER_PASCAL ?
" : " :
" ";
953 if (utf8_name !=
NULL &&
973 GtkTreeIter *iter =
NULL;
1037 if (G_LIKELY(iter->stamp != -1))
1046 GdkPixbuf *icon =
NULL;
1053 gtk_tree_model_get(GTK_TREE_MODEL(tree_store), parent,
1059static gboolean
tag_equal(gconstpointer v1, gconstpointer v2)
1061 const TMTag *t1 = v1;
1062 const TMTag *t2 = v2;
1074 const TMTag *tag = v;
1078 h = (h << 5) + h + tag->
type;
1079 for (p = tag->
name; *p !=
'\0'; p++)
1080 h = (h << 5) + h + *p;
1083 for (p = tag->
scope; *p !=
'\0'; p++)
1084 h = (h << 5) + h + *p;
1089 for (p = tag->
arglist; *p !=
'\0'; p++)
1090 h = (h << 5) + h + *p;
1100 GtkTreeModel *model = gtk_tree_view_get_model(view);
1101 GtkTreePath *path = gtk_tree_model_get_path(model, iter);
1103 gtk_tree_view_expand_to_path(view, path);
1104 gtk_tree_path_free(path);
1112 gboolean has_parent;
1115 has_parent = gtk_tree_model_iter_parent(GTK_TREE_MODEL(store), &parent, iter);
1116 cont = gtk_tree_store_remove(store, iter);
1118 if (! cont && has_parent)
1131 gint parent_line = GPOINTER_TO_INT(key);
1132 gboolean new_nearest;
1139 if (parent_line > data->
line)
1141 if (new_nearest && !data->
lower)
1149 if (parent_line < data->
line)
1156static gint
tree_cmp(gconstpointer a, gconstpointer b, gpointer user_data)
1158 return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
1164 g_slice_free(GtkTreeIter, data);
1172 gchar *name_free =
NULL;
1196 if (
name && g_hash_table_lookup_extended(table,
name,
NULL, (gpointer *) &tree))
1201 g_hash_table_insert(table, name_free ? name_free : g_strdup(
name), tree);
1205 g_tree_insert(tree, GINT_TO_POINTER(tag->
line), g_slice_dup(GtkTreeIter, iter));
1214 GtkTreeIter *parent_search =
NULL;
1217 tree = g_hash_table_lookup(table,
name);
1225 parent_search = g_tree_lookup(tree, GINT_TO_POINTER(user_data.
found_line));
1228 return parent_search;
1236 g_tree_destroy(tree);
1247 GTree *tree = g_hash_table_lookup(table, tag);
1251 g_hash_table_insert(table, tag, tree);
1253 GList *
list = g_tree_lookup(tree, GINT_TO_POINTER(tag->
line));
1255 g_tree_insert(tree, GINT_TO_POINTER(tag->
line),
list);
1264 GTree *tree = g_hash_table_lookup(table, tag);
1271 list = g_tree_lookup(tree, GINT_TO_POINTER(user_data.
found_line));
1285 GTree *tree = g_hash_table_lookup(table, tag);
1288 GList *
list = g_tree_lookup(tree, GINT_TO_POINTER(tag->
line));
1296 if (((GList *) node->data)->data == tag)
1299 list = g_list_delete_link(
list, node);
1301 g_tree_remove(tree, GINT_TO_POINTER(tag->
line));
1303 g_tree_insert(tree, GINT_TO_POINTER(tag->
line),
list);
1311 GList *
list = value;
1326 g_tree_destroy(tree);
1352 GtkTreeModel *model = GTK_TREE_MODEL(store);
1353 GHashTable *parents_table;
1354 GHashTable *tags_table;
1369 TMTag *tag = item->data;
1370 const gchar *parent_name;
1376 g_hash_table_insert(parents_table, g_strdup(parent_name),
NULL);
1383 cont = gtk_tree_model_get_iter_first(model, &iter);
1400 const gchar *parent_name;
1401 TMTag *found = found_item->data;
1405 if (parent_name && ! g_hash_table_lookup(parents_table, parent_name))
1417 gtk_tree_store_set(store, &iter,
1429 *tags = g_list_delete_link(*tags, found_item);
1442 TMTag *tag = item->data;
1443 GtkTreeIter *parent;
1446 if (G_UNLIKELY(! parent))
1447 geany_debug(
"Missing symbol-tree parent iter for type %d!", tag->
type);
1452 const gchar *parent_name;
1462 parent = parent_search;
1469 expand = ! gtk_tree_model_iter_has_child(model, parent);
1474 gtk_tree_store_insert_with_values(store, &iter, parent, 0,
1482 g_object_unref(icon);
1491 g_hash_table_destroy(parents_table);
1492 g_hash_table_destroy(tags_table);
1515 g_warning(
"Couldn't find top level node '%s' or '%s'!", a, b);
1525 gtk_tree_store_iter_depth(store, iter) == 1;
1533 TMTag *tag_a, *tag_b;
1555 if (gtk_tree_store_iter_depth(GTK_TREE_STORE(model), a) == 0)
1563 cmp = -(astr != bstr);
1568 cmp = strcmp(astr, bstr);
1593 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),
SYMBOLS_COLUMN_NAME, GTK_SORT_ASCENDING);
1601 g_return_val_if_fail(
DOC_VALID(doc), FALSE);
1611 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(doc->
priv->
tag_store), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, 0);
1621 if (sort_mode == SYMBOLS_SORT_USE_PREVIOUS)
1639 tags_ext = g_strrstr(shortname,
".tags");
1659 const char pre_process[] =
"gcc -E -dD -p -I.";
1666 const char *tags_file = argv[1];
1676 g_printerr(
_(
"Unknown filetype extension for \"%s\".\n"), tags_file);
1688 const gchar *cflags = getenv(
"CFLAGS");
1689 command = g_strdup_printf(
"%s %s", pre_process,
FALLBACK(cflags,
""));
1697 argc - 2, tags_file, ft->
lang);
1702 g_printerr(
_(
"Failed to create tags file, perhaps because no symbols "
1709 g_printerr(
_(
"Usage: %s -g <Tags File> <File list>\n\n"), argv[0]);
1710 g_printerr(
_(
"Example:\n"
1711 "CFLAGS=`pkg-config gtk+-2.0 --cflags` %s -g gtk2.c.tags"
1712 " /usr/include/gtk-2.0/gtk/gtk.h\n"), argv[0]);
1725 GTK_FILE_CHOOSER_ACTION_OPEN,
1726 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
1727 GTK_STOCK_OPEN, GTK_RESPONSE_OK,
1729 gtk_widget_set_name(
dialog,
"GeanyDialog");
1730 filter = gtk_file_filter_new();
1731 gtk_file_filter_set_name(
filter,
_(
"Geany tags file (*.*.tags)"));
1732 gtk_file_filter_add_pattern(
filter,
"*.*.tags");
1733 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(
dialog),
filter);
1735 if (gtk_dialog_run(GTK_DIALOG(
dialog)) == GTK_RESPONSE_OK)
1737 GSList *flist = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(
dialog));
1740 for (item = flist; item !=
NULL; item = g_slist_next(item))
1742 gchar *fname = item->data;
1759 g_slist_free(flist);
1761 gtk_widget_destroy(
dialog);
1773 if (! g_file_test(dir, G_FILE_TEST_IS_DIR))
1781 file_list = g_slist_concat(file_list,
list);
1784 for (node = file_list; node !=
NULL; node = node->next)
1786 gchar *fname = node->data;
1796 geany_debug(
"Unknown filetype for file '%s'.", fname);
1803 g_slist_free(file_list);
1809 static guchar *tags_loaded =
NULL;
1810 static gboolean init_tags = FALSE;
1814 g_return_if_fail(ft_id > 0);
1818 if (tags_loaded[ft_id])
1820 tags_loaded[ft_id] = TRUE;
1830 const gchar *fname = node->data;
1841 g_return_if_fail(tag);
1890 GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(menu));
1892 GdkRectangle monitor;
1894 GdkEventButton *event_button = g_object_get_data(G_OBJECT(menu),
"geany-button-event");
1899 *x = (gint) event_button->x_root;
1900 *y = (gint) event_button->y_root;
1905 ScintillaObject *
sci = data;
1906 GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(
sci));
1914 gdk_window_get_origin(window, x, y);
1919 monitor_num = gdk_screen_get_monitor_at_point(screen, *x, *y);
1921 gtk_widget_get_preferred_size(GTK_WIDGET(menu),
NULL, &req);
1923#if GTK_CHECK_VERSION(3, 4, 0)
1924 gdk_screen_get_monitor_workarea(screen, monitor_num, &monitor);
1926 gdk_screen_get_monitor_geometry(screen, monitor_num, &monitor);
1930 if (gtk_widget_get_direction(GTK_WIDGET(menu)) == GTK_TEXT_DIR_RTL)
1932 if (*x - req.width - 1 >= monitor.x)
1933 *x -= req.width + 1;
1934 else if (*x + req.width > monitor.x + monitor.width)
1941 if (*x + req.width + 1 <= monitor.x + monitor.width)
1942 *x =
MAX(monitor.x, *x + 1);
1943 else if (*x - req.width - 1 >= monitor.x)
1944 *x -= req.width + 1;
1946 *x = monitor.x +
MAX(0, monitor.width - req.width);
1953 if (*y + line_height + req.height <= monitor.y + monitor.height)
1954 *y =
MAX(monitor.y, *y + line_height);
1955 else if (*y - req.height >= monitor.y)
1956 *y = *y - req.height;
1958 *y = monitor.y +
MAX(0, monitor.height - req.height);
1966 GtkWidget *first =
NULL;
1969 GdkEventButton *button_event =
NULL;
1972 gchar **short_names, **file_names;
1973 menu = gtk_menu_new();
1977 file_names = g_new(gchar *, tags->len);
1988 gchar *fname = short_names[i];
1991 if (! first && have_best)
1993 text = g_markup_printf_escaped(
_(
"<b>%s: %lu</b>"), fname, tmtag->
line);
1996 text = g_markup_printf_escaped(
_(
"%s: %lu"), fname, tmtag->
line);
1999 label = g_object_new(GTK_TYPE_LABEL,
"label",
text,
"use-markup", TRUE,
"xalign", 0.0,
NULL);
2000 item = g_object_new(GTK_TYPE_IMAGE_MENU_ITEM,
"image", image,
"child",
label,
"always-show-image", TRUE,
NULL);
2003 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2011 g_free(short_names);
2016 g_signal_connect(menu,
"realize", G_CALLBACK(gtk_menu_shell_select_item), first);
2018 event = gtk_get_current_event();
2019 if (event && event->type == GDK_BUTTON_PRESS)
2020 button_event = (GdkEventButton *) event;
2022 gdk_event_free(event);
2024 g_object_set_data_full(G_OBJECT(menu),
"geany-button-event", button_event,
2025 button_event ? (GDestroyNotify) gdk_event_free :
NULL);
2027 button_event ? button_event->button : 0, gtk_get_current_event_time ());
2071 gchar *dir = g_path_get_dirname(doc->
real_path);
2089 GPtrArray *filtered_tags = g_ptr_array_new();
2094 if ((definition && !(tmtag->
type & forward_types)) ||
2095 (!definition && (tmtag->
type & forward_types)))
2100 if (last_tag !=
NULL && last_tag->
file == tmtag->
file &&
2103 if (last_tag == current_tag)
2104 g_ptr_array_add(filtered_tags, tmtag);
2106 else if (tmtag != current_tag)
2107 g_ptr_array_add(filtered_tags, tmtag);
2113 return filtered_tags;
2122 gboolean found = FALSE;
2123 const GPtrArray *all_tags;
2124 GPtrArray *tags, *filtered_tags;
2131 tags = g_ptr_array_new();
2136 g_ptr_array_add(tags, tmtag);
2138 current_tag = tmtag;
2144 definition = current_tag->
type & forward_types;
2146 filtered_tags =
filter_tags(tags, current_tag, definition);
2147 if (filtered_tags->len == 0)
2150 g_ptr_array_free(filtered_tags, TRUE);
2151 filtered_tags =
filter_tags(tags, current_tag, !definition);
2153 g_ptr_array_free(tags, TRUE);
2154 tags = filtered_tags;
2160 tmtag = tags->pdata[0];
2169 else if (tags->len > 1)
2171 GPtrArray *tag_list;
2172 TMTag *tag, *best_tag;
2177 tag_list = g_ptr_array_new();
2179 g_ptr_array_add(tag_list, best_tag);
2182 if (tag != best_tag)
2183 g_ptr_array_add(tag_list, tag);
2187 g_ptr_array_free(tag_list, TRUE);
2190 found = tags->len > 0;
2191 g_ptr_array_free(tags, TRUE);
2229 static gint old_line = -2;
2231 static gint old_fold_num = -1;
2232 static guint old_tag_types = 0;
2237 if (doc ==
NULL || doc != old_doc || old_tag_types != tag_types)
2239 else if (cur_line == old_line)
2244 if (abs(cur_line - old_line) == 1)
2247 ret = (fold_num != old_fold_num);
2253 old_line = cur_line;
2255 old_fold_num = fold_num;
2256 old_tag_types = tag_types;
2266 gint start, end, max_pos;
2293 gint start, end, first_pos, max_pos;
2301 while (end < max_pos &&
2304 if (tmp == 0) end --;
2307 while (end > 0 && end > first_pos - 500 &&
2311 if (end < 0) end = 0;
2323 if (start != 0 && start < end) start++;
2325 if (start == end)
return NULL;
2342 gint parenthesis_match_line = -1;
2356 if (parenthesis_match_line !=
line)
2368 if ((parenthesis_match_line == last_child) ||
2369 (parenthesis_match_line == last_child + 1 &&
2396 gint tag_line = tag->
line - 1;
2397 gint last_child =
line + 1;
2404 if (abs(tag_line - parent) > 1)
2411 if (
line <= last_child)
2414 *tagname = g_strconcat(tag->
scope,
2417 *tagname = g_strdup(tag->
name);
2428 gint tag_line = parent;
2447 if (cur_tag !=
NULL)
2455 *tagname = g_strdup(
_(
"unknown"));
2462 static gint tag_line = -1;
2463 static gchar *cur_tag =
NULL;
2465 g_return_val_if_fail(doc ==
NULL || doc->
is_valid, -1);
2471 cur_tag = g_strdup(
_(
"unknown"));
2472 if (tagname !=
NULL)
2519 gint sort_mode = GPOINTER_TO_INT(user_data);
2537 gtk_widget_set_sensitive(
symbol_menu.sort_by_name, enable);
2538 gtk_widget_set_sensitive(
symbol_menu.sort_by_appearance, enable);
2539 gtk_widget_set_sensitive(
symbol_menu.expand_all, enable);
2540 gtk_widget_set_sensitive(
symbol_menu.collapse_all, enable);
2541 gtk_widget_set_sensitive(
symbol_menu.find_usage, enable);
2542 gtk_widget_set_sensitive(
symbol_menu.find_doc_usage, enable);
2550 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
symbol_menu.sort_by_name), TRUE);
2552 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
symbol_menu.sort_by_appearance), TRUE);
2560 gboolean
expand = GPOINTER_TO_INT(user_data);
2569 gtk_tree_view_expand_all(GTK_TREE_VIEW(doc->
priv->
tag_tree));
2571 gtk_tree_view_collapse_all(GTK_TREE_VIEW(doc->
priv->
tag_tree));
2578 GtkTreeSelection *selection;
2579 GtkTreeModel *model;
2587 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(doc->
priv->
tag_tree));
2588 if (gtk_tree_selection_get_selected(selection, &model, &iter))
2605 GtkWidget *item, *menu;
2610 gtk_widget_show(item);
2612 g_signal_connect(item,
"activate", G_CALLBACK(
on_expand_collapse), GINT_TO_POINTER(TRUE));
2615 gtk_widget_show(item);
2617 g_signal_connect(item,
"activate", G_CALLBACK(
on_expand_collapse), GINT_TO_POINTER(FALSE));
2619 item = gtk_separator_menu_item_new();
2620 gtk_widget_show(item);
2623 symbol_menu.sort_by_name = item = gtk_radio_menu_item_new_with_mnemonic(
NULL,
2624 _(
"Sort by _Name"));
2625 gtk_widget_show(item);
2628 GINT_TO_POINTER(SYMBOLS_SORT_BY_NAME));
2630 symbol_menu.sort_by_appearance = item = gtk_radio_menu_item_new_with_mnemonic_from_widget(
2631 GTK_RADIO_MENU_ITEM(item),
_(
"Sort by _Appearance"));
2632 gtk_widget_show(item);
2635 GINT_TO_POINTER(SYMBOLS_SORT_BY_APPEARANCE));
2637 item = gtk_separator_menu_item_new();
2638 gtk_widget_show(item);
2642 gtk_widget_show(item);
2647 gtk_widget_show(item);
2652 gtk_widget_show(item);
Interface to the added lexer functions in the SciLexer version of the edit control.
#define SCE_C_GLOBALCLASS
#define SCI_POINTXFROMPOSITION
#define SCI_POINTYFROMPOSITION
#define SC_FOLDLEVELNUMBERMASK
#define SC_FOLDLEVELHEADERFLAG
GeanyDocument * document_get_current(void)
Finds the current document.
GeanyDocument * document_open_file(const gchar *locale_filename, gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc)
Opens a document specified by locale_filename.
GeanyDocument * document_find_by_real_path(const gchar *realname)
Finds a document whose real_path field matches the given filename.
#define DOC_VALID(doc_ptr)
Null-safe way to check GeanyDocument::is_valid.
#define documents
Wraps GeanyData::documents_array so it can be used with C array syntax.
#define foreach_document(i)
Iterates all valid document indexes.
gchar * editor_get_calltip_text(GeanyEditor *editor, const TMTag *tag)
static void expand(ScintillaObject *sci, gint *line, gboolean doExpand, gboolean force, gint visLevels, gint level)
GeanyEditorPrefs editor_prefs
Editor-related functions for GeanyEditor.
#define GEANY_WORDCHARS
Default character set to define which characters should be treated as part of a word.
gchar * encodings_convert_to_utf8_from_charset(const gchar *buffer, gssize size, const gchar *charset, gboolean fast)
Tries to convert buffer into UTF-8 encoding from the encoding specified with charset.
Encoding conversion and Byte Order Mark (BOM) handling.
GeanyFiletypeID
IDs of known filetypes.
@ GEANY_FILETYPES_VERILOG
@ GEANY_FILETYPES_HASKELL
@ GEANY_FILETYPES_ASCIIDOC
@ GEANY_FILETYPES_DOCBOOK
@ GEANY_FILETYPES_TXT2TAGS
@ GEANY_FILETYPES_FORTRAN
#define filetypes
Wraps GeanyData::filetypes_array so it can be used with C array syntax.
#define FILETYPE_ID(filetype_ptr)
#define GEANY_TAGS_SUBDIR
gboolean highlighting_is_code_style(gint lexer, gint style)
Checks whether the given style is normal code (not string, comment, preprocessor, etc).
Syntax highlighting for the different filetypes, using the Scintilla lexers.
CommandLineOptions cl_options
void geany_debug(gchar const *format,...)
Main program-related commands.
gboolean navqueue_goto_line(GeanyDocument *old_doc, GeanyDocument *new_doc, gint line)
Adds old file position and new file position to the navqueue, then goes to the new position.
gint sci_get_line_count(ScintillaObject *sci)
Gets the total number of lines.
gint sci_get_style_at(ScintillaObject *sci, gint position)
Gets style ID at position.
gint sci_get_current_position(ScintillaObject *sci)
Gets the cursor position.
gint sci_get_fold_level(ScintillaObject *sci, gint line)
gint sci_get_current_line(ScintillaObject *sci)
Gets current line number.
gint sci_get_lexer(ScintillaObject *sci)
Gets the currently used lexer.
gchar sci_get_char_at(ScintillaObject *sci, gint pos)
Gets a character.
gint sci_get_line_end_position(ScintillaObject *sci, gint line)
Gets the position at the end of a line.
gchar * sci_get_contents_range(ScintillaObject *sci, gint start, gint end)
Gets text between start and end.
gint sci_get_fold_parent(ScintillaObject *sci, gint start_line)
gint sci_get_line_from_position(ScintillaObject *sci, gint position)
Gets the line number from position.
gint sci_get_position_from_line(ScintillaObject *sci, gint line)
Gets the position for the start of line.
gint sci_find_matching_brace(ScintillaObject *sci, gint pos)
Finds a matching brace at pos.
Wrapper functions for the Scintilla editor widget SCI_* messages.
void search_find_usage(const gchar *search_text, const gchar *original_search_text, GeanyFindFlags flags, gboolean in_session)
void search_show_find_in_files_dialog_full(const gchar *text, const gchar *dir)
GeanyFiletype * filetypes_detect_from_extension(const gchar *utf8_filename)
GPtrArray * filetypes_array
const gchar * filetypes_get_display_name(GeanyFiletype *ft)
Gets ft->name or a translation for filetype None.
void filetypes_load_config(guint ft_id, gboolean reload)
gtk_container_add(GTK_CONTAINER(dialog->vbox), check_button)
gtk_widget_show_all(dialog)
const TMWorkspace * tm_workspace
TagManager workspace/session tags.
gchar * configdir
User configuration directory, usually ~/.config/geany.
gint symbol_list_sort_mode
Structure for representing an open tab with all its properties.
gboolean changed
Whether this document has been changed since it was last saved.
GeanyFiletype * file_type
The filetype for this document, it's only a reference to one of the elements of the global filetypes ...
gboolean has_tags
Whether this document supports source code symbols(tags) to show in the sidebar.
struct GeanyDocumentPrivate * priv
gchar * real_path
The link-dereferenced, locale-encoded file name.
gchar * encoding
The encoding of the document, must be a valid string representation of an encoding,...
gboolean is_valid
Flag used to check if this document is valid when iterating GeanyData::documents_array.
GeanyEditor * editor
The editor associated with the document.
TMSourceFile * tm_file
TMSourceFile object for this document, or NULL.
gint autocompletion_update_freq
ScintillaObject * sci
The Scintilla editor GtkWidget.
gchar * name
Untranslated short name, such as "C", "None".
GeanyFiletypeID id
Index in filetypes.
struct GeanyFiletypePrivate * priv
GtkWidget * window
Main window.
GPtrArray * tags_array
Sorted tag array obtained by parsing the object.
char * file_name
Full file name (inc.
char * short_name
Just the name of the file (without the path)
The TMTag structure represents a single tag in the tag manager.
char * scope
Scope of tag.
char * var_type
Variable type (maps to struct for typedefs)
char * arglist
Argument list (functions/prototypes/macros)
TMSourceFile * file
These are tag attributes.
gulong line
Line number of the tag.
GPtrArray * global_typename_array
GPtrArray * typename_array
GPtrArray * global_tags
Global tags loaded at startup.
GtkTreeIter tag_interface
GtkTreeIter tag_externvar
GtkTreeIter tag_namespace
Defines internationalization macros.
static guint tag_hash(gconstpointer v)
static gboolean symbols_load_global_tags(const gchar *tags_file, GeanyFiletype *ft)
static gint get_current_tag_name_cached(GeanyDocument *doc, const gchar **tagname, TMTagType tag_types)
static void on_expand_collapse(GtkWidget *widget, gpointer user_data)
static void create_taglist_popup_menu(void)
static void on_symbol_tree_menu_show(GtkWidget *widget, gpointer user_data)
static gchar * get_symbol_tooltip(GeanyDocument *doc, const TMTag *tag)
void symbols_reload_config_files(void)
static GtkTreeIter * parents_table_lookup(GHashTable *table, const gchar *name, guint line)
static void update_tree_tags(GeanyDocument *doc, GList **tags)
static void show_goto_popup(GeanyDocument *doc, GPtrArray *tags, gboolean have_best)
static gint compare_top_level_names(const gchar *a, const gchar *b)
static void init_user_tags(void)
static GPtrArray * top_level_iter_names
static void on_symbol_tree_sort_clicked(GtkMenuItem *menuitem, gpointer user_data)
int symbols_generate_global_tags(int argc, char **argv, gboolean want_preprocess)
static gboolean tags_table_tree_value_free(gpointer key, gpointer value, gpointer data)
static gboolean tag_has_missing_parent(const TMTag *tag, GtkTreeStore *store, GtkTreeIter *iter)
static void on_goto_popup_item_activate(GtkMenuItem *item, TMTag *tag)
GtkWidget * sort_by_appearance
GtkWidget * find_in_files
gint symbols_get_current_function(GeanyDocument *doc, const gchar **tagname)
GString * symbols_find_typenames_as_string(TMParserType lang, gboolean global)
static gint get_function_fold_number(GeanyDocument *doc)
gboolean symbols_recreate_tag_list(GeanyDocument *doc, gint sort_mode)
void symbols_finalize(void)
static gboolean goto_tag(const gchar *name, gboolean definition)
static void on_document_save(G_GNUC_UNUSED GObject *object, GeanyDocument *doc)
gboolean symbols_goto_tag(const gchar *name, gboolean definition)
static GdkPixbuf * get_child_icon(GtkTreeStore *tree_store, GtkTreeIter *parent)
static const gchar * get_symbol_name(GeanyDocument *doc, const TMTag *tag, gboolean found_parent)
static GeanyFiletype * detect_global_tags_filetype(const gchar *utf8_filename)
void symbols_global_tags_loaded(guint file_type_idx)
static struct @121 symbol_menu
GtkWidget * find_doc_usage
struct TreeviewSymbols tv_iters
static gchar * parse_function_at_line(ScintillaObject *sci, gint tag_line)
static gint compare_symbol(const TMTag *tag_a, const TMTag *tag_b)
static gboolean find_toplevel_iter(GtkTreeStore *store, GtkTreeIter *iter, const gchar *title)
static gboolean tree_store_remove_row(GtkTreeStore *store, GtkTreeIter *iter)
static void add_top_level_items(GeanyDocument *doc)
static gint compare_symbol_lines(gconstpointer a, gconstpointer b)
static gsize get_tag_count(void)
static struct @120 symbols_icons[N_ICONS]
static GtkTreeIter * get_tag_type_iter(TMTagType tag_type)
static gint tree_cmp(gconstpointer a, gconstpointer b, gpointer user_data)
static void init_tag_iters(void)
static GList * get_tag_list(GeanyDocument *doc, TMTagType tag_types)
static gchar * parse_cpp_function_at_line(ScintillaObject *sci, gint tag_line)
static void parents_table_value_free(gpointer data)
static void load_c_ignore_tags(void)
static void tags_table_value_free(gpointer data)
static gint get_fold_header_after(ScintillaObject *sci, gint line)
static void tags_table_remove(GHashTable *table, TMTag *tag)
static gint tree_search_func(gconstpointer key, gpointer user_data)
static GList * tags_table_lookup(GHashTable *table, TMTag *tag)
static GPtrArray * filter_tags(GPtrArray *tags, TMTag *current_tag, gboolean definition)
static guint get_tag_class(const TMTag *tag)
const gchar * symbols_get_context_separator(gint ft_id)
Gets the context separator used by the tag manager for a particular file type.
static gboolean current_tag_changed(GeanyDocument *doc, gint cur_line, gint fold_level, guint tag_types)
static void sort_tree(GtkTreeStore *store, gboolean sort_by_name)
void symbols_show_load_tags_dialog(void)
static void update_parents_table(GHashTable *table, const TMTag *tag, const GtkTreeIter *iter)
static const gchar * get_parent_name(const TMTag *tag)
static gboolean tag_equal(gconstpointer v1, gconstpointer v2)
static void goto_popup_position_func(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
static void tags_table_insert(GHashTable *table, TMTag *tag, GList *data)
static void hide_empty_rows(GtkTreeStore *store)
static gint get_current_tag_name(GeanyDocument *doc, gchar **tagname, TMTagType tag_types)
static void tree_view_expand_to_iter(GtkTreeView *view, GtkTreeIter *iter)
static void parents_table_tree_value_free(gpointer data)
static void G_GNUC_NULL_TERMINATED tag_list_add_groups(GtkTreeStore *tree_store,...)
gint symbols_get_current_scope(GeanyDocument *doc, const gchar **tagname)
static void on_find_usage(GtkWidget *widget, G_GNUC_UNUSED gpointer unused)
static TMTag * find_best_goto_tag(GeanyDocument *doc, GPtrArray *tags)
static gint compare_tags_by_name_line(gconstpointer ptr1, gconstpointer ptr2)
static GdkPixbuf * get_tag_icon(const gchar *icon_name)
static void load_user_tags(GeanyFiletypeID ft_id)
static gint tree_sort_func(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data)
gboolean tm_parser_has_full_context(TMParserType lang)
const gchar * tm_parser_context_separator(TMParserType lang)
gboolean tm_parser_langs_compatible(TMParserType lang, TMParserType other)
@ tm_tag_function_t
Function definition.
@ tm_tag_package_t
Package (Java only)
@ tm_tag_interface_t
Interface (Java only)
@ tm_tag_field_t
Field (Java only)
@ tm_tag_class_t
Class declaration.
@ tm_tag_max_t
Maximum value of TMTagType.
@ tm_tag_member_t
Member variable of class/struct.
@ tm_tag_method_t
Class method (Java only)
@ tm_tag_struct_t
Struct declaration.
@ tm_tag_macro_with_arg_t
Parameterized macro.
@ tm_tag_namespace_t
Namespace declaration.
@ tm_tag_variable_t
Variable.
@ tm_tag_prototype_t
Function prototype.
@ tm_tag_typedef_t
Typedef.
@ tm_tag_externvar_t
Extern or forward declaration.
@ tm_tag_enum_t
Enum declaration.
@ tm_tag_macro_t
Macro (without arguments)
const TMTag * tm_get_current_tag(GPtrArray *file_tags, const gulong line, const TMTagType tag_types)
TMTag * tm_tag_ref(TMTag *tag)
void tm_tag_unref(TMTag *tag)
gboolean tm_tags_equal(const TMTag *a, const TMTag *b)
#define TM_TAG(tag)
Use the TM_TAG() macro to cast a pointer to (TMTag *)
GPtrArray * tm_workspace_find(const char *name, const char *scope, TMTagType type, TMTagAttrType *attrs, TMParserType lang)
gboolean tm_workspace_load_global_tags(const char *tags_file, TMParserType mode)
gboolean tm_workspace_create_global_tags(const char *pre_process, const char **includes, int includes_count, const char *tags_file, TMParserType lang)
const TMWorkspace * tm_get_workspace(void)
gboolean ui_tree_model_iter_any_next(GtkTreeModel *model, GtkTreeIter *iter, gboolean down)
GeanyMainWidgets main_widgets
void ui_set_statusbar(gboolean log, const gchar *format,...)
Displays text on the statusbar.
void ui_add_config_file_menu_item(const gchar *real_path, const gchar *label, GtkContainer *parent)
GtkWidget * ui_image_menu_item_new(const gchar *stock_id, const gchar *label)
Creates a GtkImageMenuItem with a stock image and a custom label.
User Interface general utility functions.
gchar * utils_get_utf8_from_locale(const gchar *locale_text)
Converts the given string (in locale encoding) into UTF-8 encoding.
GSList * utils_get_file_list_full(const gchar *path, gboolean full_path, gboolean sort, GError **error)
Gets a list of files from the specified directory.
gint utils_mkdir(const gchar *path, gboolean create_parent_dirs)
Creates a directory if it doesn't already exist.
gboolean utils_str_equal(const gchar *a, const gchar *b)
NULL-safe string comparison.
gchar ** utils_strv_shorten_file_list(gchar **file_names, gssize file_names_len)
Transform file names in a list to be shorter.
General utility functions, non-GTK related.
#define foreach_list(node, list)
Iterates all the nodes in list.
#define foreach_ptr_array(item, idx, ptr_array)
Iterates all the pointers in ptr_array.
#define SETPTR(ptr, result)
Assigns result to ptr, then frees the old value.
#define EMPTY(ptr)
Returns TRUE if ptr is NULL or *ptr is FALSE.
#define utils_strdupa(str)
Duplicates a string on the stack using g_alloca().