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

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/layer-manager.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
/*
 
2
 * Inkscape::LayerManager - a view of a document's layers, relative
 
3
 *                          to a particular desktop
 
4
 *
 
5
 * Copyright 2006  MenTaLguY  <mental@rydia.net>
 
6
 *
 
7
 * Released under GNU GPL, read the file 'COPYING' for more information
 
8
 */
 
9
 
 
10
#ifndef SEEN_INKSCAPE_LAYER_MANAGER_H
 
11
#define SEEN_INKSCAPE_LAYER_MANAGER_H
 
12
 
 
13
#include "document-subset.h"
 
14
#include "gc-finalized.h"
 
15
#include "gc-soft-ptr.h"
 
16
#include <vector>
 
17
#include <map>
 
18
 
 
19
class SPDesktop;
 
20
class SPDocument;
 
21
 
 
22
namespace Inkscape {
 
23
 
 
24
class LayerManager : public DocumentSubset,
 
25
                     public GC::Finalized
 
26
{
 
27
public:
 
28
    LayerManager(SPDesktop *desktop);
 
29
    virtual ~LayerManager();
 
30
 
 
31
    void setCurrentLayer( SPObject* obj );
 
32
    void renameLayer( SPObject* obj, gchar const *label, bool uniquify );
 
33
 
 
34
    sigc::connection connectCurrentLayerChanged(const sigc::slot<void, SPObject *> & slot) {
 
35
        return _layer_changed_signal.connect(slot);
 
36
    }
 
37
 
 
38
    sigc::connection connectLayerDetailsChanged(const sigc::slot<void, SPObject *> & slot) {
 
39
        return _details_changed_signal.connect(slot);
 
40
    }
 
41
 
 
42
private:
 
43
    friend class LayerWatcher;
 
44
    class LayerWatcher;
 
45
 
 
46
    void _objectModified( SPObject* obj, guint flags );
 
47
    void _setDocument(SPDocument *document);
 
48
    void _rebuild();
 
49
    void _selectedLayerChanged(SPObject *layer);
 
50
 
 
51
    sigc::connection _layer_connection;
 
52
    sigc::connection _document_connection;
 
53
    sigc::connection _resource_connection;
 
54
 
 
55
    GC::soft_ptr<SPDesktop> _desktop;
 
56
    SPDocument *_document;
 
57
 
 
58
    std::vector<LayerWatcher*> _watchers;
 
59
 
 
60
    sigc::signal<void, SPObject *>     _layer_changed_signal;
 
61
    sigc::signal<void, SPObject *>     _details_changed_signal;
 
62
};
 
63
 
 
64
}
 
65
 
 
66
#endif
 
67
/*
 
68
  Local Variables:
 
69
  mode:c++
 
70
  c-file-style:"stroustrup"
 
71
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
72
  indent-tabs-mode:nil
 
73
  fill-column:99
 
74
  End:
 
75
*/
 
76
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :