2006-02-04 19:56:50 +00:00
|
|
|
/*
|
|
|
|
* funnel_stat.c
|
|
|
|
*
|
|
|
|
* EPAN's funneled GUI mini-API
|
|
|
|
*
|
2008-08-05 21:03:46 +00:00
|
|
|
* (c) 2006, Luis E. Garcia Ontanon <luis@ontanon.org>
|
2006-02-06 01:27:05 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2006-02-04 19:56:50 +00:00
|
|
|
* 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
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2006-02-04 19:56:50 +00:00
|
|
|
*/
|
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
/*
|
2006-05-22 07:29:40 +00:00
|
|
|
* Most of the code here has been harvested from other Wireshark gtk modules.
|
2006-02-06 01:27:05 +00:00
|
|
|
* most from prefs_dlg.c and about_dlg.c
|
2011-08-25 18:35:22 +00:00
|
|
|
*
|
|
|
|
* (From original checkin message:
|
|
|
|
* The funneled GUI mini API.
|
2012-03-16 02:36:32 +00:00
|
|
|
* A very reduced set of gui ops (by now just a text window)
|
2011-08-25 18:35:22 +00:00
|
|
|
* that can be funneled to dissectors (even plugins) via epan.
|
2006-02-06 01:27:05 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 01:48:30 +00:00
|
|
|
#include "config.h"
|
2006-02-04 19:56:50 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2008-04-13 01:54:20 +00:00
|
|
|
#include <epan/prefs.h>
|
|
|
|
#include <epan/funnel.h>
|
|
|
|
|
2012-01-16 01:07:52 +00:00
|
|
|
#include "ui/progress_dlg.h"
|
2015-12-22 20:07:00 +00:00
|
|
|
#include "ui/simple_dialog.h"
|
|
|
|
#include <epan/color_filters.h>
|
2006-02-04 19:56:50 +00:00
|
|
|
|
2012-01-15 21:59:11 +00:00
|
|
|
#include "ui/gtk/gui_utils.h"
|
|
|
|
#include "ui/gtk/dlg_utils.h"
|
|
|
|
#include "ui/gtk/font_utils.h"
|
|
|
|
#include "ui/gtk/gui_stat_menu.h"
|
|
|
|
#include "ui/gtk/main.h"
|
|
|
|
#include "ui/gtk/webbrowser.h"
|
|
|
|
#include "ui/gtk/gtkglobals.h"
|
2016-08-29 16:38:45 +00:00
|
|
|
#include "ui/gtk/old-gtk-compat.h"
|
2006-02-04 19:56:50 +00:00
|
|
|
|
2014-01-17 19:21:41 +00:00
|
|
|
void register_tap_listener_gtkfunnel(void);
|
2006-02-04 19:56:50 +00:00
|
|
|
|
|
|
|
struct _funnel_text_window_t {
|
2012-03-08 20:02:10 +00:00
|
|
|
GtkWidget* win;
|
2006-02-04 19:56:50 +00:00
|
|
|
GtkWidget* txt;
|
2006-03-30 19:42:49 +00:00
|
|
|
GtkWidget* button_hbox;
|
2006-02-05 20:02:41 +00:00
|
|
|
GtkWidget* bt_close;
|
|
|
|
text_win_close_cb_t close_cb;
|
|
|
|
void* close_data;
|
2012-03-08 20:02:10 +00:00
|
|
|
GPtrArray* buttons;
|
2006-02-04 19:56:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _funnel_tree_window_t {
|
2012-03-08 20:02:10 +00:00
|
|
|
GtkWidget *win;
|
2006-02-04 19:56:50 +00:00
|
|
|
|
|
|
|
};
|
2006-02-04 20:26:36 +00:00
|
|
|
|
|
|
|
struct _funnel_node_t {
|
|
|
|
void* dummy;
|
|
|
|
};
|
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
static void text_window_cancel_button_cb(GtkWidget *bt _U_, gpointer data) {
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_text_window_t* tw = (funnel_text_window_t *)data;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-05 20:02:41 +00:00
|
|
|
window_destroy(GTK_WIDGET(tw->win));
|
|
|
|
tw->win = NULL;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
if (tw->close_cb)
|
|
|
|
tw->close_cb(tw->close_data);
|
2006-02-05 20:02:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void unref_text_win_cancel_bt_cb(GtkWidget *bt _U_, gpointer data) {
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_text_window_t* tw = (funnel_text_window_t *)data;
|
2013-01-04 05:22:43 +00:00
|
|
|
guint i;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
window_destroy(GTK_WIDGET(tw->win));
|
|
|
|
tw->win = NULL;
|
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
if (tw->close_cb)
|
|
|
|
tw->close_cb(tw->close_data);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
for (i = 0; i < tw->buttons->len; i++) {
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_bt_t* cbd = (funnel_bt_t *)g_ptr_array_index(tw->buttons,i);
|
2012-03-08 20:02:10 +00:00
|
|
|
/* XXX a free cb should be passed somehow */
|
|
|
|
if (cbd->data && cbd->free_data_fcn) cbd->free_data_fcn(cbd->data);
|
|
|
|
if (cbd->free_fcn) cbd->free_fcn(cbd);
|
|
|
|
}
|
|
|
|
g_ptr_array_free(tw->buttons,TRUE);
|
2006-02-06 01:27:05 +00:00
|
|
|
g_free(tw);
|
|
|
|
}
|
|
|
|
|
2006-03-30 19:42:49 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
static gboolean text_window_unref_del_event_cb(GtkWidget *win _U_, GdkEvent *event _U_, gpointer user_data) {
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_text_window_t* tw = (funnel_text_window_t *)user_data;
|
2013-01-04 05:22:43 +00:00
|
|
|
guint i;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
window_destroy(GTK_WIDGET(tw->win));
|
|
|
|
tw->win = NULL;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
if (tw->close_cb)
|
|
|
|
tw->close_cb(tw->close_data);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
for (i = 0; i < tw->buttons->len; i++) {
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_bt_t* cbd = (funnel_bt_t *)g_ptr_array_index(tw->buttons,i);
|
2012-03-08 20:02:10 +00:00
|
|
|
/* XXX a free cb should be passed somehow */
|
|
|
|
if (cbd->data && cbd->free_data_fcn) cbd->free_data_fcn(cbd->data);
|
|
|
|
if (cbd->free_fcn) cbd->free_fcn(cbd);
|
|
|
|
}
|
|
|
|
g_ptr_array_free(tw->buttons,TRUE);
|
2006-02-05 20:02:41 +00:00
|
|
|
g_free(tw);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
return TRUE;
|
2006-02-05 20:02:41 +00:00
|
|
|
}
|
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
static gboolean text_window_delete_event_cb(GtkWidget *win _U_, GdkEvent *event _U_, gpointer user_data)
|
2006-02-05 20:02:41 +00:00
|
|
|
{
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_text_window_t* tw = (funnel_text_window_t *)user_data;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
window_destroy(GTK_WIDGET(tw->win));
|
|
|
|
tw->win = NULL;
|
|
|
|
|
|
|
|
if (tw->close_cb)
|
|
|
|
tw->close_cb(tw->close_data);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-05 20:02:41 +00:00
|
|
|
return TRUE;
|
2006-02-04 19:56:50 +00:00
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static funnel_text_window_t* new_text_window(const char* title) {
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_text_window_t* tw = (funnel_text_window_t *)g_malloc(sizeof(funnel_text_window_t));
|
2012-03-08 20:02:10 +00:00
|
|
|
GtkWidget *txt_scrollw, *main_vb, *hbox;
|
2006-02-04 19:56:50 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
tw->close_cb = NULL;
|
|
|
|
tw->close_data = NULL;
|
2006-10-04 18:45:26 +00:00
|
|
|
tw->buttons = g_ptr_array_new();
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
tw->win = dlg_window_new(title); /* transient_for top_level */
|
|
|
|
gtk_window_set_destroy_with_parent (GTK_WINDOW(tw->win), TRUE);
|
2009-06-21 20:42:07 +00:00
|
|
|
|
2008-04-11 22:10:36 +00:00
|
|
|
g_signal_connect(tw->win, "delete-event", G_CALLBACK(text_window_delete_event_cb), tw);
|
2006-02-05 20:02:41 +00:00
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
txt_scrollw = scrolled_window_new(NULL, NULL);
|
2012-04-21 16:40:14 +00:00
|
|
|
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 3, FALSE);
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 6);
|
|
|
|
gtk_container_add(GTK_CONTAINER(tw->win), main_vb);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-07-19 15:02:07 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX (main_vb), txt_scrollw, TRUE, TRUE, 0);
|
2006-02-04 19:56:50 +00:00
|
|
|
|
2010-08-30 16:10:01 +00:00
|
|
|
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(txt_scrollw),
|
2006-02-04 19:56:50 +00:00
|
|
|
GTK_SHADOW_IN);
|
|
|
|
|
|
|
|
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(txt_scrollw),
|
|
|
|
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
|
|
|
tw->txt = gtk_text_view_new();
|
|
|
|
gtk_text_view_set_editable(GTK_TEXT_VIEW(tw->txt), FALSE);
|
|
|
|
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(tw->txt), GTK_WRAP_WORD);
|
|
|
|
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(tw->txt), FALSE);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(tw->txt), 4);
|
|
|
|
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(tw->txt), 4);
|
2006-02-04 19:56:50 +00:00
|
|
|
|
2012-04-21 16:40:14 +00:00
|
|
|
hbox = ws_gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0, FALSE);
|
2006-03-30 20:15:59 +00:00
|
|
|
gtk_widget_show(hbox);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-04-21 21:13:13 +00:00
|
|
|
tw->button_hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_button_box_set_layout(GTK_BUTTON_BOX(tw->button_hbox), GTK_BUTTONBOX_START);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-03-30 20:15:59 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(hbox), tw->button_hbox, TRUE, TRUE, 0);
|
2006-03-30 19:42:49 +00:00
|
|
|
gtk_widget_show(tw->button_hbox);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(main_vb), hbox, FALSE, FALSE, 0);
|
2006-03-30 19:42:49 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
tw->bt_close = gtk_button_new_with_label("Close");
|
|
|
|
gtk_widget_set_can_default(tw->bt_close, TRUE);
|
|
|
|
g_object_set_data(G_OBJECT(hbox), "Close", tw->bt_close);
|
2006-03-30 19:42:49 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_box_pack_end(GTK_BOX(hbox), tw->bt_close, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(tw->bt_close);
|
2006-03-30 19:42:49 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
g_signal_connect(tw->bt_close, "clicked", G_CALLBACK(text_window_cancel_button_cb), tw);
|
2006-02-05 20:02:41 +00:00
|
|
|
gtk_widget_grab_default(tw->bt_close);
|
2006-02-04 19:56:50 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(txt_scrollw), tw->txt);
|
2006-02-04 19:56:50 +00:00
|
|
|
gtk_window_resize(GTK_WINDOW(tw->win),400,300);
|
|
|
|
gtk_widget_show_all(tw->win);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
return tw;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void text_window_clear(funnel_text_window_t* tw)
|
|
|
|
{
|
2006-02-06 13:06:15 +00:00
|
|
|
GtkTextBuffer *buf;
|
|
|
|
|
2010-08-30 16:10:01 +00:00
|
|
|
if (! tw->win) return;
|
2006-02-05 20:02:41 +00:00
|
|
|
|
2006-02-06 13:06:15 +00:00
|
|
|
buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tw->txt));
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
gtk_text_buffer_set_text(buf, "", 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void text_window_append(funnel_text_window_t* tw, const char *str)
|
|
|
|
{
|
|
|
|
GtkWidget *txt;
|
2009-04-16 03:18:10 +00:00
|
|
|
int nchars;
|
2006-02-06 13:06:15 +00:00
|
|
|
GtkTextBuffer *buf;
|
|
|
|
GtkTextIter iter;
|
2008-08-11 01:33:31 +00:00
|
|
|
|
2010-08-30 16:10:01 +00:00
|
|
|
if (! tw->win) return;
|
2006-02-04 19:56:50 +00:00
|
|
|
|
|
|
|
txt = tw->txt;
|
2009-04-16 03:18:10 +00:00
|
|
|
nchars = (int) strlen(str);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
|
|
|
|
2006-02-06 13:06:15 +00:00
|
|
|
buf= gtk_text_view_get_buffer(GTK_TEXT_VIEW(txt));
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
gtk_text_buffer_get_end_iter(buf, &iter);
|
2011-08-17 19:39:34 +00:00
|
|
|
#if GTK_CHECK_VERSION(3,0,0)
|
2011-08-18 08:49:05 +00:00
|
|
|
gtk_widget_override_font(GTK_WIDGET(txt), user_font_get_regular());
|
2011-08-17 19:39:34 +00:00
|
|
|
#else
|
2011-08-18 08:49:05 +00:00
|
|
|
gtk_widget_modify_font(GTK_WIDGET(txt), user_font_get_regular());
|
2011-08-17 19:39:34 +00:00
|
|
|
#endif
|
2006-02-04 19:56:50 +00:00
|
|
|
if (!g_utf8_validate(str, -1, NULL))
|
|
|
|
printf("Invalid utf8 encoding: %s\n", str);
|
2008-08-11 01:33:31 +00:00
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
gtk_text_buffer_insert(buf, &iter, str, nchars);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static void text_window_set_text(funnel_text_window_t* tw, const char* text)
|
2006-02-04 19:56:50 +00:00
|
|
|
{
|
2010-08-30 16:10:01 +00:00
|
|
|
if (! tw->win) return;
|
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
text_window_clear(tw);
|
|
|
|
text_window_append(tw, text);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void text_window_prepend(funnel_text_window_t* tw, const char *str _U_) {
|
2006-03-05 02:01:16 +00:00
|
|
|
GtkWidget *txt;
|
2009-04-16 03:18:10 +00:00
|
|
|
int nchars;
|
2006-03-05 02:01:16 +00:00
|
|
|
GtkTextBuffer *buf;
|
|
|
|
GtkTextIter iter;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
|
|
|
if (! tw->win) return;
|
|
|
|
|
2006-03-05 02:01:16 +00:00
|
|
|
txt = tw->txt;
|
2009-04-16 03:18:10 +00:00
|
|
|
nchars = (int) strlen(str);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
|
|
|
|
2006-03-05 02:01:16 +00:00
|
|
|
buf= gtk_text_view_get_buffer(GTK_TEXT_VIEW(txt));
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-03-05 02:01:16 +00:00
|
|
|
gtk_text_buffer_get_start_iter(buf, &iter);
|
2011-08-17 19:39:34 +00:00
|
|
|
#if GTK_CHECK_VERSION(3,0,0)
|
2011-08-18 08:49:05 +00:00
|
|
|
gtk_widget_override_font(GTK_WIDGET(txt), user_font_get_regular());
|
2011-08-17 19:39:34 +00:00
|
|
|
#else
|
|
|
|
gtk_widget_modify_font(GTK_WIDGET(txt), user_font_get_regular());
|
|
|
|
#endif
|
2006-03-05 02:01:16 +00:00
|
|
|
if (!g_utf8_validate(str, -1, NULL))
|
|
|
|
printf("Invalid utf8 encoding: %s\n", str);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-03-05 02:01:16 +00:00
|
|
|
gtk_text_buffer_insert(buf, &iter, str, nchars);
|
2006-02-04 19:56:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const gchar* text_window_get_text(funnel_text_window_t* tw) {
|
2006-03-05 02:01:16 +00:00
|
|
|
GtkWidget *txt;
|
|
|
|
GtkTextBuffer *buf;
|
|
|
|
GtkTextIter start;
|
|
|
|
GtkTextIter end;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
|
|
|
if (! tw->win) return "";
|
2006-02-04 19:56:50 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
txt = tw->txt;
|
2006-03-05 02:01:16 +00:00
|
|
|
|
|
|
|
buf= gtk_text_view_get_buffer(GTK_TEXT_VIEW(txt));
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_text_buffer_get_start_iter(buf, &start);
|
|
|
|
gtk_text_buffer_get_end_iter(buf, &end);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
return gtk_text_buffer_get_text(buf, &start, &end, FALSE);
|
2006-02-04 19:56:50 +00:00
|
|
|
}
|
|
|
|
|
2006-03-30 19:42:49 +00:00
|
|
|
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-05 20:02:41 +00:00
|
|
|
static void text_window_set_close_cb(funnel_text_window_t* tw, text_win_close_cb_t cb, void* data) {
|
|
|
|
tw->close_cb = cb;
|
|
|
|
tw->close_data = data;
|
|
|
|
}
|
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
static void text_window_destroy(funnel_text_window_t* tw) {
|
|
|
|
if (tw->win) {
|
2006-02-05 20:02:41 +00:00
|
|
|
/*
|
|
|
|
* the window is still there and its callbacks refer to this data structure
|
|
|
|
* we need to change the callback so that they free tw.
|
|
|
|
*/
|
2008-04-11 22:10:36 +00:00
|
|
|
g_signal_connect(tw->bt_close, "clicked", G_CALLBACK(unref_text_win_cancel_bt_cb), tw);
|
|
|
|
g_signal_connect(tw->win, "delete-event", G_CALLBACK(text_window_unref_del_event_cb), tw);
|
2006-02-05 20:02:41 +00:00
|
|
|
} else {
|
2013-01-04 05:22:43 +00:00
|
|
|
guint i;
|
2006-02-05 20:02:41 +00:00
|
|
|
/*
|
|
|
|
* we have no window anymore a human user closed
|
|
|
|
* the window already just free the container
|
|
|
|
*/
|
2012-03-08 20:02:10 +00:00
|
|
|
for (i = 0; i < tw->buttons->len; i++) {
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_bt_t* cbd = (funnel_bt_t *)g_ptr_array_index(tw->buttons,i);
|
2012-03-08 20:02:10 +00:00
|
|
|
/* XXX a free cb should be passed somehow */
|
|
|
|
if (cbd->data && cbd->free_data_fcn) cbd->free_data_fcn(cbd->data);
|
|
|
|
if (cbd->free_fcn) cbd->free_fcn(cbd);
|
|
|
|
}
|
|
|
|
g_ptr_array_free(tw->buttons,TRUE);
|
2006-02-05 20:02:41 +00:00
|
|
|
g_free(tw);
|
2006-02-04 19:56:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-03-30 19:42:49 +00:00
|
|
|
static void text_window_set_editable(funnel_text_window_t* tw, gboolean editable){
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_text_view_set_editable(GTK_TEXT_VIEW(tw->txt), editable);
|
|
|
|
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(tw->txt), editable);
|
2006-03-30 19:42:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean text_window_button_cb(GtkWidget *bt _U_, gpointer user_data)
|
|
|
|
{
|
2013-03-21 02:58:59 +00:00
|
|
|
funnel_bt_t* cbd = (funnel_bt_t *)user_data;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
if (cbd->func) {
|
|
|
|
return cbd->func(cbd->tw,cbd->data);
|
|
|
|
} else {
|
|
|
|
return TRUE;
|
|
|
|
}
|
2006-03-30 19:42:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void text_window_add_button(funnel_text_window_t* tw, funnel_bt_t* cbd, const gchar* label) {
|
2012-03-08 20:02:10 +00:00
|
|
|
GtkWidget *button;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
cbd->tw = tw;
|
|
|
|
g_ptr_array_add(tw->buttons,cbd);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
button = gtk_button_new_with_label(label);
|
|
|
|
gtk_widget_set_can_default(button, TRUE);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(tw->button_hbox), button, FALSE, FALSE, 0);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_widget_show(button);
|
|
|
|
g_signal_connect(button, "clicked", G_CALLBACK(text_window_button_cb), cbd);
|
2006-03-30 19:42:49 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
|
|
|
|
struct _funnel_dlg_data {
|
|
|
|
GtkWidget* win;
|
|
|
|
GPtrArray* entries;
|
|
|
|
funnel_dlg_cb_t dlg_cb;
|
|
|
|
void* data;
|
|
|
|
};
|
|
|
|
|
|
|
|
static gboolean funnel_dlg_cb(GtkWidget *win _U_, gpointer user_data)
|
|
|
|
{
|
2013-03-21 02:58:59 +00:00
|
|
|
struct _funnel_dlg_data* dd = (struct _funnel_dlg_data *)user_data;
|
2006-02-06 01:27:05 +00:00
|
|
|
guint i;
|
|
|
|
guint len = dd->entries->len;
|
|
|
|
GPtrArray* returns = g_ptr_array_new();
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
for(i=0; i<len; i++) {
|
2013-03-21 02:58:59 +00:00
|
|
|
GtkEntry* entry = (GtkEntry *)g_ptr_array_index(dd->entries,i);
|
2006-02-06 01:27:05 +00:00
|
|
|
g_ptr_array_add(returns,g_strdup(gtk_entry_get_text(entry)));
|
|
|
|
}
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
g_ptr_array_add(returns,NULL);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
if (dd->dlg_cb)
|
|
|
|
dd->dlg_cb((gchar**)returns->pdata,dd->data);
|
|
|
|
|
|
|
|
window_destroy(GTK_WIDGET(dd->win));
|
|
|
|
|
2006-02-06 23:54:54 +00:00
|
|
|
g_ptr_array_free(returns,FALSE);
|
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void funnel_cancel_btn_cb(GtkWidget *bt _U_, gpointer data) {
|
2013-03-21 02:58:59 +00:00
|
|
|
GtkWidget* win = (GtkWidget *)data;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
window_destroy(GTK_WIDGET(win));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void funnel_new_dialog(const gchar* title,
|
|
|
|
const gchar** fieldnames,
|
|
|
|
funnel_dlg_cb_t dlg_cb,
|
|
|
|
void* data) {
|
2013-01-03 15:50:10 +00:00
|
|
|
GtkWidget *win, *main_grid, *main_vb, *bbox, *bt_cancel, *bt_ok;
|
2006-02-06 01:27:05 +00:00
|
|
|
guint i;
|
|
|
|
const gchar* fieldname;
|
2013-03-21 02:58:59 +00:00
|
|
|
struct _funnel_dlg_data* dd = (struct _funnel_dlg_data *)g_malloc(sizeof(struct _funnel_dlg_data));
|
2006-02-06 01:27:05 +00:00
|
|
|
|
|
|
|
dd->entries = g_ptr_array_new();
|
|
|
|
dd->dlg_cb = dlg_cb;
|
|
|
|
dd->data = data;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
win = dlg_window_new(title);
|
|
|
|
|
|
|
|
dd->win = win;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
for (i=0; fieldnames[i]; i++);
|
2006-02-06 01:27:05 +00:00
|
|
|
gtk_window_resize(GTK_WINDOW(win),400,10*(i+2));
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-04-21 16:40:14 +00:00
|
|
|
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 5, FALSE);
|
2006-02-06 01:27:05 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(win), main_vb);
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 6);
|
2006-02-06 01:27:05 +00:00
|
|
|
|
2013-01-03 15:50:10 +00:00
|
|
|
main_grid = ws_gtk_grid_new();
|
|
|
|
gtk_box_pack_start(GTK_BOX(main_vb), main_grid, FALSE, FALSE, 0);
|
|
|
|
ws_gtk_grid_set_row_spacing(GTK_GRID(main_grid), 10);
|
|
|
|
ws_gtk_grid_set_column_spacing(GTK_GRID(main_grid), 15);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
for (i = 0; (fieldname = fieldnames[i]) ; i++) {
|
|
|
|
GtkWidget *entry, *label;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2006-02-06 01:27:05 +00:00
|
|
|
label = gtk_label_new(fieldname);
|
2009-04-21 16:57:52 +00:00
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 1.0f, 0.5f);
|
2013-01-05 15:25:30 +00:00
|
|
|
ws_gtk_grid_attach_defaults(GTK_GRID(main_grid), label, 0, i+1, 1, 1);
|
2006-02-06 01:27:05 +00:00
|
|
|
gtk_widget_show(label);
|
|
|
|
|
|
|
|
entry = gtk_entry_new();
|
|
|
|
g_ptr_array_add(dd->entries,entry);
|
2013-01-05 15:25:30 +00:00
|
|
|
ws_gtk_grid_attach_defaults(GTK_GRID(main_grid), entry, 1, i+1, 1, 1);
|
2006-02-06 01:27:05 +00:00
|
|
|
gtk_widget_show(entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
bbox = dlg_button_row_new(GTK_STOCK_CANCEL,GTK_STOCK_OK, NULL);
|
2008-04-11 16:44:31 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2013-03-21 02:58:59 +00:00
|
|
|
bt_ok = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
|
2008-04-11 22:10:36 +00:00
|
|
|
g_signal_connect(bt_ok, "clicked", G_CALLBACK(funnel_dlg_cb), dd);
|
2006-02-06 01:27:05 +00:00
|
|
|
gtk_widget_grab_default(bt_ok);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2013-03-21 02:58:59 +00:00
|
|
|
bt_cancel = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
|
2008-04-11 22:10:36 +00:00
|
|
|
g_signal_connect(bt_cancel, "clicked", G_CALLBACK(funnel_cancel_btn_cb), win);
|
2006-02-06 01:27:05 +00:00
|
|
|
gtk_widget_grab_default(bt_cancel);
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2013-01-03 15:50:10 +00:00
|
|
|
gtk_widget_show(main_grid);
|
2006-02-06 01:27:05 +00:00
|
|
|
gtk_widget_show(main_vb);
|
|
|
|
gtk_widget_show(win);
|
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static const gchar * funnel_get_filter(funnel_ops_id_t *ops_id _U_ _U_) {
|
|
|
|
return gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget));
|
2012-09-15 13:58:57 +00:00
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static void funnel_set_filter(funnel_ops_id_t *ops_id _U_, const char* filter_string) {
|
2012-03-08 20:02:10 +00:00
|
|
|
gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), filter_string);
|
2006-10-03 12:07:10 +00:00
|
|
|
}
|
2006-02-11 13:05:24 +00:00
|
|
|
|
2011-06-27 11:07:31 +00:00
|
|
|
static void funnel_set_color_filter_slot(guint8 filt_nr, const gchar* filter_string) {
|
2015-12-22 20:07:00 +00:00
|
|
|
gchar *err_msg = NULL;
|
|
|
|
if (!color_filters_set_tmp(filt_nr, (gchar *)filter_string, FALSE, &err_msg)) {
|
|
|
|
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
|
|
|
|
g_free(err_msg);
|
|
|
|
}
|
2011-06-27 11:07:31 +00:00
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static void funnel_apply_filter(funnel_ops_id_t *ops_id _U_) {
|
2012-03-08 20:02:10 +00:00
|
|
|
const char* filter_string = gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget));
|
|
|
|
main_filter_packets(&cfile, filter_string, FALSE);
|
2006-10-03 14:27:45 +00:00
|
|
|
}
|
|
|
|
|
2006-02-11 13:05:24 +00:00
|
|
|
/* XXX: finish this */
|
|
|
|
static void funnel_logger(const gchar *log_domain _U_,
|
|
|
|
GLogLevelFlags log_level _U_,
|
|
|
|
const gchar *message,
|
|
|
|
gpointer user_data _U_) {
|
|
|
|
fputs(message,stderr);
|
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static void funnel_retap_packets(funnel_ops_id_t *ops_id _U_) {
|
2012-03-08 20:02:10 +00:00
|
|
|
cf_retap_packets(&cfile);
|
2006-03-05 02:01:16 +00:00
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static gboolean funnel_open_file(funnel_ops_id_t *ops_id _U_, const char* fname, const char* filter, char** err_str) {
|
2012-03-08 20:02:10 +00:00
|
|
|
int err = 0;
|
|
|
|
dfilter_t *rfcode = NULL;
|
|
|
|
|
2015-01-18 10:22:19 +00:00
|
|
|
*err_str = NULL;
|
2012-03-08 20:02:10 +00:00
|
|
|
|
|
|
|
switch (cfile.state) {
|
|
|
|
case FILE_CLOSED:
|
|
|
|
case FILE_READ_DONE:
|
|
|
|
case FILE_READ_ABORTED:
|
|
|
|
break;
|
|
|
|
case FILE_READ_IN_PROGRESS:
|
2015-01-18 10:22:19 +00:00
|
|
|
*err_str = g_strdup("file read in progress");
|
2012-03-08 20:02:10 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
if (filter) {
|
2015-01-18 10:22:19 +00:00
|
|
|
if (!dfilter_compile(filter, &rfcode, err_str)) {
|
2012-03-08 20:02:10 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2014-03-20 16:57:29 +00:00
|
|
|
/* This closes the current file if it succeeds. */
|
2014-01-18 14:20:02 +00:00
|
|
|
if (cf_open(&cfile, fname, WTAP_TYPE_AUTO, FALSE, &err) != CF_OK) {
|
2015-01-18 10:22:19 +00:00
|
|
|
*err_str = g_strdup(g_strerror(err));
|
2017-08-26 08:30:47 +00:00
|
|
|
dfilter_free(rfcode);
|
2012-03-08 20:02:10 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2006-10-03 12:07:10 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
cfile.rfcode = rfcode;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
switch (cf_read(&cfile, FALSE)) {
|
|
|
|
case CF_READ_OK:
|
|
|
|
case CF_READ_ERROR:
|
|
|
|
break;
|
|
|
|
default:
|
2015-01-18 10:22:19 +00:00
|
|
|
*err_str = g_strdup("problem while reading file");
|
2012-03-08 20:02:10 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
return TRUE;
|
2006-10-03 12:07:10 +00:00
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static struct progdlg* funnel_new_progress_window(funnel_ops_id_t *ops_id _U_, const gchar* label, const gchar* task, gboolean terminate_is_stop, gboolean *stop_flag) {
|
|
|
|
return create_progress_dlg(top_level, label, task, terminate_is_stop, stop_flag);
|
2008-08-11 01:33:31 +00:00
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static void funnel_update_progress(struct progdlg* win, float pr, const gchar* task) {
|
|
|
|
update_progress_dlg(win, pr, task);
|
2008-08-11 01:33:31 +00:00
|
|
|
}
|
|
|
|
|
2015-07-03 20:52:49 +00:00
|
|
|
static void funnel_destroy_progress_window(struct progdlg* win) {
|
|
|
|
destroy_progress_dlg(win);
|
2008-08-11 01:33:31 +00:00
|
|
|
}
|
|
|
|
|
2016-01-03 12:48:39 +00:00
|
|
|
static void funnel_reload_packets(funnel_ops_id_t *ops_id _U_) {
|
2012-03-08 20:02:10 +00:00
|
|
|
if (cfile.state == FILE_READ_DONE) cf_reload(&cfile);
|
2006-10-03 12:07:10 +00:00
|
|
|
}
|
2006-02-11 13:05:24 +00:00
|
|
|
|
2006-02-06 23:54:54 +00:00
|
|
|
static const funnel_ops_t funnel_ops = {
|
2015-07-03 20:52:49 +00:00
|
|
|
NULL, /* ops_id */
|
2006-02-04 19:56:50 +00:00
|
|
|
new_text_window,
|
|
|
|
text_window_set_text,
|
|
|
|
text_window_append,
|
|
|
|
text_window_prepend,
|
|
|
|
text_window_clear,
|
|
|
|
text_window_get_text,
|
2006-02-05 20:02:41 +00:00
|
|
|
text_window_set_close_cb,
|
2012-03-08 20:02:10 +00:00
|
|
|
text_window_set_editable,
|
2006-02-06 01:27:05 +00:00
|
|
|
text_window_destroy,
|
2012-03-08 20:02:10 +00:00
|
|
|
text_window_add_button,
|
2006-02-06 01:27:05 +00:00
|
|
|
/*...,*/
|
2006-02-11 13:05:24 +00:00
|
|
|
funnel_new_dialog,
|
2015-08-11 12:08:08 +00:00
|
|
|
NULL,
|
2006-03-05 02:01:16 +00:00
|
|
|
funnel_logger,
|
2012-03-08 20:02:10 +00:00
|
|
|
funnel_retap_packets,
|
|
|
|
copy_to_clipboard,
|
2012-09-15 13:58:57 +00:00
|
|
|
funnel_get_filter,
|
2012-03-08 20:02:10 +00:00
|
|
|
funnel_set_filter,
|
|
|
|
funnel_set_color_filter_slot,
|
|
|
|
funnel_open_file,
|
2016-01-03 12:48:39 +00:00
|
|
|
funnel_reload_packets,
|
|
|
|
NULL,
|
2012-03-08 20:02:10 +00:00
|
|
|
funnel_apply_filter,
|
|
|
|
browser_open_url,
|
|
|
|
browser_open_data_file,
|
2008-08-11 01:33:31 +00:00
|
|
|
funnel_new_progress_window,
|
|
|
|
funnel_update_progress,
|
|
|
|
funnel_destroy_progress_window
|
2006-02-04 19:56:50 +00:00
|
|
|
};
|
|
|
|
|
2006-02-05 03:59:56 +00:00
|
|
|
|
|
|
|
typedef struct _menu_cb_t {
|
|
|
|
void (*callback)(gpointer);
|
|
|
|
void* callback_data;
|
2006-02-05 20:02:41 +00:00
|
|
|
gboolean retap;
|
2006-02-05 03:59:56 +00:00
|
|
|
} menu_cb_t;
|
|
|
|
|
|
|
|
static void our_menu_callback(void* unused _U_, gpointer data) {
|
2013-03-21 02:58:59 +00:00
|
|
|
menu_cb_t* mcb = (menu_cb_t *)data;
|
2006-02-05 03:59:56 +00:00
|
|
|
mcb->callback(mcb->callback_data);
|
2009-06-05 22:42:47 +00:00
|
|
|
if (mcb->retap) cf_retap_packets(&cfile);
|
2006-02-05 03:59:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void register_menu_cb(const char *name,
|
2013-02-12 19:00:39 +00:00
|
|
|
register_stat_group_t group,
|
2006-02-05 03:59:56 +00:00
|
|
|
void (*callback)(gpointer),
|
2006-02-05 20:02:41 +00:00
|
|
|
gpointer callback_data,
|
|
|
|
gboolean retap) {
|
2011-08-26 08:25:38 +00:00
|
|
|
|
2013-03-21 02:58:59 +00:00
|
|
|
menu_cb_t* mcb = (menu_cb_t *)g_malloc(sizeof(menu_cb_t));
|
2012-03-08 20:02:10 +00:00
|
|
|
const char *label = NULL, *str = NULL;
|
2006-02-05 03:59:56 +00:00
|
|
|
|
|
|
|
mcb->callback = callback;
|
|
|
|
mcb->callback_data = callback_data;
|
2006-02-05 20:02:41 +00:00
|
|
|
mcb->retap = retap;
|
2010-08-30 16:10:01 +00:00
|
|
|
|
2012-03-08 20:02:10 +00:00
|
|
|
str = strrchr(name,'/');
|
|
|
|
if(str){
|
|
|
|
label = str+1;
|
|
|
|
}else{
|
|
|
|
label = name;
|
|
|
|
}
|
|
|
|
|
2013-05-24 01:05:39 +00:00
|
|
|
register_menu_bar_menu_items(
|
2012-03-08 20:02:10 +00:00
|
|
|
stat_group_name(group), /* GUI path to the place holder in the menu */
|
|
|
|
name, /* Action name */
|
|
|
|
NULL, /* Stock id */
|
|
|
|
label, /* label */
|
|
|
|
NULL, /* Accelerator */
|
|
|
|
NULL, /* Tooltip */
|
|
|
|
our_menu_callback, /* Callback */
|
|
|
|
mcb, /* callback data */
|
|
|
|
TRUE, /* enabled */
|
|
|
|
NULL,
|
|
|
|
NULL);
|
2006-02-04 19:56:50 +00:00
|
|
|
}
|
|
|
|
|
2006-02-06 23:54:54 +00:00
|
|
|
void initialize_funnel_ops(void) {
|
|
|
|
funnel_set_funnel_ops(&funnel_ops);
|
|
|
|
}
|
|
|
|
|
2006-02-04 19:56:50 +00:00
|
|
|
void
|
|
|
|
register_tap_listener_gtkfunnel(void)
|
|
|
|
{
|
2006-02-05 03:59:56 +00:00
|
|
|
funnel_register_all_menus(register_menu_cb);
|
2006-02-04 19:56:50 +00:00
|
|
|
}
|
2015-02-15 18:58:39 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|