Difference between revisions of "Clipboard"
Jump to navigation
Jump to search
Romain2Boss (talk | contribs) (→How can I add a new SVG mimetype?: Creation) |
Romain2Boss (talk | contribs) m (Refactoring) |
||
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)]): | 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)]): | ||
Line 10: | Line 8: | ||
* In all other cases, the objects selected are 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: | 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: | ||
Line 33: | Line 29: | ||
* Text string | * Text string | ||
=== Special behaviour === | |||
Those behaviours are accessible via keyboard shortcuts and/or menus: | Those behaviours are accessible via keyboard shortcuts and/or menus: | ||
Line 41: | Line 37: | ||
* 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)]) | * 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)]) | ||
=== How can I | == Developpers informations == | ||
=== How can I allow pasting a new SVG mimetype? === | |||
Nota: this section is underwriting and should be used with caution. | Nota: this section is underwriting and should be used with caution. | ||
Line 54: | Line 52: | ||
## Add a new case in the ''if'' with your mimetype | ## Add a new case in the ''if'' with your mimetype | ||
== Source files == | === 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.cpp /src/ui/clipboard.cpp] | ||
* [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.h /src/ui/clipboard.h] | * [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head%3A/src/ui/clipboard.h /src/ui/clipboard.h] |
Revision as of 21:52, 28 March 2012
What can I copy?
When copying, different scenari could appear (cf. void ClipboardManagerImpl::copy(SPDesktop *desktop)):
- If Inkscape is in Gradient mode and a gradient is selected, the selected gradient is copied
- If Inkscape is in Color picker mode, the color under the cursor is copied
- If Inkscape is in 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. ClipboardManagerImpl::ClipboardManagerImpl()) but the idea is to search data in the clipboard following this order:
- Inkscape SVG ressource
- image/x-inkscape-svg
- SVG ressource
- image/svg+xml
- image/svg+xml-compressed
- Others vector formats:
- PDF ressource
- Adobe Illustrator ressource
If no ressource is found, other formats are searched (cf. 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. bool ClipboardManagerImpl::pastePathEffect(SPDesktop *desktop))
- Paste size (Edit menu) (cf. bool ClipboardManagerImpl::pasteSize(SPDesktop *desktop, bool separately, bool apply_x, bool apply_y))
- Paste style (Edit menu) (cf. bool ClipboardManagerImpl::pasteStyle(SPDesktop *desktop))
Developpers informations
How can I allow pasting a new SVG mimetype?
Nota: this section is underwriting and should be used with caution.
Default non-Inkscape SVG mimetype is image/svg+xml. In order to deal with others non-Inkscape SVG mimetypes, do the following:
- In src/ui/clipboard.cpp
- Locate ClipboardManagerImpl::ClipboardManagerImpl()
- Just after the image/svg+xml mimetype, add a new line with your mimetype
- Locate ClipboardManagerimpl::_retrieveClipboard()
- The goal here is to change the mimetype from yours to the default non-Inkscape SVG mimetype. Locate the if test which set the target to the default non-Inkscape SVG mimetype
- Add a new case in the if with your mimetype