geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
#include "msgwindow.h"
#include "build.h"
#include "document.h"
#include "callbacks.h"
#include "filetypes.h"
#include "keybindings.h"
#include "main.h"
#include "navqueue.h"
#include "prefs.h"
#include "support.h"
#include "ui_utils.h"
#include "utils.h"
#include "vte.h"
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <gdk/gdkkeysyms.h>
Go to the source code of this file.
Classes | |
struct | ParseData |
Enumerations | |
enum | { MSG_COL_LINE = 0 , MSG_COL_DOC_ID , MSG_COL_COLOR , MSG_COL_STRING , MSG_COL_COUNT } |
enum | { COMPILER_COL_COLOR = 0 , COMPILER_COL_STRING , COMPILER_COL_COUNT } |
Functions | |
static void | prepare_msg_tree_view (void) |
static void | prepare_status_tree_view (void) |
static void | prepare_compiler_tree_view (void) |
static GtkWidget * | create_message_popup_menu (gint type) |
static gboolean | on_msgwin_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
static void | on_scribble_populate (GtkTextView *textview, GtkMenu *arg1, gpointer user_data) |
void | msgwin_show_hide_tabs (void) |
void | msgwin_set_messages_dir (const gchar *messages_dir) |
Sets the Messages path for opening any parsed filenames without absolute path from message lines. More... | |
static void | load_color (const gchar *color_name, GdkColor *color) |
void | msgwin_init (void) |
void | msgwin_finalize (void) |
static gboolean | on_msgwin_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer data) |
static const GdkColor * | get_color (gint msg_color) |
void | msgwin_compiler_add (gint msg_color, const gchar *format,...) |
Adds a formatted message in the compiler tab treeview in the messages window. More... | |
void | msgwin_compiler_add_string (gint msg_color, const gchar *msg) |
Adds a new message in the compiler tab treeview in the messages window. More... | |
void | msgwin_show_hide (gboolean show) |
void | msgwin_msg_add (gint msg_color, gint line, GeanyDocument *doc, const gchar *format,...) |
Adds a formatted message in the messages tab treeview in the messages window. More... | |
void | msgwin_msg_add_string (gint msg_color, gint line, GeanyDocument *doc, const gchar *string) |
Adds a new message in the messages tab treeview in the messages window. More... | |
void | msgwin_status_add_string (const gchar *string) |
Logs a new status message without setting the status bar. More... | |
void | msgwin_status_add (const gchar *format,...) |
Logs a formatted status message without setting the status bar. More... | |
static void | on_message_treeview_clear_activate (GtkMenuItem *menuitem, gpointer user_data) |
static void | on_compiler_treeview_copy_activate (GtkMenuItem *menuitem, gpointer user_data) |
static void | on_compiler_treeview_copy_all_activate (GtkMenuItem *menuitem, gpointer user_data) |
static void | on_hide_message_window (GtkMenuItem *menuitem, gpointer user_data) |
void | msgwin_menu_add_common_items (GtkMenu *menu) |
static gboolean | find_prev_build_dir (GtkTreePath *cur, GtkTreeModel *model, gchar **prefix) |
static gboolean | goto_compiler_file_line (const gchar *fname, gint line, gboolean focus_editor) |
gboolean | msgwin_goto_compiler_file_line (gboolean focus_editor) |
static void | make_absolute (gchar **filename, const gchar *dir) |
static void | parse_file_line (ParseData *data, gchar **filename, gint *line) |
static void | parse_compiler_error_line (const gchar *string, gchar **filename, gint *line) |
void | msgwin_parse_compiler_error_line (const gchar *string, const gchar *dir, gchar **filename, gint *line) |
static void | msgwin_parse_generic_line (const gchar *string, gchar **filename, gint *line) |
gboolean | msgwin_goto_messages_file_line (gboolean focus_editor) |
void | msgwin_switch_tab (gint tabnum, gboolean show) |
Switches to the given notebook tab of the messages window. More... | |
void | msgwin_clear_tab (gint tabnum) |
Removes all messages from a tab specified by tabnum in the messages window. More... | |
Variables | |
MessageWindow | msgwindow |
static GdkColor | color_error = {0, 0xFFFF, 0, 0} |
static GdkColor | color_context = {0, 0x7FFF, 0, 0} |
static GdkColor | color_message = {0, 0, 0, 0xD000} |
anonymous enum |
Enumerator | |
---|---|
MSG_COL_LINE | |
MSG_COL_DOC_ID | |
MSG_COL_COLOR | |
MSG_COL_STRING | |
MSG_COL_COUNT |
Definition at line 68 of file msgwindow.c.
anonymous enum |
Enumerator | |
---|---|
COMPILER_COL_COLOR | |
COMPILER_COL_STRING | |
COMPILER_COL_COUNT |
Definition at line 77 of file msgwindow.c.
|
static |
Definition at line 646 of file msgwindow.c.
References _, clear(), gtk_container_add(), msgwin_menu_add_common_items(), NULL, on_compiler_treeview_copy_activate(), on_compiler_treeview_copy_all_activate(), and on_message_treeview_clear_activate().
Referenced by msgwin_init().
|
static |
Definition at line 706 of file msgwindow.c.
References build_parse_make_dir(), COMPILER_COL_STRING, and NULL.
Referenced by msgwin_goto_compiler_file_line().
|
static |
Definition at line 296 of file msgwindow.c.
References COLOR_BLUE, color_context, COLOR_DARK_RED, color_error, color_message, COLOR_RED, and NULL.
Referenced by msgwin_compiler_add_string(), and msgwin_msg_add_string().
|
static |
Definition at line 730 of file msgwindow.c.
References _, GeanyDocument::changed, document_find_by_filename(), document_get_current(), document_open_file(), GeanyDocument::editor, editor_indicator_set_on_line(), editor_prefs, filename, GEANY_INDICATOR_ERROR, line, name, navqueue_goto_line(), NULL, GeanyEditor::sci, SETPTR, ui_set_statusbar(), GeanyEditorPrefs::use_indicators, utils_get_current_file_dir_utf8(), utils_get_locale_from_utf8(), and utils_get_utf8_from_locale().
Referenced by msgwin_goto_compiler_file_line().
|
static |
|
static |
Definition at line 841 of file msgwindow.c.
References filename, NULL, SETPTR, and utils_is_absolute_path().
Referenced by msgwin_parse_compiler_error_line(), and msgwin_parse_generic_line().
void msgwin_clear_tab | ( | gint | tabnum | ) |
Removes all messages from a tab specified by tabnum in the messages window.
tabnum | An index of a tab in the messages window which should be cleared. Valid values are MSG_STATUS , MSG_COMPILER and MSG_MESSAGE . |
Definition at line 1328 of file msgwindow.c.
References build_menu_update(), MSG_COMPILER, MSG_MESSAGE, MSG_STATUS, msgwindow, and NULL.
Referenced by on_message_treeview_clear_activate().
void msgwin_compiler_add | ( | gint | msg_color, |
const gchar * | format, | ||
... | |||
) |
Adds a formatted message in the compiler tab treeview in the messages window.
msg_color | A color to be used for the text. It must be an element of MsgColors. |
format | printf()-style format string. |
... | Arguments for the format string. |
Definition at line 320 of file msgwindow.c.
References format, and msgwin_compiler_add_string().
Referenced by build_spawn_cmd().
void msgwin_compiler_add_string | ( | gint | msg_color, |
const gchar * | msg | ||
) |
Adds a new message in the compiler tab treeview in the messages window.
msg_color | A color to be used for the text. It must be an element of MsgColors. |
msg | Compiler message to be added. |
Definition at line 343 of file msgwindow.c.
References color, COMPILER_COL_COLOR, COMPILER_COL_STRING, GeanyInterfacePrefs::compiler_tab_autoscroll, get_color(), interface_prefs, msgwindow, NULL, ui_prefs, and utils_get_utf8_from_locale().
Referenced by msgwin_compiler_add(), process_build_output_line(), and show_build_result_message().
void msgwin_finalize | ( | void | ) |
gboolean msgwin_goto_compiler_file_line | ( | gboolean | focus_editor | ) |
Definition at line 796 of file msgwindow.c.
References color, color_error, COMPILER_COL_COLOR, COMPILER_COL_STRING, filename, find_prev_build_dir(), goto_compiler_file_line(), line, msgwin_parse_compiler_error_line(), msgwindow, and NULL.
Referenced by on_build_next_error(), on_build_previous_error(), on_msgwin_button_press_event(), and on_msgwin_key_press_event().
gboolean msgwin_goto_messages_file_line | ( | gboolean | focus_editor | ) |
Definition at line 1170 of file msgwindow.c.
References _, document_find_by_id(), document_get_current(), document_open_file(), GeanyDocument::editor, filename, line, MSG_COL_DOC_ID, MSG_COL_LINE, MSG_COL_STRING, msgwin_parse_generic_line(), msgwindow, navqueue_goto_line(), NULL, GeanyEditor::sci, ui_set_statusbar(), and utils_beep().
Referenced by on_msgwin_button_press_event(), on_msgwin_key_press_event(), on_next_message1_activate(), and on_previous_message1_activate().
void msgwin_init | ( | void | ) |
Definition at line 142 of file msgwindow.c.
References color_context, color_error, color_message, create_message_popup_menu(), interface_prefs, load_color(), main_widgets, MSG_COMPILER, MSG_MESSAGE, MSG_STATUS, GeanyInterfacePrefs::msgwin_font, msgwindow, NULL, on_scribble_populate(), prepare_compiler_tree_view(), prepare_msg_tree_view(), prepare_status_tree_view(), ui_lookup_widget(), ui_widget_modify_font_from_string(), and GeanyMainWidgets::window.
Referenced by main_lib().
void msgwin_menu_add_common_items | ( | GtkMenu * | menu | ) |
Definition at line 689 of file msgwindow.c.
References _, gtk_container_add(), NULL, and on_hide_message_window().
Referenced by create_message_popup_menu(), and on_scribble_populate().
void msgwin_msg_add | ( | gint | msg_color, |
gint | line, | ||
GeanyDocument * | doc, | ||
const gchar * | format, | ||
... | |||
) |
Adds a formatted message in the messages tab treeview in the messages window.
If line and doc are set, clicking on this line jumps into the file which is specified by doc into the line specified with line.
msg_color | A color to be used for the text. It must be an element of MsgColors. |
line | The document's line where the message belongs to. Set to -1 to ignore. |
doc | The document. Set to NULL to ignore. |
format | printf()-style format string. |
... | Arguments for the format string. |
Definition at line 403 of file msgwindow.c.
References format, line, and msgwin_msg_add_string().
Referenced by find_document_usage(), search_find_usage(), and search_finished().
void msgwin_msg_add_string | ( | gint | msg_color, |
gint | line, | ||
GeanyDocument * | doc, | ||
const gchar * | string | ||
) |
Adds a new message in the messages tab treeview in the messages window.
If line and doc are set, clicking on this line jumps into the file which is specified by doc into the line specified with line.
msg_color | A color to be used for the text. It must be an element of MsgColors. |
line | The document's line where the message belongs to. Set to -1 to ignore. |
doc | The document. Set to NULL to ignore. |
string | Message to be added. |
Definition at line 433 of file msgwindow.c.
References color, get_color(), GeanyDocument::id, line, MSG_COL_COLOR, MSG_COL_DOC_ID, MSG_COL_LINE, MSG_COL_STRING, msgwin_show_hide(), msgwindow, NULL, ui_prefs, and utils_get_utf8_from_locale().
Referenced by msgwin_msg_add(), read_fif_io(), search_find_in_files(), and search_finished().
void msgwin_parse_compiler_error_line | ( | const gchar * | string, |
const gchar * | dir, | ||
gchar ** | filename, | ||
gint * | line | ||
) |
Definition at line 1090 of file msgwindow.c.
References build_info, filename, filetypes, filetypes_parse_error_message(), line, make_absolute(), NULL, parse_compiler_error_line(), and utils_get_utf8_from_locale().
Referenced by msgwin_goto_compiler_file_line(), and process_build_output_line().
|
static |
Definition at line 1128 of file msgwindow.c.
References filename, line, make_absolute(), msgwindow, NULL, SETPTR, and utils_get_locale_from_utf8().
Referenced by msgwin_goto_messages_file_line().
void msgwin_set_messages_dir | ( | const gchar * | messages_dir | ) |
Sets the Messages path for opening any parsed filenames without absolute path from message lines.
messages_dir | The directory. |
Definition at line 114 of file msgwindow.c.
References msgwindow.
Referenced by search_find_in_files().
void msgwin_show_hide | ( | gboolean | show | ) |
Definition at line 372 of file msgwindow.c.
References GEANY_KEY_GROUP_FOCUS, GEANY_KEYS_FOCUS_EDITOR, ignore_callback, keybindings_send_command(), main_widgets, GeanyMainWidgets::message_window_notebook, ui_lookup_widget(), ui_prefs, ui_widget_show_hide(), and GeanyMainWidgets::window.
Referenced by build_run_cmd(), msgwin_msg_add_string(), msgwin_switch_tab(), on_hide_message_window(), on_show_messages_window1_toggled(), and show_build_result_message().
void msgwin_show_hide_tabs | ( | void | ) |
Definition at line 99 of file msgwindow.c.
References interface_prefs, GeanyInterfacePrefs::msgwin_compiler_visible, GeanyInterfacePrefs::msgwin_messages_visible, GeanyInterfacePrefs::msgwin_scribble_visible, GeanyInterfacePrefs::msgwin_status_visible, msgwindow, and ui_widget_show_hide().
Referenced by configuration_apply_settings(), and on_prefs_dialog_response().
void msgwin_status_add | ( | const gchar * | format, |
... | |||
) |
Logs a formatted status message without setting the status bar.
Use ui_set_statusbar() to display text on the statusbar.
format | printf()-style format string. |
... | Arguments for the format string. |
Definition at line 520 of file msgwindow.c.
References format, and msgwin_status_add_string().
Referenced by document_new_file(), document_open_file_full(), document_save_file(), plugin_check_version(), print_external(), remove_page(), status_changed(), and ui_set_statusbar().
void msgwin_status_add_string | ( | const gchar * | string | ) |
Logs a new status message without setting the status bar.
Use ui_set_statusbar() to display text on the statusbar.
string | Status message to be logged. |
Definition at line 481 of file msgwindow.c.
References main_status, MSG_STATUS, msgwindow, NULL, prefs, GeanyPrefs::switch_to_status, and utils_get_current_time_string().
Referenced by msgwin_status_add().
void msgwin_switch_tab | ( | gint | tabnum, |
gboolean | show | ||
) |
Switches to the given notebook tab of the messages window.
The messages window is shown if it was previously hidden and show is set to TRUE
.
tabnum | An index of a tab in the messages window. Valid values are all elements of MessageWindowTabNum. |
show | Whether to show the messages window at all if it was hidden before. |
Definition at line 1293 of file msgwindow.c.
References MSG_COMPILER, MSG_MESSAGE, MSG_SCRATCH, MSG_STATUS, MSG_VTE, msgwin_show_hide(), msgwindow, and NULL.
Referenced by cb_func_switch_action().
|
static |
Definition at line 544 of file msgwindow.c.
References COMPILER_COL_STRING, EMPTY, MSG_COL_STRING, MSG_COMPILER, MSG_MESSAGE, MSG_STATUS, msgwindow, NULL, and tv.
Referenced by create_message_popup_menu().
|
static |
Definition at line 585 of file msgwindow.c.
References COMPILER_COL_STRING, EMPTY, line, MSG_COL_STRING, MSG_COMPILER, MSG_MESSAGE, MSG_STATUS, and msgwindow.
Referenced by create_message_popup_menu().
|
static |
Definition at line 640 of file msgwindow.c.
References msgwin_show_hide().
Referenced by msgwin_menu_add_common_items().
|
static |
Definition at line 535 of file msgwindow.c.
References msgwin_clear_tab().
Referenced by create_message_popup_menu().
|
static |
Definition at line 1229 of file msgwindow.c.
References MSG_COMPILER, MSG_MESSAGE, MSG_STATUS, msgwin_goto_compiler_file_line(), msgwin_goto_messages_file_line(), msgwindow, and NULL.
Referenced by prepare_compiler_tree_view(), prepare_msg_tree_view(), and prepare_status_tree_view().
|
static |
Definition at line 173 of file msgwindow.c.
References MSG_COMPILER, MSG_MESSAGE, msgwin_goto_compiler_file_line(), msgwin_goto_messages_file_line(), and ui_is_keyval_enter_or_return().
Referenced by prepare_compiler_tree_view(), and prepare_msg_tree_view().
|
static |
Definition at line 682 of file msgwindow.c.
References msgwin_menu_add_common_items().
Referenced by msgwin_init().
|
static |
Definition at line 908 of file msgwindow.c.
References build_info, ParseData::file_idx, filename, GEANY_FILETYPES_BASIC, GEANY_FILETYPES_C, GEANY_FILETYPES_CPP, GEANY_FILETYPES_CS, GEANY_FILETYPES_D, GEANY_FILETYPES_F77, GEANY_FILETYPES_FERITE, GEANY_FILETYPES_FORTRAN, GEANY_FILETYPES_HTML, GEANY_FILETYPES_JAVA, GEANY_FILETYPES_LATEX, GEANY_FILETYPES_MAKE, GEANY_FILETYPES_NONE, GEANY_FILETYPES_PASCAL, GEANY_FILETYPES_PERL, GEANY_FILETYPES_PHP, GEANY_FILETYPES_PYTHON, GEANY_FILETYPES_RUBY, GEANY_FILETYPES_TCL, line, ParseData::line_idx, ParseData::min_fields, NULL, parse_file_line(), ParseData::pattern, ParseData::string, and strstr().
Referenced by msgwin_parse_compiler_error_line().
|
static |
Definition at line 864 of file msgwindow.c.
References document_get_current(), ParseData::file_idx, GeanyDocument::file_name, filename, line, ParseData::line_idx, ParseData::min_fields, NULL, ParseData::pattern, and ParseData::string.
Referenced by parse_compiler_error_line().
|
static |
Definition at line 261 of file msgwindow.c.
References COMPILER_COL_COLOR, COMPILER_COL_COUNT, COMPILER_COL_STRING, interface_prefs, MSG_COMPILER, GeanyInterfacePrefs::msgwin_font, msgwindow, NULL, on_msgwin_button_press_event(), on_msgwin_key_press_event(), and ui_widget_modify_font_from_string().
Referenced by msgwin_init().
|
static |
Definition at line 222 of file msgwindow.c.
References interface_prefs, MSG_COL_COLOR, MSG_COL_COUNT, MSG_COL_STRING, MSG_MESSAGE, GeanyInterfacePrefs::msgwin_font, msgwindow, NULL, on_msgwin_button_press_event(), on_msgwin_key_press_event(), and ui_widget_modify_font_from_string().
Referenced by msgwin_init().
|
static |
Definition at line 198 of file msgwindow.c.
References _, interface_prefs, MSG_STATUS, GeanyInterfacePrefs::msgwin_font, msgwindow, NULL, on_msgwin_button_press_event(), and ui_widget_modify_font_from_string().
Referenced by msgwin_init().
|
static |
Definition at line 86 of file msgwindow.c.
Referenced by get_color(), and msgwin_init().
|
static |
Definition at line 85 of file msgwindow.c.
Referenced by get_color(), msgwin_goto_compiler_file_line(), and msgwin_init().
|
static |
Definition at line 87 of file msgwindow.c.
Referenced by get_color(), and msgwin_init().
MessageWindow msgwindow |
Definition at line 66 of file msgwindow.c.
Referenced by apply_settings(), build_menu_update(), build_run_cmd(), build_spawn_cmd(), check_menu_key(), configuration_apply_settings(), do_main_quit(), focus_msgwindow(), msgwin_clear_tab(), msgwin_compiler_add_string(), msgwin_finalize(), msgwin_goto_compiler_file_line(), msgwin_goto_messages_file_line(), msgwin_init(), msgwin_msg_add_string(), msgwin_parse_generic_line(), msgwin_set_messages_dir(), msgwin_show_hide_tabs(), msgwin_status_add_string(), msgwin_switch_tab(), on_build_next_error(), on_build_previous_error(), on_compiler_treeview_copy_activate(), on_compiler_treeview_copy_all_activate(), on_msgwin_button_press_event(), on_next_message1_activate(), on_prefs_dialog_response(), on_prefs_font_choosed(), on_previous_message1_activate(), on_search1_activate(), prepare_compiler_tree_view(), prepare_msg_tree_view(), prepare_status_tree_view(), replace_in_session(), save_ui_prefs(), search_find_in_files(), search_find_usage(), search_finished(), and show_build_result_message().