Add parameter static option for more layers
authorCarlos Lopez <genetita@gmail.com>
Sun, 29 Aug 2010 08:17:42 +0000 (10:17 +0200)
committerCarlos Lopez <genetita@gmail.com>
Sun, 29 Aug 2010 08:17:42 +0000 (10:17 +0200)
synfig-core/src/modules/lyr_std/clamp.cpp
synfig-core/src/modules/lyr_std/julia.cpp
synfig-core/src/modules/lyr_std/mandelbrot.cpp
synfig-core/src/modules/mod_filter/lumakey.cpp
synfig-core/src/modules/mod_geometry/checkerboard.cpp
synfig-core/src/modules/mod_geometry/outline.cpp
synfig-core/src/modules/mod_geometry/rectangle.cpp
synfig-core/src/synfig/layer_polygon.cpp
synfig-core/src/synfig/layer_solidcolor.cpp

index 14b4c41..eafb048 100644 (file)
@@ -68,6 +68,8 @@ Layer_Clamp::Layer_Clamp():
        ceiling(1.0f),
        floor(0.0f)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 inline Color
index ad2478e..4061b28 100644 (file)
@@ -118,6 +118,8 @@ Julia::Julia():color_shift(angle::degrees(0))
 
        bailout=4;
        lp=log(log(bailout));
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool
@@ -144,6 +146,7 @@ Julia::set_param(const String & param, const ValueBase &value)
        IMPORT(smooth_outside);
        IMPORT(broken);
 
+// TODO: Use IMPORT_PLUS
        if(param=="iterations" && value.same_type_as(iterations))
        {
                iterations=value.get(iterations);
@@ -151,6 +154,7 @@ Julia::set_param(const String & param, const ValueBase &value)
                        iterations=0;
                if(iterations>500000)
                        iterations=500000;
+               set_param_static(param, value.get_static());
                return true;
        }
        if(param=="bailout" && value.same_type_as(bailout))
@@ -158,6 +162,7 @@ Julia::set_param(const String & param, const ValueBase &value)
                bailout=value.get(bailout);
                bailout*=bailout;
                lp=log(log(bailout));
+               set_param_static(param, value.get_static());
                return true;
        }
 
@@ -188,7 +193,11 @@ Julia::get_param(const String & param)const
        EXPORT(broken);
 
        if(param=="bailout")
-               return sqrt(bailout);
+       {
+               ValueBase ret(sqrt(bailout));
+               ret.set_static(get_param_static(param));
+               return ret;
+       }
 
        EXPORT_NAME();
        EXPORT_VERSION();
index bacbbda..9e7e4bd 100644 (file)
@@ -119,6 +119,9 @@ Mandelbrot::Mandelbrot():
 
        bailout=4;
        lp=log(log(bailout));
+
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool
@@ -147,6 +150,7 @@ Mandelbrot::set_param(const String & param, const ValueBase &value)
        IMPORT(gradient_inside);
        IMPORT(gradient_outside);
 
+// TODO: Use IMPORT_PLUS
        if(param=="iterations" && value.same_type_as(iterations))
        {
                iterations=value.get(iterations);
@@ -154,6 +158,7 @@ Mandelbrot::set_param(const String & param, const ValueBase &value)
                        iterations=0;
                if(iterations>500000)
                        iterations=500000;
+               set_param_static(param, value.get_static());
                return true;
        }
        if(param=="bailout" && value.same_type_as(bailout))
@@ -161,6 +166,7 @@ Mandelbrot::set_param(const String & param, const ValueBase &value)
                bailout=value.get(bailout);
                bailout*=bailout;
                lp=log(log(bailout));
+               set_param_static(param, value.get_static());
                return true;
        }
 
@@ -195,7 +201,11 @@ Mandelbrot::get_param(const String & param)const
        EXPORT(gradient_outside);
 
        if(param=="bailout")
-               return sqrt(bailout);
+       {
+               ValueBase ret(sqrt(bailout));
+               ret.set_static(get_param_static(param));
+               return ret;
+       }
 
        EXPORT_NAME();
        EXPORT_VERSION();
index 9b30808..f468c2a 100644 (file)
@@ -67,6 +67,8 @@ LumaKey::LumaKey():
        Layer_Composite (1.0,Color::BLEND_STRAIGHT)
 {
        set_blend_method(Color::BLEND_STRAIGHT);
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 
index d195bc0..2389e01 100644 (file)
@@ -68,7 +68,10 @@ CheckerBoard::CheckerBoard():
        color                   (Color::black()),
        origin                  (Point(0.125,0.125)),
        size                    (Point(0.25,0.25))
-{}
+{
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
+}
 
 inline bool
 CheckerBoard::point_test(const synfig::Point& getpos)const
index e84effb..17e7867 100644 (file)
@@ -161,6 +161,9 @@ Outline::Outline()
        bline=bline_point_list;
 
        needs_sync=true;
+
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 
index ef096f7..ee50b80 100644 (file)
@@ -82,6 +82,8 @@ Rectangle::Rectangle():
        expand(0),
        invert(false)
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool
index 299bbbf..8c92f8f 100644 (file)
@@ -74,6 +74,8 @@ Layer_Polygon::Layer_Polygon():
        vector_list.push_back(Point(-0.333333,0));
        vector_list.push_back(Point(0.333333,0));
        sync();
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 Layer_Polygon::~Layer_Polygon()
index 9b9c2b7..be1ffdc 100644 (file)
@@ -67,6 +67,8 @@ Layer_SolidColor::Layer_SolidColor():
        Layer_Composite(1.0,Color::BLEND_COMPOSITE),
        color(Color::black())
 {
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
 }
 
 bool