Hi,
The media type registration (MIME) for SVG: image/svg+xml is finally being registered. As part of this registration, information on how SVG content is tagged by clipboards is required. For example, the Windows Clipboard Name is "SVG Image". Can someone tell me how Inkscape tags SVG content on the clipboard for Windows, MacOS, and Linux? As far as I can tell, Inkscape copies the entire SVG content is copied as text.
Thanks,
Tav
See: "Additional information" in http://dev.w3.org/SVG/profiles/1.1F2/publish/mimereg.html
2010/9/5 Tavmjong Bah <tavmjong@...8...>:
Can someone tell me how Inkscape tags SVG content on the clipboard for Windows, MacOS, and Linux? As far as I can tell, Inkscape copies the entire SVG content is copied as text.
SVG content is definitely not copied as text.
There is no concept of clipboard tags in GTK. Instead, there are mimetypes. We advertise two SVG mimetypes: image/x-inkscape-svg, which corresponds to "Inkscape SVG" in the Save menu, and image/svg+xml, which corresponds to "Plain SVG" (Inkscape SVG with all Inkscape-specific stuff stripped out). The proper place to handle the new clipboard tag is probably GTK.
If I understand how the GTK code works, we could use "SVG Image" as the 'mimetype' passed to GTK and in absence of any special processing on the GTK side this would get used as the "clipboard tag".
Regards, Krzysztof
Thanks!
Tav
PS. When I copied from Inkscape to a text editor I got the SVG as text which is what made me think that it might be copied as text.
On Sun, 2010-09-05 at 23:31 +0200, Krzysztof Kosiński wrote:
2010/9/5 Tavmjong Bah <tavmjong@...8...>:
Can someone tell me how Inkscape tags SVG content on the clipboard for Windows, MacOS, and Linux? As far as I can tell, Inkscape copies the entire SVG content is copied as text.
SVG content is definitely not copied as text.
There is no concept of clipboard tags in GTK. Instead, there are mimetypes. We advertise two SVG mimetypes: image/x-inkscape-svg, which corresponds to "Inkscape SVG" in the Save menu, and image/svg+xml, which corresponds to "Plain SVG" (Inkscape SVG with all Inkscape-specific stuff stripped out). The proper place to handle the new clipboard tag is probably GTK.
If I understand how the GTK code works, we could use "SVG Image" as the 'mimetype' passed to GTK and in absence of any special processing on the GTK side this would get used as the "clipboard tag".
Regards, Krzysztof
On Sep 5, 2010, at 10:22 PM, Tavmjong Bah wrote:
Thanks!
Tav
PS. When I copied from Inkscape to a text editor I got the SVG as text which is what made me think that it might be copied as text.
Actually Inkscape tags the clipboard data in several different forms, including bitmap alternatives.
As I was working on various inkscape clipboard and drag-n-drop behaviors, I did a little program to help with info:
http://sourceforge.net/projects/dragndrop/
You can see all the data flavors advertised by Inkscape. And last I checked, some text types were included.
On Sep 5, 2010, at 2:31 PM, Krzysztof Kosiński wrote:
2010/9/5 Tavmjong Bah <tavmjong@...8...>:
Can someone tell me how Inkscape tags SVG content on the clipboard for Windows, MacOS, and Linux? As far as I can tell, Inkscape copies the entire SVG content is copied as text.
SVG content is definitely not copied as text.
There is no concept of clipboard tags in GTK. Instead, there are mimetypes. We advertise two SVG mimetypes: image/x-inkscape-svg, which corresponds to "Inkscape SVG" in the Save menu, and image/svg+xml, which corresponds to "Plain SVG" (Inkscape SVG with all Inkscape-specific stuff stripped out). The proper place to handle the new clipboard tag is probably GTK.
Actually the MIME type being advertised *is* the clipboard 'tag'
It is also often referred to as a data "flavor".
At the heart of the GTK system is the GtkTargetEntry. That includes a string member named "target" which is the "tag" for the data type. http://library.gnome.org/devel/gtk/stable/gtk-Selections.html#GtkTargetEntry
There is a *convention* to use mimetypes for the data type string. However it is only a convention. There are a few that do not use an actual MIME type string, and then there are several that use complex MIME types with optional parameters.
Depending on the platform, GTK version, etc. we can also be advertising more than just two pertinent types. A while back our clipboard code was modified to query pixbuf and others at runtime and make all toolkit-supported data types advertised as well.
But finally the place to handle any changes in our supported data formats is in Inkscape code itself, not in GTK.
On Sep 5, 2010, at 2:31 PM, Krzysztof Kosiński wrote:
If I understand how the GTK code works, we could use "SVG Image" as the 'mimetype' passed to GTK and in absence of any special processing on the GTK side this would get used as the "clipboard tag".
That's probably close.
The key is that GTK itself does not require 'mimetype' but only 'target'. Whereas there is a *convention* to use mimetypes for clipboard data flavor names, it's not required. So it is perfectly GTK-friendly to use "SVG Image" as the data target type. For certain cases it might be nice if the GTK layer on Windows did a conversion to and from "SVG Image", the more complex use of parameters on the mime types would get lost.
participants (3)
-
Jon Cruz
-
Krzysztof Kosiński
-
Tavmjong Bah