From: Carlos Lopez Date: Sat, 21 Aug 2010 11:35:09 +0000 (+0200) Subject: Allow paste canvas layer to have static parameters. X-Git-Url: https://git.pterodactylus.net/?p=synfig.git;a=commitdiff_plain;h=79520f781b362e36426241f46a65c4a1855660f4 Allow paste canvas layer to have static parameters. Children lock is static by default --- diff --git a/synfig-core/src/synfig/layer_pastecanvas.cpp b/synfig-core/src/synfig/layer_pastecanvas.cpp index cd61506..733e7fe 100644 --- a/synfig-core/src/synfig/layer_pastecanvas.cpp +++ b/synfig-core/src/synfig/layer_pastecanvas.cpp @@ -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 ¶m, 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 ¶m) 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); +} diff --git a/synfig-core/src/synfig/layer_pastecanvas.h b/synfig-core/src/synfig/layer_pastecanvas.h index 01bf40f..deb951f 100644 --- a/synfig-core/src/synfig/layer_pastecanvas.h +++ b/synfig-core/src/synfig/layer_pastecanvas.h @@ -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 ¶m, const bool x); + virtual bool get_param_static(const String ¶m) 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