Don't give tvbuffs names; instead, give data sources names, where a
[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.16 2002/02/18 01:08:44 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 *create_byte_view(gint bv_size, GtkWidget *pane, int pos);
51
52 extern void add_byte_views(frame_data *frame, proto_tree *tree,
53     GtkWidget *tree_view, GtkWidget *byte_nb_ptr);
54
55 void packet_hex_print(GtkText *, const guint8 *, frame_data *, field_info *,
56                       guint);
57 void packet_hex_reprint(GtkText *);
58
59 void create_tree_view(gint tv_size, e_prefs *prefs, GtkWidget *pane,
60                 GtkWidget **tv_scrollw_p, GtkWidget **tree_view_p, int pos);
61 void proto_tree_draw(proto_tree *protocol_tree, GtkWidget *tree_view);
62 void expand_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
63 void collapse_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
64
65 void set_ptree_sel_browse_all(gboolean);
66 void set_ptree_font_all(GdkFont *font);
67
68 void clear_tree_and_hex_views(void);
69
70 #endif