add more details for doxygen
[obnox/wireshark/wip.git] / gtk / proto_draw.h
index 371ca75627c6ae5bf9f11198cc8e4c1ba87affba..20e5b5da5c6af9407df144c201b0c40303f2c478 100644 (file)
-/* gtkpacket.h
+/* proto_draw.h
  * Definitions for GTK+ packet display structures and routines
  *
- * $Id: proto_draw.h,v 1.11 2001/03/23 14:44:04 jfoster Exp $
+ * $Id: proto_draw.h,v 1.28 2004/06/04 17:16:58 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
  *
- * 
  * 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.
- * 
+ *
  * 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.
- * 
+ *
  * 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__
-#define E_BYTE_VIEW_TEXT_INFO_KEY "byte_view_win"
-#define E_BYTE_VIEW_DATA_PTR_KEY  "byte_view_data"
-#define E_BYTE_VIEW_DATA_LEN_KEY  "byte_view_len"
-#define E_BYTE_VIEW_START_KEY     "byte_view_start"
-#define E_BYTE_VIEW_END_KEY       "byte_view_end"
-#define E_BYTE_VIEW_ENCODE_KEY    "byte_view_encode"
-#define E_BYTE_VIEW_NAME_KEY     "byte_view_name"
-
-GtkWidget *add_byte_tab( GtkWidget *byte_nb, const char *name, const guint8 *data, int len);
-int add_byte_view( const char *name, const guint8 *data, int len);
-
-void set_notebook_page( GtkWidget *nb_ptr, int num);
-int find_notebook_page( GtkWidget *nb_ptr, gchar *label);
-
-
-GtkWidget *get_byte_view( GtkWidget *byte_view_notebook);
-int get_byte_view_data( GtkWidget *byte_view_notebook, guint8 **data_ptr);
-int get_byte_view_and_data( GtkWidget *byte_view_notebook, GtkWidget **byte_view, guint8 **data_ptr);
-
-void redraw_hex_dump(GtkWidget *nb, frame_data *fd, field_info *finfo);
-
-void redraw_hex_dump_all(void);
-void create_byte_view(gint bv_size, GtkWidget *pane, GtkWidget **byte_view_p,
-               GtkWidget **bv_scrollw_p, int pos);
-void packet_hex_print(GtkText *, guint8 *, frame_data *, field_info *, int);
-void packet_hex_reprint(GtkText *);
-
-void create_tree_view(gint tv_size, e_prefs *prefs, GtkWidget *pane,
-               GtkWidget **tv_scrollw_p, GtkWidget **tree_view_p, int pos);
-void proto_tree_draw(proto_tree *protocol_tree, GtkWidget *tree_view);
-void expand_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
-void collapse_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
-
-void set_ptree_sel_browse_all(gboolean);
-void set_ptree_line_style_all(gint style);
-void set_ptree_expander_style_all(gint style);
-void set_ptree_font_all(GdkFont *font);
+
+/** @file
+ *  Packet tree and details panes.
+ *  @ingroup main_window_group
+ */
+
+/** Get the current text notebook page of the packet details notebook.
+ *
+ * @param nb_ptr the notebook widget
+ * @return the notebook page
+ */
+extern GtkWidget *get_notebook_bv_ptr(GtkWidget *nb_ptr);
+
+/**
+ * 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
+ */
+extern const guint8 *get_byte_view_data_and_length(GtkWidget *byte_view,
+                                                  guint *data_len);
+
+/** Set the current text page of the notebook to the window that
+ * refers to a particular tvbuff.
+ *
+ * @param nb_ptr the byte view notebook
+ * @param tvb the tvbuff to look at
+ */
+extern void set_notebook_page(GtkWidget *nb_ptr, tvbuff_t *tvb);
+
+/** Redraw a given byte view window.
+ *
+ * @param nb_ptr the byte view notebook
+ * @param fd ???
+ * @param finfo ???
+ * @todo think about parameters
+ */
+extern void redraw_hex_dump(GtkWidget *nb_ptr, frame_data *fd, field_info *finfo);
+
+/** Redraw all byte view windows. */
+extern void redraw_hex_dump_all(void);
+
+/** Create a new byte view (packet details pane).
+ *
+ * @return the new byte view
+ */
+extern GtkWidget *byte_view_new(void);
+
+/** 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
+ */
+extern void add_byte_views(epan_dissect_t *edt, GtkWidget *tree_view,
+                           GtkWidget *nb_ptr);
+
+/** 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
+ */
+extern gboolean byte_view_select(GtkWidget *widget, GdkEventButton *event);
+
+/** Callback for "Export Selected Packet Bytes" operation.
+ *
+ * @param w unused
+ * @param data unused
+ */
+extern void savehex_cb(GtkWidget * w, gpointer data);
+
+#if GTK_MAJOR_VERSION < 2
+/** 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
+ */
+extern void packet_hex_print(GtkText *bv, const guint8 *pd, frame_data *fd,
+                field_info *finfo, guint len);
+
+/**
+ * Redraw the text using the saved information. Usually called if
+ * the preferences have changed.
+ *
+ * @param bv the byte view
+ */
+extern void packet_hex_reprint(GtkText *bv);
+
+/** Set a new font for all protocol trees.
+ *
+ * @param font the new font
+ */
+extern void set_ptree_font_all(GdkFont *font);
+#else
+/** 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
+ */
+extern void packet_hex_print(GtkTextView *bv, const guint8 *pd, frame_data *fd,
+                field_info *finfo, guint len);
+
+/**
+ * Redraw the text using the saved information. Usually called if
+ * the preferences have changed.
+ *
+ * @param bv the byte view
+ */
+extern void packet_hex_reprint(GtkTextView *bv);
+
+/** 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);
+#endif
+
+/** 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)
+ */
+extern GtkWidget * main_tree_view_new(e_prefs *prefs, GtkWidget **tree_view_p);
+
+/** 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
+ */
+extern gboolean tree_view_select(GtkWidget *widget, GdkEventButton *event);
+
+/** 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);
 
 #endif