Rename ValueBase::same_as() to ValueBase::same_type_as(), since it compares types...
[synfig.git] / synfig-core / trunk / src / modules / mod_geometry / star.cpp
index 2e5bac0..e317d0c 100644 (file)
@@ -1,18 +1,22 @@
-/*! ========================================================================
-** Sinfg
-** Template File
-** $Id: star.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $
+/* === S Y N F I G ========================================================= */
+/*!    \file star.cpp
+**     \brief Template Header
 **
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**     $Id$
 **
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+**     \legal
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **
-** 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 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.
+**
+**     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
 **
 ** === N O T E S ===========================================================
 **
 #include <ETL/bezier>
 #include <ETL/hermite>
 
-#include <sinfg/string.h>
-#include <sinfg/time.h>
-#include <sinfg/context.h>
-#include <sinfg/paramdesc.h>
-#include <sinfg/renddesc.h>
-#include <sinfg/surface.h>
-#include <sinfg/value.h>
-#include <sinfg/valuenode.h>
-#include <sinfg/segment.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
+#include <synfig/context.h>
+#include <synfig/paramdesc.h>
+#include <synfig/renddesc.h>
+#include <synfig/surface.h>
+#include <synfig/value.h>
+#include <synfig/valuenode.h>
+#include <synfig/segment.h>
 
 #endif
 
@@ -52,12 +56,12 @@ using namespace etl;
 
 /* === G L O B A L S ======================================================= */
 
-SINFG_LAYER_INIT(Star);
-SINFG_LAYER_SET_NAME(Star,"star");
-SINFG_LAYER_SET_LOCAL_NAME(Star,_("Star"));
-SINFG_LAYER_SET_CATEGORY(Star,_("Geometry"));
-SINFG_LAYER_SET_VERSION(Star,"0.1");
-SINFG_LAYER_SET_CVS_ID(Star,"$Id: star.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $");
+SYNFIG_LAYER_INIT(Star);
+SYNFIG_LAYER_SET_NAME(Star,"star");
+SYNFIG_LAYER_SET_LOCAL_NAME(Star,_("Star"));
+SYNFIG_LAYER_SET_CATEGORY(Star,_("Geometry"));
+SYNFIG_LAYER_SET_VERSION(Star,"0.1");
+SYNFIG_LAYER_SET_CVS_ID(Star,"$Id$");
 
 /* === P R O C E D U R E S ================================================= */
 
@@ -79,7 +83,7 @@ Star::sync()
 {
        Angle dist_between_points(Angle::rot(1)/float(points));
        std::vector<Point> vector_list;
-       
+
        int i;
        for(i=0;i<points;i++)
        {
@@ -95,21 +99,21 @@ Star::sync()
 bool
 Star::set_param(const String & param, const ValueBase &value)
 {
-       if(     param=="radius1" && value.same_as(radius1))
+       if(     param=="radius1" && value.same_type_as(radius1))
        {
                value.put(&radius1);
                sync();
                return true;
        }
 
-       if(     param=="radius2" && value.same_as(radius2))
+       if(     param=="radius2" && value.same_type_as(radius2))
        {
                value.put(&radius2);
                sync();
                return true;
        }
 
-       if(     param=="points" && value.same_as(points))
+       if(     param=="points" && value.same_type_as(points))
        {
                value.put(&points);
                if(points<2)points=2;
@@ -117,7 +121,7 @@ Star::set_param(const String & param, const ValueBase &value)
                return true;
        }
 
-       if(     param=="angle" && value.same_as(angle))
+       if(     param=="angle" && value.same_type_as(angle))
        {
                value.put(&angle);
                sync();
@@ -142,7 +146,7 @@ Star::get_param(const String& param)const
        EXPORT_VERSION();
 
        if(param=="vector_list")
-               return ValueBase();     
+               return ValueBase();
 
        return Layer_Polygon::get_param(param);
 }