From owner-p4-projects@FreeBSD.ORG Tue Mar 25 06:38:52 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 269F21065671; Tue, 25 Mar 2008 06:38:52 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFDC9106564A for ; Tue, 25 Mar 2008 06:38:51 +0000 (UTC) (envelope-from dongmei@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 98E1E8FC29 for ; Tue, 25 Mar 2008 06:38:51 +0000 (UTC) (envelope-from dongmei@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2P6cpZE083162 for ; Tue, 25 Mar 2008 06:38:51 GMT (envelope-from dongmei@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2P6cpqN083160 for perforce@freebsd.org; Tue, 25 Mar 2008 06:38:51 GMT (envelope-from dongmei@FreeBSD.org) Date: Tue, 25 Mar 2008 06:38:51 GMT Message-Id: <200803250638.m2P6cpqN083160@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to dongmei@FreeBSD.org using -f From: dongmei To: Perforce Change Reviews Cc: Subject: PERFORCE change 138498 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2008 06:38:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=138498 Change 138498 by dongmei@dongmei2007 on 2008/03/25 06:38:27 add find mechanism continue Affected files ... .. //depot/projects/soc2007/dongmei-auditanalyzer/Makefile#5 edit .. //depot/projects/soc2007/dongmei-auditanalyzer/gtk/list_view.c#6 edit .. //depot/projects/soc2007/dongmei-auditanalyzer/gtk/list_view.h#3 edit .. //depot/projects/soc2007/dongmei-auditanalyzer/gtk/progress_dlg.c#3 edit .. //depot/projects/soc2007/dongmei-auditanalyzer/tfile.c#9 edit Differences ... ==== //depot/projects/soc2007/dongmei-auditanalyzer/Makefile#5 (text+ko) ==== @@ -2,8 +2,9 @@ .PATH: ${.CURDIR} .PATH: ${.CURDIR}/gtk .PATH: ${.CURDIR}/image +.PATH: ${.CURDIR}/eng -SOURCES = main.c menu.c list_view.c tree_view.c file_dlg.c gui_utils.c simple_dialog.c trail_file_dlg.c filesystem.c buffer.c except.c file_access.c strerror.c tfile.c tsess.c file_util.c capture.c toolbar.c +SOURCES = main.c menu.c list_view.c tree_view.c file_dlg.c gui_utils.c simple_dialog.c trail_file_dlg.c filesystem.c buffer.c except.c file_access.c strerror.c tfile.c tsess.c file_util.c capture.c toolbar.c find_dlg.c progress_dlg.c strutil.c OBJS = ${SOURCES:.c=.o} CFLAGS = `pkg-config gtk+-2.0 --cflags` -D_U_="" LDADD = `pkg-config gtk+-2.0 gthread-2.0 --libs` -lbsm ==== //depot/projects/soc2007/dongmei-auditanalyzer/gtk/list_view.c#6 (text+ko) ==== @@ -214,4 +214,63 @@ free(event); } +gint +packet_list_find_row_from_data(gpointer data) +{ +#ifdef LATER + return eth_clist_find_row_from_data(ETH_CLIST(packet_list), data); +#endif +} +void +packet_list_set_selected_row(gint row) +{ +#ifdef LATER + gint visible_rows; + gint first_row; + gboolean full_visible; + + + full_visible = eth_clist_row_is_visible(ETH_CLIST(packet_list), row) == + GTK_VISIBILITY_FULL; + + /* XXX - why is there no "eth_clist_set_focus_row()", so that we + * can make the row for the frame we found the focus row? + * + * See http://www.gnome.org/mailing-lists/archives/gtk-list/2000-January/0038.shtml + */ + ETH_CLIST(packet_list)->focus_row = row; + + eth_clist_select_row(ETH_CLIST(packet_list), row, -1); + + if (!full_visible) { + + eth_clist_freeze(ETH_CLIST(packet_list)); + + eth_clist_moveto(ETH_CLIST(packet_list), row, -1, 0.0, 0.0); + + /* even after move still invisible (happens with empty list) -> give up */ + if(eth_clist_row_is_visible(ETH_CLIST(packet_list), row) != + GTK_VISIBILITY_FULL) { + eth_clist_thaw(ETH_CLIST(packet_list)); + return; + } + + /* The now selected row will be the first visible row in the list. + * This is inconvenient, as the user is usually interested in some + * packets *before* the currently selected one too. + * + * Try to adjust the visible rows, so the currently selected row will + * be shown around the first third of the list screen. + * + * (This won't even do any harm if the current row is the first or the + * last in the list) */ + visible_rows = packet_list_last_full_visible_row(row) - packet_list_first_full_visible_row(row); + first_row = row - visible_rows / 3; + + eth_clist_moveto(ETH_CLIST(packet_list), first_row >= 0 ? first_row : 0, -1, 0.0, 0.0); + + eth_clist_thaw(ETH_CLIST(packet_list)); + } +#endif +} ==== //depot/projects/soc2007/dongmei-auditanalyzer/gtk/list_view.h#3 (text+ko) ==== ==== //depot/projects/soc2007/dongmei-auditanalyzer/gtk/progress_dlg.c#3 (text+ko) ==== @@ -3,6 +3,23 @@ * * $Id: progress_dlg.c 19942 2006-11-21 00:40:36Z ulfl $ * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * 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. */ #ifdef HAVE_CONFIG_H @@ -13,7 +30,7 @@ #include #include "gtkglobals.h" -#include "dlg_utils.h" +//#include "dlg_utils.h" #include "gui_utils.h" #include "progress_dlg.h" #include "compat_macros.h" ==== //depot/projects/soc2007/dongmei-auditanalyzer/tfile.c#9 (text+ko) ==== @@ -8,6 +8,7 @@ #include #include "exceptions.h" #include "gtk/tree_view.h" +#include "gtk/list_view.h" #include "file_wrappers.h" #include