-/****************************************************************************
-** $Id: rs_layerlist.cpp 1938 2004-12-09 23:09:53Z andrew $
-**
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-** This file is part of the qcadlib Library project.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid qcadlib Professional Edition licenses may use
-** this file in accordance with the qcadlib Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.ribbonsoft.com for further details.
-**
-** Contact info@ribbonsoft.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
+// rs_layerlist.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -----------------------------------------------------------
+// JLH 06/01/2010 Added this text. :-)
+//
#include "rs_layerlist.h"
-#include "rs_layer.h"
-#include "rs_layerlistlistener.h"
+//#include "rs_layerlistlistener.h"
+#include "rs_debug.h"
#include "rs_entity.h"
+#include "rs_layer.h"
/**
* Default constructor.
activeLayer = layer;
+#if 0
if (notify)
{
for(int i=0; i<layerListListeners.count(); ++i)
RS_DEBUG->print("RS_LayerList::activate listener notified");
}
}
+#endif
RS_DEBUG->print("RS_LayerList::activate end");
}
{
layers.append(layer);
+#if 0
// notify listeners
for(int i=0; i<layerListListeners.count(); ++i)
{
RS_LayerListListener * l = layerListListeners.at(i);
l->layerAdded(layer);
}
+#endif
setModified(true);
// if there was no active layer so far, activate this one.
- if (activeLayer ==NULL)
+ if (activeLayer == NULL)
activate(layer);
}
else
if (idx != -1)
layers.takeAt(idx);
+#if 0
for(int i=0; i<layerListListeners.count(); ++i)
{
RS_LayerListListener * l = layerListListeners.at(i);
l->layerRemoved(layer);
}
+#endif
setModified(true);
*/
void RS_LayerList::edit(RS_Layer * layer, const RS_Layer & source)
{
- if (layer == NULL)
+ if (!layer)
return;
*layer = source;
+#if 0
for(int i=0; i<layerListListeners.count(); ++i)
{
RS_LayerListListener * l = layerListListeners.at(i);
l->layerEdited(layer);
}
+#endif
setModified(true);
}
RS_Layer * ret = NULL;
-// for(RS_Layer * l=layers.first(); l!=NULL; l=layers.next())
for(int i=0; i<layers.size(); i++)
{
RS_Layer * l = layers[i];
*/
void RS_LayerList::toggle(RS_Layer * layer)
{
- if (layer == NULL)
+ if (!layer)
return;
layer->toggle();
+#if 0
// Notify listeners:
for(int i=0; i < layerListListeners.count(); ++i)
{
RS_LayerListListener * l = layerListListeners.at(i);
l->layerToggled(layer);
}
+#endif
}
/**
*/
void RS_LayerList::toggleLock(RS_Layer * layer)
{
- if (layer == NULL)
+ if (!layer)
return;
layer->toggleLock();
+#if 0
// Notify listeners:
for(int i=0; i<layerListListeners.count(); ++i)
{
RS_LayerListListener * l = layerListListeners.at(i);
l->layerToggled(layer);
}
+#endif
}
/**
for(uint l=0; l<count(); l++)
at(l)->freeze(freeze);
+#if 0
for(int i=0; i<layerListListeners.count(); ++i)
{
RS_LayerListListener * l = layerListListeners.at(i);
l->layerToggled(NULL);
}
+#endif
}
+#if 0
/**
* adds a LayerListListener to the list of listeners. Listeners
* are notified when the layer list changes.
if (i != -1)
layerListListeners.takeAt(i);
}
+#endif
/**
* Sets the layer lists modified status to 'm'.