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
28
using
Inkscape::Util::share_string
;
29
31
Inkscape::XML::Document
*
32
sp_repr_document_new
(
char
const
*rootname)
33
{
34
Inkscape::XML::Document
*doc =
new
Inkscape::XML::SimpleDocument
();
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
);
45
Inkscape::GC::release
(
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 :
Inkscape::XML::Node
Interface for refcounted XML nodes.
Definition
node.h:80
Inkscape::XML::Node::appendChild
virtual void appendChild(Node *child)=0
Append a node as the last child of this node.
Inkscape::XML::Node::setAttribute
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
Definition
node.cpp:25
Inkscape::XML::SimpleDocument
Definition
simple-document.h:28
comment-node.h
Comment node implementation.
root
RootCluster root
Definition
containment.cpp:50
element-node.h
Element node implementation.
Inkscape::GC::release
static R & release(R &r)
Decrements the reference count of a anchored object.
Definition
gc-anchored.h:133
Inkscape::Util::share_string
ptr_shared share_string(char const *string)
Definition
share.cpp:20
sp_repr_document_new
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
repr.h
C facade to Inkscape::XML::Node.
simple-document.h
Inkscape::XML::SimpleDocument - generic XML document implementation.
Inkscape::XML::Document
Interface for XML documents.
Definition
document.h:43
Inkscape::XML::Document::createElement
virtual Node * createElement(char const *name)=0
Inkscape::XML::Document::createComment
virtual Node * createComment(char const *content)=0
text-node.h
Text node implementation.
src
xml
repr.cpp
Generated on Sun Jul 13 2025 04:02:23 for Inkscape by
1.9.8