document.h revision 3c6c66c964b787706a0048cfd6123c2524e00a15
#ifndef SEEN_SP_DOCUMENT_H
#define SEEN_SP_DOCUMENT_H
/** \file
* SPDocument: Typed SVG document implementation
*/
/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
* Copyright (C) 2004-2005 MenTaLguY
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <stddef.h>
#include "libcroco/cr-cascade.h"
#include "gc-managed.h"
#include "gc-finalized.h"
#include "gc-anchored.h"
#include <vector>
}
struct SPGroup;
struct SPRoot;
struct SPUnit;
struct Application;
struct Document;
}
}
struct Persp3D;
}
struct SPDocumentPrivate;
/// Typed SVG document implementation.
{
// Note: multiple public and private sections is not a good practice, but happens
// in this class as transitional to fixing encapsulation:
SPDocument();
virtual ~SPDocument();
unsigned int keepalive : 1;
unsigned int modified_since_save : 1;
/// Last action key
/// Handler ID
/// Connector rerouting handler ID
// Instance of the connector router
bool oldSignalsConnected;
/** Returns our SPRoot */
/** Our Inkscape::XML::Document. */
/** A filename (not a URI yet), or NULL */
/** To be used for resolving relative hrefs. */
/** basename(uri) or other human-readable label for the document. */
/** Return the main defs object for the document. */
inline void setCurrentPersp3DImpl(Persp3DImpl * const persp_impl) { current_persp3d_impl = persp_impl; }
/*
* getCurrentPersp3D returns current_persp3d (if non-NULL) or the first
* perspective in the defs. If no perspective exists, returns NULL.
*/
Persp3D * getCurrentPersp3D();
unsigned int numPerspectivesInDefs() const {
}
void collectOrphans();
void _emitModified();
bool _updateDocument();
/// Are we currently in a transition between two "known good" states of the document?
bool isSeeking() const;
bool isModifiedSinceSave() const { return modified_since_save; }
void setModifiedSinceSave(bool modified = true);
Persp3D *current_persp3d; /**< Currently 'active' perspective (to which, e.g., newly created boxes are attached) */
void emitReconstructionStart(void);
void emitReconstructionFinish(void);
unsigned long serial() const;
sigc::connection connectResourcesChanged(const gchar *key, SPDocument::ResourcesChangedSignal::slot_type slot);
/**
* Returns the bottommost item from the list which is at the point, or NULL if none.
*/
static SPItem *getItemFromListAtPointBottom(unsigned int dkey, SPGroup *group, const GSList *list, Geom::Point const p, bool take_insensitive = false);
// ToDo - Merge createDoc with createNewDoc
static SPDocument *createDoc(Inkscape::XML::Document *rdoc, gchar const *uri, gchar const *base, gchar const *name, unsigned int keepalive);
SPDocument *doRef();
SPDocument *doUnref();
void requestModified();
SPItem *getItemAtPoint(unsigned int key, Geom::Point const p, gboolean into_groups, SPItem *upto = NULL) const;
unsigned int vacuumDocument();
};
struct SPUnit;
/*
* Ideas: How to overcome style invalidation nightmare
*
* 1. There is reference request dictionary, that contains
* objects (styles) needing certain id. Object::build checks
* final id against it, and invokes necesary methods
*
* 2. Removing referenced object is simply prohibited -
* needs analyse, how we can deal with situations, where
* we simply want to ungroup etc. - probably we need
* Repr::reparent method :( [Or was it ;)]
*
*/
#endif // SEEN_SP_DOCUMENT_H
/*
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:fileencoding=utf-8:textwidth=99 :