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.