geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
#include "sidebar.h"
#include "app.h"
#include "callbacks.h"
#include "documentprivate.h"
#include "filetypesprivate.h"
#include "geanyobject.h"
#include "keyfile.h"
#include "navqueue.h"
#include "stash.h"
#include "support.h"
#include "symbols.h"
#include "ui_utils.h"
#include "utils.h"
#include "keybindings.h"
#include <string.h>
#include <gdk/gdkkeysyms.h>
Go to the source code of this file.
Macros | |
#define | CHANGE_TREE(new_child) |
#define | WIDGET(w) w && GTK_IS_WIDGET(w) |
Enumerations | |
enum | { TREEVIEW_SYMBOL = 0 , TREEVIEW_OPENFILES } |
enum | { OPENFILES_ACTION_REMOVE = 0 , OPENFILES_ACTION_SAVE , OPENFILES_ACTION_RELOAD } |
enum | { DOCUMENTS_ICON , DOCUMENTS_SHORTNAME , DOCUMENTS_DOCUMENT , DOCUMENTS_COLOR , DOCUMENTS_FILENAME } |
Functions | |
static void | on_openfiles_document_action (GtkMenuItem *menuitem, gpointer user_data) |
static gboolean | sidebar_button_press_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
static gboolean | sidebar_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data) |
static void | on_list_document_activate (GtkCheckMenuItem *item, gpointer user_data) |
static void | on_list_symbol_activate (GtkCheckMenuItem *item, gpointer user_data) |
static void | documents_menu_update (GtkTreeSelection *selection) |
static void | sidebar_tabs_show_hide (GtkNotebook *notebook, GtkWidget *child, guint page_num, gpointer data) |
static void | prepare_taglist (GtkWidget *tree, GtkTreeStore *store) |
static gboolean | on_default_tag_tree_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
static void | create_default_tag_tree (void) |
void | sidebar_update_tag_list (GeanyDocument *doc, gboolean update) |
static gint | documents_sort_func (GtkTreeModel *model, GtkTreeIter *iter_a, GtkTreeIter *iter_b, gpointer data) |
static void | prepare_openfiles (void) |
static gboolean | find_tree_iter_dir (GtkTreeIter *iter, const gchar *dir) |
static gboolean | utils_filename_has_prefix (const gchar *str, const gchar *prefix) |
static gchar * | get_doc_folder (const gchar *path) |
static GtkTreeIter * | get_doc_parent (GeanyDocument *doc) |
void | sidebar_openfiles_add (GeanyDocument *doc) |
static void | openfiles_remove (GeanyDocument *doc) |
void | sidebar_openfiles_update (GeanyDocument *doc) |
void | sidebar_openfiles_update_all (void) |
void | sidebar_remove_document (GeanyDocument *doc) |
static void | on_hide_sidebar (void) |
static gboolean | on_sidebar_display_symbol_list_show (GtkWidget *item) |
static gboolean | on_sidebar_display_open_files_show (GtkWidget *item) |
void | sidebar_add_common_menu_items (GtkMenu *menu) |
static void | on_openfiles_show_paths_activate (GtkCheckMenuItem *item, gpointer user_data) |
static void | on_find_in_files (GtkMenuItem *menuitem, gpointer user_data) |
static void | on_openfiles_expand_collapse (GtkMenuItem *menuitem, gpointer user_data) |
static void | create_openfiles_popup_menu (void) |
static void | unfold_parent (GtkTreeIter *iter) |
static gboolean | tree_model_find_node (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
void | sidebar_select_openfiles_item (GeanyDocument *doc) |
static void | document_action (GeanyDocument *doc, gint action) |
static void | change_focus_to_editor (GeanyDocument *doc, GtkWidget *source_widget) |
static gboolean | openfiles_go_to_selection (GtkTreeSelection *selection, guint keyval) |
static gboolean | taglist_go_to_selection (GtkTreeSelection *selection, guint keyval, guint state) |
static gboolean | sidebar_button_press_cb (GtkWidget *widget, GdkEventButton *event, G_GNUC_UNUSED gpointer user_data) |
static void | on_load_settings (void) |
static void | on_save_settings (void) |
static void | on_sidebar_switch_page (GtkNotebook *notebook, gpointer page, guint page_num, gpointer user_data) |
void | sidebar_init (void) |
void | sidebar_finalize (void) |
void | sidebar_focus_openfiles_tab (void) |
void | sidebar_focus_symbols_tab (void) |
Variables | |
SidebarTreeviews | tv = {NULL, NULL, NULL} |
static gboolean | may_steal_focus = FALSE |
struct { | |
GtkWidget * close | |
GtkWidget * save | |
GtkWidget * reload | |
GtkWidget * show_paths | |
GtkWidget * find_in_files | |
GtkWidget * expand_all | |
GtkWidget * collapse_all | |
} | doc_items = {NULL, NULL, NULL, NULL, NULL, NULL, NULL} |
static GtkTreeStore * | store_openfiles |
static GtkWidget * | openfiles_popup_menu |
static gboolean | documents_show_paths |
static GtkWidget * | tag_window |
static StashGroup * | stash_group = NULL |
#define CHANGE_TREE | ( | new_child | ) |
anonymous enum |
anonymous enum |
anonymous enum |
|
static |
Definition at line 857 of file sidebar.c.
References document_try_focus(), and may_steal_focus.
Referenced by openfiles_go_to_selection(), and taglist_go_to_selection().
|
static |
Definition at line 167 of file sidebar.c.
References _, SidebarTreeviews::default_tag_tree, gtk_container_add(), gtk_widget_show_all(), label, NULL, on_default_tag_tree_button_press_event(), tag_window, and tv.
Referenced by sidebar_update_tag_list().
|
static |
Definition at line 681 of file sidebar.c.
References _, doc_items, documents_show_paths, gtk_container_add(), NULL, on_find_in_files(), on_openfiles_document_action(), on_openfiles_expand_collapse(), on_openfiles_show_paths_activate(), OPENFILES_ACTION_RELOAD, OPENFILES_ACTION_REMOVE, OPENFILES_ACTION_SAVE, openfiles_popup_menu, sidebar_add_common_menu_items(), and ui_image_menu_item_new().
Referenced by sidebar_button_press_cb().
|
static |
Definition at line 798 of file sidebar.c.
References DOC_VALID, document_close, document_reload_prompt(), document_save_file(), NULL, OPENFILES_ACTION_RELOAD, OPENFILES_ACTION_REMOVE, and OPENFILES_ACTION_SAVE.
Referenced by on_openfiles_document_action().
|
static |
Definition at line 1025 of file sidebar.c.
References app, doc_items, DOCUMENTS_DOCUMENT, DOCUMENTS_SHORTNAME, documents_show_paths, EMPTY, GeanyProject::name, NULL, GeanyApp::project, and GeanyDocument::real_path.
Referenced by sidebar_button_press_cb().
|
static |
Definition at line 252 of file sidebar.c.
References DOCUMENTS_SHORTNAME.
Referenced by prepare_openfiles().
|
static |
Definition at line 335 of file sidebar.c.
References DOCUMENTS_DOCUMENT, DOCUMENTS_SHORTNAME, GEANY_STRING_UNTITLED, name, store_openfiles, utils_filenamecmp, and utils_str_equal().
Referenced by get_doc_parent().
|
static |
Definition at line 366 of file sidebar.c.
References app, EMPTY, GeanyProject::name, NULL, GeanyApp::project, project_get_base_path(), and utils_filename_has_prefix().
Referenced by get_doc_parent().
|
static |
Definition at line 418 of file sidebar.c.
References DOC_FILENAME, DOCUMENTS_FILENAME, DOCUMENTS_ICON, DOCUMENTS_SHORTNAME, documents_show_paths, GeanyDocument::file_name, find_tree_iter_dir(), GEANY_STRING_UNTITLED, get_doc_folder(), NULL, store_openfiles, and ui_get_mime_icon().
Referenced by sidebar_openfiles_add().
|
static |
Definition at line 154 of file sidebar.c.
References NULL, SidebarTreeviews::popup_taglist, and tv.
Referenced by create_default_tag_tree().
|
static |
Definition at line 645 of file sidebar.c.
References DOC_FILENAME, DOCUMENTS_DOCUMENT, DOCUMENTS_FILENAME, search_show_find_in_files_dialog(), SidebarTreeviews::tree_openfiles, and tv.
Referenced by create_openfiles_popup_menu().
|
static |
Definition at line 568 of file sidebar.c.
References ui_prefs, and ui_sidebar_show_hide().
Referenced by sidebar_add_common_menu_items().
|
static |
Definition at line 629 of file sidebar.c.
References interface_prefs, main_widgets, NULL, GeanyMainWidgets::sidebar_notebook, GeanyInterfacePrefs::sidebar_openfiles_visible, sidebar_tabs_show_hide(), and ui_sidebar_show_hide().
Referenced by sidebar_add_common_menu_items().
|
static |
Definition at line 637 of file sidebar.c.
References interface_prefs, main_widgets, NULL, GeanyMainWidgets::sidebar_notebook, GeanyInterfacePrefs::sidebar_symbol_visible, sidebar_tabs_show_hide(), and ui_sidebar_show_hide().
Referenced by sidebar_add_common_menu_items().
|
static |
Definition at line 1059 of file sidebar.c.
References main_widgets, NULL, prepare_openfiles(), GeanyMainWidgets::sidebar_notebook, sidebar_tabs_show_hide(), stash_group, stash_group_display(), tag_window, ui_lookup_widget(), and GeanyMainWidgets::window.
Referenced by sidebar_init().
|
static |
Definition at line 824 of file sidebar.c.
References document_action(), DOCUMENTS_DOCUMENT, SidebarTreeviews::tree_openfiles, and tv.
Referenced by create_openfiles_popup_menu(), and sidebar_button_press_cb().
|
static |
Definition at line 670 of file sidebar.c.
References expand(), SidebarTreeviews::tree_openfiles, and tv.
Referenced by create_openfiles_popup_menu().
|
static |
Definition at line 622 of file sidebar.c.
References documents_show_paths, and sidebar_openfiles_update_all().
Referenced by create_openfiles_popup_menu().
|
static |
Definition at line 1070 of file sidebar.c.
References main_widgets, NULL, GeanyMainWidgets::sidebar_notebook, sidebar_tabs_show_hide(), stash_group, and stash_group_update().
Referenced by sidebar_init().
|
static |
Definition at line 583 of file sidebar.c.
References interface_prefs, and GeanyInterfacePrefs::sidebar_openfiles_visible.
Referenced by sidebar_add_common_menu_items().
|
static |
Definition at line 575 of file sidebar.c.
References interface_prefs, and GeanyInterfacePrefs::sidebar_symbol_visible.
Referenced by sidebar_add_common_menu_items().
|
static |
Definition at line 1077 of file sidebar.c.
References document_get_current(), sidebar_update_tag_list(), and TREEVIEW_SYMBOL.
Referenced by sidebar_init().
|
static |
Definition at line 865 of file sidebar.c.
References change_focus_to_editor(), document_show_tab(), DOCUMENTS_DOCUMENT, ignore_callback, NULL, SidebarTreeviews::tree_openfiles, and tv.
Referenced by sidebar_button_press_cb(), and sidebar_key_press_cb().
|
static |
Definition at line 494 of file sidebar.c.
References GeanyDocumentPrivate::iter, GeanyDocument::priv, and store_openfiles.
Referenced by sidebar_openfiles_update(), and sidebar_remove_document().
|
static |
Definition at line 274 of file sidebar.c.
References DOCUMENTS_COLOR, DOCUMENTS_FILENAME, DOCUMENTS_ICON, DOCUMENTS_SHORTNAME, documents_sort_func(), interface_prefs, main_widgets, NULL, sidebar_button_press_cb(), sidebar_key_press_cb(), store_openfiles, GeanyInterfacePrefs::tagbar_font, SidebarTreeviews::tree_openfiles, tv, ui_lookup_widget(), ui_tree_view_set_tooltip_text_column(), ui_widget_modify_font_from_string(), and GeanyMainWidgets::window.
Referenced by on_load_settings().
|
static |
Definition at line 108 of file sidebar.c.
References _, interface_prefs, NULL, GeanyInterfacePrefs::show_symbol_list_expanders, sidebar_button_press_cb(), sidebar_key_press_cb(), SYMBOLS_COLUMN_ICON, SYMBOLS_COLUMN_NAME, SYMBOLS_COLUMN_TOOLTIP, GeanyInterfacePrefs::tagbar_font, ui_tree_view_set_tooltip_text_column(), and ui_widget_modify_font_from_string().
Referenced by sidebar_update_tag_list().
void sidebar_add_common_menu_items | ( | GtkMenu * | menu | ) |
Definition at line 591 of file sidebar.c.
References _, gtk_container_add(), NULL, on_hide_sidebar(), on_list_document_activate(), on_list_symbol_activate(), on_sidebar_display_open_files_show(), and on_sidebar_display_symbol_list_show().
Referenced by create_openfiles_popup_menu(), and create_taglist_popup_menu().
|
static |
Definition at line 950 of file sidebar.c.
References create_openfiles_popup_menu(), documents_menu_update(), may_steal_focus, NULL, on_openfiles_document_action(), OPENFILES_ACTION_REMOVE, openfiles_go_to_selection(), openfiles_popup_menu, SidebarTreeviews::popup_taglist, taglist_go_to_selection(), SidebarTreeviews::tree_openfiles, and tv.
|
static |
Referenced by prepare_openfiles(), and prepare_taglist().
void sidebar_finalize | ( | void | ) |
Definition at line 1115 of file sidebar.c.
References SidebarTreeviews::default_tag_tree, openfiles_popup_menu, SidebarTreeviews::popup_taglist, tv, and WIDGET.
Referenced by do_main_quit().
void sidebar_focus_openfiles_tab | ( | void | ) |
Definition at line 1129 of file sidebar.c.
References interface_prefs, main_widgets, GeanyMainWidgets::sidebar_notebook, GeanyInterfacePrefs::sidebar_openfiles_visible, SidebarTreeviews::tree_openfiles, TREEVIEW_OPENFILES, tv, and ui_prefs.
Referenced by cb_func_switch_action().
void sidebar_focus_symbols_tab | ( | void | ) |
Definition at line 1141 of file sidebar.c.
References interface_prefs, main_widgets, GeanyMainWidgets::sidebar_notebook, GeanyInterfacePrefs::sidebar_symbol_visible, TREEVIEW_SYMBOL, and ui_prefs.
Referenced by cb_func_switch_action().
void sidebar_init | ( | void | ) |
Definition at line 1085 of file sidebar.c.
References configuration_add_pref_group(), documents_show_paths, geany_object, group, main_widgets, NULL, on_load_settings(), on_save_settings(), on_sidebar_switch_page(), GeanyMainWidgets::sidebar_notebook, sidebar_tabs_show_hide(), stash_group, stash_group_add_boolean(), stash_group_add_widget_property(), stash_group_new(), and ui_prefs.
Referenced by main_lib().
|
static |
Definition at line 923 of file sidebar.c.
References may_steal_focus, openfiles_go_to_selection(), taglist_go_to_selection(), SidebarTreeviews::tree_openfiles, tv, and ui_is_keyval_enter_or_return().
Referenced by prepare_openfiles(), and prepare_taglist().
void sidebar_openfiles_add | ( | GeanyDocument * | doc | ) |
Definition at line 462 of file sidebar.c.
References color, DOC_FILENAME, document_get_status_color(), DOCUMENTS_COLOR, DOCUMENTS_DOCUMENT, DOCUMENTS_FILENAME, DOCUMENTS_ICON, DOCUMENTS_SHORTNAME, GeanyDocument::file_type, get_doc_parent(), GeanyFiletype::icon, GeanyDocumentPrivate::iter, NULL, GeanyDocument::priv, store_openfiles, SidebarTreeviews::tree_openfiles, tv, and ui_get_mime_icon().
Referenced by document_create(), sidebar_openfiles_update(), and sidebar_openfiles_update_all().
void sidebar_openfiles_update | ( | GeanyDocument * | doc | ) |
Definition at line 507 of file sidebar.c.
References color, DOC_FILENAME, document_get_status_color(), DOCUMENTS_COLOR, DOCUMENTS_FILENAME, DOCUMENTS_ICON, GeanyDocument::file_type, GeanyFiletype::icon, GeanyDocumentPrivate::iter, openfiles_remove(), GeanyDocument::priv, sidebar_openfiles_add(), store_openfiles, SidebarTreeviews::tree_openfiles, tv, and utils_str_equal().
Referenced by document_set_filetype(), and ui_update_tab_status().
void sidebar_openfiles_update_all | ( | void | ) |
Definition at line 542 of file sidebar.c.
References documents, foreach_document, sidebar_openfiles_add(), and store_openfiles.
Referenced by on_openfiles_show_paths_activate(), on_prefs_dialog_response(), and update_ui().
void sidebar_remove_document | ( | GeanyDocument * | doc | ) |
Definition at line 554 of file sidebar.c.
References NULL, openfiles_remove(), GeanyDocument::priv, and GeanyDocumentPrivate::tag_tree.
Referenced by remove_page().
void sidebar_select_openfiles_item | ( | GeanyDocument * | doc | ) |
Definition at line 790 of file sidebar.c.
References store_openfiles, and tree_model_find_node().
Referenced by main_lib(), and on_notebook1_switch_page_after().
|
static |
Definition at line 1154 of file sidebar.c.
References interface_prefs, GeanyInterfacePrefs::sidebar_openfiles_visible, GeanyInterfacePrefs::sidebar_symbol_visible, and tabs.
Referenced by on_list_document_activate(), on_list_symbol_activate(), on_load_settings(), on_save_settings(), and sidebar_init().
void sidebar_update_tag_list | ( | GeanyDocument * | doc, |
gboolean | update | ||
) |
Definition at line 188 of file sidebar.c.
References CHANGE_TREE, create_default_tag_tree(), SidebarTreeviews::default_tag_tree, GeanyDocument::file_type, filetype_has_tags(), GeanyDocument::has_tags, GeanyDocument::is_valid, main_widgets, NULL, prepare_taglist(), GeanyDocument::priv, GeanyMainWidgets::sidebar_notebook, SYMBOLS_N_COLUMNS, symbols_recreate_tag_list(), GeanyDocumentPrivate::tag_store, GeanyDocumentPrivate::tag_tree, GeanyDocumentPrivate::tag_tree_dirty, tag_window, TM_TYPE_TAG, TREEVIEW_SYMBOL, and tv.
Referenced by document_update_tags(), main_lib(), on_notebook1_switch_page_after(), on_save_all1_activate(), on_sidebar_switch_page(), and remove_page().
|
static |
Definition at line 887 of file sidebar.c.
References change_focus_to_editor(), document_get_current(), GEANY_PRIMARY_MOD_MASK, keybindings_get_modifiers(), line, TMTag::line, navqueue_goto_line(), NULL, SYMBOLS_COLUMN_TAG, and tm_tag_unref().
Referenced by sidebar_button_press_cb(), and sidebar_key_press_cb().
|
static |
Definition at line 771 of file sidebar.c.
References DOCUMENTS_DOCUMENT, NULL, store_openfiles, SidebarTreeviews::tree_openfiles, tv, and unfold_parent().
Referenced by sidebar_select_openfiles_item().
|
static |
Definition at line 755 of file sidebar.c.
References store_openfiles, SidebarTreeviews::tree_openfiles, and tv.
Referenced by tree_model_find_node().
|
static |
Definition at line 356 of file sidebar.c.
References utils_filenamecmp.
Referenced by get_doc_folder().
GtkWidget* close |
Definition at line 56 of file sidebar.c.
Referenced by backupcopy_document_save_cb(), build_create_shellscript(), create_temp_file(), instantsave_document_new_cb(), on_font_dialog_response(), on_monitor_reload_file_response(), on_monitor_resave_missing_file_response(), resizeTagFile(), and scanBlock().
struct { ... } doc_items |
Referenced by create_openfiles_popup_menu(), and documents_menu_update().
|
static |
Definition at line 91 of file sidebar.c.
Referenced by create_openfiles_popup_menu(), documents_menu_update(), get_doc_parent(), on_openfiles_show_paths_activate(), and sidebar_init().
|
static |
Definition at line 52 of file sidebar.c.
Referenced by change_focus_to_editor(), sidebar_button_press_cb(), and sidebar_key_press_cb().
|
static |
Definition at line 90 of file sidebar.c.
Referenced by create_openfiles_popup_menu(), sidebar_button_press_cb(), and sidebar_finalize().
GtkWidget* reload |
Definition at line 58 of file sidebar.c.
Referenced by document_open_file_full(), and filetypes_load_config().
GtkWidget* save |
Definition at line 57 of file sidebar.c.
Referenced by absoluteDirname(), LexerLaTeX::Fold(), LexerLaTeX::getSave(), latexFoldSave::latexFoldSave(), latexFoldSaveToInt(), latexFoldSave::operator=(), reinitStatementWithToken(), restartStatement(), and LexerLaTeX::setSave().
|
static |
Definition at line 1057 of file sidebar.c.
Referenced by on_load_settings(), on_save_settings(), and sidebar_init().
|
static |
Definition at line 89 of file sidebar.c.
Referenced by find_tree_iter_dir(), get_doc_parent(), openfiles_remove(), prepare_openfiles(), sidebar_openfiles_add(), sidebar_openfiles_update(), sidebar_openfiles_update_all(), sidebar_select_openfiles_item(), tree_model_find_node(), and unfold_parent().
|
static |
Definition at line 92 of file sidebar.c.
Referenced by create_default_tag_tree(), on_load_settings(), and sidebar_update_tag_list().
SidebarTreeviews tv = {NULL, NULL, NULL} |
Definition at line 50 of file sidebar.c.
Referenced by check_menu_key(), create_default_tag_tree(), create_taglist_popup_menu(), document_create(), on_compiler_treeview_copy_activate(), on_default_tag_tree_button_press_event(), on_find_in_files(), on_openfiles_document_action(), on_openfiles_expand_collapse(), on_prefs_font_choosed(), openfiles_go_to_selection(), prepare_openfiles(), sidebar_button_press_cb(), sidebar_finalize(), sidebar_focus_openfiles_tab(), sidebar_key_press_cb(), sidebar_openfiles_add(), sidebar_openfiles_update(), sidebar_update_tag_list(), tree_model_find_node(), and unfold_parent().