Difference between revisions of "ClipBoard"

From Inkscape Wiki
Jump to navigation Jump to search
(Adding "What can I copy?", "What can I paste?", "Sources files")
(Undo revision 78248 by Romain2Boss (talk))
Line 1: Line 1:
== What can I copy? ==
When copying, different scenari could appear (cf. [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.cpp void ClipboardManagerImpl::copy(SPDesktop *desktop)]):
* If Inkscape is in [[Gradient Toolbar|Gradient mode]] and a gradient is selected, the selected gradient is copied
* If Inkscape is in [[Dropper Toolbar|Color picker mode]], the color under the cursor is copied
* If Inkscape is in [[Text Toolbar|Text mode]] and if a text is selected, the selected text is copied
* In all other cases, the objects selected are copied
== What can I paste? ==
=== Default behaviour ===
When pasting, the clipboard items will be scaned at a predefined order (cf. [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.cpp ClipboardManagerImpl::ClipboardManagerImpl()]) but the idea is to search data in the clipboard following this order:
* SVG ressource (from various targets)
* Others vector formats:
** PDF ressource
** Adobe Illustrator ressource
If no ressource is found, other formats are searched (cf. [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.cpp bool ClipboardManagerImpl::paste(SPDesktop *desktop, bool in_place)]):
* Windows users only: EMF ressource
* Image ressource
* Text string
=== Special behaviour ===
Those behaviours are accessible via keyboard shortcuts and/or menus:
* Paste path effect ([[Path Menu]]) (cf. [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.cpp bool ClipboardManagerImpl::pastePathEffect(SPDesktop *desktop)])
* Paste size ([[Edit Menu]]) (cf. [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.cpp bool ClipboardManagerImpl::pasteSize(SPDesktop *desktop, bool separately, bool apply_x, bool apply_y)])
* Paste style ([[Edit Menu]]) (cf. [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.cpp bool ClipboardManagerImpl::pasteStyle(SPDesktop *desktop)])
== Source files ==
* [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.cpp /src/ui/clipboard.cpp]
* [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.h /src/ui/clipboard.h]
== Discussions ==
I think the best way to handle the clipboard is to make it an SPDocument in its own right.  When object(s) are copied to the clipboard, we should:
I think the best way to handle the clipboard is to make it an SPDocument in its own right.  When object(s) are copied to the clipboard, we should:


Line 63: Line 22:
-----
-----


=== ClipboardBehavior ===
===ClipboardBehavior===
This is an area to collect information about how the clipboard is currently behaving, and how it's not meeting expectations in different instances. It's time to get the clipboard cleaned up nice, so we'll need to know all the instances that users might need us to address.
This is an area to collect information about how the clipboard is currently behaving, and how it's not meeting expectations in different instances. It's time to get the clipboard cleaned up nice, so we'll need to know all the instances that users might need us to address.


=== Typical Usage ===
==Typical Usage==


I've seen that the typical usage of a vector graphics program by a designer is to create shapes and lines for use in a graphics editing program.  For example, a graphic designer uses illustrator to create some shapes and then pastes them into photoshop to create the final image.  The analogy for InkScape would be to create the shapes and paste them into the GIMP.  The reason for this is that the GIMP is fine for editing images, but it has lousy support for lines and shapes.  Vector Graphics tools like InkScape and Illustrator aren't very good at creating effects and working with photographs.  With good clipboard support, the two applications integrate together to make a complete set of graphics tools!
I've seen that the typical usage of a vector graphics program by a designer is to create shapes and lines for use in a graphics editing program.  For example, a graphic designer uses illustrator to create some shapes and then pastes them into photoshop to create the final image.  The analogy for InkScape would be to create the shapes and paste them into the GIMP.  The reason for this is that the GIMP is fine for editing images, but it has lousy support for lines and shapes.  Vector Graphics tools like InkScape and Illustrator aren't very good at creating effects and working with photographs.  With good clipboard support, the two applications integrate together to make a complete set of graphics tools!

Revision as of 17:29, 28 February 2012

I think the best way to handle the clipboard is to make it an SPDocument in its own right. When object(s) are copied to the clipboard, we should:

1. compile a list of objects and their dependencies (eliminating duplicates -- see DependencyTracking) 2. clear the clipboard SPDocument 3. use some (currently unwritten) facility for bulk-copying SPObjects (see BulkObjectCopy) between documents with references intact to copy the object list to the clipboard document

When pasting, we just use the same bulk object copy facility to copy from the clipboard SPDocument to the destination document (which may or may not be the origin document).

Question: should we handle SPUse specially?

Eventually, we should look at things like taking advantage of e.g. StockLibraryInterface to avoid creating unneeded duplicates of things like referenced gradients when pasting into the same document. But that's icing.

Request: Integration with the System Clipboard

Inkscape should integrate better with the system clipboard on Windows. At least, allowing to copy a bitmap image would be highly useful. As it is the only alternative is to save a bitmap & paste it into office documents.

The clipboard format should be configurable. On Windows for the paste option this is usually done with "paste special" where you can select which clipboard content should be pasted. Usually there is a combination of bitmap grafic/text/vector grafic available. The inkscape SVG editor should default to import the EMF vector grafic for pasting from Windows.

When copying it should be configurable whether text,bitmap grafic of vector grafic or a bundle of all three should be put into the clipboard.

Please note that there are applications like the PC Notestaker software that can't save to files but can only communicate via the clipboard. As of 2009-10 inkscape is not usable in combination with such software - what a pitty!


ClipboardBehavior

This is an area to collect information about how the clipboard is currently behaving, and how it's not meeting expectations in different instances. It's time to get the clipboard cleaned up nice, so we'll need to know all the instances that users might need us to address.

Typical Usage

I've seen that the typical usage of a vector graphics program by a designer is to create shapes and lines for use in a graphics editing program. For example, a graphic designer uses illustrator to create some shapes and then pastes them into photoshop to create the final image. The analogy for InkScape would be to create the shapes and paste them into the GIMP. The reason for this is that the GIMP is fine for editing images, but it has lousy support for lines and shapes. Vector Graphics tools like InkScape and Illustrator aren't very good at creating effects and working with photographs. With good clipboard support, the two applications integrate together to make a complete set of graphics tools!