Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

Glib::ustring Inkscape::UI::ClipboardManagerImpl::getPathParameter (  ) [virtual]

Get LPE path data from the clipboard.

Returns:
The retrieved path data (contents of the d attribute), or "" if no path was found

Implements Inkscape::UI::ClipboardManager.

Definition at line 516 of file clipboard.cpp.

References _retrieveClipboard(), _userWarn(), and sp_repr_lookup_name().

{
    SPDocument *tempdoc = _retrieveClipboard(); // any target will do here
    if ( tempdoc == NULL ) {
        _userWarn(SP_ACTIVE_DESKTOP, _("Nothing on the clipboard."));
        return "";
    }
    Inkscape::XML::Node
        *root = sp_document_repr_root(tempdoc),
        *path = sp_repr_lookup_name(root, "svg:path", -1); // unlimited search depth
    if ( path == NULL ) {
        _userWarn(SP_ACTIVE_DESKTOP, _("Clipboard does not contain a path."));
        sp_document_unref(tempdoc);
        return "";
    }
    gchar const *svgd = path->attribute("d");
    return svgd;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index