layer-manager.h revision b45b3ca12c271745b18a142d10a6ac8efd9f79cc
273e421813f295d65aab512f508e8fb575d997d4gouldtj/*
273e421813f295d65aab512f508e8fb575d997d4gouldtj * Inkscape::LayerManager - a view of a document's layers, relative
273e421813f295d65aab512f508e8fb575d997d4gouldtj * to a particular desktop
273e421813f295d65aab512f508e8fb575d997d4gouldtj *
273e421813f295d65aab512f508e8fb575d997d4gouldtj * Copyright 2006 MenTaLguY <mental@rydia.net>
273e421813f295d65aab512f508e8fb575d997d4gouldtj *
273e421813f295d65aab512f508e8fb575d997d4gouldtj * Released under GNU GPL, read the file 'COPYING' for more information
273e421813f295d65aab512f508e8fb575d997d4gouldtj */
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtj#ifndef SEEN_INKSCAPE_LAYER_MANAGER_H
273e421813f295d65aab512f508e8fb575d997d4gouldtj#define SEEN_INKSCAPE_LAYER_MANAGER_H
273e421813f295d65aab512f508e8fb575d997d4gouldtj
5cf507fca7719ae9280d0a5199e024e920f1284dAlex Valavanis#include "document-subset.h"
273e421813f295d65aab512f508e8fb575d997d4gouldtj#include "gc-finalized.h"
273e421813f295d65aab512f508e8fb575d997d4gouldtj#include "gc-soft-ptr.h"
273e421813f295d65aab512f508e8fb575d997d4gouldtj#include <vector>
273e421813f295d65aab512f508e8fb575d997d4gouldtj#include <map>
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtjclass SPDesktop;
273e421813f295d65aab512f508e8fb575d997d4gouldtjclass Document;
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtjnamespace Inkscape {
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtjclass LayerManager : public DocumentSubset,
273e421813f295d65aab512f508e8fb575d997d4gouldtj public GC::Finalized
273e421813f295d65aab512f508e8fb575d997d4gouldtj{
273e421813f295d65aab512f508e8fb575d997d4gouldtjpublic:
273e421813f295d65aab512f508e8fb575d997d4gouldtj LayerManager(SPDesktop *desktop);
273e421813f295d65aab512f508e8fb575d997d4gouldtj virtual ~LayerManager();
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtj void setCurrentLayer( SPObject* obj );
273e421813f295d65aab512f508e8fb575d997d4gouldtj void renameLayer( SPObject* obj, gchar const *label, bool uniquify );
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtj sigc::connection connectCurrentLayerChanged(const sigc::slot<void, SPObject *> & slot) {
273e421813f295d65aab512f508e8fb575d997d4gouldtj return _layer_changed_signal.connect(slot);
273e421813f295d65aab512f508e8fb575d997d4gouldtj }
e4a9f366dbcb54f76b8c42869fa6873808132357gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtj sigc::connection connectLayerDetailsChanged(const sigc::slot<void, SPObject *> & slot) {
273e421813f295d65aab512f508e8fb575d997d4gouldtj return _details_changed_signal.connect(slot);
57e8d5fd57a890842b51a13207e222fcf953816cJazzyNico }
57e8d5fd57a890842b51a13207e222fcf953816cJazzyNico
273e421813f295d65aab512f508e8fb575d997d4gouldtjprivate:
273e421813f295d65aab512f508e8fb575d997d4gouldtj friend class LayerWatcher;
273e421813f295d65aab512f508e8fb575d997d4gouldtj class LayerWatcher;
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtj void _objectModified( SPObject* obj, guint flags );
a649057d824379292b26fc4d4cc99ba46b9eb26eKris void _setDocument(Document *document);
273e421813f295d65aab512f508e8fb575d997d4gouldtj void _rebuild();
273e421813f295d65aab512f508e8fb575d997d4gouldtj void _selectedLayerChanged(SPObject *layer);
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtj sigc::connection _layer_connection;
273e421813f295d65aab512f508e8fb575d997d4gouldtj sigc::connection _document_connection;
273e421813f295d65aab512f508e8fb575d997d4gouldtj sigc::connection _resource_connection;
273e421813f295d65aab512f508e8fb575d997d4gouldtj
273e421813f295d65aab512f508e8fb575d997d4gouldtj GC::soft_ptr<SPDesktop> _desktop;
Document *_document;
std::vector<LayerWatcher*> _watchers;
sigc::signal<void, SPObject *> _layer_changed_signal;
sigc::signal<void, SPObject *> _details_changed_signal;
};
}
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :