Revision: 2609 http://geany.svn.sourceforge.net/geany/?rev=2609&view=rev Author: ntrel Date: 2008-05-22 07:41:28 -0700 (Thu, 22 May 2008)
Log Message: ----------- Note: this commit breaks the plugin API. Split widget fields out of GeanyApp into GeanyMainWidgets, so other data items can be added without breaking the plugin ABI. Add GeanyData::main_widgets, and macro. Rename treeview_notebook sidebar_notebook in GeanyMainWidgets. Move tools_menu from GeanyData to GeanyMainWidgets. Move statusbar out of GeanyApp (shouldn't be used directly). Move ignore_callback out of GeanyApp. Rename sci_goto_line() argument unfold, like sci_goto_pos(). Make utils_goto_file_pos(), utils_goto_line(), utils_switch_document() into static functions (they are UI-related, so shouldn't be in utils.c). Move utils_goto_pos() to editor.c, add mark argument.
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/autosave.c trunk/plugins/classbuilder.c trunk/plugins/demoplugin.c trunk/plugins/export.c trunk/plugins/filebrowser.c trunk/plugins/htmlchars.c trunk/plugins/pluginmacros.h trunk/plugins/vcdiff.c trunk/src/about.c trunk/src/build.c trunk/src/callbacks.c trunk/src/dialogs.c trunk/src/document.c trunk/src/editor.c trunk/src/editor.h trunk/src/encodings.c trunk/src/filetypes.c trunk/src/geany.h trunk/src/keybindings.c trunk/src/keyfile.c trunk/src/main.c trunk/src/msgwindow.c trunk/src/navqueue.c trunk/src/notebook.c trunk/src/plugindata.h trunk/src/plugins.c trunk/src/prefs.c trunk/src/printing.c trunk/src/project.c trunk/src/sciwrappers.c trunk/src/sciwrappers.h trunk/src/search.c trunk/src/socket.c trunk/src/symbols.c trunk/src/templates.c trunk/src/tools.c trunk/src/treeviews.c trunk/src/ui_utils.c trunk/src/ui_utils.h trunk/src/utils.c trunk/src/utils.h trunk/src/win32.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/ChangeLog 2008-05-22 14:41:28 UTC (rev 2609) @@ -1,3 +1,31 @@ +2008-05-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/templates.c, src/build.c, src/utils.c, src/ui_utils.h, + src/win32.c, src/utils.h, src/keybindings.c, src/printing.c, + src/tools.c, src/sciwrappers.c, src/project.c, src/sciwrappers.h, + src/encodings.c, src/prefs.c, src/dialogs.c, src/navqueue.c, + src/plugindata.h, src/geany.h, src/about.c, src/treeviews.c, + src/msgwindow.c, src/callbacks.c, src/notebook.c, src/keyfile.c, + src/filetypes.c, src/search.c, src/document.c, src/plugins.c, + src/main.c, src/editor.c, src/symbols.c, src/socket.c, + src/editor.h, src/ui_utils.c, plugins/export.c, plugins/vcdiff.c, + plugins/demoplugin.c, plugins/filebrowser.c, plugins/htmlchars.c, + plugins/autosave.c, plugins/pluginmacros.h, plugins/classbuilder.c: + Note: this commit breaks the plugin API. + Split widget fields out of GeanyApp into GeanyMainWidgets, so other + data items can be added without breaking the plugin ABI. + Add GeanyData::main_widgets, and macro. + Rename treeview_notebook sidebar_notebook in GeanyMainWidgets. + Move tools_menu from GeanyData to GeanyMainWidgets. + Move statusbar out of GeanyApp (shouldn't be used directly). + Move ignore_callback out of GeanyApp. + Rename sci_goto_line() argument unfold, like sci_goto_pos(). + Make utils_goto_file_pos(), utils_goto_line(), + utils_switch_document() into static functions (they are UI-related, + so shouldn't be in utils.c). + Move utils_goto_pos() to editor.c, add mark argument. + + 2008-05-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* plugins/Makefile.am:
Modified: trunk/plugins/autosave.c =================================================================== --- trunk/plugins/autosave.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/plugins/autosave.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -26,6 +26,7 @@ #include "geany.h" #include "support.h" #include "document.h" +#include "ui_utils.h"
#include "plugindata.h" #include "pluginmacros.h" @@ -52,7 +53,7 @@ gboolean auto_save(gpointer data) { gint cur_idx = p_document->get_cur_idx(); - gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); + gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets->notebook)); gint saved_files = 0;
if (save_all)
Modified: trunk/plugins/classbuilder.c =================================================================== --- trunk/plugins/classbuilder.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/plugins/classbuilder.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -30,6 +30,7 @@ #include "support.h" #include "filetypes.h" #include "document.h" +#include "ui_utils.h" #include "pluginmacros.h"
@@ -354,7 +355,7 @@ cc_dlg->class_type = type;
cc_dlg->dialog = gtk_dialog_new_with_buttons(_("Create Class"), - GTK_WINDOW(app->window), + GTK_WINDOW(main_widgets->window), GTK_DIALOG_MODAL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, @@ -777,7 +778,7 @@ GtkWidget *menu_create_gtk_class;
menu_create_class1 = gtk_image_menu_item_new_with_mnemonic (_("Create Cla_ss")); - gtk_container_add (GTK_CONTAINER (data->tools_menu), menu_create_class1); + gtk_container_add (GTK_CONTAINER (main_widgets->tools_menu), menu_create_class1);
image1861 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_create_class1), image1861);
Modified: trunk/plugins/demoplugin.c =================================================================== --- trunk/plugins/demoplugin.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/plugins/demoplugin.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -37,6 +37,7 @@
#include "geany.h" /* for the GeanyApp data type */ #include "support.h" /* for the _() translation macro (see also po/POTFILES.in) */ +#include "ui_utils.h"
#include "plugindata.h" /* this defines the plugin API */ #include "pluginmacros.h" /* some useful macros to avoid typing geany_data so often */ @@ -67,7 +68,7 @@ GtkWidget *dialog;
dialog = gtk_message_dialog_new( - GTK_WINDOW(app->window), + GTK_WINDOW(main_widgets->window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, @@ -89,7 +90,7 @@ /* Add an item to the Tools menu */ demo_item = gtk_menu_item_new_with_mnemonic(_("_Demo Plugin")); gtk_widget_show(demo_item); - gtk_container_add(GTK_CONTAINER(geany_data->tools_menu), demo_item); + gtk_container_add(GTK_CONTAINER(main_widgets->tools_menu), demo_item); g_signal_connect(G_OBJECT(demo_item), "activate", G_CALLBACK(item_activate), NULL);
welcome_text = g_strdup(_("Hello World!"));
Modified: trunk/plugins/export.c =================================================================== --- trunk/plugins/export.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/plugins/export.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -163,14 +163,14 @@ return;
idx = p_document->get_cur_idx(); - tooltips = GTK_TOOLTIPS(p_support->lookup_widget(app->window, "tooltips")); + tooltips = GTK_TOOLTIPS(p_support->lookup_widget(main_widgets->window, "tooltips"));
exi = g_new(ExportInfo, 1); exi->idx = idx; exi->export_func = func; exi->have_zoom_level_checkbox = FALSE;
- dialog = gtk_file_chooser_dialog_new(_("Export File"), GTK_WINDOW(app->window), + dialog = gtk_file_chooser_dialog_new(_("Export File"), GTK_WINDOW(main_widgets->window), GTK_FILE_CHOOSER_ACTION_SAVE, NULL, NULL); gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); @@ -205,7 +205,7 @@ g_signal_connect((gpointer) dialog, "response", G_CALLBACK(on_file_save_dialog_response), exi);
- gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(app->window)); + gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_widgets->window));
/* if the current document has a filename we use it as the default. */ gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(dialog)); @@ -712,7 +712,7 @@ GtkWidget *menu_create_latex;
menu_export = gtk_image_menu_item_new_with_mnemonic(_("_Export")); - gtk_container_add(GTK_CONTAINER(data->tools_menu), menu_export); + gtk_container_add(GTK_CONTAINER(main_widgets->tools_menu), menu_export);
menu_export_menu = gtk_menu_new (); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_export), menu_export_menu);
Modified: trunk/plugins/filebrowser.c =================================================================== --- trunk/plugins/filebrowser.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/plugins/filebrowser.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -738,7 +738,7 @@ { GtkWidget *wid, *toolbar; GtkTooltips *tooltips = GTK_TOOLTIPS(p_support->lookup_widget( - app->window, "tooltips")); + main_widgets->window, "tooltips"));
toolbar = gtk_toolbar_new(); gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar), GTK_ICON_SIZE_MENU); @@ -938,7 +938,7 @@ gtk_container_add(GTK_CONTAINER(file_view_vbox), scrollwin);
gtk_widget_show_all(file_view_vbox); - gtk_notebook_append_page(GTK_NOTEBOOK(app->treeview_notebook), file_view_vbox, + gtk_notebook_append_page(GTK_NOTEBOOK(main_widgets->sidebar_notebook), file_view_vbox, gtk_label_new(_("Files")));
load_settings();
Modified: trunk/plugins/htmlchars.c =================================================================== --- trunk/plugins/htmlchars.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/plugins/htmlchars.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -29,6 +29,7 @@ #include "plugindata.h" #include "document.h" #include "keybindings.h" +#include "ui_utils.h" #include "pluginmacros.h"
@@ -83,7 +84,7 @@ GtkWidget *swin, *vbox, *label;
sc_dialog = gtk_dialog_new_with_buttons( - _("Special Characters"), GTK_WINDOW(app->window), + _("Special Characters"), GTK_WINDOW(main_widgets->window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, _("_Insert"), GTK_RESPONSE_OK, NULL); vbox = p_ui->dialog_vbox_new(GTK_DIALOG(sc_dialog)); @@ -531,7 +532,7 @@ /* Add an item to the Tools menu */ demo_item = gtk_menu_item_new_with_mnemonic(menu_text); gtk_widget_show(demo_item); - gtk_container_add(GTK_CONTAINER(geany_data->tools_menu), demo_item); + gtk_container_add(GTK_CONTAINER(main_widgets->tools_menu), demo_item); g_signal_connect(G_OBJECT(demo_item), "activate", G_CALLBACK(item_activate), NULL);
/* disable menu_item when there are no documents open */
Modified: trunk/plugins/pluginmacros.h =================================================================== --- trunk/plugins/pluginmacros.h 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/plugins/pluginmacros.h 2008-05-22 14:41:28 UTC (rev 2609) @@ -37,6 +37,7 @@
/* common data structs */ #define app geany_data->app +#define main_widgets geany_data->main_widgets #define doc_array geany_data->doc_array /**< Allows use of @c doc_list[] macro */ #define filetypes_array geany_data->filetypes_array /**< Allows use of @c filetypes[] macro */ #define prefs geany_data->prefs
Modified: trunk/plugins/vcdiff.c =================================================================== --- trunk/plugins/vcdiff.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/plugins/vcdiff.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -34,6 +34,7 @@ #include "filetypes.h" #include "utils.h" #include "project.h" +#include "ui_utils.h" #include "pluginmacros.h"
@@ -293,7 +294,7 @@ else { p_sci->set_text(doc_list[idx].sci, text); - book = GTK_NOTEBOOK(app->notebook); + book = GTK_NOTEBOOK(main_widgets->notebook); page = gtk_notebook_page_num(book, GTK_WIDGET(doc_list[idx].sci)); gtk_notebook_set_current_page(book, page); doc_list[idx].changed = FALSE; @@ -508,7 +509,7 @@ tooltips = gtk_tooltips_new();
menu_vcdiff = gtk_image_menu_item_new_with_mnemonic(_("_Version Diff")); - gtk_container_add(GTK_CONTAINER(data->tools_menu), menu_vcdiff); + gtk_container_add(GTK_CONTAINER(main_widgets->tools_menu), menu_vcdiff);
g_signal_connect((gpointer) menu_vcdiff, "activate", G_CALLBACK(update_menu_items), NULL);
Modified: trunk/src/about.c =================================================================== --- trunk/src/about.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/about.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -118,7 +118,7 @@ dialog = gtk_dialog_new();
/* configure dialog */ - gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(app->window)); + gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_widgets.window)); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_set_title(GTK_WINDOW(dialog), _("About Geany")); gtk_widget_set_name(dialog, "GeanyDialog");
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/build.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -1027,7 +1027,7 @@ { GtkWidget *menu, *item = NULL, *image, *separator; GtkAccelGroup *accel_group = gtk_accel_group_new(); - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips")); KeyBindingGroup *group = g_ptr_array_index(keybinding_groups, GEANY_KEY_GROUP_BUILD);
menu = gtk_menu_new(); @@ -1144,7 +1144,7 @@ { GtkWidget *menu, *item, *image, *separator; GtkAccelGroup *accel_group = gtk_accel_group_new(); - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips")); KeyBindingGroup *group = g_ptr_array_index(keybinding_groups, GEANY_KEY_GROUP_BUILD);
menu = gtk_menu_new(); @@ -1264,7 +1264,7 @@ G_CALLBACK(on_build_arguments_activate), filetypes[GEANY_FILETYPES_LATEX]); menu_items->item_set_args = item;
- gtk_window_add_accel_group(GTK_WINDOW(app->window), accel_group); + gtk_window_add_accel_group(GTK_WINDOW(main_widgets.window), accel_group);
menu_items->menu = menu; g_object_ref((gpointer)menu_items->menu); /* to hold it after removing */ @@ -1330,7 +1330,7 @@ if (DOC_IDX_VALID(idx)) ft = doc_list[idx].file_type; g_return_if_fail(ft != NULL);
- dialog = gtk_dialog_new_with_buttons(_("Set Arguments"), GTK_WINDOW(app->window), + dialog = gtk_dialog_new_with_buttons(_("Set Arguments"), GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); @@ -1499,7 +1499,7 @@ if (DOC_IDX_VALID(idx)) ft = doc_list[idx].file_type; g_return_if_fail(ft != NULL);
- dialog = gtk_dialog_new_with_buttons(_("Set Includes and Arguments"), GTK_WINDOW(app->window), + dialog = gtk_dialog_new_with_buttons(_("Set Includes and Arguments"), GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); @@ -1645,14 +1645,14 @@ (FILETYPE_ID(doc_list[idx].file_type) == GEANY_FILETYPES_NONE && doc_list[idx].file_name == NULL)) { - gtk_widget_set_sensitive(lookup_widget(app->window, "menu_build1"), FALSE); - gtk_menu_item_remove_submenu(GTK_MENU_ITEM(lookup_widget(app->window, "menu_build1"))); + gtk_widget_set_sensitive(lookup_widget(main_widgets.window, "menu_build1"), FALSE); + gtk_menu_item_remove_submenu(GTK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_build1"))); gtk_widget_set_sensitive(widgets.compile_button, FALSE); gtk_widget_set_sensitive(widgets.run_button, FALSE); return; } else - gtk_widget_set_sensitive(lookup_widget(app->window, "menu_build1"), TRUE); + gtk_widget_set_sensitive(lookup_widget(main_widgets.window, "menu_build1"), TRUE);
ft = doc_list[idx].file_type; g_return_if_fail(ft != NULL); @@ -1660,7 +1660,7 @@ menu_items = build_get_menu_items(ft->id); /* Note: don't remove the submenu first because it can now cause an X hang if * the menu is already open when called from build_exit_cb(). */ - gtk_menu_item_set_submenu(GTK_MENU_ITEM(lookup_widget(app->window, "menu_build1")), + gtk_menu_item_set_submenu(GTK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_build1")), menu_items->menu);
have_path = (doc_list[idx].file_name != NULL); @@ -2041,6 +2041,6 @@
void build_init() { - widgets.compile_button = lookup_widget(app->window, "toolbutton13"); - widgets.run_button = lookup_widget(app->window, "toolbutton26"); + widgets.compile_button = lookup_widget(main_widgets.window, "toolbutton13"); + widgets.run_button = lookup_widget(main_widgets.window, "toolbutton26"); }
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/callbacks.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -175,7 +175,7 @@ on_save1_activate (GtkMenuItem *menuitem, gpointer user_data) { - gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook)); + gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook)); gint idx = document_get_cur_idx();
if (cur_page >= 0) @@ -200,7 +200,7 @@ on_save_all1_activate (GtkMenuItem *menuitem, gpointer user_data) { - gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); + gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)); gint cur_idx = document_get_cur_idx();
document_delay_colourise(); /* avoid recolourising all C files after each save */ @@ -212,7 +212,7 @@ if (doc_list[idx].file_name == NULL) { /* display unnamed document */ - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), document_get_notebook_page(idx)); dialogs_show_save_as(); } @@ -237,7 +237,7 @@ on_close1_activate (GtkMenuItem *menuitem, gpointer user_data) { - guint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook)); + guint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook)); document_remove(cur_page); }
@@ -301,7 +301,7 @@ gpointer user_data) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
if (GTK_IS_EDITABLE(focusw)) gtk_editable_cut_clipboard(GTK_EDITABLE(focusw)); @@ -323,7 +323,7 @@ gpointer user_data) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
if (GTK_IS_EDITABLE(focusw)) gtk_editable_copy_clipboard(GTK_EDITABLE(focusw)); @@ -345,7 +345,7 @@ gpointer user_data) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
if (GTK_IS_EDITABLE(focusw)) gtk_editable_paste_clipboard(GTK_EDITABLE(focusw)); @@ -386,7 +386,7 @@ gpointer user_data) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
if (GTK_IS_EDITABLE(focusw)) gtk_editable_delete_selection(GTK_EDITABLE(focusw)); @@ -484,7 +484,7 @@ { if (ignore_toolbar_toggle) return;
- gtk_toolbar_set_style(GTK_TOOLBAR(app->toolbar), GTK_TOOLBAR_BOTH); + gtk_toolbar_set_style(GTK_TOOLBAR(main_widgets.toolbar), GTK_TOOLBAR_BOTH); toolbar_prefs.icon_style = GTK_TOOLBAR_BOTH; }
@@ -495,7 +495,7 @@ { if (ignore_toolbar_toggle) return;
- gtk_toolbar_set_style(GTK_TOOLBAR(app->toolbar), GTK_TOOLBAR_ICONS); + gtk_toolbar_set_style(GTK_TOOLBAR(main_widgets.toolbar), GTK_TOOLBAR_ICONS); toolbar_prefs.icon_style = GTK_TOOLBAR_ICONS; }
@@ -506,7 +506,7 @@ { if (ignore_toolbar_toggle) return;
- gtk_toolbar_set_style(GTK_TOOLBAR(app->toolbar), GTK_TOOLBAR_TEXT); + gtk_toolbar_set_style(GTK_TOOLBAR(main_widgets.toolbar), GTK_TOOLBAR_TEXT); toolbar_prefs.icon_style = GTK_TOOLBAR_TEXT; }
@@ -550,7 +550,7 @@ const GdkColor red = {0, 0xffff, 0x6666, 0x6666}; const GdkColor white = {0, 0xffff, 0xffff, 0xffff}; static gboolean old_value = TRUE; - GtkWidget *widget = lookup_widget(app->window, "entry1"); + GtkWidget *widget = lookup_widget(main_widgets.window, "entry1");
/* only update if really needed */ if (search_data.search_bar && old_value != success) @@ -609,7 +609,7 @@ { gint idx = document_get_cur_idx(); gboolean result; - GtkWidget *entry = lookup_widget(GTK_WIDGET(app->window), "entry1"); + GtkWidget *entry = lookup_widget(GTK_WIDGET(main_widgets.window), "entry1");
setup_find_next(GTK_EDITABLE(entry)); result = document_search_bar_find(idx, search_data.text, 0, FALSE); @@ -644,7 +644,7 @@ on_hide_toolbar1_activate (GtkMenuItem *menuitem, gpointer user_data) { - GtkWidget *tool_item = lookup_widget(GTK_WIDGET(app->window), "menu_show_toolbar1"); + GtkWidget *tool_item = lookup_widget(GTK_WIDGET(main_widgets.window), "menu_show_toolbar1"); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(tool_item), FALSE); }
@@ -698,7 +698,7 @@ on_toolbutton15_clicked (GtkToolButton *toolbutton, gpointer user_data) { - gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook)); + gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook)); document_remove(cur_page); }
@@ -761,7 +761,7 @@ gpointer user_data) { /* suppress selection changed signal when switching to the open files list */ - app->ignore_callback = TRUE; + ignore_callback = TRUE; }
@@ -771,7 +771,7 @@ guint page_num, gpointer user_data) { - app->ignore_callback = FALSE; + ignore_callback = FALSE; }
@@ -780,7 +780,7 @@ gpointer user_data) { gint idx = document_get_cur_idx(); - if (app->ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return; + if (ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return; sci_convert_eols(doc_list[idx].sci, SC_EOL_CRLF); sci_set_eol_mode(doc_list[idx].sci, SC_EOL_CRLF); } @@ -791,7 +791,7 @@ gpointer user_data) { gint idx = document_get_cur_idx(); - if (app->ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return; + if (ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return; sci_convert_eols(doc_list[idx].sci, SC_EOL_LF); sci_set_eol_mode(doc_list[idx].sci, SC_EOL_LF); } @@ -802,7 +802,7 @@ gpointer user_data) { gint idx = document_get_cur_idx(); - if (app->ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return; + if (ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return; sci_convert_eols(doc_list[idx].sci, SC_EOL_CR); sci_set_eol_mode(doc_list[idx].sci, SC_EOL_CR); } @@ -918,10 +918,10 @@ on_show_toolbar1_toggled (GtkCheckMenuItem *checkmenuitem, gpointer user_data) { - if (app->ignore_callback) return; + if (ignore_callback) return;
toolbar_prefs.visible = (toolbar_prefs.visible) ? FALSE : TRUE;; - ui_widget_show_hide(GTK_WIDGET(app->toolbar), toolbar_prefs.visible); + ui_widget_show_hide(GTK_WIDGET(main_widgets.toolbar), toolbar_prefs.visible); }
@@ -938,10 +938,10 @@ on_show_messages_window1_toggled (GtkCheckMenuItem *checkmenuitem, gpointer user_data) { - if (app->ignore_callback) return; + if (ignore_callback) return;
ui_prefs.msgwindow_visible = (ui_prefs.msgwindow_visible) ? FALSE : TRUE; - ui_widget_show_hide(lookup_widget(app->window, "scrolledwindow1"), ui_prefs.msgwindow_visible); + ui_widget_show_hide(lookup_widget(main_widgets.window, "scrolledwindow1"), ui_prefs.msgwindow_visible); }
@@ -967,7 +967,7 @@ on_line_wrapping1_toggled (GtkCheckMenuItem *checkmenuitem, gpointer user_data) { - if (! app->ignore_callback) + if (! ignore_callback) { gint idx = document_get_cur_idx(); if (! DOC_IDX_VALID(idx)) return; @@ -980,7 +980,7 @@ on_set_file_readonly1_toggled (GtkCheckMenuItem *checkmenuitem, gpointer user_data) { - if (! app->ignore_callback) + if (! ignore_callback) { gint idx = document_get_cur_idx(); if (! DOC_IDX_VALID(idx)) return; @@ -996,7 +996,7 @@ on_use_auto_indentation1_toggled (GtkCheckMenuItem *checkmenuitem, gpointer user_data) { - if (! app->ignore_callback) + if (! ignore_callback) { gint idx = document_get_cur_idx(); if (! DOC_IDX_VALID(idx)) return; @@ -1037,7 +1037,7 @@ gpointer user_data) { gboolean definition = (menuitem == - GTK_MENU_ITEM(lookup_widget(app->popup_menu, "goto_tag_definition1"))); + GTK_MENU_ITEM(lookup_widget(main_widgets.editor_menu, "goto_tag_definition1"))); GeanyDocument *doc = document_get_current();
g_return_if_fail(doc); @@ -1187,15 +1187,19 @@
if (line > 0 && line <= sci_get_line_count(doc_list[idx].sci)) { - utils_goto_line(idx, line); + gint pos; + + line--; /* the user counts lines from 1, we begin at 0 so bring the user line to our one */ + pos = sci_get_position_from_line(doc_list[idx].sci, line); + editor_goto_pos(idx, pos, TRUE); } else { utils_beep(); } - } - if (dialog) gtk_widget_destroy(GTK_WIDGET(dialog)); + if (dialog) + gtk_widget_destroy(GTK_WIDGET(dialog)); }
@@ -1220,7 +1224,7 @@ gpointer user_data) { on_goto_line_dialog_response(NULL, GTK_RESPONSE_ACCEPT, - lookup_widget(app->window, "entry_goto_line")); + lookup_widget(main_widgets.window, "entry_goto_line")); }
@@ -1546,7 +1550,7 @@ gint idx = document_get_cur_idx(); guint i = GPOINTER_TO_INT(user_data);
- if (app->ignore_callback || ! DOC_IDX_VALID(idx) || encodings[i].charset == NULL || + if (ignore_callback || ! DOC_IDX_VALID(idx) || encodings[i].charset == NULL || utils_str_equal(encodings[i].charset, doc_list[idx].encoding)) return;
if (doc_list[idx].readonly) @@ -1589,13 +1593,13 @@ { static gint active_page = -1;
- if (app->ignore_callback) return; + if (ignore_callback) return;
if (ui_prefs.sidebar_visible) { /* to remember the active page because GTK (e.g. 2.8.18) doesn't do it and shows always * the last page (for unknown reason, with GTK 2.6.4 it works) */ - active_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->treeview_notebook)); + active_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook)); }
ui_prefs.sidebar_visible = ! ui_prefs.sidebar_visible; @@ -1607,7 +1611,7 @@ }
ui_sidebar_show_hide(); - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->treeview_notebook), active_page); + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook), active_page); }
@@ -1615,7 +1619,7 @@ on_menu_write_unicode_bom1_toggled (GtkCheckMenuItem *checkmenuitem, gpointer user_data) { - if (! app->ignore_callback) + if (! ignore_callback) { gint idx = document_get_cur_idx();
@@ -1835,8 +1839,8 @@
if (item_close == NULL) { - item_close = lookup_widget(app->window, "project_close1"); - item_properties = lookup_widget(app->window, "project_properties1"); + item_close = lookup_widget(main_widgets.window, "project_close1"); + item_properties = lookup_widget(main_widgets.window, "project_properties1"); }
gtk_widget_set_sensitive(item_close, (app->project != NULL)); @@ -1966,9 +1970,9 @@ { static gint hide_all = -1; GtkCheckMenuItem *msgw = GTK_CHECK_MENU_ITEM( - lookup_widget(app->window, "menu_show_messages_window1")); + lookup_widget(main_widgets.window, "menu_show_messages_window1")); GtkCheckMenuItem *toolbari = GTK_CHECK_MENU_ITEM( - lookup_widget(app->window, "menu_show_toolbar1")); + lookup_widget(main_widgets.window, "menu_show_toolbar1"));
/* get the initial state (necessary if Geany was closed with hide_all = TRUE) */ if (hide_all == -1) @@ -1991,7 +1995,7 @@ gtk_check_menu_item_set_active(msgw, ! gtk_check_menu_item_get_active(msgw));
interface_prefs.show_notebook_tabs = FALSE; - gtk_notebook_set_show_tabs(GTK_NOTEBOOK(app->notebook), interface_prefs.show_notebook_tabs); + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(main_widgets.notebook), interface_prefs.show_notebook_tabs);
ui_statusbar_showhide(FALSE);
@@ -2005,7 +2009,7 @@ gtk_check_menu_item_set_active(msgw, ! gtk_check_menu_item_get_active(msgw));
interface_prefs.show_notebook_tabs = TRUE; - gtk_notebook_set_show_tabs(GTK_NOTEBOOK(app->notebook), interface_prefs.show_notebook_tabs); + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(main_widgets.notebook), interface_prefs.show_notebook_tabs);
ui_statusbar_showhide(TRUE);
@@ -2113,7 +2117,7 @@ { GeanyDocument *doc;
- if (app->ignore_callback) + if (ignore_callback) return;
doc = document_get_current();
Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/dialogs.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -169,11 +169,11 @@ { GtkWidget *filetype_combo, *encoding_combo; GtkWidget *viewbtn; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips")); guint i; gchar *encoding_string;
- ui_widgets.open_filesel = gtk_file_chooser_dialog_new(_("Open File"), GTK_WINDOW(app->window), + ui_widgets.open_filesel = gtk_file_chooser_dialog_new(_("Open File"), GTK_WINDOW(main_widgets.window), GTK_FILE_CHOOSER_ACTION_OPEN, NULL, NULL); gtk_widget_set_name(ui_widgets.open_filesel, "GeanyDialog");
@@ -192,7 +192,7 @@ gtk_window_set_destroy_with_parent(GTK_WINDOW(ui_widgets.open_filesel), TRUE); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(ui_widgets.open_filesel), FALSE); gtk_window_set_type_hint(GTK_WINDOW(ui_widgets.open_filesel), GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.open_filesel), GTK_WINDOW(app->window)); + gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.open_filesel), GTK_WINDOW(main_widgets.window)); gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(ui_widgets.open_filesel), TRUE);
/* add checkboxes and filename entry */ @@ -283,7 +283,7 @@ GtkWidget *vbox, *table, *file_entry, *check_hidden; GtkWidget *filetype_ebox, *filetype_label, *filetype_combo; GtkWidget *encoding_ebox, *encoding_label, *encoding_combo; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips"));
vbox = gtk_vbox_new(FALSE, 6);
@@ -472,9 +472,9 @@ static void create_save_file_dialog(void) { GtkWidget *vbox, *check_open_new_tab, *rename_btn; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips"));
- ui_widgets.save_filesel = gtk_file_chooser_dialog_new(_("Save File"), GTK_WINDOW(app->window), + ui_widgets.save_filesel = gtk_file_chooser_dialog_new(_("Save File"), GTK_WINDOW(main_widgets.window), GTK_FILE_CHOOSER_ACTION_SAVE, NULL, NULL); gtk_window_set_modal(GTK_WINDOW(ui_widgets.save_filesel), TRUE); gtk_window_set_destroy_with_parent(GTK_WINDOW(ui_widgets.save_filesel), TRUE); @@ -512,7 +512,7 @@ g_signal_connect((gpointer) ui_widgets.save_filesel, "response", G_CALLBACK(on_file_save_dialog_response), NULL);
- gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.save_filesel), GTK_WINDOW(app->window)); + gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.save_filesel), GTK_WINDOW(main_widgets.window)); } #endif
@@ -631,7 +631,7 @@ #ifdef G_OS_WIN32 win32_message_dialog(NULL, type, string); #else - dialog = gtk_message_dialog_new(GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT, + dialog = gtk_message_dialog_new(GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_OK, "%s", string); gtk_widget_set_name(dialog, "GeanyDialog"); gtk_dialog_run(GTK_DIALOG(dialog)); @@ -650,7 +650,7 @@ g_free(string); #else GtkWidget *dialog; - dialog = gtk_message_dialog_new(GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT, + dialog = gtk_message_dialog_new(GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_OK, "%s", text); gtk_widget_set_name(dialog, "GeanyDialog"); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s", secondary); @@ -669,7 +669,7 @@ gint ret;
/* display the file tab to remind the user of the document */ - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), document_get_notebook_page(idx));
if (doc_list[idx].file_name != NULL) @@ -686,7 +686,7 @@ setptr(msg, g_strconcat(msg, "\n", msg2, NULL)); ret = win32_message_dialog_unsaved(msg); #else - dialog = gtk_message_dialog_new(GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT, + dialog = gtk_message_dialog_new(GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", msg); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s", msg2); gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); @@ -789,7 +789,7 @@
gtk_font_selection_dialog_set_font_name( GTK_FONT_SELECTION_DIALOG(ui_widgets.open_fontsel), interface_prefs.editor_font); - gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.open_fontsel), GTK_WINDOW(app->window)); + gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.open_fontsel), GTK_WINDOW(main_widgets.window)); } /* We make sure the dialog is visible. */ gtk_window_present(GTK_WINDOW(ui_widgets.open_fontsel)); @@ -890,7 +890,7 @@ { GtkWidget *dialog, *vbox;
- dialog = gtk_dialog_new_with_buttons(title, GTK_WINDOW(app->window), + dialog = gtk_dialog_new_with_buttons(title, GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog)); @@ -918,7 +918,7 @@ { GtkWidget *dialog, *label, *entry, *vbox;
- dialog = gtk_dialog_new_with_buttons(_("Go to Line"), GTK_WINDOW(app->window), + dialog = gtk_dialog_new_with_buttons(_("Go to Line"), GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); @@ -1006,7 +1006,7 @@
base_name = g_path_get_basename(doc_list[idx].file_name); title = g_strconcat(base_name, " ", _("Properties"), NULL); - dialog = gtk_dialog_new_with_buttons(title, GTK_WINDOW(app->window), + dialog = gtk_dialog_new_with_buttons(title, GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL); g_free(title); @@ -1319,7 +1319,7 @@ GtkWidget *dialog;
if (parent == NULL) - parent = app->window; + parent = main_widgets.window;
dialog = gtk_message_dialog_new(GTK_WINDOW(parent), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, @@ -1362,14 +1362,14 @@ va_start(args, text); g_vsnprintf(string, 511, text, args); va_end(args); - ret = show_question(app->window, GTK_STOCK_YES, GTK_STOCK_NO, string, NULL); + ret = show_question(main_widgets.window, GTK_STOCK_YES, GTK_STOCK_NO, string, NULL); g_free(string); return ret; }
/* extra_text can be NULL; otherwise it is displayed below main_text. - * if parent is NULL, app->window will be used */ + * if parent is NULL, main_widgets.window will be used */ gboolean dialogs_show_question_full(GtkWidget *parent, const gchar *yes_btn, const gchar *no_btn, const gchar *extra_text, const gchar *main_text, ...) {
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/document.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -193,7 +193,7 @@ { if (! DOC_IDX_VALID(doc_idx)) return -1;
- return gtk_notebook_page_num(GTK_NOTEBOOK(app->notebook), + return gtk_notebook_page_num(GTK_NOTEBOOK(main_widgets.notebook), GTK_WIDGET(doc_list[doc_idx].sci)); }
@@ -212,7 +212,7 @@ if (page_num >= doc_array->len) return -1;
sci = (ScintillaObject*)gtk_notebook_get_nth_page( - GTK_NOTEBOOK(app->notebook), page_num); + GTK_NOTEBOOK(main_widgets.notebook), page_num);
return document_find_by_sci(sci); } @@ -226,14 +226,14 @@ **/ gint document_get_cur_idx() { - gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook)); + gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook));
if (cur_page == -1) return -1; else { ScintillaObject *sci = (ScintillaObject*) - gtk_notebook_get_nth_page(GTK_NOTEBOOK(app->notebook), cur_page); + gtk_notebook_get_nth_page(GTK_NOTEBOOK(main_widgets.notebook), cur_page);
return document_find_by_sci(sci); } @@ -434,7 +434,7 @@ gint new_idx; GeanyDocument *this; gint tabnum; - gint cur_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); + gint cur_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook));
if (cur_pages == 1) { @@ -524,10 +524,10 @@ doc_list[idx].tm_file = NULL; doc_list[idx].scroll_percent = -1.0F; document_undo_clear(idx); - if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) == 0) + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) == 0) { treeviews_update_tag_list(-1, FALSE); - /*on_notebook1_switch_page(GTK_NOTEBOOK(app->notebook), NULL, 0, NULL);*/ + /*on_notebook1_switch_page(GTK_NOTEBOOK(main_widgets.notebook), NULL, 0, NULL);*/ ui_set_window_title(-1); ui_save_buttons_toggle(FALSE); ui_document_buttons_update(); @@ -556,7 +556,7 @@ /* Opens a new empty document only if there are no other documents open */ gint document_new_file_if_non_open() { - if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) == 0) + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) == 0) return document_new_file(NULL, NULL, NULL);
return -1; @@ -1020,8 +1020,8 @@ if (idx >= 0) { ui_add_recent_file(utf8_filename); /* either add or reorder recent item */ - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), - gtk_notebook_page_num(GTK_NOTEBOOK(app->notebook), + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), + gtk_notebook_page_num(GTK_NOTEBOOK(main_widgets.notebook), (GtkWidget*) doc_list[idx].sci)); g_free(utf8_filename); g_free(locale_filename); @@ -1116,7 +1116,7 @@ ui_set_statusbar(TRUE, _("File %s reloaded."), utf8_filename); else msgwin_status_add(_("File %s opened(%d%s)."), - utf8_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)), + utf8_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)), (readonly) ? _(", read-only") : "");
g_free(utf8_filename); @@ -1285,9 +1285,9 @@ document_set_filetype(idx, ft); if (document_get_cur_idx() == idx) { - app->ignore_callback = TRUE; + ignore_callback = TRUE; filetypes_select_radio_item(doc_list[idx].file_type); - app->ignore_callback = FALSE; + ignore_callback = FALSE; } } utils_replace_filename(idx); @@ -2135,7 +2135,7 @@ doc_list[idx].encoding = g_strdup(new_encoding);
ui_update_statusbar(idx, -1); - gtk_widget_set_sensitive(lookup_widget(app->window, "menu_write_unicode_bom1"), + gtk_widget_set_sensitive(lookup_widget(main_widgets.window, "menu_write_unicode_bom1"), encodings_is_unicode_charset(doc_list[idx].encoding)); }
@@ -2272,9 +2272,9 @@
document_set_encoding(idx, (const gchar*)action->data);
- app->ignore_callback = TRUE; + ignore_callback = TRUE; encodings_select_radio_item((const gchar*)action->data); - app->ignore_callback = FALSE; + ignore_callback = FALSE;
g_free(action->data); break; @@ -2341,9 +2341,9 @@
document_set_encoding(idx, (const gchar*)action->data);
- app->ignore_callback = TRUE; + ignore_callback = TRUE; encodings_select_radio_item((const gchar*)action->data); - app->ignore_callback = FALSE; + ignore_callback = FALSE;
g_free(action->data); break; @@ -2509,7 +2509,7 @@ gint p; guint i, len = doc_array->len;
- for (p = 0; p < gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); p++) + for (p = 0; p < gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)); p++) { gint idx = document_get_n_idx(p);
@@ -2545,7 +2545,7 @@ } main_status.closing_all = TRUE;
- while (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) > 0) + while (gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) > 0) { document_remove(0); }
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/editor.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -101,7 +101,7 @@ ui_update_popup_goto_items((current_word[0] != '\0') ? TRUE : FALSE); ui_update_popup_copy_items(idx); ui_update_insert_include_item(idx, 0); - gtk_menu_popup(GTK_MENU(app->popup_menu), NULL, NULL, NULL, NULL, event->button, event->time); + gtk_menu_popup(GTK_MENU(main_widgets.editor_menu), NULL, NULL, NULL, NULL, event->button, event->time);
return TRUE; } @@ -460,7 +460,7 @@
case SCN_MODIFIED: { - if (nt->modificationType & SC_STARTACTION && ! app->ignore_callback) + if (nt->modificationType & SC_STARTACTION && ! ignore_callback) { /* get notified about undo changes */ document_undo_add(idx, UNDO_SCINTILLA, NULL); @@ -3211,3 +3211,34 @@ /* remove indent spaces on backspace, if using spaces to indent */ SSM(doc->sci, SCI_SETBACKSPACEUNINDENTS, ! use_tabs, 0); } + + +/* Move to position @a pos, switching to the document at @a idx if necessary, + * setting a marker if @a mark is set. */ +gboolean editor_goto_pos(gint idx, gint pos, gboolean mark) +{ + gint page_num; + + if (! DOC_IDX_VALID(idx) || pos < 0) + return FALSE; + + if (mark) + { + gint line = sci_get_line_from_position(doc_list[idx].sci, pos); + + /* mark the tag with the yellow arrow */ + sci_marker_delete_all(doc_list[idx].sci, 0); + sci_set_marker_at_line(doc_list[idx].sci, line, TRUE, 0); + } + + sci_goto_pos(doc_list[idx].sci, pos, TRUE); + doc_list[idx].scroll_percent = 0.25F; + + /* finally switch to the page */ + page_num = gtk_notebook_page_num(GTK_NOTEBOOK(main_widgets.notebook), GTK_WIDGET(doc_list[idx].sci)); + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), page_num); + + return TRUE; +} + +
Modified: trunk/src/editor.h =================================================================== --- trunk/src/editor.h 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/editor.h 2008-05-22 14:41:28 UTC (rev 2609) @@ -201,4 +201,6 @@
void editor_set_line_wrapping(gint idx, gboolean wrap);
+gboolean editor_goto_pos(gint idx, gint pos, gboolean mark); + #endif
Modified: trunk/src/encodings.c =================================================================== --- trunk/src/encodings.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/encodings.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -40,6 +40,7 @@ #include "msgwindow.h" #include "encodings.h" #include "callbacks.h" +#include "ui_utils.h"
#ifdef HAVE_REGCOMP @@ -239,7 +240,7 @@ } if (i == GEANY_ENCODINGS_MAX) i = GEANY_ENCODING_UTF_8; /* fallback to UTF-8 */
- /* app->ignore_callback has to be set by the caller */ + /* ignore_callback has to be set by the caller */ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(radio_items[i]), TRUE); }
@@ -329,8 +330,8 @@ #endif
/* create encodings submenu in document menu */ - menu[0] = lookup_widget(app->window, "set_encoding1_menu"); - menu[1] = lookup_widget(app->window, "menu_reload_as1_menu"); + menu[0] = lookup_widget(main_widgets.window, "set_encoding1_menu"); + menu[1] = lookup_widget(main_widgets.window, "menu_reload_as1_menu"); cb_func[0] = G_CALLBACK(on_encoding_change); cb_func[1] = G_CALLBACK(on_reload_as_activate);
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/filetypes.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -443,7 +443,7 @@ static void create_set_filetype_menu() { filetype_id ft_id; - GtkWidget *filetype_menu = lookup_widget(app->window, "set_filetype1_menu"); + GtkWidget *filetype_menu = lookup_widget(main_widgets.window, "set_filetype1_menu"); GtkWidget *sub_menu = filetype_menu; GtkWidget *sub_menu_programming, *sub_menu_scripts, *sub_menu_markup, *sub_menu_misc; GtkWidget *sub_item_programming, *sub_item_scripts, *sub_item_markup, *sub_item_misc; @@ -700,8 +700,8 @@ { FullFileType *fft;
- /* app->ignore_callback has to be set by the caller */ - g_return_if_fail(app->ignore_callback); + /* ignore_callback has to be set by the caller */ + g_return_if_fail(ignore_callback);
if (ft == NULL) ft = filetypes[GEANY_FILETYPES_NONE]; @@ -716,7 +716,7 @@ gpointer user_data) { gint idx = document_get_cur_idx(); - if (app->ignore_callback || idx < 0 || ! doc_list[idx].is_valid) return; + if (ignore_callback || idx < 0 || ! doc_list[idx].is_valid) return;
document_set_filetype(idx, (GeanyFiletype*)user_data); }
Modified: trunk/src/geany.h =================================================================== --- trunk/src/geany.h 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/geany.h 2008-05-22 14:41:28 UTC (rev 2609) @@ -59,8 +59,7 @@ typedef struct _GeanyProject GeanyProject;
-/* Commonly used items. - * Remember to increment abi_version in plugindata.h when changing items. */ +/* Important commonly-used items. */ typedef struct GeanyApp { gboolean debug_mode; @@ -69,22 +68,15 @@ gchar *docdir; const TMWorkspace *tm_workspace; GeanyProject *project; /* currently active project or NULL if none is open */ - gboolean ignore_callback; /* should not be used in new code - (use clicked instead of toggled signal) */ - - /* Important widgets */ - GtkWidget *window; - GtkWidget *toolbar; - GtkWidget *treeview_notebook; - GtkWidget *notebook; - GtkWidget *statusbar; /* use ui_set_statusbar() to set */ - GtkWidget *popup_menu; } GeanyApp;
extern GeanyApp *app;
+extern gboolean ignore_callback; + + enum { GEANY_IMAGE_SMALL_CROSS,
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/keybindings.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -137,7 +137,7 @@
/* Lookup a widget in the main window */ #define LW(widget_name) \ - lookup_widget(app->window, G_STRINGIFY(widget_name)) + lookup_widget(main_widgets.window, G_STRINGIFY(widget_name))
/* Expansion for group_id = FILE: * static KeyBinding FILE_keys[GEANY_KEYS_FILE_COUNT]; */ @@ -456,7 +456,7 @@
init_default_kb();
- gtk_window_add_accel_group(GTK_WINDOW(app->window), kb_accel_group); + gtk_window_add_accel_group(GTK_WINDOW(main_widgets.window), kb_accel_group); }
@@ -542,7 +542,7 @@
#define GEANY_ADD_POPUP_ACCEL(kb_id, wid) \ - add_menu_accel(group, kb_id, accel_group, lookup_widget(app->popup_menu, G_STRINGIFY(wid))) + add_menu_accel(group, kb_id, accel_group, lookup_widget(main_widgets.editor_menu, G_STRINGIFY(wid)))
/* set the menu item accelerator shortcuts (just for visibility, they are handled anyway) */ static void add_popup_menu_accels(void) @@ -583,7 +583,7 @@
/* the build menu items are set if the build menus are created */
- gtk_window_add_accel_group(GTK_WINDOW(app->window), accel_group); + gtk_window_add_accel_group(GTK_WINDOW(main_widgets.window), accel_group); }
@@ -676,7 +676,7 @@ GString *text_keys; gint height, response;
- dialog = gtk_dialog_new_with_buttons(_("Keyboard Shortcuts"), GTK_WINDOW(app->window), + dialog = gtk_dialog_new_with_buttons(_("Keyboard Shortcuts"), GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_EDIT, GTK_RESPONSE_APPLY, GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL); @@ -745,7 +745,7 @@ if (state & GDK_MOD1_MASK && keyval >= GDK_0 && keyval <= GDK_9) { gint page = keyval - GDK_0 - 1; - gint npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); + gint npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook));
/* alt-0 is for the rightmost tab */ if (keyval == GDK_0) @@ -754,7 +754,7 @@ if (swap_alt_tab_order && ! file_prefs.tab_order_ltr) page = (npages - 1) - page;
- gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), page); + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), page); return TRUE; } if (keyval == GDK_Page_Up || keyval == GDK_Page_Down) @@ -763,10 +763,10 @@ if (state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) { if (keyval == GDK_Page_Up) - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), 0); + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), 0); if (keyval == GDK_Page_Down) - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), - gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) - 1); + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), + gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) - 1); return TRUE; } } @@ -784,7 +784,7 @@ if (kb->key == keyval && kb->mods == state) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
/* keybinding only valid when scintilla widget has focus */ if (DOC_IDX_VALID(idx) && focusw == GTK_WIDGET(doc_list[idx].sci)) @@ -815,7 +815,7 @@
if (! vc->enable_bash_keys) return FALSE; - if (gtk_window_get_focus(GTK_WINDOW(app->window)) != vc->vte) + if (gtk_window_get_focus(GTK_WINDOW(main_widgets.window)) != vc->vte) return FALSE; /* prevent menubar flickering: */ if (state == GDK_SHIFT_MASK && (keyval >= GDK_a && keyval <= GDK_z)) @@ -836,10 +836,10 @@ * from overriding the VTE bash shortcuts. * Ideally we would just somehow disable the menubar without redrawing it, * but maybe that's not possible. */ - widget = lookup_widget(app->window, "menubar1"); + widget = lookup_widget(main_widgets.window, "menubar1"); gtk_widget_set_sensitive(widget, FALSE); g_idle_add(&set_sensitive, (gpointer) widget); - widget = app->popup_menu; + widget = main_widgets.editor_menu; gtk_widget_set_sensitive(widget, FALSE); g_idle_add(&set_sensitive, (gpointer) widget); return TRUE; @@ -1042,14 +1042,14 @@
static void cb_func_menu_fullscreen(G_GNUC_UNUSED guint key_id) { - GtkCheckMenuItem *c = GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_fullscreen1")); + GtkCheckMenuItem *c = GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_fullscreen1"));
gtk_check_menu_item_set_active(c, ! gtk_check_menu_item_get_active(c)); }
static void cb_func_menu_messagewindow(G_GNUC_UNUSED guint key_id) { - GtkCheckMenuItem *c = GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_show_messages_window1")); + GtkCheckMenuItem *c = GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_show_messages_window1"));
gtk_check_menu_item_set_active(c, ! gtk_check_menu_item_get_active(c)); } @@ -1175,15 +1175,15 @@ static void cb_func_switch_search_bar(G_GNUC_UNUSED guint key_id) { if (toolbar_prefs.visible && toolbar_prefs.show_search) - gtk_widget_grab_focus(lookup_widget(app->window, "entry1")); + gtk_widget_grab_focus(lookup_widget(main_widgets.window, "entry1")); }
static void cb_func_switch_sidebar(G_GNUC_UNUSED guint key_id) { if (ui_prefs.sidebar_visible) { - gint page_num = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->treeview_notebook)); - GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(app->treeview_notebook), page_num); + gint page_num = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook)); + GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook), page_num);
/* gtk_widget_grab_focus() won't work because of the scrolled window containers */ gtk_widget_child_focus(page, GTK_DIR_TAB_FORWARD); @@ -1195,14 +1195,37 @@ msgwin_switch_tab(MSG_VTE, TRUE); }
+ +static void switch_document(gint direction) +{ + gint page_count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)); + gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook)); + + if (direction == LEFT) + { + if (cur_page > 0) + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), cur_page - 1); + else + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), page_count - 1); + } + else if (direction == RIGHT) + { + if (cur_page < page_count - 1) + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), cur_page + 1); + else + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), 0); + } +} + + static void cb_func_switch_tableft(G_GNUC_UNUSED guint key_id) { - utils_switch_document(LEFT); + switch_document(LEFT); }
static void cb_func_switch_tabright(G_GNUC_UNUSED guint key_id) { - utils_switch_document(RIGHT); + switch_document(RIGHT); }
static void cb_func_switch_tablastused(G_GNUC_UNUSED guint key_id) @@ -1210,7 +1233,7 @@ gint last_doc_idx = callbacks_data.last_doc_idx;
if (DOC_IDX_VALID(last_doc_idx)) - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), document_get_notebook_page(last_doc_idx)); }
@@ -1219,7 +1242,7 @@ { gint idx = document_get_cur_idx(); GtkWidget *sci = GTK_WIDGET(doc_list[idx].sci); - GtkNotebook *nb = GTK_NOTEBOOK(app->notebook); + GtkNotebook *nb = GTK_NOTEBOOK(main_widgets.notebook); gint cur_page = gtk_notebook_get_current_page(nb);
if (! DOC_IDX_VALID(idx)) @@ -1397,7 +1420,7 @@ static void cb_func_editor_action(guint key_id) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
/* edit keybindings only valid when scintilla widget has focus */ if (! DOC_IDX_VALID(idx) || focusw != GTK_WIDGET(doc_list[idx].sci)) return; @@ -1439,7 +1462,7 @@ break; case GEANY_KEYS_EDITOR_CONTEXTACTION: if (check_current_word()) - on_context_action1_activate(GTK_MENU_ITEM(lookup_widget(app->popup_menu, + on_context_action1_activate(GTK_MENU_ITEM(lookup_widget(main_widgets.editor_menu, "context_action1")), NULL); break; case GEANY_KEYS_EDITOR_SUPPRESSSNIPPETCOMPLETION: @@ -1468,7 +1491,7 @@ static void cb_func_format_action(guint key_id) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
/* keybindings only valid when scintilla widget has focus */ if (! DOC_IDX_VALID(idx) || focusw != GTK_WIDGET(doc_list[idx].sci)) return; @@ -1522,12 +1545,12 @@ static void cb_func_select_action(guint key_id) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window)); static GtkWidget *scribble_widget = NULL;
/* special case for Select All in the scribble widget */ if (scribble_widget == NULL) /* lookup the scribble widget only once */ - scribble_widget = lookup_widget(app->window, "textview_scribble"); + scribble_widget = lookup_widget(main_widgets.window, "textview_scribble"); if (key_id == GEANY_KEYS_SELECT_ALL && focusw == scribble_widget) { g_signal_emit_by_name(scribble_widget, "select-all", TRUE); @@ -1565,7 +1588,7 @@ static void cb_func_insert_action(guint key_id) { gint idx = document_get_cur_idx(); - GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window)); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
/* keybindings only valid when scintilla widget has focus */ if (! DOC_IDX_VALID(idx) || focusw != GTK_WIDGET(doc_list[idx].sci)) return; @@ -1576,7 +1599,7 @@ editor_insert_alternative_whitespace(idx); break; case GEANY_KEYS_INSERT_DATE: - gtk_menu_item_activate(GTK_MENU_ITEM(lookup_widget(app->window, "insert_date_custom1"))); + gtk_menu_item_activate(GTK_MENU_ITEM(lookup_widget(main_widgets.window, "insert_date_custom1"))); break; } }
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/keyfile.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -144,11 +144,11 @@ gchar entry[14]; guint i = 0, j = 0, max;
- npage = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook)); + npage = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook)); g_key_file_set_integer(config, "files", "current_page", npage);
/* store the filenames to reopen them the next time */ - max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); + max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)); for (i = 0; i < max; i++) { idx = document_get_n_idx(i); @@ -339,7 +339,7 @@ GtkTextBuffer *buffer; GtkTextIter start, end;
- buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(lookup_widget(app->window, "textview_scribble"))); + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(lookup_widget(main_widgets.window, "textview_scribble"))); gtk_text_buffer_get_bounds(buffer, &start, &end); scribble_text = gtk_text_buffer_get_text(buffer, &start, &end, FALSE); g_key_file_set_string(config, PACKAGE, "scribble_text", scribble_text); @@ -349,16 +349,16 @@ if (prefs.save_winpos) { g_key_file_set_integer(config, PACKAGE, "treeview_position", - gtk_paned_get_position(GTK_PANED(lookup_widget(app->window, "hpaned1")))); + gtk_paned_get_position(GTK_PANED(lookup_widget(main_widgets.window, "hpaned1")))); g_key_file_set_integer(config, PACKAGE, "msgwindow_position", - gtk_paned_get_position(GTK_PANED(lookup_widget(app->window, "vpaned1")))); + gtk_paned_get_position(GTK_PANED(lookup_widget(main_widgets.window, "vpaned1")))); }
if (prefs.save_winpos) { - gtk_window_get_position(GTK_WINDOW(app->window), &ui_prefs.geometry[0], &ui_prefs.geometry[1]); - gtk_window_get_size(GTK_WINDOW(app->window), &ui_prefs.geometry[2], &ui_prefs.geometry[3]); - if (gdk_window_get_state(app->window->window) & GDK_WINDOW_STATE_MAXIMIZED) + gtk_window_get_position(GTK_WINDOW(main_widgets.window), &ui_prefs.geometry[0], &ui_prefs.geometry[1]); + gtk_window_get_size(GTK_WINDOW(main_widgets.window), &ui_prefs.geometry[2], &ui_prefs.geometry[3]); + if (gdk_window_get_state(main_widgets.window->window) & GDK_WINDOW_STATE_MAXIMIZED) ui_prefs.geometry[4] = 1; else ui_prefs.geometry[4] = 0; @@ -913,7 +913,7 @@ main_status.opening_session_files = FALSE; /** TODO if session_notebook_page is equal to the current notebook tab(the last opened) ** the notebook switch page callback isn't triggered and e.g. menu items are not updated */ - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), session_notebook_page); + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), session_notebook_page); } main_status.opening_session_files = FALSE; } @@ -926,7 +926,7 @@ if (scribble_text) { /* update the scribble widget, because now it's realized */ gtk_text_buffer_set_text( - gtk_text_view_get_buffer(GTK_TEXT_VIEW(lookup_widget(app->window, "textview_scribble"))), + gtk_text_view_get_buffer(GTK_TEXT_VIEW(lookup_widget(main_widgets.window, "textview_scribble"))), scribble_text, -1); } g_free(scribble_text); @@ -934,15 +934,15 @@ /* set the position of the hpaned and vpaned */ if (prefs.save_winpos) { - gtk_paned_set_position(GTK_PANED(lookup_widget(app->window, "hpaned1")), hpan_position); - gtk_paned_set_position(GTK_PANED(lookup_widget(app->window, "vpaned1")), vpan_position); + gtk_paned_set_position(GTK_PANED(lookup_widget(main_widgets.window, "hpaned1")), hpan_position); + gtk_paned_set_position(GTK_PANED(lookup_widget(main_widgets.window, "vpaned1")), vpan_position); }
/* set fullscreen after initial draw so that returning to normal view is the right size. * fullscreen mode is disabled by default, so act only if it is true */ if (ui_prefs.fullscreen) { - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_fullscreen1")), TRUE); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_fullscreen1")), TRUE); ui_prefs.fullscreen = TRUE; ui_set_fullscreen(); }
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/main.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -83,7 +83,8 @@ #endif
-GeanyApp *app; +GeanyApp *app; +gboolean ignore_callback; /* hack workaround for GTK+ toggle button callback problem */
GeanyStatus main_status; CommandLineOptions cl_options; /* fields initialised in parse_command_line_options */ @@ -171,23 +172,23 @@ /* toolbar, message window and sidebar are by default visible, so don't change it if it is true */ if (! toolbar_prefs.visible) { - app->ignore_callback = TRUE; - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_show_toolbar1")), FALSE); - gtk_widget_hide(app->toolbar); - app->ignore_callback = FALSE; + ignore_callback = TRUE; + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_show_toolbar1")), FALSE); + gtk_widget_hide(main_widgets.toolbar); + ignore_callback = FALSE; } if (! ui_prefs.msgwindow_visible) { - app->ignore_callback = TRUE; - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_show_messages_window1")), FALSE); - gtk_widget_hide(lookup_widget(app->window, "scrolledwindow1")); - app->ignore_callback = FALSE; + ignore_callback = TRUE; + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_show_messages_window1")), FALSE); + gtk_widget_hide(lookup_widget(main_widgets.window, "scrolledwindow1")); + ignore_callback = FALSE; } if (! ui_prefs.sidebar_visible) { - app->ignore_callback = TRUE; - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_show_sidebar1")), FALSE); - app->ignore_callback = FALSE; + ignore_callback = TRUE; + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_show_sidebar1")), FALSE); + ignore_callback = FALSE; } ui_sidebar_show_hide(); /* sets the icon style of the toolbar */ @@ -195,88 +196,88 @@ { case GTK_TOOLBAR_BOTH: { - /*gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "images_and_text1")), TRUE);*/ + /*gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "images_and_text1")), TRUE);*/ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(ui_widgets.toolbar_menu, "images_and_text2")), TRUE); break; } case GTK_TOOLBAR_ICONS: { - /*gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "images_only1")), TRUE);*/ + /*gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "images_only1")), TRUE);*/ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(ui_widgets.toolbar_menu, "images_only2")), TRUE); break; } case GTK_TOOLBAR_TEXT: { - /*gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "text_only1")), TRUE);*/ + /*gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "text_only1")), TRUE);*/ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(ui_widgets.toolbar_menu, "text_only2")), TRUE); break; } } - gtk_toolbar_set_style(GTK_TOOLBAR(app->toolbar), toolbar_prefs.icon_style); + gtk_toolbar_set_style(GTK_TOOLBAR(main_widgets.toolbar), toolbar_prefs.icon_style);
/* sets the icon size of the toolbar, use user preferences (.gtkrc) if not set */ if (toolbar_prefs.icon_size == GTK_ICON_SIZE_SMALL_TOOLBAR || toolbar_prefs.icon_size == GTK_ICON_SIZE_LARGE_TOOLBAR) { - gtk_toolbar_set_icon_size(GTK_TOOLBAR(app->toolbar), toolbar_prefs.icon_size); + gtk_toolbar_set_icon_size(GTK_TOOLBAR(main_widgets.toolbar), toolbar_prefs.icon_size); } ui_update_toolbar_icons(toolbar_prefs.icon_size);
/* line number and markers margin are by default enabled */ if (! editor_prefs.show_markers_margin) { - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_markers_margin1")), FALSE); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_markers_margin1")), FALSE); editor_prefs.show_markers_margin = FALSE; } if (! editor_prefs.show_linenumber_margin) { - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_linenumber_margin1")), FALSE); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_linenumber_margin1")), FALSE); editor_prefs.show_linenumber_margin = FALSE; }
/* interprets the saved window geometry */ if (prefs.save_winpos && ui_prefs.geometry[0] != -1) { - gtk_window_move(GTK_WINDOW(app->window), ui_prefs.geometry[0], ui_prefs.geometry[1]); - gtk_window_set_default_size(GTK_WINDOW(app->window), ui_prefs.geometry[2], ui_prefs.geometry[3]); + gtk_window_move(GTK_WINDOW(main_widgets.window), ui_prefs.geometry[0], ui_prefs.geometry[1]); + gtk_window_set_default_size(GTK_WINDOW(main_widgets.window), ui_prefs.geometry[2], ui_prefs.geometry[3]); if (ui_prefs.geometry[4] == 1) - gtk_window_maximize(GTK_WINDOW(app->window)); + gtk_window_maximize(GTK_WINDOW(main_widgets.window)); }
/* hide statusbar if desired */ if (! interface_prefs.statusbar_visible) { - gtk_widget_hide(app->statusbar); + gtk_widget_hide(ui_widgets.statusbar); }
- app->ignore_callback = TRUE; + ignore_callback = TRUE; gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM( - lookup_widget(app->window, "menu_line_wrapping1")), editor_prefs.line_wrapping); + lookup_widget(main_widgets.window, "menu_line_wrapping1")), editor_prefs.line_wrapping); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM( - lookup_widget(app->window, "menu_use_auto_indentation1")), + lookup_widget(main_widgets.window, "menu_use_auto_indentation1")), (editor_prefs.indent_mode != INDENT_NONE)); - app->ignore_callback = FALSE; + ignore_callback = FALSE;
/* connect the toolbar dropdown menu for the new button */ gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON( - lookup_widget(app->window, "menutoolbutton1")), ui_widgets.new_file_menu); + lookup_widget(main_widgets.window, "menutoolbutton1")), ui_widgets.new_file_menu);
/* set the tab placements of the notebooks */ - gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->notebook), interface_prefs.tab_pos_editor); + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(main_widgets.notebook), interface_prefs.tab_pos_editor); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(msgwindow.notebook), interface_prefs.tab_pos_msgwin); - gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->treeview_notebook), interface_prefs.tab_pos_sidebar); + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(main_widgets.sidebar_notebook), interface_prefs.tab_pos_sidebar);
ui_update_toolbar_items();
/* whether to show notebook tabs or not */ - gtk_notebook_set_show_tabs(GTK_NOTEBOOK(app->notebook), interface_prefs.show_notebook_tabs); + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(main_widgets.notebook), interface_prefs.show_notebook_tabs); }
static void main_init(void) { /* inits */ - app->window = NULL; + main_widgets.window = NULL; app->project = NULL; ui_widgets.open_fontsel = NULL; ui_widgets.open_colorsel = NULL; @@ -287,55 +288,57 @@ main_status.main_window_realized= FALSE; file_prefs.tab_order_ltr = FALSE; main_status.quitting = FALSE; - app->ignore_callback = FALSE; + ignore_callback = FALSE; app->tm_workspace = tm_get_workspace(); ui_prefs.recent_queue = g_queue_new(); main_status.opening_session_files = FALSE;
- app->window = create_window1(); + main_widgets.window = create_window1(); ui_widgets.new_file_menu = gtk_menu_new(); ui_widgets.recent_files_toolbar = gtk_menu_new(); - ui_widgets.recent_files_menuitem = lookup_widget(app->window, "recent_files1"); + ui_widgets.recent_files_menuitem = lookup_widget(main_widgets.window, "recent_files1"); ui_widgets.recent_files_menubar = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(ui_widgets.recent_files_menuitem), ui_widgets.recent_files_menubar);
/* store important pointers for later reference */ - app->toolbar = lookup_widget(app->window, "toolbar1"); - app->treeview_notebook = lookup_widget(app->window, "notebook3"); - app->notebook = lookup_widget(app->window, "notebook1"); - app->statusbar = lookup_widget(app->window, "statusbar"); - app->popup_menu = create_edit_menu1(); + main_widgets.toolbar = lookup_widget(main_widgets.window, "toolbar1"); + main_widgets.sidebar_notebook = lookup_widget(main_widgets.window, "notebook3"); + main_widgets.notebook = lookup_widget(main_widgets.window, "notebook1"); + main_widgets.editor_menu = create_edit_menu1(); + main_widgets.tools_menu = lookup_widget(main_widgets.window, "tools1_menu"); + + ui_widgets.statusbar = lookup_widget(main_widgets.window, "statusbar"); ui_widgets.toolbar_menu = create_toolbar_popup_menu1(); - ui_widgets.print_page_setup = lookup_widget(app->window, "page_setup1"); - ui_widgets.popup_goto_items[0] = lookup_widget(app->popup_menu, "goto_tag_definition1"); - ui_widgets.popup_goto_items[1] = lookup_widget(app->popup_menu, "goto_tag_declaration1"); - ui_widgets.popup_goto_items[2] = lookup_widget(app->popup_menu, "find_usage1"); - ui_widgets.popup_copy_items[0] = lookup_widget(app->popup_menu, "cut1"); - ui_widgets.popup_copy_items[1] = lookup_widget(app->popup_menu, "copy1"); - ui_widgets.popup_copy_items[2] = lookup_widget(app->popup_menu, "delete1"); - ui_widgets.menu_copy_items[0] = lookup_widget(app->window, "menu_cut1"); - ui_widgets.menu_copy_items[1] = lookup_widget(app->window, "menu_copy1"); - ui_widgets.menu_copy_items[2] = lookup_widget(app->window, "menu_delete1"); - ui_widgets.menu_insert_include_items[0] = lookup_widget(app->popup_menu, "insert_include1"); - ui_widgets.menu_insert_include_items[1] = lookup_widget(app->window, "insert_include2"); - ui_widgets.save_buttons[0] = lookup_widget(app->window, "menu_save1"); - ui_widgets.save_buttons[1] = lookup_widget(app->window, "toolbutton10"); - ui_widgets.save_buttons[2] = lookup_widget(app->window, "menu_save_all1"); - ui_widgets.save_buttons[3] = lookup_widget(app->window, "toolbutton22"); - ui_widgets.redo_items[0] = lookup_widget(app->popup_menu, "redo1"); - ui_widgets.redo_items[1] = lookup_widget(app->window, "menu_redo2"); - ui_widgets.redo_items[2] = lookup_widget(app->window, "toolbutton_redo"); - ui_widgets.undo_items[0] = lookup_widget(app->popup_menu, "undo1"); - ui_widgets.undo_items[1] = lookup_widget(app->window, "menu_undo2"); - ui_widgets.undo_items[2] = lookup_widget(app->window, "toolbutton_undo"); + ui_widgets.print_page_setup = lookup_widget(main_widgets.window, "page_setup1"); + ui_widgets.popup_goto_items[0] = lookup_widget(main_widgets.editor_menu, "goto_tag_definition1"); + ui_widgets.popup_goto_items[1] = lookup_widget(main_widgets.editor_menu, "goto_tag_declaration1"); + ui_widgets.popup_goto_items[2] = lookup_widget(main_widgets.editor_menu, "find_usage1"); + ui_widgets.popup_copy_items[0] = lookup_widget(main_widgets.editor_menu, "cut1"); + ui_widgets.popup_copy_items[1] = lookup_widget(main_widgets.editor_menu, "copy1"); + ui_widgets.popup_copy_items[2] = lookup_widget(main_widgets.editor_menu, "delete1"); + ui_widgets.menu_copy_items[0] = lookup_widget(main_widgets.window, "menu_cut1"); + ui_widgets.menu_copy_items[1] = lookup_widget(main_widgets.window, "menu_copy1"); + ui_widgets.menu_copy_items[2] = lookup_widget(main_widgets.window, "menu_delete1"); + ui_widgets.menu_insert_include_items[0] = lookup_widget(main_widgets.editor_menu, "insert_include1"); + ui_widgets.menu_insert_include_items[1] = lookup_widget(main_widgets.window, "insert_include2"); + ui_widgets.save_buttons[0] = lookup_widget(main_widgets.window, "menu_save1"); + ui_widgets.save_buttons[1] = lookup_widget(main_widgets.window, "toolbutton10"); + ui_widgets.save_buttons[2] = lookup_widget(main_widgets.window, "menu_save_all1"); + ui_widgets.save_buttons[3] = lookup_widget(main_widgets.window, "toolbutton22"); + ui_widgets.redo_items[0] = lookup_widget(main_widgets.editor_menu, "redo1"); + ui_widgets.redo_items[1] = lookup_widget(main_widgets.window, "menu_redo2"); + ui_widgets.redo_items[2] = lookup_widget(main_widgets.window, "toolbutton_redo"); + ui_widgets.undo_items[0] = lookup_widget(main_widgets.editor_menu, "undo1"); + ui_widgets.undo_items[1] = lookup_widget(main_widgets.window, "menu_undo2"); + ui_widgets.undo_items[2] = lookup_widget(main_widgets.window, "toolbutton_undo");
ui_init();
/* set widget names for matching with .gtkrc-2.0 */ - gtk_widget_set_name(app->window, "GeanyMainWindow"); + gtk_widget_set_name(main_widgets.window, "GeanyMainWindow"); gtk_widget_set_name(ui_widgets.toolbar_menu, "GeanyToolbarMenu"); - gtk_widget_set_name(app->popup_menu, "GeanyEditMenu"); + gtk_widget_set_name(main_widgets.editor_menu, "GeanyEditMenu");
#if ! GTK_CHECK_VERSION(2, 10, 0) /* hide Page setup menu item, it isn't supported with non-GTK printing */ @@ -814,8 +817,8 @@
/* inits */ main_init(); - gtk_widget_set_size_request(app->window, GEANY_WINDOW_MINIMAL_WIDTH, GEANY_WINDOW_MINIMAL_HEIGHT); - gtk_window_set_default_size(GTK_WINDOW(app->window), GEANY_WINDOW_DEFAULT_WIDTH, GEANY_WINDOW_DEFAULT_HEIGHT); + gtk_widget_set_size_request(main_widgets.window, GEANY_WINDOW_MINIMAL_WIDTH, GEANY_WINDOW_MINIMAL_HEIGHT); + gtk_window_set_default_size(GTK_WINDOW(main_widgets.window), GEANY_WINDOW_DEFAULT_WIDTH, GEANY_WINDOW_DEFAULT_HEIGHT); encodings_init();
load_settings(); @@ -841,19 +844,19 @@ GdkPixbuf *pb;
pb = ui_new_pixbuf_from_inline(GEANY_IMAGE_LOGO, FALSE); - gtk_window_set_icon(GTK_WINDOW(app->window), pb); + gtk_window_set_icon(GTK_WINDOW(main_widgets.window), pb); g_object_unref(pb); /* free our reference */ }
/* registering some basic events */ - g_signal_connect(G_OBJECT(app->window), "delete_event", G_CALLBACK(on_exit_clicked), NULL); - g_signal_connect(G_OBJECT(app->window), "key-press-event", G_CALLBACK(keybindings_got_event), NULL); - g_signal_connect(G_OBJECT(app->toolbar), "button-press-event", G_CALLBACK(toolbar_popup_menu), NULL); - g_signal_connect(G_OBJECT(lookup_widget(app->window, "textview_scribble")), + g_signal_connect(G_OBJECT(main_widgets.window), "delete_event", G_CALLBACK(on_exit_clicked), NULL); + g_signal_connect(G_OBJECT(main_widgets.window), "key-press-event", G_CALLBACK(keybindings_got_event), NULL); + g_signal_connect(G_OBJECT(main_widgets.toolbar), "button-press-event", G_CALLBACK(toolbar_popup_menu), NULL); + g_signal_connect(G_OBJECT(lookup_widget(main_widgets.window, "textview_scribble")), "motion-notify-event", G_CALLBACK(on_motion_event), NULL); - g_signal_connect(G_OBJECT(lookup_widget(app->window, "entry1")), + g_signal_connect(G_OBJECT(lookup_widget(main_widgets.window, "entry1")), "motion-notify-event", G_CALLBACK(on_motion_event), NULL); - g_signal_connect(G_OBJECT(lookup_widget(app->window, "entry_goto_line")), + g_signal_connect(G_OBJECT(lookup_widget(main_widgets.window, "entry_goto_line")), "motion-notify-event", G_CALLBACK(on_motion_event), NULL);
#ifdef HAVE_VTE @@ -894,7 +897,7 @@ /* load session files into tabs, as they are found in the session_files variable */ configuration_open_files();
- if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) == 0) + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) == 0) { ui_update_popup_copy_items(-1); ui_update_popup_reundo_items(-1); @@ -916,7 +919,7 @@ treeviews_update_tag_list(idx, FALSE);
/* finally realize the window to show the user what we have done */ - gtk_widget_show(app->window); + gtk_widget_show(main_widgets.window); main_status.main_window_realized = TRUE;
configuration_apply_settings(); @@ -927,7 +930,7 @@ { socket_info.read_ioc = g_io_channel_unix_new(socket_info.lock_socket); socket_info.lock_socket_tag = g_io_add_watch(socket_info.read_ioc, - G_IO_IN|G_IO_PRI|G_IO_ERR, socket_lock_input_cb, app->window); + G_IO_IN|G_IO_PRI|G_IO_ERR, socket_lock_input_cb, main_widgets.window); } #endif
@@ -1008,11 +1011,11 @@ g_free(vte_info.lib_vte); g_free(vte_info.dir); #endif - gtk_widget_destroy(app->window); + gtk_widget_destroy(main_widgets.window);
/* destroy popup menus */ - if (app->popup_menu && GTK_IS_WIDGET(app->popup_menu)) - gtk_widget_destroy(app->popup_menu); + if (main_widgets.editor_menu && GTK_IS_WIDGET(main_widgets.editor_menu)) + gtk_widget_destroy(main_widgets.editor_menu); if (ui_widgets.toolbar_menu && GTK_IS_WIDGET(ui_widgets.toolbar_menu)) gtk_widget_destroy(ui_widgets.toolbar_menu); if (tv.popup_taglist && GTK_IS_WIDGET(tv.popup_taglist))
Modified: trunk/src/msgwindow.c =================================================================== --- trunk/src/msgwindow.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/msgwindow.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -75,13 +75,13 @@
void msgwin_init() { - msgwindow.notebook = lookup_widget(app->window, "notebook_info"); - msgwindow.tree_status = lookup_widget(app->window, "treeview3"); - msgwindow.tree_msg = lookup_widget(app->window, "treeview4"); - msgwindow.tree_compiler = lookup_widget(app->window, "treeview5"); + msgwindow.notebook = lookup_widget(main_widgets.window, "notebook_info"); + msgwindow.tree_status = lookup_widget(main_widgets.window, "treeview3"); + msgwindow.tree_msg = lookup_widget(main_widgets.window, "treeview4"); + msgwindow.tree_compiler = lookup_widget(main_widgets.window, "treeview5"); msgwindow.find_in_files_dir = NULL;
- gtk_widget_set_sensitive(lookup_widget(app->window, "next_message1"), FALSE); + gtk_widget_set_sensitive(lookup_widget(main_widgets.window, "next_message1"), FALSE);
prepare_status_tree_view(); prepare_msg_tree_view(); @@ -90,7 +90,7 @@ msgwindow.popup_msg_menu = create_message_popup_menu(MSG_MESSAGE); msgwindow.popup_compiler_menu = create_message_popup_menu(MSG_COMPILER);
- g_signal_connect(G_OBJECT(lookup_widget(app->window, "textview_scribble")), + g_signal_connect(G_OBJECT(lookup_widget(main_widgets.window, "textview_scribble")), "populate-popup", G_CALLBACK(on_scribble_populate), NULL); }
@@ -258,12 +258,12 @@ void msgwin_show_hide(gboolean show) { ui_prefs.msgwindow_visible = show; - app->ignore_callback = TRUE; + ignore_callback = TRUE; gtk_check_menu_item_set_active( - GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_show_messages_window1")), + GTK_CHECK_MENU_ITEM(lookup_widget(main_widgets.window, "menu_show_messages_window1")), show); - app->ignore_callback = FALSE; - ui_widget_show_hide(lookup_widget(app->window, "scrolledwindow1"), show); + ignore_callback = FALSE; + ui_widget_show_hide(lookup_widget(main_widgets.window, "scrolledwindow1"), show); }
@@ -311,7 +311,7 @@ gtk_list_store_append(msgwindow.store_msg, &iter); gtk_list_store_set(msgwindow.store_msg, &iter, 0, line, 1, idx, 2, color, 3, tmp, -1);
- gtk_widget_set_sensitive(lookup_widget(app->window, "next_message1"), TRUE); + gtk_widget_set_sensitive(lookup_widget(main_widgets.window, "next_message1"), TRUE);
g_free(tmp); } @@ -919,7 +919,7 @@
switch (tabnum) { - case MSG_SCRATCH: widget = lookup_widget(app->window, "textview_scribble"); break; + case MSG_SCRATCH: widget = lookup_widget(main_widgets.window, "textview_scribble"); break; #ifdef HAVE_VTE case MSG_VTE: widget = (vte_info.have_vte) ? vc->vte : NULL; break; #endif @@ -948,7 +948,7 @@ switch (tabnum) { case MSG_MESSAGE: - gtk_widget_set_sensitive(lookup_widget(app->window, "next_message1"), FALSE); + gtk_widget_set_sensitive(lookup_widget(main_widgets.window, "next_message1"), FALSE); store = msgwindow.store_msg; break;
Modified: trunk/src/navqueue.c =================================================================== --- trunk/src/navqueue.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/navqueue.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -33,6 +33,8 @@ #include "document.h" #include "utils.h" #include "support.h" +#include "ui_utils.h" +#include "editor.h"
/* for the navigation history queue */ @@ -54,8 +56,8 @@ navigation_queue = g_queue_new(); nav_queue_pos = 0;
- navigation_buttons[0] = lookup_widget(app->window, "toolbutton_back"); - navigation_buttons[1] = lookup_widget(app->window, "toolbutton_forward"); + navigation_buttons[0] = lookup_widget(main_widgets.window, "toolbutton_back"); + navigation_buttons[1] = lookup_widget(main_widgets.window, "toolbutton_forward"); }
@@ -165,10 +167,20 @@ add_new_position(doc_list[new_idx].file_name, pos); }
- return utils_goto_pos(new_idx, pos); + return editor_goto_pos(new_idx, pos, TRUE); }
+static gboolean goto_file_pos(const gchar *file, gboolean is_tm_filename, gint pos) +{ + gint file_idx = document_find_by_filename(file, is_tm_filename); + + if (file_idx < 0) return FALSE; + + return editor_goto_pos(file_idx, pos, TRUE); +} + + void navqueue_go_back() { filepos *fprev; @@ -180,7 +192,7 @@
/* jump back */ fprev = g_queue_peek_nth(navigation_queue, nav_queue_pos + 1); - if (utils_goto_file_pos(fprev->file, FALSE, fprev->pos)) + if (goto_file_pos(fprev->file, FALSE, fprev->pos)) { nav_queue_pos++; } @@ -203,7 +215,7 @@
/* jump forward */ fnext = g_queue_peek_nth(navigation_queue, nav_queue_pos - 1); - if (utils_goto_file_pos(fnext->file, FALSE, fnext->pos)) + if (goto_file_pos(fnext->file, FALSE, fnext->pos)) { nav_queue_pos--; }
Modified: trunk/src/notebook.c =================================================================== --- trunk/src/notebook.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/notebook.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -89,10 +89,10 @@ void notebook_init() { /* focus the current document after clicking on a tab */ - g_signal_connect_after(G_OBJECT(app->notebook), "button-release-event", + g_signal_connect_after(G_OBJECT(main_widgets.notebook), "button-release-event", G_CALLBACK(focus_sci), NULL);
- g_signal_connect(G_OBJECT(app->notebook), "drag-data-received", + g_signal_connect(G_OBJECT(main_widgets.notebook), "drag-data-received", G_CALLBACK(on_window_drag_data_received), NULL);
setup_tab_dnd(); @@ -101,7 +101,7 @@
static void setup_tab_dnd() { - GtkWidget *notebook = app->notebook; + GtkWidget *notebook = main_widgets.notebook;
/* Due to a segfault with manual tab DnD setup on GTK 2.10, we must * use the built in gtk_notebook_set_tab_reorderable from GTK 2.10. @@ -157,8 +157,8 @@ gpointer user_data) { static gboolean drag_enabled = TRUE; /* stores current state */ - GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(app->notebook), - gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook))); + GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(main_widgets.notebook), + gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook)));
if (page == NULL || event->x < 0 || event->y < 0) return FALSE;
@@ -278,14 +278,14 @@ }
-/* call this after the number of tabs in app->notebook changes. */ +/* call this after the number of tabs in main_widgets.notebook changes. */ static void tab_count_changed(void) { - switch (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook))) + switch (gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook))) { case 0: /* Enables DnD for dropping files into the empty notebook widget */ - gtk_drag_dest_set(app->notebook, GTK_DEST_DEFAULT_ALL, + gtk_drag_dest_set(main_widgets.notebook, GTK_DEST_DEFAULT_ALL, files_drop_targets, G_N_ELEMENTS(files_drop_targets), GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK); break; @@ -294,7 +294,7 @@ /* Disables DnD for dropping files into the notebook widget and enables the DnD for moving file * tabs. Files can still be dropped into the notebook widget because it will be handled by the * active Scintilla Widget (only dropping to the tab bar is not possible but it should be ok) */ - gtk_drag_dest_set(app->notebook, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, + gtk_drag_dest_set(main_widgets.notebook, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, drag_targets, G_N_ELEMENTS(drag_targets), GDK_ACTION_MOVE); break; } @@ -307,7 +307,7 @@ on_menu_toggle_all_additional_widgets1_activate(NULL, NULL); /* close tab on middle click */ if (event->button == 2) - document_remove(gtk_notebook_page_num(GTK_NOTEBOOK(app->notebook), GTK_WIDGET(user_data))); + document_remove(gtk_notebook_page_num(GTK_NOTEBOOK(main_widgets.notebook), GTK_WIDGET(user_data)));
return FALSE; } @@ -376,10 +376,10 @@ gtk_misc_set_alignment(GTK_MISC(this->tabmenu_label), 0.0, 0);
if (file_prefs.tab_order_ltr) - tabnum = gtk_notebook_append_page_menu(GTK_NOTEBOOK(app->notebook), page, + tabnum = gtk_notebook_append_page_menu(GTK_NOTEBOOK(main_widgets.notebook), page, hbox, this->tabmenu_label); else - tabnum = gtk_notebook_insert_page_menu(GTK_NOTEBOOK(app->notebook), page, + tabnum = gtk_notebook_insert_page_menu(GTK_NOTEBOOK(main_widgets.notebook), page, hbox, this->tabmenu_label, 0);
tab_count_changed(); @@ -388,7 +388,7 @@ #if GTK_CHECK_VERSION(2, 10, 0) if (gtk_check_version(2, 10, 0) == NULL) /* null means version ok */ { - gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(app->notebook), page, TRUE); + gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(main_widgets.notebook), page, TRUE); } #endif g_free(title); @@ -399,7 +399,7 @@ static void notebook_tab_close_clicked_cb(GtkButton *button, gpointer user_data) { - gint cur_page = gtk_notebook_page_num(GTK_NOTEBOOK(app->notebook), + gint cur_page = gtk_notebook_page_num(GTK_NOTEBOOK(main_widgets.notebook), GTK_WIDGET(user_data)); document_remove(cur_page); } @@ -408,16 +408,16 @@ /* Always use this instead of gtk_notebook_remove_page(). */ void notebook_remove_page(gint page_num) { - gint curpage = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook)); + gint curpage = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook));
/* Focus the next page, not the previous */ if (curpage == page_num && file_prefs.tab_order_ltr) { - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), curpage + 1); + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), curpage + 1); }
/* now remove the page (so we don't temporarily switch to the previous page) */ - gtk_notebook_remove_page(GTK_NOTEBOOK(app->notebook), page_num); + gtk_notebook_remove_page(GTK_NOTEBOOK(main_widgets.notebook), page_num);
tab_count_changed(); }
Modified: trunk/src/plugindata.h =================================================================== --- trunk/src/plugindata.h 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/plugindata.h 2008-05-22 14:41:28 UTC (rev 2609) @@ -35,12 +35,12 @@
/* The API version should be incremented whenever any plugin data types below are * modified or appended to. */ -static const gint api_version = 60; +static const gint api_version = 61;
/* The ABI version should be incremented whenever existing fields in the plugin * data types below have to be changed or reordered. It should stay the same if fields * are only appended, as this doesn't affect existing fields. */ -static const gint abi_version = 30; +static const gint abi_version = 31;
/** Check the plugin can be loaded by Geany. * This performs runtime checks that try to ensure: @@ -153,8 +153,8 @@ * Core variable pointers can be appended when needed by plugin authors, if appropriate. */ typedef struct GeanyData { - GeanyApp *app; /**< Geany application data fields */ - GtkWidget *tools_menu; /**< Most plugins should add menu items to the Tools menu only */ + struct GeanyApp *app; /**< Geany application data fields */ + struct GeanyMainWidgets *main_widgets; /**< Important widgets in the main window. */ GArray *doc_array; /**< Dynamic array of document structs */ GPtrArray *filetypes_array; /**< Dynamic array of filetype pointers */ struct GeanyPrefs *prefs; /**< General settings */
Modified: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/plugins.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -88,7 +88,7 @@ static gchar **active_plugins_pref = NULL; /* list of plugin filenames to load at startup */ static GList *failed_plugins_list = NULL; /* plugins the user wants active but can't be used */
-static GtkWidget *separator = NULL; +static GtkWidget *menu_separator = NULL;
static void pm_show_dialog(GtkMenuItem *menuitem, gpointer user_data);
@@ -271,7 +271,7 @@ { GeanyData gd = { app, - lookup_widget(app->window, "tools1_menu"), + &main_widgets, doc_array, filetypes_array, &prefs, @@ -435,7 +435,7 @@
if (plugin->fields.flags & PLUGIN_IS_DOCUMENT_SENSITIVE) { - gboolean enable = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) ? TRUE : FALSE; + gboolean enable = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) ? TRUE : FALSE; gtk_widget_set_sensitive(plugin->fields.menu_item, enable); }
@@ -705,15 +705,15 @@
widget = gtk_separator_menu_item_new(); gtk_widget_show(widget); - gtk_container_add(GTK_CONTAINER(geany_data.tools_menu), widget); + gtk_container_add(GTK_CONTAINER(main_widgets.tools_menu), widget);
widget = gtk_menu_item_new_with_mnemonic(_("_Plugin Manager")); - gtk_container_add(GTK_CONTAINER (geany_data.tools_menu), widget); + gtk_container_add(GTK_CONTAINER(main_widgets.tools_menu), widget); gtk_widget_show(widget); g_signal_connect((gpointer) widget, "activate", G_CALLBACK(pm_show_dialog), NULL);
- separator = gtk_separator_menu_item_new(); - gtk_container_add(GTK_CONTAINER(geany_data.tools_menu), separator); + menu_separator = gtk_separator_menu_item_new(); + gtk_container_add(GTK_CONTAINER(main_widgets.tools_menu), menu_separator);
load_active_plugins();
@@ -826,11 +826,11 @@ { gboolean found;
- if (separator == NULL) + if (menu_separator == NULL) return;
found = (g_list_find_custom(active_plugin_list, NULL, (GCompareFunc) plugin_has_menu) != NULL); - ui_widget_show_hide(separator, found); + ui_widget_show_hide(menu_separator, found); }
@@ -1029,7 +1029,7 @@ /* before showing the dialog, we need to create the list of available plugins */ load_all_plugins();
- pm_widgets.dialog = gtk_dialog_new_with_buttons(_("Plugins"), GTK_WINDOW(app->window), + pm_widgets.dialog = gtk_dialog_new_with_buttons(_("Plugins"), GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK_RESPONSE_CANCEL, NULL); vbox = ui_dialog_vbox_new(GTK_DIALOG(pm_widgets.dialog));
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/prefs.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -965,13 +965,13 @@ treeviews_openfiles_update_all(); /* to update if full path setting has changed */ ui_update_toolbar_items(); ui_update_toolbar_icons(toolbar_prefs.icon_size); - gtk_toolbar_set_style(GTK_TOOLBAR(app->toolbar), toolbar_prefs.icon_style); + gtk_toolbar_set_style(GTK_TOOLBAR(main_widgets.toolbar), toolbar_prefs.icon_style); ui_sidebar_show_hide(); - gtk_notebook_set_show_tabs(GTK_NOTEBOOK(app->notebook), interface_prefs.show_notebook_tabs); + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(main_widgets.notebook), interface_prefs.show_notebook_tabs);
- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->notebook), interface_prefs.tab_pos_editor); + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(main_widgets.notebook), interface_prefs.tab_pos_editor); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(msgwindow.notebook), interface_prefs.tab_pos_msgwin); - gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->treeview_notebook), interface_prefs.tab_pos_sidebar); + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(main_widgets.sidebar_notebook), interface_prefs.tab_pos_sidebar);
/* re-colourise all open documents, if tab width or long line settings have changed */ for (i = 0; i < doc_array->len; i++) @@ -1049,7 +1049,7 @@ } if (GTK_IS_WIDGET(tv.default_tag_tree)) ui_widget_modify_font_from_string(tv.default_tag_tree, interface_prefs.tagbar_font); - ui_widget_modify_font_from_string(lookup_widget(app->window, "entry1"), + ui_widget_modify_font_from_string(lookup_widget(main_widgets.window, "entry1"), interface_prefs.tagbar_font); break; } @@ -1310,7 +1310,7 @@ if (kb->key == key && kb->mods == mods && ! (kb->key == search_kb->key && kb->mods == search_kb->mods)) { - if (dialogs_show_question_full(app->window, _("_Override"), GTK_STOCK_CANCEL, + if (dialogs_show_question_full(main_widgets.window, _("_Override"), GTK_STOCK_CANCEL, _("Override that keybinding?"), _("The combination '%s' is already used for "%s"."), action, kb->label)) @@ -1401,7 +1401,7 @@
ui_widgets.prefs_dialog = create_prefs_dialog(); gtk_widget_set_name(ui_widgets.prefs_dialog, "GeanyPrefsDialog"); - gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.prefs_dialog), GTK_WINDOW(app->window)); + gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.prefs_dialog), GTK_WINDOW(main_widgets.window));
/* init the default file encoding combo box */ combo_new = lookup_widget(ui_widgets.prefs_dialog, "combo_new_encoding");
Modified: trunk/src/printing.c =================================================================== --- trunk/src/printing.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/printing.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -777,7 +777,7 @@ gtk_print_operation_set_default_page_setup(op, page_setup);
res = gtk_print_operation_run( - op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW(app->window), &error); + op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW(main_widgets.window), &error);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY) { @@ -807,7 +807,7 @@ settings = gtk_print_settings_new();
new_page_setup = gtk_print_run_page_setup_dialog( - GTK_WINDOW(app->window), page_setup, settings); + GTK_WINDOW(main_widgets.window), page_setup, settings);
if (page_setup != NULL) g_object_unref(page_setup);
Modified: trunk/src/project.c =================================================================== --- trunk/src/project.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/project.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -97,7 +97,7 @@ GtkWidget *button; GtkWidget *bbox; GtkWidget *label; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips")); PropertyDialogElements *e; gint response;
@@ -106,7 +106,7 @@ g_return_if_fail(app->project == NULL);
e = g_new0(PropertyDialogElements, 1); - e->dialog = gtk_dialog_new_with_buttons(_("New Project"), GTK_WINDOW(app->window), + e->dialog = gtk_dialog_new_with_buttons(_("New Project"), GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
@@ -236,7 +236,7 @@ if (! close_open_project()) return;
#ifdef G_OS_WIN32 - file = win32_show_project_open_dialog(app->window, _("Open Project"), dir, FALSE, TRUE); + file = win32_show_project_open_dialog(main_widgets.window, _("Open Project"), dir, FALSE, TRUE); if (file != NULL) { /* try to load the config */ @@ -254,7 +254,7 @@ } #else
- dialog = gtk_file_chooser_dialog_new(_("Open Project"), GTK_WINDOW(app->window), + dialog = gtk_file_chooser_dialog_new(_("Open Project"), GTK_WINDOW(main_widgets.window), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); @@ -265,7 +265,7 @@ gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), TRUE); gtk_window_set_type_hint(GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(app->window)); + gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_widgets.window)); gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE);
/* add FileFilters */ @@ -353,9 +353,9 @@ GtkWidget *bbox; GtkWidget *label; GtkWidget *swin; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips"));
- e->dialog = gtk_dialog_new_with_buttons(_("Project Properties"), GTK_WINDOW(app->window), + e->dialog = gtk_dialog_new_with_buttons(_("Project Properties"), GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); gtk_dialog_add_buttons(GTK_DIALOG(e->dialog), GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
Modified: trunk/src/sciwrappers.c =================================================================== --- trunk/src/sciwrappers.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/sciwrappers.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -710,9 +710,9 @@ }
-void sci_goto_line(ScintillaObject *sci, gint line, gboolean ensure_visibility) +void sci_goto_line(ScintillaObject *sci, gint line, gboolean unfold) { - if (ensure_visibility) SSM(sci,SCI_ENSUREVISIBLE,line,0); + if (unfold) SSM(sci, SCI_ENSUREVISIBLE, line, 0); SSM(sci, SCI_GOTOLINE, line, 0); }
Modified: trunk/src/sciwrappers.h =================================================================== --- trunk/src/sciwrappers.h 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/sciwrappers.h 2008-05-22 14:41:28 UTC (rev 2609) @@ -129,7 +129,7 @@ gint sci_search_prev (ScintillaObject * sci, gint flags, const gchar *text); gint sci_find_text (ScintillaObject * sci, gint flags, struct TextToFind *ttf); void sci_set_font (ScintillaObject * sci, gint style, const gchar* font, gint size); -void sci_goto_line (ScintillaObject * sci, gint line, gboolean ensure_visibility); +void sci_goto_line (ScintillaObject * sci, gint line, gboolean unfold); void sci_marker_delete_all (ScintillaObject * sci, gint marker); gint sci_get_style_at (ScintillaObject * sci, gint position); void sci_set_symbol_margin (ScintillaObject * sci, gboolean set);
Modified: trunk/src/search.c =================================================================== --- trunk/src/search.c 2008-05-21 17:41:11 UTC (rev 2608) +++ trunk/src/search.c 2008-05-22 14:41:28 UTC (rev 2609) @@ -134,7 +134,7 @@ { GtkWidget *checkbox1, *checkbox2, *check_regexp, *check_back, *checkbox5, *checkbox7, *hbox, *fbox, *mbox; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips"));
check_regexp = gtk_check_button_new_with_mnemonic(_("_Use regular expressions")); g_object_set_data_full(G_OBJECT(dialog), "check_regexp", @@ -297,12 +297,12 @@ { GtkWidget *label, *entry, *sbox, *vbox; GtkWidget *exp, *bbox, *button, *check_close; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips"));
load_monospace_style();
widgets.find_dialog = gtk_dialog_new_with_buttons(_("Find"), - GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL); vbox = ui_dialog_vbox_new(GTK_DIALOG(widgets.find_dialog)); gtk_widget_set_name(widgets.find_dialog, "GeanyDialogSearch"); @@ -419,12 +419,12 @@ GtkWidget *label_find, *label_replace, *entry_find, *entry_replace, *check_close, *button, *rbox, *fbox, *vbox, *exp, *bbox; GtkSizeGroup *label_size; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips"));
load_monospace_style();
widgets.replace_dialog = gtk_dialog_new_with_buttons(_("Replace"), - GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL); vbox = ui_dialog_vbox_new(GTK_DIALOG(widgets.replace_dialog)); gtk_box_set_spacing(GTK_BOX(vbox), 9); @@ -569,12 +569,12 @@ *check_recursive, *check_extra, *entry_extra; GtkWidget *dbox, *sbox, *cbox, *rbox, *rbtn, *hbox, *vbox; GtkSizeGroup *size_group; - GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); + GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(main_widgets.window, "tooltips"));
load_monospace_style();
widgets.find_in_files_dialog = gtk_dialog_new_with_buttons( - _("Find in Files"), GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT, + _("Find in Files"), GTK_WINDOW(main_widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); vbox = ui_dialog_vbox_new(GTK_DIALOG(widgets.find_in_files_dialog)); gtk_box_set_spacing(GTK_BOX(vbox), 9); @@ -1007,7 +1007,7 @@
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.