/**
* Default constructor.
*/
-RS_LayerList::RS_LayerList()
+LayerList::LayerList()
{
// Good news, we don't have to screw with this shit
// layers.setAutoDelete(false);
setModified(false);
}
-/*virtual*/ RS_LayerList::~RS_LayerList()
+/*virtual*/ LayerList::~LayerList()
{
}
/**
* Removes all layers in the layerlist.
*/
-void RS_LayerList::clear()
+void LayerList::clear()
{
layers.clear();
setModified(true);
/**
* @return Number of layers in the list.
*/
-uint RS_LayerList::count() const
+uint LayerList::count() const
{
return layers.count();
}
/**
* @return Layer at given position or NULL if i is out of range.
*/
-RS_Layer * RS_LayerList::at(uint i)
+Layer * LayerList::at(uint i)
{
return layers.at(i);
}
*
* @param notify Notify listeners.
*/
-void RS_LayerList::activate(const QString & name, bool notify)
+void LayerList::activate(const QString & name, bool notify)
{
- RS_DEBUG->print("RS_LayerList::activate: %s, notify: %d begin", name.toLatin1().data(), notify);
+ DEBUG->print("LayerList::activate: %s, notify: %d begin", name.toLatin1().data(), notify);
activate(find(name), notify);
/*
if (activeLayer==NULL) {
- RS_DEBUG->print("activeLayer is NULL");
+ DEBUG->print("activeLayer is NULL");
} else {
- RS_DEBUG->print("activeLayer is %s", activeLayer->getName().latin1());
+ DEBUG->print("activeLayer is %s", activeLayer->getName().latin1());
}
*/
- RS_DEBUG->print("RS_LayerList::activate: %s end", name.toLatin1().data());
+ DEBUG->print("LayerList::activate: %s end", name.toLatin1().data());
}
/**
*
* @param notify Notify listeners.
*/
-void RS_LayerList::activate(RS_Layer * layer, bool notify)
+void LayerList::activate(Layer * layer, bool notify)
{
- RS_DEBUG->print("RS_LayerList::activate notify: %d begin", notify);
+ DEBUG->print("LayerList::activate notify: %d begin", notify);
/*if (layer!=NULL) {
- RS_DEBUG->print("RS_LayerList::activate: %s",
+ DEBUG->print("LayerList::activate: %s",
layer->getName().latin1());
} else {
- RS_DEBUG->print("RS_LayerList::activate: NULL");
+ DEBUG->print("LayerList::activate: NULL");
}*/
activeLayer = layer;
{
for(int i=0; i<layerListListeners.count(); ++i)
{
- RS_LayerListListener * l = layerListListeners.at(i);
+ LayerListListener * l = layerListListeners.at(i);
l->layerActivated(activeLayer);
- RS_DEBUG->print("RS_LayerList::activate listener notified");
+ DEBUG->print("LayerList::activate listener notified");
}
}
#endif
- RS_DEBUG->print("RS_LayerList::activate end");
+ DEBUG->print("LayerList::activate end");
}
//! @return The active layer of NULL if no layer is activated.
-RS_Layer * RS_LayerList::getActive()
+Layer * LayerList::getActive()
{
return activeLayer;
}
*
* Listeners are notified.
*/
-void RS_LayerList::add(RS_Layer * layer)
+void LayerList::add(Layer * layer)
{
- RS_DEBUG->print("RS_LayerList::addLayer()");
+ DEBUG->print("LayerList::addLayer()");
if (layer == NULL)
return;
// check if layer already exists:
- RS_Layer * l = find(layer->getName());
+ Layer * l = find(layer->getName());
if (l == NULL)
{
// notify listeners
for(int i=0; i<layerListListeners.count(); ++i)
{
- RS_LayerListListener * l = layerListListeners.at(i);
+ LayerListListener * l = layerListListeners.at(i);
l->layerAdded(layer);
}
#endif
* Listeners are notified after the layer was removed from
* the list but before it gets deleted.
*/
-void RS_LayerList::remove(RS_Layer * layer)
+void LayerList::remove(Layer * layer)
{
- RS_DEBUG->print("RS_LayerList::removeLayer()");
+ DEBUG->print("LayerList::removeLayer()");
if (layer == NULL)
return;
#if 0
for(int i=0; i<layerListListeners.count(); ++i)
{
- RS_LayerListListener * l = layerListListeners.at(i);
+ LayerListListener * l = layerListListeners.at(i);
l->layerRemoved(layer);
}
#endif
* are copied from layer 'source'.
* Listeners are notified.
*/
-void RS_LayerList::edit(RS_Layer * layer, const RS_Layer & source)
+void LayerList::edit(Layer * layer, const Layer & source)
{
if (!layer)
return;
#if 0
for(int i=0; i<layerListListeners.count(); ++i)
{
- RS_LayerListListener * l = layerListListeners.at(i);
+ LayerListListener * l = layerListListeners.at(i);
l->layerEdited(layer);
}
#endif
* @return Pointer to the layer with the given name or
* \p NULL if no such layer was found.
*/
-RS_Layer * RS_LayerList::find(const QString & name)
+Layer * LayerList::find(const QString & name)
{
- //RS_DEBUG->print("RS_LayerList::find begin");
+ //DEBUG->print("LayerList::find begin");
- RS_Layer * ret = NULL;
+ Layer * ret = NULL;
for(int i=0; i<layers.size(); i++)
{
- RS_Layer * l = layers[i];
+ Layer * l = layers[i];
if (l->getName() == name)
ret = l;
}
- //RS_DEBUG->print("RS_LayerList::find end");
+ //DEBUG->print("LayerList::find end");
return ret;
}
* @return Index of the given layer in the layer list or -1 if the layer
* was not found.
*/
-int RS_LayerList::getIndex(const QString & name)
+int LayerList::getIndex(const QString & name)
{
#if 0
- //RS_DEBUG->print("RS_LayerList::find begin");
+ //DEBUG->print("LayerList::find begin");
int ret = -1;
int i = 0;
- for(RS_Layer * l=layers.first(); l!=NULL; l=layers.next())
+ for(Layer * l=layers.first(); l!=NULL; l=layers.next())
{
if (l->getName() == name)
{
i++;
}
- //RS_DEBUG->print("RS_LayerList::find end");
+ //DEBUG->print("LayerList::find end");
return ret;
#else
for(int i=0; i<layers.size(); i++)
{
- RS_Layer * l = layers[i];
+ Layer * l = layers[i];
if (l->getName() == name)
return i;
* @return Index of the given layer in the layer list or -1 if the layer
* was not found.
*/
-int RS_LayerList::getIndex(RS_Layer * layer)
+int LayerList::getIndex(Layer * layer)
{
#if 0
- //RS_DEBUG->print("RS_LayerList::find begin");
+ //DEBUG->print("LayerList::find begin");
int ret = -1;
int i = 0;
- for(RS_Layer* l=layers.first(); l!=NULL; l=layers.next())
+ for(Layer* l=layers.first(); l!=NULL; l=layers.next())
{
if (l == layer)
{
i++;
}
- //RS_DEBUG->print("RS_LayerList::find end");
+ //DEBUG->print("LayerList::find end");
return ret;
#else
* Switches on / off the given layer.
* Listeners are notified.
*/
-void RS_LayerList::toggle(const QString & name)
+void LayerList::toggle(const QString & name)
{
toggle(find(name));
}
* Switches on / off the given layer.
* Listeners are notified.
*/
-void RS_LayerList::toggle(RS_Layer * layer)
+void LayerList::toggle(Layer * layer)
{
if (!layer)
return;
// Notify listeners:
for(int i=0; i < layerListListeners.count(); ++i)
{
- RS_LayerListListener * l = layerListListeners.at(i);
+ LayerListListener * l = layerListListeners.at(i);
l->layerToggled(layer);
}
#endif
* Locks or unlocks the given layer.
* Listeners are notified.
*/
-void RS_LayerList::toggleLock(RS_Layer * layer)
+void LayerList::toggleLock(Layer * layer)
{
if (!layer)
return;
// Notify listeners:
for(int i=0; i<layerListListeners.count(); ++i)
{
- RS_LayerListListener * l = layerListListeners.at(i);
+ LayerListListener * l = layerListListeners.at(i);
l->layerToggled(layer);
}
#endif
*
* @param freeze true: freeze, false: defreeze
*/
-void RS_LayerList::freezeAll(bool freeze)
+void LayerList::freezeAll(bool freeze)
{
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);
+ LayerListListener * l = layerListListeners.at(i);
l->layerToggled(NULL);
}
#endif
*
* Typical listeners are: layer list widgets, pen toolbar, graphic view
*/
-void RS_LayerList::addListener(RS_LayerListListener * listener)
+void LayerList::addListener(LayerListListener * listener)
{
layerListListeners.append(listener);
}
/**
* removes a LayerListListener from the list of listeners.
*/
-void RS_LayerList::removeListener(RS_LayerListListener * listener)
+void LayerList::removeListener(LayerListListener * listener)
{
// layerListListeners.remove(listener);
/**
* Sets the layer lists modified status to 'm'.
*/
-void RS_LayerList::setModified(bool m)
+void LayerList::setModified(bool m)
{
modified = m;
}
* @retval true The layer list has been modified.
* @retval false The layer list has not been modified.
*/
-/*virtual*/ bool RS_LayerList::isModified() const
+/*virtual*/ bool LayerList::isModified() const
{
return modified;
}
/**
* Dumps the layers to stdout.
*/
-std::ostream & operator<<(std::ostream & os, RS_LayerList & l)
+std::ostream & operator<<(std::ostream & os, LayerList & l)
{
os << "Layerlist: \n";