Cache G_TYPE_INSTANCE_GET_PRIVATE() result when initializing an
[geany-mirror.git] / src / msgwindow.h
blob45337337bfc9957b9b6e0bce5f9c31764d3370d2
1 /*
2 * msgwindow.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005-2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2006-2010 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * $Id$
24 /**
25 * @file msgwindow.h
26 * Message window functions (status, compiler, messages windows).
27 * Also compiler error message parsing and grep file and line parsing.
28 **/
31 #ifndef GEANY_MSGWINDOW_H
32 #define GEANY_MSGWINDOW_H 1
35 /**
36 * Various colors for use in the compiler and messages treeviews when adding messages.
37 **/
38 enum MsgColors
40 COLOR_RED, /**< Color red */
41 COLOR_DARK_RED, /**< Color dark red */
42 COLOR_BLACK, /**< Color black */
43 COLOR_BLUE /**< Color blue */
46 /** Indices of the notebooks in the messages window. */
47 typedef enum
49 /* force it to start at 0 to keep in sync with the notebook page numbers */
50 MSG_STATUS = 0, /**< Index of the status message tab */
51 MSG_COMPILER, /**< Index of the compiler tab */
52 MSG_MESSAGE, /**< Index of the messages tab */
53 MSG_SCRATCH, /**< Index of the scratch tab */
54 MSG_VTE /**< Index of the VTE tab */
55 } MessageWindowTabNum;
59 typedef struct
61 GtkListStore *store_status;
62 GtkListStore *store_msg;
63 GtkListStore *store_compiler;
64 GtkWidget *tree_compiler;
65 GtkWidget *tree_status;
66 GtkWidget *tree_msg;
67 GtkWidget *scribble;
68 GtkWidget *popup_status_menu;
69 GtkWidget *popup_msg_menu;
70 GtkWidget *popup_compiler_menu;
71 GtkWidget *notebook;
72 gchar *find_in_files_dir;
73 } MessageWindow;
75 extern MessageWindow msgwindow;
78 void msgwin_init(void);
80 void msgwin_finalize(void);
82 void msgwin_show_hide(gboolean show);
84 void msgwin_switch_tab(gint tabnum, gboolean show);
86 void msgwin_clear_tab(gint tabnum);
88 void msgwin_msg_add(gint msg_color, gint line, GeanyDocument *doc, const gchar *format, ...)
89 G_GNUC_PRINTF (4, 5);
91 void msgwin_msg_add_string(gint msg_color, gint line, GeanyDocument *doc, const gchar *string);
93 void msgwin_compiler_add(gint msg_color, const gchar *format, ...) G_GNUC_PRINTF (2, 3);
95 void msgwin_compiler_add_string(gint msg_color, const gchar *msg);
97 void msgwin_status_add(const gchar *format, ...) G_GNUC_PRINTF (1, 2);
99 void msgwin_show_hide_tabs(void);
102 void msgwin_menu_add_common_items(GtkMenu *menu);
104 gboolean msgwin_goto_compiler_file_line(guint keyval);
106 void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir,
107 gchar **filename, gint *line);
109 gboolean msgwin_goto_messages_file_line(guint keyval);
111 #endif