Prevent compiler warnings about unused parameters.
[synfig.git] / synfig-core / trunk / src / synfig / layer.cpp
index 7d15019..0d4f398 100644 (file)
@@ -2,19 +2,20 @@
 /*!    \file layer.cpp
 **     \brief Layer class implementation
 **
-**     $Id: layer.cpp,v 1.2 2005/01/24 03:08:17 darco Exp $
+**     $Id$
 **
 **     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
 **
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
+**     This package is distributed in the hope that it will be useful,
+**     but WITHOUT ANY WARRANTY; without even the implied warranty of
+**     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+**     General Public License for more details.
 **     \endlegal
 */
 /* ========================================================================= */
@@ -97,11 +98,10 @@ Layer::subsys_init()
 #define INCLUDE_LAYER(class)   synfig::Layer::book()[synfig::String(class::name__)]=BookEntry(class::create,class::name__,class::local_name__,class::category__,class::cvs_id__,class::version__)
 #define LAYER_ALIAS(class,alias)       synfig::Layer::book()[synfig::String(alias)]=synfig::Layer::BookEntry(class::create,alias,alias,_("Do Not Use"),class::cvs_id__,class::version__);
 
-       INCLUDE_LAYER(Layer_SolidColor);
-       INCLUDE_LAYER(Layer_PasteCanvas);
-       INCLUDE_LAYER(Layer_Polygon);
-       LAYER_ALIAS(Layer_Polygon,"Polygon");
-       INCLUDE_LAYER(Layer_MotionBlur);
+       INCLUDE_LAYER(Layer_SolidColor);        LAYER_ALIAS(Layer_SolidColor,"SolidColor");
+       INCLUDE_LAYER(Layer_PasteCanvas);       LAYER_ALIAS(Layer_PasteCanvas,"PasteCanvas");
+       INCLUDE_LAYER(Layer_Polygon);           LAYER_ALIAS(Layer_Polygon,"Polygon");
+       INCLUDE_LAYER(Layer_MotionBlur);        LAYER_ALIAS(Layer_MotionBlur,"MotionBlur");
 
 #undef INCLUDE_LAYER
 
@@ -132,7 +132,7 @@ synfig::Layer::create(const String &name)
        {
                return Layer::LooseHandle(new Layer_Mime(name));
        }
-       
+
        Layer* layer(book()[name].factory());
        return Layer::LooseHandle(layer);
 }
@@ -145,15 +145,15 @@ synfig::Layer::~Layer()
                remove_child(dynamic_param_list_.begin()->second.get());
                dynamic_param_list_.erase(dynamic_param_list_.begin());
        }
-       
+
        remove_from_all_groups();
-       
+
        parent_death_connect_.disconnect();
        begin_delete();
 }
 
 void
-synfig::Layer::set_canvas(etl::loose_handle<synfig::Canvas> x)
+synfig::Layer::set_canvas(etl::loose_handle<Canvas> x)
 {
        if(canvas_!=x)
        {
@@ -212,7 +212,7 @@ Layer::set_description(const String& x)
        if(description_!=x)
        {
                description_=x;
-               signal_description_changed_();          
+               signal_description_changed_();
        }
 }
 
@@ -223,19 +223,19 @@ Layer::connect_dynamic_param(const String& param, etl::loose_handle<ValueNode> v
 
        if(previous==value_node)
                return true;
-       
+
        dynamic_param_list_[param]=ValueNode::Handle(value_node);
-       
+
        if(previous)
                remove_child(previous.get());
-       
+
        add_child(value_node.get());
-       
+
        if(!value_node->is_exported() && get_canvas())
        {
                value_node->set_parent_canvas(get_canvas());
        }
-       
+
        changed();
        return true;
 }
@@ -265,7 +265,7 @@ Layer::on_changed()
 bool
 Layer::set_param(const String &param, const ValueBase &value)
 {
-       if(param=="z_depth" && value.same_as(z_depth_))
+       if(param=="z_depth" && value.same_type_as(z_depth_))
        {
                z_depth_=value.get(z_depth_);
                return true;
@@ -302,16 +302,16 @@ Layer::Handle
 Layer::clone(const GUID& deriv_guid) const
 {
        if(!book().count(get_name())) return 0;
-       
+
        //Layer *ret = book()[get_name()].factory();//create(get_name()).get();
        Handle ret = create(get_name()).get();
-       
+
        ret->group_=group_;
        //ret->set_canvas(get_canvas());
        ret->set_description(get_description());
        ret->set_active(active());
        ret->set_guid(get_guid()^deriv_guid);
-       
+
        //ret->set_param_list(get_param_list());
        // Process the parameter list sothat
        // we can duplicate any inlinecanvases
@@ -320,10 +320,10 @@ Layer::clone(const GUID& deriv_guid) const
        {
                if(dynamic_param_list().count(iter->first)==0 && iter->second.get_type()==ValueBase::TYPE_CANVAS)
                {
-                       
+
                        // This parameter is a canvas.  We need a close look.
                        Canvas::Handle canvas(iter->second.get(Canvas::Handle()));
-                       if(canvas->is_inline())
+                       if(canvas && canvas->is_inline())
                        {
                                // This parameter is an inlinecanvas! we need to clone it
                                // before we set it as aparameter.
@@ -333,11 +333,11 @@ Layer::clone(const GUID& deriv_guid) const
                                continue;
                        }
                }
-               
+
                // This is a normal parameter,go ahead and set it.
                ret->set_param(iter->first, iter->second);
        }
-               
+
        // Duplicate the dynamic paramlist, but only the exported data nodes
        DynamicParamList::const_iterator iter;
        for(iter=dynamic_param_list().begin();iter!=dynamic_param_list().end();++iter)
@@ -354,7 +354,7 @@ Layer::clone(const GUID& deriv_guid) const
                                continue;
                        }
                }
-               
+
                if(iter->second->is_exported())
                        ret->connect_dynamic_param(iter->first,iter->second);
                else
@@ -362,7 +362,7 @@ Layer::clone(const GUID& deriv_guid) const
        }
 
        //ret->set_canvas(0);
-       
+
        return ret;
 }
 
@@ -425,7 +425,7 @@ Layer::get_version()const
 }
 
 bool
-Layer::set_version(const String &ver)
+Layer::set_version(const String &/*ver*/)
 {
        return false;
 }
@@ -466,7 +466,7 @@ Layer::hit_check(synfig::Context context, const synfig::Point &pos)const
 **     is anything but accelerated...
 */
 bool
-Layer::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)  const
+Layer::accelerated_render(Context context,Surface *surface,int /*quality*/, const RendDesc &renddesc, ProgressCallback *cb)  const
 {
        handle<Target> target=surface_target(surface);
        if(!target)
@@ -521,10 +521,10 @@ Layer::get_times_vfunc(Node::time_set &set) const
 {
        DynamicParamList::const_iterator        i = dynamic_param_list_.begin(),
                                                                                end = dynamic_param_list_.end();
-               
+
        for(; i != end; ++i)
        {
-               const Node::time_set &tset = i->second->get_times();            
+               const Node::time_set &tset = i->second->get_times();
                set.insert(tset.begin(),tset.end());
        }
 }
@@ -540,14 +540,14 @@ Layer::add_to_group(const String&x)
        group_=x;
        signal_added_to_group()(group_);
 }
-       
+
 void
 Layer::remove_from_group(const String&x)
 {
        if(group_==x)
                remove_from_all_groups();
 }
-       
+
 void
 Layer::remove_from_all_groups()
 {
@@ -556,7 +556,7 @@ Layer::remove_from_all_groups()
        signal_removed_from_group()(group_);
        group_.clear();
 }
-       
+
 String
 Layer::get_group()const
 {