Ethereal-dev: Re: [Ethereal-dev] Patch to allow "copy to clipboard as CSV" for the contents of

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <[email protected]>
Date: Sat, 17 Jul 2004 03:02:41 -0700
On Sun, Jan 03, 1999 at 01:02:49AM -0600, thomas palmer wrote:

> The following patch allows a user to copy the contents of the Endpoint
> List Window to the clipboard.

Unfortunately, it doesn't compile with GTK+ 1.2[.x], as the clipboard
stuff isn't present:

hostlist_table.c: In function `copy_as_csv_cb':
hostlist_table.c:654: `GtkClipboard' undeclared (first use this
function)
hostlist_table.c:654: (Each undeclared identifier is reported only once
hostlist_table.c:654: for each function it appears in.)
hostlist_table.c:654: `cb' undeclared (first use this function)
hostlist_table.c:654: warning: statement with no effect
hostlist_table.c:655: `GdkDisplay' undeclared (first use this function)
hostlist_table.c:655: `disp' undeclared (first use this function)
hostlist_table.c:655: warning: statement with no effect
hostlist_table.c:657: parse error before `*'
hostlist_table.c:659: `hosts' undeclared (first use this function)
hostlist_table.c:681: warning: implicit declaration of function
`gdk_display_get_default'
hostlist_table.c:682: warning: implicit declaration of function
`gtk_clipboard_get_for_display'
hostlist_table.c:682: `GDK_SELECTION_CLIPBOARD' undeclared (first use
this function)
hostlist_table.c:683: warning: implicit declaration of function
`gtk_clipboard_set_text'
hostlist_table.c:651: warning: unused variable `k'
hostlist_table.c:649: warning: unused parameter `data'

so the clipboard manipulation should be abstracted away into some
routines using the GTK+ clipboard stuff if GTK_MAJOR_VERSION is >= 2 and
using the gtk_selection stuff (with an atom "CLIPBOARD"; see
"gtkeditable.c" in the GTK+ 1.2[.x] source) otherwise.