]> Shamusworld >> Repos - architektonas/blobdiff - src/base/layerlist.cpp
Removed unnecessary RS_ prefix from classes and whatnot.
[architektonas] / src / base / layerlist.cpp
index d46890488f44866ff582ae957493765151b10596..4196381092c7df92657e5d868ddb174502d8917f 100644 (file)
@@ -24,7 +24,7 @@
 /**
  * Default constructor.
  */
-RS_LayerList::RS_LayerList()
+LayerList::LayerList()
 {
 // Good news, we don't have to screw with this shit
 //     layers.setAutoDelete(false);
@@ -33,14 +33,14 @@ RS_LayerList::RS_LayerList()
        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);
@@ -49,7 +49,7 @@ void RS_LayerList::clear()
 /**
  * @return Number of layers in the list.
  */
-uint RS_LayerList::count() const
+uint LayerList::count() const
 {
        return layers.count();
 }
@@ -57,7 +57,7 @@ uint RS_LayerList::count() const
 /**
  * @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);
 }
@@ -67,20 +67,20 @@ RS_Layer * RS_LayerList::at(uint 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());
 }
 
 /**
@@ -88,15 +88,15 @@ void RS_LayerList::activate(const QString & name, bool notify)
  *
  * @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;
@@ -106,18 +106,18 @@ void RS_LayerList::activate(RS_Layer * layer, bool notify)
        {
                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;
 }
@@ -130,15 +130,15 @@ RS_Layer * RS_LayerList::getActive()
  *
  * 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)
        {
@@ -148,7 +148,7 @@ void RS_LayerList::add(RS_Layer * layer)
                // 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
@@ -177,9 +177,9 @@ void RS_LayerList::add(RS_Layer * layer)
  * 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;
@@ -194,7 +194,7 @@ void RS_LayerList::remove(RS_Layer * layer)
 #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
@@ -214,7 +214,7 @@ void RS_LayerList::remove(RS_Layer * layer)
  * 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;
@@ -224,7 +224,7 @@ void RS_LayerList::edit(RS_Layer * layer, const RS_Layer & source)
 #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
@@ -236,21 +236,21 @@ void RS_LayerList::edit(RS_Layer * layer, const RS_Layer & source)
  * @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;
 }
@@ -259,15 +259,15 @@ RS_Layer * RS_LayerList::find(const QString & name)
  * @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)
                {
@@ -278,13 +278,13 @@ int RS_LayerList::getIndex(const QString & 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;
@@ -298,15 +298,15 @@ int RS_LayerList::getIndex(const QString & name)
  * @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)
                {
@@ -317,7 +317,7 @@ int RS_LayerList::getIndex(RS_Layer * layer)
                i++;
        }
 
-       //RS_DEBUG->print("RS_LayerList::find end");
+       //DEBUG->print("LayerList::find end");
 
        return ret;
 #else
@@ -329,7 +329,7 @@ int RS_LayerList::getIndex(RS_Layer * layer)
  * 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));
 }
@@ -338,7 +338,7 @@ void RS_LayerList::toggle(const QString & 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;
@@ -349,7 +349,7 @@ void RS_LayerList::toggle(RS_Layer * layer)
        // 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
@@ -359,7 +359,7 @@ void RS_LayerList::toggle(RS_Layer * layer)
  * Locks or unlocks the given layer.
  * Listeners are notified.
  */
-void RS_LayerList::toggleLock(RS_Layer * layer)
+void LayerList::toggleLock(Layer * layer)
 {
        if (!layer)
                return;
@@ -370,7 +370,7 @@ void RS_LayerList::toggleLock(RS_Layer * layer)
        // 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
@@ -381,7 +381,7 @@ void RS_LayerList::toggleLock(RS_Layer * layer)
  *
  * @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);
@@ -389,7 +389,7 @@ void RS_LayerList::freezeAll(bool 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
@@ -402,7 +402,7 @@ void RS_LayerList::freezeAll(bool freeze)
  *
  * 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);
 }
@@ -410,7 +410,7 @@ void RS_LayerList::addListener(RS_LayerListListener * listener)
 /**
  * removes a LayerListListener from the list of listeners.
  */
-void RS_LayerList::removeListener(RS_LayerListListener * listener)
+void LayerList::removeListener(LayerListListener * listener)
 {
 //     layerListListeners.remove(listener);
 
@@ -424,7 +424,7 @@ void RS_LayerList::removeListener(RS_LayerListListener * listener)
 /**
  * Sets the layer lists modified status to 'm'.
  */
-void RS_LayerList::setModified(bool m)
+void LayerList::setModified(bool m)
 {
        modified = m;
 }
@@ -433,7 +433,7 @@ void RS_LayerList::setModified(bool 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;
 }
@@ -441,7 +441,7 @@ void RS_LayerList::setModified(bool m)
 /**
  * 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";