Allow paste canvas layer to have static parameters.
authorCarlos Lopez <genetita@gmail.com>
Sat, 21 Aug 2010 11:35:09 +0000 (13:35 +0200)
committerCarlos Lopez <genetita@gmail.com>
Sat, 21 Aug 2010 11:35:09 +0000 (13:35 +0200)
Children lock is static by default

synfig-core/src/synfig/layer_pastecanvas.cpp
synfig-core/src/synfig/layer_pastecanvas.h

index cd61506..733e7fe 100644 (file)
@@ -87,7 +87,13 @@ Layer_PasteCanvas::Layer_PasteCanvas():
        depth(0),
        zoom(0),
        time_offset(0),
-       extra_reference(false)
+       extra_reference(false),
+       origin_static(false),
+       focus_static(false),
+       canvas_static(false),
+       zoom_static(false),
+       offset_static(false),
+       children_lock_static(true)
 {
        children_lock=false;
        muck_with_time_=true;
@@ -565,3 +571,31 @@ void Layer_PasteCanvas::get_times_vfunc(Node::time_set &set) const
 
        Layer::get_times_vfunc(set);
 }
+
+
+bool
+Layer_PasteCanvas::set_param_static(const String &param, const bool x)
+{
+       SET_STATIC(origin, x)
+       SET_STATIC(focus, x)
+       SET_STATIC(canvas, x)
+       SET_STATIC(zoom, x)
+       SET_STATIC(offset, x)
+       SET_STATIC(children_lock, x)
+
+       return Layer_Composite::set_param_static(param, x);
+}
+
+
+bool
+Layer_PasteCanvas::get_param_static(const String &param) const
+{
+       GET_STATIC(origin)
+       GET_STATIC(focus)
+       GET_STATIC(canvas)
+       GET_STATIC(zoom)
+       GET_STATIC(offset)
+       GET_STATIC(children_lock)
+
+       return Layer_Composite::get_param_static(param);
+}
index 01bf40f..deb951f 100644 (file)
@@ -76,6 +76,13 @@ private:
        //! signal connection for children. Seems to be used only here
        sigc::connection child_changed_connection;
 
+       bool origin_static;
+       bool focus_static;
+       bool canvas_static;
+       bool zoom_static;
+       bool offset_static;
+       bool children_lock_static;
+
        // Nasty hack: Remember whether we called an extra ref() when
        // setting the canvas, so we know whether to call an extra unref()
        // when finished with the canvas.
@@ -157,6 +164,8 @@ public:
        virtual bool set_param(const String & param, const synfig::ValueBase &value);
        //! Get the value of the specified parameter. \see Layer::get_param
        virtual ValueBase get_param(const String & param)const;
+       virtual bool set_param_static(const String &param, const bool x);
+       virtual bool get_param_static(const String &param) const;
        //! Gets the blend color of the Layer in the context at \a pos
        virtual Color get_color(Context context, const Point &pos)const;
        //! Sets the time of the Paste Canvas Layer and those under it