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 "toolbar.h"
#include "app.h"
#include "build.h"
#include "callbacks.h"
#include "document.h"
#include "geanyentryaction.h"
#include "geanymenubuttonaction.h"
#include "main.h"
#include "support.h"
#include "ui_utils.h"
#include "utils.h"
#include <string.h>
#include <glib/gstdio.h>
Go to the source code of this file.
Classes | |
struct | TBEditorWidget |
Macros | |
#define | TB_EDITOR_SEPARATOR _("Separator") |
#define | TB_EDITOR_SEPARATOR_LABEL _("--- Separator ---") |
Enumerations | |
enum | { TB_EDITOR_COL_ACTION , TB_EDITOR_COL_LABEL , TB_EDITOR_COL_ICON , TB_EDITOR_COLS_MAX } |
Functions | |
GtkWidget * | toolbar_get_widget_by_name (const gchar *name) |
GtkWidget * | toolbar_get_widget_child_by_name (const gchar *name) |
GtkAction * | toolbar_get_action_by_name (const gchar *name) |
static void | toolbar_item_destroy_cb (GtkWidget *widget, G_GNUC_UNUSED gpointer data) |
void | toolbar_item_ref (GtkToolItem *item) |
static GtkWidget * | toolbar_reload (const gchar *markup) |
static void | toolbar_notify_style_cb (GObject *object, GParamSpec *arg1, gpointer data) |
GtkWidget * | toolbar_init (void) |
void | toolbar_update_ui (void) |
gint | toolbar_get_insert_position (void) |
void | toolbar_finalize (void) |
void | toolbar_show_hide (void) |
static void | toolbar_set_icon_style (void) |
static void | toolbar_set_icon_size (void) |
void | toolbar_apply_settings (void) |
static void | tb_editor_handler_start_element (GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error) |
static GSList * | tb_editor_parse_ui (const gchar *buffer, gssize length, GError **error) |
static void | tb_editor_set_item_values (const gchar *name, GtkListStore *store, GtkTreeIter *iter) |
static void | tb_editor_scroll_to_iter (GtkTreeView *treeview, GtkTreeIter *iter) |
static void | tb_editor_free_path (TBEditorWidget *tbw) |
static void | tb_editor_btn_remove_clicked_cb (GtkWidget *button, TBEditorWidget *tbw) |
static void | tb_editor_btn_add_clicked_cb (GtkWidget *button, TBEditorWidget *tbw) |
static gboolean | tb_editor_drag_motion_cb (GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint ltime, TBEditorWidget *tbw) |
static void | tb_editor_drag_data_get_cb (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *data, guint info, guint ltime, TBEditorWidget *tbw) |
static void | tb_editor_drag_data_rcvd_cb (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint info, guint ltime, TBEditorWidget *tbw) |
static gboolean | tb_editor_foreach_used (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | tb_editor_write_markup (TBEditorWidget *tbw) |
static void | tb_editor_available_items_changed_cb (GtkTreeModel *model, GtkTreePath *arg1, GtkTreeIter *arg2, TBEditorWidget *tbw) |
static void | tb_editor_available_items_deleted_cb (GtkTreeModel *model, GtkTreePath *arg1, TBEditorWidget *tbw) |
static TBEditorWidget * | tb_editor_create_dialog (GtkWindow *parent) |
void | toolbar_configure (GtkWindow *parent) |
Variables | |
GeanyToolbarPrefs | toolbar_prefs |
static GtkUIManager * | uim |
static GtkActionGroup * | group |
static GSList * | plugin_items = NULL |
static const GtkActionEntry | ui_entries [] |
static const guint | ui_entries_n = G_N_ELEMENTS(ui_entries) |
static const gchar * | toolbar_markup |
static const GtkTargetEntry | tb_editor_dnd_targets [] |
static const gint | tb_editor_dnd_targets_len = G_N_ELEMENTS(tb_editor_dnd_targets) |
static const GMarkupParser | tb_editor_xml_parser |
anonymous enum |
|
static |
Definition at line 916 of file toolbar.c.
References tb_editor_write_markup().
Referenced by toolbar_configure().
|
static |
Definition at line 923 of file toolbar.c.
References tb_editor_write_markup().
Referenced by toolbar_configure().
|
static |
Definition at line 739 of file toolbar.c.
References NULL, TBEditorWidget::store_available, TBEditorWidget::store_used, TB_EDITOR_COL_ACTION, tb_editor_scroll_to_iter(), TB_EDITOR_SEPARATOR, tb_editor_set_item_values(), TBEditorWidget::tree_available, TBEditorWidget::tree_used, and utils_str_equal().
Referenced by tb_editor_create_dialog().
|
static |
Definition at line 713 of file toolbar.c.
References TBEditorWidget::store_available, TBEditorWidget::store_used, TB_EDITOR_COL_ACTION, tb_editor_scroll_to_iter(), TB_EDITOR_SEPARATOR, tb_editor_set_item_values(), TBEditorWidget::tree_available, TBEditorWidget::tree_used, and utils_str_equal().
Referenced by tb_editor_create_dialog().
|
static |
Definition at line 930 of file toolbar.c.
References _, dialog, TBEditorWidget::dialog, gtk_container_add(), gtk_widget_show_all(), label, TBEditorWidget::last_drag_path, main_widgets, NULL, TBEditorWidget::store_available, TBEditorWidget::store_used, tb_editor_btn_add_clicked_cb(), tb_editor_btn_remove_clicked_cb(), TB_EDITOR_COL_ICON, TB_EDITOR_COL_LABEL, TB_EDITOR_COLS_MAX, tb_editor_dnd_targets, tb_editor_dnd_targets_len, tb_editor_drag_data_get_cb(), tb_editor_drag_data_rcvd_cb(), tb_editor_drag_motion_cb(), TBEditorWidget::tree_available, TBEditorWidget::tree_used, ui_button_new_with_image(), ui_dialog_vbox_new(), and GeanyMainWidgets::window.
Referenced by toolbar_configure().
|
static |
Definition at line 783 of file toolbar.c.
References TBEditorWidget::drag_source, EMPTY, name, TB_EDITOR_COL_ACTION, and tb_editor_dnd_targets.
Referenced by tb_editor_create_dialog().
|
static |
Definition at line 813 of file toolbar.c.
References TBEditorWidget::drag_source, TBEditorWidget::last_drag_path, TBEditorWidget::last_drag_pos, NULL, tb_editor_free_path(), tb_editor_scroll_to_iter(), TB_EDITOR_SEPARATOR, tb_editor_set_item_values(), text, TBEditorWidget::tree_available, TBEditorWidget::tree_used, and utils_str_equal().
Referenced by tb_editor_create_dialog().
|
static |
Definition at line 771 of file toolbar.c.
References TBEditorWidget::last_drag_path, TBEditorWidget::last_drag_pos, and NULL.
Referenced by tb_editor_create_dialog().
|
static |
Definition at line 868 of file toolbar.c.
References EMPTY, TB_EDITOR_COL_ACTION, TB_EDITOR_SEPARATOR, and utils_str_equal().
Referenced by tb_editor_write_markup().
|
static |
Definition at line 703 of file toolbar.c.
References TBEditorWidget::last_drag_path, and NULL.
Referenced by tb_editor_drag_data_rcvd_cb(), and toolbar_configure().
|
static |
Definition at line 616 of file toolbar.c.
References NULL, TB_EDITOR_SEPARATOR, and utils_str_equal().
|
static |
Definition at line 644 of file toolbar.c.
References error(), list, NULL, and tb_editor_xml_parser.
Referenced by toolbar_configure().
|
static |
Definition at line 695 of file toolbar.c.
References NULL.
Referenced by tb_editor_btn_add_clicked_cb(), tb_editor_btn_remove_clicked_cb(), and tb_editor_drag_data_rcvd_cb().
|
static |
Definition at line 657 of file toolbar.c.
References group, label, name, NULL, TB_EDITOR_COL_ACTION, TB_EDITOR_COL_ICON, TB_EDITOR_COL_LABEL, TB_EDITOR_SEPARATOR, TB_EDITOR_SEPARATOR_LABEL, utils_str_equal(), and utils_str_remove_chars().
Referenced by tb_editor_btn_add_clicked_cb(), tb_editor_btn_remove_clicked_cb(), tb_editor_drag_data_rcvd_cb(), and toolbar_configure().
|
static |
Definition at line 885 of file toolbar.c.
References app, GeanyApp::configdir, filename, NULL, TBEditorWidget::store_used, tb_editor_foreach_used(), toolbar_reload(), and utils_write_file().
Referenced by tb_editor_available_items_changed_cb(), and tb_editor_available_items_deleted_cb().
void toolbar_apply_settings | ( | void | ) |
Definition at line 577 of file toolbar.c.
References toolbar_set_icon_size(), and toolbar_set_icon_style().
Referenced by apply_settings(), on_prefs_dialog_response(), and toolbar_reload().
void toolbar_configure | ( | GtkWindow * | parent | ) |
Definition at line 1062 of file toolbar.c.
References TBEditorWidget::dialog, foreach_list, foreach_slist, group, name, NULL, TBEditorWidget::store_available, TBEditorWidget::store_used, tb_editor_available_items_changed_cb(), tb_editor_available_items_deleted_cb(), TB_EDITOR_COL_ACTION, TB_EDITOR_COL_LABEL, tb_editor_create_dialog(), tb_editor_free_path(), tb_editor_parse_ui(), TB_EDITOR_SEPARATOR, TB_EDITOR_SEPARATOR_LABEL, tb_editor_set_item_values(), TBEditorWidget::tree_used, and uim.
Referenced by on_button_customize_toolbar_clicked().
void toolbar_finalize | ( | void | ) |
Definition at line 525 of file toolbar.c.
References GEANY_MENU_BUTTON_ACTION, geany_menu_button_action_get_menu(), geany_menu_button_action_set_menu(), group, NULL, plugin_items, toolbar_get_action_by_name(), and uim.
Referenced by do_main_quit().
GtkAction * toolbar_get_action_by_name | ( | const gchar * | name | ) |
Definition at line 152 of file toolbar.c.
References group, name, and NULL.
Referenced by build_init(), create_file_template_menu(), init_recent_files(), navqueue_init(), recent_get_recent_files(), and toolbar_finalize().
gint toolbar_get_insert_position | ( | void | ) |
Definition at line 500 of file toolbar.c.
References main_widgets, NULL, pos, GeanyMainWidgets::toolbar, and toolbar_get_widget_by_name().
Referenced by plugin_add_toolbar_item(), and toolbar_reload().
GtkWidget * toolbar_get_widget_by_name | ( | const gchar * | name | ) |
Definition at line 124 of file toolbar.c.
References name, NULL, and uim.
Referenced by set_stop_button(), toolbar_get_insert_position(), toolbar_get_widget_child_by_name(), and ui_init_toolbar_widgets().
GtkWidget * toolbar_get_widget_child_by_name | ( | const gchar * | name | ) |
Definition at line 141 of file toolbar.c.
References name, NULL, and toolbar_get_widget_by_name().
Referenced by cb_func_goto_action(), cb_func_switch_action(), do_toolbar_search(), on_toolbutton_goto_clicked(), on_toolbutton_search_clicked(), search_find_again(), and toolbar_reload().
GtkWidget * toolbar_init | ( | void | ) |
Definition at line 340 of file toolbar.c.
References _, build_toolbutton_build_clicked(), geany_entry_action_new(), geany_menu_button_action_new(), GEANY_STOCK_BUILD, GETTEXT_PACKAGE, group, NULL, on_new1_activate(), on_open1_activate(), on_toolbar_search_entry_activate(), on_toolbar_search_entry_changed(), on_toolbutton_goto_entry_activate(), toolbar_notify_style_cb(), toolbar_reload(), ui_entries, ui_entries_n, and uim.
Referenced by main_init().
|
static |
Definition at line 160 of file toolbar.c.
References plugin_items.
Referenced by toolbar_item_ref().
void toolbar_item_ref | ( | GtkToolItem * | item | ) |
Definition at line 166 of file toolbar.c.
References NULL, plugin_items, and toolbar_item_destroy_cb().
Referenced by plugin_add_toolbar_item().
|
static |
Definition at line 322 of file toolbar.c.
References GeanyToolbarPrefs::icon_size, GeanyToolbarPrefs::icon_style, main_widgets, GeanyMainWidgets::toolbar, toolbar_prefs, ui_get_gtk_settings_integer(), GeanyToolbarPrefs::use_gtk_default_icon, GeanyToolbarPrefs::use_gtk_default_style, and utils_str_equal().
Referenced by toolbar_init().
|
static |
Definition at line 175 of file toolbar.c.
References app, GeanyToolbarPrefs::append_to_menu, GeanyDocument::changed, GeanyApp::configdir, GeanyApp::datadir, document_get_current(), entry, error(), filename, foreach_slist, geany_debug(), GEANY_MENU_BUTTON_ACTION, geany_menu_button_action_get_menu(), geany_menu_button_action_set_menu(), group, main_status, main_widgets, NULL, on_escape_key_press_event(), on_motion_event(), plugin_items, SETPTR, GeanyMainWidgets::toolbar, toolbar_apply_settings(), toolbar_get_insert_position(), toolbar_get_widget_child_by_name(), toolbar_markup, toolbar_popup_menu(), toolbar_prefs, ui_document_buttons_update(), ui_init_toolbar_widgets(), ui_lookup_widget(), ui_save_buttons_toggle(), ui_update_popup_reundo_items(), uim, and GeanyMainWidgets::window.
Referenced by tb_editor_write_markup(), and toolbar_init().
|
static |
Definition at line 564 of file toolbar.c.
References GeanyToolbarPrefs::icon_size, main_widgets, GeanyMainWidgets::toolbar, toolbar_prefs, ui_get_gtk_settings_integer(), and GeanyToolbarPrefs::use_gtk_default_icon.
Referenced by toolbar_apply_settings().
|
static |
Definition at line 550 of file toolbar.c.
References GeanyToolbarPrefs::icon_style, main_widgets, GeanyMainWidgets::toolbar, toolbar_prefs, ui_get_gtk_settings_integer(), and GeanyToolbarPrefs::use_gtk_default_style.
Referenced by toolbar_apply_settings().
void toolbar_show_hide | ( | void | ) |
Definition at line 539 of file toolbar.c.
References ignore_callback, main_widgets, GeanyMainWidgets::toolbar, toolbar_prefs, ui_lookup_widget(), ui_widget_show_hide(), GeanyToolbarPrefs::visible, and GeanyMainWidgets::window.
Referenced by apply_settings(), and on_prefs_dialog_response().
void toolbar_update_ui | ( | void | ) |
Definition at line 414 of file toolbar.c.
References GeanyToolbarPrefs::append_to_menu, main_widgets, NULL, GeanyMainWidgets::toolbar, toolbar_prefs, ui_lookup_widget(), GeanyToolbarPrefs::visible, and GeanyMainWidgets::window.
Referenced by apply_settings(), and on_prefs_dialog_response().
|
static |
Definition at line 50 of file toolbar.c.
Referenced by tb_editor_set_item_values(), toolbar_configure(), toolbar_finalize(), toolbar_get_action_by_name(), toolbar_init(), and toolbar_reload().
|
static |
Definition at line 51 of file toolbar.c.
Referenced by toolbar_finalize(), toolbar_item_destroy_cb(), toolbar_item_ref(), and toolbar_reload().
|
static |
Definition at line 602 of file toolbar.c.
Referenced by tb_editor_create_dialog(), and tb_editor_drag_data_get_cb().
|
static |
Definition at line 606 of file toolbar.c.
Referenced by tb_editor_create_dialog().
|
static |
Definition at line 638 of file toolbar.c.
Referenced by tb_editor_parse_ui().
|
static |
Definition at line 89 of file toolbar.c.
Referenced by toolbar_reload().
GeanyToolbarPrefs toolbar_prefs |
Definition at line 48 of file toolbar.c.
Referenced by cb_func_goto_action(), cb_func_switch_action(), geany_data_init(), load_dialog_prefs(), main_lib(), on_prefs_dialog_response(), on_show_toolbar1_toggled(), prefs_init_dialog(), save_dialog_prefs(), toolbar_notify_style_cb(), toolbar_reload(), toolbar_set_icon_size(), toolbar_set_icon_style(), toolbar_show_hide(), and toolbar_update_ui().
|
static |
Definition at line 55 of file toolbar.c.
Referenced by toolbar_init().
|
static |
Definition at line 85 of file toolbar.c.
Referenced by toolbar_init().
|
static |
Definition at line 49 of file toolbar.c.
Referenced by toolbar_configure(), toolbar_finalize(), toolbar_get_widget_by_name(), toolbar_init(), and toolbar_reload().