~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/xml/repr.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#define __SP_REPR_C__
 
2
 
 
3
/** \file
 
4
 * A few non-inline functions of the C facade to Inkscape::XML::Node.
 
5
 */
 
6
 
 
7
/*
 
8
 * Authors:
 
9
 *   Lauris Kaplinski <lauris@kaplinski.com>
 
10
 *   MenTaLguY <mental@rydia.net>
 
11
 *
 
12
 * Copyright (C) 1999-2003 authors
 
13
 * Copyright (C) 2000-2002 Ximian, Inc.
 
14
 * g++ port Copyright (C) 2003 Nathan Hurst
 
15
 *
 
16
 * Released under GNU GPL, read the file 'COPYING' for more information
 
17
 */
 
18
 
 
19
#define noREPR_VERBOSE
 
20
 
 
21
#ifdef HAVE_CONFIG_H
 
22
# include "config.h"
 
23
#endif
 
24
 
 
25
#include <cstring>
 
26
 
 
27
#include "xml/repr.h"
 
28
#include "xml/text-node.h"
 
29
#include "xml/element-node.h"
 
30
#include "xml/comment-node.h"
 
31
#include "xml/simple-document.h"
 
32
 
 
33
using Inkscape::Util::share_string;
 
34
 
 
35
/// Returns new document having as first child a node named rootname.
 
36
Inkscape::XML::Document *
 
37
sp_repr_document_new(char const *rootname)
 
38
{
 
39
    Inkscape::XML::Document *doc = new Inkscape::XML::SimpleDocument();
 
40
    if (!strcmp(rootname, "svg:svg")) {
 
41
        doc->setAttribute("version", "1.0");
 
42
        doc->setAttribute("standalone", "no");
 
43
        Inkscape::XML::Node *comment = doc->createComment(" Created with Inkscape (http://www.inkscape.org/) ");
 
44
        doc->appendChild(comment);
 
45
        Inkscape::GC::release(comment);
 
46
    }
 
47
 
 
48
    Inkscape::XML::Node *root = doc->createElement(rootname);
 
49
    doc->appendChild(root);
 
50
    Inkscape::GC::release(root);
 
51
 
 
52
    return doc;
 
53
}
 
54
 
 
55
/*
 
56
  Local Variables:
 
57
  mode:c++
 
58
  c-file-style:"stroustrup"
 
59
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
60
  indent-tabs-mode:nil
 
61
  fill-column:99
 
62
  End:
 
63
*/
 
64
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :