renamed ui_util.c/.h to gui_utils.c/.h to prevent confusion with identical named ui_util.h in / dir

svn path=/trunk/; revision=15465
This commit is contained in:
Ulf Lamping 2005-08-20 12:09:48 +00:00
parent 5adc2b6bf1
commit eafbbbcabb
82 changed files with 1430 additions and 1436 deletions

View File

@ -64,6 +64,7 @@ noinst_HEADERS = \
gtkglobals.h \
gtk_stat_util.h \
gui_prefs.h \
gui_utils.h \
help_dlg.h \
hostlist_table.h \
isprint.h \
@ -96,7 +97,6 @@ noinst_HEADERS = \
tap_dfilter_dlg.h \
text_page.h \
toolbar.h \
ui_util.h \
voip_calls.h \
voip_calls_dlg.h \
webbrowser.h

View File

@ -67,6 +67,7 @@ ETHEREAL_GTK_SRC = \
graph_analysis.c \
gtk_stat_util.c \
gui_prefs.c \
gui_utils.c \
help_dlg.c \
hostlist_table.c \
layout_prefs.c \
@ -99,7 +100,6 @@ ETHEREAL_GTK_SRC = \
tap_dfilter_dlg.c \
text_page.c \
toolbar.c \
ui_util.c \
voip_calls.c \
webbrowser.c

View File

@ -32,7 +32,7 @@
#include <epan/filesystem.h>
#include <epan/plugins.h>
#include "about_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "compat_macros.h"
#include "globals.h"

View File

@ -53,7 +53,7 @@
#include "../globals.h"
#include "filter_dlg.h"
#include "compat_macros.h"
#include "ui_util.h"
#include "gui_utils.h"
typedef struct column_arrows {

View File

@ -52,7 +52,7 @@
#include "filter_dlg.h"
#include "compat_macros.h"
#include <epan/dissectors/packet-ansi_map.h>
#include "ui_util.h"
#include "gui_utils.h"
typedef struct column_arrows {

View File

@ -36,7 +36,7 @@
#include <epan/stat.h>
#include "stat_menu.h"
#include "simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include <epan/tap.h>
#include "../register.h"

View File

@ -37,7 +37,7 @@
#include "globals.h"
#include <epan/addr_resolv.h>
#include "main.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "capture.h"
#include "capture_dlg.h"
#include "filter_dlg.h"

View File

@ -42,7 +42,7 @@
#include "capture.h"
#include "main.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include "help_dlg.h"

View File

@ -54,7 +54,7 @@
#include "capture_dlg.h"
#include "capture_if_details_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "wtap.h"

View File

@ -41,7 +41,7 @@
#include "globals.h"
#include "capture_ui_utils.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "pcap-util.h"

View File

@ -37,7 +37,7 @@
#include "gtkglobals.h"
#include <epan/prefs.h>
#include "prefs_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "simple_dialog.h"
#include "pcap-util.h"

View File

@ -40,7 +40,7 @@
#include <epan/dfilter/dfilter.h>
#include "simple_dialog.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dfilter_expr_dlg.h"
#include "compat_macros.h"
#include "filter_dlg.h"

View File

@ -34,11 +34,7 @@
#include <epan/prefs.h>
#include <epan/column.h>
#include "compat_macros.h"
#include "ui_util.h"
#if GTK_MAJOR_VERSION >= 2
#include "ui_util.h"
#endif
#include "gui_utils.h"
static GtkWidget *column_l, *del_bt, *title_te, *fmt_m, *up_bt, *dn_bt;
static gint cur_fmt, cur_row;

View File

@ -53,7 +53,7 @@
#include "gtk/color_dlg.h"
#include "gtkglobals.h"
#include "main.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "help_dlg.h"

View File

@ -44,7 +44,7 @@
#include "stat_menu.h"
#include "simple_dialog.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include <epan/tap.h>
#include "../register.h"
#include <epan/dissectors/packet-dcerpc.h>

View File

@ -34,7 +34,7 @@
#include "simple_dialog.h"
#include <epan/packet.h>
#include <epan/ipproto.h>
#include "ui_util.h"
#include "gui_utils.h"
#include <epan/epan_dissect.h>
#include "compat_macros.h"
#include "decode_as_dcerpc.h"

View File

@ -35,7 +35,7 @@
#include "simple_dialog.h"
#include <epan/packet.h>
#include <epan/ipproto.h>
#include "ui_util.h"
#include "gui_utils.h"
#include <epan/epan_dissect.h>
#include "compat_macros.h"
#include "decode_as_dcerpc.h"

View File

@ -49,7 +49,7 @@
#include "globals.h"
#include "main.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "simple_dialog.h"
#include "dlg_utils.h"
#include "proto_dlg.h"

View File

@ -34,7 +34,7 @@
#include "globals.h"
#include "gtkglobals.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "keys.h"
#include "compat_macros.h"

View File

@ -80,7 +80,7 @@
/** @file
* Utilities for dialog boxes. Depending on the window functions in
* ui_util.h, see: @ref howto_window_page for details.
* gui_utils.h, see: @ref howto_window_page for details.
* @ingroup dialog_group
*/
@ -164,7 +164,7 @@ extern void set_last_open_dir(char *dirname);
* @param stock_id_first the first button (e.g. GTK_STOCK_OK)
* @param ... the next buttons, just like stock_id_first
* @return the new button row
* @todo move this to ui_util.h
* @todo move this to gui_utils.h
*/
extern GtkWidget *dlg_button_row_new(const gchar *stock_id_first, ...);
@ -173,7 +173,7 @@ extern GtkWidget *dlg_button_row_new(const gchar *stock_id_first, ...);
*
* @param widget a widget which should be connected (usually a GtkEntry)
* @param ok_button the button to be activated
* @todo move this to ui_util.h
* @todo move this to gui_utils.h
*/
extern void dlg_set_activate(GtkWidget *widget, GtkWidget *ok_button);

View File

@ -46,7 +46,7 @@
#include "../timestats.h"
#include "compat_macros.h"
#include "../simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "../file.h"
#include "../globals.h"

View File

@ -38,7 +38,7 @@
#include <epan/addr_resolv.h>
#include "keys.h"
#include "filter_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "alert_box.h"
#include "simple_dialog.h"
#include "menu.h"

View File

@ -44,7 +44,7 @@
#include "compat_macros.h"
#include "simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "main.h"

View File

@ -36,7 +36,7 @@
#include "gtk/main.h"
#include "filter_dlg.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "simple_dialog.h"
#include "dfilter_expr_dlg.h"
#include "compat_macros.h"

View File

@ -36,7 +36,7 @@
#include <epan/strutil.h>
#include "globals.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "find_dlg.h"
#include "filter_dlg.h"
#include "alert_box.h"

View File

@ -36,7 +36,7 @@
#include <epan/stat.h>
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include "gtkglobals.h"

View File

@ -58,7 +58,7 @@
#include <epan/addr_resolv.h>
#include <epan/charsets.h>
#include "util.h"
#include "ui_util.h"
#include "gui_utils.h"
#include <epan/epan_dissect.h>
#include <epan/filesystem.h>
#include "compat_macros.h"

View File

@ -36,7 +36,7 @@
#include "simple_dialog.h"
#include "dlg_utils.h"
#include "compat_macros.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "help_dlg.h"
/* Capture callback data keys */

View File

@ -52,7 +52,7 @@
#include "gtkglobals.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"
#include "../color.h"

View File

@ -53,7 +53,7 @@
#include "../globals.h"
#include "filter_dlg.h"
#include "compat_macros.h"
#include "ui_util.h"
#include "gui_utils.h"
typedef struct column_arrows {

View File

@ -46,7 +46,7 @@
#include "image/clist_descend.xpm"
#include "simple_dialog.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include <epan/tap.h>
#include "../register.h"
#include "../globals.h"

View File

@ -43,7 +43,7 @@
#include "file.h"
#include "summary.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include <epan/tap.h>

View File

@ -37,7 +37,7 @@
#include "supported_protos_dlg.h"
#include <epan/prefs.h>
#include "prefs_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "simple_dialog.h"
#include "dlg_utils.h"
#include "proto_draw.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,308 +1,308 @@
/* ui_util.h
* Definitions for UI utility routines
*
* $Id$
*
* Ethereal - Network traffic analyzer
* 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 __GTKGUIUI_UTIL_H__
#define __GTKGUIUI_UTIL_H__
/** @defgroup windows_group Windows
*
* There are the following toplevel windows:
*
* - @ref main_window_group
* - Statistic Windows (several different statistic windows)
*
* See: @ref howto_window_page for details.
*
*/
/** @page howto_window_page How to develop a window / dialog
*
* Windows and dialogs are related to each other. Dialogs are special kind of windows, but they behave
* slightly different. Dialogs stick on it's parent window, normal windows will be much more independant
* from it's parent window. Dialogs should be used to ask or note the user something, while windows should
* show data independantly from the main window.
* Dialogs are created by calling dlg_window_new() which in turn will call window_new().
* After that, dialogs can be developed the same way as windows, all window related functions in ui_util.h
* can be used for both.
*
* @section window_create Create a window
*
* A typical window / dialog will be created by the following calls:
*
* - window_new() will create a new window with default position and size,
* use dlg_window_new() if you need a dialog (transient to the main window)
* - gtk_window_set_default_size() to set the default size of the window. Only
* needed, if the initial size is not appropriate, e.g. when a scrolled_window_new() is used.
* Be sure that the given size is larger than the initial size, otherwise the window might
* clip the content (at least on GTK1)
* - SIGNAL_CONNECT(my_win, "destroy", my_destroy_cb, NULL) callback, if some cleanup needs to be
* done after the window is destroyed, e.g. free up memory, or set the window pointer
* of a singleton window (only one instance allowed, e.g. about dialog) back to zero
* - create and fill in the content and button widgets
* - gtk_widget_show_all() shows all the widgets in the window
* - window_present() present the window on screen and
* (if available) set previously saved position and size
*
* @section window_events Events
*
* The following events are usually interesting:
*
* - "delete_event": the window managers "X" (e.g. upper right edge) of the window
* was clicked, default handler will call gtk_widget_destroy()
* - "destroy": everything is already gone, only cleanup of left over ressources
* can/should be done now
*
* @section window_hints Hints
*
* If you want to save size and position, be sure to call window_destroy() instead of only
* gtk_widget_destroy(), so you will probably have to SIGNAL_CONNECT to the "delete_event"!
*
* Don't use WIDGET_SET_SIZE() to set the size of a window,
* use gtk_window_set_default_size() for that purpose!
*
* Be sure to call window_present() / window_destroy() appropriately, if you
* want to have size and position of the window handled by ui_util.
*
*/
/** @file
* Utilities for Windows and other user interface functions. See: @ref howto_window_page for details.
* @ingroup dialog_group
* @ingroup windows_group
*/
/** @name Window Functions
* @todo Move these window functions to a new file win_utils.h?
* @{ */
/** Create a new window with the Ethereal icon.
* If you want to create a dialog, use dlg_window_new() instead.
*
* @param type window type, typical GTK_WINDOW_TOPLEVEL
* @param title the title for the new window
* @return the newly created window
*/
extern GtkWidget *window_new(GtkWindowType type, const gchar *title);
/** Same as window_new(), but will keep its geometry values (size, position, ...).
* Be sure to use window_present() and window_destroy() appropriately!
*
* @param type window type, typical GTK_WINDOW_TOPLEVEL
* @param title the title for the new window
* @param geom_name the name to distinguish this window, will also be used for the recent file (don't use special chars)
* @return the newly created window
*/
extern GtkWidget *window_new_with_geom(GtkWindowType type, const gchar *title, const gchar *geom_name);
/** Create a new splash window, with no icon or title bar.
*
* @return the newly created window
*/
extern GtkWidget *splash_window_new(void);
/** Present the created window on the top of the screen. This will put the window on top and
* (if available) set previously saved position and size.
*
* @param win the window from window_new()
*/
extern void window_present(GtkWidget *win);
/** callback function for window_set_cancel_button() */
typedef void (*window_cancel_button_fct) (GtkWidget *w, gpointer data);
/** Register the default cancel button "Cancel"/"Close"/"Ok" of this window.
* This will set the callback function for this button, grab this button as the default one and
* set the "ESC" key handler to call the callback function if key is pressed.
*
* @param win the window from window_new()
* @param bt the default button of this window
* @param cb callback function to be called, when this button is pressed
*/
extern void window_set_cancel_button(GtkWidget *win, GtkWidget *bt, window_cancel_button_fct cb);
/** Remember the current window position / size and then destroy the window.
* It's important to call this instead of gtk_widget_destroy() when using window_new_with_geom().
*
* @param win the window from window_new()
*/
extern void window_destroy(GtkWidget *win);
/** Default callback handler for cancel button "clicked" signal.
* Use this for window_set_cancel_button(), if no user specific functionality required,
* will simply call window_destroy()
*/
extern void window_cancel_button_cb(GtkWidget *w _U_, gpointer data);
/** Default callback handler if the window managers X of the window was clicked (delete_event).
* Use this for SIGNAL_CONNECT(), if no user specific functionality required,
* will simply call window_destroy()
*/
extern gboolean window_delete_event_cb(GtkWidget *win, GdkEvent *event _U_, gpointer user_data _U_);
/** geometry values for use in window_get_geometry() and window_set_geometry() */
typedef struct window_geometry_s {
gchar *key; /**< current key in hashtable (internally used only) */
gboolean set_pos; /**< set the x and y position values */
gint x; /**< the windows x position */
gint y; /**< the windows y position */
gboolean set_size; /**< set the width and height values */
gint width; /**< the windows width */
gint height; /**< the windows height */
gboolean set_maximized; /**< set the maximized state (GTK2 only) */
gboolean maximized; /**< the windows maximized state (GTK2 only) */
} window_geometry_t;
/** Get the geometry of a window.
*
* @param win the window from window_new()
* @param geom the current geometry values of the window, the set_xy values will not be used
* @todo if main uses the window_new_with_geom() to save size and such, make this function static
*/
extern void window_get_geometry(GtkWidget *win, window_geometry_t *geom);
/** Set the geometry of a window.
*
* @param win the window from window_new()
* @param geom the new geometry values of the window
* @todo if main uses the window_new_with_geom() to save size and such, make this function static
*/
extern void window_set_geometry(GtkWidget *win, window_geometry_t *geom);
/** Write all geometry values of all windows to the recent file.
* Will call write_recent_geom() for every existing window type.
*
* @param rf recent file handle from caller
*/
extern void window_geom_recent_write_all(gpointer rf);
/** Read in a single geometry key value pair from the recent file.
*
* @param name the geom_name of the window
* @param key the subkey of this pair (e.g. "x")
* @param value the new value (e.g. "123")
*/
extern void window_geom_recent_read_pair(const char *name, const char *key, const char *value);
/** Raise a top-level window and de-iconify it.
* This routine is used if the user has done something to
* ask that a window of a certain type be popped up when there can be only
* one such window and such a window has already been popped up - we
* pop up the existing one rather than creating a new one.
*
* @param win the window from window_new() to be reactivated
*/
extern void reactivate_window(GtkWidget *win);
/** @} */
/** Create a GtkScrolledWindow, set its scrollbar placement appropriately,
* and remember it.
*
* @param hadjustment horizontal adjustment
* @param vadjustment vertical adjustment
* @return the new scrolled window
*/
extern GtkWidget *scrolled_window_new(GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
/** Set the scrollbar placement of all scrolled windows based on user
preference. */
extern void set_scrollbar_placement_all(void);
#if GTK_MAJOR_VERSION < 2
/** Create a GtkCTree, give it the right styles, and remember it.
*
* @param columns the number of columns
* @param tree_column which column has the tree graphic
* @return the newly created GtkCTree
*/
extern GtkWidget *ctree_new(gint columns, gint tree_column);
/** Create a GtkCTree, give it the right styles, and remember it.
*
* @param columns the number of columns
* @param tree_column which column has the tree graphic
* @param titles the titles of all columns
* @return the newly created GtkCTree
*/
extern GtkWidget *ctree_new_with_titles(gint columns, gint tree_column,
const gchar *titles[]);
#else
/** Create a GtkTreeView, give it the right styles, and remember it.
*
* @param model the model (the data) of this tree view
*/
extern GtkWidget *tree_view_new(GtkTreeModel *model);
#endif
/** Create a simple list widget.
*
* @param cols number of columns
* @param titles the titles of all columns
* @return the new simple list widget
*/
extern GtkWidget *simple_list_new(gint cols, const gchar **titles);
/** Append a row to the simple list.
*
* @param list the list from simple_list_new()
* @param ... row and title, finished by -1 (e.g.: 0, "first", 1, "second", -1).
*/
extern void simple_list_append(GtkWidget *list, ...);
/** Set the styles of all Trees based upon user preferences. */
extern void set_tree_styles_all(void);
/** Convert an xpm picture into a GtkWidget showing it.
* Beware: Ethereal's main window must already be visible!
*
* @param xpm the character array containing the picture
* @return a newly created GtkWidget showing the picture
*/
extern GtkWidget *xpm_to_widget(const char ** xpm);
/** Convert an xpm picture into a GtkWidget showing it.
* Beware: the given parent window must already be visible!
*
* @param parent the parent window of to widget to be generated
* @param xpm the character array containing the picture
* @return a newly created GtkWidget showing the picture
*/
extern GtkWidget *xpm_to_widget_from_parent(GtkWidget *parent, const char ** xpm);
/** Copy a GString to the clipboard.
*
* @param str GString that is to be copied to the clipboard.
*/
extern void copy_to_clipboard(GString *str);
/** Create a new window title that includes user-defined preference string.
*
* @param caption string you want included in title (appended to user-defined string)
* @return a newly created title string including user-defined preference (if specified)
*/
extern gchar *create_user_window_title(const gchar *caption);
#endif /* __GTKGUIUI_UTIL_H__ */
/* gui_utils.h
* Definitions for UI utility routines
*
* $Id: ui_util.h 15263 2005-08-08 17:22:55Z ulfl $
*
* Ethereal - Network traffic analyzer
* 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 __GTKGUIUI_UTIL_H__
#define __GTKGUIUI_UTIL_H__
/** @defgroup windows_group Windows
*
* There are the following toplevel windows:
*
* - @ref main_window_group
* - Statistic Windows (several different statistic windows)
*
* See: @ref howto_window_page for details.
*
*/
/** @page howto_window_page How to develop a window / dialog
*
* Windows and dialogs are related to each other. Dialogs are special kind of windows, but they behave
* slightly different. Dialogs stick on it's parent window, normal windows will be much more independant
* from it's parent window. Dialogs should be used to ask or note the user something, while windows should
* show data independantly from the main window.
* Dialogs are created by calling dlg_window_new() which in turn will call window_new().
* After that, dialogs can be developed the same way as windows, all window related functions in gui_utils.h
* can be used for both.
*
* @section window_create Create a window
*
* A typical window / dialog will be created by the following calls:
*
* - window_new() will create a new window with default position and size,
* use dlg_window_new() if you need a dialog (transient to the main window)
* - gtk_window_set_default_size() to set the default size of the window. Only
* needed, if the initial size is not appropriate, e.g. when a scrolled_window_new() is used.
* Be sure that the given size is larger than the initial size, otherwise the window might
* clip the content (at least on GTK1)
* - SIGNAL_CONNECT(my_win, "destroy", my_destroy_cb, NULL) callback, if some cleanup needs to be
* done after the window is destroyed, e.g. free up memory, or set the window pointer
* of a singleton window (only one instance allowed, e.g. about dialog) back to zero
* - create and fill in the content and button widgets
* - gtk_widget_show_all() shows all the widgets in the window
* - window_present() present the window on screen and
* (if available) set previously saved position and size
*
* @section window_events Events
*
* The following events are usually interesting:
*
* - "delete_event": the window managers "X" (e.g. upper right edge) of the window
* was clicked, default handler will call gtk_widget_destroy()
* - "destroy": everything is already gone, only cleanup of left over ressources
* can/should be done now
*
* @section window_hints Hints
*
* If you want to save size and position, be sure to call window_destroy() instead of only
* gtk_widget_destroy(), so you will probably have to SIGNAL_CONNECT to the "delete_event"!
*
* Don't use WIDGET_SET_SIZE() to set the size of a window,
* use gtk_window_set_default_size() for that purpose!
*
* Be sure to call window_present() / window_destroy() appropriately, if you
* want to have size and position of the window handled by ui_util.
*
*/
/** @file
* Utilities for Windows and other user interface functions. See: @ref howto_window_page for details.
* @ingroup dialog_group
* @ingroup windows_group
*/
/** @name Window Functions
* @todo Move these window functions to a new file win_utils.h?
* @{ */
/** Create a new window with the Ethereal icon.
* If you want to create a dialog, use dlg_window_new() instead.
*
* @param type window type, typical GTK_WINDOW_TOPLEVEL
* @param title the title for the new window
* @return the newly created window
*/
extern GtkWidget *window_new(GtkWindowType type, const gchar *title);
/** Same as window_new(), but will keep its geometry values (size, position, ...).
* Be sure to use window_present() and window_destroy() appropriately!
*
* @param type window type, typical GTK_WINDOW_TOPLEVEL
* @param title the title for the new window
* @param geom_name the name to distinguish this window, will also be used for the recent file (don't use special chars)
* @return the newly created window
*/
extern GtkWidget *window_new_with_geom(GtkWindowType type, const gchar *title, const gchar *geom_name);
/** Create a new splash window, with no icon or title bar.
*
* @return the newly created window
*/
extern GtkWidget *splash_window_new(void);
/** Present the created window on the top of the screen. This will put the window on top and
* (if available) set previously saved position and size.
*
* @param win the window from window_new()
*/
extern void window_present(GtkWidget *win);
/** callback function for window_set_cancel_button() */
typedef void (*window_cancel_button_fct) (GtkWidget *w, gpointer data);
/** Register the default cancel button "Cancel"/"Close"/"Ok" of this window.
* This will set the callback function for this button, grab this button as the default one and
* set the "ESC" key handler to call the callback function if key is pressed.
*
* @param win the window from window_new()
* @param bt the default button of this window
* @param cb callback function to be called, when this button is pressed
*/
extern void window_set_cancel_button(GtkWidget *win, GtkWidget *bt, window_cancel_button_fct cb);
/** Remember the current window position / size and then destroy the window.
* It's important to call this instead of gtk_widget_destroy() when using window_new_with_geom().
*
* @param win the window from window_new()
*/
extern void window_destroy(GtkWidget *win);
/** Default callback handler for cancel button "clicked" signal.
* Use this for window_set_cancel_button(), if no user specific functionality required,
* will simply call window_destroy()
*/
extern void window_cancel_button_cb(GtkWidget *w _U_, gpointer data);
/** Default callback handler if the window managers X of the window was clicked (delete_event).
* Use this for SIGNAL_CONNECT(), if no user specific functionality required,
* will simply call window_destroy()
*/
extern gboolean window_delete_event_cb(GtkWidget *win, GdkEvent *event _U_, gpointer user_data _U_);
/** geometry values for use in window_get_geometry() and window_set_geometry() */
typedef struct window_geometry_s {
gchar *key; /**< current key in hashtable (internally used only) */
gboolean set_pos; /**< set the x and y position values */
gint x; /**< the windows x position */
gint y; /**< the windows y position */
gboolean set_size; /**< set the width and height values */
gint width; /**< the windows width */
gint height; /**< the windows height */
gboolean set_maximized; /**< set the maximized state (GTK2 only) */
gboolean maximized; /**< the windows maximized state (GTK2 only) */
} window_geometry_t;
/** Get the geometry of a window.
*
* @param win the window from window_new()
* @param geom the current geometry values of the window, the set_xy values will not be used
* @todo if main uses the window_new_with_geom() to save size and such, make this function static
*/
extern void window_get_geometry(GtkWidget *win, window_geometry_t *geom);
/** Set the geometry of a window.
*
* @param win the window from window_new()
* @param geom the new geometry values of the window
* @todo if main uses the window_new_with_geom() to save size and such, make this function static
*/
extern void window_set_geometry(GtkWidget *win, window_geometry_t *geom);
/** Write all geometry values of all windows to the recent file.
* Will call write_recent_geom() for every existing window type.
*
* @param rf recent file handle from caller
*/
extern void window_geom_recent_write_all(gpointer rf);
/** Read in a single geometry key value pair from the recent file.
*
* @param name the geom_name of the window
* @param key the subkey of this pair (e.g. "x")
* @param value the new value (e.g. "123")
*/
extern void window_geom_recent_read_pair(const char *name, const char *key, const char *value);
/** Raise a top-level window and de-iconify it.
* This routine is used if the user has done something to
* ask that a window of a certain type be popped up when there can be only
* one such window and such a window has already been popped up - we
* pop up the existing one rather than creating a new one.
*
* @param win the window from window_new() to be reactivated
*/
extern void reactivate_window(GtkWidget *win);
/** @} */
/** Create a GtkScrolledWindow, set its scrollbar placement appropriately,
* and remember it.
*
* @param hadjustment horizontal adjustment
* @param vadjustment vertical adjustment
* @return the new scrolled window
*/
extern GtkWidget *scrolled_window_new(GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
/** Set the scrollbar placement of all scrolled windows based on user
preference. */
extern void set_scrollbar_placement_all(void);
#if GTK_MAJOR_VERSION < 2
/** Create a GtkCTree, give it the right styles, and remember it.
*
* @param columns the number of columns
* @param tree_column which column has the tree graphic
* @return the newly created GtkCTree
*/
extern GtkWidget *ctree_new(gint columns, gint tree_column);
/** Create a GtkCTree, give it the right styles, and remember it.
*
* @param columns the number of columns
* @param tree_column which column has the tree graphic
* @param titles the titles of all columns
* @return the newly created GtkCTree
*/
extern GtkWidget *ctree_new_with_titles(gint columns, gint tree_column,
const gchar *titles[]);
#else
/** Create a GtkTreeView, give it the right styles, and remember it.
*
* @param model the model (the data) of this tree view
*/
extern GtkWidget *tree_view_new(GtkTreeModel *model);
#endif
/** Create a simple list widget.
*
* @param cols number of columns
* @param titles the titles of all columns
* @return the new simple list widget
*/
extern GtkWidget *simple_list_new(gint cols, const gchar **titles);
/** Append a row to the simple list.
*
* @param list the list from simple_list_new()
* @param ... row and title, finished by -1 (e.g.: 0, "first", 1, "second", -1).
*/
extern void simple_list_append(GtkWidget *list, ...);
/** Set the styles of all Trees based upon user preferences. */
extern void set_tree_styles_all(void);
/** Convert an xpm picture into a GtkWidget showing it.
* Beware: Ethereal's main window must already be visible!
*
* @param xpm the character array containing the picture
* @return a newly created GtkWidget showing the picture
*/
extern GtkWidget *xpm_to_widget(const char ** xpm);
/** Convert an xpm picture into a GtkWidget showing it.
* Beware: the given parent window must already be visible!
*
* @param parent the parent window of to widget to be generated
* @param xpm the character array containing the picture
* @return a newly created GtkWidget showing the picture
*/
extern GtkWidget *xpm_to_widget_from_parent(GtkWidget *parent, const char ** xpm);
/** Copy a GString to the clipboard.
*
* @param str GString that is to be copied to the clipboard.
*/
extern void copy_to_clipboard(GString *str);
/** Create a new window title that includes user-defined preference string.
*
* @param caption string you want included in title (appended to user-defined string)
* @return a newly created title string including user-defined preference (if specified)
*/
extern gchar *create_user_window_title(const gchar *caption);
#endif /* __GTKGUIUI_UTIL_H__ */

View File

@ -52,7 +52,7 @@
#include "../globals.h"
#include "../tap_dfilter_dlg.h"
#include "tap_dfilter_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
static void gtk_h225counter_init(const char *optarg);

View File

@ -53,7 +53,7 @@
#include "../globals.h"
#include "../tap_dfilter_dlg.h"
#include "tap_dfilter_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
static void gtk_h225rassrt_init(const char *optarg);

View File

@ -37,7 +37,7 @@
#include "text_page.h"
#include <epan/prefs.h>
#include "gtkglobals.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include "dlg_utils.h"
#include "simple_dialog.h"

View File

@ -50,7 +50,7 @@
#include "gtk/color_dlg.h"
#include "gtkglobals.h"
#include "main.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "help_dlg.h"

View File

@ -41,7 +41,7 @@
#include <epan/packet_info.h>
#include "gtkglobals.h"
#include "ui_util.h"
#include "gui_utils.h"
#include <epan/stat.h>
#include "stat_menu.h"
#include <epan/tap.h>

View File

@ -31,10 +31,8 @@
#include "globals.h"
#include "layout_prefs.h"
#include "gtkglobals.h"
/*#include <epan/resolv.h>*/
#include <epan/prefs.h>
/*#include "prefs_dlg.h"*/
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"
#include "dlg_utils.h"

View File

@ -46,7 +46,7 @@
#include "../timestats.h"
#include "compat_macros.h"
#include "../simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "../file.h"
#include "../globals.h"

View File

@ -81,7 +81,7 @@
#include "register.h"
#include <epan/prefs-int.h>
#include "ringbuffer.h"
#include "../ui_util.h" /* beware: ui_util.h exists twice! */
#include "../ui_util.h"
#include <epan/tap.h>
#include <epan/stat.h>
#include "util.h"
@ -110,7 +110,7 @@
#include "dlg_utils.h"
#include "gtkglobals.h"
#include "colors.h"
#include "ui_util.h" /* beware: ui_util.h exists twice! */
#include "gui_utils.h"
#include "compat_macros.h"
#include "main.h"

View File

@ -53,7 +53,7 @@
#include "../globals.h"
#include "../tap_dfilter_dlg.h"
#include "tap_dfilter_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#define NUM_TIMESTATS 10

View File

@ -52,7 +52,7 @@
#include "../globals.h"
#include "filter_dlg.h"
#include "compat_macros.h"
#include "ui_util.h"
#include "gui_utils.h"
#include <epan/dissectors/packet-mtp3.h>
#include "mtp3_stat.h"

View File

@ -46,7 +46,7 @@
#include "image/clist_ascend.xpm"
#include "image/clist_descend.xpm"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include <epan/tap.h>

View File

@ -34,7 +34,7 @@
#include <epan/addr_resolv.h>
#include <epan/prefs.h>
#include "prefs_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "menu.h"
#include "compat_macros.h"

View File

@ -35,7 +35,7 @@
#include "color.h"
#include "color_filters.h"
#include "../ui_util.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "menu.h"
#include "colors.h"

View File

@ -56,7 +56,7 @@
#include "proto_draw.h"
#include "keys.h"
#include "gtkglobals.h"
#include "ui_util.h"
#include "gui_utils.h"
#include <epan/plugins.h>
#include <epan/epan_dissect.h>
#include "compat_macros.h"

View File

@ -31,7 +31,7 @@
#include "globals.h"
#include <epan/plugins.h>
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#ifdef HAVE_PLUGINS

View File

@ -45,7 +45,7 @@
#include "layout_prefs.h"
#include "capture_prefs.h"
#include "nameres_prefs.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "simple_dialog.h"
#include "compat_macros.h"

View File

@ -37,7 +37,7 @@
#include "alert_box.h"
#include "simple_dialog.h"
#include "file_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "main.h"
#include <epan/epan_dissect.h>

View File

@ -36,7 +36,7 @@
#include <epan/prefs.h>
#include "prefs_dlg.h"
#include "util.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "file_dlg.h"
#include "compat_macros.h"

View File

@ -31,7 +31,7 @@
#include <gtk/gtk.h>
#include "gtkglobals.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "progress_dlg.h"
#include "compat_macros.h"

View File

@ -35,7 +35,7 @@
#include "globals.h"
#include "main.h"
#include "util.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "proto_dlg.h"
#include "simple_dialog.h"

View File

@ -64,7 +64,7 @@
#include "proto_draw.h"
#include "packet_win.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "gtkglobals.h"
#include "compat_macros.h"
#include "alert_box.h"

View File

@ -30,7 +30,7 @@
#include "proto_hier_stats.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"
#include "help_dlg.h"

View File

@ -33,7 +33,7 @@
#include "globals.h"
#include "packet-range.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "compat_macros.h"
#include "simple_dialog.h"

View File

@ -39,7 +39,7 @@
#include "main.h"
#include <epan/prefs.h>
#include <epan/prefs-int.h>
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "cfilter_combo_utils.h"
#include "simple_dialog.h"

View File

@ -43,7 +43,7 @@
#include "../register.h"
#include <epan/dissectors/packet-rpc.h>
#include "../globals.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "compat_macros.h"

View File

@ -40,7 +40,7 @@
#include <epan/stat.h>
#include "stat_menu.h"
#include "simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include <epan/tap.h>
#include "../register.h"

View File

@ -65,7 +65,7 @@
#include <epan/stat.h>
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "alert_box.h"
#include "simple_dialog.h"
#include "stat_menu.h"

View File

@ -38,7 +38,7 @@
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include "gtkglobals.h"

View File

@ -35,7 +35,7 @@
#include "register.h"
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"

View File

@ -37,7 +37,7 @@
#include "../color.h"
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"
#include "simple_dialog.h"

View File

@ -53,7 +53,7 @@
#include "../globals.h"
#include "../tap_dfilter_dlg.h"
#include "tap_dfilter_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
static void sctpstat_init(const char *optarg);

View File

@ -37,7 +37,7 @@
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"

View File

@ -33,7 +33,7 @@
#include "simple_dialog.h"
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"

View File

@ -37,7 +37,7 @@
#include "../color.h"
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"
#include "simple_dialog.h"

View File

@ -37,7 +37,7 @@
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"

View File

@ -44,7 +44,7 @@
#include "color.h"
#include "gtk/color_dlg.h"
#include "main.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "gtkglobals.h"

View File

@ -33,7 +33,7 @@
#include "gtkglobals.h"
#include "simple_dialog.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include <epan/strutil.h>

View File

@ -37,7 +37,7 @@
#include <epan/stat.h>
#include "stat_menu.h"
#include "simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include <epan/tap.h>
#include "../register.h"

View File

@ -46,7 +46,7 @@
#include "../timestats.h"
#include "compat_macros.h"
#include "../simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "../file.h"
#include "../globals.h"

View File

@ -36,7 +36,7 @@
#include "globals.h"
#include <epan/stat.h>
#include "stat_menu.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include "compat_macros.h"
#include "tap_dfilter_dlg.h"

View File

@ -43,7 +43,7 @@
#include "summary.h"
#include "summary_dlg.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include "help_dlg.h"

View File

@ -34,7 +34,7 @@
#include <epan/prefs.h>
#include "globals.h"
#include "gtkglobals.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include "dlg_utils.h"
#include "font_utils.h"

View File

@ -44,7 +44,7 @@
#include "filter_dlg.h"
#include "../tap_dfilter_dlg.h"
#include "tap_dfilter_dlg.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "gtkglobals.h"

View File

@ -38,7 +38,7 @@
#include <epan/packet.h> /* frame_data */
#include "gtkglobals.h" /* packet_list */
#include "simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "color.h"
#include "compat_macros.h"
#include "etypes.h"

View File

@ -34,7 +34,7 @@
#include "epan/filesystem.h"
#include "text_page.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include "simple_dialog.h"
#include "font_utils.h"

View File

@ -53,7 +53,7 @@
#include <epan/stat.h>
#include "stat_menu.h"
#include "dlg_utils.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "compat_macros.h"
#include "gtkglobals.h"

View File

@ -37,7 +37,7 @@
#include <epan/stat.h>
#include "stat_menu.h"
#include "simple_dialog.h"
#include "ui_util.h"
#include "gui_utils.h"
#include "dlg_utils.h"
#include <epan/tap.h>
#include "../register.h"