~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/sp-title.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_TITLE_C__
 
2
 
 
3
/*
 
4
 * SVG <title> implementation
 
5
 *
 
6
 * Authors:
 
7
 *   Jeff Schiller <codedread@gmail.com>
 
8
 *
 
9
 * Copyright (C) 2008 Jeff Schiller
 
10
 *
 
11
 * Released under GNU GPL, read the file 'COPYING' for more information
 
12
 */
 
13
 
 
14
#ifdef HAVE_CONFIG_H
 
15
# include "config.h"
 
16
#endif
 
17
 
 
18
#include "sp-title.h"
 
19
#include "xml/repr.h"
 
20
 
 
21
static void sp_title_class_init(SPTitleClass *klass);
 
22
static void sp_title_init(SPTitle *rect);
 
23
static Inkscape::XML::Node *sp_title_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
 
24
 
 
25
static SPObjectClass *title_parent_class;
 
26
 
 
27
GType
 
28
sp_title_get_type (void)
 
29
{
 
30
    static GType title_type = 0;
 
31
 
 
32
    if (!title_type) {
 
33
        GTypeInfo title_info = {
 
34
            sizeof (SPTitleClass),
 
35
            NULL, NULL,
 
36
            (GClassInitFunc) sp_title_class_init,
 
37
            NULL, NULL,
 
38
            sizeof (SPTitle),
 
39
            16,
 
40
            (GInstanceInitFunc) sp_title_init,
 
41
            NULL,    /* value_table */
 
42
        };
 
43
        title_type = g_type_register_static (SP_TYPE_OBJECT, "SPTitle", &title_info, (GTypeFlags)0);
 
44
    }
 
45
    return title_type;
 
46
}
 
47
 
 
48
static void
 
49
sp_title_class_init(SPTitleClass *klass)
 
50
{
 
51
    SPObjectClass *sp_object_class = (SPObjectClass *) klass;
 
52
    title_parent_class = (SPObjectClass *) g_type_class_ref(SP_TYPE_OBJECT);
 
53
 
 
54
    sp_object_class->write = sp_title_write;
 
55
}
 
56
 
 
57
static void
 
58
sp_title_init(SPTitle */*desc*/)
 
59
{
 
60
}
 
61
 
 
62
/*
 
63
 * \brief Writes it's settings to an incoming repr object, if any
 
64
 */
 
65
static Inkscape::XML::Node *
 
66
sp_title_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
 
67
{
 
68
    if (!repr) {
 
69
        repr = SP_OBJECT_REPR (object)->duplicate(doc);
 
70
    }
 
71
 
 
72
    if (((SPObjectClass *) title_parent_class)->write)
 
73
        ((SPObjectClass *) title_parent_class)->write(object, doc, repr, flags);
 
74
 
 
75
    return repr;
 
76
}