/*
* Editable view implementation
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
* bulia byak <buliabyak@users.sf.net>
* Ralf Stephan <ralf@ark.in-berlin.de>
* John Bintz <jcoswell@coswellproductions.org>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
* Copyright (C) 2007 Jon A. Cruz
* Copyright (C) 2006-2008 Johan Engelen
* Copyright (C) 2006 John Bintz
* Copyright (C) 2004 MenTaLguY
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "document.h"
#include "layer-fns.h"
#include "layer-model.h"
#include "object-hierarchy.h"
#include "sp-defs.h"
#include "sp-item.h"
#include "sp-item-group.h"
#include "sp-object.h"
#include "sp-root.h"
#include <glib.h>
// Callbacks
namespace Inkscape {
: _doc( 0 )
, _layer_hierarchy( 0 )
, _display_key( 0 )
{
}
LayerModel::~LayerModel()
{
if (_layer_hierarchy) {
delete _layer_hierarchy;
// _layer_hierarchy = NULL; //this should be here, but commented to find other bug somewhere else.
}
}
{
if (_layer_hierarchy) {
delete _layer_hierarchy;
}
}
{
}
{
return _doc;
}
/**
* Returns current root (=bottom) layer.
*/
{
}
/**
* Returns current top layer.
*/
{
}
/**
* Resets the bottom layer to the current root
*/
if (_layer_hierarchy) {
}
}
/**
* Sets the current layer of the desktop.
*
* Make \a object the top layer.
*/
g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) );
// printf("Set Layer to ID: %s\n", object->getId());
}
for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), currentRoot()); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) {
}
}
for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), currentRoot()); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) {
}
}
g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) );
bool othersLocked = false;
for ( SPObject* obj = Inkscape::next_layer(currentRoot(), object); obj; obj = Inkscape::next_layer(currentRoot(), obj) ) {
// Dont lock any ancestors, since that would in turn lock the layer as well
}
}
for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), object); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) {
}
}
}
}
}
g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) );
bool othersShowing = false;
for ( SPObject* obj = Inkscape::next_layer(currentRoot(), object); obj; obj = Inkscape::next_layer(currentRoot(), obj) ) {
// Don't hide ancestors, since that would in turn hide the layer as well
}
}
for ( SPObject* obj = Inkscape::previous_layer(currentRoot(), object); obj; obj = Inkscape::previous_layer(currentRoot(), obj) ) {
}
}
}
}
}
/**
* Return layer that contains \a object.
*/
// Objects in defs have no layer and are NOT in the root layer
if(SP_IS_DEFS(object))
return NULL;
}
return object;
}
/**
* True if object is a layer.
*/
return ( SP_IS_GROUP(object)
}
} // namespace Inkscape
/// Callback
static void
}
/// Callback
static void
}
/// Callback
static void
{
}
/*
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 :