Make "{byte,tree}_view_select()" return "gboolean", not "gint", as they
[obnox/wireshark/wip.git] / gtk / proto_draw.h
1 /* proto_draw.h
2  * Definitions for GTK+ packet display structures and routines
3  *
4  * $Id: proto_draw.h,v 1.24 2004/01/27 20:36:48 guy Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef __GTKPACKET_H__
26 #define __GTKPACKET_H__
27
28 /* Get the current text window for the notebook. */
29 extern GtkWidget *get_notebook_bv_ptr(GtkWidget *nb_ptr);
30
31 /*
32  * Get the data and length for a byte view, given the byte view page.
33  * Return the pointer, or NULL on error, and set "*data_len" to the length.
34  */
35 extern const guint8 *get_byte_view_data_and_length(GtkWidget *byte_view,
36                                                    guint *data_len);
37
38 /*
39  * Set the current text window for the notebook to the window that
40  * refers to a particular tvbuff.
41  */
42 extern void set_notebook_page(GtkWidget *nb_ptr, tvbuff_t *tvb);
43
44 /* Redraw a given byte view window. */
45 extern void redraw_hex_dump(GtkWidget *nb, frame_data *fd, field_info *finfo);
46
47 /* Redraw all byte view windows. */
48 extern void redraw_hex_dump_all(void);
49
50 extern GtkWidget *byte_view_new(void);
51
52 extern void add_byte_views(epan_dissect_t *edt, GtkWidget *tree_view,
53                            GtkWidget *byte_nb_ptr);
54
55 extern gboolean byte_view_select(GtkWidget *widget, GdkEventButton *event);
56
57 #if GTK_MAJOR_VERSION < 2
58 void packet_hex_print(GtkText *, const guint8 *, frame_data *, field_info *,
59                       guint);
60 void packet_hex_reprint(GtkText *);
61 void set_ptree_font_all(GdkFont *font);
62 #else
63 void packet_hex_print(GtkTextView *, const guint8 *, frame_data *, field_info *,
64                       guint);
65 void packet_hex_reprint(GtkTextView *);
66 void set_ptree_font_all(PangoFontDescription *font);
67 #endif
68
69 extern GtkWidget * main_tree_view_new(e_prefs *prefs, GtkWidget **tree_view_p);
70 void proto_tree_draw(proto_tree *protocol_tree, GtkWidget *tree_view);
71 void expand_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
72 void collapse_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
73
74 extern gboolean tree_view_select(GtkWidget *widget, GdkEventButton *event);
75
76 void set_ptree_sel_browse_all(gboolean);
77
78 #endif