70#include <gdk/gdkkeysyms.h>
71#include <glib/gstdio.h>
132 for (i = 0; i <
max; i++)
176 gtk_widget_set_sensitive(
ui_widgets.recent_files_menuitem,
177 g_queue_get_length(
ui_prefs.recent_queue) > 0);
194 gtk_widget_hide(item);
215 g_return_if_fail(doc !=
NULL);
229 g_return_if_fail(doc !=
NULL);
243 if (GTK_IS_EDITABLE(focusw))
244 gtk_editable_cut_clipboard(GTK_EDITABLE(focusw));
245 else if (IS_SCINTILLA(focusw))
247 else if (GTK_IS_TEXT_VIEW(focusw))
249 GtkTextBuffer *buffer = gtk_text_view_get_buffer(
250 GTK_TEXT_VIEW(focusw));
251 gtk_text_buffer_cut_clipboard(buffer, gtk_clipboard_get(GDK_NONE), TRUE);
260 if (GTK_IS_EDITABLE(focusw))
261 gtk_editable_copy_clipboard(GTK_EDITABLE(focusw));
262 else if (IS_SCINTILLA(focusw))
264 else if (GTK_IS_TEXT_VIEW(focusw))
266 GtkTextBuffer *buffer = gtk_text_view_get_buffer(
267 GTK_TEXT_VIEW(focusw));
268 gtk_text_buffer_copy_clipboard(buffer, gtk_clipboard_get(GDK_NONE));
277 if (GTK_IS_EDITABLE(focusw))
278 gtk_editable_paste_clipboard(GTK_EDITABLE(focusw));
279 else if (IS_SCINTILLA(focusw))
281 else if (GTK_IS_TEXT_VIEW(focusw))
283 GtkTextBuffer *buffer = gtk_text_view_get_buffer(
284 GTK_TEXT_VIEW(focusw));
285 gtk_text_buffer_paste_clipboard(buffer, gtk_clipboard_get(GDK_NONE),
NULL,
295 if (GTK_IS_EDITABLE(focusw))
296 gtk_editable_delete_selection(GTK_EDITABLE(focusw));
299 else if (GTK_IS_TEXT_VIEW(focusw))
301 GtkTextBuffer *buffer = gtk_text_view_get_buffer(
302 GTK_TEXT_VIEW(focusw));
303 gtk_text_buffer_delete_selection(buffer, TRUE, TRUE);
333 g_return_if_fail(doc !=
NULL);
353 _(
"Changes detected, reloading all will lose any changes and history."),
354 _(
"Are you sure you want to reload all files?")))
428 const gchar *
text = gtk_entry_get_text(GTK_ENTRY(
entry));
444 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(tool_item), FALSE);
453 g_return_if_fail(doc !=
NULL);
464 g_return_if_fail(doc !=
NULL);
474 g_return_if_fail(doc !=
NULL);
483 guint page_num, gpointer user_data)
510 g_signal_emit_by_name(
geany_object,
"document-activate", doc);
516 guint page_num, gpointer user_data)
524 guint page_num, gpointer user_data)
534 g_return_if_fail(doc !=
NULL);
580 g_return_if_fail(doc !=
NULL);
588 if (event->button == 3)
600 ScintillaObject *
sci;
601 gboolean keep_sel = TRUE;
603 g_return_if_fail(doc !=
NULL);
615 gchar *result =
NULL;
625 result = g_utf8_strdown(
text, -1);
632 result = g_utf8_strup(
text, -1);
740 g_return_if_fail(doc !=
NULL);
752 g_return_if_fail(doc !=
NULL);
767 g_return_if_fail(doc !=
NULL);
780 g_return_if_fail(doc !=
NULL);
816 g_return_if_fail(doc !=
NULL);
854 g_return_if_fail(doc !=
NULL);
918 *line_no = atoi(
text + 1);
919 *offset = (*
text ==
'+') ? 1 : -1;
923 *line_no = atoi(
text) - 1;
931 static gchar value[16] =
"";
936 _(
"Enter the line you want to go to:"), value);
943 g_return_if_fail(doc !=
NULL);
949 g_snprintf(value,
sizeof(value),
"%s", result);
962 g_return_if_fail(doc !=
NULL);
978 const gchar *
text = gtk_entry_get_text(GTK_ENTRY(
entry));
1031 const gchar *cur_tag =
NULL;
1037 _(
"Please set the filetype for the current file before using this function."));
1057 g_return_if_fail(doc !=
NULL);
1058 g_return_if_fail(
pos == -1 ||
pos >= 0);
1063 _(
"Please set the filetype for the current file before using this function."));
1097 g_return_if_fail(doc !=
NULL);
1098 g_return_if_fail(
pos == -1 ||
pos >= 0);
1099 g_return_if_fail(
template < GEANY_MAX_TEMPLATES);
1142 g_return_if_fail(doc !=
NULL);
1163 g_return_if_fail(doc !=
NULL);
1180 g_return_if_fail(doc !=
NULL);
1189 g_return_if_fail(doc !=
NULL);
1198 g_return_if_fail(doc !=
NULL);
1213 g_return_if_fail(doc !=
NULL);
1222 g_return_if_fail(doc !=
NULL);
1233 if (GTK_IS_TEXT_VIEW(focusw))
1235 g_signal_emit_by_name(focusw,
"select-all", TRUE);
1239 else if (vte_info.have_vte && focusw == vc->vte)
1244 else if (GTK_IS_EDITABLE(focusw))
1246 gtk_editable_select_region(GTK_EDITABLE(focusw), 0, -1);
1248 else if (IS_SCINTILLA(focusw))
1288 g_return_if_fail(doc !=
NULL);
1307 g_return_if_fail(doc !=
NULL);
1316 g_return_if_fail(doc !=
NULL);
1325 g_return_if_fail(doc !=
NULL);
1334 g_return_if_fail(doc !=
NULL);
1343 g_return_if_fail(doc !=
NULL);
1391 static GtkWidget *item_close =
NULL;
1392 static GtkWidget *item_properties =
NULL;
1394 if (item_close ==
NULL)
1401 gtk_widget_set_sensitive(item_properties, (
app->
project !=
NULL));
1402 gtk_widget_set_sensitive(
ui_widgets.recent_projects_menuitem,
1403 g_queue_get_length(
ui_prefs.recent_projects_queue) > 0);
1419 g_return_if_fail(doc !=
NULL);
1428 if (g_path_is_absolute(sel))
1437 path = g_get_current_dir();
1439 filename = g_build_path(G_DIR_SEPARATOR_S, path, sel,
NULL);
1441 if (! g_file_test(
filename, G_FILE_TEST_EXISTS) &&
1451 if (! g_file_test(
filename, G_FILE_TEST_EXISTS))
1454 if (! g_file_test(
filename, G_FILE_TEST_EXISTS))
1459 if (g_file_test(
filename, G_FILE_TEST_EXISTS))
1476 g_return_if_fail(doc !=
NULL);
1495 const gchar *check_msg;
1497 g_return_if_fail(doc !=
NULL);
1513 check_msg =
_(
"Check the path setting in Filetype configuration.");
1518 check_msg =
_(
"Check the path setting in Preferences.");
1524 gchar *command_line = g_strdup(
command);
1531 ui_set_statusbar(TRUE,
_(
"Cannot execute context action command \"%s\": %s. %s"),
1534 g_error_free(
error);
1536 g_free(command_line);
1549 static gint hide_all = -1;
1550 GtkCheckMenuItem *msgw = GTK_CHECK_MENU_ITEM(
1552 GtkCheckMenuItem *toolbari = GTK_CHECK_MENU_ITEM(
1556 if (G_UNLIKELY(hide_all == -1))
1558 if (! gtk_check_menu_item_get_active(msgw) &&
1560 ! gtk_check_menu_item_get_active(toolbari))
1568 hide_all = ! hide_all;
1572 if (gtk_check_menu_item_get_active(msgw))
1573 gtk_check_menu_item_set_active(msgw, ! gtk_check_menu_item_get_active(msgw));
1580 if (gtk_check_menu_item_get_active(toolbari))
1581 gtk_check_menu_item_set_active(toolbari, ! gtk_check_menu_item_get_active(toolbari));
1586 if (! gtk_check_menu_item_get_active(msgw))
1587 gtk_check_menu_item_set_active(msgw, ! gtk_check_menu_item_get_active(msgw));
1594 if (! gtk_check_menu_item_get_active(toolbari))
1595 gtk_check_menu_item_set_active(toolbari, ! gtk_check_menu_item_get_active(toolbari));
1615 gtk_widget_grab_focus(widget);
1629 g_return_if_fail(doc !=
NULL);
1662 g_return_if_fail(doc !=
NULL);
1679 if (event->keyval == GDK_KEY_Escape && state == 0)
1696 g_return_if_fail(doc !=
NULL);
1706 g_return_if_fail(doc !=
NULL);
1716 gboolean have_messages;
1719 have_messages = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(
msgwindow.store_msg),
1722 gtk_widget_set_sensitive(next_message, have_messages);
1723 gtk_widget_set_sensitive(previous_message, have_messages);
1734 if (cur_doc ==
NULL)
1741 if (doc == cur_doc || ! doc->
is_valid)
1765 if (vte_info.have_vte)
1766 vte_send_selection_to_vte();
1774 if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
1776 static GtkWidget *menuitem =
NULL;
1778 if (menuitem ==
NULL)
1783 ui_prefs.fullscreen = (
event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ? TRUE : FALSE;
1784 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
ui_prefs.fullscreen);
1795 GtkNotebook *notebook;
1800 if (notebook !=
NULL && widget !=
NULL)
1801 gtk_notebook_set_current_page(notebook, gtk_notebook_page_num(notebook, widget));
1918 width = atoi(
label);
1922 if (doc !=
NULL && width > 0)
1963 gtk_widget_set_sensitive(widget, gtk_toggle_button_get_active(button));
1981 const gchar *signal_name,
const gchar *handler_name, GObject *connect_obj,
1982 GConnectFlags flags, gpointer user_data)
1984 GHashTable *hash = user_data;
1987 callback = g_hash_table_lookup(hash, handler_name);
1988 g_return_if_fail(callback);
1990 if (connect_obj ==
NULL)
1991 g_signal_connect_data(
object, signal_name, callback,
NULL,
NULL, flags);
1993 g_signal_connect_object(
object, signal_name, callback, connect_obj, flags);
2001 g_return_if_fail(GTK_IS_BUILDER(
builder));
2003 hash = g_hash_table_new(g_str_hash, g_str_equal);
2005#define ITEM(n) g_hash_table_insert(hash, (gpointer) #n, G_CALLBACK(n));
2006# include "signallist.i"
2010 g_hash_table_destroy(hash);
#define SCI_SELECTIONISRECTANGLE
void about_dialog_show(void)
void build_menu_update(GeanyDocument *doc)
Interface to the Build menu functionality.
void on_find_next1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_context_action1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_menu_project1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void show_notebook_page(const gchar *notebook_name, const gchar *page_name)
static void on_move_lines_up1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_cut_current_lines1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void goto_tag(gboolean definition)
void on_menu_toggle_all_additional_widgets1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_plugin_preferences1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_find_nextsel1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_replace1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_find_prevsel1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_replace_spaces_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_hide_toolbar1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_line_wrapping1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
void on_save_all1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_comments_fileheader_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_delete1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void builder_connect_func(GtkBuilder *builder, GObject *object, const gchar *signal_name, const gchar *handler_name, GObject *connect_obj, GConnectFlags flags, gpointer user_data)
void on_help1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_increase_indent1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_show_sidebar1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
static void on_tabs_and_spaces1_activate(GtkCheckMenuItem *menuitem, gpointer user_data)
static void on_copy_current_lines1_activate(GtkMenuItem *menuitem, gpointer user_data)
gboolean on_escape_key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
void on_project_close1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_uncomment_line1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_duplicate_line_or_selection1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_next_message1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_set_file_readonly1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
void on_reload_all(GtkAction *action, gpointer user_data)
void on_find_usage1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_delete_current_lines1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_goto_tag_definition1(GtkMenuItem *menuitem, gpointer user_data)
static void on_help_menu_item_wiki_activate(GtkMenuItem *item, gpointer user_data)
void on_menu_select_all1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_debug_messages1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_markers_margin1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
void on_paste1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_file_properties_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_project_open1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_project_new1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_comments_gpl_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_zoom_in1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_go_to_previous_marker1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_help_menu_item_bug_report_activate(GtkMenuItem *item, gpointer user_data)
static void on_customize_toolbar1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_go_to_line_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_move_lines_down1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_menu_comments_multiline_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_open_selected_file1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_comments_function_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_toolbutton_forward_activate(GtkAction *menuitem, gpointer user_data)
static void on_button_customize_toolbar_clicked(GtkButton *button, gpointer user_data)
static gboolean on_window_delete_event(GtkWidget *widget, GdkEvent *event, gpointer gdata)
static void on_show_messages_window1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
static void on_menu_comments_bsd_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_mark_all1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_comments_multiline_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_toolbutton_back_activate(GtkAction *menuitem, gpointer user_data)
void on_toolbutton_run_clicked(GtkAction *action, gpointer user_data)
static void convert_eol(gint mode)
void on_find_document_usage1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_edit1_select(GtkMenuItem *menuitem, gpointer user_data)
void on_show_color_chooser1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_show_symbol_list_toggled(GtkToggleButton *button, gpointer user_data)
static void set_indent_type(GtkCheckMenuItem *menuitem, GeanyIndentType type)
static void on_reset_indentation1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_toggle_case1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void insert_multiline_comment(GeanyDocument *doc, gint pos)
static void on_menu_unfold_all1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_save1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_find_in_files1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_indent_width_activate(GtkMenuItem *menuitem, gpointer user_data)
gboolean toolbar_popup_menu(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static void on_load_tags1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_previous_message1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void find_usage(gboolean in_session)
static void on_select_current_paragraph1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_tv_notebook_switch_page_after(GtkNotebook *notebook, gpointer page, guint page_num, gpointer user_data)
static void on_menu_show_white_space1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
static void on_show_line_numbers1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
static void on_menu_reload_configuration1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_spaces1_activate(GtkCheckMenuItem *menuitem, gpointer user_data)
void on_undo1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_search1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_menu_write_unicode_bom1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
static void on_menu_fold_all1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_close_all1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_line_breaking1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_smart_line_indent1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_use_auto_indentation1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
static void on_comments_bsd_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_copy1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_notebook1_switch_page_after(GtkNotebook *notebook, gpointer page, guint page_num, gpointer user_data)
void on_open1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void setup_find(const gchar *text, gboolean backwards)
void on_cut1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void insert_comment_template(GeanyDocument *doc, gint pos, guint template)
static void on_change_font1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_send_selection_to_vte1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_go_to_next_marker1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_menu_comments_gpl_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_count_words1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void do_toolbar_search(const gchar *text, gboolean incremental, gboolean backwards)
void on_toolbutton_goto_clicked(GtkAction *action, gpointer user_data)
void on_new1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_detect_type_from_file_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_info1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_find_previous1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void get_line_and_offset_from_text(const gchar *text, gint *line_no, gint *offset)
static void on_menu_show_indentation_guides1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
static void on_website1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_zoom_out1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_fullscreen1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
static void on_tabs1_activate(GtkCheckMenuItem *menuitem, gpointer user_data)
void on_preferences1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_normal_size1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_menu_color_schemes_activate(GtkImageMenuItem *imagemenuitem, gpointer user_data)
static void on_file1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_select_current_lines1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_help_shortcuts1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_reflow_lines_block1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_redo1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_clone1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_insert_alternative_white_space1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_find1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_toolbar_search_entry_activate(GtkAction *action, const gchar *text, gpointer user_data)
static void on_comments_changelog_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_detect_width_from_file_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_close_other_documents1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_toggle_line_commentation1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_decrease_indent1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_cr_activate(GtkCheckMenuItem *menuitem, gpointer user_data)
void on_save_as1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_crlf_activate(GtkCheckMenuItem *menuitem, gpointer user_data)
void on_remove_markers1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_comment_line1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_toolbutton_compile_clicked(GtkAction *action, gpointer user_data)
static void on_edit1_deselect(GtkMenuShell *menushell, gpointer user_data)
void on_toolbutton_search_clicked(GtkAction *action, gpointer user_data)
void on_menu_remove_indicators1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_lf_activate(GtkCheckMenuItem *menuitem, gpointer user_data)
static void on_menu_show_line_endings1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
gboolean on_motion_event(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
static void on_page_setup1_activate(GtkMenuItem *menuitem, gpointer user_data)
static gboolean on_window_state_event(GtkWidget *widget, GdkEventWindowState *event, gpointer user_data)
void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_toolbutton_reload_clicked(GtkAction *action, gpointer user_data)
static void on_goto_tag_declaration1(GtkMenuItem *menuitem, gpointer user_data)
static void on_tv_notebook_switch_page(GtkNotebook *notebook, gpointer page, guint page_num, gpointer user_data)
void on_print1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_show_toolbar1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
void on_close1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_help_menu_item_donate_activate(GtkMenuItem *item, gpointer user_data)
void on_toolbar_search_entry_changed(GtkAction *action, const gchar *text, gpointer user_data)
void on_toolbutton_goto_entry_activate(GtkAction *action, const gchar *text, gpointer user_data)
void callbacks_connect(GtkBuilder *builder)
void on_project_properties1_activate(GtkMenuItem *menuitem, gpointer user_data)
static void on_strip_trailing_spaces1_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_replace_tabs_activate(GtkMenuItem *menuitem, gpointer user_data)
gboolean dialogs_show_question_full(GtkWidget *parent, const gchar *yes_btn, const gchar *no_btn, const gchar *extra_text, const gchar *main_text,...)
gboolean dialogs_show_save_as(void)
Shows the Save As dialog for the current notebook page.
void dialogs_show_file_properties(GeanyDocument *doc)
void dialogs_show_open_file(void)
gchar * dialogs_show_input_goto_line(const gchar *title, GtkWindow *parent, const gchar *label_text, const gchar *default_text)
void dialogs_show_open_font(void)
File related dialogs, miscellaneous dialogs, font dialog.
GeanyDocument * document_get_current(void)
Finds the current document.
void document_redo(GeanyDocument *doc)
gboolean document_close_all(void)
GeanyDocument * document_clone(GeanyDocument *old_doc)
gboolean document_can_redo(GeanyDocument *doc)
void document_undo_add(GeanyDocument *doc, guint type, gpointer data)
GeanyDocument * document_get_from_notebook_child(GtkWidget *page)
GeanyDocument * document_get_from_page(guint page_num)
Finds the document for the given notebook page page_num.
gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gboolean inc, gboolean backwards)
void document_highlight_tags(GeanyDocument *doc)
void document_show_tab(GeanyDocument *doc)
gboolean document_reload_force(GeanyDocument *doc, const gchar *forced_enc)
Reloads the document with the specified file encoding.
gboolean document_check_disk_status(GeanyDocument *doc, gboolean force)
gboolean document_detect_indent_type(GeanyDocument *doc, GeanyIndentType *type_)
gboolean document_save_file(GeanyDocument *doc, gboolean force)
Saves the document.
void document_apply_indent_settings(GeanyDocument *doc)
GeanyFilePrefs file_prefs
void document_undo(GeanyDocument *doc)
gboolean document_can_undo(GeanyDocument *doc)
GeanyDocument * document_open_file(const gchar *locale_filename, gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc)
Opens a document specified by locale_filename.
GPtrArray * documents_array
gboolean document_detect_indent_width(GeanyDocument *doc, gint *width_)
gboolean document_reload_prompt(GeanyDocument *doc, const gchar *forced_enc)
GeanyDocument * document_new_file(const gchar *utf8_filename, GeanyFiletype *ft, const gchar *text)
Creates a new document.
#define documents
Wraps GeanyData::documents_array so it can be used with C array syntax.
#define foreach_document(i)
Iterates all valid document indexes.
void editor_replace_spaces(GeanyEditor *editor, gboolean ignore_selection)
gchar * editor_get_default_selection(GeanyEditor *editor, gboolean use_current_word, const gchar *wordchars)
void editor_indicator_clear(GeanyEditor *editor, gint indic)
Deletes all currently set indicators matching indic in the editor window.
void editor_indent(GeanyEditor *editor, gboolean increase)
void editor_unfold_all(GeanyEditor *editor)
void editor_find_current_word_sciwc(GeanyEditor *editor, gint pos, gchar *word, gsize wordlen)
void editor_replace_tabs(GeanyEditor *editor, gboolean ignore_selection)
gboolean editor_goto_line(GeanyEditor *editor, gint line_no, gint offset)
void editor_insert_multiline_comment(GeanyEditor *editor)
void editor_set_indent(GeanyEditor *editor, GeanyIndentType type, gint width)
void editor_set_line_wrapping(GeanyEditor *editor, gboolean wrap)
gint editor_do_comment(GeanyEditor *editor, gint line, gboolean allow_empty_lines, gboolean toggle, gboolean single_comment)
gint editor_do_uncomment(GeanyEditor *editor, gint line, gboolean toggle)
void editor_strip_trailing_spaces(GeanyEditor *editor, gboolean ignore_selection)
void editor_find_current_word(GeanyEditor *editor, gint pos, gchar *word, gsize wordlen, const gchar *wc)
void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type)
Sets the indent type for editor.
void editor_do_comment_toggle(GeanyEditor *editor)
void editor_set_indent_width(GeanyEditor *editor, gint width)
Sets the indent width for editor.
GeanyEditorPrefs editor_prefs
void editor_fold_all(GeanyEditor *editor)
#define GEANY_WORDCHARS
Default character set to define which characters should be treated as part of a word.
#define GEANY_MAX_WORD_LENGTH
GeanyIndentType
Whether to use tabs, spaces or both to indent.
@ GEANY_INDENT_TYPE_BOTH
Both.
@ GEANY_INDENT_TYPE_TABS
Tabs.
@ GEANY_INDENT_TYPE_SPACES
Spaces.
@ GEANY_INDICATOR_SEARCH
Indicator used to highlight search results in the document.
@ GEANY_INDICATOR_ERROR
Indicator to highlight errors in the document text.
Encoding conversion and Byte Order Mark (BOM) handling.
void error(const errorSelection selection, const char *const format,...)
Filetype detection, file extensions and filetype menu items.
#define FILETYPE_ID(filetype_ptr)
void highlighting_show_color_scheme_dialog(void)
Syntax highlighting for the different filetypes, using the Scintilla lexers.
void keybindings_send_command(guint group_id, guint key_id)
Mimics a (built-in only) keybinding action.
GdkModifierType keybindings_get_modifiers(GdkModifierType mods)
Gets significant modifiers from a GdkModifierType mask.
void keybindings_show_shortcuts(void)
Configurable keyboard shortcuts.
@ GEANY_KEY_GROUP_SELECT
Group.
@ GEANY_KEY_GROUP_SEARCH
Group.
@ GEANY_KEY_GROUP_CLIPBOARD
Group.
@ GEANY_KEY_GROUP_INSERT
Group.
@ GEANY_KEY_GROUP_BUILD
Group.
@ GEANY_KEY_GROUP_GOTO
Group.
@ GEANY_KEY_GROUP_EDITOR
Group.
@ GEANY_KEY_GROUP_FORMAT
Group.
@ GEANY_KEY_GROUP_FOCUS
Group.
@ GEANY_KEYS_EDITOR_DUPLICATELINE
Keybinding.
@ GEANY_KEYS_CLIPBOARD_CUTLINE
Keybinding.
@ GEANY_KEYS_GOTO_TAGDEFINITION
Keybinding.
@ GEANY_KEYS_EDITOR_MOVELINEDOWN
Keybinding.
@ GEANY_KEYS_CLIPBOARD_COPYLINE
Keybinding.
@ GEANY_KEYS_BUILD_COMPILE
Keybinding.
@ GEANY_KEYS_FORMAT_REFLOWPARAGRAPH
Keybinding.
@ GEANY_KEYS_GOTO_NEXTMARKER
Keybinding.
@ GEANY_KEYS_SELECT_WORD
Keybinding.
@ GEANY_KEYS_BUILD_RUN
Keybinding.
@ GEANY_KEYS_EDITOR_MOVELINEUP
Keybinding.
@ GEANY_KEYS_FORMAT_AUTOINDENT
Keybinding.
@ GEANY_KEYS_SEARCH_MARKALL
Keybinding.
@ GEANY_KEYS_SELECT_PARAGRAPH
Keybinding.
@ GEANY_KEYS_INSERT_ALTWHITESPACE
Keybinding.
@ GEANY_KEYS_GOTO_PREVIOUSMARKER
Keybinding.
@ GEANY_KEYS_FOCUS_EDITOR
Keybinding.
@ GEANY_KEYS_GOTO_TAGDECLARATION
Keybinding.
@ GEANY_KEYS_EDITOR_DELETELINE
Keybinding.
@ GEANY_KEYS_SELECT_LINE
Keybinding.
void main_reload_configuration(void)
Reloads most of Geany's configuration files without restarting.
void log_show_debug_messages_dialog(void)
Main program-related commands.
gboolean msgwin_goto_messages_file_line(gboolean focus_editor)
void msgwin_show_hide(gboolean show)
Message window functions (status, compiler, messages windows).
void navqueue_go_forward(void)
void navqueue_go_back(void)
gboolean plugins_have_preferences(void)
signal void(* project_open)(GObject *obj, GKeyFile *config, gpointer user_data)
Sent after a project is opened but before session files are loaded.
signal void(* project_close)(GObject *obj, gpointer user_data)
Sent after a project is closed.
signal void(* document_close)(GObject *obj, GeanyDocument *doc, gpointer user_data)
Sent before closing a document.
void plugin_show_configure(GeanyPlugin *plugin)
Shows the plugin's configure dialog.
Plugin utility functions.
GeanyToolPrefs tool_prefs
void prefs_show_dialog(void)
void printing_page_setup_gtk(void)
PrintingPrefs printing_prefs
void printing_print_doc(GeanyDocument *doc)
gchar * project_get_base_path(void)
void project_properties(void)
gint sci_get_eol_mode(ScintillaObject *sci)
void sci_select_all(ScintillaObject *sci)
void sci_goto_pos(ScintillaObject *sci, gint pos, gboolean unfold)
gchar * sci_get_selection_contents(ScintillaObject *sci)
Gets selected text.
void sci_zoom_out(ScintillaObject *sci)
gint sci_get_current_position(ScintillaObject *sci)
Gets the cursor position.
void sci_set_eol_mode(ScintillaObject *sci, gint eolmode)
void sci_set_selection_start(ScintillaObject *sci, gint position)
Sets the selection start position.
void sci_send_command(ScintillaObject *sci, gint cmd)
Sends Scintilla commands without any parameters.
void sci_paste(ScintillaObject *sci)
void sci_marker_delete_all(ScintillaObject *sci, gint marker)
void sci_set_readonly(ScintillaObject *sci, gboolean readonly)
void sci_cancel(ScintillaObject *sci)
void sci_replace_sel(ScintillaObject *sci, const gchar *text)
Replaces selection.
void sci_convert_eols(ScintillaObject *sci, gint eolmode)
void sci_set_current_position(ScintillaObject *sci, gint position, gboolean scroll_to_caret)
Sets the cursor position.
void sci_cut(ScintillaObject *sci)
void sci_zoom_in(ScintillaObject *sci)
gboolean sci_has_selection(ScintillaObject *sci)
Checks if there's a selection.
void sci_start_undo_action(ScintillaObject *sci)
Begins grouping a set of edits together as one Undo action.
void sci_insert_text(ScintillaObject *sci, gint pos, const gchar *text)
Inserts text.
void sci_end_undo_action(ScintillaObject *sci)
Ends grouping a set of edits together as one Undo action.
void sci_copy(ScintillaObject *sci)
void sci_clear(ScintillaObject *sci)
void sci_zoom_off(ScintillaObject *sci)
gint sci_get_position_from_line(ScintillaObject *sci, gint line)
Gets the position for the start of line.
Wrapper functions for the Scintilla editor widget SCI_* messages.
void search_show_find_in_files_dialog(const gchar *dir)
Shows the Find in Files dialog.
void search_find_usage(const gchar *search_text, const gchar *original_search_text, GeanyFindFlags flags, gboolean in_session)
void search_show_find_dialog(void)
void search_find_selection(GeanyDocument *doc, gboolean search_backwards)
GeanySearchData search_data
void search_find_again(gboolean change_direction)
void search_show_replace_dialog(void)
gboolean spawn_async(const gchar *working_directory, const gchar *command_line, gchar **argv, gchar **envp, GPid *child_pid, GError **error)
Executes a child asynchronously.
Portable and convenient process spawning and communication.
struct GeanyProject * project
Currently active project or NULL if none is open.
Structure for representing an open tab with all its properties.
gchar * file_name
The UTF-8 encoded file name.
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_bom
Internally used flag to indicate whether the file of this document has a byte-order-mark.
gchar * real_path
The link-dereferenced, locale-encoded file name.
gboolean readonly
Whether this document is read-only.
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.
gboolean show_markers_margin
gboolean show_indent_guide
gboolean show_linenumber_margin
gboolean show_line_endings
gboolean show_white_space
gboolean line_breaking
Whether to split long lines as you type.
gboolean auto_indent
TRUE if auto-indentation is enabled.
ScintillaObject * sci
The Scintilla editor GtkWidget.
gboolean line_wrapping
TRUE if line wrapping is enabled.
gboolean keep_edit_history_on_reload
gchar * context_action_cmd
gboolean sidebar_symbol_visible
whether the symbol sidebar is visible
gboolean sidebar_openfiles_visible
whether the open file list is visible
gboolean show_notebook_tabs
whether editor tabs are visible
GtkWidget * window
Main window.
GtkWidget * notebook
Document notebook.
GtkWidget * toolbar
Main toolbar.
GtkWidget * sidebar_notebook
Sidebar notebook.
gchar * base_path
Base path of the project directory (in UTF-8, maybe relative).
gboolean use_gtk_printing
Defines internationalization macros.
#define ngettext(String, PluralString, Number)
gint symbols_get_current_function(GeanyDocument *doc, const gchar **tagname)
void symbols_show_load_tags_dialog(void)
gchar * templates_get_template_fileheader(gint filetype_idx, const gchar *fname)
gchar * templates_get_template_changelog(GeanyDocument *doc)
GeanyTemplatePrefs template_prefs
gchar * templates_get_template_function(GeanyDocument *doc, const gchar *func_name)
gchar * templates_get_template_licence(GeanyDocument *doc, gint licence_type)
void ui_update_statusbar(GeanyDocument *doc, gint pos)
void ui_set_fullscreen(void)
void ui_widget_show_hide(GtkWidget *widget, gboolean show)
void ui_sidebar_show_hide(void)
void ui_update_menu_copy_items(GeanyDocument *doc)
void ui_statusbar_showhide(gboolean state)
void ui_update_tab_status(GeanyDocument *doc)
gboolean ui_tree_view_find_next(GtkTreeView *treeview, TVMatchCallback cb)
gboolean ui_tree_view_find_previous(GtkTreeView *treeview, TVMatchCallback cb)
void ui_save_buttons_toggle(gboolean enable)
void ui_set_window_title(GeanyDocument *doc)
gchar * ui_menu_item_get_text(GtkMenuItem *menu_item)
GeanyMainWidgets main_widgets
void ui_menu_copy_items_set_sensitive(gboolean sensitive)
void ui_set_statusbar(gboolean log, const gchar *format,...)
Displays text on the statusbar.
void ui_document_show_hide(GeanyDocument *doc)
void ui_toggle_editor_features(GeanyUIEditorFeatures feature)
void ui_set_search_entry_background(GtkWidget *widget, gboolean success)
GtkWidget * ui_lookup_widget(GtkWidget *widget, const gchar *widget_name)
Returns a widget from a name in a component, usually created by Glade.
void ui_update_popup_reundo_items(GeanyDocument *doc)
void ui_update_insert_include_item(GeanyDocument *doc, gint item)
GeanyInterfacePrefs interface_prefs
static GtkBuilder * builder
User Interface general utility functions.
void utils_open_browser(const gchar *uri)
Tries to open the given URI in a browser.
gchar * utils_get_help_url(const gchar *suffix)
gboolean utils_str_has_upper(const gchar *str)
gchar * utils_get_utf8_from_locale(const gchar *locale_text)
Converts the given string (in locale encoding) into UTF-8 encoding.
gchar * utils_get_current_file_dir_utf8(void)
void utils_str_replace_all(gchar **haystack, const gchar *needle, const gchar *replacement)
gchar * utils_get_locale_from_utf8(const gchar *utf8_text)
Converts the given UTF-8 encoded string into locale encoding.
General utility functions, non-GTK related.
#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.