Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
repr.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
6/*
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 * MenTaLguY <mental@rydia.net>
10 *
11 * Copyright (C) 1999-2003 authors
12 * Copyright (C) 2000-2002 Ximian, Inc.
13 * g++ port Copyright (C) 2003 Nathan Hurst
14 *
15 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
16 */
17
18#define noREPR_VERBOSE
19
20#include <cstring>
21
22#include "xml/repr.h"
23#include "xml/text-node.h"
24#include "xml/element-node.h"
25#include "xml/comment-node.h"
26#include "xml/simple-document.h"
27
29
32sp_repr_document_new(char const *rootname)
33{
35 if (!strcmp(rootname, "svg:svg")) {
36 doc->setAttribute("version", "1.0");
37 doc->setAttribute("standalone", "no");
38 Inkscape::XML::Node *comment = doc->createComment(" Created with Inkscape (http://www.inkscape.org/) ");
39 doc->appendChild(comment);
40 Inkscape::GC::release(comment);
41 }
42
43 Inkscape::XML::Node *root = doc->createElement(rootname);
44 doc->appendChild(root);
46
47 return doc;
48}
49
50/*
51 Local Variables:
52 mode:c++
53 c-file-style:"stroustrup"
54 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
55 indent-tabs-mode:nil
56 fill-column:99
57 End:
58*/
59// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
Interface for refcounted XML nodes.
Definition node.h:80
virtual void appendChild(Node *child)=0
Append a node as the last child of this node.
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
Definition node.cpp:25
Comment node implementation.
RootCluster root
Element node implementation.
static R & release(R &r)
Decrements the reference count of a anchored object.
ptr_shared share_string(char const *string)
Definition share.cpp:20
Inkscape::XML::Document * sp_repr_document_new(char const *rootname)
Returns new document having as first child a node named rootname.
Definition repr.cpp:32
C facade to Inkscape::XML::Node.
Inkscape::XML::SimpleDocument - generic XML document implementation.
Interface for XML documents.
Definition document.h:43
virtual Node * createElement(char const *name)=0
virtual Node * createComment(char const *content)=0
Text node implementation.