Re: [gtk-osx-users] Pasting images from clipboard
- From: John Ralls <jralls ceridwen us>
- To: Miroslav Rajcic <mrajcic hotmail com>
- Cc: "gtk-osx-users-list gnome org" <gtk-osx-users-list gnome org>
- Subject: Re: [gtk-osx-users] Pasting images from clipboard
- Date: Tue, 16 Feb 2016 07:01:58 -0800
On Feb 15, 2016, at 11:24 PM, Miroslav Rajcic <mrajcic hotmail com> wrote:
I can confirm that this patch works OK. I actually modified sample to use this function (instead of
patching GTK+ itself):
GdkPixbuf *gtk_clipboard_wait_for_image1 (GtkClipboard *clipboard)
{
GdkAtom target = gdk_atom_intern_static_string("image/tiff");
GtkSelectionData *data = gtk_clipboard_wait_for_contents (clipboard, target);
if (data && data->data){
GdkPixbuf *pixbuf = gtk_selection_data_get_pixbuf (data);
gtk_selection_data_free (data);
return pixbuf;
}
return NULL;
}
And it reported success.
I suppose this is a temporary code, because it only looks for tiff format?
No, the 'image/tiff' string is just a string. It could just as well be 'foo' as long as it's the same in both
https://git.gnome.org/browse/gtk+/tree/gtk/gtkclipboard-quartz.c#n863 and
https://git.gnome.org/browse/gtk+/tree/gtk/gtkquartz.c#n260. Quartz uses a single id, NSTIFFPboardType, for
all image types.
Regards,
John Ralls
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]