Enable "Match Selected" only if there's a field selected *and* we can do
a "Match Selected" on it - we can't do a "Match Selected" if the field
has no value (e.g., FT_NULL) and has a length of 0.
If we unselect the current packet, we don't have a protocol tree, so we
don't have a currently selected field - clear the "Match Selected" menu
item and the display in the status line of information about the
currently selected field.
Move the low-level statusbar manipulation into "gtk/main.c", in routines
whose API doesn't expose anything GTK+-ish.
"close_cap_file()" calls one of those routines to clear out the status
bar, so it doesn't need to take a pointer to the statusbar widget as an
argument.
"clear_tree_and_hex_views()" is purely a display-manipulating routine;
move it to "gtk/proto_draw.c".
Extract from "tree_view_unselect_row_cb()" an "unselect_field()" routine
to do all the work that needs to be done if the currently selected
protocol tree row is unselected, and call it if the currently selected
packet list row is unselected (if it's unselected, there *is* no
protocol tree, so no row can be selected), as well as from
"tree_view_unselect_row_cb()".
Before pushing a new field-description message onto the statusbar, pop
the old one off.
Get rid of an unused variable (set, but not used).
svn path=/trunk/; revision=3513
2001-06-05 07:39:31 +00:00
|
|
|
/* proto_draw.h
|
1999-03-23 03:14:46 +00:00
|
|
|
* Definitions for GTK+ packet display structures and routines
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-03-23 03:14:46 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1999-03-23 03:14:46 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-03-23 03:14:46 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-03-23 03:14:46 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-03-23 03:14:46 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GTKPACKET_H__
|
|
|
|
#define __GTKPACKET_H__
|
2001-03-23 14:44:04 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** @file
|
|
|
|
* Packet tree and details panes.
|
2004-06-04 17:19:01 +00:00
|
|
|
* @ingroup main_window_group
|
2004-06-02 20:14:51 +00:00
|
|
|
*/
|
|
|
|
|
2005-12-05 22:45:54 +00:00
|
|
|
/** Create byte views in the main window.
|
|
|
|
*/
|
|
|
|
void add_main_byte_views(epan_dissect_t *edt);
|
|
|
|
|
|
|
|
/** Display the protocol tree in the main window.
|
|
|
|
*/
|
|
|
|
void main_proto_tree_draw(proto_tree *protocol_tree);
|
|
|
|
|
|
|
|
/** Clear the hex dump and protocol tree panes.
|
|
|
|
*/
|
|
|
|
void clear_tree_and_hex_views(void);
|
|
|
|
|
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Get the current text notebook page of the packet details notebook.
|
|
|
|
*
|
|
|
|
* @param nb_ptr the notebook widget
|
|
|
|
* @return the notebook page
|
|
|
|
*/
|
2002-02-18 01:08:44 +00:00
|
|
|
extern GtkWidget *get_notebook_bv_ptr(GtkWidget *nb_ptr);
|
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/**
|
|
|
|
* Get the data and length for a byte view, given the byte view page widget.
|
|
|
|
*
|
|
|
|
* @param byte_view the byte view to look at
|
|
|
|
* @param data_len set "*data_len" to the length
|
|
|
|
* @return the pointer, or NULL on error
|
2002-02-18 01:08:44 +00:00
|
|
|
*/
|
|
|
|
extern const guint8 *get_byte_view_data_and_length(GtkWidget *byte_view,
|
|
|
|
guint *data_len);
|
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Set the current text page of the notebook to the window that
|
2002-02-18 01:08:44 +00:00
|
|
|
* refers to a particular tvbuff.
|
2004-06-02 20:14:51 +00:00
|
|
|
*
|
|
|
|
* @param nb_ptr the byte view notebook
|
|
|
|
* @param tvb the tvbuff to look at
|
2002-02-18 01:08:44 +00:00
|
|
|
*/
|
|
|
|
extern void set_notebook_page(GtkWidget *nb_ptr, tvbuff_t *tvb);
|
2001-03-23 14:44:04 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Redraw a given byte view window.
|
|
|
|
*
|
|
|
|
* @param nb_ptr the byte view notebook
|
2004-06-05 13:28:13 +00:00
|
|
|
* @param fd selected frame
|
|
|
|
* @param finfo selected field_info
|
2004-06-02 20:14:51 +00:00
|
|
|
*/
|
|
|
|
extern void redraw_hex_dump(GtkWidget *nb_ptr, frame_data *fd, field_info *finfo);
|
2001-03-23 14:44:04 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Redraw all byte view windows. */
|
2002-02-18 01:08:44 +00:00
|
|
|
extern void redraw_hex_dump_all(void);
|
2001-03-23 14:44:04 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Create a new byte view (packet details pane).
|
|
|
|
*
|
|
|
|
* @return the new byte view
|
|
|
|
*/
|
2004-01-19 00:42:12 +00:00
|
|
|
extern GtkWidget *byte_view_new(void);
|
2001-03-23 14:44:04 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Clear and fill all the byte view notebook tabs.
|
|
|
|
*
|
|
|
|
* @param edt current dissections
|
|
|
|
* @param tree_view the corresponding packet tree
|
|
|
|
* @param nb_ptr the byte view notebook
|
|
|
|
*/
|
2002-06-04 07:03:57 +00:00
|
|
|
extern void add_byte_views(epan_dissect_t *edt, GtkWidget *tree_view,
|
2004-06-02 20:14:51 +00:00
|
|
|
GtkWidget *nb_ptr);
|
1999-03-23 03:14:46 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Gdk button click appeared, select the byte view from that position.
|
|
|
|
*
|
|
|
|
* @param widget the byte view
|
|
|
|
* @param event the button event clicked
|
|
|
|
* @return TRUE if could be selected
|
|
|
|
*/
|
2004-01-27 20:36:48 +00:00
|
|
|
extern gboolean byte_view_select(GtkWidget *widget, GdkEventButton *event);
|
2004-01-27 19:46:52 +00:00
|
|
|
|
2006-11-14 22:35:22 +00:00
|
|
|
/** This highlights the field in the proto tree that is at position byte
|
|
|
|
*
|
|
|
|
* @param tvb the current tvbuff
|
|
|
|
* @param byte the byte offset within the packet to highlight
|
|
|
|
* @param tree_view the current tree_view
|
|
|
|
* @param tree the current tree
|
|
|
|
* @return TRUE if highlighting was successful
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
highlight_field(tvbuff_t *tvb, gint byte, GtkTreeView *tree_view,
|
|
|
|
proto_tree *tree);
|
|
|
|
|
2004-06-03 21:46:27 +00:00
|
|
|
/** Callback for "Export Selected Packet Bytes" operation.
|
|
|
|
*
|
|
|
|
* @param w unused
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void savehex_cb(GtkWidget * w, gpointer data);
|
|
|
|
|
2007-01-28 02:49:50 +00:00
|
|
|
/** Format of packet data to copy to clipboard.
|
|
|
|
* Lower nibble holds data type, next nibble holds flags.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
CD_ALLINFO, /* All information - columated hex with text in separate column */
|
|
|
|
CD_TEXTONLY, /* Printable characters */
|
|
|
|
CD_HEX, /* Hex, space separated, no linebreaks */
|
|
|
|
CD_HEXCOLUMNS, /* Like "All Information" but with no ASCII */
|
|
|
|
CD_BINARY, /* Raw binary octets */
|
|
|
|
|
|
|
|
CD_TYPEMASK = 0x0000FFFF, /* Mask for extracting type */
|
|
|
|
CD_FLAGSMASK = 0xFFFF0000, /* Mask for extracting flags */
|
|
|
|
|
|
|
|
CD_FLAGS_SELECTEDONLY = 0x00010000 /* Copy only selected bytes */
|
|
|
|
} copy_data_type;
|
|
|
|
|
|
|
|
|
2004-09-02 16:58:43 +00:00
|
|
|
/** Callback for "Copy packet bytes to clipboard" operation.
|
|
|
|
*
|
|
|
|
* @param w unused
|
|
|
|
* @param data unused
|
|
|
|
*/
|
2007-01-28 02:49:50 +00:00
|
|
|
extern void copy_hex_cb(GtkWidget * w, gpointer data, copy_data_type data_type);
|
2004-09-02 16:58:43 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Redraw a given byte view window.
|
|
|
|
*
|
|
|
|
* @param bv the byte view
|
|
|
|
* @param pd the packet data
|
|
|
|
* @param fd the current fame
|
|
|
|
* @param finfo the current field info
|
|
|
|
* @param len the byte view length
|
|
|
|
*/
|
2006-11-05 00:54:17 +00:00
|
|
|
extern void packet_hex_print(GtkWidget *bv, const guint8 *pd, frame_data *fd,
|
2004-06-02 20:14:51 +00:00
|
|
|
field_info *finfo, guint len);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Redraw the text using the saved information. Usually called if
|
|
|
|
* the preferences have changed.
|
|
|
|
*
|
|
|
|
* @param bv the byte view
|
|
|
|
*/
|
2006-11-05 00:54:17 +00:00
|
|
|
extern void packet_hex_reprint(GtkWidget *bv);
|
2004-06-02 20:14:51 +00:00
|
|
|
|
|
|
|
/** Set a new font for all protocol trees.
|
|
|
|
*
|
|
|
|
* @param font the new font
|
|
|
|
*/
|
|
|
|
extern void set_ptree_font_all(PangoFontDescription *font);
|
|
|
|
|
|
|
|
/** Find field in tree view by field_info.
|
|
|
|
*
|
|
|
|
* @param tree_view the tree view to look at
|
|
|
|
* @param finfo the field info the look for
|
|
|
|
* @return the path to the field
|
|
|
|
*/
|
|
|
|
extern GtkTreePath *tree_find_by_field_info(GtkTreeView *tree_view, field_info *finfo);
|
1999-03-23 03:14:46 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Create a new tree view (packet details).
|
|
|
|
*
|
|
|
|
* @param prefs current preferences
|
|
|
|
* @param tree_view_p fill in the new tree view
|
|
|
|
* @return the new scrolled window (parent of the tree view)
|
|
|
|
*/
|
2004-01-19 00:42:12 +00:00
|
|
|
extern GtkWidget * main_tree_view_new(e_prefs *prefs, GtkWidget **tree_view_p);
|
1999-07-07 22:52:57 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Clear and redraw the whole tree view.
|
|
|
|
*
|
|
|
|
* @param protocol_tree the currently dissected protocol tree
|
|
|
|
* @param tree_view the tree view to redraw
|
|
|
|
*/
|
|
|
|
extern void proto_tree_draw(proto_tree *protocol_tree, GtkWidget *tree_view);
|
|
|
|
|
|
|
|
/** Expand the whole tree view.
|
|
|
|
*
|
|
|
|
* @param protocol_tree the currently dissected protocol tree
|
|
|
|
* @param tree_view the tree view to redraw
|
|
|
|
*/
|
|
|
|
extern void expand_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
|
|
|
|
|
|
|
|
/** Collapse the whole tree view.
|
|
|
|
*
|
|
|
|
* @param protocol_tree the currently dissected protocol tree
|
|
|
|
* @param tree_view the tree view to redraw
|
|
|
|
*/
|
|
|
|
extern void collapse_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
|
|
|
|
|
|
|
|
/** Gdk button click appeared, select the byte view from that position.
|
|
|
|
*
|
|
|
|
* @param widget the tree view
|
|
|
|
* @param event the button event clicked
|
|
|
|
* @return TRUE if could be selected
|
|
|
|
*/
|
2004-01-27 20:36:48 +00:00
|
|
|
extern gboolean tree_view_select(GtkWidget *widget, GdkEventButton *event);
|
2004-01-27 19:46:52 +00:00
|
|
|
|
2004-06-02 20:14:51 +00:00
|
|
|
/** Set the selection mode of all packet tree windows.
|
|
|
|
*
|
|
|
|
* @param val GTK_SELECTION_SINGLE if TRUE, GTK_SELECTION_BROWSE if FALSE
|
|
|
|
*/
|
|
|
|
extern void set_ptree_sel_browse_all(gboolean val);
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
|
2005-09-11 16:55:34 +00:00
|
|
|
|
|
|
|
/** init the expert colors */
|
|
|
|
extern void proto_draw_colors_init(void);
|
|
|
|
|
|
|
|
/** the expert colors */
|
|
|
|
extern GdkColor expert_color_chat;
|
|
|
|
extern GdkColor expert_color_note;
|
|
|
|
extern GdkColor expert_color_warn;
|
|
|
|
extern GdkColor expert_color_error;
|
|
|
|
|
1999-03-23 03:14:46 +00:00
|
|
|
#endif
|