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

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/sp-tref-reference.h

  • 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
#ifndef SEEN_SP_TREF_REFERENCE_H
 
2
#define SEEN_SP_TREF_REFERENCE_H
 
3
 
 
4
/*
 
5
 * The reference corresponding to href of <tref> element.
 
6
 * 
 
7
 * This file was created based on sp-use-reference.h
 
8
 *
 
9
 * Copyright (C) 2007 Gail Banaszkiewicz
 
10
 *
 
11
 * Released under GNU GPL, read the file 'COPYING' for more information.
 
12
 */
 
13
 
 
14
#include <forward.h>
 
15
#include <uri-references.h>
 
16
#include <sigc++/sigc++.h>
 
17
 
 
18
#include "util/share.h"
 
19
#include "xml/node-observer.h"
 
20
#include "xml/subtree.h"
 
21
 
 
22
 
 
23
class SPTRefReference : public Inkscape::URIReference,
 
24
                        public Inkscape::XML::NodeObserver {
 
25
public:
 
26
    SPTRefReference(SPObject *owner) : URIReference(owner), subtreeObserved(NULL) {
 
27
        updateObserver();
 
28
    }
 
29
    
 
30
    virtual ~SPTRefReference() {
 
31
        if (subtreeObserved) {
 
32
            subtreeObserved->removeObserver(*this);
 
33
            delete subtreeObserved;
 
34
        }   
 
35
    }
 
36
 
 
37
    SPItem *getObject() const {
 
38
        return (SPItem *)URIReference::getObject();
 
39
    }
 
40
   
 
41
    void updateObserver();
 
42
    
 
43
    /////////////////////////////////////////////////////////////////////
 
44
    // Node Observer Functions
 
45
    // -----------------------
 
46
    virtual void notifyChildAdded(Inkscape::XML::Node &node, Inkscape::XML::Node &child, Inkscape::XML::Node *prev);
 
47
    virtual void notifyChildRemoved(Inkscape::XML::Node &node, Inkscape::XML::Node &child, Inkscape::XML::Node *prev);
 
48
    virtual void notifyChildOrderChanged(Inkscape::XML::Node &node, Inkscape::XML::Node &child,
 
49
                                         Inkscape::XML::Node *old_prev, Inkscape::XML::Node *new_prev);
 
50
    virtual void notifyContentChanged(Inkscape::XML::Node &node,
 
51
                                      Inkscape::Util::ptr_shared<char> old_content,
 
52
                                      Inkscape::Util::ptr_shared<char> new_content);
 
53
    virtual void notifyAttributeChanged(Inkscape::XML::Node &node, GQuark name,
 
54
                                        Inkscape::Util::ptr_shared<char> old_value,
 
55
                                        Inkscape::Util::ptr_shared<char> new_value);
 
56
    /////////////////////////////////////////////////////////////////////
 
57
 
 
58
protected:
 
59
    virtual bool _acceptObject(SPObject * obj) const; 
 
60
    
 
61
    Inkscape::XML::Subtree *subtreeObserved; 
 
62
};
 
63
 
 
64
#endif /* !SEEN_SP_TREF_REFERENCE_H */
 
65
 
 
66
/*
 
67
  Local Variables:
 
68
  mode:c++
 
69
  c-file-style:"stroustrup"
 
70
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
71
  indent-tabs-mode:nil
 
72
  fill-column:99
 
73
  End:
 
74
*/
 
75
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :