more updates
authordarco <darco@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 19 Apr 2005 22:42:16 +0000 (22:42 +0000)
committerdarco <darco@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 19 Apr 2005 22:42:16 +0000 (22:42 +0000)
git-svn-id: http://svn.voria.com/code@21 1f10aa63-cdf2-0310-b900-c93c546f37ac

344 files changed:
synfig-core/trunk/config/pkg-support/sinfg-devel.info [deleted file]
synfig-core/trunk/config/pkg-support/synfig-devel.info [new file with mode: 0644]
synfig-core/trunk/config/sinfg.m4 [deleted file]
synfig-core/trunk/config/synfig.m4 [new file with mode: 0644]
synfig-core/trunk/sinfg-config.in [deleted file]
synfig-core/trunk/sinfg.kdevprj [deleted file]
synfig-core/trunk/sinfg.pbproj/config.h [deleted file]
synfig-core/trunk/sinfg.pbproj/darco.mode1 [deleted file]
synfig-core/trunk/sinfg.pbproj/darco.pbxuser [deleted file]
synfig-core/trunk/sinfg.pbproj/doxygen.cfg [deleted file]
synfig-core/trunk/sinfg.pbproj/etl_profile.h [deleted file]
synfig-core/trunk/sinfg.pbproj/project.pbxproj [deleted file]
synfig-core/trunk/sinfg.pc.in [deleted file]
synfig-core/trunk/sinfg.prj [deleted file]
synfig-core/trunk/src/sinfg/.cvsignore [deleted file]
synfig-core/trunk/src/sinfg/Makefile.am [deleted file]
synfig-core/trunk/src/sinfg/activepoint.cpp [deleted file]
synfig-core/trunk/src/sinfg/activepoint.h [deleted file]
synfig-core/trunk/src/sinfg/angle.h [deleted file]
synfig-core/trunk/src/sinfg/blinepoint.cpp [deleted file]
synfig-core/trunk/src/sinfg/blinepoint.h [deleted file]
synfig-core/trunk/src/sinfg/blur.cpp [deleted file]
synfig-core/trunk/src/sinfg/blur.h [deleted file]
synfig-core/trunk/src/sinfg/canvas.cpp [deleted file]
synfig-core/trunk/src/sinfg/canvas.h [deleted file]
synfig-core/trunk/src/sinfg/canvasbase.h [deleted file]
synfig-core/trunk/src/sinfg/color.cpp [deleted file]
synfig-core/trunk/src/sinfg/color.h [deleted file]
synfig-core/trunk/src/sinfg/context.cpp [deleted file]
synfig-core/trunk/src/sinfg/context.h [deleted file]
synfig-core/trunk/src/sinfg/curve_helper.cpp [deleted file]
synfig-core/trunk/src/sinfg/curve_helper.h [deleted file]
synfig-core/trunk/src/sinfg/curveset.cpp [deleted file]
synfig-core/trunk/src/sinfg/curveset.h [deleted file]
synfig-core/trunk/src/sinfg/distance.cpp [deleted file]
synfig-core/trunk/src/sinfg/distance.h [deleted file]
synfig-core/trunk/src/sinfg/exception.cpp [deleted file]
synfig-core/trunk/src/sinfg/exception.h [deleted file]
synfig-core/trunk/src/sinfg/gamma.cpp [deleted file]
synfig-core/trunk/src/sinfg/gamma.h [deleted file]
synfig-core/trunk/src/sinfg/general.h [deleted file]
synfig-core/trunk/src/sinfg/gradient.cpp [deleted file]
synfig-core/trunk/src/sinfg/gradient.h [deleted file]
synfig-core/trunk/src/sinfg/guid.cpp [deleted file]
synfig-core/trunk/src/sinfg/guid.h [deleted file]
synfig-core/trunk/src/sinfg/guidset.h [deleted file]
synfig-core/trunk/src/sinfg/importer.cpp [deleted file]
synfig-core/trunk/src/sinfg/importer.h [deleted file]
synfig-core/trunk/src/sinfg/interpolation.h [deleted file]
synfig-core/trunk/src/sinfg/keyframe.cpp [deleted file]
synfig-core/trunk/src/sinfg/keyframe.h [deleted file]
synfig-core/trunk/src/sinfg/layer.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer.h [deleted file]
synfig-core/trunk/src/sinfg/layer_bitmap.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer_bitmap.h [deleted file]
synfig-core/trunk/src/sinfg/layer_composite.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer_composite.h [deleted file]
synfig-core/trunk/src/sinfg/layer_mime.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer_mime.h [deleted file]
synfig-core/trunk/src/sinfg/layer_motionblur.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer_motionblur.h [deleted file]
synfig-core/trunk/src/sinfg/layer_pastecanvas.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer_pastecanvas.h [deleted file]
synfig-core/trunk/src/sinfg/layer_polygon.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer_polygon.h [deleted file]
synfig-core/trunk/src/sinfg/layer_shape.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer_shape.h [deleted file]
synfig-core/trunk/src/sinfg/layer_solidcolor.cpp [deleted file]
synfig-core/trunk/src/sinfg/layer_solidcolor.h [deleted file]
synfig-core/trunk/src/sinfg/listimporter.cpp [deleted file]
synfig-core/trunk/src/sinfg/listimporter.h [deleted file]
synfig-core/trunk/src/sinfg/loadcanvas.cpp [deleted file]
synfig-core/trunk/src/sinfg/loadcanvas.h [deleted file]
synfig-core/trunk/src/sinfg/main.cpp [deleted file]
synfig-core/trunk/src/sinfg/main.h [deleted file]
synfig-core/trunk/src/sinfg/module.cpp [deleted file]
synfig-core/trunk/src/sinfg/module.h [deleted file]
synfig-core/trunk/src/sinfg/mutex.cpp [deleted file]
synfig-core/trunk/src/sinfg/mutex.h [deleted file]
synfig-core/trunk/src/sinfg/node.cpp [deleted file]
synfig-core/trunk/src/sinfg/node.h [deleted file]
synfig-core/trunk/src/sinfg/palette.cpp [deleted file]
synfig-core/trunk/src/sinfg/palette.h [deleted file]
synfig-core/trunk/src/sinfg/paramdesc.cpp [deleted file]
synfig-core/trunk/src/sinfg/paramdesc.h [deleted file]
synfig-core/trunk/src/sinfg/pch.h [deleted file]
synfig-core/trunk/src/sinfg/polynomial_root.cpp [deleted file]
synfig-core/trunk/src/sinfg/polynomial_root.h [deleted file]
synfig-core/trunk/src/sinfg/proto/Makefile [deleted file]
synfig-core/trunk/src/sinfg/proto/nodebase.px [deleted file]
synfig-core/trunk/src/sinfg/proto/proto.m4 [deleted file]
synfig-core/trunk/src/sinfg/protocol.h [deleted file]
synfig-core/trunk/src/sinfg/real.h [deleted file]
synfig-core/trunk/src/sinfg/rect.cpp [deleted file]
synfig-core/trunk/src/sinfg/rect.h [deleted file]
synfig-core/trunk/src/sinfg/renddesc.cpp [deleted file]
synfig-core/trunk/src/sinfg/renddesc.h [deleted file]
synfig-core/trunk/src/sinfg/render.cpp [deleted file]
synfig-core/trunk/src/sinfg/render.h [deleted file]
synfig-core/trunk/src/sinfg/savecanvas.cpp [deleted file]
synfig-core/trunk/src/sinfg/savecanvas.h [deleted file]
synfig-core/trunk/src/sinfg/segment.h [deleted file]
synfig-core/trunk/src/sinfg/sinfg.h [deleted file]
synfig-core/trunk/src/sinfg/sinfg.nsh [deleted file]
synfig-core/trunk/src/sinfg/smartfile.h [deleted file]
synfig-core/trunk/src/sinfg/string.h [deleted file]
synfig-core/trunk/src/sinfg/string_decl.h [deleted file]
synfig-core/trunk/src/sinfg/surface.cpp [deleted file]
synfig-core/trunk/src/sinfg/surface.h [deleted file]
synfig-core/trunk/src/sinfg/surfacenew.cpp [deleted file]
synfig-core/trunk/src/sinfg/surfacenew.h [deleted file]
synfig-core/trunk/src/sinfg/target.cpp [deleted file]
synfig-core/trunk/src/sinfg/target.h [deleted file]
synfig-core/trunk/src/sinfg/target_multi.cpp [deleted file]
synfig-core/trunk/src/sinfg/target_multi.h [deleted file]
synfig-core/trunk/src/sinfg/target_null.cpp [deleted file]
synfig-core/trunk/src/sinfg/target_null.h [deleted file]
synfig-core/trunk/src/sinfg/target_null_tile.cpp [deleted file]
synfig-core/trunk/src/sinfg/target_null_tile.h [deleted file]
synfig-core/trunk/src/sinfg/target_scanline.cpp [deleted file]
synfig-core/trunk/src/sinfg/target_scanline.h [deleted file]
synfig-core/trunk/src/sinfg/target_tile.cpp [deleted file]
synfig-core/trunk/src/sinfg/target_tile.h [deleted file]
synfig-core/trunk/src/sinfg/time.cpp [deleted file]
synfig-core/trunk/src/sinfg/time.h [deleted file]
synfig-core/trunk/src/sinfg/timepointcollect.cpp [deleted file]
synfig-core/trunk/src/sinfg/timepointcollect.h [deleted file]
synfig-core/trunk/src/sinfg/transform.cpp [deleted file]
synfig-core/trunk/src/sinfg/transform.h [deleted file]
synfig-core/trunk/src/sinfg/types.h [deleted file]
synfig-core/trunk/src/sinfg/uniqueid.cpp [deleted file]
synfig-core/trunk/src/sinfg/uniqueid.h [deleted file]
synfig-core/trunk/src/sinfg/value.cpp [deleted file]
synfig-core/trunk/src/sinfg/value.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_animated.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_animated.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_bline.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_bline.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_composite.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_composite.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_const.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_const.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_dynamiclist.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_dynamiclist.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_gradientrotate.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_gradientrotate.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_linear.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_linear.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_radialcomposite.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_radialcomposite.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_reference.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_reference.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_scale.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_scale.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_segcalctangent.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_segcalctangent.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_segcalcvertex.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_segcalcvertex.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_sine.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_sine.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_stripes.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_stripes.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_subtract.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_subtract.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_timedswap.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_timedswap.h [deleted file]
synfig-core/trunk/src/sinfg/valuenode_twotone.cpp [deleted file]
synfig-core/trunk/src/sinfg/valuenode_twotone.h [deleted file]
synfig-core/trunk/src/sinfg/vector.h [deleted file]
synfig-core/trunk/src/sinfg/version.h [deleted file]
synfig-core/trunk/src/sinfg/waypoint.cpp [deleted file]
synfig-core/trunk/src/sinfg/waypoint.h [deleted file]
synfig-core/trunk/src/synfig/.cvsignore [new file with mode: 0644]
synfig-core/trunk/src/synfig/Makefile.am [new file with mode: 0644]
synfig-core/trunk/src/synfig/activepoint.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/activepoint.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/angle.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/blinepoint.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/blinepoint.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/blur.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/blur.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/canvas.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/canvas.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/canvasbase.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/color.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/color.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/context.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/context.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/curve_helper.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/curve_helper.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/curveset.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/curveset.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/distance.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/distance.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/exception.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/exception.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/gamma.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/gamma.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/general.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/gradient.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/gradient.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/guid.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/guid.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/guidset.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/importer.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/importer.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/interpolation.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/keyframe.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/keyframe.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_bitmap.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_bitmap.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_composite.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_composite.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_mime.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_mime.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_motionblur.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_motionblur.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_pastecanvas.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_pastecanvas.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_polygon.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_polygon.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_shape.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_shape.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_solidcolor.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/layer_solidcolor.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/listimporter.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/listimporter.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/loadcanvas.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/loadcanvas.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/main.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/main.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/module.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/module.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/mutex.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/mutex.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/node.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/node.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/palette.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/palette.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/paramdesc.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/paramdesc.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/pch.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/polynomial_root.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/polynomial_root.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/proto/Makefile [new file with mode: 0644]
synfig-core/trunk/src/synfig/proto/nodebase.px [new file with mode: 0644]
synfig-core/trunk/src/synfig/proto/proto.m4 [new file with mode: 0644]
synfig-core/trunk/src/synfig/protocol.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/real.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/rect.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/rect.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/renddesc.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/renddesc.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/render.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/render.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/savecanvas.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/savecanvas.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/segment.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/sinfg.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/sinfg.nsh [new file with mode: 0644]
synfig-core/trunk/src/synfig/smartfile.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/string.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/string_decl.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/surface.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/surface.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/surfacenew.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/surfacenew.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/target.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/target.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_multi.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_multi.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_null.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_null.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_null_tile.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_null_tile.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_scanline.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_scanline.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_tile.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/target_tile.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/time.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/time.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/timepointcollect.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/timepointcollect.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/transform.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/transform.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/types.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/uniqueid.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/uniqueid.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/value.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/value.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_animated.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_animated.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_bline.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_bline.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_composite.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_composite.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_const.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_const.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_dynamiclist.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_gradientrotate.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_gradientrotate.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_linear.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_linear.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_radialcomposite.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_radialcomposite.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_reference.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_reference.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_scale.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_scale.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_segcalctangent.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_segcalctangent.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_segcalcvertex.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_segcalcvertex.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_sine.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_sine.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_stripes.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_stripes.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_subtract.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_subtract.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_timedswap.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_timedswap.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_twotone.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/valuenode_twotone.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/vector.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/version.h [new file with mode: 0644]
synfig-core/trunk/src/synfig/waypoint.cpp [new file with mode: 0644]
synfig-core/trunk/src/synfig/waypoint.h [new file with mode: 0644]
synfig-core/trunk/synfig-config.in [new file with mode: 0644]
synfig-core/trunk/synfig.kdevprj [new file with mode: 0644]
synfig-core/trunk/synfig.pbproj/config.h [new file with mode: 0644]
synfig-core/trunk/synfig.pbproj/darco.mode1 [new file with mode: 0755]
synfig-core/trunk/synfig.pbproj/darco.pbxuser [new file with mode: 0755]
synfig-core/trunk/synfig.pbproj/doxygen.cfg [new file with mode: 0644]
synfig-core/trunk/synfig.pbproj/etl_profile.h [new file with mode: 0644]
synfig-core/trunk/synfig.pbproj/project.pbxproj [new file with mode: 0755]
synfig-core/trunk/synfig.pc.in [new file with mode: 0644]
synfig-core/trunk/synfig.prj [new file with mode: 0644]

diff --git a/synfig-core/trunk/config/pkg-support/sinfg-devel.info b/synfig-core/trunk/config/pkg-support/sinfg-devel.info
deleted file mode 100644 (file)
index 0cf6df6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Title @_PRODUCT_NAME_@ @_VERSION_@
-Version @_RELEASE_@
-Description @_PACKAGE_NAME_@
-DefaultLocation /Library/Frameworks
-DeleteWarning 
-NeedsAuthorization YES
-DisableStop NO
-UseUserMask YES
-Application NO
-Relocatable YES
-Required NO
-InstallOnly NO
-RequiresReboot NO
-InstallFat NO
diff --git a/synfig-core/trunk/config/pkg-support/synfig-devel.info b/synfig-core/trunk/config/pkg-support/synfig-devel.info
new file mode 100644 (file)
index 0000000..0cf6df6
--- /dev/null
@@ -0,0 +1,14 @@
+Title @_PRODUCT_NAME_@ @_VERSION_@
+Version @_RELEASE_@
+Description @_PACKAGE_NAME_@
+DefaultLocation /Library/Frameworks
+DeleteWarning 
+NeedsAuthorization YES
+DisableStop NO
+UseUserMask YES
+Application NO
+Relocatable YES
+Required NO
+InstallOnly NO
+RequiresReboot NO
+InstallFat NO
diff --git a/synfig-core/trunk/config/sinfg.m4 b/synfig-core/trunk/config/sinfg.m4
deleted file mode 100644 (file)
index 4a623a9..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# SINFG M4 Macro
-# For GNU Autotools
-# $Id: sinfg.m4,v 1.1.1.1 2005/01/04 01:23:08 darco Exp $
-#
-# By Robert B. Quattlebaum Jr. <darco@users.sf.net>
-#      AM_LIBXMLPP(,$2)
-
-
-AC_DEFUN([SINFG_DEPS],
-[
-       USING_ETL(,$2)
-       AM_PATH_XML2(,,$2)
-       AC_CHECK_FUNCS([floor pow sqrt],,$2)
-       AM_LIBXMLPP(,$2)
-
-       CXXFLAGS="$CXXFLAGS $LIBXMLPP_CFLAGS"
-       LIBS="$LIBS $LIBXMLPP_LIBS"
-
-       $1
-])
-
-AC_DEFUN([USING_SINFG],
-[
-       AC_ARG_WITH(sinfg-includes,
-       [  --with-sinfg-includes    Specify location of sinfg headers],[
-       CXXFLAGS="$CXXFLAGS -I$withval"
-       ])
-
-       AC_PATH_PROG(SINFG_CONFIG,sinfg-config,no)
-
-       if test "$SINFG_CONFIG" = "no"; then
-               no_SINFG_config="yes"
-               $2
-       else
-               AC_MSG_CHECKING([if $SINFG_CONFIG works])
-               if $SINFG_CONFIG --libs >/dev/null 2>&1; then
-                       SINFG_VERSION="`$SINFG_CONFIG --version`"
-                       AC_MSG_RESULT([yes, $SINFG_VERSION])
-                       CXXFLAGS="$CXXFLAGS `$SINFG_CONFIG --cxxflags`"
-                       $1
-               else
-                       AC_MSG_RESULT(no)
-                       no_SINFG_config="yes"
-                       $2
-               fi
-       fi
-
-       SINFG_DEPS($1,$2)
-])
-
-
diff --git a/synfig-core/trunk/config/synfig.m4 b/synfig-core/trunk/config/synfig.m4
new file mode 100644 (file)
index 0000000..4a623a9
--- /dev/null
@@ -0,0 +1,51 @@
+# SINFG M4 Macro
+# For GNU Autotools
+# $Id: sinfg.m4,v 1.1.1.1 2005/01/04 01:23:08 darco Exp $
+#
+# By Robert B. Quattlebaum Jr. <darco@users.sf.net>
+#      AM_LIBXMLPP(,$2)
+
+
+AC_DEFUN([SINFG_DEPS],
+[
+       USING_ETL(,$2)
+       AM_PATH_XML2(,,$2)
+       AC_CHECK_FUNCS([floor pow sqrt],,$2)
+       AM_LIBXMLPP(,$2)
+
+       CXXFLAGS="$CXXFLAGS $LIBXMLPP_CFLAGS"
+       LIBS="$LIBS $LIBXMLPP_LIBS"
+
+       $1
+])
+
+AC_DEFUN([USING_SINFG],
+[
+       AC_ARG_WITH(sinfg-includes,
+       [  --with-sinfg-includes    Specify location of sinfg headers],[
+       CXXFLAGS="$CXXFLAGS -I$withval"
+       ])
+
+       AC_PATH_PROG(SINFG_CONFIG,sinfg-config,no)
+
+       if test "$SINFG_CONFIG" = "no"; then
+               no_SINFG_config="yes"
+               $2
+       else
+               AC_MSG_CHECKING([if $SINFG_CONFIG works])
+               if $SINFG_CONFIG --libs >/dev/null 2>&1; then
+                       SINFG_VERSION="`$SINFG_CONFIG --version`"
+                       AC_MSG_RESULT([yes, $SINFG_VERSION])
+                       CXXFLAGS="$CXXFLAGS `$SINFG_CONFIG --cxxflags`"
+                       $1
+               else
+                       AC_MSG_RESULT(no)
+                       no_SINFG_config="yes"
+                       $2
+               fi
+       fi
+
+       SINFG_DEPS($1,$2)
+])
+
+
diff --git a/synfig-core/trunk/sinfg-config.in b/synfig-core/trunk/sinfg-config.in
deleted file mode 100644 (file)
index 86463d6..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-
-bindir=@bindir@
-libexecdir=@libexecdir@
-datadir=@datadir@
-sysconfdir=@sysconfdir@
-sharedstatedir=@sharedstatedir@
-localstatedir=@localstatedir@
-libdir=@libdir@
-infodir=@infodir@
-mandir=@mandir@
-includedir=@includedir@
-
-LIBS="@SINFG_LIBS@"
-
-VERSION=@VERSION@
-PACKAGE=@PACKAGE@
-
-CFLAGS="@CONFIG_CFLAGS@"
-
-usage()
-{
-       cat <<EOF
-Usage: sinfg-config [OPTION]...
-
-Generic options
-  --version    print installed version of sinfg.
-  --help        display this help and exit.
-
-Compilation support options
-  --cflags      print pre-processor and compiler flags
-  --libs        print library linking information
-  
-Install directories
-  --prefix --exec-prefix --bindir --libexecdir --datadir
-  --sysconfdir --sharedstatedir --localstatedir --libdir --infodir
-  --mandir --includedir
-
-EOF
-       
-       exit 1
-}
-
-if test $# -eq 0; then
-       usage 1
-fi
-
-case $1 in
---version)
-       echo $PACKAGE $VERSION
-       exit 0
-       ;;
---exec-prefix)
-       echo $exec_prefix
-       exit 0
-       ;;
---prefix)
-       echo $prefix
-       exit 0
-       ;;
---help)
-       usage 0
-       ;;
---cflags)
-       echo $CFLAGS
-       exit 0
-       ;;
---cxxflags)
-       echo $CFLAGS
-       exit 0
-       ;;
---libs)
-       echo $LIBS
-       exit 0
-       ;;
-esac
-
-echo Unknown option "$1"
-exit 4
diff --git a/synfig-core/trunk/sinfg.kdevprj b/synfig-core/trunk/sinfg.kdevprj
deleted file mode 100644 (file)
index 3fdb1c7..0000000
+++ /dev/null
@@ -1,1198 +0,0 @@
-[./ChangeLog]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./ETL-0.01.01.spec]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./ETL.kdevprj]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./INSTALL]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./Makefile.am]
-files=./aclocal.m4,./config.status,./README,./configure,./config.log,./ETL-0.01.01.spec,./INSTALL,./ChangeLog,./ETL.kdevprj,./bootstrap,
-sub_dirs=test,config,ETL.pbproj,include,
-type=normal
-
-[./README]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./aclocal.m4]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./bootstrap]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./config.log]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./config.status]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[./configure]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[ChangeLog]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[Config for BinMakefileAm]
-addcxxflags=
-bin_program=sinfg
-cflags=
-cppflags=
-cxxflags=\s-O1
-ldadd=
-ldflags=\s\s
-libtool_dir=./libtool/
-path_to_bin_program=./src/tool
-
-[ETL.pbproj/Makefile.am]
-files=
-sub_dirs=
-type=normal
-
-[General]
-AMChanged=false
-author=darco
-configure_args=\s--build=i386-linux --host=i386-linux --target=i386-linux\s
-debug_args=-v -v -v --version
-dir_where_make_will_be_called=./
-email=darco@voria.net
-execute_args=-v -v -v --version
-kdevprj_version=1.3
-lfv_open_groups=
-make_options=\s-j2 -l 2 -j 2
-makefiles=./Makefile.am,include/Makefile.am,ETL.pbproj/Makefile.am,config/Makefile.am,config/pkg-support/Makefile.am,config/pkg-support/devel-resources/Makefile.am,test/Makefile.am,src/modules/trgt_bmp/Makefile.am,src/modules/Makefile.am,src/Makefile.am,src/modules/trgt_gif/Makefile.am,src/modules/lyr_std/Makefile.am,src/modules/example/Makefile.am,src/sinfg/Makefile.am,src/tool/Makefile.am,Makefile.am,src/modules/trgt_ppm/Makefile.am,src/modules/trgt_mpg/Makefile.am,src/modules/mod_ffmpeg/Makefile.am,src/modules/mptr_mplayer/Makefile.am,src/modules/trgt_dv/Makefile.am,src/modules/mod_imagemagick/Makefile.am
-modifyMakefiles=true
-project_name=Sinfg
-project_type=normal_empty
-short_info=
-sub_dir=
-version=
-version_control=CVS
-workspace=1
-
-[INSTALL]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[LFV Groups]
-GNU=AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,NEWS,
-Headers=*.h,*.hxx,*.hpp,*.H,
-Others=*,
-Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l,
-Translations=*.ts,*.po,
-User Interface=*.ui,*.kdevdlg,*.rc,
-groups=Headers,Sources,GNU,Translations,User Interface,Others
-
-[Makefile.am]
-dist=true
-files=bootstrap,ChangeLog,INSTALL,Makefile.am,README,sinfg.kdevprj,sinfg-config.in
-install=false
-install_location=
-sub_dirs=src,config
-type=DATA
-
-[README]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[bootstrap]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/ETL.m4]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/Makefile.am]
-files=config/depcomp,config/configure.ac,config/config.guess,config/install-sh,config/config.sub,config/missing,config/cxx_macros.m4,config/project.spec.in,config/mkinstalldirs,config/sdl.m4,config/build.cfg,config/libxml.m4,config/ETL.m4,config/sinfg.m4
-sub_dirs=pkg-support,
-type=normal
-
-[config/build.cfg]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/config.guess]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/config.sub]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/configure.ac]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/cxx_macros.m4]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/depcomp]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/install-sh]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/libxml.m4]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/missing]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/mkinstalldirs]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/pkg-support/ETL-devel.info]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/pkg-support/Makefile.am]
-files=config/pkg-support/ETL-devel.info,
-sub_dirs=devel-resources,
-type=normal
-
-[config/pkg-support/devel-resources/Makefile.am]
-files=config/pkg-support/devel-resources/ReadMe.txt,config/pkg-support/devel-resources/install.sh,config/pkg-support/devel-resources/Welcome.txt,
-sub_dirs=
-type=normal
-
-[config/pkg-support/devel-resources/ReadMe.txt]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/pkg-support/devel-resources/Welcome.txt]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/pkg-support/devel-resources/install.sh]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/project.spec.in]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/sdl.m4]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[config/sinfg.m4]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/Makefile.am]
-files=include/ipc,include/_bit_rotate.h,include/_fastangle_tables.h,include/_clock_system.h,include/angle,include/clock,include/fixed,include/_rwlock.h,include/_thread.h,include/etl_profile.h.in~,include/etl_profile.h.in,include/_curve.h,include/_trivial.h,include/etl_profile.h,include/surface,include/_mutex_win32.h,include/_clock_gettimeofday.h,include/handle,include/_clock_base.h,include/_smach.h,include/_fixed.h,include/_condition.h,include/random,include/thread,include/stamp-h.in,include/stamp-h1,include/_surface.h,include/_fastangle.h,include/_mutex_pthreads.h,include/_handle.h,include/_random.h,include/_angle.h,include/etl_config.h,
-sub_dirs=
-type=normal
-
-[include/_angle.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_bit_rotate.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_clock_base.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_clock_gettimeofday.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_clock_system.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_condition.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_curve.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_fastangle.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_fastangle_tables.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_fixed.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_handle.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_mutex_pthreads.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_mutex_win32.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_random.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_rwlock.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_smach.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_surface.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_thread.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/_trivial.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/angle]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/clock]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/etl_config.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/etl_profile.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[include/etl_profile.h.in]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/etl_profile.h.in~]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/fixed]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/handle]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/ipc]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/random]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/stamp-h.in]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/stamp-h1]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/surface]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[include/thread]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[sinfg-config.in]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[sinfg.kdevprj]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[src/Makefile.am]
-dist=true
-files=src/Makefile.am,src/template.cpp,src/template.h
-install=false
-install_location=
-sub_dirs=modules,sinfg,tool
-type=static_library
-
-[src/modules/Makefile.am]
-dist=true
-files=src/modules/Makefile.am
-install=false
-install_location=
-sub_dirs=trgt_bmp,trgt_gif,lyr_std,example,trgt_ppm,trgt_mpg,mod_ffmpeg,mptr_mplayer,trgt_dv,mod_imagemagick
-type=DATA
-
-[src/modules/example/Makefile.am]
-dist=true
-files=src/modules/example/main.cpp,src/modules/example/Makefile.am
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:1
-sharedlib_rootname=example
-sub_dirs=
-type=DATA
-
-[src/modules/example/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/Makefile.am]
-dist=true
-files=src/modules/lyr_std/checkerboard.cpp,src/modules/lyr_std/checkerboard.h,src/modules/lyr_std/main.cpp,src/modules/lyr_std/Makefile.am,src/modules/lyr_std/mandelbrot.cpp,src/modules/lyr_std/mandelbrot.h,src/modules/lyr_std/solidcolor.cpp,src/modules/lyr_std/solidcolor.h,src/modules/lyr_std/zoom.cpp,src/modules/lyr_std/zoom.h,src/modules/lyr_std/circle.h,src/modules/lyr_std/circle.cpp,src/modules/lyr_std/blur.cpp,src/modules/lyr_std/blur.h,src/modules/lyr_std/import.cpp,src/modules/lyr_std/import.h,src/modules/lyr_std/polygon.cpp,src/modules/lyr_std/polygon.h
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:1
-sharedlib_rootname=lyr_std
-sub_dirs=
-type=static_library
-
-[src/modules/lyr_std/blur.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/blur.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/lyr_std/checkerboard.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/checkerboard.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/lyr_std/circle.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/circle.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/lyr_std/import.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/import.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/lyr_std/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/mandelbrot.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/mandelbrot.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/lyr_std/polygon.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/polygon.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/lyr_std/solidcolor.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/solidcolor.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/lyr_std/zoom.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/lyr_std/zoom.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/mod_ffmpeg/Makefile.am]
-files=src/modules/mod_ffmpeg/main.cpp,src/modules/mod_ffmpeg/mptr_ffmpeg.cpp,src/modules/mod_ffmpeg/mptr_ffmpeg.h,src/modules/mod_ffmpeg/trgt_ffmpeg.cpp,src/modules/mod_ffmpeg/trgt_ffmpeg.h
-sharedlib_LDFLAGS=-version-info 0:0:0
-sharedlib_rootname=mod_ffmpeg
-sub_dirs=
-type=static_library
-
-[src/modules/mod_ffmpeg/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/mod_ffmpeg/mptr_ffmpeg.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/mod_ffmpeg/mptr_ffmpeg.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/mod_ffmpeg/trgt_ffmpeg.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/mod_ffmpeg/trgt_ffmpeg.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/mod_imagemagick/Makefile.am]
-dist=true
-files=src/modules/mod_imagemagick/main.cpp,src/modules/mod_imagemagick/mptr_imagemagick.cpp,src/modules/mod_imagemagick/mptr_imagemagick.h,src/modules/mod_imagemagick/Makefile.am,src/modules/mod_imagemagick/trgt_imagemagick.cpp,src/modules/mod_imagemagick/trgt_imagemagick.h
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:0
-sharedlib_rootname=mod_imagemagick
-sub_dirs=
-type=static_library
-
-[src/modules/mod_imagemagick/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/mod_imagemagick/mptr_imagemagick.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/mod_imagemagick/mptr_imagemagick.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/mod_imagemagick/trgt_imagemagick.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/mod_imagemagick/trgt_imagemagick.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/mptr_mplayer/Makefile.am]
-dist=true
-files=src/modules/mptr_mplayer/main.cpp,src/modules/mptr_mplayer/mptr_mplayer.cpp,src/modules/mptr_mplayer/Makefile.am,src/modules/mptr_mplayer/mptr_mplayer.h
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:0
-sharedlib_rootname=mptr_mplayer
-sub_dirs=
-type=DATA
-
-[src/modules/mptr_mplayer/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/mptr_mplayer/mptr_mplayer.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/mptr_mplayer/mptr_mplayer.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/trgt_bmp/Makefile.am]
-dist=true
-files=src/modules/trgt_bmp/main.cpp,src/modules/trgt_bmp/trgt_bmp.cpp,src/modules/trgt_bmp/Makefile.am,src/modules/trgt_bmp/trgt_bmp.h
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:1
-sharedlib_rootname=trgt_bmp
-sub_dirs=
-type=DATA
-
-[src/modules/trgt_bmp/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_bmp/trgt_bmp.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_bmp/trgt_bmp.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/trgt_dv/Makefile.am]
-dist=true
-files=src/modules/trgt_dv/main.cpp,src/modules/trgt_dv/trgt_dv.cpp,src/modules/trgt_dv/trgt_dv.h,src/modules/trgt_dv/Makefile.am
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:0
-sharedlib_rootname=trgt_dv
-sub_dirs=
-type=DATA
-
-[src/modules/trgt_dv/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_dv/trgt_dv.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_dv/trgt_dv.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/trgt_gif/Makefile.am]
-dist=true
-files=src/modules/trgt_gif/main.cpp,src/modules/trgt_gif/Makefile.am,src/modules/trgt_gif/trgt_gif.cpp,src/modules/trgt_gif/trgt_gif.h
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:1
-sharedlib_rootname=trgt_gif
-sub_dirs=
-type=static_library
-
-[src/modules/trgt_gif/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_gif/trgt_gif.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_gif/trgt_gif.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/trgt_mpg/Makefile.am]
-dist=true
-files=src/modules/trgt_mpg/main.cpp,src/modules/trgt_mpg/Makefile.am,src/modules/trgt_mpg/trgt_mpg.cpp,src/modules/trgt_mpg/trgt_mpg.h
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:1
-sharedlib_rootname=trgt_mpg
-sub_dirs=
-type=static_library
-
-[src/modules/trgt_mpg/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_mpg/trgt_mpg.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_mpg/trgt_mpg.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/trgt_ppm/Makefile.am]
-dist=true
-files=src/modules/trgt_ppm/Makefile.am,src/modules/trgt_ppm/main.cpp,src/modules/trgt_ppm/trgt_ppm.cpp,src/modules/trgt_ppm/trgt_ppm.h,src/modules/trgt_ppm/mptr_ppm.cpp,src/modules/trgt_ppm/mptr_ppm.h,src/modules/trgt_ppm/trgt_mpg.h,src/modules/trgt_ppm/trgt_mpg.cpp
-install=false
-install_location=
-sub_dirs=
-type=static_library
-
-[src/modules/trgt_ppm/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_ppm/mptr_ppm.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_ppm/mptr_ppm.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/trgt_ppm/trgt_mpg.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_ppm/trgt_mpg.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/modules/trgt_ppm/trgt_ppm.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/modules/trgt_ppm/trgt_ppm.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/Makefile.am]
-dist=true
-files=src/sinfg/animate.cpp,src/sinfg/animate.h,src/sinfg/color.cpp,src/sinfg/color.h,src/sinfg/general.h,src/sinfg/layer.cpp,src/sinfg/layer.h,src/sinfg/main.cpp,src/sinfg/Makefile.am,src/sinfg/modules.cpp,src/sinfg/modules.h,src/sinfg/pch.h,src/sinfg/renddesc.h,src/sinfg/render.cpp,src/sinfg/render.h,src/sinfg/sinfg.h,src/sinfg/target.cpp,src/sinfg/target.h,src/sinfg/vector.h,src/sinfg/bmplayer.cpp,src/sinfg/bmplayer.h,src/sinfg/importer.cpp,src/sinfg/importer.h,src/sinfg/surface.cpp,src/sinfg/surface.h,src/sinfg/datatype.h,src/sinfg/datatype.cpp,src/sinfg/canvas.cpp,src/sinfg/canvas.h,src/sinfg/loadcanvas.cpp,src/sinfg/loadcanvas.h,src/sinfg/savecanvas.cpp,src/sinfg/savecanvas.h
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:1
-sharedlib_rootname=sinfg
-sub_dirs=
-type=static_library
-
-[src/sinfg/animate.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/animate.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/bmplayer.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/bmplayer.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/canvas.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/canvas.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/color.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/color.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/datatype.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/datatype.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/general.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/importer.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/importer.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/layer.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/layer.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/loadcanvas.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/loadcanvas.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/modules.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/modules.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/pch.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/renddesc.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/render.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/render.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/savecanvas.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/savecanvas.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/sinfg.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/surface.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/surface.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/target.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/sinfg/target.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/sinfg/vector.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/template.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[src/template.h]
-dist=true
-install=false
-install_location=
-type=HEADER
-
-[src/tool/Makefile.am]
-dist=true
-files=src/tool/main.cpp,src/tool/Makefile.am
-install=false
-install_location=
-sharedlib_LDFLAGS=-version-info 0:0:1
-sharedlib_rootname=tool
-sub_dirs=
-type=DATA
-
-[src/tool/main.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[test/Makefile.am]
-files=test/random.cpp,test/angle,test/clock,test/fixed,test/smach,test/smach.cpp,test/handle.cpp,test/handle,test/clock.cpp,test/angle.cpp,test/random,test/fixed.cpp,
-sub_dirs=
-type=normal
-
-[test/angle]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[test/angle.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[test/clock]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[test/clock.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[test/fixed]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[test/fixed.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[test/handle]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[test/handle.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[test/random]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[test/random.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
-
-[test/smach]
-dist=true
-install=false
-install_location=
-type=DATA
-
-[test/smach.cpp]
-dist=true
-install=false
-install_location=
-type=SOURCE
diff --git a/synfig-core/trunk/sinfg.pbproj/config.h b/synfig-core/trunk/sinfg.pbproj/config.h
deleted file mode 100644 (file)
index 5ef5097..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-/* config.h.  Generated automatically by configure.  */
-/* config-h.in.  Generated automatically from configure.in by autoheader.  */
-/* Define to the address where bug reports for this package should be sent. */
-
-#define PACKAGE_BUGREPORT "darco@deepdarc.com"
-#define PROJECT_BUILDER 1
-
-/* Define to the full name of this package. */
-#define PACKAGE "sinfg"
-
-/* Define to the version of this package. */
-#define VERSION "0.60.05-mac"
-
-#define LTDL_SHLIB_EXT ".so"
-
-#define PLATFORM_DARWIN_PPC 1
-
-/* Define to empty if the keyword does not work.  */
-/* #undef const */
-
-/* Define as __inline if that's what the C compiler calls it.  */
-/* #undef inline */
-
-#define SINFG_LTDL_NO_STATIC
-
-/* Define if you have the ANSI C header files.  */
-#define STDC_HEADERS 1
-
-/* Define if you have the argz_append function.  */
-/* #undef HAVE_ARGZ_APPEND */
-
-/* Define if you have the argz_create_sep function.  */
-/* #undef HAVE_ARGZ_CREATE_SEP */
-
-/* Define if you have the argz_insert function.  */
-/* #undef HAVE_ARGZ_INSERT */
-
-/* Define if you have the argz_next function.  */
-/* #undef HAVE_ARGZ_NEXT */
-
-/* Define if you have the argz_stringify function.  */
-/* #undef HAVE_ARGZ_STRINGIFY */
-
-/* Define if you have the bcopy function.  */
-/* #undef HAVE_BCOPY */
-
-/* Define if you have the dlerror function.  */
-/* #undef HAVE_DLERROR */
-
-/* Define if you have the index function.  */
-/* #undef HAVE_INDEX */
-
-/* Define if you have the memcpy function.  */
-#define HAVE_MEMCPY 1
-
-/* Define if you have the memmove function.  */
-#define HAVE_MEMMOVE 1
-
-/* Define if you have the rindex function.  */
-/* #undef HAVE_RINDEX */
-
-/* Define if you have the strchr function.  */
-#define HAVE_STRCHR 1
-
-/* Define if you have the strcmp function.  */
-#define HAVE_STRCMP 1
-
-/* Define if you have the strrchr function.  */
-#define HAVE_STRRCHR 1
-
-/* Define if you have the <argz.h> header file.  */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <assert.h> header file.  */
-/* #undef HAVE_ASSERT_H */
-
-/* Define if you have the <ctype.h> header file.  */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <dirent.h> header file.  */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <dl.h> header file.  */
-/* #undef HAVE_DL_H */
-
-/* Define if you have the <dld.h> header file.  */
-/* #undef HAVE_DLD_H */
-
-/* Define if you have the <dlfcn.h> header file.  */
-#undef HAVE_DLFCN_H
-
-/* Define if you have the <errno.h> header file.  */
-#define HAVE_ERRNO_H 1
-
-/* Define if you have the <malloc.h> header file.  */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <memory.h> header file.  */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <ndir.h> header file.  */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <stdio.h> header file.  */
-#define HAVE_STDIO_H 1
-
-/* Define if you have the <stdlib.h> header file.  */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file.  */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file.  */
-/* #undef HAVE_STRINGS_H */
-
-/* Define if you have the <sys/dir.h> header file.  */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/dl.h> header file.  */
-/* #undef HAVE_SYS_DL_H */
-
-/* Define if you have the <sys/ndir.h> header file.  */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <unistd.h> header file.  */
-#define HAVE_UNISTD_H 1
-
-/* Define to the extension used for shared libraries, say, .so.  */
-/* #undef LTDL_SHLIB_EXT */
-
-/* Define to the name of the environment variable that determines the dynamic library search path.  */
-#define LTDL_SHLIBPATH_VAR "DYLD_LIBRARY_PATH"
-
-/* Define to the system default library search path.  */
-#define LTDL_SYSSEARCHPATH "/lib:/usr/lib"
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.  */
-#define LTDL_OBJDIR ".libs/"
-
-/* Define if libtool can extract symbol lists from object files.  */
-#define HAVE_PRELOADED_SYMBOLS 1
-
-/* Define if you have the libdl library or equivalent.  */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the libdl library or equivalent. */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the libdl library or equivalent. */
-/* #undef HAVE_LIBDL */
-
-/* Define if you have the shl_load function. */
-/* #undef HAVE_SHL_LOAD */
-
-/* Define if you have the shl_load function. */
-/* #undef HAVE_SHL_LOAD */
-
-/* Define if you have the GNU dld library. */
-/* #undef HAVE_DLD */
-
-/* Define if dlsym() requires a leading underscode in symbol names.  */
-/* #undef NEED_USCORE */
-
-/* Define if the OS needs help to load dependent libraries for dlopen().  */
-#define LTDL_DLOPEN_DEPLIBS 1
-
-/* Define to a type to use for `error_t' if it is not otherwise available. */
-#define error_t int
-
-/* Define to 1 if you have the `argz_append' function. */
-/* #undef HAVE_ARGZ_APPEND */
-
-/* Define to 1 if you have the `argz_create_sep' function. */
-/* #undef HAVE_ARGZ_CREATE_SEP */
-
-/* Define to 1 if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define to 1 if you have the `argz_insert' function. */
-/* #undef HAVE_ARGZ_INSERT */
-
-/* Define to 1 if you have the `argz_next' function. */
-/* #undef HAVE_ARGZ_NEXT */
-
-/* Define to 1 if you have the `argz_stringify' function. */
-/* #undef HAVE_ARGZ_STRINGIFY */
-
-/* Define to 1 if you have the <assert.h> header file. */
-/* #undef HAVE_ASSERT_H */
-
-/* Define to 1 if you have the `bcopy' function. */
-/* #undef HAVE_BCOPY */
-
-/* Define to 1 if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
-   */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the GNU dld library. */
-/* #undef HAVE_DLD */
-
-/* Define to 1 if you have the <dld.h> header file. */
-/* #undef HAVE_DLD_H */
-
-/* Define to 1 if you have the `dlerror' function. */
-#define HAVE_DLERROR 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <dl.h> header file. */
-/* #undef HAVE_DL_H */
-
-/* Define to 1 if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define to 1 if the system has the type `error_t'. */
-/* #undef HAVE_ERROR_T */
-
-/* Define to 1 if you have the `index' function. */
-/* #undef HAVE_INDEX */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define if you have the libdl library or equivalent. */
-#define HAVE_LIBDL 1
-
-/* Define to 1 if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-#define HAVE_SIGNAL_H 1
-
-/* Define to 1 if you have the `memcpy' function. */
-#define HAVE_MEMCPY 1
-
-/* Define to 1 if you have the `memmove' function. */
-#define HAVE_MEMMOVE 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if libtool can extract symbol lists from object files. */
-#define HAVE_PRELOADED_SYMBOLS 1
-
-/* Define to 1 if you have the `rindex' function. */
-/* #undef HAVE_RINDEX */
-
-/* Define if you have the shl_load function. */
-/* #undef HAVE_SHL_LOAD */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#define HAVE_STDIO_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strchr' function. */
-#define HAVE_STRCHR 1
-
-/* Define to 1 if you have the `strcmp' function. */
-#define HAVE_STRCMP 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strrchr' function. */
-#define HAVE_STRRCHR 1
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
-   */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define to 1 if you have the <sys/dl.h> header file. */
-/* #undef HAVE_SYS_DL_H */
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
-   */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if the OS needs help to load dependent libraries for dlopen(). */
-#define LTDL_DLOPEN_DEPLIBS 1
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#define LTDL_OBJDIR ".libs/"
-
-/* Define to the name of the environment variable that determines the dynamic
-   library search path. */
-#define LTDL_SHLIBPATH_VAR "DYLD_LIBRARY_PATH"
-
-/* Define to the extension used for shared libraries, say, ".so". */
-/* #undef LTDL_SHLIB_EXT */
-
-/* Define to the system default library search path. */
-#define LTDL_SYSSEARCHPATH "/lib:/usr/lib"
-
-/* Define if dlsym() requires a leading underscode in symbol names. */
-#define NEED_USCORE 1
-
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to a type to use for `error_t' if it is not otherwise available. */
-#define error_t int
-
-#define HAVE_LIBPNG    1
-#define HAVE_OPENEXR   1
-/* Define as `__inline' if that's what the C compiler calls it, or to nothing
-   if it is not supported. */
-/* #undef inline */
diff --git a/synfig-core/trunk/sinfg.pbproj/darco.mode1 b/synfig-core/trunk/sinfg.pbproj/darco.mode1
deleted file mode 100755 (executable)
index 3f5cc0e..0000000
+++ /dev/null
@@ -1,1121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>ActivePerspectiveName</key>
-       <string>Project</string>
-       <key>AllowedModules</key>
-       <array>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>PBXSmartGroupTreeModule</string>
-                       <key>Name</key>
-                       <string>Groups and Files Outline View</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>PBXNavigatorGroup</string>
-                       <key>Name</key>
-                       <string>Editor</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>XCTaskListModule</string>
-                       <key>Name</key>
-                       <string>Task List</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>XCDetailModule</string>
-                       <key>Name</key>
-                       <string>File and Smart Group Detail Viewer</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>1</string>
-                       <key>Module</key>
-                       <string>PBXBuildResultsModule</string>
-                       <key>Name</key>
-                       <string>Detailed Build Results Viewer</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>1</string>
-                       <key>Module</key>
-                       <string>PBXProjectFindModule</string>
-                       <key>Name</key>
-                       <string>Project Batch Find Tool</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>PBXRunSessionModule</string>
-                       <key>Name</key>
-                       <string>Run Log</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>PBXBookmarksModule</string>
-                       <key>Name</key>
-                       <string>Bookmarks Tool</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>PBXClassBrowserModule</string>
-                       <key>Name</key>
-                       <string>Class Browser</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>PBXCVSModule</string>
-                       <key>Name</key>
-                       <string>Source Code Control Tool</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>PBXDebugBreakpointsModule</string>
-                       <key>Name</key>
-                       <string>Debug Breakpoints Tool</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>XCDockableInspector</string>
-                       <key>Name</key>
-                       <string>Inspector</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>n</string>
-                       <key>Module</key>
-                       <string>PBXOpenQuicklyModule</string>
-                       <key>Name</key>
-                       <string>Open Quickly Tool</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>1</string>
-                       <key>Module</key>
-                       <string>PBXDebugSessionModule</string>
-                       <key>Name</key>
-                       <string>Debugger</string>
-               </dict>
-               <dict>
-                       <key>BundleLoadPath</key>
-                       <string></string>
-                       <key>MaxInstances</key>
-                       <string>1</string>
-                       <key>Module</key>
-                       <string>PBXDebugCLIModule</string>
-                       <key>Name</key>
-                       <string>Debug Console</string>
-               </dict>
-       </array>
-       <key>Description</key>
-       <string>This workspace mimics that found in Xcode 1.2, with various minor improvements such as including attached editors to the build results window and the project find window.</string>
-       <key>DockingSystemVisible</key>
-       <false/>
-       <key>Extension</key>
-       <string>mode1</string>
-       <key>FirstTimeWindowDisplayed</key>
-       <false/>
-       <key>Identifier</key>
-       <string>com.apple.perspectives.project.mode1</string>
-       <key>MajorVersion</key>
-       <integer>31</integer>
-       <key>MinorVersion</key>
-       <integer>0</integer>
-       <key>Name</key>
-       <string>Default Workspace</string>
-       <key>Notifications</key>
-       <array/>
-       <key>OpenEditors</key>
-       <array/>
-       <key>Perspectives</key>
-       <array>
-               <dict>
-                       <key>ChosenToolbarItems</key>
-                       <array>
-                               <string>active-target-popup</string>
-                               <string>action</string>
-                               <string>NSToolbarFlexibleSpaceItem</string>
-                               <string>buildOrClean</string>
-                               <string>build-and-runOrDebug</string>
-                               <string>clean-target</string>
-                               <string>com.apple.ide.PBXToolbarStopButton</string>
-                               <string>get-info</string>
-                               <string>toggle-editor</string>
-                               <string>NSToolbarFlexibleSpaceItem</string>
-                               <string>com.apple.pbx.toolbar.searchfield</string>
-                       </array>
-                       <key>ControllerClassBaseName</key>
-                       <string></string>
-                       <key>IconName</key>
-                       <string>WindowOfProject</string>
-                       <key>Identifier</key>
-                       <string>perspective.project</string>
-                       <key>IsVertical</key>
-                       <false/>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>ContentConfiguration</key>
-                                       <dict>
-                                               <key>PBXBottomSmartGroupGIDs</key>
-                                               <array>
-                                                       <string>1C37FBAC04509CD000000102</string>
-                                                       <string>1C37FAAC04509CD000000102</string>
-                                                       <string>1C08E77C0454961000C914BD</string>
-                                                       <string>1C37FABC05509CD000000102</string>
-                                                       <string>1C37FABC05539CD112110102</string>
-                                                       <string>E2644B35053B69B200211256</string>
-                                                       <string>1C37FABC04509CD000100104</string>
-                                               </array>
-                                               <key>PBXProjectModuleGUID</key>
-                                               <string>1CE0B1FE06471DED0097A5F4</string>
-                                               <key>PBXProjectModuleLabel</key>
-                                               <string>Files</string>
-                                               <key>PBXProjectStructureProvided</key>
-                                               <string>yes</string>
-                                               <key>PBXSmartGroupTreeModuleColumnData</key>
-                                               <dict>
-                                                       <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
-                                                       <array>
-                                                               <real>186</real>
-                                                       </array>
-                                                       <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
-                                                       <array>
-                                                               <string>MainColumn</string>
-                                                       </array>
-                                               </dict>
-                                               <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
-                                               <dict>
-                                                       <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
-                                                       <array>
-                                                               <string>F550016102F0983D01000102</string>
-                                                               <string>F550017202F0ABE401000102</string>
-                                                               <string>A684452D0474A7BD00A80006</string>
-                                                               <string>F588A3BE02F0CCE501000102</string>
-                                                               <string>1C37FABC05509CD000000102</string>
-                                                       </array>
-                                                       <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
-                                                       <array>
-                                                               <array>
-                                                                       <integer>0</integer>
-                                                               </array>
-                                                       </array>
-                                                       <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
-                                                       <string>{{0, 1804}, {186, 576}}</string>
-                                               </dict>
-                                               <key>PBXTopSmartGroupGIDs</key>
-                                               <array/>
-                                       </dict>
-                                       <key>GeometryConfiguration</key>
-                                       <dict>
-                                               <key>Frame</key>
-                                               <string>{{0, 0}, {203, 594}}</string>
-                                               <key>GroupTreeTableConfiguration</key>
-                                               <array>
-                                                       <string>MainColumn</string>
-                                                       <real>186</real>
-                                               </array>
-                                               <key>RubberWindowFrame</key>
-                                               <string>152 177 935 636 0 0 1152 848 </string>
-                                       </dict>
-                                       <key>Module</key>
-                                       <string>PBXSmartGroupTreeModule</string>
-                                       <key>Proportion</key>
-                                       <string>203pt</string>
-                               </dict>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1CE0B20306471E060097A5F4</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>MyNewFile14.java</string>
-                                                               <key>PBXSplitModuleInNavigatorKey</key>
-                                                               <dict>
-                                                                       <key>Split0</key>
-                                                                       <dict>
-                                                                               <key>PBXProjectModuleGUID</key>
-                                                                               <string>1CE0B20406471E060097A5F4</string>
-                                                                               <key>PBXProjectModuleLabel</key>
-                                                                               <string>MyNewFile14.java</string>
-                                                                       </dict>
-                                                                       <key>SplitCount</key>
-                                                                       <string>1</string>
-                                                               </dict>
-                                                               <key>StatusBarVisibility</key>
-                                                               <true/>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 0}, {726, 0}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>152 177 935 636 0 0 1152 848 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXNavigatorGroup</string>
-                                                       <key>Proportion</key>
-                                                       <string>0pt</string>
-                                               </dict>
-                                               <dict>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1CE0B20506471E060097A5F4</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>Targets</string>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 7}, {726, 587}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>152 177 935 636 0 0 1152 848 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>XCDetailModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>587pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>726pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Project</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>XCModuleDock</string>
-                               <string>PBXSmartGroupTreeModule</string>
-                               <string>XCModuleDock</string>
-                               <string>PBXNavigatorGroup</string>
-                               <string>XCDetailModule</string>
-                       </array>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>A6E2EA81076564F1002AF736</string>
-                               <string>1CE0B1FE06471DED0097A5F4</string>
-                               <string>A6E2EA82076564F1002AF736</string>
-                               <string>1CE0B20306471E060097A5F4</string>
-                               <string>1CE0B20506471E060097A5F4</string>
-                       </array>
-                       <key>ToolbarConfiguration</key>
-                       <string>xcode.toolbar.config.default</string>
-               </dict>
-       </array>
-       <key>PerspectivesBarVisible</key>
-       <false/>
-       <key>StatusbarIsVisible</key>
-       <true/>
-       <key>TimeStamp</key>
-       <real>0.0</real>
-       <key>ToolbarDisplayMode</key>
-       <integer>1</integer>
-       <key>ToolbarIsVisible</key>
-       <true/>
-       <key>ToolbarSizeMode</key>
-       <integer>1</integer>
-       <key>Type</key>
-       <string>Perspectives</string>
-       <key>UpdateMessage</key>
-       <string></string>
-       <key>WindowJustification</key>
-       <integer>5</integer>
-       <key>WindowOrderList</key>
-       <array>
-               <string>A6E2EAF7076568B6002AF736</string>
-               <string>A6E2EB0A07656ADA002AF736</string>
-               <string>/Users/darco/Projects/Voria/sinfg/sinfg.pbproj</string>
-       </array>
-       <key>WindowString</key>
-       <string>152 177 935 636 0 0 1152 848 </string>
-       <key>WindowTools</key>
-       <array>
-               <dict>
-                       <key>FirstTimeWindowDisplayed</key>
-                       <false/>
-                       <key>Identifier</key>
-                       <string>windowTool.build</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1CD0528F0623707200166675</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>time.h</string>
-                                                               <key>PBXSplitModuleInNavigatorKey</key>
-                                                               <dict>
-                                                                       <key>Split0</key>
-                                                                       <dict>
-                                                                               <key>PBXProjectModuleGUID</key>
-                                                                               <string>1CD052900623707200166675</string>
-                                                                               <key>PBXProjectModuleLabel</key>
-                                                                               <string>time.h</string>
-                                                                               <key>bookmark</key>
-                                                                               <string>A6E2EB0907656ADA002AF736</string>
-                                                                               <key>history</key>
-                                                                               <array>
-                                                                                       <string>A6E2EB0807656ADA002AF736</string>
-                                                                               </array>
-                                                                       </dict>
-                                                                       <key>SplitCount</key>
-                                                                       <string>1</string>
-                                                               </dict>
-                                                               <key>StatusBarVisibility</key>
-                                                               <true/>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 0}, {500, 215}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>27 325 500 500 0 0 1152 848 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXNavigatorGroup</string>
-                                                       <key>Proportion</key>
-                                                       <string>215pt</string>
-                                               </dict>
-                                               <dict>
-                                                       <key>BecomeActive</key>
-                                                       <true/>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>XCMainBuildResultsModuleGUID</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>Build</string>
-                                                               <key>XCBuildResultsTrigger_Collapse</key>
-                                                               <integer>1021</integer>
-                                                               <key>XCBuildResultsTrigger_Open</key>
-                                                               <integer>1011</integer>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 222}, {500, 236}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>27 325 500 500 0 0 1152 848 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXBuildResultsModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>236pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>458pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Build Results</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXBuildResultsModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <true/>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>A6E2EAF7076568B6002AF736</string>
-                               <string>A6E2EAF8076568B6002AF736</string>
-                               <string>1CD0528F0623707200166675</string>
-                               <string>XCMainBuildResultsModuleGUID</string>
-                       </array>
-                       <key>ToolbarConfiguration</key>
-                       <string>xcode.toolbar.config.build</string>
-                       <key>WindowString</key>
-                       <string>27 325 500 500 0 0 1152 848 </string>
-                       <key>WindowToolGUID</key>
-                       <string>A6E2EAF7076568B6002AF736</string>
-                       <key>WindowToolIsVisible</key>
-                       <true/>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>windowTool.debugger</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>Debugger</key>
-                                                               <dict>
-                                                                       <key>HorizontalSplitView</key>
-                                                                       <dict>
-                                                                               <key>_collapsingFrameDimension</key>
-                                                                               <real>0.0</real>
-                                                                               <key>_indexOfCollapsedView</key>
-                                                                               <integer>0</integer>
-                                                                               <key>_percentageOfCollapsedView</key>
-                                                                               <real>0.0</real>
-                                                                               <key>isCollapsed</key>
-                                                                               <string>yes</string>
-                                                                               <key>sizes</key>
-                                                                               <array>
-                                                                                       <string>{{0, 0}, {317, 164}}</string>
-                                                                                       <string>{{317, 0}, {377, 164}}</string>
-                                                                               </array>
-                                                                       </dict>
-                                                                       <key>VerticalSplitView</key>
-                                                                       <dict>
-                                                                               <key>_collapsingFrameDimension</key>
-                                                                               <real>0.0</real>
-                                                                               <key>_indexOfCollapsedView</key>
-                                                                               <integer>0</integer>
-                                                                               <key>_percentageOfCollapsedView</key>
-                                                                               <real>0.0</real>
-                                                                               <key>isCollapsed</key>
-                                                                               <string>yes</string>
-                                                                               <key>sizes</key>
-                                                                               <array>
-                                                                                       <string>{{0, 0}, {694, 164}}</string>
-                                                                                       <string>{{0, 164}, {694, 216}}</string>
-                                                                               </array>
-                                                                       </dict>
-                                                               </dict>
-                                                               <key>LauncherConfigVersion</key>
-                                                               <string>8</string>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1C162984064C10D400B95A72</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>Debug - GLUTExamples (Underwater)</string>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>DebugConsoleDrawerSize</key>
-                                                               <string>{100, 120}</string>
-                                                               <key>DebugConsoleVisible</key>
-                                                               <string>None</string>
-                                                               <key>DebugConsoleWindowFrame</key>
-                                                               <string>{{200, 200}, {500, 300}}</string>
-                                                               <key>DebugSTDIOWindowFrame</key>
-                                                               <string>{{200, 200}, {500, 300}}</string>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 0}, {694, 380}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>321 238 694 422 0 0 1440 878 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXDebugSessionModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>380pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>380pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Debugger</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXDebugSessionModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <true/>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>1CD10A99069EF8BA00B06720</string>
-                               <string>1C0AD2AB069F1E9B00FABCE6</string>
-                               <string>1C162984064C10D400B95A72</string>
-                               <string>1C0AD2AC069F1E9B00FABCE6</string>
-                       </array>
-                       <key>ToolbarConfiguration</key>
-                       <string>xcode.toolbar.config.debug</string>
-                       <key>WindowString</key>
-                       <string>321 238 694 422 0 0 1440 878 </string>
-                       <key>WindowToolGUID</key>
-                       <string>1CD10A99069EF8BA00B06720</string>
-                       <key>WindowToolIsVisible</key>
-                       <false/>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>windowTool.find</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>Dock</key>
-                                                       <array>
-                                                               <dict>
-                                                                       <key>ContentConfiguration</key>
-                                                                       <dict>
-                                                                               <key>PBXProjectModuleGUID</key>
-                                                                               <string>1CDD528C0622207200134675</string>
-                                                                               <key>PBXProjectModuleLabel</key>
-                                                                               <string>&lt;No Editor&gt;</string>
-                                                                               <key>PBXSplitModuleInNavigatorKey</key>
-                                                                               <dict>
-                                                                                       <key>Split0</key>
-                                                                                       <dict>
-                                                                                               <key>PBXProjectModuleGUID</key>
-                                                                                               <string>1CD0528D0623707200166675</string>
-                                                                                       </dict>
-                                                                                       <key>SplitCount</key>
-                                                                                       <string>1</string>
-                                                                               </dict>
-                                                                               <key>StatusBarVisibility</key>
-                                                                               <true/>
-                                                                       </dict>
-                                                                       <key>GeometryConfiguration</key>
-                                                                       <dict>
-                                                                               <key>Frame</key>
-                                                                               <string>{{0, 0}, {781, 167}}</string>
-                                                                               <key>RubberWindowFrame</key>
-                                                                               <string>62 385 781 470 0 0 1440 878 </string>
-                                                                       </dict>
-                                                                       <key>Module</key>
-                                                                       <string>PBXNavigatorGroup</string>
-                                                                       <key>Proportion</key>
-                                                                       <string>781pt</string>
-                                                               </dict>
-                                                       </array>
-                                                       <key>Proportion</key>
-                                                       <string>50%</string>
-                                               </dict>
-                                               <dict>
-                                                       <key>BecomeActive</key>
-                                                       <true/>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1CD0528E0623707200166675</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>Project Find</string>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>Frame</key>
-                                                               <string>{{8, 0}, {773, 254}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>62 385 781 470 0 0 1440 878 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXProjectFindModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>50%</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>428pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Project Find</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXProjectFindModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <true/>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>1C530D57069F1CE1000CFCEE</string>
-                               <string>1C530D58069F1CE1000CFCEE</string>
-                               <string>1C530D59069F1CE1000CFCEE</string>
-                               <string>1CDD528C0622207200134675</string>
-                               <string>1C530D5A069F1CE1000CFCEE</string>
-                               <string>1CE0B1FE06471DED0097A5F4</string>
-                               <string>1CD0528E0623707200166675</string>
-                       </array>
-                       <key>WindowString</key>
-                       <string>62 385 781 470 0 0 1440 878 </string>
-                       <key>WindowToolGUID</key>
-                       <string>1C530D57069F1CE1000CFCEE</string>
-                       <key>WindowToolIsVisible</key>
-                       <false/>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>MENUSEPARATOR</string>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>windowTool.debuggerConsole</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>BecomeActive</key>
-                                                       <true/>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1C78EAAC065D492600B07095</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>Debugger Console</string>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 0}, {440, 358}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>650 41 440 400 0 0 1280 1002 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXDebugCLIModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>358pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>358pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Debugger Console</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXDebugCLIModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <true/>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>1C78EAAD065D492600B07095</string>
-                               <string>1C78EAAE065D492600B07095</string>
-                               <string>1C78EAAC065D492600B07095</string>
-                       </array>
-                       <key>WindowString</key>
-                       <string>650 41 440 400 0 0 1280 1002 </string>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>windowTool.run</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>LauncherConfigVersion</key>
-                                                               <string>3</string>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1CD0528B0623707200166675</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>Run</string>
-                                                               <key>Runner</key>
-                                                               <dict>
-                                                                       <key>HorizontalSplitView</key>
-                                                                       <dict>
-                                                                               <key>_collapsingFrameDimension</key>
-                                                                               <real>0.0</real>
-                                                                               <key>_indexOfCollapsedView</key>
-                                                                               <integer>0</integer>
-                                                                               <key>_percentageOfCollapsedView</key>
-                                                                               <real>0.0</real>
-                                                                               <key>isCollapsed</key>
-                                                                               <string>yes</string>
-                                                                               <key>sizes</key>
-                                                                               <array>
-                                                                                       <string>{{0, 0}, {491, 167}}</string>
-                                                                                       <string>{{0, 176}, {491, 267}}</string>
-                                                                               </array>
-                                                                       </dict>
-                                                                       <key>VerticalSplitView</key>
-                                                                       <dict>
-                                                                               <key>_collapsingFrameDimension</key>
-                                                                               <real>0.0</real>
-                                                                               <key>_indexOfCollapsedView</key>
-                                                                               <integer>0</integer>
-                                                                               <key>_percentageOfCollapsedView</key>
-                                                                               <real>0.0</real>
-                                                                               <key>isCollapsed</key>
-                                                                               <string>yes</string>
-                                                                               <key>sizes</key>
-                                                                               <array>
-                                                                                       <string>{{0, 0}, {405, 443}}</string>
-                                                                                       <string>{{414, 0}, {514, 443}}</string>
-                                                                               </array>
-                                                                       </dict>
-                                                               </dict>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 0}, {458, 143}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>342 452 458 185 0 0 1440 878 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXRunSessionModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>143pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>143pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Run Log</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXRunSessionModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <true/>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>1C0AD2B3069F1EA900FABCE6</string>
-                               <string>1C0AD2B4069F1EA900FABCE6</string>
-                               <string>1CD0528B0623707200166675</string>
-                               <string>1C0AD2B5069F1EA900FABCE6</string>
-                       </array>
-                       <key>ToolbarConfiguration</key>
-                       <string>xcode.toolbar.config.run</string>
-                       <key>WindowString</key>
-                       <string>342 452 458 185 0 0 1440 878 </string>
-                       <key>WindowToolGUID</key>
-                       <string>1C0AD2B3069F1EA900FABCE6</string>
-                       <key>WindowToolIsVisible</key>
-                       <false/>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>windowTool.scm</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1C78EAB2065D492600B07095</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>&lt;No Editor&gt;</string>
-                                                               <key>PBXSplitModuleInNavigatorKey</key>
-                                                               <dict>
-                                                                       <key>Split0</key>
-                                                                       <dict>
-                                                                               <key>PBXProjectModuleGUID</key>
-                                                                               <string>1C78EAB3065D492600B07095</string>
-                                                                       </dict>
-                                                                       <key>SplitCount</key>
-                                                                       <string>1</string>
-                                                               </dict>
-                                                               <key>StatusBarVisibility</key>
-                                                               <true/>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 0}, {452, 0}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>743 379 452 308 0 0 1280 1002 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXNavigatorGroup</string>
-                                                       <key>Proportion</key>
-                                                       <string>0pt</string>
-                                               </dict>
-                                               <dict>
-                                                       <key>BecomeActive</key>
-                                                       <true/>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1CD052920623707200166675</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>SCM</string>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>ConsoleFrame</key>
-                                                               <string>{{0, 259}, {452, 0}}</string>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 7}, {452, 259}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>743 379 452 308 0 0 1280 1002 </string>
-                                                               <key>TableConfiguration</key>
-                                                               <array>
-                                                                       <string>Status</string>
-                                                                       <real>30</real>
-                                                                       <string>FileName</string>
-                                                                       <real>199</real>
-                                                                       <string>Path</string>
-                                                                       <real>197.09500122070312</real>
-                                                               </array>
-                                                               <key>TableFrame</key>
-                                                               <string>{{0, 0}, {452, 250}}</string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXCVSModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>259pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>266pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>SCM</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXCVSModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <true/>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>1C78EAB4065D492600B07095</string>
-                               <string>1C78EAB5065D492600B07095</string>
-                               <string>1C78EAB2065D492600B07095</string>
-                               <string>1CD052920623707200166675</string>
-                       </array>
-                       <key>WindowString</key>
-                       <string>743 379 452 308 0 0 1280 1002 </string>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>windowTool.breakpoints</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>BecomeActive</key>
-                                                       <true/>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1CD052930623707200166675</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>Breakpoints</string>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>BreakpointsTreeTableConfiguration</key>
-                                                               <array>
-                                                                       <string>enabledColumn</string>
-                                                                       <real>16</real>
-                                                                       <string>breakpointColumn</string>
-                                                                       <real>201.5830078125</real>
-                                                               </array>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 0}, {240, 195}}</string>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>342 421 240 216 0 0 1440 878 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXDebugBreakpointsModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>195pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>195pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Breakpoints</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXDebugBreakpointsModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <false/>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>1C0AD2AD069F1E9B00FABCE6</string>
-                               <string>1C0AD2AE069F1E9B00FABCE6</string>
-                               <string>1CD052930623707200166675</string>
-                       </array>
-                       <key>WindowString</key>
-                       <string>342 421 240 216 0 0 1440 878 </string>
-                       <key>WindowToolGUID</key>
-                       <string>1C0AD2AD069F1E9B00FABCE6</string>
-                       <key>WindowToolIsVisible</key>
-                       <false/>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>windowTool.bookmarks</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>Module</key>
-                                                       <string>PBXBookmarksModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>166pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>166pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Bookmarks</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXBookmarksModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <false/>
-                       <key>WindowString</key>
-                       <string>538 42 401 187 0 0 1280 1002 </string>
-               </dict>
-               <dict>
-                       <key>Identifier</key>
-                       <string>windowTool.classBrowser</string>
-                       <key>Layout</key>
-                       <array>
-                               <dict>
-                                       <key>Dock</key>
-                                       <array>
-                                               <dict>
-                                                       <key>BecomeActive</key>
-                                                       <true/>
-                                                       <key>ContentConfiguration</key>
-                                                       <dict>
-                                                               <key>OptionsSetName</key>
-                                                               <string>Hierarchy, all classes</string>
-                                                               <key>PBXProjectModuleGUID</key>
-                                                               <string>1CA6456E063B45B4001379D8</string>
-                                                               <key>PBXProjectModuleLabel</key>
-                                                               <string>Class Browser - NSObject</string>
-                                                       </dict>
-                                                       <key>GeometryConfiguration</key>
-                                                       <dict>
-                                                               <key>ClassesFrame</key>
-                                                               <string>{{0, 0}, {374, 96}}</string>
-                                                               <key>ClassesTreeTableConfiguration</key>
-                                                               <array>
-                                                                       <string>PBXClassNameColumnIdentifier</string>
-                                                                       <real>208</real>
-                                                                       <string>PBXClassBookColumnIdentifier</string>
-                                                                       <real>22</real>
-                                                               </array>
-                                                               <key>Frame</key>
-                                                               <string>{{0, 0}, {630, 331}}</string>
-                                                               <key>MembersFrame</key>
-                                                               <string>{{0, 105}, {374, 395}}</string>
-                                                               <key>MembersTreeTableConfiguration</key>
-                                                               <array>
-                                                                       <string>PBXMemberTypeIconColumnIdentifier</string>
-                                                                       <real>22</real>
-                                                                       <string>PBXMemberNameColumnIdentifier</string>
-                                                                       <real>216</real>
-                                                                       <string>PBXMemberTypeColumnIdentifier</string>
-                                                                       <real>97</real>
-                                                                       <string>PBXMemberBookColumnIdentifier</string>
-                                                                       <real>22</real>
-                                                               </array>
-                                                               <key>PBXModuleWindowStatusBarHidden2</key>
-                                                               <true/>
-                                                               <key>RubberWindowFrame</key>
-                                                               <string>385 179 630 352 0 0 1440 878 </string>
-                                                       </dict>
-                                                       <key>Module</key>
-                                                       <string>PBXClassBrowserModule</string>
-                                                       <key>Proportion</key>
-                                                       <string>331pt</string>
-                                               </dict>
-                                       </array>
-                                       <key>Proportion</key>
-                                       <string>331pt</string>
-                               </dict>
-                       </array>
-                       <key>Name</key>
-                       <string>Class Browser</string>
-                       <key>ServiceClasses</key>
-                       <array>
-                               <string>PBXClassBrowserModule</string>
-                       </array>
-                       <key>StatusbarIsVisible</key>
-                       <false/>
-                       <key>TableOfContents</key>
-                       <array>
-                               <string>1C0AD2AF069F1E9B00FABCE6</string>
-                               <string>1C0AD2B0069F1E9B00FABCE6</string>
-                               <string>1CA6456E063B45B4001379D8</string>
-                       </array>
-                       <key>ToolbarConfiguration</key>
-                       <string>xcode.toolbar.config.classbrowser</string>
-                       <key>WindowString</key>
-                       <string>385 179 630 352 0 0 1440 878 </string>
-                       <key>WindowToolGUID</key>
-                       <string>1C0AD2AF069F1E9B00FABCE6</string>
-                       <key>WindowToolIsVisible</key>
-                       <false/>
-               </dict>
-       </array>
-</dict>
-</plist>
diff --git a/synfig-core/trunk/sinfg.pbproj/darco.pbxuser b/synfig-core/trunk/sinfg.pbproj/darco.pbxuser
deleted file mode 100755 (executable)
index fd19245..0000000
+++ /dev/null
@@ -1,757 +0,0 @@
-// !$*UTF8*$!
-{
-       A60324DD04425DAD00A80006 = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {806, 2309}}";
-                       sepNavSelRange = "{3451, 79}";
-                       sepNavVisRect = "{{0, 1470}, {459, 183}}";
-                       sepNavWindowFrame = "{{42, 264}, {750, 558}}";
-               };
-       };
-       A60324E904425DF300A80006 = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {938, 8161}}";
-                       sepNavSelRange = "{10705, 0}";
-                       sepNavVisRect = "{{0, 5897}, {711, 428}}";
-               };
-       };
-       A64F6CE3052A991700140006 = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {788, 8231}}";
-                       sepNavSelRange = "{6111, 55}";
-                       sepNavVisRect = "{{0, 3321}, {711, 428}}";
-               };
-       };
-       A65F23E605E843EC005A2B7E = {
-               fallbackIsa = XCSourceControlManager;
-               isSCMEnabled = 0;
-               isa = PBXSourceControlManager;
-               scmConfiguration = {
-               };
-               scmType = scm.cvs;
-       };
-       A65F23E705E843EC005A2B7E = {
-               indexTemplatePath = "";
-               isa = PBXCodeSenseManager;
-               usesDefaults = 1;
-               wantsCodeCompletion = 1;
-               wantsCodeCompletionAutoSuggestions = 0;
-               wantsCodeCompletionCaseSensitivity = 1;
-               wantsCodeCompletionListAlways = 1;
-               wantsCodeCompletionOnlyMatchingItems = 1;
-               wantsCodeCompletionParametersIncluded = 1;
-               wantsCodeCompletionPlaceholdersInserted = 1;
-               wantsCodeCompletionTabCompletes = 1;
-               wantsIndex = 1;
-       };
-       A6E2EB0807656ADA002AF736 = {
-               fRef = A60324DD04425DAD00A80006;
-               isa = PBXTextBookmark;
-               rLen = 1;
-               rLoc = 111;
-               rType = 1;
-       };
-       A6E2EB0907656ADA002AF736 = {
-               fRef = A60324DD04425DAD00A80006;
-               isa = PBXTextBookmark;
-               name = "\ttemplate<typename U> bool operator<(const U& rhs)const { return value_<rhs; }\n";
-               rLen = 79;
-               rLoc = 3451;
-               rType = 0;
-               vrLen = 832;
-               vrLoc = 3108;
-       };
-       A6F67DA003E7AE5C00A80006 = {
-               activeExec = 0;
-       };
-       F50C8476037493D401A80006 = {
-               activeExec = 0;
-       };
-       F50C849D03771AF301A80006 = {
-               activeExec = 0;
-       };
-       F513071503267616012F4765 = {
-               activeExec = 0;
-       };
-       F51307A3032684C7012F4765 = {
-               activeExec = 0;
-       };
-       F536546B03575855012F4ADF = {
-               activeExec = 0;
-       };
-       F550016502F0983D01000102 = {
-               activeBuildStyle = F5F2702E03C932DE01BABFEF;
-               activeExecutable = F5F48EBD0314868C01682FCB;
-               activeTarget = F5F48ECF0314873101682FCB;
-               addToTargets = (
-                       F5F48ECF0314873101682FCB,
-                       F5B07697032A95BC01A80082,
-               );
-               breakpoints = (
-               );
-               codeSenseManager = A65F23E705E843EC005A2B7E;
-               executables = (
-                       F5F48EBD0314868C01682FCB,
-               );
-               perUserDictionary = {
-                       PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       20,
-                                       266.8799,
-                                       155.2085,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXErrorsWarningsDataSource_TypeID,
-                                       PBXErrorsWarningsDataSource_MessageID,
-                                       PBXErrorsWarningsDataSource_LocationID,
-                               );
-                       };
-                       PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       20,
-                                       452,
-                                       20,
-                                       83,
-                                       43,
-                                       43,
-                                       20,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXFileDataSource_FiletypeID,
-                                       PBXFileDataSource_Filename_ColumnID,
-                                       PBXFileDataSource_Built_ColumnID,
-                                       PBXFileDataSource_ObjectSize_ColumnID,
-                                       PBXFileDataSource_Errors_ColumnID,
-                                       PBXFileDataSource_Warnings_ColumnID,
-                                       PBXFileDataSource_Target_ColumnID,
-                               );
-                       };
-                       PBXConfiguration.PBXFileTableDataSource3.PBXSymbolsDataSource = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXSymbolsDataSource_SymbolNameID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       16,
-                                       128.8008,
-                                       158.0356,
-                                       135.2085,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXSymbolsDataSource_SymbolTypeIconID,
-                                       PBXSymbolsDataSource_SymbolNameID,
-                                       PBXSymbolsDataSource_SymbolTypeID,
-                                       PBXSymbolsDataSource_ReferenceNameID,
-                               );
-                       };
-                       PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       20,
-                                       385,
-                                       85,
-                                       20,
-                                       85,
-                                       43,
-                                       43,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXFileDataSource_FiletypeID,
-                                       PBXFileDataSource_Filename_ColumnID,
-                                       PBXTargetDataSource_PrimaryAttribute,
-                                       PBXFileDataSource_Built_ColumnID,
-                                       PBXFileDataSource_ObjectSize_ColumnID,
-                                       PBXFileDataSource_Errors_ColumnID,
-                                       PBXFileDataSource_Warnings_ColumnID,
-                               );
-                       };
-                       PBXPerProjectTemplateStateSaveDate = 124085462;
-                       PBXPrepackagedSmartGroups_v2 = (
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       activationKey = OldTargetSmartGroup;
-                                       clz = PBXTargetSmartGroup;
-                                       description = "Displays all targets of the project.";
-                                       globalID = 1C37FABC04509CD000000102;
-                                       name = Targets;
-                                       preferences = {
-                                               image = Targets;
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = PBXTargetSmartGroup2;
-                                       description = "Displays all targets of the project as well as nested build phases.";
-                                       globalID = 1C37FBAC04509CD000000102;
-                                       name = Targets;
-                                       preferences = {
-                                               image = Targets;
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = PBXExecutablesSmartGroup;
-                                       description = "Displays all executables of the project.";
-                                       globalID = 1C37FAAC04509CD000000102;
-                                       name = Executables;
-                                       preferences = {
-                                               image = Executable;
-                                       };
-                               },
-                               {
-                                       " PBXTransientLocationAtTop " = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = PBXErrorsWarningsSmartGroup;
-                                       description = "Displays files with errors or warnings.";
-                                       globalID = 1C08E77C0454961000C914BD;
-                                       name = "Errors and Warnings";
-                                       preferences = {
-                                               fnmatch = "";
-                                               image = WarningsErrors;
-                                               recursive = 1;
-                                               regex = "";
-                                               root = "<PROJECT>";
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = PBXFilenameSmartGroup;
-                                       description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
-                                       globalID = 1CC0EA4004350EF90044410B;
-                                       name = "Implementation Files";
-                                       preferences = {
-                                               canSave = 1;
-                                               fnmatch = "";
-                                               image = SmartFolder;
-                                               isLeaf = 0;
-                                               recursive = 1;
-                                               regex = "?*\\.[mcMC]";
-                                               root = "<PROJECT>";
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = PBXFilenameSmartGroup;
-                                       description = "This group displays Interface Builder NIB Files.";
-                                       globalID = 1CC0EA4004350EF90041110B;
-                                       name = "NIB Files";
-                                       preferences = {
-                                               canSave = 1;
-                                               fnmatch = "*.nib";
-                                               image = SmartFolder;
-                                               isLeaf = 0;
-                                               recursive = 1;
-                                               regex = "";
-                                               root = "<PROJECT>";
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = no;
-                                       absolutePathToBundle = "";
-                                       clz = PBXFindSmartGroup;
-                                       description = "Displays Find Results.";
-                                       globalID = 1C37FABC05509CD000000102;
-                                       name = "Find Results";
-                                       preferences = {
-                                               image = spyglass;
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = no;
-                                       absolutePathToBundle = "";
-                                       clz = PBXBookmarksSmartGroup;
-                                       description = "Displays Project Bookmarks.";
-                                       globalID = 1C37FABC05539CD112110102;
-                                       name = Bookmarks;
-                                       preferences = {
-                                               image = Bookmarks;
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = XCSCMSmartGroup;
-                                       description = "Displays files with interesting SCM status.";
-                                       globalID = E2644B35053B69B200211256;
-                                       name = SCM;
-                                       preferences = {
-                                               image = PBXRepository;
-                                               isLeaf = 0;
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = PBXSymbolsSmartGroup;
-                                       description = "Displays all symbols for the project.";
-                                       globalID = 1C37FABC04509CD000100104;
-                                       name = "Project Symbols";
-                                       preferences = {
-                                               image = ProjectSymbols;
-                                               isLeaf = 1;
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = PBXFilenameSmartGroup;
-                                       description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
-                                       globalID = PBXTemplateMarker;
-                                       name = "Simple Filter SmartGroup";
-                                       preferences = {
-                                               canSave = 1;
-                                               fnmatch = "*.nib";
-                                               image = SmartFolder;
-                                               isLeaf = 0;
-                                               recursive = 1;
-                                               regex = "";
-                                               root = "<PROJECT>";
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       absolutePathToBundle = "";
-                                       clz = PBXFilenameSmartGroup;
-                                       description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
-                                       globalID = PBXTemplateMarker;
-                                       name = "Simple Regular Expression SmartGroup";
-                                       preferences = {
-                                               canSave = 1;
-                                               fnmatch = "";
-                                               image = SmartFolder;
-                                               isLeaf = 0;
-                                               recursive = 1;
-                                               regex = "?*\\.[mcMC]";
-                                               root = "<PROJECT>";
-                                       };
-                               },
-                               {
-                                       PBXTransientLocationAtTop = bottom;
-                                       clz = XDDesignSmartGroup;
-                                       description = "Displays Xdesign models";
-                                       globalID = 2E4A936305E6979E00701470;
-                                       name = Design;
-                                       preferences = {
-                                               image = Design;
-                                               isLeaf = 0;
-                                       };
-                               },
-                       );
-                       PBXWorkspaceContents = (
-                               {
-                                       PBXProjectWorkspaceModule_StateKey_Rev39 = {
-                                               PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = {
-                                                       BoundsStr = "{{0, 0}, {454, 340}}";
-                                                       Rows = (
-                                                               5,
-                                                       );
-                                                       VisibleRectStr = "{{0, 0}, {454, 340}}";
-                                               };
-                                               PBXProjectWorkspaceModule_EditorOpen = false;
-                                               PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = {
-                                                       PBXSplitModuleInNavigatorKey = {
-                                                               SplitCount = 1;
-                                                       };
-                                               };
-                                               PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
-                                                       PBXProjectWorkspaceModule_SGTM_Geometry = {
-                                                               _collapsingFrameDimension = 0;
-                                                               _indexOfCollapsedView = 0;
-                                                               _percentageOfCollapsedView = 0;
-                                                               sizes = (
-                                                                       "{{0, 0}, {182, 357}}",
-                                                                       "{{182, 0}, {469, 357}}",
-                                                               );
-                                                       };
-                                               };
-                                               PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {469, 357}}";
-                                               PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 0}, {750, 480}}";
-                                               PBXProjectWorkspaceModule_OldSuperviewFrame = "{{182, 0}, {469, 357}}";
-                                               PBXProjectWorkspaceModule_SGTM = {
-                                                       PBXBottomSmartGroupGIDs = (
-                                                               1C37FBAC04509CD000000102,
-                                                               1C37FAAC04509CD000000102,
-                                                               1C08E77C0454961000C914BD,
-                                                               1CC0EA4004350EF90044410B,
-                                                               1CC0EA4004350EF90041110B,
-                                                               1C37FABC05509CD000000102,
-                                                               1C37FABC05539CD112110102,
-                                                               E2644B35053B69B200211256,
-                                                               1C37FABC04509CD000100104,
-                                                       );
-                                                       PBXSmartGroupTreeModuleColumnData = {
-                                                               PBXSmartGroupTreeModuleColumnWidthsKey = (
-                                                                       165,
-                                                               );
-                                                               PBXSmartGroupTreeModuleColumnsKey_v4 = (
-                                                                       MainColumn,
-                                                               );
-                                                       };
-                                                       PBXSmartGroupTreeModuleOutlineStateKey_v7 = {
-                                                               PBXSmartGroupTreeModuleOutlineStateExpansionKey = (
-                                                                       F550016102F0983D01000102,
-                                                                       F58056B403A2F89101A80006,
-                                                                       F58BF73F03379BB601A80006,
-                                                                       F588A3BE02F0CCE501000102,
-                                                                       1C37FBAC04509CD000000102,
-                                                                       A60D2D0405E8559700A20744,
-                                                               );
-                                                               PBXSmartGroupTreeModuleOutlineStateSelectionKey = (
-                                                                       (
-                                                                               26,
-                                                                               22,
-                                                                               0,
-                                                                       ),
-                                                               );
-                                                               PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 120}, {165, 339}}";
-                                                       };
-                                                       PBXTopSmartGroupGIDs = (
-                                                       );
-                                               };
-                                       };
-                               },
-                       );
-                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXBuildResultsModule" = {
-                       };
-                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugCLIModule" = {
-                       };
-                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugSessionModule" = {
-                       };
-                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXNavigatorGroup" = {
-                               PBXSplitModuleInNavigatorKey = {
-                                       SplitCount = 1;
-                               };
-                       };
-                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = {
-                               PBXProjectWorkspaceModule_StateKey_Rev39 = {
-                                       PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = {
-                                               BoundsStr = "{{0, 0}, {454, 340}}";
-                                               Rows = (
-                                               );
-                                               VisibleRectStr = "{{0, 0}, {454, 340}}";
-                                       };
-                                       PBXProjectWorkspaceModule_EditorOpen = false;
-                                       PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = {
-                                               PBXSplitModuleInNavigatorKey = {
-                                                       SplitCount = 1;
-                                               };
-                                       };
-                                       PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
-                                               PBXProjectWorkspaceModule_SGTM_Geometry = {
-                                                       _collapsingFrameDimension = 0;
-                                                       _indexOfCollapsedView = 0;
-                                                       _percentageOfCollapsedView = 0;
-                                                       sizes = (
-                                                               "{{0, 0}, {182, 357}}",
-                                                               "{{182, 0}, {469, 357}}",
-                                                       );
-                                               };
-                                       };
-                                       PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {469, 357}}";
-                                       PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 0}, {750, 480}}";
-                                       PBXProjectWorkspaceModule_OldSuperviewFrame = "{{182, 0}, {469, 357}}";
-                                       PBXProjectWorkspaceModule_SGTM = {
-                                               PBXBottomSmartGroupGIDs = (
-                                                       1C37FBAC04509CD000000102,
-                                                       1C37FAAC04509CD000000102,
-                                                       1C08E77C0454961000C914BD,
-                                                       1CC0EA4004350EF90044410B,
-                                                       1CC0EA4004350EF90041110B,
-                                                       1C37FABC05509CD000000102,
-                                                       1C37FABC05539CD112110102,
-                                                       E2644B35053B69B200211256,
-                                                       1C37FABC04509CD000100104,
-                                               );
-                                               PBXSmartGroupTreeModuleColumnData = {
-                                                       PBXSmartGroupTreeModuleColumnWidthsKey = (
-                                                               165,
-                                                       );
-                                                       PBXSmartGroupTreeModuleColumnsKey_v4 = (
-                                                               MainColumn,
-                                                       );
-                                               };
-                                               PBXSmartGroupTreeModuleOutlineStateKey_v7 = {
-                                                       PBXSmartGroupTreeModuleOutlineStateExpansionKey = (
-                                                               F550016102F0983D01000102,
-                                                               F58056B403A2F89101A80006,
-                                                               F513071C032676F4012F4765,
-                                                               F513072A03267792012F4765,
-                                                               F58BF73F03379BB601A80006,
-                                                               1C37FBAC04509CD000000102,
-                                                               A60D2D0405E8559700A20744,
-                                                       );
-                                                       PBXSmartGroupTreeModuleOutlineStateSelectionKey = (
-                                                               (
-                                                                       37,
-                                                                       33,
-                                                                       31,
-                                                               ),
-                                                       );
-                                                       PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 446}, {165, 339}}";
-                                               };
-                                               PBXTopSmartGroupGIDs = (
-                                               );
-                                       };
-                               };
-                       };
-                       PBXWorkspaceGeometries = (
-                               {
-                                       Frame = "{{0, 0}, {651, 357}}";
-                                       PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
-                                       };
-                                       RubberWindowFrame = "314 374 651 399 0 0 1280 832 ";
-                               },
-                       );
-                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXBuildResultsModule" = {
-                               Frame = "{{0, 0}, {703, 453}}";
-                               PBXModuleWindowStatusBarHidden = YES;
-                               RubberWindowFrame = "515 102 703 474 0 0 1280 832 ";
-                       };
-                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugCLIModule" = {
-                               Frame = "{{0, 0}, {400, 201}}";
-                               PBXModuleWindowStatusBarHidden = YES;
-                               RubberWindowFrame = "50 804 400 222 0 0 1280 832 ";
-                       };
-                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugSessionModule" = {
-                               DebugConsoleDrawerSize = "{100, 120}";
-                               DebugConsoleVisible = None;
-                               DebugConsoleWindowFrame = "{{200, 200}, {500, 300}}";
-                               DebugSTDIOWindowFrame = "{{200, 200}, {500, 300}}";
-                               Frame = "{{0, 0}, {745, 442}}";
-                               WindowFrame = "{{269, 294}, {745, 520}}";
-                       };
-                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXNavigatorGroup" = {
-                               Frame = "{{0, 0}, {750, 481}}";
-                               PBXModuleWindowStatusBarHidden = YES;
-                               RubberWindowFrame = "532 129 750 502 0 0 1280 832 ";
-                       };
-                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = {
-                               Frame = "{{0, 0}, {651, 357}}";
-                               PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
-                                       PBXProjectWorkspaceModule_BuildResultsWindowVisible = true;
-                               };
-                               RubberWindowFrame = "314 374 651 399 0 0 1280 832 ";
-                       };
-                       PBXWorkspaceStateSaveDate = 124085462;
-               };
-               perUserProjectItems = {
-                       A6E2EB0807656ADA002AF736 = A6E2EB0807656ADA002AF736;
-                       A6E2EB0907656ADA002AF736 = A6E2EB0907656ADA002AF736;
-               };
-               sourceControlManager = A65F23E605E843EC005A2B7E;
-               userBookmarkGroup = F5CDFD230325C4C0012F4765;
-               userBuildSettings = {
-               };
-       };
-       F57D1CB1033FDE9A01A80006 = {
-               activeExec = 0;
-       };
-       F58056B303A2F5F401A80006 = {
-               activeExec = 0;
-       };
-       F580574A03A2FA0401A80006 = {
-               activeExec = 0;
-       };
-       F581E14903B24E2D0101DBD7 = {
-               activeExec = 0;
-       };
-       F59F5F6D0374911E01A80006 = {
-               activeExec = 0;
-       };
-       F59F5F8A037491BD01A80006 = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {711, 1217}}";
-                       sepNavSelRange = "{870, 0}";
-                       sepNavVisRect = "{{0, 231}, {711, 449}}";
-                       sepNavWindowFrame = "{{111, 185}, {750, 558}}";
-               };
-       };
-       F5B0764C032A77BE01A80082 = {
-               activeExec = 0;
-       };
-       F5B07697032A95BC01A80082 = {
-               activeExec = 0;
-       };
-       F5CDFD230325C4C0012F4765 = {
-               children = (
-                       F5CDFD260325D76A012F4765,
-                       F5CDFD270325D7B3012F4765,
-                       F5CDFD280325E148012F4765,
-               );
-               isa = PBXBookmarkGroup;
-               name = Root;
-       };
-       F5CDFD260325D76A012F4765 = {
-               fRef = F5FB06D103200B2801A80006;
-               isa = PBXTextBookmark;
-               name = "ltdl.c: find_handle_callback";
-               rLen = 0;
-               rLoc = 0;
-               rType = 0;
-               vrLen = 0;
-               vrLoc = 0;
-       };
-       F5CDFD270325D7B3012F4765 = {
-               fRef = F5FB06D103200B2801A80006;
-               isa = PBXTextBookmark;
-               name = "ltdl.c: try_dlopen";
-               rLen = 0;
-               rLoc = 0;
-               rType = 0;
-               vrLen = 0;
-               vrLoc = 0;
-       };
-       F5CDFD280325E148012F4765 = {
-               fRef = F5FB06D103200B2801A80006;
-               isa = PBXTextBookmark;
-               name = "ltdl.c: lt_dlopenext";
-               rLen = 0;
-               rLoc = 0;
-               rType = 0;
-               vrLen = 0;
-               vrLoc = 0;
-       };
-       F5D9889B03317C7401A80006 = {
-               activeExec = 0;
-       };
-       F5F48EBB0314868C01682FCB = {
-               activeExec = 0;
-               executables = (
-                       F5F48EBD0314868C01682FCB,
-               );
-       };
-       F5F48EBD0314868C01682FCB = {
-               activeArgIndex = 11;
-               activeArgIndices = (
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       YES,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-                       NO,
-               );
-               argumentStrings = (
-                       "",
-                       "--help",
-                       "--info",
-                       "--license",
-                       "--version",
-                       "internal_mandel.sif -w 300 -h 200 -a 1 --fps 10 -o mandel.gif",
-                       "mandelbrot.sif --fps 5 --start-time 5 --end-time 10 -a 1 -w 300 -h 200 -o mandel_out.sif",
-                       "--layers",
-                       "-v -v -v --targets",
-                       "--modules",
-                       "internal_mandel.sif -o mandelbrot.bmp -w 800 -h 600 -a 3 --time 15",
-                       "../examples/chitori.sif -o chitori.bmp --time 0 -Q 10",
-                       "mandelbrot.sif --time 15 -o mandelbrot.bmp",
-                       "internal_anim.sif --fps 15 --start-time 0 --end-time 22 -w 320 -h 240 -a 5 -o anim.gif -v",
-                       "internal_mandel.sif -o mandel.mpg --fps 10 --start-time 3 --end-time 6 -w 300 -h 200 -a 1",
-                       "internal_mandel.sif -o mandel.mpg --fps 7 --start-time 0 --end-time 6 -w 300 -h 200 -a 1",
-                       "internal_anim.sif -o anim.sif",
-                       "polygon.sif -w 320 -h 240 --start-time 0 --end-time 120 --fps 7 -o polygon.gif",
-                       "../example/about_icon.sif -w 640 -h 480 --frame 10 -o out.png -v -v -v",
-               );
-               configStateDict = {
-               };
-               cppStopOnCatchEnabled = 0;
-               cppStopOnThrowEnabled = 0;
-               customDataFormattersEnabled = 1;
-               debuggerPlugin = GDBDebugging;
-               disassemblyDisplayState = 0;
-               dylibVariantSuffix = "";
-               enableDebugStr = 1;
-               environmentEntries = (
-                       {
-                               active = YES;
-                               name = "";
-                               value = "";
-                       },
-               );
-               isa = PBXExecutable;
-               libgmallocEnabled = 0;
-               name = "Sinfg Tool";
-               shlibInfoDictList = (
-               );
-               sourceDirectories = (
-               );
-       };
-       F5F48EC2031486BE01682FCB = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {1130, 13747}}";
-                       sepNavSelRange = "{18012, 26}";
-                       sepNavVisRect = "{{0, 10587}, {711, 428}}";
-               };
-       };
-       F5F48EC40314870401682FCB = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {776, 1987}}";
-                       sepNavSelRange = "{888, 23}";
-                       sepNavVisRect = "{{0, 0}, {711, 449}}";
-                       sepNavWindowFrame = "{{157, 143}, {750, 558}}";
-               };
-       };
-       F5F48EC50314870401682FCB = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {836, 5431}}";
-                       sepNavSelRange = "{0, 0}";
-                       sepNavVisRect = "{{0, 0}, {711, 428}}";
-                       sepNavWindowFrame = "{{42, 248}, {750, 558}}";
-               };
-       };
-       F5F48EC60314870401682FCB = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {711, 1931}}";
-                       sepNavSelRange = "{2494, 21}";
-                       sepNavVisRect = "{{0, 1127}, {711, 449}}";
-                       sepNavWindowFrame = "{{134, 164}, {750, 558}}";
-               };
-       };
-       F5F48ECF0314873101682FCB = {
-               activeExec = 0;
-       };
-       F5F7845003482C9101A80006 = {
-               activeExec = 0;
-       };
-       F5F784630348DCAA01A80006 = {
-               activeExec = 0;
-       };
-       F5FB06D103200B2801A80006 = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {711, 55817}}";
-                       sepNavSelRange = "{1363, 22}";
-                       sepNavVisRect = "{{0, 409}, {711, 428}}";
-               };
-       };
-       F5FB06D203200B2801A80006 = {
-               uiCtxt = {
-                       sepNavIntBoundsRect = "{{0, 0}, {806, 5207}}";
-                       sepNavSelRange = "{0, 0}";
-                       sepNavVisRect = "{{0, 0}, {711, 428}}";
-                       sepNavWindowFrame = "{{134, 164}, {750, 558}}";
-               };
-       };
-       F5FB071303201B3201A80006 = {
-               activeExec = 0;
-       };
-}
diff --git a/synfig-core/trunk/sinfg.pbproj/doxygen.cfg b/synfig-core/trunk/sinfg.pbproj/doxygen.cfg
deleted file mode 100644 (file)
index 97a7029..0000000
+++ /dev/null
@@ -1,922 +0,0 @@
-# Doxyfile 1.2.14
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-#       TAG = value [value, ...]
-# For lists items can also be appended using:
-#       TAG += value [value, ...]
-# ValueBases that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = "sinfg"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
-# if some version control system is used.
-
-PROJECT_NUMBER         = 0.60.00-CVS
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = doc
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
-# documentation generated by doxygen is written. Doxygen will use this 
-# information to generate all constant output in the proper language. 
-# The default language is English, other supported languages are: 
-# Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, 
-# German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, 
-# Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish.
-
-OUTPUT_LANGUAGE        = English
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
-# documentation are documented, even if no documentation was available. 
-# Private class members and static file members will be hidden unless 
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL            = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
-# will be included in the documentation.
-
-EXTRACT_PRIVATE        = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file 
-# will be included in the documentation.
-
-EXTRACT_STATIC         = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
-# defined locally in source files will be included in the documentation. 
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES  = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
-# undocumented members of documented classes, files or namespaces. 
-# If set to NO (the default) these members will be included in the 
-# various overviews, but no documentation section is generated. 
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
-# undocumented classes that are normally visible in the class hierarchy. 
-# If set to NO (the default) these class will be included in the various 
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
-# include brief member descriptions after the members that are listed in 
-# the file and class documentation (similar to JavaDoc). 
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
-# the brief description of a member or function before the detailed description. 
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF           = YES
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
-# Doxygen will generate a detailed section even if there is only a brief 
-# description.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
-# members of a class in the documentation of that class as if those members were 
-# ordinary class members. Constructors, destructors and assignment operators of 
-# the base classes will not be shown.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
-# path before files name in the file list and in the header files. If set 
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES        = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
-# can be used to strip a user defined part of the path. Stripping is 
-# only done if one of the specified strings matches the left-hand part of 
-# the path. It is allowed to use relative paths in the argument list.
-
-STRIP_FROM_PATH        =
-
-# The INTERNAL_DOCS tag determines if documentation 
-# that is typed after a \internal command is included. If the tag is set 
-# to NO (the default) then the documentation will be excluded. 
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS          = YES
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
-# doxygen to hide any special comment blocks from generated source code 
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS    = YES
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
-# file names in lower case letters. If set to YES upper case letters are also 
-# allowed. This is useful if you have classes or files whose names only differ 
-# in case and if your file system supports case sensitive file names. Windows 
-# users are adviced to set this option to NO.
-
-CASE_SENSE_NAMES       = YES
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
-# (but less readable) file names. This can be useful is your file systems 
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES            = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
-# will show members with their full class and namespace scopes in the 
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES       = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
-# will generate a verbatim copy of the header file for each class for 
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS       = YES
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put list of the files that are included by a file in the documentation 
-# of that file.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
-# will interpret the first line (until the first dot) of a JavaDoc-style 
-# comment as the brief description. If set to NO, the JavaDoc 
-# comments  will behave just like the Qt-style comments (thus requiring an 
-# explict @brief command for a brief description.
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
-# reimplements.
-
-INHERIT_DOCS           = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
-# is inserted in the documentation for inline members.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
-# will sort the (detailed) documentation of file and class members 
-# alphabetically by member name. If set to NO the members will appear in 
-# declaration order.
-
-# SORT_MEMBER_DOCS       = YES
-SORT_MEMBER_DOCS       = NO
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
-# tag is set to YES, then doxygen will reuse the documentation of the first 
-# member in the group (if any) for the other members of the group. By default 
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC   = YES
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE               = 4
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or 
-# disable (NO) the todo list. This list is created by putting \todo 
-# commands in the documentation.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or 
-# disable (NO) the test list. This list is created by putting \test 
-# commands in the documentation.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or 
-# disable (NO) the bug list. This list is created by putting \bug 
-# commands in the documentation.
-
-GENERATE_BUGLIST       = YES
-
-# This tag can be used to specify a number of aliases that acts 
-# as commands in the documentation. An alias has the form "name=value". 
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
-# put the command \sideeffect (or @sideeffect) in the documentation, which 
-# will result in a user defined paragraph with heading "Side Effects:". 
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES                = "legal=\if legal" "endlegal=\endif" "writeme=\todo This needs to be documented" "stub=\todo This is a stub"
-
-# The ENABLED_SECTIONS tag can be used to enable conditional 
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS       = 
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
-# the initial value of a variable or define consist of for it to appear in 
-# the documentation. If the initializer consists of more lines than specified 
-# here it will be hidden. Use a value of 0 to hide initializers completely. 
-# The appearance of the initializer of individual variables and defines in the 
-# documentation can be controlled using \showinitializer or \hideinitializer 
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
-# only. Doxygen will then generate output that is more tailored for C. 
-# For instance some of the names that are used will be different. The list 
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C  = NO
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
-# at the bottom of the documentation of classes and structs. If set to YES the 
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES        = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated 
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET                  = YES
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are 
-# generated by doxygen. Possible values are YES and NO. If left blank 
-# NO is used.
-
-WARNINGS               = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# The WARN_FORMAT tag determines the format of the warning messages that 
-# doxygen can produce. The string should contain the $file, $line, and $text 
-# tags, which will be replaced by the file and line number from which the 
-# warning originated and the warning text.
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning 
-# and error messages should be written. If left blank the output is written 
-# to stderr.
-
-WARN_LOGFILE           = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain 
-# documented source files. You may enter file names like "myfile.cpp" or 
-# directories like "/usr/src/myproject". Separate the files or directories 
-# with spaces.
-
-INPUT                  = src/sinfg
-
-# If the value of the INPUT tag contains directories, you can use the 
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank the following patterns are tested: 
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
-# *.h++ *.idl *.odl
-
-FILE_PATTERNS          = *.h *.hxx *.hpp
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
-# should be searched for input files as well. Possible values are YES and NO. 
-# If left blank NO is used.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should 
-# excluded from the INPUT source files. This way you can easily exclude a 
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE                = 
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
-# that are symbolic links (a Unix filesystem feature) are excluded from the input.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the 
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
-# certain files from those directories.
-
-EXCLUDE_PATTERNS       = 
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or 
-# directories that contain example code fragments that are included (see 
-# the \include command).
-
-EXAMPLE_PATH           = 
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank all files are included.
-
-EXAMPLE_PATTERNS       = 
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
-# searched for input files to be used with the \include or \dontinclude 
-# commands irrespective of the value of the RECURSIVE tag. 
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or 
-# directories that contain image that are included in the documentation (see 
-# the \image command).
-
-IMAGE_PATH             = 
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should 
-# invoke to filter for each input file. Doxygen will invoke the filter program 
-# by executing (via popen()) the command <filter> <input-file>, where <filter> 
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
-# input file. Doxygen will then use the output that the filter program writes 
-# to standard output.
-
-INPUT_FILTER           = 
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
-# INPUT_FILTER) will be used to filter the input files when producing source 
-# files to browse.
-
-FILTER_SOURCE_FILES    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
-# be generated. Documented entities will be cross-referenced with these sources.
-
-SOURCE_BROWSER         = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body 
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = NO
-
-# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
-# then for each documented function all documented 
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES (the default) 
-# then for each documented function all documented entities 
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
-# of all compounds will be generated. Enable this if the project 
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX     = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all 
-# classes will be put under the same header in the alphabetical index. 
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX          =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
-# generate HTML output.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard header.
-
-HTML_HEADER            = 
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard footer.
-
-HTML_FOOTER            = 
-
-# The HTML_STYLESHEET tag can be used to specify a user defined cascading 
-# style sheet that is used by each HTML page. It can be used to 
-# fine-tune the look of the HTML output. If the tag is left blank doxygen 
-# will generate a default style sheet
-
-HTML_STYLESHEET        = 
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
-# files or namespaces will be aligned in HTML using tables. If set to 
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS     = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
-# will be generated that can be used as input for tools like the 
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP      = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
-# controls if a separate .chi index file is generated (YES) or that 
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI           = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
-# controls whether a binary table of contents is generated (YES) or a 
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members 
-# to the contents of the Html help documentation and to the tree view.
-
-TOC_EXPAND             = NO
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
-# top of each HTML page. The value NO (the default) enables the index and 
-# the value YES disables it.
-
-DISABLE_INDEX          = NO
-
-# This tag can be used to set the number of enum values (range [1..20]) 
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that 
-# is generated for HTML Help). For this to work a browser that supports 
-# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+, 
-# or Internet explorer 4.0+). Note that for large projects the tree generation 
-# can take a very long time. In such cases it is better to disable this feature. 
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW      = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
-# used to set the initial width (in pixels) of the frame in which the tree 
-# is shown.
-
-TREEVIEW_WIDTH         = 250
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
-# generate Latex output.
-
-GENERATE_LATEX         = YES
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT           = latex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
-# LaTeX documents. This may be useful for small projects and may help to 
-# save some trees in general.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used 
-# by the printer. Possible values are: a4, a4wide, letter, legal and 
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE             = letter
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES         = 
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
-# the generated latex document. The header should contain everything until 
-# the first chapter. If it is left blank doxygen will generate a 
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER           = 
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
-# contain links (just like the HTML output) instead of page references 
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS         = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
-# plain latex in the generated Makefile. Set this option to YES to get a 
-# higher quality PDF documentation.
-
-USE_PDFLATEX           = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
-# command to the generated LaTeX files. This will instruct LaTeX to keep 
-# running if errors occur, instead of asking the user for help. 
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE        = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
-# The RTF output is optimised for Word 97 and may not look very pretty with 
-# other RTF readers or editors.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
-# RTF documents. This may be useful for small projects and may help to 
-# save some trees in general.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
-# will contain hyperlink fields. The RTF file will 
-# contain links (just like the HTML output) instead of page references. 
-# This makes the output suitable for online browsing using WORD or other 
-# programs which support those fields. 
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's 
-# config file, i.e. a series of assigments. You only have to provide 
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE    = 
-
-# Set optional variables used in the generation of an rtf document. 
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE    = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
-# generate man pages
-
-GENERATE_MAN           = YES
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to 
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION          = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
-# then it will generate one additional man file for each entity 
-# documented in the real man page(s). These additional files 
-# only source the real man page, but without them the man command 
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will 
-# generate an XML file that captures the structure of 
-# the code including all documentation. Note that this 
-# feature is still experimental and incomplete at the 
-# moment.
-
-GENERATE_XML           = NO
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
-# generate an AutoGen Definitions (see autogen.sf.net) file 
-# that captures the structure of the code including all 
-# documentation. Note that this feature is still experimental 
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
-# evaluate all C-preprocessor directives found in the sources and include 
-# files.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
-# names in the source code. If set to NO (the default) only conditional 
-# compilation will be performed. Macro expansion can be done in a controlled 
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION        = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
-# then the macro expansion is limited to the macros specified with the 
-# PREDEFINED and EXPAND_AS_PREDEFINED tags.
-
-EXPAND_ONLY_PREDEF     = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that 
-# contain include files that are not input files but should be processed by 
-# the preprocessor.
-
-INCLUDE_PATH           = 
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
-# patterns (like *.h and *.hpp) to filter out the header-files in the 
-# directories. If left blank, the patterns specified with FILE_PATTERNS will 
-# be used.
-
-INCLUDE_FILE_PATTERNS  = 
-
-# The PREDEFINED tag can be used to specify one or more macro names that 
-# are defined before the preprocessor is started (similar to the -D option of 
-# gcc). The argument of the tag is a list of macros of the form: name 
-# or name=definition (no spaces). If the definition and the = are 
-# omitted =1 is assumed.
-
-PREDEFINED             = SINFG_NO_DEPRECATED DOXYGEN_SKIP
-
-# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then 
-# this tag can be used to specify a list of macro names that should be expanded. 
-# The macro definition that is found in the sources will be used. 
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED      = 
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
-# doxygen's preprocessor will remove all function-like macros that are alone 
-# on a line and do not end with a semicolon. Such function macros are typically 
-# used for boiler-plate code, and will confuse the parser if not removed.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references   
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tagfiles.
-
-TAGFILES               = 
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE       = 
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
-# in the class index. If set to NO only the inherited external classes 
-# will be listed.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
-# in the modules index. If set to NO, only the current project's groups will 
-# be listed.
-
-EXTERNAL_GROUPS        = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script 
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
-# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or 
-# super classes. Setting the tag to NO turns the diagrams off. Note that this 
-# option is superceded by the HAVE_DOT option below. This is only a fallback. It is 
-# recommended to install and use dot, since it yield more powerful graphs.
-
-CLASS_DIAGRAMS         = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
-# available from the path. This tool is part of Graphviz, a graph visualization 
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT               = NO
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect inheritance relations. Setting this tag to YES will force the 
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect implementation dependencies (inheritance, containment, and 
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH    = YES
-
-# If set to YES, the inheritance and collaboration graphs will show the 
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS     = YES
-
-# If set to YES, the inheritance and collaboration graphs will hide 
-# inheritance and usage relations if the target is undocumented 
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS   = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
-# tags are set to YES then doxygen will generate a graph for each documented 
-# file showing the direct and indirect include dependencies of the file with 
-# other documented files.
-
-INCLUDE_GRAPH          = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
-# documented header file showing the documented files that directly or 
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
-# generated by dot. Possible values are gif, jpg, and png
-# If left blank gif will be used.
-
-DOT_IMAGE_FORMAT       = gif
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be 
-# found. If left blank, it is assumed the dot tool can be found on the path.
-
-DOT_PATH               = 
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that 
-# contain dot files that are included in the documentation (see the 
-# \dotfile command).
-
-DOTFILE_DIRS           = 
-
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
-# this value, doxygen will try to truncate the graph, so that it fits within 
-# the specified constraint. Beware that most browsers cannot cope with very 
-# large images.
-
-MAX_DOT_GRAPH_WIDTH    = 1024
-
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
-# this value, doxygen will try to truncate the graph, so that it fits within 
-# the specified constraint. Beware that most browsers cannot cope with very 
-# large images.
-
-MAX_DOT_GRAPH_HEIGHT   = 1024
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
-# generate a legend page explaining the meaning of the various boxes and 
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
-# remove the intermedate dot files that are used to generate 
-# the various graphs.
-
-DOT_CLEANUP            = YES
-
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine   
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be 
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE           = NO
-
-# The CGI_NAME tag should be the name of the CGI script that 
-# starts the search engine (doxysearch) with the correct parameters. 
-# A script with this name will be generated by doxygen.
-
-CGI_NAME               = search.cgi
-
-# The CGI_URL tag should be the absolute URL to the directory where the 
-# cgi binaries are located. See the documentation of your http daemon for 
-# details.
-
-CGI_URL                = 
-
-# The DOC_URL tag should be the absolute URL to the directory where the 
-# documentation is located. If left blank the absolute path to the 
-# documentation, with file:// prepended to it, will be used.
-
-DOC_URL                = 
-
-# The DOC_ABSPATH tag should be the absolute path to the directory where the 
-# documentation is located. If left blank the directory on the local machine 
-# will be used.
-
-DOC_ABSPATH            = 
-
-# The BIN_ABSPATH tag must point to the directory where the doxysearch binary 
-# is installed.
-
-BIN_ABSPATH            = /usr/local/bin/
-
-# The EXT_DOC_PATHS tag can be used to specify one or more paths to 
-# documentation generated for other projects. This allows doxysearch to search 
-# the documentation for these projects as well.
-
-EXT_DOC_PATHS          = 
diff --git a/synfig-core/trunk/sinfg.pbproj/etl_profile.h b/synfig-core/trunk/sinfg.pbproj/etl_profile.h
deleted file mode 100644 (file)
index 0e414d7..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* include/etl_profile.h.  Generated by configure.  */
-/* include/etl_profile.h.in.  Generated from configure.in by autoheader.  */
-
-
-#ifndef __VETL_PROFILE_H
-#define __VETL_PROFILE_H
-
-/* define if target is big endian */
-#define WORDS_BIGENDIAN
-
-#ifndef HAVE_GETTIMEOFDAY
-#define HAVE_GETTIMEOFDAY
-#endif 
-
-#ifndef HAVE_PTHREAD_H
-#define HAVE_PTHREAD_H
-#endif
-
-#ifndef HAVE_SCHED_H
-#define HAVE_SCHED_H
-#endif
-
-#ifndef HAVE_PTHREAD_CREATE
-#define HAVE_PTHREAD_CREATE
-#endif
-
-#endif // __VETL_CONFIG_H
-
diff --git a/synfig-core/trunk/sinfg.pbproj/project.pbxproj b/synfig-core/trunk/sinfg.pbproj/project.pbxproj
deleted file mode 100755 (executable)
index f6f112d..0000000
+++ /dev/null
@@ -1,6808 +0,0 @@
-// !$*UTF8*$!
-{
-       archiveVersion = 1;
-       classes = {
-       };
-       objectVersion = 39;
-       objects = {
-               A60324CD0442574800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = insideout.cpp;
-                       path = src/modules/lyr_std/insideout.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324CE0442574800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = insideout.h;
-                       path = src/modules/lyr_std/insideout.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324CF0442574800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = julia.cpp;
-                       path = src/modules/lyr_std/julia.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324D00442574800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = julia.h;
-                       path = src/modules/lyr_std/julia.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324D30442574800A80006 = {
-                       fileRef = A60324CD0442574800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324D40442574800A80006 = {
-                       fileRef = A60324CE0442574800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324D50442574800A80006 = {
-                       fileRef = A60324CF0442574800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324D60442574800A80006 = {
-                       fileRef = A60324D00442574800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324D904425DAD00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = angle.h;
-                       path = src/sinfg/angle.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324DA04425DAD00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = renddesc.cpp;
-                       path = src/sinfg/renddesc.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324DB04425DAD00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = string.h;
-                       path = src/sinfg/string.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324DC04425DAD00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = time.cpp;
-                       path = src/sinfg/time.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324DD04425DAD00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = time.h;
-                       path = src/sinfg/time.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324DE04425DAD00A80006 = {
-                       fileRef = A60324D904425DAD00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A60324DF04425DAD00A80006 = {
-                       fileRef = A60324DA04425DAD00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324E004425DAD00A80006 = {
-                       fileRef = A60324DB04425DAD00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A60324E104425DAD00A80006 = {
-                       fileRef = A60324DC04425DAD00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324E204425DAD00A80006 = {
-                       fileRef = A60324DD04425DAD00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A60324E304425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_animated.cpp;
-                       path = src/sinfg/valuenode_animated.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324E404425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_animated.h;
-                       path = src/sinfg/valuenode_animated.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324E504425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_composite.cpp;
-                       path = src/sinfg/valuenode_composite.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324E604425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_composite.h;
-                       path = src/sinfg/valuenode_composite.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324E704425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_const.cpp;
-                       path = src/sinfg/valuenode_const.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324E804425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_const.h;
-                       path = src/sinfg/valuenode_const.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324E904425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_dynamiclist.cpp;
-                       path = src/sinfg/valuenode_dynamiclist.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324EA04425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_dynamiclist.h;
-                       path = src/sinfg/valuenode_dynamiclist.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324EB04425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_linear.cpp;
-                       path = src/sinfg/valuenode_linear.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324EC04425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_linear.h;
-                       path = src/sinfg/valuenode_linear.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324ED04425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_reference.cpp;
-                       path = src/sinfg/valuenode_reference.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324EE04425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_reference.h;
-                       path = src/sinfg/valuenode_reference.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324EF04425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_scale.cpp;
-                       path = src/sinfg/valuenode_scale.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324F004425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_scale.h;
-                       path = src/sinfg/valuenode_scale.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324F104425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_subtract.cpp;
-                       path = src/sinfg/valuenode_subtract.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324F204425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_subtract.h;
-                       path = src/sinfg/valuenode_subtract.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324F304425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_timedswap.cpp;
-                       path = src/sinfg/valuenode_timedswap.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324F404425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_timedswap.h;
-                       path = src/sinfg/valuenode_timedswap.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324F504425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode.cpp;
-                       path = src/sinfg/valuenode.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324F604425DF300A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode.h;
-                       path = src/sinfg/valuenode.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A60324F704425DF300A80006 = {
-                       fileRef = A60324E304425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324F804425DF300A80006 = {
-                       fileRef = A60324E404425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A60324F904425DF300A80006 = {
-                       fileRef = A60324E504425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324FA04425DF300A80006 = {
-                       fileRef = A60324E604425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A60324FB04425DF300A80006 = {
-                       fileRef = A60324E704425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324FC04425DF300A80006 = {
-                       fileRef = A60324E804425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A60324FD04425DF300A80006 = {
-                       fileRef = A60324E904425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A60324FE04425DF300A80006 = {
-                       fileRef = A60324EA04425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A60324FF04425DF300A80006 = {
-                       fileRef = A60324EB04425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A603250004425DF300A80006 = {
-                       fileRef = A60324EC04425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A603250104425DF300A80006 = {
-                       fileRef = A60324ED04425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A603250204425DF300A80006 = {
-                       fileRef = A60324EE04425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A603250304425DF300A80006 = {
-                       fileRef = A60324EF04425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A603250404425DF300A80006 = {
-                       fileRef = A60324F004425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A603250504425DF300A80006 = {
-                       fileRef = A60324F104425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A603250604425DF300A80006 = {
-                       fileRef = A60324F204425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A603250704425DF300A80006 = {
-                       fileRef = A60324F304425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A603250804425DF300A80006 = {
-                       fileRef = A60324F404425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A603250904425DF300A80006 = {
-                       fileRef = A60324F504425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A603250A04425DF300A80006 = {
-                       fileRef = A60324F604425DF300A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CD2052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = activepoint.cpp;
-                       path = src/sinfg/activepoint.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CD3052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = activepoint.h;
-                       path = src/sinfg/activepoint.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CD4052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = blinepoint.cpp;
-                       path = src/sinfg/blinepoint.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CD5052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = blinepoint.h;
-                       path = src/sinfg/blinepoint.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CD6052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = gamma.cpp;
-                       path = src/sinfg/gamma.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CD7052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = gamma.h;
-                       path = src/sinfg/gamma.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CD8052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = gradient.cpp;
-                       path = src/sinfg/gradient.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CD9052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = gradient.h;
-                       path = src/sinfg/gradient.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CDA052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer_shape.cpp;
-                       path = src/sinfg/layer_shape.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CDB052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer_shape.h;
-                       path = src/sinfg/layer_shape.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CDC052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = main.h;
-                       path = src/sinfg/main.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CDD052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = target_null_tile.cpp;
-                       path = src/sinfg/target_null_tile.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CDE052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = target_null_tile.h;
-                       path = src/sinfg/target_null_tile.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CDF052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = target_scanline.cpp;
-                       path = src/sinfg/target_scanline.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE0052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = target_scanline.h;
-                       path = src/sinfg/target_scanline.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE1052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = target_tile.cpp;
-                       path = src/sinfg/target_tile.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE2052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = target_tile.h;
-                       path = src/sinfg/target_tile.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE3052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_bline.cpp;
-                       path = src/sinfg/valuenode_bline.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE4052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_bline.h;
-                       path = src/sinfg/valuenode_bline.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE5052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_segcalctangent.cpp;
-                       path = src/sinfg/valuenode_segcalctangent.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE6052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_segcalctangent.h;
-                       path = src/sinfg/valuenode_segcalctangent.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE7052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_segcalcvertex.cpp;
-                       path = src/sinfg/valuenode_segcalcvertex.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE8052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_segcalcvertex.h;
-                       path = src/sinfg/valuenode_segcalcvertex.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CE9052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_stripes.cpp;
-                       path = src/sinfg/valuenode_stripes.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CEA052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_stripes.h;
-                       path = src/sinfg/valuenode_stripes.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CEB052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_twotone.cpp;
-                       path = src/sinfg/valuenode_twotone.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CEC052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_twotone.h;
-                       path = src/sinfg/valuenode_twotone.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CED052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = waypoint.cpp;
-                       path = src/sinfg/waypoint.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CEE052A991700140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = waypoint.h;
-                       path = src/sinfg/waypoint.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6CEF052A991700140006 = {
-                       fileRef = A64F6CD2052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6CF0052A991700140006 = {
-                       fileRef = A64F6CD3052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CF1052A991700140006 = {
-                       fileRef = A64F6CD4052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6CF2052A991700140006 = {
-                       fileRef = A64F6CD5052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CF3052A991700140006 = {
-                       fileRef = A64F6CD6052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6CF4052A991700140006 = {
-                       fileRef = A64F6CD7052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CF5052A991700140006 = {
-                       fileRef = A64F6CD8052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6CF6052A991700140006 = {
-                       fileRef = A64F6CD9052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CF7052A991700140006 = {
-                       fileRef = A64F6CDA052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6CF8052A991700140006 = {
-                       fileRef = A64F6CDB052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CF9052A991700140006 = {
-                       fileRef = A64F6CDC052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CFA052A991700140006 = {
-                       fileRef = A64F6CDD052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6CFB052A991700140006 = {
-                       fileRef = A64F6CDE052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CFC052A991700140006 = {
-                       fileRef = A64F6CDF052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6CFD052A991700140006 = {
-                       fileRef = A64F6CE0052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6CFE052A991700140006 = {
-                       fileRef = A64F6CE1052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6CFF052A991700140006 = {
-                       fileRef = A64F6CE2052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6D00052A991700140006 = {
-                       fileRef = A64F6CE3052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6D01052A991700140006 = {
-                       fileRef = A64F6CE4052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6D02052A991700140006 = {
-                       fileRef = A64F6CE5052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6D03052A991700140006 = {
-                       fileRef = A64F6CE6052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6D04052A991700140006 = {
-                       fileRef = A64F6CE7052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6D05052A991700140006 = {
-                       fileRef = A64F6CE8052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6D06052A991700140006 = {
-                       fileRef = A64F6CE9052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6D07052A991700140006 = {
-                       fileRef = A64F6CEA052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6D08052A991700140006 = {
-                       fileRef = A64F6CEB052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6D09052A991700140006 = {
-                       fileRef = A64F6CEC052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6D0A052A991700140006 = {
-                       fileRef = A64F6CED052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6D0B052A991700140006 = {
-                       fileRef = A64F6CEE052A991700140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A64F6D10052A99B800140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = radialgradient.cpp;
-                       path = src/modules/lyr_std/radialgradient.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6D16052A99B800140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = twirl.cpp;
-                       path = src/modules/lyr_std/twirl.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6D17052A99B800140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = twirl.h;
-                       path = src/modules/lyr_std/twirl.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A64F6D1C052A99B800140006 = {
-                       fileRef = A64F6D10052A99B800140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6D22052A99B800140006 = {
-                       fileRef = A64F6D16052A99B800140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A64F6D23052A99B800140006 = {
-                       fileRef = A64F6D17052A99B800140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A65F23C805E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
-                       remoteInfo = "Sinfg Library";
-               };
-               A65F23C905E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5B0764C032A77BE01A80082;
-                       remoteInfo = "BMP Target Module";
-               };
-               A65F23CA05E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5B07697032A95BC01A80082;
-                       remoteInfo = "Std. Layers Module";
-               };
-               A65F23CB05E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F57D1CB1033FDE9A01A80006;
-                       remoteInfo = "PPM Target Module";
-               };
-               A65F23CC05E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F536546B03575855012F4ADF;
-                       remoteInfo = "FFMpeg Module";
-               };
-               A65F23CD05E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F59F5F6D0374911E01A80006;
-                       remoteInfo = "FreeType Font Layer Module";
-               };
-               A65F23CE05E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F50C8476037493D401A80006;
-                       remoteInfo = "ImageMagick Module";
-               };
-               A65F23CF05E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F50C849D03771AF301A80006;
-                       remoteInfo = "DV Target Module";
-               };
-               A65F23D005E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F581E14903B24E2D0101DBD7;
-                       remoteInfo = "PNG Target Module";
-               };
-               A65F23D105E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = A6F67DA003E7AE5C00A80006;
-                       remoteInfo = "OpenEXR Module";
-               };
-               A65F23D205E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5F48EBB0314868C01682FCB;
-                       remoteInfo = "Sinfg Tool";
-               };
-               A65F23D305E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
-                       remoteInfo = "Sinfg Library";
-               };
-               A65F23D405E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F51307A3032684C7012F4765;
-                       remoteInfo = "All Modules";
-               };
-               A65F23D505E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
-                       remoteInfo = "Sinfg Library";
-               };
-               A65F23D605E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
-                       remoteInfo = "Sinfg Library";
-               };
-               A65F23D705E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5F48EBB0314868C01682FCB;
-                       remoteInfo = "Sinfg Tool";
-               };
-               A65F23D805E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F51307A3032684C7012F4765;
-                       remoteInfo = "All Modules";
-               };
-               A65F23D905E843AF005A2B7E = {
-                       containerPortal = F550016502F0983D01000102;
-                       isa = PBXContainerItemProxy;
-                       proxyType = 1;
-                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
-                       remoteInfo = "Sinfg Library";
-               };
-               A6714DEC0413E7BB00F656BD = {
-                       children = (
-                               A64F6CE3052A991700140006,
-                               A64F6CE4052A991700140006,
-                               A64F6CE5052A991700140006,
-                               A64F6CE6052A991700140006,
-                               A64F6CE7052A991700140006,
-                               A64F6CE8052A991700140006,
-                               A64F6CE9052A991700140006,
-                               A64F6CEA052A991700140006,
-                               A64F6CEB052A991700140006,
-                               A64F6CEC052A991700140006,
-                               A60324F504425DF300A80006,
-                               A60324F604425DF300A80006,
-                               A60324E304425DF300A80006,
-                               A60324E404425DF300A80006,
-                               A60324E504425DF300A80006,
-                               A60324E604425DF300A80006,
-                               A60324E704425DF300A80006,
-                               A60324E804425DF300A80006,
-                               A60324E904425DF300A80006,
-                               A60324EA04425DF300A80006,
-                               A60324EB04425DF300A80006,
-                               A60324EC04425DF300A80006,
-                               A60324ED04425DF300A80006,
-                               A60324EE04425DF300A80006,
-                               A60324EF04425DF300A80006,
-                               A60324F004425DF300A80006,
-                               A60324F104425DF300A80006,
-                               A60324F204425DF300A80006,
-                               A60324F304425DF300A80006,
-                               A60324F404425DF300A80006,
-                       );
-                       isa = PBXGroup;
-                       name = ValueNodes;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6714DF40413E80A00F656BD = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = segment.h;
-                       path = src/sinfg/segment.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6714DF50413E80A00F656BD = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = types.h;
-                       path = src/sinfg/types.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6714DFD0413E80A00F656BD = {
-                       fileRef = A6714DF40413E80A00F656BD;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A6714DFE0413E80A00F656BD = {
-                       fileRef = A6714DF50413E80A00F656BD;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A6714E1C0413F56300F656BD = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = rotate.cpp;
-                       path = src/modules/lyr_std/rotate.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6714E1D0413F56300F656BD = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = rotate.h;
-                       path = src/modules/lyr_std/rotate.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6714E1E0413F56300F656BD = {
-                       fileRef = A6714E1C0413F56300F656BD;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6714E1F0413F56300F656BD = {
-                       fileRef = A6714E1D0413F56300F656BD;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A68444F50474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = canvasbase.h;
-                       path = src/sinfg/canvasbase.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444F60474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = context.cpp;
-                       path = src/sinfg/context.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444F70474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = context.h;
-                       path = src/sinfg/context.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444F80474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer_bitmap.cpp;
-                       path = src/sinfg/layer_bitmap.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444F90474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer_bitmap.h;
-                       path = src/sinfg/layer_bitmap.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444FA0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer_composite.cpp;
-                       path = src/sinfg/layer_composite.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444FB0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer_composite.h;
-                       path = src/sinfg/layer_composite.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444FC0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer_mime.cpp;
-                       path = src/sinfg/layer_mime.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444FD0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer_mime.h;
-                       path = src/sinfg/layer_mime.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444FE0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer_motionblur.cpp;
-                       path = src/sinfg/layer_motionblur.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68444FF0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer_motionblur.h;
-                       path = src/sinfg/layer_motionblur.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445000474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer_pastecanvas.cpp;
-                       path = src/sinfg/layer_pastecanvas.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445010474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer_pastecanvas.h;
-                       path = src/sinfg/layer_pastecanvas.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445020474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer_polygon.cpp;
-                       path = src/sinfg/layer_polygon.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445030474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer_polygon.h;
-                       path = src/sinfg/layer_polygon.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445040474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer_solidcolor.cpp;
-                       path = src/sinfg/layer_solidcolor.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445050474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer_solidcolor.h;
-                       path = src/sinfg/layer_solidcolor.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445060474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = paramdesc.h;
-                       path = src/sinfg/paramdesc.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445070474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = real.h;
-                       path = src/sinfg/real.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445080474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = string_decl.h;
-                       path = src/sinfg/string_decl.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A684450B0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = target_multi.cpp;
-                       path = src/sinfg/target_multi.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A684450C0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = target_multi.h;
-                       path = src/sinfg/target_multi.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A684450D0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = target_null.cpp;
-                       path = src/sinfg/target_null.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A684450E0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = target_null.h;
-                       path = src/sinfg/target_null.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A684450F0474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = uniqueid.cpp;
-                       path = src/sinfg/uniqueid.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445100474A77900A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = uniqueid.h;
-                       path = src/sinfg/uniqueid.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445110474A77900A80006 = {
-                       fileRef = A68444F50474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445120474A77900A80006 = {
-                       fileRef = A68444F60474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A68445130474A77900A80006 = {
-                       fileRef = A68444F70474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445140474A77900A80006 = {
-                       fileRef = A68444F80474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A68445150474A77900A80006 = {
-                       fileRef = A68444F90474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445160474A77900A80006 = {
-                       fileRef = A68444FA0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A68445170474A77900A80006 = {
-                       fileRef = A68444FB0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445180474A77900A80006 = {
-                       fileRef = A68444FC0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A68445190474A77900A80006 = {
-                       fileRef = A68444FD0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A684451A0474A77900A80006 = {
-                       fileRef = A68444FE0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684451B0474A77900A80006 = {
-                       fileRef = A68444FF0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A684451C0474A77900A80006 = {
-                       fileRef = A68445000474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684451D0474A77900A80006 = {
-                       fileRef = A68445010474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A684451E0474A77900A80006 = {
-                       fileRef = A68445020474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684451F0474A77900A80006 = {
-                       fileRef = A68445030474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445200474A77900A80006 = {
-                       fileRef = A68445040474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A68445210474A77900A80006 = {
-                       fileRef = A68445050474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445220474A77900A80006 = {
-                       fileRef = A68445060474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445230474A77900A80006 = {
-                       fileRef = A68445070474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445240474A77900A80006 = {
-                       fileRef = A68445080474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445270474A77900A80006 = {
-                       fileRef = A684450B0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A68445280474A77900A80006 = {
-                       fileRef = A684450C0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A68445290474A77900A80006 = {
-                       fileRef = A684450D0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684452A0474A77900A80006 = {
-                       fileRef = A684450E0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A684452B0474A77900A80006 = {
-                       fileRef = A684450F0474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684452C0474A77900A80006 = {
-                       fileRef = A68445100474A77900A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A684452D0474A7BD00A80006 = {
-                       children = (
-                               A64F6CDA052A991700140006,
-                               A64F6CDB052A991700140006,
-                               A68444F80474A77900A80006,
-                               A68444F90474A77900A80006,
-                               A68444FA0474A77900A80006,
-                               A68444FB0474A77900A80006,
-                               A68444FC0474A77900A80006,
-                               A68444FD0474A77900A80006,
-                               A68444FE0474A77900A80006,
-                               A68444FF0474A77900A80006,
-                               A68445000474A77900A80006,
-                               A68445010474A77900A80006,
-                               A68445020474A77900A80006,
-                               A68445030474A77900A80006,
-                               A68445040474A77900A80006,
-                               A68445050474A77900A80006,
-                       );
-                       isa = PBXGroup;
-                       name = Layers;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A684452E0474A7D900A80006 = {
-                       children = (
-                               A64F6CDD052A991700140006,
-                               A64F6CDE052A991700140006,
-                               A64F6CDF052A991700140006,
-                               A64F6CE0052A991700140006,
-                               A64F6CE1052A991700140006,
-                               A64F6CE2052A991700140006,
-                               A684450B0474A77900A80006,
-                               A684450C0474A77900A80006,
-                               A684450D0474A77900A80006,
-                               A684450E0474A77900A80006,
-                       );
-                       isa = PBXGroup;
-                       name = Targets;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A684452F0474A83F00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = clamp.cpp;
-                       path = src/modules/lyr_std/clamp.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445300474A83F00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = clamp.h;
-                       path = src/modules/lyr_std/clamp.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445330474A83F00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = stretch.cpp;
-                       path = src/modules/lyr_std/stretch.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445340474A83F00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = stretch.h;
-                       path = src/modules/lyr_std/stretch.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445350474A83F00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = xorpattern.cpp;
-                       path = src/modules/lyr_std/xorpattern.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445360474A83F00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = xorpattern.h;
-                       path = src/modules/lyr_std/xorpattern.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A68445370474A83F00A80006 = {
-                       fileRef = A684452F0474A83F00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A68445380474A83F00A80006 = {
-                       fileRef = A68445300474A83F00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684453B0474A83F00A80006 = {
-                       fileRef = A68445330474A83F00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684453C0474A83F00A80006 = {
-                       fileRef = A68445340474A83F00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684453D0474A83F00A80006 = {
-                       fileRef = A68445350474A83F00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A684453E0474A83F00A80006 = {
-                       fileRef = A68445360474A83F00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6B861DF03E88E9500A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = archive.ar;
-                       name = libHalf.a;
-                       path = /usr/local/lib/libHalf.a;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               A6B861E003E88E9500A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = archive.ar;
-                       name = libIex.a;
-                       path = /usr/local/lib/libIex.a;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               A6B861E103E88E9500A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = archive.ar;
-                       name = libIlmImf.a;
-                       path = /usr/local/lib/libIlmImf.a;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               A6B861E203E88E9500A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = archive.ar;
-                       name = libImath.a;
-                       path = /usr/local/lib/libImath.a;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               A6B861E303E88E9500A80006 = {
-                       fileRef = A6B861DF03E88E9500A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6B861E403E88E9500A80006 = {
-                       fileRef = A6B861E003E88E9500A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6B861E503E88E9500A80006 = {
-                       fileRef = A6B861E103E88E9500A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6B861E603E88E9500A80006 = {
-                       fileRef = A6B861E203E88E9500A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6B861E703E88E9900A80006 = {
-                       children = (
-                               A6B861E003E88E9500A80006,
-                               A6B861E103E88E9500A80006,
-                               A6B861E203E88E9500A80006,
-                               A6B861DF03E88E9500A80006,
-                       );
-                       isa = PBXGroup;
-                       name = OpenEXR;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6B861E803E88EC100A80006 = {
-                       children = (
-                               F5EC16810332800301A80006,
-                               F51952E003326DBE01A80006,
-                               F58056B103A2DD0F01A80006,
-                       );
-                       isa = PBXGroup;
-                       name = XML;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6B861EB03E8937A00A80006 = {
-                       fileRef = F5FB06D503200BCD01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6B861EC03E893B500A80006 = {
-                       isa = PBXTargetDependency;
-                       target = A6F67DA003E7AE5C00A80006;
-                       targetProxy = A65F23D105E843AF005A2B7E;
-               };
-               A6B861ED03E897E500A80006 = {
-                       fileRef = A6F67DAB03E7AE5C00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1414905E836A0004C1DD1 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = curve_helper.cpp;
-                       path = src/sinfg/curve_helper.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C1414A05E836A0004C1DD1 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = curve_helper.h;
-                       path = src/sinfg/curve_helper.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C1414B05E836A0004C1DD1 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = palette.cpp;
-                       path = src/sinfg/palette.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C1414C05E836A0004C1DD1 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = palette.h;
-                       path = src/sinfg/palette.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C1414D05E836A0004C1DD1 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = polynomial_root.cpp;
-                       path = src/sinfg/polynomial_root.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C1414E05E836A0004C1DD1 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = polynomial_root.h;
-                       path = src/sinfg/polynomial_root.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C1414F05E836A0004C1DD1 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = transform.cpp;
-                       path = src/sinfg/transform.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C1415005E836A0004C1DD1 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = transform.h;
-                       path = src/sinfg/transform.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C1415105E836A0004C1DD1 = {
-                       fileRef = A6C1414905E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415205E836A0004C1DD1 = {
-                       fileRef = A6C1414A05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415305E836A0004C1DD1 = {
-                       fileRef = A6C1414B05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415405E836A0004C1DD1 = {
-                       fileRef = A6C1414C05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415505E836A0004C1DD1 = {
-                       fileRef = A6C1414D05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415605E836A0004C1DD1 = {
-                       fileRef = A6C1414E05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415705E836A0004C1DD1 = {
-                       fileRef = A6C1414F05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415805E836A0004C1DD1 = {
-                       fileRef = A6C1415005E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415905E836A0004C1DD1 = {
-                       fileRef = A6C1414905E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415A05E836A0004C1DD1 = {
-                       fileRef = A6C1414A05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415B05E836A0004C1DD1 = {
-                       fileRef = A6C1414B05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415C05E836A0004C1DD1 = {
-                       fileRef = A6C1414C05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415D05E836A0004C1DD1 = {
-                       fileRef = A6C1414D05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415E05E836A0004C1DD1 = {
-                       fileRef = A6C1414E05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1415F05E836A0004C1DD1 = {
-                       fileRef = A6C1414F05E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C1416005E836A0004C1DD1 = {
-                       fileRef = A6C1415005E836A0004C1DD1;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C8D62B0430F3DC00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = exception.cpp;
-                       path = src/sinfg/exception.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C8D62C0430F3DC00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = keyframe.cpp;
-                       path = src/sinfg/keyframe.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C8D62D0430F3DC00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = keyframe.h;
-                       path = src/sinfg/keyframe.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6C8D62E0430F3DC00A80006 = {
-                       fileRef = A6C8D62B0430F3DC00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C8D62F0430F3DC00A80006 = {
-                       fileRef = A6C8D62C0430F3DC00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6C8D6300430F3DC00A80006 = {
-                       fileRef = A6C8D62D0430F3DC00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A6D879B6042BAC7F00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = exception.h;
-                       path = src/sinfg/exception.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6D879B7042BAC7F00A80006 = {
-                       fileRef = A6D879B6042BAC7F00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A6D879B8042BACED00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = mptr_bmp.cpp;
-                       path = src/modules/mod_bmp/mptr_bmp.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6D879B9042BACED00A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = mptr_bmp.h;
-                       path = src/modules/mod_bmp/mptr_bmp.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6D879BA042BACED00A80006 = {
-                       fileRef = A6D879B8042BACED00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6D879BB042BACED00A80006 = {
-                       fileRef = A6D879B9042BACED00A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6D879BC042BACF900A80006 = {
-                       fileRef = F581E15903B24ECF0101DBD7;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6D879BD042BACFC00A80006 = {
-                       fileRef = F581E15A03B24ECF0101DBD7;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EA8307656625002AF736 = {
-                       children = (
-                       );
-                       isa = PBXGroup;
-                       name = Geometry;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8407656630002AF736 = {
-                       children = (
-                       );
-                       isa = PBXGroup;
-                       name = Gradients;
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8507656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = curveset.cpp;
-                       path = src/sinfg/curveset.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8607656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = curveset.h;
-                       path = src/sinfg/curveset.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8707656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = distance.cpp;
-                       path = src/sinfg/distance.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8807656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = distance.h;
-                       path = src/sinfg/distance.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8907656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = guid.cpp;
-                       path = src/sinfg/guid.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8A07656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = guid.h;
-                       path = src/sinfg/guid.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8B07656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = guidset.h;
-                       path = src/sinfg/guidset.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8C07656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = interpolation.h;
-                       path = src/sinfg/interpolation.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8D07656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = node.cpp;
-                       path = src/sinfg/node.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8E07656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = node.h;
-                       path = src/sinfg/node.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA8F07656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = rect.cpp;
-                       path = src/sinfg/rect.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9007656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = rect.h;
-                       path = src/sinfg/rect.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9107656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = smartfile.h;
-                       path = src/sinfg/smartfile.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9207656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = timepointcollect.cpp;
-                       path = src/sinfg/timepointcollect.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9307656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = timepointcollect.h;
-                       path = src/sinfg/timepointcollect.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9407656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_radialcomposite.cpp;
-                       path = src/sinfg/valuenode_radialcomposite.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9507656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_radialcomposite.h;
-                       path = src/sinfg/valuenode_radialcomposite.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9607656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = valuenode_sine.cpp;
-                       path = src/sinfg/valuenode_sine.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9707656673002AF736 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = valuenode_sine.h;
-                       path = src/sinfg/valuenode_sine.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6E2EA9807656673002AF736 = {
-                       fileRef = A6E2EA8507656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EA9907656673002AF736 = {
-                       fileRef = A6E2EA8607656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EA9A07656673002AF736 = {
-                       fileRef = A6E2EA8707656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EA9B07656673002AF736 = {
-                       fileRef = A6E2EA8807656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EA9C07656673002AF736 = {
-                       fileRef = A6E2EA8907656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EA9D07656673002AF736 = {
-                       fileRef = A6E2EA8A07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EA9E07656673002AF736 = {
-                       fileRef = A6E2EA8B07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EA9F07656673002AF736 = {
-                       fileRef = A6E2EA8C07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA007656673002AF736 = {
-                       fileRef = A6E2EA8D07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA107656673002AF736 = {
-                       fileRef = A6E2EA8E07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA207656673002AF736 = {
-                       fileRef = A6E2EA8F07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA307656673002AF736 = {
-                       fileRef = A6E2EA9007656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA407656673002AF736 = {
-                       fileRef = A6E2EA9107656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA507656673002AF736 = {
-                       fileRef = A6E2EA9207656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA607656673002AF736 = {
-                       fileRef = A6E2EA9307656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA707656673002AF736 = {
-                       fileRef = A6E2EA9407656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA807656673002AF736 = {
-                       fileRef = A6E2EA9507656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAA907656673002AF736 = {
-                       fileRef = A6E2EA9607656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAAA07656673002AF736 = {
-                       fileRef = A6E2EA9707656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAAB07656673002AF736 = {
-                       fileRef = A6E2EA8507656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAAC07656673002AF736 = {
-                       fileRef = A6E2EA8607656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAAD07656673002AF736 = {
-                       fileRef = A6E2EA8707656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAAE07656673002AF736 = {
-                       fileRef = A6E2EA8807656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAAF07656673002AF736 = {
-                       fileRef = A6E2EA8907656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB007656673002AF736 = {
-                       fileRef = A6E2EA8A07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB107656673002AF736 = {
-                       fileRef = A6E2EA8B07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB207656673002AF736 = {
-                       fileRef = A6E2EA8C07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB307656673002AF736 = {
-                       fileRef = A6E2EA8D07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB407656673002AF736 = {
-                       fileRef = A6E2EA8E07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB507656673002AF736 = {
-                       fileRef = A6E2EA8F07656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB607656673002AF736 = {
-                       fileRef = A6E2EA9007656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB707656673002AF736 = {
-                       fileRef = A6E2EA9107656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB807656673002AF736 = {
-                       fileRef = A6E2EA9207656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EAB907656673002AF736 = {
-                       fileRef = A6E2EA9307656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EABA07656673002AF736 = {
-                       fileRef = A6E2EA9407656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EABB07656673002AF736 = {
-                       fileRef = A6E2EA9507656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EABC07656673002AF736 = {
-                       fileRef = A6E2EA9607656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6E2EABD07656673002AF736 = {
-                       fileRef = A6E2EA9707656673002AF736;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6F67D8D03E7AD7400A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = listimporter.cpp;
-                       path = src/sinfg/listimporter.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67D8E03E7AD7400A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = listimporter.h;
-                       path = src/sinfg/listimporter.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67D8F03E7AD7400A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = version.h;
-                       path = src/sinfg/version.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67D9C03E7AD7400A80006 = {
-                       fileRef = A6F67D8D03E7AD7400A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6F67D9D03E7AD7400A80006 = {
-                       fileRef = A6F67D8E03E7AD7400A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A6F67D9E03E7AD7400A80006 = {
-                       fileRef = A6F67D8F03E7AD7400A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A6F67D9F03E7AE1900A80006 = {
-                       children = (
-                               A6F67DAD03E7AEF800A80006,
-                               A6F67DAE03E7AEF800A80006,
-                               A6F67DAF03E7AEF800A80006,
-                               A6F67DB003E7AEF800A80006,
-                               A6F67DB103E7AEF800A80006,
-                       );
-                       isa = PBXGroup;
-                       name = OpenEXR;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67DA003E7AE5C00A80006 = {
-                       buildPhases = (
-                               A6F67DA103E7AE5C00A80006,
-                               A6F67DA303E7AE5C00A80006,
-                               A6F67DA603E7AE5C00A80006,
-                               A6F67DAA03E7AE5C00A80006,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = "/usr/local/include/OpenEXR src";
-                               LIBRARY_SEARCH_PATHS = "";
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "-DHAVE_CONFIG_H";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmod_openexr.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "OpenEXR Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = A6F67DAB03E7AE5C00A80006;
-               };
-               A6F67DA103E7AE5C00A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               A6F67DB903E7AEF800A80006,
-                               A6F67DBB03E7AEF800A80006,
-                               A6B861EB03E8937A00A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               A6F67DA303E7AE5C00A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               A6F67DB703E7AEF800A80006,
-                               A6F67DB803E7AEF800A80006,
-                               A6F67DBA03E7AEF800A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               A6F67DA603E7AE5C00A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               A6F67DA703E7AE5C00A80006,
-                               A6F67DA803E7AE5C00A80006,
-                               A6B861E303E88E9500A80006,
-                               A6B861E403E88E9500A80006,
-                               A6B861E503E88E9500A80006,
-                               A6B861E603E88E9500A80006,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               A6F67DA703E7AE5C00A80006 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6F67DA803E7AE5C00A80006 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6F67DAA03E7AE5C00A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               A6F67DAB03E7AE5C00A80006 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmod_openexr.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               A6F67DAD03E7AEF800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mod_openexr/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67DAE03E7AEF800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = mptr_openexr.cpp;
-                       path = src/modules/mod_openexr/mptr_openexr.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67DAF03E7AEF800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = mptr_openexr.h;
-                       path = src/modules/mod_openexr/mptr_openexr.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67DB003E7AEF800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_openexr.cpp;
-                       path = src/modules/mod_openexr/trgt_openexr.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67DB103E7AEF800A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_openexr.h;
-                       path = src/modules/mod_openexr/trgt_openexr.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6F67DB703E7AEF800A80006 = {
-                       fileRef = A6F67DAD03E7AEF800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6F67DB803E7AEF800A80006 = {
-                       fileRef = A6F67DAE03E7AEF800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6F67DB903E7AEF800A80006 = {
-                       fileRef = A6F67DAF03E7AEF800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6F67DBA03E7AEF800A80006 = {
-                       fileRef = A6F67DB003E7AEF800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6F67DBB03E7AEF800A80006 = {
-                       fileRef = A6F67DB103E7AEF800A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6FEFDEC05DEA44C00140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = blur.cpp;
-                       path = src/sinfg/blur.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6FEFDED05DEA44C00140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = blur.h;
-                       path = src/sinfg/blur.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6FEFDEE05DEA44C00140006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = paramdesc.cpp;
-                       path = src/sinfg/paramdesc.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               A6FEFDEF05DEA44C00140006 = {
-                       fileRef = A6FEFDEC05DEA44C00140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               A6FEFDF005DEA44C00140006 = {
-                       fileRef = A6FEFDED05DEA44C00140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               A6FEFDF105DEA44C00140006 = {
-                       fileRef = A6FEFDEE05DEA44C00140006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-//A60
-//A61
-//A62
-//A63
-//A64
-//F50
-//F51
-//F52
-//F53
-//F54
-               F504527502F391C901000102 = {
-                       buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                               HEADER_SEARCH_PATHS = "\U0001./sinfg.pbproj";
-                               LDFLAGS = "\U0001-flat-namespace";
-                               MACOSX_DEPLOYMENT_TARGET = 10.2;
-                               OPTIMIZATION_CFLAGS = "-O0 -g -faltivec";
-                               OTHER_CFLAGS = "\U0001-DHAVE_CFLAGS -D_DEBUG -DHAVE_CONFIG_H -Wno-long-double";
-                               OTHER_CXXFLAGS = "\U0001-DHAVE_CFLAGS -D_DEBUG -DHAVE_CONFIG_H -Wno-long-double";
-                       };
-                       isa = PBXBuildStyle;
-                       name = "Development (GCC3)";
-               };
-               F50C8475037493C801A80006 = {
-                       isa = PBXTargetDependency;
-                       target = F59F5F6D0374911E01A80006;
-                       targetProxy = A65F23CD05E843AF005A2B7E;
-               };
-               F50C8476037493D401A80006 = {
-                       buildPhases = (
-                               F50C8477037493D401A80006,
-                               F50C847A037493D401A80006,
-                               F50C847E037493D401A80006,
-                               F50C8481037493D401A80006,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmod_imagemagick.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "ImageMagick Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F50C8482037493D401A80006;
-               };
-               F50C8477037493D401A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F50C848B0374945C01A80006,
-                               F50C848D0374945C01A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F50C847A037493D401A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F50C84890374945C01A80006,
-                               F50C848A0374945C01A80006,
-                               F50C848C0374945C01A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F50C847E037493D401A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F50C847F037493D401A80006,
-                               F50C8480037493D401A80006,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F50C847F037493D401A80006 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C8480037493D401A80006 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C8481037493D401A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F50C8482037493D401A80006 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmod_imagemagick.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F50C84830374942C01A80006 = {
-                       children = (
-                               F50C84840374945C01A80006,
-                               F50C84850374945C01A80006,
-                               F50C84860374945C01A80006,
-                               F50C84870374945C01A80006,
-                               F50C84880374945C01A80006,
-                               F50C848E0374947C01A80006,
-                       );
-                       isa = PBXGroup;
-                       name = ImageMagick;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84840374945C01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mod_imagemagick/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84850374945C01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = mptr_imagemagick.cpp;
-                       path = src/modules/mod_imagemagick/mptr_imagemagick.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84860374945C01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = mptr_imagemagick.h;
-                       path = src/modules/mod_imagemagick/mptr_imagemagick.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84870374945C01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_imagemagick.cpp;
-                       path = src/modules/mod_imagemagick/trgt_imagemagick.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84880374945C01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_imagemagick.h;
-                       path = src/modules/mod_imagemagick/trgt_imagemagick.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84890374945C01A80006 = {
-                       fileRef = F50C84840374945C01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C848A0374945C01A80006 = {
-                       fileRef = F50C84850374945C01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C848B0374945C01A80006 = {
-                       fileRef = F50C84860374945C01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C848C0374945C01A80006 = {
-                       fileRef = F50C84870374945C01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C848D0374945C01A80006 = {
-                       fileRef = F50C84880374945C01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C848E0374947C01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/mod_imagemagick/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C848F0374948C01A80006 = {
-                       isa = PBXTargetDependency;
-                       target = F50C8476037493D401A80006;
-                       targetProxy = A65F23CE05E843AF005A2B7E;
-               };
-               F50C8494037496BE01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = translate.cpp;
-                       path = src/modules/lyr_std/translate.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C8495037496BE01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = translate.h;
-                       path = src/modules/lyr_std/translate.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C849A037496BE01A80006 = {
-                       fileRef = F50C8494037496BE01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C849B037496BE01A80006 = {
-                       fileRef = F50C8495037496BE01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C849C03771ACC01A80006 = {
-                       children = (
-                               F50C84AB03771B7B01A80006,
-                               F50C84AC03771B7B01A80006,
-                               F50C84AD03771B7B01A80006,
-                               F50C84B103771B9601A80006,
-                       );
-                       isa = PBXGroup;
-                       name = DV;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C849D03771AF301A80006 = {
-                       buildPhases = (
-                               F50C849E03771AF301A80006,
-                               F50C84A103771AF301A80006,
-                               F50C84A503771AF301A80006,
-                               F50C84A803771AF301A80006,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmod_dv.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "DV Target Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F50C84A903771AF301A80006;
-               };
-               F50C849E03771AF301A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F50C84B003771B7B01A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F50C84A103771AF301A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F50C84AE03771B7B01A80006,
-                               F50C84AF03771B7B01A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F50C84A503771AF301A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F50C84A603771AF301A80006,
-                               F50C84A703771AF301A80006,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F50C84A603771AF301A80006 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C84A703771AF301A80006 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C84A803771AF301A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F50C84A903771AF301A80006 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmod_dv.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F50C84AA03771B0501A80006 = {
-                       isa = PBXTargetDependency;
-                       target = F50C849D03771AF301A80006;
-                       targetProxy = A65F23CF05E843AF005A2B7E;
-               };
-               F50C84AB03771B7B01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mod_dv/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84AC03771B7B01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_dv.cpp;
-                       path = src/modules/mod_dv/trgt_dv.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84AD03771B7B01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_dv.h;
-                       path = src/modules/mod_dv/trgt_dv.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84AE03771B7B01A80006 = {
-                       fileRef = F50C84AB03771B7B01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C84AF03771B7B01A80006 = {
-                       fileRef = F50C84AC03771B7B01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C84B003771B7B01A80006 = {
-                       fileRef = F50C84AD03771B7B01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C84B103771B9601A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/mod_dv/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F50C84B203771D3F01A80006 = {
-                       fileRef = F59F5F860374911E01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C84B303771D4001A80006 = {
-                       fileRef = F50C8482037493D401A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F50C84B403771D4101A80006 = {
-                       fileRef = F50C84A903771AF301A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F51305FF0325FC38012F4765 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = wrapper.framework;
-                       name = ETL.framework;
-                       path = /Library/Frameworks/ETL.framework;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               F51306480325FC38012F4765 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F51306490325FC4E012F4765 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F513064A0325FC51012F4765 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F513071103267616012F4765 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5130731032677CD012F4765,
-                               F5130732032677CD012F4765,
-                               F513073F03267D2C012F4765,
-                               F5130733032677CD012F4765,
-                               F513073B03267CDB012F4765,
-                       );
-                       isa = PBXResourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F513071503267616012F4765 = {
-                       buildPhases = (
-                               F581E13F03B249EA0101DBD7,
-                               F513079E032682CF012F4765,
-                               F513071903267679012F4765,
-                               F513071A03267680012F4765,
-                               F513071103267616012F4765,
-                               F513071B03267685012F4765,
-                       );
-                       buildSettings = {
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_REZFLAGS = "";
-                               PRODUCT_NAME = "sinfg-devel";
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                               WRAPPER_EXTENSION = pkg;
-                       };
-                       dependencies = (
-                               F51307170326764F012F4765,
-                               F513071803267651012F4765,
-                               F51307A5032684D5012F4765,
-                       );
-                       isa = PBXBundleTarget;
-                       name = Package;
-                       productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
-                       productName = Package;
-                       productReference = F513071603267616012F4765;
-                       productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>English</string>
-       <key>CFBundleGetInfoString</key>
-       <string></string>
-       <key>CFBundleIconFile</key>
-       <string></string>
-       <key>CFBundleIdentifier</key>
-       <string></string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleName</key>
-       <string></string>
-       <key>CFBundlePackageType</key>
-       <string>PKG</string>
-       <key>CFBundleShortVersionString</key>
-       <string></string>
-       <key>CFBundleSignature</key>
-       <string>????</string>
-       <key>CFBundleVersion</key>
-       <string>0.0.1d1</string>
-</dict>
-</plist>
-";
-               };
-               F513071603267616012F4765 = {
-                       explicitFileType = wrapper.cfbundle;
-                       isa = PBXFileReference;
-                       path = "sinfg-devel.pkg";
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F51307170326764F012F4765 = {
-                       isa = PBXTargetDependency;
-                       target = F5F48ECF0314873101682FCB;
-                       targetProxy = A65F23D505E843AF005A2B7E;
-               };
-               F513071803267651012F4765 = {
-                       isa = PBXTargetDependency;
-                       target = F5F48EBB0314868C01682FCB;
-                       targetProxy = A65F23D705E843AF005A2B7E;
-               };
-               F513071903267679012F4765 = {
-                       buildActionMask = 2147483647;
-                       dstPath = "pkg-tmp";
-                       dstSubfolderSpec = 16;
-                       files = (
-                               F5130738032677F3012F4765,
-                       );
-                       isa = PBXCopyFilesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F513071A03267680012F4765 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXShellScriptBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = ". config/build.cfg\n\nset -x\n\n# clean up the framework, remove extra files\nrm -rf build/pkg-tmp/sinfg.framework/Resources/pbdevelopment.plist\n\n# create the module manifest\nls --color=no build/pkg-tmp/sinfg.framework/Resources/modules | sed \"s/.so//;s/.dylib//;s/lib//;\" > build/pkg-tmp/sinfg.framework/Resources/sinfg_modules.cfg\n\n# remove the .DS_Store file to keep tool from crapping out\nrm -rf pkg-support/devel-resources/.DS_Store\n\nsed \"\ns:@_VERSION_@:$VERSION:;\ns:@_PACKAGE_@:$PACKAGE:;\ns:@_RELEASE_@:$RELEASE:;\ns:@_PACKAGE_NAME_@:$PACKAGE_NAME:;\ns:@_PRODUCT_NAME_@:$PRODUCT_NAME:;\n\" < config/pkg-support/sinfg-devel.info > build/$PRODUCT_NAME.info\n\n# create the .pkg\npackage build/pkg-tmp build/$PRODUCT_NAME.info -d  build \n\n# remove temporary files\nrm -rf build/pkg-tmp build/$PRODUCT_NAME.info\n\n# compress\n(cd build; sleep 1; tar -zcvf $PRODUCT_NAME.pkg.tar.gz $PRODUCT_NAME.pkg)";
-               };
-               F513071B03267685012F4765 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXShellScriptBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = ". config/build.cfg\n\nDIR=build/sinfg-devel.pkg/Contents/Resources\n\nsed \"\ns:@_VERSION_@:$VERSION:;\ns:@_PACKAGE_@:$PACKAGE:;\ns:@_RELEASE_@:$RELEASE:;\ns:@_PACKAGE_NAME_@:$PACKAGE_NAME:;\ns:@_PRODUCT_NAME_@:$PRODUCT_NAME:;\n\" < $DIR/install.sh > $DIR/$PRODUCT_NAME.post_install\ncp $DIR/$PRODUCT_NAME.post_install $DIR/$PRODUCT_NAME.post_upgrade\n\nrm $DIR/install.sh\n\n# add execute flag to scripts\nchmod 755 $DIR/$PRODUCT_NAME.post_install $DIR/$PRODUCT_NAME.post_upgrade\n";
-               };
-               F513071C032676F4012F4765 = {
-                       children = (
-                               F513072A03267792012F4765,
-                               F513072703267737012F4765,
-                       );
-                       isa = PBXGroup;
-                       name = "Package Files";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F513072703267737012F4765 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = "sinfg-devel.info";
-                       path = "config/pkg-support/sinfg-devel.info";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F513072A03267792012F4765 = {
-                       children = (
-                               F513072B032677B1012F4765,
-                               F513072C032677B1012F4765,
-                               F513072D032677B1012F4765,
-                       );
-                       isa = PBXGroup;
-                       name = "sinfg-devel";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F513072B032677B1012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text.script.sh;
-                       name = install.sh;
-                       path = "config/pkg-support/devel-resources/install.sh";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F513072C032677B1012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = ReadMe.txt;
-                       path = "config/pkg-support/devel-resources/ReadMe.txt";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F513072D032677B1012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Welcome.txt;
-                       path = "config/pkg-support/devel-resources/Welcome.txt";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5130731032677CD012F4765 = {
-                       fileRef = F513072B032677B1012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5130732032677CD012F4765 = {
-                       fileRef = F513072C032677B1012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5130733032677CD012F4765 = {
-                       fileRef = F513072D032677B1012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5130738032677F3012F4765 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F513073A03267C35012F4765 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXShellScriptBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "[ -e sinfg ] && mv sinfg build\nexit 0";
-               };
-               F513073B03267CDB012F4765 = {
-                       fileRef = F5F48EBC0314868C01682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F513073C03267D1E012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text.script.sh;
-                       path = "sinfg-config.in";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F513073F03267D2C012F4765 = {
-                       fileRef = F513073C03267D1E012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F513079503267FC7012F4765 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = file;
-                       name = "sinfg-devel.pkg.tar.gz";
-                       path = "build/sinfg-devel.pkg.tar.gz";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F513079E032682CF012F4765 = {
-                       buildActionMask = 2147483647;
-                       dstPath = sinfg.framework/Resources/modules;
-                       dstSubfolderSpec = 16;
-                       files = (
-                               F536547F0357610A012F4ADF,
-                               F53654800357610B012F4ADF,
-                               F53654820357610C012F4ADF,
-                               F53654840357610E012F4ADF,
-                               F50C84B203771D3F01A80006,
-                               F50C84B303771D4001A80006,
-                               F50C84B403771D4101A80006,
-                               F581E16903B253EE0101DBD7,
-                               A6B861ED03E897E500A80006,
-                       );
-                       isa = PBXCopyFilesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F51307A3032684C7012F4765 = {
-                       buildPhases = (
-                       );
-                       buildSettings = {
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_REZFLAGS = "";
-                               PRODUCT_NAME = "All Modules";
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                               A6B861EC03E893B500A80006,
-                               F581E15603B24E660101DBD7,
-                               F50C84AA03771B0501A80006,
-                               F50C848F0374948C01A80006,
-                               F50C8475037493C801A80006,
-                               F53654760357586F012F4ADF,
-                               F57D1CBC033FDEB701A80006,
-                               F5B076A6032A962601A80082,
-                               F5B07656032A7E8301A80082,
-                       );
-                       isa = PBXAggregateTarget;
-                       name = "All Modules";
-                       productName = "All Modules";
-               };
-               F51307A5032684D5012F4765 = {
-                       isa = PBXTargetDependency;
-                       target = F51307A3032684C7012F4765;
-                       targetProxy = A65F23D805E843AF005A2B7E;
-               };
-               F51307FB0326CBE8012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = render.cpp;
-                       path = src/sinfg/render.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F51307FC0326CBE8012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = render.h;
-                       path = src/sinfg/render.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F51307FE0326CBE8012F4765 = {
-                       fileRef = F51307FC0326CBE8012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F51307FF0326CD28012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = target.cpp;
-                       path = src/sinfg/target.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F51308000326CD28012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = target.h;
-                       path = src/sinfg/target.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F51308010326CD28012F4765 = {
-                       fileRef = F51307FF0326CD28012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F51308020326CD28012F4765 = {
-                       fileRef = F51308000326CD28012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F51952E003326DBE01A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = file;
-                       name = libxml.framework;
-                       path = /Library/Frameworks/libxml.framework;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               F5213F280384B9AF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = supersample.cpp;
-                       path = src/modules/lyr_std/supersample.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5213F290384B9AF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = supersample.h;
-                       path = src/modules/lyr_std/supersample.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5213F2C0384B9AF01A80006 = {
-                       fileRef = F5213F280384B9AF01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5213F2D0384B9AF01A80006 = {
-                       fileRef = F5213F290384B9AF01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536545E0357581B012F4ADF = {
-                       children = (
-                               F536545F03575842012F4ADF,
-                               F536546003575842012F4ADF,
-                               F536546103575842012F4ADF,
-                               F536546203575842012F4ADF,
-                               F536546303575842012F4ADF,
-                               F536546403575842012F4ADF,
-                       );
-                       isa = PBXGroup;
-                       name = FFMpeg;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F536545F03575842012F4ADF = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mod_ffmpeg/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F536546003575842012F4ADF = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/mod_ffmpeg/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F536546103575842012F4ADF = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = mptr_ffmpeg.cpp;
-                       path = src/modules/mod_ffmpeg/mptr_ffmpeg.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F536546203575842012F4ADF = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = mptr_ffmpeg.h;
-                       path = src/modules/mod_ffmpeg/mptr_ffmpeg.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F536546303575842012F4ADF = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_ffmpeg.cpp;
-                       path = src/modules/mod_ffmpeg/trgt_ffmpeg.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F536546403575842012F4ADF = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_ffmpeg.h;
-                       path = src/modules/mod_ffmpeg/trgt_ffmpeg.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F536546B03575855012F4ADF = {
-                       buildPhases = (
-                               F536546C03575855012F4ADF,
-                               F536546E03575855012F4ADF,
-                               F536547103575855012F4ADF,
-                               F536547403575855012F4ADF,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmod_ffmpeg.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "FFMpeg Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F536547503575855012F4ADF;
-               };
-               F536546C03575855012F4ADF = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F536547703575885012F4ADF,
-                               F536547903575887012F4ADF,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F536546E03575855012F4ADF = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F536547803575886012F4ADF,
-                               F536547A03575887012F4ADF,
-                               F536547B03575888012F4ADF,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F536547103575855012F4ADF = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F536547203575855012F4ADF,
-                               F536547303575855012F4ADF,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F536547203575855012F4ADF = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536547303575855012F4ADF = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536547403575855012F4ADF = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F536547503575855012F4ADF = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmod_ffmpeg.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F53654760357586F012F4ADF = {
-                       isa = PBXTargetDependency;
-                       target = F536546B03575855012F4ADF;
-                       targetProxy = A65F23CC05E843AF005A2B7E;
-               };
-               F536547703575885012F4ADF = {
-                       fileRef = F536546403575842012F4ADF;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536547803575886012F4ADF = {
-                       fileRef = F536546303575842012F4ADF;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536547903575887012F4ADF = {
-                       fileRef = F536546203575842012F4ADF;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536547A03575887012F4ADF = {
-                       fileRef = F536546103575842012F4ADF;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536547B03575888012F4ADF = {
-                       fileRef = F536545F03575842012F4ADF;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536547E03575FC6012F4ADF = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F536547F0357610A012F4ADF = {
-                       fileRef = F5B07653032A77BE01A80082;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F53654800357610B012F4ADF = {
-                       fileRef = F5B0769F032A95BC01A80082;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F53654820357610C012F4ADF = {
-                       fileRef = F57D1CBB033FDE9A01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F53654840357610E012F4ADF = {
-                       fileRef = F536547503575855012F4ADF;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F550016102F0983D01000102 = {
-                       children = (
-                               F58056B403A2F89101A80006,
-                               F513071C032676F4012F4765,
-                               F5FB07070320189701A80006,
-                               F5FB06D003200AE401A80006,
-                               F550017202F0ABE401000102,
-                               F550017302F0ABFA01000102,
-                               F58BF73F03379BB601A80006,
-                               F5D988D703325F0301A80006,
-                               F588A3BE02F0CCE501000102,
-                               F550016A02F0987601000102,
-                               F550016B02F0987601000102,
-                               F550016C02F0987601000102,
-                       );
-                       isa = PBXGroup;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F550016302F0983D01000102 = {
-                       buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                               GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_ENABLE_FIX_AND_CONTINUE = YES;
-                               GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-                               GCC_OPTIMIZATION_LEVEL = 0;
-                               GCC_VERSION = 2.x;
-                               LDFLAGS = "\U0001-flat-namespace";
-                               MACOSX_DEPLOYMENT_TARGET = 10.2;
-                               OTHER_CFLAGS = "\U0001-DHAVE_CFLAGS  -Wno-long-double";
-                               ZERO_LINK = YES;
-                       };
-                       isa = PBXBuildStyle;
-                       name = Development;
-               };
-               F550016402F0983D01000102 = {
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               LDFLAGS = "\U0001-flat-namespace";
-                               MACOSX_DEPLOYMENT_TARGET = 10.2;
-                               OPTIMIZATION_CFLAGS = "-O2 -ffast-math";
-                               OTHER_CFLAGS = "\U0001-DHAVE_CFLAGS -DNDEBUG  -Wno-long-double";
-                               OTHER_CXXFLAGS = "\U0001-DHAVE_CFLAGS -DNDEBUG -Wno-long-double";
-                               USE_GCC3_PFE_SUPPORT = YES;
-                       };
-                       isa = PBXBuildStyle;
-                       name = "Deployment (GCC3)";
-               };
-               F550016502F0983D01000102 = {
-                       buildSettings = {
-                       };
-                       buildStyles = (
-                               F550016302F0983D01000102,
-                               F504527502F391C901000102,
-                               F550016402F0983D01000102,
-                               F5F2702E03C932DE01BABFEF,
-                       );
-                       hasScannedForEncodings = 1;
-                       isa = PBXProject;
-                       mainGroup = F550016102F0983D01000102;
-                       productRefGroup = F588A3BE02F0CCE501000102;
-                       projectDirPath = "";
-                       targets = (
-                               F5F48ECF0314873101682FCB,
-                               F513071503267616012F4765,
-                               F5F48EBB0314868C01682FCB,
-                               F5FB071303201B3201A80006,
-                               F5B0764C032A77BE01A80082,
-                               F5D9889B03317C7401A80006,
-                               F57D1CB1033FDE9A01A80006,
-                               F5B07697032A95BC01A80082,
-                               F5F7845003482C9101A80006,
-                               F536546B03575855012F4ADF,
-                               F59F5F6D0374911E01A80006,
-                               F50C8476037493D401A80006,
-                               F50C849D03771AF301A80006,
-                               F581E14903B24E2D0101DBD7,
-                               A6F67DA003E7AE5C00A80006,
-                               F51307A3032684C7012F4765,
-                               F5F784630348DCAA01A80006,
-                               F58056B303A2F5F401A80006,
-                               F580574A03A2FA0401A80006,
-                       );
-               };
-               F550016802F0987601000102 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text.script.sh;
-                       path = bootstrap;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F550016A02F0987601000102 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       path = INSTALL;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F550016B02F0987601000102 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       path = Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F550016C02F0987601000102 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       path = README;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F550016E02F09B9701000102 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = build.cfg;
-                       path = config/build.cfg;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F550017102F0A69401000102 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = project.spec.in;
-                       path = config/project.spec.in;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F550017202F0ABE401000102 = {
-                       children = (
-                               A6E2EA8507656673002AF736,
-                               A6E2EA8607656673002AF736,
-                               A6E2EA8707656673002AF736,
-                               A6E2EA8807656673002AF736,
-                               A6E2EA8907656673002AF736,
-                               A6E2EA8A07656673002AF736,
-                               A6E2EA8B07656673002AF736,
-                               A6E2EA8C07656673002AF736,
-                               A6E2EA8D07656673002AF736,
-                               A6E2EA8E07656673002AF736,
-                               A6E2EA8F07656673002AF736,
-                               A6E2EA9007656673002AF736,
-                               A6E2EA9107656673002AF736,
-                               A6E2EA9207656673002AF736,
-                               A6E2EA9307656673002AF736,
-                               A6E2EA9407656673002AF736,
-                               A6E2EA9507656673002AF736,
-                               A6E2EA9607656673002AF736,
-                               A6E2EA9707656673002AF736,
-                               A6714DEC0413E7BB00F656BD,
-                               A684452D0474A7BD00A80006,
-                               A684452E0474A7D900A80006,
-                               F5FB06D503200BCD01A80006,
-                               A6714DF40413E80A00F656BD,
-                               A64F6CD2052A991700140006,
-                               A64F6CD3052A991700140006,
-                               A64F6CD4052A991700140006,
-                               A64F6CD5052A991700140006,
-                               A64F6CD6052A991700140006,
-                               A64F6CD7052A991700140006,
-                               A64F6CD8052A991700140006,
-                               A64F6CD9052A991700140006,
-                               A64F6CDC052A991700140006,
-                               A64F6CED052A991700140006,
-                               A64F6CEE052A991700140006,
-                               A6714DF50413E80A00F656BD,
-                               F579DCCA031560A001682FCB,
-                               F579DCD40315734101682FCB,
-                               F5F48EC60314870401682FCB,
-                               F5F48EC40314870401682FCB,
-                               F5F48EC50314870401682FCB,
-                               F579DCC80315607801682FCB,
-                               F579DCCE0315672F01682FCB,
-                               F579DCD003156FA301682FCB,
-                               F579DCD103156FA301682FCB,
-                               F579DCD60315770A01682FCB,
-                               F579DCD70315770A01682FCB,
-                               F579DCE303159B9401682FCB,
-                               F51307FB0326CBE8012F4765,
-                               A68444F50474A77900A80006,
-                               A68444F60474A77900A80006,
-                               A68444F70474A77900A80006,
-                               A68445060474A77900A80006,
-                               A68445070474A77900A80006,
-                               A68445080474A77900A80006,
-                               A684450F0474A77900A80006,
-                               A68445100474A77900A80006,
-                               F51307FC0326CBE8012F4765,
-                               F51307FF0326CD28012F4765,
-                               F51308000326CD28012F4765,
-                               F5A4F3320327E86D01A80006,
-                               A6F67D8D03E7AD7400A80006,
-                               A6F67D8E03E7AD7400A80006,
-                               A6F67D8F03E7AD7400A80006,
-                               F57D1D35034262A601A80006,
-                               F5F784D2034BC0D901A80006,
-                               F591EF12034511A901A80006,
-                               F591EF13034511A901A80006,
-                               F58056A303A2DB6901A80006,
-                               F58056A403A2DB6901A80006,
-                               F58056A503A2DB6901A80006,
-                               F58056A603A2DB6901A80006,
-                               F58056A703A2DB6901A80006,
-                               F58056A803A2DB6901A80006,
-                               F5D51DF50399C8EF01A80006,
-                               F5D51DF60399C8EF01A80006,
-                               A60324D904425DAD00A80006,
-                               A60324DA04425DAD00A80006,
-                               A60324DB04425DAD00A80006,
-                               A60324DC04425DAD00A80006,
-                               A60324DD04425DAD00A80006,
-                               A6D879B6042BAC7F00A80006,
-                               A6C8D62B0430F3DC00A80006,
-                               A6C8D62C0430F3DC00A80006,
-                               A6C8D62D0430F3DC00A80006,
-                               A6FEFDEC05DEA44C00140006,
-                               A6FEFDED05DEA44C00140006,
-                               A6FEFDEE05DEA44C00140006,
-                               A6C1414905E836A0004C1DD1,
-                               A6C1414A05E836A0004C1DD1,
-                               A6C1414B05E836A0004C1DD1,
-                               A6C1414C05E836A0004C1DD1,
-                               A6C1414D05E836A0004C1DD1,
-                               A6C1414E05E836A0004C1DD1,
-                               A6C1414F05E836A0004C1DD1,
-                               A6C1415005E836A0004C1DD1,
-                       );
-                       isa = PBXGroup;
-                       name = "Sinfg Library Sources";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F550017302F0ABFA01000102 = {
-                       children = (
-                               F579DCCC031560BA01682FCB,
-                               F5F48EC2031486BE01682FCB,
-                       );
-                       isa = PBXGroup;
-                       name = "Sinfg Tool Sources";
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F570DBE403257704012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = configure.in;
-                       path = libltdl/configure.in;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F570DBE503257704012F4765 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = libltdl/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCC80315607801682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = module.h;
-                       path = src/sinfg/module.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCC90315607801682FCB = {
-                       fileRef = F579DCC80315607801682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F579DCCA031560A001682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/sinfg/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCCC031560BA01682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/tool/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCCE0315672F01682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = module.cpp;
-                       path = src/sinfg/module.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCCF0315672F01682FCB = {
-                       fileRef = F579DCCE0315672F01682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F579DCD003156FA301682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = layer.cpp;
-                       path = src/sinfg/layer.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCD103156FA301682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = layer.h;
-                       path = src/sinfg/layer.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCD203156FA301682FCB = {
-                       fileRef = F579DCD003156FA301682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F579DCD303156FA301682FCB = {
-                       fileRef = F579DCD103156FA301682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F579DCD40315734101682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = pch.h;
-                       path = src/sinfg/pch.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCD50315734101682FCB = {
-                       fileRef = F579DCD40315734101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F579DCD60315770A01682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = color.cpp;
-                       path = src/sinfg/color.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCD70315770A01682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = color.h;
-                       path = src/sinfg/color.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCD80315770A01682FCB = {
-                       fileRef = F579DCD60315770A01682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F579DCD90315770A01682FCB = {
-                       fileRef = F579DCD70315770A01682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F579DCE303159B9401682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = vector.h;
-                       path = src/sinfg/vector.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F579DCE403159B9401682FCB = {
-                       fileRef = F579DCE303159B9401682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F57D1CAA033FDD6B01A80006 = {
-                       children = (
-                               F57D1CAB033FDE6601A80006,
-                               F57D1CAC033FDE6601A80006,
-                               F57D1CAD033FDE6701A80006,
-                               F57D1CAE033FDE6701A80006,
-                               F57D1CAF033FDE6701A80006,
-                               F57D1CB0033FDE6701A80006,
-                               F5FF0A3F03465FD101A80006,
-                               F5FF0A4003465FD101A80006,
-                       );
-                       isa = PBXGroup;
-                       name = PPM;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1CAB033FDE6601A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mod_ppm/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1CAC033FDE6601A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/mod_ppm/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1CAD033FDE6701A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_mpg.cpp;
-                       path = src/modules/mod_ppm/trgt_mpg.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1CAE033FDE6701A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_mpg.h;
-                       path = src/modules/mod_ppm/trgt_mpg.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1CAF033FDE6701A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_ppm.cpp;
-                       path = src/modules/mod_ppm/trgt_ppm.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1CB0033FDE6701A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_ppm.h;
-                       path = src/modules/mod_ppm/trgt_ppm.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1CB1033FDE9A01A80006 = {
-                       buildPhases = (
-                               F57D1CB2033FDE9A01A80006,
-                               F57D1CB4033FDE9A01A80006,
-                               F57D1CB7033FDE9A01A80006,
-                               F57D1CBA033FDE9A01A80006,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmod_ppm.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "PPM Target Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F57D1CBB033FDE9A01A80006;
-               };
-               F57D1CB2033FDE9A01A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F57D1CC5033FE09001A80006,
-                               F5FF0A4203465FD101A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F57D1CB4033FDE9A01A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F57D1CC6033FE09001A80006,
-                               F57D1CCA033FE09401A80006,
-                               F5FF0A4103465FD101A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F57D1CB7033FDE9A01A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F57D1CB8033FDE9A01A80006,
-                               F57D1CB9033FDE9A01A80006,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F57D1CB8033FDE9A01A80006 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1CB9033FDE9A01A80006 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1CBA033FDE9A01A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F57D1CBB033FDE9A01A80006 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmod_ppm.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F57D1CBC033FDEB701A80006 = {
-                       isa = PBXTargetDependency;
-                       target = F57D1CB1033FDE9A01A80006;
-                       targetProxy = A65F23CB05E843AF005A2B7E;
-               };
-               F57D1CC2033FE08001A80006 = {
-                       fileRef = F5D988A903317CCF01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1CC3033FE08101A80006 = {
-                       fileRef = F5D988AB03317CCF01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1CC4033FE08201A80006 = {
-                       fileRef = F5D988AC03317CCF01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1CC5033FE09001A80006 = {
-                       fileRef = F57D1CB0033FDE6701A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1CC6033FE09001A80006 = {
-                       fileRef = F57D1CAF033FDE6701A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1CCA033FE09401A80006 = {
-                       fileRef = F57D1CAB033FDE6601A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1D2D0340E47601A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = import.cpp;
-                       path = src/modules/lyr_std/import.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1D2E0340E47601A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = import.h;
-                       path = src/modules/lyr_std/import.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1D2F0340E47601A80006 = {
-                       fileRef = F57D1D2D0340E47601A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1D300340E47601A80006 = {
-                       fileRef = F57D1D2E0340E47601A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F57D1D35034262A601A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = surface.h;
-                       path = src/sinfg/surface.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F57D1D36034262A601A80006 = {
-                       fileRef = F57D1D35034262A601A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F58056A303A2DB6901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = canvas.cpp;
-                       path = src/sinfg/canvas.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58056A403A2DB6901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = canvas.h;
-                       path = src/sinfg/canvas.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58056A503A2DB6901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = loadcanvas.cpp;
-                       path = src/sinfg/loadcanvas.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58056A603A2DB6901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = loadcanvas.h;
-                       path = src/sinfg/loadcanvas.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58056A703A2DB6901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = savecanvas.cpp;
-                       path = src/sinfg/savecanvas.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58056A803A2DB6901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = savecanvas.h;
-                       path = src/sinfg/savecanvas.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58056A903A2DB6901A80006 = {
-                       fileRef = F58056A303A2DB6901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F58056AA03A2DB6901A80006 = {
-                       fileRef = F58056A403A2DB6901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F58056AB03A2DB6901A80006 = {
-                       fileRef = F58056A503A2DB6901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F58056AC03A2DB6901A80006 = {
-                       fileRef = F58056A603A2DB6901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F58056AD03A2DB6901A80006 = {
-                       fileRef = F58056A703A2DB6901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F58056AE03A2DB6901A80006 = {
-                       fileRef = F58056A803A2DB6901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F58056B103A2DD0F01A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = "compiled.mach-o.dylib";
-                       name = "libxml++-1.0.dylib";
-                       path = "/usr/local/lib/libxml++-1.0.1.0.3.dylib";
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               F58056B203A2DD0F01A80006 = {
-                       fileRef = F58056B103A2DD0F01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F58056B303A2F5F401A80006 = {
-                       buildArgumentsString = sinfg.pbproj/doxygen.cfg;
-                       buildPhases = (
-                       );
-                       buildSettings = {
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_REZFLAGS = "";
-                               PATH = "\U0001:/sw/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/bin";
-                               PRODUCT_NAME = doc;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       buildToolPath = /sw/bin/doxygen;
-                       dependencies = (
-                       );
-                       isa = PBXLegacyTarget;
-                       name = Doxygen;
-                       passBuildSettingsInEnvironment = 1;
-                       productName = Documentation;
-               };
-               F58056B403A2F89101A80006 = {
-                       children = (
-                               F5D12A4403A2FF4A01A80006,
-                               F58056B503A2F8BF01A80006,
-                               F58056B803A2F96801A80006,
-                               F580574C03A2FD9F01A80006,
-                               F5D12AE603A302D101A80006,
-                       );
-                       isa = PBXGroup;
-                       name = Documentation;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58056B503A2F8BF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = file;
-                       name = index.html;
-                       path = doc/html/index.html;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58056B803A2F96801A80006 = {
-                       includeInIndex = 1;
-                       isa = PBXFileReference;
-                       lastKnownFileType = file;
-                       name = html;
-                       path = doc/html;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F580574A03A2FA0401A80006 = {
-                       buildArgumentsString = pdf;
-                       buildPhases = (
-                       );
-                       buildSettings = {
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_REZFLAGS = "";
-                               PATH = "\U0001:/sw/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/bin:/bin";
-                               PRODUCT_NAME = "LaTeX Documentation";
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       buildToolPath = /usr/bin/gnumake;
-                       buildWorkingDirectory = /Users/darco/src/voria/sinfg/doc/latex/;
-                       dependencies = (
-                       );
-                       isa = PBXLegacyTarget;
-                       name = "PDF Documentation";
-                       passBuildSettingsInEnvironment = 1;
-                       productName = "PDF Documentation";
-               };
-               F580574C03A2FD9F01A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = file;
-                       name = refman.pdf;
-                       path = doc/latex/refman.pdf;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F581E13F03B249EA0101DBD7 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXShellScriptBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "rm -fr sinfg-devel.pkg";
-               };
-               F581E14003B24C140101DBD7 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = "compiled.mach-o.dylib";
-                       name = libpng.dylib;
-                       path = /usr/local/lib/libpng.3.1.2.5.dylib;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               F581E14803B24DF40101DBD7 = {
-                       children = (
-                               F581E15703B24ECF0101DBD7,
-                               F581E15803B24ECF0101DBD7,
-                               F581E15903B24ECF0101DBD7,
-                               F581E15A03B24ECF0101DBD7,
-                               F581E15B03B24ECF0101DBD7,
-                               F581E15C03B24ECF0101DBD7,
-                       );
-                       isa = PBXGroup;
-                       name = PNG;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F581E14903B24E2D0101DBD7 = {
-                       buildPhases = (
-                               F581E14A03B24E2D0101DBD7,
-                               F581E14D03B24E2D0101DBD7,
-                               F581E15103B24E2D0101DBD7,
-                               F581E15403B24E2D0101DBD7,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_SEARCH_PATHS = "";
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmod_png.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "PNG Target Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F581E15503B24E2D0101DBD7;
-               };
-               F581E14A03B24E2D0101DBD7 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F581E16303B24ED90101DBD7,
-                               A6D879BD042BACFC00A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F581E14D03B24E2D0101DBD7 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F581E16403B24EDA0101DBD7,
-                               F581E16703B24EDC0101DBD7,
-                               A6D879BC042BACF900A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F581E15103B24E2D0101DBD7 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F581E15203B24E2D0101DBD7,
-                               F581E15303B24E2D0101DBD7,
-                               F581E16803B253BB0101DBD7,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F581E15203B24E2D0101DBD7 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F581E15303B24E2D0101DBD7 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F581E15403B24E2D0101DBD7 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F581E15503B24E2D0101DBD7 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmod_png.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F581E15603B24E660101DBD7 = {
-                       isa = PBXTargetDependency;
-                       target = F581E14903B24E2D0101DBD7;
-                       targetProxy = A65F23D005E843AF005A2B7E;
-               };
-               F581E15703B24ECF0101DBD7 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mod_png/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F581E15803B24ECF0101DBD7 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/mod_png/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F581E15903B24ECF0101DBD7 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = mptr_png.cpp;
-                       path = src/modules/mod_png/mptr_png.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F581E15A03B24ECF0101DBD7 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = mptr_png.h;
-                       path = src/modules/mod_png/mptr_png.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F581E15B03B24ECF0101DBD7 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_png.cpp;
-                       path = src/modules/mod_png/trgt_png.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F581E15C03B24ECF0101DBD7 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_png.h;
-                       path = src/modules/mod_png/trgt_png.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F581E16303B24ED90101DBD7 = {
-                       fileRef = F581E15C03B24ECF0101DBD7;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F581E16403B24EDA0101DBD7 = {
-                       fileRef = F581E15B03B24ECF0101DBD7;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F581E16703B24EDC0101DBD7 = {
-                       fileRef = F581E15703B24ECF0101DBD7;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F581E16803B253BB0101DBD7 = {
-                       fileRef = F581E14003B24C140101DBD7;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F581E16903B253EE0101DBD7 = {
-                       fileRef = F581E15503B24E2D0101DBD7;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F588A3B502F0C38001000102 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = configure.ac;
-                       path = config/configure.ac;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F588A3BE02F0CCE501000102 = {
-                       children = (
-                               F5F48EBC0314868C01682FCB,
-                               F5F48ED00314873101682FCB,
-                               F5FB071403201B3201A80006,
-                               F513071603267616012F4765,
-                               F513079503267FC7012F4765,
-                               F5B07653032A77BE01A80082,
-                               F5B0769F032A95BC01A80082,
-                               F5D988A703317C7401A80006,
-                               F57D1CBB033FDE9A01A80006,
-                               F5F7845E03482C9101A80006,
-                               F536547503575855012F4ADF,
-                               F59F5F860374911E01A80006,
-                               F50C8482037493D401A80006,
-                               F50C84A903771AF301A80006,
-                               F581E15503B24E2D0101DBD7,
-                               A6F67DAB03E7AE5C00A80006,
-                       );
-                       isa = PBXGroup;
-                       name = Products;
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58BF73F03379BB601A80006 = {
-                       children = (
-                               F550016E02F09B9701000102,
-                               F550016802F0987601000102,
-                               F550017102F0A69401000102,
-                               F588A3B502F0C38001000102,
-                               F513073C03267D1E012F4765,
-                               F58BF74003379C0301A80006,
-                               F58BF74103379C0301A80006,
-                               F58BF74203379C0301A80006,
-                       );
-                       isa = PBXGroup;
-                       name = "Build Configuration";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58BF74003379C0301A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = cxx_macros.m4;
-                       path = config/cxx_macros.m4;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58BF74103379C0301A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = ETL.m4;
-                       path = config/ETL.m4;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F58BF74203379C0301A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = libxml.m4;
-                       path = config/libxml.m4;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F591EF12034511A901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = importer.cpp;
-                       path = src/sinfg/importer.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F591EF13034511A901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = importer.h;
-                       path = src/sinfg/importer.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F591EF14034511A901A80006 = {
-                       fileRef = F591EF12034511A901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F591EF15034511A901A80006 = {
-                       fileRef = F591EF13034511A901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F59F5F6D0374911E01A80006 = {
-                       buildPhases = (
-                               F59F5F6F0374911E01A80006,
-                               F59F5F780374911E01A80006,
-                               F59F5F820374911E01A80006,
-                               F59F5F850374911E01A80006,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = "/usr/X11R6/include/freetype2 /usr/local/include/freetype2 src";
-                               LIBRARY_SEARCH_PATHS = /usr/X11R6/lib;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = liblyr_freetype.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                               F59F5F6E0374911E01A80006,
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "FreeType Font Layer Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F59F5F860374911E01A80006;
-               };
-               F59F5F6E0374911E01A80006 = {
-                       isa = PBXTargetDependency;
-                       target = F5F48ECF0314873101682FCB;
-                       targetProxy = A65F23C805E843AF005A2B7E;
-               };
-               F59F5F6F0374911E01A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F59F5F91037491C201A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F59F5F780374911E01A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F59F5F90037491C201A80006,
-                               F59F5F92037491C301A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F59F5F820374911E01A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F59F5F830374911E01A80006,
-                               F59F5F840374911E01A80006,
-                               F59F5F940374921B01A80006,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F59F5F830374911E01A80006 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F59F5F840374911E01A80006 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F59F5F850374911E01A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F59F5F860374911E01A80006 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = liblyr_freetype.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F59F5F870374916F01A80006 = {
-                       children = (
-                               F59F5F88037491BD01A80006,
-                               F59F5F89037491BD01A80006,
-                               F59F5F8A037491BD01A80006,
-                               F59F5F8B037491BD01A80006,
-                       );
-                       isa = PBXGroup;
-                       name = "FreeType Layer";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F59F5F88037491BD01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = lyr_freetype.cpp;
-                       path = src/modules/lyr_freetype/lyr_freetype.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F59F5F89037491BD01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = lyr_freetype.h;
-                       path = src/modules/lyr_freetype/lyr_freetype.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F59F5F8A037491BD01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/lyr_freetype/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F59F5F8B037491BD01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/lyr_freetype/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F59F5F90037491C201A80006 = {
-                       fileRef = F59F5F8A037491BD01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F59F5F91037491C201A80006 = {
-                       fileRef = F59F5F89037491BD01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F59F5F92037491C301A80006 = {
-                       fileRef = F59F5F88037491BD01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F59F5F930374921B01A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = "compiled.mach-o.dylib";
-                       name = libfreetype.dylib;
-                       path = /usr/X11R6/lib/libfreetype.6.3.dylib;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               F59F5F940374921B01A80006 = {
-                       fileRef = F59F5F930374921B01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5A4F3320327E86D01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = renddesc.h;
-                       path = src/sinfg/renddesc.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5A4F3330327E86D01A80006 = {
-                       fileRef = F5A4F3320327E86D01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F5B07646032A774701A80082 = {
-                       children = (
-                               A6F67D9F03E7AE1900A80006,
-                               F581E14803B24DF40101DBD7,
-                               F50C849C03771ACC01A80006,
-                               F50C84830374942C01A80006,
-                               F536545E0357581B012F4ADF,
-                               F5F7844B03482C5201A80006,
-                               F57D1CAA033FDD6B01A80006,
-                               F5D9889A03317C5A01A80006,
-                               F5B07647032A775701A80082,
-                       );
-                       isa = PBXGroup;
-                       name = "Image Formats";
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B07647032A775701A80082 = {
-                       children = (
-                               F5B07648032A778701A80082,
-                               F5B07649032A778701A80082,
-                               F5EDFADA032D252001A80082,
-                               F5EDFADB032D252001A80082,
-                               A6D879B8042BACED00A80006,
-                               A6D879B9042BACED00A80006,
-                       );
-                       isa = PBXGroup;
-                       name = BMP;
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B07648032A778701A80082 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mod_bmp/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B07649032A778701A80082 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/mod_bmp/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B0764C032A77BE01A80082 = {
-                       buildPhases = (
-                               F5B0764D032A77BE01A80082,
-                               F5B0764E032A77BE01A80082,
-                               F5B07650032A77BE01A80082,
-                               F5B07652032A77BE01A80082,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "-lstdc++";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmod_bmp.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "BMP Target Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F5B07653032A77BE01A80082;
-               };
-               F5B0764D032A77BE01A80082 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5EDFADD032D252001A80082,
-                               A6D879BB042BACED00A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5B0764E032A77BE01A80082 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5B07655032A7C8801A80082,
-                               F5EDFADC032D252001A80082,
-                               A6D879BA042BACED00A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5B07650032A77BE01A80082 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5B07651032A77BE01A80082,
-                               F5B0767E032A846D01A80082,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5B07651032A77BE01A80082 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5B07652032A77BE01A80082 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5B07653032A77BE01A80082 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmod_bmp.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F5B07655032A7C8801A80082 = {
-                       fileRef = F5B07648032A778701A80082;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5B07656032A7E8301A80082 = {
-                       isa = PBXTargetDependency;
-                       target = F5B0764C032A77BE01A80082;
-                       targetProxy = A65F23C905E843AF005A2B7E;
-               };
-               F5B0767E032A846D01A80082 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5B07694032A8C0201A80082 = {
-                       fileRef = F51307FB0326CBE8012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5B07695032A957A01A80082 = {
-                       children = (
-                               A6E2EA8407656630002AF736,
-                               A6E2EA8307656625002AF736,
-                               F59F5F870374916F01A80006,
-                               F5B07696032A959401A80082,
-                       );
-                       isa = PBXGroup;
-                       name = Layers;
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B07696032A959401A80082 = {
-                       children = (
-                               F5B076A1032A961101A80082,
-                               F5B076A2032A961101A80082,
-                               A64F6D10052A99B800140006,
-                               A64F6D16052A99B800140006,
-                               A64F6D17052A99B800140006,
-                               F5B076B1032ABBA401A80082,
-                               F5B076B2032ABBA401A80082,
-                               F5D988B1033194E101A80006,
-                               F5D988B2033194E101A80006,
-                               F57D1D2D0340E47601A80006,
-                               F57D1D2E0340E47601A80006,
-                               A60324CD0442574800A80006,
-                               A60324CE0442574800A80006,
-                               A60324CF0442574800A80006,
-                               A60324D00442574800A80006,
-                               F50C8494037496BE01A80006,
-                               F50C8495037496BE01A80006,
-                               F5213F280384B9AF01A80006,
-                               F5213F290384B9AF01A80006,
-                               A6714E1C0413F56300F656BD,
-                               A6714E1D0413F56300F656BD,
-                               A684452F0474A83F00A80006,
-                               A68445300474A83F00A80006,
-                               A68445330474A83F00A80006,
-                               A68445340474A83F00A80006,
-                               A68445350474A83F00A80006,
-                               A68445360474A83F00A80006,
-                       );
-                       isa = PBXGroup;
-                       name = "Standard Layers";
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B07697032A95BC01A80082 = {
-                       buildPhases = (
-                               F5B07698032A95BC01A80082,
-                               F5B07699032A95BC01A80082,
-                               F5B0769B032A95BC01A80082,
-                               F5B0769E032A95BC01A80082,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = liblyr_std.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                               F5B076A8032A9B7901A80082,
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "Std. Layers Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F5B0769F032A95BC01A80082;
-               };
-               F5B07698032A95BC01A80082 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5B076B4032ABBA401A80082,
-                               F5D988B4033194E101A80006,
-                               F57D1D300340E47601A80006,
-                               F50C849B037496BE01A80006,
-                               F5213F2D0384B9AF01A80006,
-                               A6714E1F0413F56300F656BD,
-                               A60324D40442574800A80006,
-                               A60324D60442574800A80006,
-                               A68445380474A83F00A80006,
-                               A684453C0474A83F00A80006,
-                               A684453E0474A83F00A80006,
-                               A64F6D23052A99B800140006,
-                               A6C1415A05E836A0004C1DD1,
-                               A6C1415C05E836A0004C1DD1,
-                               A6C1415E05E836A0004C1DD1,
-                               A6C1416005E836A0004C1DD1,
-                               A6E2EAAC07656673002AF736,
-                               A6E2EAAE07656673002AF736,
-                               A6E2EAB007656673002AF736,
-                               A6E2EAB107656673002AF736,
-                               A6E2EAB207656673002AF736,
-                               A6E2EAB407656673002AF736,
-                               A6E2EAB607656673002AF736,
-                               A6E2EAB707656673002AF736,
-                               A6E2EAB907656673002AF736,
-                               A6E2EABB07656673002AF736,
-                               A6E2EABD07656673002AF736,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5B07699032A95BC01A80082 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5B076A5032A961D01A80082,
-                               F5B076B3032ABBA401A80082,
-                               F5D988B3033194E101A80006,
-                               F57D1D2F0340E47601A80006,
-                               F50C849A037496BE01A80006,
-                               F5213F2C0384B9AF01A80006,
-                               A6714E1E0413F56300F656BD,
-                               A60324D30442574800A80006,
-                               A60324D50442574800A80006,
-                               A68445370474A83F00A80006,
-                               A684453B0474A83F00A80006,
-                               A684453D0474A83F00A80006,
-                               A64F6D1C052A99B800140006,
-                               A64F6D22052A99B800140006,
-                               A6C1415905E836A0004C1DD1,
-                               A6C1415B05E836A0004C1DD1,
-                               A6C1415D05E836A0004C1DD1,
-                               A6C1415F05E836A0004C1DD1,
-                               A6E2EAAB07656673002AF736,
-                               A6E2EAAD07656673002AF736,
-                               A6E2EAAF07656673002AF736,
-                               A6E2EAB307656673002AF736,
-                               A6E2EAB507656673002AF736,
-                               A6E2EAB807656673002AF736,
-                               A6E2EABA07656673002AF736,
-                               A6E2EABC07656673002AF736,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5B0769B032A95BC01A80082 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5B0769C032A95BC01A80082,
-                               F5B0769D032A95BC01A80082,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5B0769C032A95BC01A80082 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5B0769D032A95BC01A80082 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5B0769E032A95BC01A80082 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5B0769F032A95BC01A80082 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = liblyr_std.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F5B076A1032A961101A80082 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/lyr_std/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B076A2032A961101A80082 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/lyr_std/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B076A5032A961D01A80082 = {
-                       fileRef = F5B076A1032A961101A80082;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5B076A6032A962601A80082 = {
-                       isa = PBXTargetDependency;
-                       target = F5B07697032A95BC01A80082;
-                       targetProxy = A65F23CA05E843AF005A2B7E;
-               };
-               F5B076A8032A9B7901A80082 = {
-                       isa = PBXTargetDependency;
-                       target = F5F48ECF0314873101682FCB;
-                       targetProxy = A65F23D905E843AF005A2B7E;
-               };
-               F5B076B1032ABBA401A80082 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = mandelbrot.cpp;
-                       path = src/modules/lyr_std/mandelbrot.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B076B2032ABBA401A80082 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = mandelbrot.h;
-                       path = src/modules/lyr_std/mandelbrot.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5B076B3032ABBA401A80082 = {
-                       fileRef = F5B076B1032ABBA401A80082;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5B076B4032ABBA401A80082 = {
-                       fileRef = F5B076B2032ABBA401A80082;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5CDFD240325C617012F4765 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = "compiled.mach-o.dylib";
-                       name = libdl.dylib;
-                       path = /usr/lib/libSystem.B.dylib;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               F5CDFD250325C617012F4765 = {
-                       fileRef = F5CDFD240325C617012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5D12A4403A2FF4A01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = doxygen.cfg;
-                       path = sinfg.pbproj/doxygen.cfg;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D12AE603A302D101A80006 = {
-                       includeInIndex = 1;
-                       isa = PBXFileReference;
-                       lastKnownFileType = file;
-                       name = man;
-                       path = doc/man;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D51DF50399C8EF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = value.cpp;
-                       path = src/sinfg/value.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D51DF60399C8EF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = value.h;
-                       path = src/sinfg/value.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D51DF70399C8EF01A80006 = {
-                       fileRef = F5D51DF50399C8EF01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5D51DF80399C8EF01A80006 = {
-                       fileRef = F5D51DF60399C8EF01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F5D9889A03317C5A01A80006 = {
-                       children = (
-                               F5D988A903317CCF01A80006,
-                               F5D988AA03317CCF01A80006,
-                               F5D988AB03317CCF01A80006,
-                               F5D988AC03317CCF01A80006,
-                       );
-                       isa = PBXGroup;
-                       name = GIF;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D9889B03317C7401A80006 = {
-                       buildPhases = (
-                               F5D9889C03317C7401A80006,
-                               F5D9889F03317C7401A80006,
-                               F5D988A303317C7401A80006,
-                               F5D988A603317C7401A80006,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmod_gif.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "GIF Target Module copy";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F5D988A703317C7401A80006;
-               };
-               F5D9889C03317C7401A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F57D1CC4033FE08201A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5D9889F03317C7401A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F57D1CC2033FE08001A80006,
-                               F57D1CC3033FE08101A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5D988A303317C7401A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5D988A403317C7401A80006,
-                               F5D988A503317C7401A80006,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5D988A403317C7401A80006 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5D988A503317C7401A80006 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5D988A603317C7401A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5D988A703317C7401A80006 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmod_gif.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F5D988A903317CCF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mod_gif/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D988AA03317CCF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/mod_gif/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D988AB03317CCF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_gif.cpp;
-                       path = src/modules/mod_gif/trgt_gif.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D988AC03317CCF01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_gif.h;
-                       path = src/modules/mod_gif/trgt_gif.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D988B1033194E101A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = zoom.cpp;
-                       path = src/modules/lyr_std/zoom.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D988B2033194E101A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = zoom.h;
-                       path = src/modules/lyr_std/zoom.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5D988B3033194E101A80006 = {
-                       fileRef = F5D988B1033194E101A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5D988B4033194E101A80006 = {
-                       fileRef = F5D988B2033194E101A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5D988D703325F0301A80006 = {
-                       children = (
-                               F5CDFD240325C617012F4765,
-                               A6B861E803E88EC100A80006,
-                               F51305FF0325FC38012F4765,
-                               F59F5F930374921B01A80006,
-                               A6B861E703E88E9900A80006,
-                               F581E14003B24C140101DBD7,
-                       );
-                       isa = PBXGroup;
-                       name = "Libraries and Frameworks";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5EC16810332800301A80006 = {
-                       isa = PBXFileReference;
-                       lastKnownFileType = "compiled.mach-o.dylib";
-                       name = libxml2.dylib;
-                       path = /usr/local/lib/libxml2.2.6.16.dylib;
-                       refType = 0;
-                       sourceTree = "<absolute>";
-               };
-               F5EC16820332800301A80006 = {
-                       fileRef = F5EC16810332800301A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5EDFADA032D252001A80082 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = trgt_bmp.cpp;
-                       path = src/modules/mod_bmp/trgt_bmp.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5EDFADB032D252001A80082 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = trgt_bmp.h;
-                       path = src/modules/mod_bmp/trgt_bmp.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5EDFADC032D252001A80082 = {
-                       fileRef = F5EDFADA032D252001A80082;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5EDFADD032D252001A80082 = {
-                       fileRef = F5EDFADB032D252001A80082;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F2702E03C932DE01BABFEF = {
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               GCC_VERSION = 3;
-                               HEADER_SEARCH_PATHS = "\U0001./sinfg.pbproj";
-                               LDFLAGS = "\U0001-flat-namespace";
-                               MACOSX_DEPLOYMENT_TARGET = 10.2;
-                               OPTIMIZATION_CFLAGS = "-O3 -ffast-math -faltivec";
-                               OTHER_CFLAGS = "\U0001-DHAVE_CFLAGS -DNDEBUG -DHAVE_CONFIG_H -Wno-long-double";
-                               OTHER_CXXFLAGS = "\U0001-DHAVE_CFLAGS -DNDEBUG -DHAVE_CONFIG_H -Wno-long-double";
-                               USE_GCC3_PFE_SUPPORT = YES;
-                       };
-                       isa = PBXBuildStyle;
-                       name = "Deployment (GCC3) AltiVec";
-               };
-               F5F48EB70314868C01682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48EB80314868C01682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5F48EC3031486BE01682FCB,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48EB90314868C01682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5F48EE10314895701682FCB,
-                               F51306490325FC4E012F4765,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48EBA0314868C01682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48EBB0314868C01682FCB = {
-                       buildPhases = (
-                               F5F48EB70314868C01682FCB,
-                               F5F48EB80314868C01682FCB,
-                               F5F48EB90314868C01682FCB,
-                               F5F48EBA0314868C01682FCB,
-                               F513073A03267C35012F4765,
-                       );
-                       buildSettings = {
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_REZFLAGS = "";
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = sinfg;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               USE_GCC3_PFE_SUPPORT = YES;
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                               F5F48ED50314875A01682FCB,
-                       );
-                       isa = PBXToolTarget;
-                       name = "Sinfg Tool";
-                       productName = "Sinfg Tool";
-                       productReference = F5F48EBC0314868C01682FCB;
-               };
-               F5F48EBC0314868C01682FCB = {
-                       explicitFileType = "compiled.mach-o.executable";
-                       isa = PBXFileReference;
-                       path = sinfg;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F5F48EC2031486BE01682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/tool/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F48EC3031486BE01682FCB = {
-                       fileRef = F5F48EC2031486BE01682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F48EC40314870401682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = general.h;
-                       path = src/sinfg/general.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F48EC50314870401682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/sinfg/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F48EC60314870401682FCB = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = sinfg.h;
-                       path = src/sinfg/sinfg.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F48ECA0314873101682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5FB06D403200B2801A80006,
-                               F5F48ED10314873B01682FCB,
-                               F5F48ED30314873D01682FCB,
-                               F579DCC90315607801682FCB,
-                               F579DCD303156FA301682FCB,
-                               F579DCD50315734101682FCB,
-                               F579DCD90315770A01682FCB,
-                               F579DCE403159B9401682FCB,
-                               F51307FE0326CBE8012F4765,
-                               F51308020326CD28012F4765,
-                               F5A4F3330327E86D01A80006,
-                               F57D1D36034262A601A80006,
-                               F591EF15034511A901A80006,
-                               F5D51DF80399C8EF01A80006,
-                               F5FB06D603200BCD01A80006,
-                               F58056AA03A2DB6901A80006,
-                               F58056AC03A2DB6901A80006,
-                               F58056AE03A2DB6901A80006,
-                               A6F67D9D03E7AD7400A80006,
-                               A6F67D9E03E7AD7400A80006,
-                               A6714DFD0413E80A00F656BD,
-                               A6714DFE0413E80A00F656BD,
-                               A6D879B7042BAC7F00A80006,
-                               A6C8D6300430F3DC00A80006,
-                               A60324DE04425DAD00A80006,
-                               A60324E004425DAD00A80006,
-                               A60324E204425DAD00A80006,
-                               A60324F804425DF300A80006,
-                               A60324FA04425DF300A80006,
-                               A60324FC04425DF300A80006,
-                               A60324FE04425DF300A80006,
-                               A603250004425DF300A80006,
-                               A603250204425DF300A80006,
-                               A603250404425DF300A80006,
-                               A603250604425DF300A80006,
-                               A603250804425DF300A80006,
-                               A603250A04425DF300A80006,
-                               A68445110474A77900A80006,
-                               A68445130474A77900A80006,
-                               A68445150474A77900A80006,
-                               A68445170474A77900A80006,
-                               A68445190474A77900A80006,
-                               A684451B0474A77900A80006,
-                               A684451D0474A77900A80006,
-                               A684451F0474A77900A80006,
-                               A68445210474A77900A80006,
-                               A68445220474A77900A80006,
-                               A68445230474A77900A80006,
-                               A68445240474A77900A80006,
-                               A68445280474A77900A80006,
-                               A684452A0474A77900A80006,
-                               A684452C0474A77900A80006,
-                               A64F6CF0052A991700140006,
-                               A64F6CF2052A991700140006,
-                               A64F6CF4052A991700140006,
-                               A64F6CF6052A991700140006,
-                               A64F6CF8052A991700140006,
-                               A64F6CF9052A991700140006,
-                               A64F6CFB052A991700140006,
-                               A64F6CFD052A991700140006,
-                               A64F6CFF052A991700140006,
-                               A64F6D01052A991700140006,
-                               A64F6D03052A991700140006,
-                               A64F6D05052A991700140006,
-                               A64F6D07052A991700140006,
-                               A64F6D09052A991700140006,
-                               A64F6D0B052A991700140006,
-                               A6FEFDF005DEA44C00140006,
-                               A6C1415205E836A0004C1DD1,
-                               A6C1415405E836A0004C1DD1,
-                               A6C1415605E836A0004C1DD1,
-                               A6C1415805E836A0004C1DD1,
-                               A6E2EA9907656673002AF736,
-                               A6E2EA9B07656673002AF736,
-                               A6E2EA9D07656673002AF736,
-                               A6E2EA9E07656673002AF736,
-                               A6E2EA9F07656673002AF736,
-                               A6E2EAA107656673002AF736,
-                               A6E2EAA307656673002AF736,
-                               A6E2EAA407656673002AF736,
-                               A6E2EAA607656673002AF736,
-                               A6E2EAA807656673002AF736,
-                               A6E2EAAA07656673002AF736,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48ECB0314873101682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXResourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48ECC0314873101682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5F48ED20314873C01682FCB,
-                               F579DCCF0315672F01682FCB,
-                               F579DCD203156FA301682FCB,
-                               F579DCD80315770A01682FCB,
-                               F5FB06D303200B2801A80006,
-                               F51308010326CD28012F4765,
-                               F5B07694032A8C0201A80082,
-                               F591EF14034511A901A80006,
-                               F5F784D3034BC0D901A80006,
-                               F5D51DF70399C8EF01A80006,
-                               F58056A903A2DB6901A80006,
-                               F58056AB03A2DB6901A80006,
-                               F58056AD03A2DB6901A80006,
-                               A6F67D9C03E7AD7400A80006,
-                               A6C8D62E0430F3DC00A80006,
-                               A6C8D62F0430F3DC00A80006,
-                               A60324DF04425DAD00A80006,
-                               A60324E104425DAD00A80006,
-                               A60324F704425DF300A80006,
-                               A60324F904425DF300A80006,
-                               A60324FB04425DF300A80006,
-                               A60324FD04425DF300A80006,
-                               A60324FF04425DF300A80006,
-                               A603250104425DF300A80006,
-                               A603250304425DF300A80006,
-                               A603250504425DF300A80006,
-                               A603250704425DF300A80006,
-                               A603250904425DF300A80006,
-                               A68445120474A77900A80006,
-                               A68445140474A77900A80006,
-                               A68445160474A77900A80006,
-                               A68445180474A77900A80006,
-                               A684451A0474A77900A80006,
-                               A684451C0474A77900A80006,
-                               A684451E0474A77900A80006,
-                               A68445200474A77900A80006,
-                               A68445270474A77900A80006,
-                               A68445290474A77900A80006,
-                               A684452B0474A77900A80006,
-                               A64F6CEF052A991700140006,
-                               A64F6CF1052A991700140006,
-                               A64F6CF3052A991700140006,
-                               A64F6CF5052A991700140006,
-                               A64F6CF7052A991700140006,
-                               A64F6CFA052A991700140006,
-                               A64F6CFC052A991700140006,
-                               A64F6CFE052A991700140006,
-                               A64F6D00052A991700140006,
-                               A64F6D02052A991700140006,
-                               A64F6D04052A991700140006,
-                               A64F6D06052A991700140006,
-                               A64F6D08052A991700140006,
-                               A64F6D0A052A991700140006,
-                               A6FEFDEF05DEA44C00140006,
-                               A6FEFDF105DEA44C00140006,
-                               A6C1415105E836A0004C1DD1,
-                               A6C1415305E836A0004C1DD1,
-                               A6C1415505E836A0004C1DD1,
-                               A6C1415705E836A0004C1DD1,
-                               A6E2EA9807656673002AF736,
-                               A6E2EA9A07656673002AF736,
-                               A6E2EA9C07656673002AF736,
-                               A6E2EAA007656673002AF736,
-                               A6E2EAA207656673002AF736,
-                               A6E2EAA507656673002AF736,
-                               A6E2EAA707656673002AF736,
-                               A6E2EAA907656673002AF736,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48ECD0314873101682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5CDFD250325C617012F4765,
-                               F51306480325FC38012F4765,
-                               F5EC16820332800301A80006,
-                               F58056B203A2DD0F01A80006,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48ECE0314873101682FCB = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F48ECF0314873101682FCB = {
-                       buildPhases = (
-                               F5F48ECA0314873101682FCB,
-                               F5F48ECB0314873101682FCB,
-                               F5F48ECC0314873101682FCB,
-                               F5F48ECD0314873101682FCB,
-                               F5F48ECE0314873101682FCB,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = "\"$(LOCAL_LIBRARY_DIR)/Frameworks\"";
-                               FRAMEWORK_VERSION = 0.60.03;
-                               HEADER_SEARCH_PATHS = "/usr/local/include/libxml++-1.0 /usr/local/include/libxml2 /sw/include libltdl";
-                               LIBRARY_SEARCH_PATHS = /sw/lib;
-                               OTHER_CFLAGS = "\U0001";
-                               OTHER_CXXFLAGS = "\U0001";
-                               OTHER_LDFLAGS = "\U0001";
-                               OTHER_LIBTOOL_FLAGS = "\U0001-dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRINCIPAL_CLASS = "";
-                               PRODUCT_NAME = sinfg;
-                               SECTORDER_FLAGS = "";
-                               USE_GCC3_PFE_SUPPORT = YES;
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                               WRAPPER_EXTENSION = framework;
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXFrameworkTarget;
-                       name = "Sinfg Library";
-                       productInstallPath = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-                       productName = "Sinfg Library";
-                       productReference = F5F48ED00314873101682FCB;
-                       productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>English</string>
-       <key>CFBundleExecutable</key>
-       <string>sinfg</string>
-       <key>CFBundleGetInfoString</key>
-       <string></string>
-       <key>CFBundleIconFile</key>
-       <string></string>
-       <key>CFBundleIdentifier</key>
-       <string></string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleName</key>
-       <string>Sinfg Library Framework</string>
-       <key>CFBundlePackageType</key>
-       <string>FMWK</string>
-       <key>CFBundleShortVersionString</key>
-       <string>0.60</string>
-       <key>CFBundleSignature</key>
-       <string>????</string>
-       <key>CFBundleVersion</key>
-       <string>0.60.03</string>
-</dict>
-</plist>
-";
-               };
-               F5F48ED00314873101682FCB = {
-                       explicitFileType = wrapper.framework;
-                       isa = PBXFileReference;
-                       path = sinfg.framework;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F5F48ED10314873B01682FCB = {
-                       fileRef = F5F48EC60314870401682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F5F48ED20314873C01682FCB = {
-                       fileRef = F5F48EC50314870401682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F48ED30314873D01682FCB = {
-                       fileRef = F5F48EC40314870401682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Public,
-                               );
-                       };
-               };
-               F5F48ED50314875A01682FCB = {
-                       isa = PBXTargetDependency;
-                       target = F5F48ECF0314873101682FCB;
-                       targetProxy = A65F23D305E843AF005A2B7E;
-               };
-               F5F48EE10314895701682FCB = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F7844B03482C5201A80006 = {
-                       children = (
-                               F5F7844C03482C7E01A80006,
-                               F5F7844D03482C7E01A80006,
-                               F5F7844E03482C7E01A80006,
-                               F5F7844F03482C7E01A80006,
-                       );
-                       isa = PBXGroup;
-                       name = MPlayer;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F7844C03482C7E01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/mptr_mplayer/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F7844D03482C7E01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/mptr_mplayer/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F7844E03482C7E01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = mptr_mplayer.cpp;
-                       path = src/modules/mptr_mplayer/mptr_mplayer.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F7844F03482C7E01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = mptr_mplayer.h;
-                       path = src/modules/mptr_mplayer/mptr_mplayer.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F7845003482C9101A80006 = {
-                       buildPhases = (
-                               F5F7845103482C9101A80006,
-                               F5F7845503482C9101A80006,
-                               F5F7845A03482C9101A80006,
-                               F5F7845D03482C9101A80006,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libmptr_mplayer.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "MPlayer Importer Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F5F7845E03482C9101A80006;
-               };
-               F5F7845103482C9101A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5F7845F03482CBD01A80006,
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F7845503482C9101A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5F7846003482CBD01A80006,
-                               F5F7846103482CBE01A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F7845A03482C9101A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5F7845B03482C9101A80006,
-                               F5F7845C03482C9101A80006,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F7845B03482C9101A80006 = {
-                       fileRef = F51305FF0325FC38012F4765;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F7845C03482C9101A80006 = {
-                       fileRef = F5F48ED00314873101682FCB;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F7845D03482C9101A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5F7845E03482C9101A80006 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libmptr_mplayer.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F5F7845F03482CBD01A80006 = {
-                       fileRef = F5F7844F03482C7E01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F7846003482CBD01A80006 = {
-                       fileRef = F5F7844E03482C7E01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F7846103482CBE01A80006 = {
-                       fileRef = F5F7844C03482C7E01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5F784630348DCAA01A80006 = {
-                       buildPhases = (
-                       );
-                       buildSettings = {
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_REZFLAGS = "";
-                               PRODUCT_NAME = All;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                               F5F784660348DCBE01A80006,
-                               F5F784640348DCB601A80006,
-                               F5F784650348DCBA01A80006,
-                       );
-                       isa = PBXAggregateTarget;
-                       name = All;
-                       productName = All;
-               };
-               F5F784640348DCB601A80006 = {
-                       isa = PBXTargetDependency;
-                       target = F5F48EBB0314868C01682FCB;
-                       targetProxy = A65F23D205E843AF005A2B7E;
-               };
-               F5F784650348DCBA01A80006 = {
-                       isa = PBXTargetDependency;
-                       target = F51307A3032684C7012F4765;
-                       targetProxy = A65F23D405E843AF005A2B7E;
-               };
-               F5F784660348DCBE01A80006 = {
-                       isa = PBXTargetDependency;
-                       target = F5F48ECF0314873101682FCB;
-                       targetProxy = A65F23D605E843AF005A2B7E;
-               };
-               F5F784D2034BC0D901A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = surface.cpp;
-                       path = src/sinfg/surface.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5F784D3034BC0D901A80006 = {
-                       fileRef = F5F784D2034BC0D901A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5FB06D003200AE401A80006 = {
-                       children = (
-                               F5FB06D103200B2801A80006,
-                               F5FB06D203200B2801A80006,
-                               F570DBE403257704012F4765,
-                               F570DBE503257704012F4765,
-                       );
-                       isa = PBXGroup;
-                       name = LTDL;
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB06D103200B2801A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.c;
-                       name = ltdl.c;
-                       path = libltdl/ltdl.c;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB06D203200B2801A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = ltdl.h;
-                       path = libltdl/ltdl.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB06D303200B2801A80006 = {
-                       fileRef = F5FB06D103200B2801A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5FB06D403200B2801A80006 = {
-                       fileRef = F5FB06D203200B2801A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                               );
-                       };
-               };
-               F5FB06D503200BCD01A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = config.h;
-                       path = sinfg.pbproj/config.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB06D603200BCD01A80006 = {
-                       fileRef = F5FB06D503200BCD01A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                               );
-                       };
-               };
-               F5FB07070320189701A80006 = {
-                       children = (
-                               F5FB0709032018C201A80006,
-                               F5B07695032A957A01A80082,
-                               F5B07646032A774701A80082,
-                               F5FB0708032018A101A80006,
-                       );
-                       isa = PBXGroup;
-                       name = Modules;
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB0708032018A101A80006 = {
-                       children = (
-                               F5FB070B032018E601A80006,
-                               F5FB070C032018E601A80006,
-                       );
-                       isa = PBXGroup;
-                       name = Example;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB0709032018C201A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB070B032018E601A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = main.cpp;
-                       path = src/modules/example/main.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB070C032018E601A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = text;
-                       name = Makefile.am;
-                       path = src/modules/example/Makefile.am;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FB070F03201B3201A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXHeadersBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5FB071003201B3201A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F5FB071503201B3A01A80006,
-                       );
-                       isa = PBXSourcesBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5FB071103201B3201A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                               F513064A0325FC51012F4765,
-                               F536547E03575FC6012F4ADF,
-                       );
-                       isa = PBXFrameworksBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5FB071203201B3201A80006 = {
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       isa = PBXRezBuildPhase;
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               F5FB071303201B3201A80006 = {
-                       buildPhases = (
-                               F5FB070F03201B3201A80006,
-                               F5FB071003201B3201A80006,
-                               F5FB071103201B3201A80006,
-                               F5FB071203201B3201A80006,
-                       );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
-                               HEADER_SEARCH_PATHS = src;
-                               LIBRARY_STYLE = DYNAMIC;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
-                               OTHER_REZFLAGS = "";
-                               PREBINDING = NO;
-                               PREFIX_HEADER = sinfg.pbproj/config.h;
-                               PRODUCT_NAME = libexample.so;
-                               REZ_EXECUTABLE = YES;
-                               SECTORDER_FLAGS = "";
-                               USE_GCC3_PFE_SUPPORT = YES;
-                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
-                       };
-                       dependencies = (
-                       );
-                       isa = PBXLibraryTarget;
-                       name = "Example Module";
-                       productInstallPath = /usr/local/lib;
-                       productName = "Example Module";
-                       productReference = F5FB071403201B3201A80006;
-               };
-               F5FB071403201B3201A80006 = {
-                       explicitFileType = "compiled.mach-o.dylib";
-                       isa = PBXFileReference;
-                       path = libexample.so;
-                       refType = 3;
-                       sourceTree = BUILT_PRODUCTS_DIR;
-               };
-               F5FB071503201B3A01A80006 = {
-                       fileRef = F5FB070B032018E601A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5FF0A3F03465FD101A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       name = mptr_ppm.cpp;
-                       path = src/modules/mod_ppm/mptr_ppm.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FF0A4003465FD101A80006 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       name = mptr_ppm.h;
-                       path = src/modules/mod_ppm/mptr_ppm.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               F5FF0A4103465FD101A80006 = {
-                       fileRef = F5FF0A3F03465FD101A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               F5FF0A4203465FD101A80006 = {
-                       fileRef = F5FF0A4003465FD101A80006;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-       };
-       rootObject = F550016502F0983D01000102;
-}
diff --git a/synfig-core/trunk/sinfg.pc.in b/synfig-core/trunk/sinfg.pc.in
deleted file mode 100644 (file)
index 10ff4e6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@sinfgincludedir@
-
-Name: sinfg
-Description: Sinfg Library and Associated Tools
-Requires: @CONFIG_DEPS@
-Version: 0.60.05-CVS
-Libs: -L${libdir} @CONFIG_LIBS@
-Cflags: @CONFIG_CFLAGS@ -I@sinfgincludedir@
diff --git a/synfig-core/trunk/sinfg.prj b/synfig-core/trunk/sinfg.prj
deleted file mode 100644 (file)
index 47d0f55..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-# Anjuta Version 1.2.2 
-Compatibility Level: 1 
-
-<PROJECT_DESCRIPTION_START>
-
-<PROJECT_DESCRIPTION_END>
-<CONFIG_PROGS_START>
-<CONFIG_PROGS_END>
-<CONFIG_LIBS_START>
-<CONFIG_LIBS_END>
-<CONFIG_HEADERS_START>
-<CONFIG_HEADERS_END>
-<CONFIG_CHARACTERISTICS_START>
-<CONFIG_CHARACTERISTICS_END>
-<CONFIG_LIB_FUNCS_START>
-<CONFIG_LIB_FUNCS_END>
-<CONFIG_ADDITIONAL_START>
-<CONFIG_ADDITIONAL_END>
-<CONFIG_FILES_START>
-<CONFIG_FILES_END>
-<MAKEFILE_AM_START>
-<MAKEFILE_AM_END>
-
-props.file.type=project
-
-anjuta.version=1.2.2
-anjuta.compatibility.level=1
-
-project.name=sinfg
-project.type=GENERIC
-project.target.type=EXECUTABLE
-project.version=0.60.00
-project.author=Robert B. Quattlebaum Jr
-project.source.target=src/tool/sinfg
-project.has.gettext=0
-project.gui.command=
-project.programming.language=C++
-project.excluded.modules=      intl
-
-project.config.extra.modules.before=
-project.config.extra.modules.after=
-project.config.blocked=1
-project.config.disable.overwriting=1 1 1 1 1 1 1 1 1 
-
-project.menu.entry=sinfg Version 0.60.00
-project.menu.group=Application
-project.menu.comment=sinfg Version 0.60.00
-project.menu.icon=
-project.menu.need.terminal=0
-
-project.configure.options=--enable-warnings=maximum --enable-static=no CXX="g++ -march=athlon -msse -mfpmath=sse"
-anjuta.program.arguments=
-preferences.build.option.jobs=0
-preferences.build.option.silent=0
-preferences.build.option.autosave=0
-preferences.make=make
-preferences.build.option.keep.going=0
-preferences.build.option.warn.undef=0
-preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss
-preferences.indent.opening=0
-preferences.autoformat.disable=0
-preferences.indent.automatic=1
-preferences.use.tabs=1
-preferences.indent.size=4
-preferences.tabsize=4
-preferences.indent.closing=0
-
-module.include.name=.
-module.include.type=
-module.include.files=\
-       sinfg.pbproj/config.h\
-       sinfg.pbproj/etl_profile.h\
-       src/modules/lyr_std/bezier.h\
-       src/modules/lyr_std/blur.h\
-       src/modules/lyr_std/checkerboard.h\
-       src/modules/lyr_std/circle.h\
-       src/modules/lyr_std/image.h\
-       src/modules/lyr_std/import.h\
-       src/modules/lyr_std/mandelbrot.h\
-       src/modules/lyr_std/polygon.h\
-       src/modules/lyr_std/region.h\
-       src/modules/lyr_std/solidcolor.h\
-       src/modules/lyr_std/supersample.h\
-       src/modules/lyr_std/translate.h\
-       src/modules/lyr_std/zoom.h\
-       src/modules/mod_ffmpeg/mptr_ffmpeg.h\
-       src/modules/mod_ffmpeg/trgt_ffmpeg.h\
-       src/modules/mptr_mplayer/mptr_mplayer.h\
-       src/modules/trgt_bmp/trgt_bmp.h\
-       src/modules/trgt_dv/trgt_dv.h\
-       src/modules/trgt_gif/trgt_gif.h\
-       src/modules/trgt_mpg/trgt_mpg.h\
-       src/modules/trgt_ppm/mptr_ppm.h\
-       src/modules/trgt_ppm/trgt_mpg.h\
-       src/modules/trgt_ppm/trgt_ppm.h\
-       src/modules/mod_imagemagick/trgt_imagemagick.h\
-       src/modules/mod_imagemagick/mptr_imagemagick.h\
-       src/modules/lyr_freetype/lyr_freetype.h\
-       src/template.h\
-       src/sinfg/animate.h\
-       src/sinfg/bmplayer.h\
-       src/sinfg/color.h\
-       src/sinfg/general.h\
-       src/sinfg/importer.h\
-       src/sinfg/layer.h\
-       src/sinfg/modules.h\
-       src/sinfg/pch.h\
-       src/sinfg/renddesc.h\
-       src/sinfg/render.h\
-       src/sinfg/sinfg.h\
-       src/sinfg/surface.h\
-       src/sinfg/target.h\
-       src/sinfg/vector.h\
-       src/sinfg/datatype.h\
-       src/sinfg/canvas.h\
-       src/sinfg/loadcanvas.h\
-       src/sinfg/savecanvas.h
-
-module.source.name=.
-module.source.type=
-module.source.files=\
-       src/modules/example/main.cpp\
-       src/modules/lyr_std/bezier.cpp\
-       src/modules/lyr_std/blur.cpp\
-       src/modules/lyr_std/checkerboard.cpp\
-       src/modules/lyr_std/circle.cpp\
-       src/modules/lyr_std/image.cpp\
-       src/modules/lyr_std/import.cpp\
-       src/modules/lyr_std/main.cpp\
-       src/modules/lyr_std/mandelbrot.cpp\
-       src/modules/lyr_std/polygon.cpp\
-       src/modules/lyr_std/region.cpp\
-       src/modules/lyr_std/solidcolor.cpp\
-       src/modules/lyr_std/supersample.cpp\
-       src/modules/lyr_std/translate.cpp\
-       src/modules/lyr_std/zoom.cpp\
-       src/modules/mod_ffmpeg/main.cpp\
-       src/modules/mod_ffmpeg/mptr_ffmpeg.cpp\
-       src/modules/mod_ffmpeg/trgt_ffmpeg.cpp\
-       src/modules/mptr_mplayer/main.cpp\
-       src/modules/mptr_mplayer/mptr_mplayer.cpp\
-       src/modules/trgt_bmp/main.cpp\
-       src/modules/trgt_bmp/trgt_bmp.cpp\
-       src/modules/trgt_dv/main.cpp\
-       src/modules/trgt_dv/trgt_dv.cpp\
-       src/modules/trgt_gif/main.cpp\
-       src/modules/trgt_gif/trgt_gif.cpp\
-       src/modules/trgt_mpg/main.cpp\
-       src/modules/trgt_mpg/trgt_mpg.cpp\
-       src/modules/trgt_ppm/main.cpp\
-       src/modules/trgt_ppm/mptr_ppm.cpp\
-       src/modules/trgt_ppm/trgt_mpg.cpp\
-       src/modules/trgt_ppm/trgt_ppm.cpp\
-       src/modules/mod_imagemagick/mptr_imagemagick.cpp\
-       src/modules/mod_imagemagick/main.cpp\
-       src/modules/mod_imagemagick/trgt_imagemagick.cpp\
-       src/modules/lyr_freetype/main.cpp\
-       src/modules/lyr_freetype/lyr_freetype.cpp\
-       src/template.cpp\
-       src/sinfg/animate.cpp\
-       src/sinfg/bmplayer.cpp\
-       src/sinfg/color.cpp\
-       src/sinfg/importer.cpp\
-       src/sinfg/layer.cpp\
-       src/sinfg/main.cpp\
-       src/sinfg/modules.cpp\
-       src/sinfg/render.cpp\
-       src/sinfg/surface.cpp\
-       src/sinfg/target.cpp\
-       src/sinfg/datatype.cpp\
-       src/sinfg/canvas.cpp\
-       src/sinfg/loadcanvas.cpp\
-       src/sinfg/savecanvas.cpp\
-       src/tool/main.cpp
-
-module.pixmap.name=.
-module.pixmap.type=
-module.pixmap.files=
-
-module.data.name=.
-module.data.type=
-module.data.files=
-
-module.help.name=.
-module.help.type=
-module.help.files=
-
-module.doc.name=.
-module.doc.type=
-module.doc.files=\
-       ChangeLog\
-       INSTALL\
-       README
-
-module.po.files=
-
-compiler.options.supports=
-compiler.options.include.paths=\
-       .\
-       ..
-compiler.options.library.paths=
-compiler.options.libraries=
-compiler.options.libraries.selected=
-compiler.options.defines=\
-       HAVE_CONFIG_H
-compiler.options.defines.selected=
-compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 
-compiler.options.optimize.buttons=0 0 1 0 
-compiler.options.other.buttons=1 0 
-compiler.options.other.c.flags=
-compiler.options.other.l.flags=
-compiler.options.other.l.libs=
-
-project.src.paths=
diff --git a/synfig-core/trunk/src/sinfg/.cvsignore b/synfig-core/trunk/src/sinfg/.cvsignore
deleted file mode 100644 (file)
index 74a6660..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-*.lo
-.deps .libs Makefile Makefile.in *.la
diff --git a/synfig-core/trunk/src/sinfg/Makefile.am b/synfig-core/trunk/src/sinfg/Makefile.am
deleted file mode 100644 (file)
index f8f712f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# $Header: /opt/voria/cvs/sinfg/src/sinfg/Makefile.am,v 1.3 2005/01/21 19:29:10 darco Exp $
-
-# SUBDIRS=proto
-
-MAINTAINERCLEANFILES=Makefile.in
-INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/libltdl
-
-LAYERHEADERS=layer_motionblur.h layer_pastecanvas.h layer_solidcolor.h layer_polygon.h layer_composite.h layer_bitmap.h layer_mime.h layer_shape.h
-LAYERSOURCES=layer_motionblur.cpp layer_pastecanvas.cpp layer_solidcolor.cpp layer_polygon.cpp layer_composite.cpp layer_bitmap.cpp layer_mime.cpp layer_shape.cpp
-
-TARGETHEADERS=target_scanline.h target_tile.h target_multi.h target_null.h target_null_tile.h
-TARGETSOURCES=target_scanline.cpp target_tile.cpp target_multi.cpp target_null.cpp target_null_tile.cpp
-
-IMPORTERHEADERS=listimporter.cpp
-IMPORTERSOURCES=listimporter.h
-
-VALUENODEHEADERS=valuenode_sine.h valuenode_radialcomposite.h valuenode_bline.h valuenode_segcalcvertex.h valuenode_segcalctangent.h valuenode_twotone.h valuenode_stripes.h valuenode_subtract.h valuenode_const.h valuenode_reference.h valuenode_linear.h valuenode_composite.h valuenode_dynamiclist.h valuenode_animated.h valuenode_scale.h valuenode_timedswap.h valuenode_gradientrotate.h
-VALUENODESOURCES=valuenode_sine.cpp valuenode_radialcomposite.cpp valuenode_bline.cpp valuenode_segcalcvertex.cpp valuenode_segcalctangent.cpp valuenode_twotone.cpp valuenode_stripes.cpp valuenode_subtract.cpp valuenode_const.cpp valuenode_reference.cpp valuenode_linear.cpp valuenode_composite.cpp valuenode_dynamiclist.cpp valuenode_animated.cpp valuenode_scale.cpp valuenode_timedswap.cpp valuenode_gradientrotate.cpp
-
-VALUEHEADERS=blinepoint.h gradient.h value.h
-VALUESOURCES=blinepoint.cpp gradient.cpp value.cpp
-
-SINFGHEADERS=surfacenew.h mutex.h timepointcollect.h interpolation.h guidset.h guid.h rect.h node.h smartfile.h distance.h palette.h main.h waypoint.h activepoint.h gamma.h uniqueid.h canvasbase.h context.h real.h paramdesc.h string_decl.h angle.h keyframe.h sinfg.h renddesc.h general.h importer.h surface.h module.h layer.h vector.h color.h canvas.h render.h target.h loadcanvas.h savecanvas.h valuenode.h version.h segment.h types.h exception.h string.h time.h blur.h transform.h curve_helper.h polynomial_root.h curveset.h
-SINFGSOURCES=mutex.cpp timepointcollect.cpp rect.cpp node.cpp guid.cpp loadcanvas.cpp distance.cpp palette.cpp paramdesc.cpp waypoint.cpp activepoint.cpp gamma.cpp uniqueid.cpp context.cpp renddesc.cpp time.cpp exception.cpp keyframe.cpp main.cpp surface.cpp module.cpp importer.cpp layer.cpp color.cpp canvas.cpp render.cpp target.cpp savecanvas.cpp valuenode.cpp blur.cpp curve_helper.cpp polynomial_root.cpp transform.cpp curveset.cpp
-
-lib_LTLIBRARIES = libsinfg.la
-libsinfg_la_SOURCES = $(VALUEHEADERS) $(VALUESOURCES) $(LAYERSOURCES) $(LAYERHEADERS) $(TARGETHEADERS) $(TARGETSOURCES) $(VALUENODEHEADERS) $(VALUENODESOURCES) $(SINFGHEADERS) $(SINFGSOURCES) $(IMPORTERHEADERS) $(IMPORTERSOURCES)
-libsinfg_la_LIBADD = @LIBLTDL@ @SINFG_LIBS@ @LIBADD_DL@
-libsinfg_la_CXXFLAGS = @SINFG_CFLAGS@ -DLIBDIR="\"@libdir@\"" -DSYSCONFDIR="\"@sysconfdir@\""
-libsinfg_la_LDFLAGS = -export-dynamic -no-undefined -version-info 0:0:0
-
-include_sinfgdir=@sinfgincludedir@/sinfg
-include_sinfg_HEADERS = $(SINFGHEADERS) $(LAYERHEADERS) $(TARGETHEADERS) $(VALUENODEHEADERS) $(IMPORTERHEADERS) $(VALUEHEADERS)
diff --git a/synfig-core/trunk/src/sinfg/activepoint.cpp b/synfig-core/trunk/src/sinfg/activepoint.cpp
deleted file mode 100644 (file)
index 75ddb4c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepoint.cpp
-**     \brief Template File
-**
-**     $Id: activepoint.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "activepoint.h"
-#include "guid.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::GUID
-Activepoint::get_guid()const
-{
-       return GUID::hasher(get_uid());
-}
diff --git a/synfig-core/trunk/src/sinfg/activepoint.h b/synfig-core/trunk/src/sinfg/activepoint.h
deleted file mode 100644 (file)
index 37e6397..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepoint.h
-**     \brief Template Header
-**
-**     $Id: activepoint.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_ACTIVEPOINT_H
-#define __SINFG_ACTIVEPOINT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "time.h"
-#include "uniqueid.h"
-#include <ETL/handle>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-class GUID;
-class ValueNode;
-       
-struct Activepoint : public UniqueID
-{
-private:
-       etl::loose_handle<ValueNode> parent_;
-       int index;
-       
-public:
-       //! Time of the activepoint
-       Time time;
-       
-       //! Priority
-       int priority;
-
-       //! Does this activepoint turn the entry on, or off?
-       bool state;
-               
-       bool operator<(const Activepoint& rhs) { return time<rhs.time; }
-       bool operator<(const Time& rhs) { return time<rhs; }
-       
-       Activepoint(const Time &time, const bool &state, int p=0): time(time), priority(p),state(state) { }
-       Activepoint() { }
-       
-       const Time& get_time()const { return time; }
-       void set_time(const Time& x) { time=x; }
-
-       bool get_state()const { return state; }
-       void set_state(bool x) { state=x; }
-
-       int get_priority()const { return priority; }
-       void set_priority(int x) { priority=x; }
-
-       const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
-       void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }        
-       
-       int get_parent_index()const { return index; }
-       void set_parent_index(int x) { index=x; }
-       
-       GUID get_guid()const;
-}; // END of struct ValueNode_BLine::Activepoint
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/angle.h b/synfig-core/trunk/src/sinfg/angle.h
deleted file mode 100644 (file)
index 9cb64bb..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file angle.h
-**     \brief Template Header
-**
-**     $Id: angle.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_ANGLE_H
-#define __SINFG_ANGLE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/angle>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \typedef Angle
-**     \todo writeme
-*/
-typedef etl::angle Angle;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/blinepoint.cpp b/synfig-core/trunk/src/sinfg/blinepoint.cpp
deleted file mode 100644 (file)
index 71cd2e2..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blinepoint.cpp
-**     \brief Template File
-**
-**     $Id: blinepoint.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "blinepoint.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-void
-sinfg::BLinePoint::reverse()
-{
-       if(split_tangent_)
-       {
-               std::swap(tangent_[0],tangent_[1]);
-               tangent_[0]=-tangent_[0];
-               tangent_[1]=-tangent_[1];
-       }
-       else
-       {
-               tangent_[0]=-tangent_[0];
-               tangent_[1]=-tangent_[1];
-       }
-}
diff --git a/synfig-core/trunk/src/sinfg/blinepoint.h b/synfig-core/trunk/src/sinfg/blinepoint.h
deleted file mode 100644 (file)
index a5302b3..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blinepoint.h
-**     \brief Template Header
-**
-**     $Id: blinepoint.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_BLINEPOINT_H
-#define __SINFG_BLINEPOINT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "vector.h"
-#include "uniqueid.h"
-#include <algorithm>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class BLinePoint : public UniqueID
-{
-private:
-       Point   vertex_;
-       Vector  tangent_[2];
-       float   width_;
-       float   origin_;
-       bool    split_tangent_;
-
-public:
-
-       BLinePoint():
-               vertex_(Point(0,0)),
-               width_(0.01),
-               origin_(0.0),
-               split_tangent_(false)
-       { }
-
-       const Point& get_vertex()const { return vertex_; }
-       void set_vertex(const Point& x) { vertex_=x; }
-
-
-       const Vector& get_tangent1()const { return tangent_[0]; }
-       const Vector& get_tangent2()const { return split_tangent_?tangent_[1]:tangent_[0]; }
-       void set_tangent(const Vector& x) { tangent_[0]=tangent_[1]=x; }
-       void set_tangent1(const Vector& x) { tangent_[0]=x; }
-       void set_tangent2(const Vector& x) { tangent_[1]=x; }
-
-
-       const float& get_width()const { return width_; }
-       void set_width(float x) { width_=x; }
-
-       // We store the origin offset by 0.5 so that
-       // can have the origin set to the default by zeroing
-       // out the structure.
-       float get_origin()const { return origin_+0.5f; }
-       void set_origin(float x) { origin_=x-0.5f; }
-
-
-       const bool& get_split_tangent_flag()const { return split_tangent_; }
-       void set_split_tangent_flag(bool x=true) { split_tangent_=x; }
-
-       void reverse();
-       
-}; // END of class BLinePoint
-       
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/blur.cpp b/synfig-core/trunk/src/sinfg/blur.cpp
deleted file mode 100644 (file)
index 3d22fc8..0000000
+++ /dev/null
@@ -1,1203 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blur.cpp
-**     \brief Blur Implementation File
-**
-**     $Id: blur.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include <sinfg/general.h>
-#include <sinfg/surface.h>
-
-#include "blur.h"
-
-#include <stdexcept>
-#include <ETL/stringf>
-
-#include <ETL/pen>
-#include <ETL/gaussian>
-#include <ETL/boxblur>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-Point Blur::operator ()(const Point &pos) const
-{      
-       Point blurpos(pos);
-       
-       switch(type)
-       {
-       case CROSS:
-               if(rand()%2)
-               {
-                       if(size[0])
-                               blurpos[0]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[0];
-               }
-               else
-               {
-                       if(size[1])
-                               blurpos[1]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[1];
-               }
-               break;
-
-       case DISC:
-               {
-                       Angle theta=Angle::rotations((float)rand()/(float)RAND_MAX);
-                       Vector::value_type mag=(float)rand()/(float)RAND_MAX;
-                       Vector vect((float)Angle::cos(theta).get()*mag,(float)Angle::sin(theta).get()*mag);
-
-                       blurpos[0]+=vect[0]*size[0];
-                       blurpos[1]+=vect[1]*size[1];
-               }
-               break;
-
-       case FASTGAUSSIAN:
-       case GAUSSIAN:
-               // Not quite a true gaussian blur,
-               // but the results are close enough for me.
-               if(size[0])
-               {
-                       blurpos[0]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[0]*3/4;
-                       blurpos[0]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[0]*3/4;
-               }
-               if(size[1])
-               {
-                       blurpos[1]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[1]*3/4;
-                       blurpos[1]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[1]*3/4;
-               }
-               break;
-
-       case BOX:
-       default:
-               if(size[0])
-                       blurpos[0]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[0];
-               if(size[1])
-                       blurpos[1]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[1];
-               break;
-       }
-       
-       return blurpos;
-}
-
-Point Blur::operator ()(sinfg::Real x, sinfg::Real y) const
-{
-       return (*this)(Point(x,y));
-}
-
-//blur functions to make my life easier
-
-template <typename T>
-static inline T zero()
-{
-       return (T)0;
-}
-
-template <>
-static inline Color zero<Color>()
-{
-       return Color::alpha();
-}
-
-template <typename T,typename AT,class VP>
-static void GuassianBlur_2x2(etl::surface<T,AT,VP> &surface)
-{
-       int x,y;
-       T Tmp1,Tmp2,SR0;
-
-       T *SC0=new T[surface.get_w()];
-
-       memcpy(SC0,surface[0],surface.get_w()*sizeof(T));
-
-       for(y=0;y<surface.get_h();y++)
-       {
-               SR0=surface[y][0];
-               for(x=0;x<surface.get_w();x++)
-               {
-                       Tmp1=surface[y][x];
-                       Tmp2=SR0+Tmp1;
-                       SR0=Tmp1;
-                       surface[y][x]=(SC0[x]+Tmp2)/4;
-                       SC0[x]=Tmp2;                    
-               }
-       }
-       delete [] SC0;
-}
-
-template <typename T,typename AT,class VP>
-static void GuassianBlur_3x3(etl::surface<T,AT,VP> &surface)
-{
-       int x,y,u,v,w,h;
-       T Tmp1,Tmp2,SR0,SR1;
-
-       w=surface.get_w();
-       h=surface.get_h();
-
-       T *SC0=new T[w+1];
-       T *SC1=new T[w+1];
-
-       // Setup the row bufers
-       for(x=0;x<w;x++)SC0[x]=surface[0][x]*4;
-//     memcpy(SC1,surface[0],w*sizeof(T));
-
-       for(y=0;y<=h;y++)
-       {
-               if(y>=h)
-                       v=h-1;
-               else
-                       v=y;
-
-               SR0=SR1=surface[y][0];
-               for(x=0;x<=w;x++)
-               {
-                       if(x>=w)
-                               u=w-1;
-                       else
-                               u=x;
-
-                       // Row Machine
-                       Tmp1=surface[v][u];
-                       Tmp2=SR0+Tmp1;
-                       SR0=Tmp1;
-                       Tmp1=SR1+Tmp2;
-                       SR1=Tmp2;
-                       
-                       // Column Machine
-                       Tmp2=SC0[x]+Tmp1;
-                       SC0[x]=Tmp1;
-                       if(y&&x)
-                               surface[y-1][x-1]=(SC1[x]+Tmp2)/16;
-                       SC1[x]=Tmp2;
-               }               
-       }
-
-       delete [] SC0;
-       delete [] SC1;
-}
-
-template <typename T,typename AT,class VP>
-inline static void GaussianBlur_5x5_(etl::surface<T,AT,VP> &surface,T *SC0,T *SC1,T *SC2,T *SC3)
-{
-       int x,y,u,v,w,h;
-       T Tmp1,Tmp2,SR0,SR1,SR2,SR3;
-
-       w=surface.get_w();
-       h=surface.get_h();
-
-       // Setup the row bufers
-       for(x=0;x<w;x++)SC0[x+2]=surface[0][x]*24;
-//     memset(SC0,0,(w+2)*sizeof(T));
-       memset(SC1,0,(w+2)*sizeof(T));
-       memset(SC2,0,(w+2)*sizeof(T));
-       memset(SC3,0,(w+2)*sizeof(T));
-
-       for(y=0;y<h+2;y++)
-       {
-               if(y>=h)
-                       v=h-1;
-               else
-                       v=y;
-
-               SR0=SR1=SR2=SR3=0;
-               SR0=surface[v][0]*1.5;
-               for(x=0;x<w+2;x++)
-               {
-                       if(x>=w)
-                               u=w-1;
-                       else
-                               u=x;
-
-                       // Row Machine
-                       Tmp1=surface[v][u];
-                       Tmp2=SR0+Tmp1;
-                       SR0=Tmp1;
-                       Tmp1=SR1+Tmp2;
-                       SR1=Tmp2;
-                       Tmp2=SR2+Tmp1;
-                       SR2=Tmp1;
-                       Tmp1=SR3+Tmp2;
-                       SR3=Tmp2;
-
-                       // Column Machine
-                       Tmp2=SC0[x]+Tmp1;
-                       SC0[x]=Tmp1;
-                       Tmp1=SC1[x]+Tmp2;
-                       SC1[x]=Tmp2;
-                       Tmp2=SC2[x]+Tmp1;
-                       SC2[x]=Tmp1;
-                       if(y>1&&x>1)
-                               surface[y-2][x-2]=(SC3[x]+Tmp2)/256;
-                       SC3[x]=Tmp2;
-               }
-       }
-
-}
-
-template <typename T,typename AT,class VP>
-inline static void GaussianBlur_5x5(etl::surface<T,AT,VP> &surface)
-{
-       int w=surface.get_w();
-
-       T *SC0=new T[w+2];
-       T *SC1=new T[w+2];
-       T *SC2=new T[w+2];
-       T *SC3=new T[w+2];
-
-       GaussianBlur_5x5_(surface,SC0,SC1,SC2,SC3);
-
-       delete [] SC0;
-       delete [] SC1;
-       delete [] SC2;
-       delete [] SC3;
-}
-
-template <typename T,typename AT,class VP>
-static void GuassianBlur_nxn(etl::surface<T,AT,VP> &surface,int n)
-{
-       int x,y,u,v,w,h;
-       int half_n=n/2,i;
-       T inv_divisor=pow(2.0,(n-1));
-       T Tmp1,Tmp2;
-       inv_divisor=1.0/(inv_divisor*inv_divisor);
-
-       w=surface.get_w();
-       h=surface.get_h();
-
-    T SR[n-1];
-       T *SC[n-1];
-       
-       for(i=0;i<n-1;i++)
-       {
-               SC[i]=new T[w+half_n];
-               if(!SC[i])
-               {
-                       throw(runtime_error(strprintf(__FILE__":%d:Malloc failure",__LINE__)));
-                       return;
-               }
-               memset(SC[i],0,(w+half_n)*sizeof(T));
-       }
-
-       // Setup the first row
-//     for(x=0;x<w;x++)SC[0][x+half_n]=surface[0][x]*550.0;//*pow(2.0,(n-1))*(2.0/n);
-
-       for(y=0;y<h+half_n;y++)
-       {
-               if(y>=h)
-                       v=h-1;
-               else
-                       v=y;
-
-               memset(SR,0,(n-1)*sizeof(T));
-
-//             SR[0]=surface[v][0]*(2.0-1.9/n);
-
-               for(x=0;x<w+half_n;x++)
-               {
-                       if(x>=w)
-                               u=w-1;
-                       else
-                               u=x;
-
-                       Tmp1=surface[v][u];
-                       // Row Machine
-                       for(i=0;i<half_n;i++)
-                       {
-                               Tmp2=SR[i*2]+Tmp1;
-                               SR[i*2]=Tmp1;
-                               Tmp1=SR[i*2+1]+Tmp2;
-                               SR[i*2+1]=Tmp2;
-                       }
-
-                       // Column Machine
-                       for(i=0;i<half_n-1;i++)
-                       {
-                               Tmp2=SC[i*2][x]+Tmp1;
-                               SC[i*2][x]=Tmp1;
-                               Tmp1=SC[i*2+1][x]+Tmp2;
-                               SC[i*2+1][x]=Tmp2;
-                       }
-                       Tmp2=SC[n-3][x]+Tmp1;
-                       SC[n-3][x]=Tmp1;
-                       if(y>=half_n&&x>=half_n)
-                               surface[y-half_n][x-half_n]=(SC[n-2][x]+Tmp2)*inv_divisor;
-                       SC[n-2][x]=Tmp2;
-               }
-       }
-
-       for(i=0;i<n-1;i++)
-               delete [] SC[i];
-}
-
-template <typename T,typename AT,class VP>
-static void GuassianBlur_2x1(etl::surface<T,AT,VP> &surface)
-{
-       int x,y;
-       AT Tmp1,Tmp2,SR0;
-
-       for(y=0;y<surface.get_h();y++)
-       {
-               SR0=surface[y][0];
-               for(x=0;x<surface.get_w();x++)
-               {
-                       Tmp1=surface[y][x];
-                       Tmp2=SR0+Tmp1;
-                       SR0=Tmp1;
-                       surface[y][x]=(Tmp2)/2;
-               }
-       }
-}
-
-template <typename T,typename AT,class VP>
-static void GuassianBlur_3x1(etl::surface<T,AT,VP> &surface)
-{
-       int x,y;
-       AT Tmp1,Tmp2,SR0,SR1;
-
-       for(y=0;y<surface.get_h();y++)
-       {
-               SR0=SR1=surface[y][0];
-               for(x=0;x<surface.get_w();x++)
-               {
-                       // Row Machine
-                       Tmp1=surface[y][x];
-                       Tmp2=SR0+Tmp1;
-                       SR0=Tmp1;
-                       Tmp1=SR1+Tmp2;
-                       SR1=Tmp2;
-
-                       if(x)
-                               surface[y][x-1]=(Tmp1)/4;
-               }
-       }
-}
-
-template <typename T,typename AT,class VP>
-static void GuassianBlur_1x2(etl::surface<T,AT,VP> &surface)
-{
-       int x,y;
-       AT Tmp1,Tmp2,SR0;
-
-       for(x=0;x<surface.get_w();x++)
-       {
-               SR0 = zero<T>();
-               for(y=0;y<surface.get_h();y++)
-               {
-                       Tmp1=surface[y][x];
-                       Tmp2=SR0+Tmp1;
-                       SR0=Tmp1;
-                       surface[y][x]=(Tmp2)/2;
-               }
-       }
-}
-
-template <typename T,typename AT,class VP>
-static void GuassianBlur_1x3(etl::surface<T,AT,VP> &surface)
-{
-       int x,y;
-       AT Tmp1,Tmp2,SR0,SR1;
-
-       for(x=0;x<surface.get_w();x++)
-       {
-               SR0=SR1=surface[0][x];
-               for(y=0;y<surface.get_h();y++)
-               {
-                       // Row Machine
-                       Tmp1=surface[y][x];
-                       Tmp2=SR0+Tmp1;
-                       SR0=Tmp1;
-                       Tmp1=SR1+Tmp2;
-                       SR1=Tmp2;
-
-                       if(y)
-                               surface[y-1][x]=(Tmp1)/4;
-               }
-       }
-}
-
-//THE GOOD ONE!!!!!!!!!
-bool Blur::operator ()(const Surface &surface, 
-                                               const Vector &resolution, 
-                                               Surface &out) const
-{
-       int w = surface.get_w(),
-               h = surface.get_h();
-       
-       if(w == 0 || h == 0 || resolution[0] == 0 || resolution[1] == 0) return false;
-       
-       const Real      pw = resolution[0]/w,
-                               ph = resolution[1]/h;
-       
-       int     halfsizex = (int) (abs(size[0]*.5/pw) + 1),
-               halfsizey = (int) (abs(size[1]*.5/ph) + 1);     
-       
-       int x,y;
-       
-       SuperCallback blurcall(cb,0,5000,5000);
-       
-       Surface worksurface(w,h);
-       
-       //sinfg::info("Blur: check surface = %s", surface_valid(surface)?"true":"false");
-       
-       // Premultiply the alpha
-       for(y=0;y<h;y++)
-       {
-               for(x=0;x<w;x++)
-               {
-                       Color a = surface[y][x];
-                       a.set_r(a.get_r()*a.get_a());
-                       a.set_g(a.get_g()*a.get_a());
-                       a.set_b(a.get_b()*a.get_a());
-                       worksurface[y][x] = a;
-               }
-       }
-       
-       switch(type)
-       {
-       case Blur::DISC:        // D I S C ----------------------------------------------------------
-               {                       
-                       int bw = halfsizex;
-                       int bh = halfsizey;
-                       
-                       if(size[0] && size[1] && w*h>2)
-                       {
-                               int x2,y2;
-                               Surface tmp_surface(worksurface);
-                               
-                               for(y=0;y<h;y++)
-                               {
-                                       for(x=0;x<w;x++)
-                                       {
-                                               //accumulate all the pixels in an ellipse of w,h about the current pixel
-                                               Color color=Color::alpha();
-                                               int total=0;
-                                               
-                                               for(y2=-bh;y2<=bh;y2++)
-                                               {
-                                                       for(x2=-bw;x2<=bw;x2++)
-                                                       {
-                                                               //get the floating point distance away from the origin pixel in relative coords
-                                                               float tmp_x=(float)x2/bw;
-                                                               float tmp_y=(float)y2/bh;
-                                                               tmp_x*=tmp_x;
-                                                               tmp_y*=tmp_y;
-                                                               
-                                                               //ignore if it's outside of the disc
-                                                               if( tmp_x+tmp_y>1.0)
-                                                                       continue;
-                                                               
-                                                               //cap the pixel indices to inside the surface
-                                                               int u= x+x2,
-                                                                       v= y+y2;
-                                                               
-                                                               if( u < 0 )                                     u = 0;
-                                                               if( u >= w ) u = w-1;
-                                                                       
-                                                               if( v < 0 )                             v = 0;
-                                                               if( v >= h ) v = h-1;
-                                                                       
-                                                               //accumulate the color, and # of pixels added in
-                                                               color += tmp_surface[v][u];
-                                                               total++;
-                                                       }
-                                               }
-                                               
-                                               //blend the color with the original color
-                                               //if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
-                                                       worksurface[y][x]=color/total;
-                                               //else
-                                               //      worksurface[y][x]=Color::blend(color/total,tmp_surface[y][x],get_amount(),get_blend_method());
-                                       }
-                                       if(!blurcall.amount_complete(y,h))
-                                       {
-                                               //if(cb)cb->error(strprintf(__FILE__"%d: Accelerated Renderer Failure",__LINE__));
-                                               return false;
-                                       }
-                               }
-                               break;
-                       }
-                       
-                       //if we don't qualify for disc blur just use box blur
-               }
-
-       case Blur::BOX: // B O X -------------------------------------------------------
-               {
-                       //horizontal part
-                       //sinfg::info("Blur: Starting Box blur (surface valid %d)", (int)surface_valid(worksurface));
-                       
-                       Surface temp_surface;
-                       temp_surface.set_wh(w,h);
-                       
-                       if(size[0])
-                       {
-                               int length = halfsizex;
-                               length=std::max(1,length);
-                               
-                               //sinfg::info("Blur: hbox blur work -> temp %d", length);
-                               etl::hbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface.begin());
-                       }
-                       else temp_surface = worksurface;
-                       //sinfg::info("Blur: hbox finished");
-                       
-                       //vertical part
-                       //Surface temp_surface2;
-                       //temp_surface2.set_wh(w,h);
-                                               
-                       if(size[1])
-                       {
-                               int length = halfsizey;
-                               length = std::max(1,length);
-                               
-                               //sinfg::info("Blur: vbox blur temp -> work %d",length);
-                               etl::vbox_blur(temp_surface.begin(),temp_surface.end(),length,worksurface.begin());
-                       }
-                       else worksurface = temp_surface;
-                       //sinfg::info("Blur: vbox finished");
-                       
-                       //blend with the original surface
-                       /*int x,y;
-                       for(y=0;y<h;y++)
-                       {
-                               for(x=0;x<w;x++)
-                               {
-                                       worksurface[y][x]=temp_surface2[y][x];//Color::blend(temp_surface2[y][x],worksurface[y][x],get_amount(),get_blend_method());
-                               }
-                       }*/
-               }
-               break;
-
-       case Blur::FASTGAUSSIAN:        // F A S T G A U S S I A N ----------------------------------------------
-               {               
-                       //fast gaussian is treated as a 3x3 type of thing, except expanded to work with the length
-                       
-                       /*      1       2       1
-                               2       4       2
-                               1       2       1
-                       */
-                       
-                       Surface temp_surface;
-                       temp_surface.set_wh(w,h);
-                       
-                       //Surface temp_surface2;
-                       //temp_surface2.set_wh(w,h);
-                       
-                       //horizontal part
-                       if(size[0])
-                       {
-                               int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1);
-                               length=std::max(1,length);
-                               
-                               //two box blurs produces: 1 2 1
-                               etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
-                               etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
-                       }
-                       //else temp_surface2=worksurface;
-                       
-                       //vertical part
-                       if(size[1])
-                       {
-                               int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1);
-                               length=std::max(1,length);
-                               
-                               //two box blurs produces: 1 2 1 on the horizontal 1 2 1
-                               etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
-                               etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
-                       }
-                       //else temp_surface2=temp_surface2;
-       
-                       /*int x,y;
-                       for(y=0;y<h;y++)
-                       {
-                               for(x=0;x<w;x++)
-                               {
-                                       worksurface[y][x]=temp_surface2[y][x];//Color::blend(temp_surface2[y][x],worksurface[y][x],get_amount(),get_blend_method());
-                               }
-                       }*/
-               }
-               break;
-
-       case Blur::CROSS: // C R O S S  -------------------------------------------------------
-               {
-                       //horizontal part
-                       Surface temp_surface;
-                       temp_surface.set_wh(worksurface.get_w(),worksurface.get_h());
-                       
-                       if(size[0])
-                       {
-                               int length = halfsizex;
-                               length = std::max(1,length);
-                               
-                               etl::hbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface.begin());
-                       }
-                       else temp_surface = worksurface;
-                               
-                       //vertical part
-                       Surface temp_surface2;
-                       temp_surface2.set_wh(worksurface.get_w(),worksurface.get_h());
-                       
-                       if(size[1])
-                       {
-                               int length = halfsizey;
-                               length = std::max(1,length);
-                               
-                               etl::vbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface2.begin());
-                       }
-                       else temp_surface2 = worksurface;
-       
-                       //blend the two together
-                       int x,y;
-
-                       for(y=0;y<h;y++)
-                       {
-                               for(x=0;x<w;x++)
-                               {
-                                       worksurface[y][x] = (temp_surface[y][x]+temp_surface2[y][x])/2;//Color::blend((temp_surface[y][x]+temp_surface2[y][x])/2,worksurface[y][x],get_amount(),get_blend_method());
-                               }
-                       }
-
-                       break;
-               }
-
-       case Blur::GAUSSIAN:    // G A U S S I A N ----------------------------------------------
-               {
-                       #ifndef GAUSSIAN_ADJUSTMENT
-                       #define GAUSSIAN_ADJUSTMENT             (0.05)
-                       #endif
-
-                       Real    pw = (Real)w/(resolution[0]);
-                       Real    ph = (Real)h/(resolution[1]);
-                       
-                       Surface temp_surface;
-                       Surface *gauss_surface;
-                       
-                       //sinfg::warning("Didn't crash yet b1");
-                       
-                       //if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
-                               gauss_surface = &worksurface;
-                       /*else
-                       {
-                               temp_surface = worksurface;
-                               gauss_surface = &temp_surface;
-                       }*/
-
-            /* Squaring the pw and ph values
-                          is necessary to insure consistant
-                          results when rendered to different
-                          resolutions.
-                          Unfortunately, this automaticly
-                          squares our rendertime.
-                          There has got to be a faster way...
-                       */
-                       pw=pw*pw;
-                       ph=ph*ph;
-
-                       int bw = (int)(abs(pw)*size[0]*GAUSSIAN_ADJUSTMENT+0.5);
-                       int bh = (int)(abs(ph)*size[1]*GAUSSIAN_ADJUSTMENT+0.5);
-                       int max=bw+bh;
-
-                       Color *SC0=new class Color[w+2];
-                       Color *SC1=new class Color[w+2];
-                       Color *SC2=new class Color[w+2];
-                       Color *SC3=new class Color[w+2];
-                       memset(SC0,0,(w+2)*sizeof(Color));
-                       memset(SC0,0,(w+2)*sizeof(Color));
-                       memset(SC0,0,(w+2)*sizeof(Color));
-                       memset(SC0,0,(w+2)*sizeof(Color));
-
-                       //sinfg::warning("Didn't crash yet b2");
-                       //int i = 0;
-                       
-                       while(bw&&bh)
-                       {
-                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
-
-                               if(bw>=4 && bh>=4)
-                               {
-                                       etl::gaussian_blur_5x5_(gauss_surface->begin(),gauss_surface->get_w(),gauss_surface->get_h(),SC0,SC1,SC2,SC3);
-                                       bw-=4,bh-=4;
-                               }
-                               else
-                               if(bw>=2 && bh>=2)
-                               {
-                                       etl::gaussian_blur_3x3(gauss_surface->begin(),gauss_surface->end());
-                                       bw-=2,bh-=2;
-                               }
-                               else
-                               if(bw>=1 && bh>=1)
-                               {
-                                       GuassianBlur_2x2(*gauss_surface);
-                                       bw--,bh--;
-                               }
-                               
-                               //sinfg::warning("Didn't crash yet bi - %d",i++);
-                       }
-                       while(bw)
-                       {
-                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
-                               if(bw>=2)
-                               {
-                                       GuassianBlur_3x1(*gauss_surface);
-                                       bw-=2;
-                               }
-                               else
-                               if(bw>=1)
-                               {
-                                       GuassianBlur_2x1(*gauss_surface);
-                                       bw--;
-                               }
-                               //sinfg::warning("Didn't crash yet bi - %d",i++);
-                       }
-                       while(bh)
-                       {
-                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
-                               if(bh>=2)
-                               {
-                                       GuassianBlur_1x3(*gauss_surface);
-                                       bh-=2;
-                               }
-                               else
-                               if(bh>=1)
-                               {
-                                       GuassianBlur_1x2(*gauss_surface);
-                                       bh--;
-                               }
-                               //sinfg::warning("Didn't crash yet bi - %d",i++);
-                       }
-
-                       delete [] SC0;
-                       delete [] SC1;
-                       delete [] SC2;
-                       delete [] SC3;
-
-                       /*if(get_amount()!=1.0 || get_blend_method()!=Color::BLEND_STRAIGHT)
-                       {
-                               int x,y;
-                               for(y=0;y<renddesc.get_h();y++)
-                                       for(x=0;x<renddesc.get_w();x++)
-                                               worksurface[y][x]=Color::blend(temp_surface[y][x],worksurface[y][x],get_amount(),get_blend_method());
-                       }*/
-                       //sinfg::warning("Didn't crash yet b end",i++);
-               }
-               break;
-
-               default:
-               break;
-       }
-
-       // Scale up the alpha
-       
-       //be sure the surface is of the correct size
-       //surface->set_wh(renddesc.get_w(),renddesc.get_h());
-       out.set_wh(w,h);
-       
-       //divide out the alpha
-       for(y=0;y<h;y++)
-       {
-               for(x=0;x<w;x++)
-               {
-                       Color a = worksurface[y][x];
-                       if(a.get_a())
-                       {
-                               a.set_r(a.get_r()/a.get_a());
-                               a.set_g(a.get_g()/a.get_a());
-                               a.set_b(a.get_b()/a.get_a());
-                               out[y][x]=a;
-                       }
-                       else out[y][x]=Color::alpha();
-               }
-       }
-       
-       //we are FRIGGGIN done....
-       blurcall.amount_complete(100,100);
-       
-       return true;
-}
-
-bool Blur::operator ()(const surface<float> &surface, 
-                                               const Vector &resolution, 
-                                               surface<float> &out) const
-{
-       int w = surface.get_w(),
-               h = surface.get_h();
-       
-       if(w == 0 || h == 0 || resolution[0] == 0 || resolution[1] == 0) return false;
-       
-       const Real      pw = resolution[0]/w,
-                               ph = resolution[1]/h;
-       
-       int     halfsizex = (int) (abs(size[0]*.5/pw) + 1),
-               halfsizey = (int) (abs(size[1]*.5/ph) + 1);     
-       int x,y;
-       
-       SuperCallback blurcall(cb,0,5000,5000);
-       
-       etl::surface<float> worksurface(surface);
-       
-       //don't need to premultiply because we are dealing with ONLY alpha
-               
-       switch(type)
-       {
-       case Blur::DISC:        // D I S C ----------------------------------------------------------
-               {                       
-                       int bw = halfsizex;
-                       int bh = halfsizey;
-                       
-                       if(size[0] && size[1] && w*h>2)
-                       {
-                               int x2,y2;
-                               etl::surface<float> tmp_surface(worksurface);
-                               
-                               for(y=0;y<h;y++)
-                               {
-                                       for(x=0;x<w;x++)
-                                       {
-                                               //accumulate all the pixels in an ellipse of w,h about the current pixel
-                                               float a = 0;
-                                               int total=0;
-                                               
-                                               for(y2=-bh;y2<=bh;y2++)
-                                               {
-                                                       for(x2=-bw;x2<=bw;x2++)
-                                                       {
-                                                               //get the floating point distance away from the origin pixel in relative coords
-                                                               float tmp_x=(float)x2/bw;
-                                                               float tmp_y=(float)y2/bh;
-                                                               tmp_x*=tmp_x;
-                                                               tmp_y*=tmp_y;
-                                                               
-                                                               //ignore if it's outside of the disc
-                                                               if( tmp_x+tmp_y>1.0)
-                                                                       continue;
-                                                               
-                                                               //cap the pixel indices to inside the surface
-                                                               int u= x+x2,
-                                                                       v= y+y2;
-                                                               
-                                                               if( u < 0 )                                     u = 0;
-                                                               if( u >= w ) u = w-1;
-                                                                       
-                                                               if( v < 0 )                             v = 0;
-                                                               if( v >= h ) v = h-1;
-                                                                       
-                                                               //accumulate the color, and # of pixels added in
-                                                               a += tmp_surface[v][u];
-                                                               total++;
-                                                       }
-                                               }
-                                               
-                                               //blend the color with the original color
-                                               //if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
-                                                       worksurface[y][x]=a/total;
-                                               //else
-                                               //      worksurface[y][x]=Color::blend(color/total,tmp_surface[y][x],get_amount(),get_blend_method());
-                                       }
-                                       if(!blurcall.amount_complete(y,h))
-                                       {
-                                               //if(cb)cb->error(strprintf(__FILE__"%d: Accelerated Renderer Failure",__LINE__));
-                                               return false;
-                                       }
-                               }
-                               break;
-                       }
-                       
-                       //if we don't qualify for disc blur just use box blur
-               }
-
-       case Blur::BOX: // B O X -------------------------------------------------------
-               {
-                       //horizontal part
-                       etl::surface<float> temp_surface;
-                       temp_surface.set_wh(w,h);
-                       
-                       if(size[0])
-                       {
-                               int length = halfsizex;
-                               length=std::max(1,length);
-                               
-                               etl::hbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface.begin());
-                       }
-                       else temp_surface = worksurface;
-                       
-                       //vertical part
-                       //etl::surface<float> temp_surface2;
-                       //temp_surface2.set_wh(w,h);
-                       
-                       if(size[1])
-                       {
-                               int length = halfsizey;
-                               length = std::max(1,length);
-                               etl::vbox_blur(temp_surface.begin(),temp_surface.end(),length,worksurface.begin());
-                       }
-                       else worksurface = temp_surface;
-                       
-                       //blend with the original surface
-                       /*int x,y;
-                       for(y=0;y<h;y++)
-                       {
-                               for(x=0;x<w;x++)
-                               {
-                                       worksurface[y][x]=temp_surface2[y][x];//Color::blend(temp_surface2[y][x],worksurface[y][x],get_amount(),get_blend_method());
-                               }
-                       }*/
-               }
-               break;
-
-       case Blur::FASTGAUSSIAN:        // F A S T G A U S S I A N ----------------------------------------------
-               {               
-                       //fast gaussian is treated as a 3x3 type of thing, except expanded to work with the length
-                       
-                       /*      1       2       1
-                               2       4       2
-                               1       2       1
-                       */
-                       
-                       etl::surface<float> temp_surface;
-                       temp_surface.set_wh(w,h);
-                       
-                       //etl::surface<float> temp_surface2;
-                       //temp_surface2.set_wh(w,h);
-                       
-                       //horizontal part
-                       if(size[0])
-                       {
-                               int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1);
-                               length=std::max(1,length);
-                               
-                               //two box blurs produces: 1 2 1
-                               etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
-                               etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
-                       }
-                       //else temp_surface2=worksurface;
-                       
-                       //vertical part
-                       if(size[1])
-                       {
-                               int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1);
-                               length=std::max(1,length);
-                               
-                               //two box blurs produces: 1 2 1 on the horizontal 1 2 1
-                               etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
-                               etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
-                       }
-                       //else temp_surface2=temp_surface2;
-       
-                       /*int x,y;
-                       for(y=0;y<h;y++)
-                       {
-                               for(x=0;x<w;x++)
-                               {
-                                       worksurface[y][x]=temp_surface2[y][x];//Color::blend(temp_surface2[y][x],worksurface[y][x],get_amount(),get_blend_method());
-                               }
-                       }*/
-               }
-               break;
-
-       case Blur::CROSS: // C R O S S  -------------------------------------------------------
-               {
-                       //horizontal part
-                       etl::surface<float> temp_surface;
-                       temp_surface.set_wh(worksurface.get_w(),worksurface.get_h());
-                       
-                       if(size[0])
-                       {
-                               int length = halfsizex;
-                               length = std::max(1,length);
-                               
-                               etl::hbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface.begin());
-                       }
-                       else temp_surface = worksurface;
-                               
-                       //vertical part
-                       etl::surface<float> temp_surface2;
-                       temp_surface2.set_wh(worksurface.get_w(),worksurface.get_h());
-                       
-                       if(size[1])
-                       {
-                               int length = halfsizey;
-                               length = std::max(1,length);
-                               
-                               etl::vbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface2.begin());
-                       }
-                       else temp_surface2 = worksurface;
-       
-                       //blend the two together
-                       int x,y;
-
-                       for(y=0;y<h;y++)
-                       {
-                               for(x=0;x<w;x++)
-                               {
-                                       worksurface[y][x] = (temp_surface[y][x]+temp_surface2[y][x])/2;//Color::blend((temp_surface[y][x]+temp_surface2[y][x])/2,worksurface[y][x],get_amount(),get_blend_method());
-                               }
-                       }
-
-                       break;
-               }
-
-       case Blur::GAUSSIAN:    // G A U S S I A N ----------------------------------------------
-               {
-                       #ifndef GAUSSIAN_ADJUSTMENT
-                       #define GAUSSIAN_ADJUSTMENT             (0.05)
-                       #endif
-
-                       Real    pw = (Real)w/(resolution[0]);
-                       Real    ph = (Real)h/(resolution[1]);
-                       
-                       //etl::surface<float> temp_surface;
-                       etl::surface<float> *gauss_surface;
-                       
-                       //if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
-                               gauss_surface = &worksurface;
-                       /*else
-                       {
-                               temp_surface = worksurface;
-                               gauss_surface = &temp_surface;
-                       }*/
-
-            /* Squaring the pw and ph values
-                          is necessary to insure consistant
-                          results when rendered to different
-                          resolutions.
-                          Unfortunately, this automaticly
-                          squares our rendertime.
-                          There has got to be a faster way...
-                       */
-                       pw=pw*pw;
-                       ph=ph*ph;
-
-                       int bw = (int)(abs(pw)*size[0]*GAUSSIAN_ADJUSTMENT+0.5);
-                       int bh = (int)(abs(ph)*size[1]*GAUSSIAN_ADJUSTMENT+0.5);
-                       int max=bw+bh;
-
-                       float *SC0=new float[w+2];
-                       float *SC1=new float[w+2];
-                       float *SC2=new float[w+2];
-                       float *SC3=new float[w+2];
-                       
-                       memset(SC0,0,(w+2)*sizeof(float));
-                       memset(SC0,0,(w+2)*sizeof(float));
-                       memset(SC0,0,(w+2)*sizeof(float));
-                       memset(SC0,0,(w+2)*sizeof(float));
-
-                       //int i = 0;
-                       
-                       while(bw&&bh)
-                       {                               
-                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
-
-                               if(bw>=4 && bh>=4)
-                               {
-                                       etl::gaussian_blur_5x5_(gauss_surface->begin(),gauss_surface->get_w(),gauss_surface->get_h(),SC0,SC1,SC2,SC3);
-                                       bw-=4,bh-=4;
-                               }
-                               else
-                               if(bw>=2 && bh>=2)
-                               {
-                                       etl::gaussian_blur_3x3(gauss_surface->begin(),gauss_surface->end());
-                                       bw-=2,bh-=2;
-                               }
-                               else
-                               if(bw>=1 && bh>=1)
-                               {
-                                       GuassianBlur_2x2(*gauss_surface);
-                                       bw--,bh--;
-                               }
-                       }
-                       
-                       while(bw)
-                       {
-                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
-                               if(bw>=2)
-                               {
-                                       GuassianBlur_3x1(*gauss_surface);
-                                       bw-=2;
-                               }
-                               else
-                               if(bw>=1)
-                               {
-                                       GuassianBlur_2x1(*gauss_surface);
-                                       bw--;
-                               }
-                       }
-                       
-                       while(bh)
-                       {
-                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
-                               if(bh>=2)
-                               {
-                                       GuassianBlur_1x3(*gauss_surface);
-                                       bh-=2;
-                               }
-                               else
-                               if(bh>=1)
-                               {
-                                       GuassianBlur_1x2(*gauss_surface);
-                                       bh--;
-                               }
-                       }
-
-                       delete [] SC0;
-                       delete [] SC1;
-                       delete [] SC2;
-                       delete [] SC3;
-
-                       /*if(get_amount()!=1.0 || get_blend_method()!=Color::BLEND_STRAIGHT)
-                       {
-                               int x,y;
-                               for(y=0;y<renddesc.get_h();y++)
-                                       for(x=0;x<renddesc.get_w();x++)
-                                               worksurface[y][x]=Color::blend(temp_surface[y][x],worksurface[y][x],get_amount(),get_blend_method());
-                       }*/
-               }
-               break;
-
-               default:
-               break;
-       }
-       
-       //be sure the surface is of the correct size
-       //surface->set_wh(renddesc.get_w(),renddesc.get_h());
-       out.set_wh(w,h);
-       
-       //divide out the alpha - don't need to cause we rock
-       out = worksurface;
-       
-       //we are FRIGGGIN done....
-       blurcall.amount_complete(100,100);
-       
-       return true;
-}
-
-/* === E N T R Y P O I N T ================================================= */
diff --git a/synfig-core/trunk/src/sinfg/blur.h b/synfig-core/trunk/src/sinfg/blur.h
deleted file mode 100644 (file)
index e8c9dbd..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blur.h
-**     \brief Blur Helper Header file
-**
-**     $Id: blur.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_BLUR_HELPER_H
-#define __SINFG_BLUR_HELPER_H
-
-/* === H E A D E R S ======================================================= */
-#include <sinfg/surface.h>
-#include <sinfg/color.h>
-#include <sinfg/vector.h>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-class sinfg::ProgressCallback;
-       
-class Blur
-{
-public:
-       enum Type
-       {
-               BOX                             =0,
-               FASTGAUSSIAN    =1,
-               CROSS                   =2,
-               GAUSSIAN                =3,
-               DISC                    =4,
-               
-               FORCE_DWORD = 0x8fffffff
-       };
-
-private:
-       sinfg::Point    size;
-       int                             type;
-
-       sinfg::ProgressCallback *cb;
-
-public:
-       sinfg::Point & set_size(const sinfg::Point &v) { return (size = v); }
-       const sinfg::Point & get_size() const { return size; }
-       sinfg::Point & get_size() { return size; }
-       
-       int & set_type(const int &t) { return (type = t); }
-       const int & get_type() const { return type; }
-       int & get_type() { return type; }
-       
-       Blur() {}
-       Blur(const sinfg::Point &s, int t, sinfg::ProgressCallback *callb=0):size(s), type(t), cb(callb) {}
-       Blur(sinfg::Real sx, sinfg::Real sy, int t, sinfg::ProgressCallback *callb = 0): size(sx,sy), type(t), cb(callb) {}
-       
-       //Parametric Blur
-       sinfg::Point operator ()(const sinfg::Point &p) const;
-       sinfg::Point operator ()(sinfg::Real x, sinfg::Real y) const;
-       
-       //Surface based blur
-       //      input surface can be the same as output surface,
-       //      though both have to be the same size
-       bool operator ()(const sinfg::Surface &surface, const sinfg::Vector &resolution, sinfg::Surface &out) const;
-               
-       bool operator ()(const etl::surface<float> &surface, const sinfg::Vector &resolution, etl::surface<float> &out) const;
-       //bool operator ()(const etl::surface<unsigned char> &surface, const sinfg::Vector &resolution, etl::surface<unsigned char> &out) const;
-};
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/canvas.cpp b/synfig-core/trunk/src/sinfg/canvas.cpp
deleted file mode 100644 (file)
index 3d3e87a..0000000
+++ /dev/null
@@ -1,1200 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvas.cpp
-**     \brief Canvas Class Member Definitions
-**
-**     $Id: canvas.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "layer.h"
-#include "canvas.h"
-#include <cassert>
-#include "exception.h"
-#include "time.h"
-#include "context.h"
-#include "layer_pastecanvas.h"
-#include <sigc++/bind.h>
-
-#endif
-
-using namespace sinfg;
-using namespace etl;
-using namespace std;
-
-namespace sinfg { extern Canvas::Handle open_canvas(const String &filename); };
-
-/* === M A C R O S ========================================================= */
-
-struct _CanvasCounter
-{
-       static int counter;
-       ~_CanvasCounter()
-       {
-               if(counter)
-                       sinfg::error("%d canvases not yet deleted!",counter);
-       }
-} _canvas_counter;
-
-int _CanvasCounter::counter(0);
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Canvas::Canvas(const string &id):
-       id_                     (id),
-       cur_time_       (0),
-       is_inline_      (false),
-       is_dirty_       (true),
-       op_flag_        (false)
-{
-       _CanvasCounter::counter++;
-       clear();
-}
-
-void
-Canvas::on_changed()
-{
-       is_dirty_=true;
-       Node::on_changed();
-}
-
-Canvas::~Canvas()
-{
-       //if(is_inline() && parent_) assert(0);
-       _CanvasCounter::counter--;
-       //DEBUGPOINT();
-       clear();
-       begin_delete();
-}
-
-Canvas::iterator
-Canvas::end()
-{
-       return CanvasBase::end()-1;
-}
-
-Canvas::const_iterator
-Canvas::end()const
-{
-       return CanvasBase::end()-1;
-}
-
-Canvas::reverse_iterator
-Canvas::rbegin()
-{
-       return CanvasBase::rbegin()+1;
-}
-
-Canvas::const_reverse_iterator
-Canvas::rbegin()const
-{
-       return CanvasBase::rbegin()+1;
-}
-
-int
-Canvas::size()const
-{
-       return CanvasBase::size()-1;
-}
-
-void
-Canvas::clear()
-{
-       while(!empty())
-       {
-               Layer::Handle layer(front());
-               //if(layer->count()>2)sinfg::info("before layer->count()=%d",layer->count());
-                               
-               erase(begin());
-               //if(layer->count()>1)sinfg::info("after layer->count()=%d",layer->count());
-       }
-       //CanvasBase::clear();
-
-       // We need to keep a blank handle at the
-       // end of the image list, and acts at
-       // the bottom. Without it, the layers
-       // would just continue going when polled
-       // for a color.
-       CanvasBase::push_back(Layer::Handle());
-       
-       changed();
-}
-
-bool
-Canvas::empty()const
-{
-       return CanvasBase::size()<=1;
-}
-
-Layer::Handle &
-Canvas::back()
-{
-       return *(CanvasBase::end()-1);
-}
-
-const Layer::Handle &
-Canvas::back()const
-{
-       return *(CanvasBase::end()-1);
-}
-
-Context
-Canvas::get_context()const
-{
-       return begin();
-}
-
-const ValueNodeList &
-Canvas::value_node_list()const
-{
-       if(is_inline() && parent_)
-               return parent_->value_node_list();
-       return value_node_list_;
-}
-
-KeyframeList &
-Canvas::keyframe_list()
-{
-       if(is_inline() && parent_)
-               return parent_->keyframe_list();
-       return keyframe_list_;
-}
-
-const KeyframeList &
-Canvas::keyframe_list()const
-{
-       if(is_inline() && parent_)
-               return parent_->keyframe_list();
-       return keyframe_list_;
-}
-
-etl::handle<Layer>
-Canvas::find_layer(const Point &pos)
-{
-       return get_context().hit_check(pos);
-}
-
-static bool
-valid_id(const String &x)
-{
-       static const char bad_chars[]=" :#@$^&()*";
-       unsigned int i;
-       
-       if(!x.empty() && x[0]>='0' && x[0]<='9')
-               return false;
-       
-       for(i=0;i<sizeof(bad_chars);i++)
-               if(x.find_first_of(bad_chars[i])!=string::npos)
-                       return false;
-
-       return true;
-}
-
-void
-Canvas::set_id(const String &x)
-{
-       if(is_inline() && parent_)
-               throw runtime_error("Inline Canvas cannot have an ID");
-       
-       if(!valid_id(x))
-               throw runtime_error("Invalid ID");
-       id_=x;
-       signal_id_changed_();
-}
-
-void
-Canvas::set_name(const String &x)
-{
-       name_=x;
-       signal_meta_data_changed()("name");
-       signal_meta_data_changed("name")();
-}
-
-void
-Canvas::set_author(const String &x)
-{
-       author_=x;
-       signal_meta_data_changed()("author");
-       signal_meta_data_changed("author")();
-}
-
-void
-Canvas::set_description(const String &x)
-{
-       description_=x;
-       signal_meta_data_changed()("description");
-       signal_meta_data_changed("description")();
-}
-
-void
-Canvas::set_time(Time t)const
-{      
-       if(is_dirty_ || !get_time().is_equal(t))
-       {       
-#if 0
-               if(is_root())
-               {
-                       sinfg::info("is_dirty_=%d",is_dirty_);
-                       sinfg::info("get_time()=%f",(float)get_time());
-                       sinfg::info("t=%f",(float)t);
-               }
-#endif
-
-               // ...questionable
-               const_cast<Canvas&>(*this).cur_time_=t;
-               
-               is_dirty_=false;
-               get_context().set_time(t);
-       }
-       is_dirty_=false;
-}
-
-Canvas::LooseHandle
-Canvas::get_root()const
-{
-       return parent_?parent_->get_root().get():const_cast<sinfg::Canvas *>(this);
-}
-
-int
-Canvas::get_depth(etl::handle<Layer> layer)const
-{
-       const_iterator iter;
-       int i(0);
-       for(iter=begin();iter!=end();++iter,i++)
-       {
-               if(layer==*iter)
-                       return i;
-       }
-       return -1;
-}
-
-String
-Canvas::get_relative_id(etl::loose_handle<const Canvas> x)const
-{
-       if(x->get_root()==this)
-               return ":";
-       if(is_inline() && parent_)
-               return parent_->_get_relative_id(x);
-       return _get_relative_id(x);
-}
-
-String
-Canvas::_get_relative_id(etl::loose_handle<const Canvas> x)const
-{
-       if(is_inline() && parent_)
-               return parent_->_get_relative_id(x);
-
-       if(x.get()==this)
-               return String();
-       
-       if(parent()==x.get())
-               return get_id();
-       
-       String id;
-       
-       const Canvas* canvas=this;
-       
-       for(;!canvas->is_root();canvas=canvas->parent().get())
-               id=':'+canvas->get_id()+id;
-       
-       if(x && get_root()!=x->get_root())
-       {
-               //String file_name=get_file_name();
-               //String file_path=x->get_file_path();
-               
-               String file_name;
-               if(is_absolute_path(get_file_name()))
-                       file_name=etl::relative_path(x->get_file_path(),get_file_name());
-               else
-                       file_name=get_file_name();
-               
-               // If the path of X is inside of file_name,
-               // then remove it.
-               //if(file_name.size()>file_path.size())
-               //      if(file_path==String(file_name,0,file_path.size()))
-               //              file_name.erase(0,file_path.size()+1);
-                       
-               id=file_name+'#'+id;
-       }
-
-       return id;
-}
-
-
-ValueNode::Handle
-Canvas::find_value_node(const String &id)
-{
-       return
-               ValueNode::Handle::cast_const(
-                       const_cast<const Canvas*>(this)->find_value_node(id)
-               );
-}
-
-ValueNode::ConstHandle
-Canvas::find_value_node(const String &id)const
-{
-       if(is_inline() && parent_)
-               return parent_->find_value_node(id);
-               
-       if(id.empty())
-               throw Exception::IDNotFound("Empty ID");
-
-       // If we do not have any resolution, then we assume that the
-       // request is for this immediate canvas
-       if(id.find_first_of(':')==string::npos && id.find_first_of('#')==string::npos)
-               return value_node_list_.find(id);
-
-       String canvas_id(id,0,id.rfind(':'));
-       String value_node_id(id,id.rfind(':')+1);
-       if(canvas_id.empty())
-               canvas_id=':';
-       //sinfg::warning("constfind:value_node_id: "+value_node_id);
-       //sinfg::warning("constfind:canvas_id: "+canvas_id);
-
-       return find_canvas(canvas_id)->value_node_list_.find(value_node_id);
-}
-
-ValueNode::Handle
-Canvas::surefind_value_node(const String &id)
-{
-       if(is_inline() && parent_)
-               return parent_->surefind_value_node(id);
-
-       if(id.empty())
-               throw Exception::IDNotFound("Empty ID");
-
-       // If we do not have any resolution, then we assume that the
-       // request is for this immediate canvas
-       if(id.find_first_of(':')==string::npos && id.find_first_of('#')==string::npos)
-               return value_node_list_.surefind(id);
-
-       String canvas_id(id,0,id.rfind(':'));
-       String value_node_id(id,id.rfind(':')+1);
-       if(canvas_id.empty())
-               canvas_id=':';
-               
-       return surefind_canvas(canvas_id)->value_node_list_.surefind(value_node_id);
-}
-
-void
-Canvas::add_value_node(ValueNode::Handle x, const String &id)
-{
-       if(is_inline() && parent_)
-               return parent_->add_value_node(x,id);
-//             throw runtime_error("You cannot add a ValueNode to an inline Canvas");
-
-       //DEBUGPOINT();
-       if(x->is_exported())
-               throw runtime_error("ValueNode is already exported");
-
-       if(id.empty())
-               throw Exception::BadLinkName("Empty ID");
-
-       if(id.find_first_of(':',0)!=string::npos)
-               throw Exception::BadLinkName("Bad character");
-       
-       try
-       {
-               //DEBUGPOINT();
-               if(PlaceholderValueNode::Handle::cast_dynamic(value_node_list_.find(id)))
-                       throw Exception::IDNotFound("add_value_node()");
-               
-               //DEBUGPOINT();
-               throw Exception::IDAlreadyExists(id);
-       }
-       catch(Exception::IDNotFound)
-       {
-               //DEBUGPOINT();
-               x->set_id(id);
-       
-               x->set_parent_canvas(this);
-       
-               if(!value_node_list_.add(x))
-               {
-                       sinfg::error("Unable to add ValueNode");
-                       throw std::runtime_error("Unable to add ValueNode");
-               }
-               //DEBUGPOINT();
-               
-               return;
-       }
-}
-
-/*
-void
-Canvas::rename_value_node(ValueNode::Handle x, const String &id)
-{
-       if(id.empty())
-               throw Exception::BadLinkName("Empty ID");
-
-       if(id.find_first_of(": ",0)!=string::npos)
-               throw Exception::BadLinkName("Bad character");
-
-       try
-       {
-               if(PlaceholderValueNode::Handle::cast_dynamic(value_node_list_.find(id)))
-                       throw Exception::IDNotFound("rename_value_node");
-               throw Exception::IDAlreadyExists(id);
-       }
-       catch(Exception::IDNotFound)
-       {
-               x->set_id(id);  
-
-               return;
-       }
-}
-*/
-
-void
-Canvas::remove_value_node(ValueNode::Handle x)
-{
-       if(is_inline() && parent_)
-               return parent_->remove_value_node(x);
-//             throw Exception::IDNotFound("Canvas::remove_value_node() was called from an inline canvas");
-               
-       if(!x)
-               throw Exception::IDNotFound("Canvas::remove_value_node() was passed empty handle");
-       
-       if(!value_node_list_.erase(x))
-               throw Exception::IDNotFound("Canvas::remove_value_node(): ValueNode was not found inside of this canvas");
-
-       //x->set_parent_canvas(0);
-       
-       x->set_id("");
-}
-
-
-etl::handle<Canvas>
-Canvas::surefind_canvas(const String &id)
-{
-       if(is_inline() && parent_)
-               return parent_->surefind_canvas(id);
-       
-       if(id.empty())
-               return this;
-       
-       // If the ID contains a "#" character, then a filename is
-       // expected on the left side. 
-       if(id.find_first_of('#')!=string::npos)
-       {
-               // If '#' is the first character, remove it
-               // and attempt to parse the ID again.
-               if(id[0]=='#')
-                       return surefind_canvas(String(id,1));
-               
-               //! \todo This needs alot more optimization
-               String file_name(id,0,id.find_first_of('#'));
-               String external_id(id,id.find_first_of('#')+1);
-               
-               Canvas::Handle external_canvas;
-               
-               // If the composition is already open, then use it.
-               if(externals_.count(file_name))
-                       external_canvas=externals_[file_name];
-               else
-               {
-                       if(is_absolute_path(file_name))
-                               external_canvas=open_canvas(file_name);
-                       else
-                               external_canvas=open_canvas(get_file_path()+'/'+file_name);
-
-                       if(!external_canvas)
-                               throw Exception::FileNotFound(file_name);
-                       externals_[file_name]=external_canvas;
-               }
-               
-               return Handle::cast_const(external_canvas.constant()->find_canvas(external_id));
-       }
-       
-       // If we do not have any resolution, then we assume that the
-       // request is for this immediate canvas
-       if(id.find_first_of(':')==string::npos)
-       {
-               Children::iterator iter;
-       
-               // Search for the image in the image list,
-               // and return it if it is found
-               for(iter=children().begin();iter!=children().end();iter++)
-                       if(id==(*iter)->get_id())
-                               return *iter;
-                       
-               // Create a new canvas and return it
-               //sinfg::warning("Implicitly creating canvas named "+id);
-               return new_child_canvas(id);
-       }
-       
-       // If the first character is the seperator, then 
-       // this references the root canvas.
-       if(id[0]==':')
-               return get_root()->surefind_canvas(string(id,1));
-
-       // Now we know that the requested Canvas is in a child
-       // of this canvas. We have to find that canvas and 
-       // call "find_canvas" on it, and return the result.
-       
-       String canvas_name=string(id,0,id.find_first_of(':'));
-       
-       Canvas::Handle child_canvas=surefind_canvas(canvas_name);
-
-       return child_canvas->surefind_canvas(string(id,id.find_first_of(':')+1));
-}
-
-Canvas::Handle
-Canvas::find_canvas(const String &id)
-{
-       return
-               Canvas::Handle::cast_const(
-                       const_cast<const Canvas*>(this)->find_canvas(id)
-               );
-}
-
-Canvas::ConstHandle
-Canvas::find_canvas(const String &id)const
-{
-       if(is_inline() && parent_)return parent_->find_canvas(id);
-
-       if(id.empty())
-               return this;
-
-       // If the ID contains a "#" character, then a filename is
-       // expected on the left side. 
-       if(id.find_first_of('#')!=string::npos)
-       {
-               // If '#' is the first character, remove it
-               // and attempt to parse the ID again.
-               if(id[0]=='#')
-                       return find_canvas(String(id,1));
-               
-               //! \todo This needs alot more optimization
-               String file_name(id,0,id.find_first_of('#'));
-               String external_id(id,id.find_first_of('#')+1);
-               
-               Canvas::Handle external_canvas;
-               
-               // If the composition is already open, then use it.
-               if(externals_.count(file_name))
-                       external_canvas=externals_[file_name];
-               else
-               {
-                       if(is_absolute_path(file_name))
-                               external_canvas=open_canvas(file_name);
-                       else
-                               external_canvas=open_canvas(get_file_path()+'/'+file_name);
-
-                       if(!external_canvas)
-                               throw Exception::FileNotFound(file_name);
-                       externals_[file_name]=external_canvas;
-               }
-               
-               return Handle::cast_const(external_canvas.constant()->find_canvas(external_id));
-       }
-       
-       // If we do not have any resolution, then we assume that the
-       // request is for this immediate canvas
-       if(id.find_first_of(':')==string::npos)
-       {
-               Children::const_iterator iter;
-       
-               // Search for the image in the image list,
-               // and return it if it is found
-               for(iter=children().begin();iter!=children().end();iter++)
-                       if(id==(*iter)->get_id())
-                               return *iter;
-                       
-               throw Exception::IDNotFound("Child Canvas in Parent Canvas: (child)"+id);
-       }
-       
-       // If the first character is the seperator, then 
-       // this references the root canvas.
-       if(id.find_first_of(':')==0)
-               return get_root()->find_canvas(string(id,1));
-
-       // Now we know that the requested Canvas is in a child
-       // of this canvas. We have to find that canvas and 
-       // call "find_canvas" on it, and return the result.
-       
-       String canvas_name=string(id,0,id.find_first_of(':'));
-       
-       Canvas::ConstHandle child_canvas=find_canvas(canvas_name);
-
-       return child_canvas->find_canvas(string(id,id.find_first_of(':')+1));
-}
-
-
-Canvas::Handle
-Canvas::create()
-{
-       return new Canvas("Untitled");
-}
-
-void
-Canvas::push_back(etl::handle<Layer> x)
-{
-//     DEBUGPOINT();
-//     int i(x->count());
-       insert(end(),x);
-       //if(x->count()!=i+1)sinfg::info("push_back before %d, after %d",i,x->count());
-}
-
-void
-Canvas::push_front(etl::handle<Layer> x)
-{
-//     DEBUGPOINT();
-//     int i(x->count());
-       insert(begin(),x);
-       //if(x->count()!=i+1)sinfg::error("push_front before %d, after %d",i,x->count());
-}
-
-void
-Canvas::insert(iterator iter,etl::handle<Layer> x)
-{
-//     int i(x->count());
-       CanvasBase::insert(iter,x);
-
-       /*if(x->count()!=i+1)
-       {
-               sinfg::error(__FILE__":%d: Canvas::insert(): ***FAILURE*** before %d, after %d",__LINE__,i,x->count());
-               return;
-               //throw runtime_error("Canvas Insertion Failed");
-       }*/
-
-       x->set_canvas(this);
-
-
-       add_child(x.get());
-
-       
-       LooseHandle correct_canvas(this);
-       //while(correct_canvas->is_inline())correct_canvas=correct_canvas->parent();
-       Layer::LooseHandle loose_layer(x);
-       
-       x->signal_added_to_group().connect(
-               sigc::bind(
-                       sigc::mem_fun(
-                               *correct_canvas,
-                               &Canvas::add_group_pair
-                       ),
-                       loose_layer
-               )
-       );
-       x->signal_removed_from_group().connect(
-               sigc::bind(
-                       sigc::mem_fun(
-                               *correct_canvas,
-                               &Canvas::remove_group_pair
-                       ),
-                       loose_layer
-               )
-       );
-
-
-       if(!x->get_group().empty())
-               add_group_pair(x->get_group(),x);
-
-
-       changed();
-}
-
-void
-Canvas::push_back_simple(etl::handle<Layer> x)
-{
-       CanvasBase::insert(end(),x);
-       changed();
-}
-
-void
-Canvas::erase(Canvas::iterator iter)
-{
-       if(!(*iter)->get_group().empty())
-               remove_group_pair((*iter)->get_group(),(*iter));
-       
-       // HACK: We really shouldn't be wiping
-       // out these signals entirely. We should
-       // only be removing the specific connections
-       // that we made. At the moment, I'm too
-       // lazy to add the code to keep track
-       // of those connections, and no one else
-       // is using these signals, so I'll just
-       // leave these next two lines like they
-       // are for now - darco 07-30-2004
-       (*iter)->signal_added_to_group().clear();
-       (*iter)->signal_removed_from_group().clear();
-
-       if(!op_flag_)remove_child(iter->get());
-               
-       CanvasBase::erase(iter);
-       if(!op_flag_)changed();
-}
-
-Canvas::Handle
-Canvas::clone(const GUID& deriv_guid)const
-{
-       sinfg::String name;
-       if(is_inline())
-               name="inline";
-       else
-       {
-               name=get_id()+"_CLONE";
-               
-               throw runtime_error("Cloning of non-inline canvases is not yet suported");
-       }
-       
-       Handle canvas(new Canvas(name));
-       
-       if(is_inline())
-       {
-               canvas->is_inline_=true;
-               canvas->parent_=0;
-               //canvas->set_inline(parent());
-       }
-
-       canvas->set_guid(get_guid()^deriv_guid);
-
-       const_iterator iter;
-       for(iter=begin();iter!=end();++iter)
-       {
-               Layer::Handle layer((*iter)->clone(deriv_guid));
-               if(layer)
-               {
-                       assert(layer.count()==1);
-                       int presize(size());
-                       canvas->push_back(layer);
-                       if(!(layer.count()>1))
-                       {
-                               sinfg::error("Canvas::clone(): Cloned layer insertion failure!");
-                               sinfg::error("Canvas::clone(): \tlayer.count()=%d",layer.count());
-                               sinfg::error("Canvas::clone(): \tlayer->get_name()=%s",layer->get_name().c_str());
-                               sinfg::error("Canvas::clone(): \tbefore size()=%d",presize);
-                               sinfg::error("Canvas::clone(): \tafter size()=%d",size());
-                       }
-                       assert(layer.count()>1);
-               }
-               else
-               {
-                       sinfg::error("Unable to clone layer");
-               }
-       }
-
-       canvas->signal_group_pair_removed().clear();
-       canvas->signal_group_pair_added().clear();
-
-       return canvas;
-}
-
-void
-Canvas::set_inline(LooseHandle parent)
-{
-       if(is_inline_ && parent_)
-       {
-               
-       }
-       
-       id_="inline";
-       is_inline_=true;
-       parent_=parent;
-
-       // Have the parent inherit all of the group stuff
-
-       std::map<String,std::set<etl::handle<Layer> > >::const_iterator iter;
-
-       for(iter=group_db_.begin();iter!=group_db_.end();++iter)
-       {
-               parent->group_db_[iter->first].insert(iter->second.begin(),iter->second.end());
-       }
-       
-       rend_desc()=parent->rend_desc();
-}
-
-Canvas::Handle
-Canvas::create_inline(Handle parent)
-{
-       assert(parent);
-       //if(parent->is_inline())
-       //      return create_inline(parent->parent());
-       
-       Handle canvas(new Canvas("inline"));
-       canvas->set_inline(parent);
-       return canvas;
-}
-
-Canvas::Handle
-Canvas::new_child_canvas()
-{
-       if(is_inline() && parent_)
-               return parent_->new_child_canvas();
-//             runtime_error("You cannot create a child Canvas in an inline Canvas");
-
-       // Create a new canvas
-       children().push_back(create());
-       Canvas::Handle canvas(children().back());
-
-       canvas->parent_=this;
-
-       canvas->rend_desc()=rend_desc();
-
-       return canvas;
-}
-
-Canvas::Handle
-Canvas::new_child_canvas(const String &id)
-{
-       if(is_inline() && parent_)
-               return parent_->new_child_canvas(id);
-//             runtime_error("You cannot create a child Canvas in an inline Canvas");
-
-       // Create a new canvas
-       children().push_back(create());
-       Canvas::Handle canvas(children().back());
-       
-       canvas->set_id(id);
-       canvas->parent_=this;
-       canvas->rend_desc()=rend_desc();
-
-       return canvas;
-}
-
-Canvas::Handle
-Canvas::add_child_canvas(Canvas::Handle child_canvas, const sinfg::String& id)
-{
-       if(is_inline() && parent_)
-               return parent_->add_child_canvas(child_canvas,id);
-
-       if(child_canvas->parent() && !child_canvas->is_inline())
-               throw std::runtime_error("Cannot add child canvas because it belongs to someone else!");
-       
-       if(!valid_id(id))
-               throw runtime_error("Invalid ID");
-       
-       try
-       {
-               find_canvas(id);
-               throw Exception::IDAlreadyExists(id);
-       }
-       catch(Exception::IDNotFound)
-       {
-               if(child_canvas->is_inline())
-                       child_canvas->is_inline_=false;
-               child_canvas->id_=id;
-               children().push_back(child_canvas);
-               child_canvas->parent_=this;
-       }
-       
-       return child_canvas;
-}
-
-void
-Canvas::remove_child_canvas(Canvas::Handle child_canvas)
-{
-       if(is_inline() && parent_)
-               return parent_->remove_child_canvas(child_canvas);
-       
-       if(child_canvas->parent_!=this)
-               throw runtime_error("Given child does not belong to me");
-       
-       if(find(children().begin(),children().end(),child_canvas)==children().end())
-               throw Exception::IDNotFound(child_canvas->get_id());
-       
-       children().remove(child_canvas);
-
-       child_canvas->parent_=0;
-}
-
-void
-Canvas::set_file_name(const String &file_name)
-{
-       if(parent())
-               parent()->set_file_name(file_name);
-       else
-       {
-               file_name_=file_name;
-               signal_file_name_changed_();
-       }
-}
-
-sigc::signal<void>&
-Canvas::signal_file_name_changed()
-{
-       if(parent())
-               return signal_file_name_changed();
-       else
-               return signal_file_name_changed_;
-}
-
-String
-Canvas::get_file_name()const
-{
-       if(parent())
-               return parent()->get_file_name();
-       return file_name_;
-}
-
-String
-Canvas::get_file_path()const
-{
-       if(parent())
-               return parent()->get_file_path();
-       return dirname(file_name_);
-}
-
-       
-String
-Canvas::get_meta_data(const String& key)const
-{
-       if(!meta_data_.count(key))
-               return String();
-       return meta_data_.find(key)->second;
-}
-
-void
-Canvas::set_meta_data(const String& key, const String& data)
-{
-       if(meta_data_[key]!=data)
-       {
-               meta_data_[key]=data;
-               signal_meta_data_changed()(key);
-               signal_meta_data_changed(key)();
-       }
-}
-
-void
-Canvas::erase_meta_data(const String& key)
-{
-       if(meta_data_.count(key))
-       {
-               meta_data_.erase(key);
-               signal_meta_data_changed()(key);
-               signal_meta_data_changed(key)();
-       }
-}
-
-std::list<String>
-Canvas::get_meta_data_keys()const
-{
-       std::list<String> ret;
-
-       std::map<String,String>::const_iterator iter;
-
-       for(iter=meta_data_.begin();!(iter==meta_data_.end());++iter)
-               ret.push_back(iter->first);
-       
-       return ret;
-}
-
-void
-sinfg::optimize_layers(Context context, Canvas::Handle op_canvas)
-{
-       Context iter;
-
-       std::vector< std::pair<float,Layer::Handle> > sort_list;
-       int i;
-       
-       // Go ahead and start romping through the canvas to paste
-       for(iter=context,i=0;*iter;iter++,i++)
-       {
-               Layer::Handle layer=*iter;
-               float z_depth(layer->get_z_depth()*1.0001+i);
-               
-               // If the layer isn't active, don't worry about it
-               if(!layer->active())
-                       continue;
-
-               // Any layer with an amount of zero is implicitly disabled.
-               ValueBase value(layer->get_param("amount"));
-               if(value.get_type()==ValueBase::TYPE_REAL && value.get(Real())==0)
-                       continue;
-
-               Layer_PasteCanvas* paste_canvas(static_cast<Layer_PasteCanvas*>(layer.get()));
-               if(layer->get_name()=="PasteCanvas" && paste_canvas->get_time_offset()==0)
-               {
-                       Canvas::Handle sub_canvas(Canvas::create_inline(op_canvas));
-                       optimize_layers(paste_canvas->get_sub_canvas()->get_context(),sub_canvas);
-//#define SINFG_OPTIMIZE_PASTE_CANVAS 1
-
-#ifdef SINFG_OPTIMIZE_PASTE_CANVAS                     
-                       Canvas::iterator sub_iter;
-                       // Determine if we can just remove the paste canvas
-                       // altogether                   
-                       if(paste_canvas->get_blend_method()==Color::BLEND_COMPOSITE && paste_canvas->get_amount()==1.0f && paste_canvas->get_zoom()==0 && paste_canvas->get_time_offset()==0 && paste_canvas->get_origin()==Point(0,0))
-                       try{
-                               for(sub_iter=sub_canvas->begin();sub_iter!=sub_canvas->end();++sub_iter)
-                               {
-                                       Layer* layer=sub_iter->get();
-                                       
-                                       // any layers that deform end up breaking things
-                                       // so do things the old way if we run into anything like this
-                                       if(!dynamic_cast<Layer_NoDeform*>(layer))
-                                               throw int();
-
-                                       ValueBase value(layer->get_param("blend_method"));
-                                       if(value.get_type()!=ValueBase::TYPE_INTEGER || value.get(int())!=(int)Color::BLEND_COMPOSITE)
-                                               throw int();
-                               }
-                               
-                               // It has turned out that we don't need a paste canvas
-                               // layer, so just go ahead and add all the layers onto
-                               // the current stack and be done with it
-                               while(sub_canvas->size())
-                               {
-                                       sort_list.push_back(std::pair<float,Layer::Handle>(z_depth,sub_canvas->front()));
-                                       //op_canvas->push_back_simple(sub_canvas->front());
-                                       sub_canvas->pop_front();
-                               }
-                               continue;
-                       }catch(int) { }
-#endif
-                       Layer::Handle new_layer(Layer::create("PasteCanvas"));
-                       dynamic_cast<Layer_PasteCanvas*>(new_layer.get())->set_do_not_muck_with_time(true);
-                       Layer::ParamList param_list(paste_canvas->get_param_list());
-                       //param_list.erase("canvas");
-                       new_layer->set_param_list(param_list);
-                       dynamic_cast<Layer_PasteCanvas*>(new_layer.get())->set_sub_canvas(sub_canvas);
-                       dynamic_cast<Layer_PasteCanvas*>(new_layer.get())->set_do_not_muck_with_time(false);
-                       layer=new_layer;
-               }
-                                                               
-               sort_list.push_back(std::pair<float,Layer::Handle>(z_depth,layer));
-               //op_canvas->push_back_simple(layer);   
-       }
-       
-       //sort_list.sort();
-       stable_sort(sort_list.begin(),sort_list.end());
-       std::vector< std::pair<float,Layer::Handle> >::iterator iter2;
-       for(iter2=sort_list.begin();iter2!=sort_list.end();++iter2)
-               op_canvas->push_back_simple(iter2->second);
-       op_canvas->op_flag_=true;
-}
-
-void
-Canvas::get_times_vfunc(Node::time_set &set) const
-{
-       const_iterator  i = begin(),
-                               iend = end();
-       
-       for(; i != iend; ++i)
-       {
-               const Node::time_set &tset = (*i)->get_times();
-               set.insert(tset.begin(),tset.end());
-       }
-}
-
-std::set<etl::handle<Layer> >
-Canvas::get_layers_in_group(const String&group)
-{
-       if(is_inline() && parent_)
-               return parent_->get_layers_in_group(group);
-
-       if(group_db_.count(group)==0)
-               return std::set<etl::handle<Layer> >();
-       return group_db_.find(group)->second;
-}
-
-std::set<String>
-Canvas::get_groups()const
-{
-       if(is_inline() && parent_)
-               return parent_->get_groups();
-
-       std::set<String> ret;
-       std::map<String,std::set<etl::handle<Layer> > >::const_iterator iter;
-       for(iter=group_db_.begin();iter!=group_db_.end();++iter)
-               ret.insert(iter->first);
-       return ret;
-}
-
-int
-Canvas::get_group_count()const
-{
-       if(is_inline() && parent_)
-               return parent_->get_group_count();
-
-       return group_db_.size();
-}
-       
-void
-Canvas::add_group_pair(String group, etl::handle<Layer> layer)
-{
-       group_db_[group].insert(layer);
-       if(group_db_[group].size()==1)
-               signal_group_added()(group);
-       else
-               signal_group_changed()(group);
-       
-       signal_group_pair_added()(group,layer);
-
-       if(is_inline()  && parent_)
-               return parent_->add_group_pair(group,layer);
-}
-
-void
-Canvas::remove_group_pair(String group, etl::handle<Layer> layer)
-{
-       group_db_[group].erase(layer);
-
-       signal_group_pair_removed()(group,layer);
-
-       if(group_db_[group].empty())
-       {
-               group_db_.erase(group);
-               signal_group_removed()(group);
-       }
-       else
-               signal_group_changed()(group);
-
-       if(is_inline() && parent_)
-               return parent_->remove_group_pair(group,layer);
-}
-
-void
-Canvas::rename_group(const String&old_name,const String&new_name)
-{
-       if(is_inline() && parent_)
-               return parent_->rename_group(old_name,new_name);
-       
-       {
-               std::map<String,std::set<etl::handle<Layer> > >::iterator iter;
-               iter=group_db_.find(old_name);
-               if(iter!=group_db_.end())
-               for(++iter;iter!=group_db_.end() && iter->first.find(old_name)==0;iter=group_db_.find(old_name),++iter)
-               {
-                       String name(iter->first,old_name.size(),String::npos);
-                       name=new_name+name;
-                       rename_group(iter->first,name);
-               }
-       }
-       
-       std::set<etl::handle<Layer> > layers(get_layers_in_group(old_name));
-       std::set<etl::handle<Layer> >::iterator iter;
-       
-       for(iter=layers.begin();iter!=layers.end();++iter)
-       {
-               (*iter)->remove_from_group(old_name);
-               (*iter)->add_to_group(new_name);
-       }
-}
diff --git a/synfig-core/trunk/src/sinfg/canvas.h b/synfig-core/trunk/src/sinfg/canvas.h
deleted file mode 100644 (file)
index 8bd540e..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvas.h
-**     \brief Canvas Class Implementation
-**
-**     $Id: canvas.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_CANVAS_H
-#define __SINFG_CANVAS_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <map>
-#include <list>
-#include <ETL/handle>
-#include <sigc++/signal.h>
-
-#include "vector.h"
-#include "string.h"
-#include "canvasbase.h"
-#include "valuenode.h"
-#include "keyframe.h"
-#include "renddesc.h"
-#include "node.h"
-#include "guid.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Context;
-class GUID;
-       
-/*!    \class Canvas
-**     \todo writeme
-*/
-class Canvas : public CanvasBase, public Node
-{
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public:
-       typedef etl::handle<Canvas> Handle;
-       typedef etl::loose_handle<Canvas> LooseHandle;
-       typedef etl::handle<const Canvas> ConstHandle;
-
-       typedef std::list<Handle> Children;
-
-       friend void sinfg::optimize_layers(Context, Canvas::Handle);
-
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-private:
-
-       //! Contains the ID string for the Canvas
-       /*!     \see get_id(), set_id() */
-       String id_;
-
-       //! Contains the name of the Canvas
-       /*!     \see set_name(), get_name() */
-       String name_;
-
-       //! Contains a description of the Canvas
-       /*!     \see set_description(), get_description() */
-       String description_;
-
-       //! Contains the author's name
-       /*!     \see set_author(), get_author() */
-       String author_;
-
-       //! Contains the author's email address
-       /*!     \todo This private parameter has no binding, so it's unusable at the moment */
-       String email_;
-
-       //! File name of Canvas
-       /*! \see get_file_name(), set_file_name() */
-       String file_name_;
-
-       //! Metadata map for Canvas.
-       /*! \see get_meta_data(), set_meta_data(), erase_meta_data() */
-       std::map<String, String> meta_data_;
-
-       //! Contains a list of ValueNodes that are in this Canvas
-       /*!     \see value_node_list(), find_value_node() */
-       ValueNodeList value_node_list_;
-
-       //! \writeme
-       KeyframeList keyframe_list_;
-
-       //! A handle to the parent canvas of this canvas.
-       /*!     If canvas is a root canvas, then this handle is empty
-       **      \see parent()
-       */
-       LooseHandle parent_;
-
-       //! List containing any child Canvases
-       /*!     \see children() */
-       Children children_;             
-       
-       //! Render Description for Canvas
-       /*!     \see rend_desc() */
-    RendDesc desc_;
-
-       //! Contains the value of the last call to set_time()
-       Time cur_time_;
-
-       //! \writeme
-       mutable std::map<String,Handle> externals_;
-       
-       //! This flag is set if this canvas is "inline"
-       bool is_inline_;
-
-       mutable bool is_dirty_;
-       
-       bool op_flag_;
-       
-       //! Layer Group database
-       std::map<String,std::set<etl::handle<Layer> > > group_db_;      
-
-       /*
- -- ** -- S I G N A L S -------------------------------------------------------
-       */
-
-private:
-
-       //!     Group Added
-       sigc::signal<void,String> signal_group_added_;  
-
-       //!     Group Removed
-       sigc::signal<void,String> signal_group_removed_;        
-       
-       //! Group Changed
-       sigc::signal<void,String> signal_group_changed_;        
-
-       sigc::signal<void,String,etl::handle<sinfg::Layer> > signal_group_pair_added_;
-       sigc::signal<void,String,etl::handle<sinfg::Layer> > signal_group_pair_removed_;
-
-       //!     Layers Reordered
-       sigc::signal<void,int*> signal_layers_reordered_;       
-       
-       //!     RendDesc Changed
-       sigc::signal<void> signal_rend_desc_changed_;   
-       
-       //!     ID Changed
-       sigc::signal<void> signal_id_changed_;  
-
-       //!     Dirty
-       //sigc::signal<void> signal_dirty_;     
-
-       //!     FileName Changed
-       sigc::signal<void> signal_file_name_changed_;   
-
-       //!     Metadata Changed
-       sigc::signal<void, String> signal_meta_data_changed_;   
-
-       //! Key-Specific meta data changed signals
-       std::map<String, sigc::signal<void> > signal_map_meta_data_changed_;
-
-
-       //!     ValueBasenode Changed
-       sigc::signal<void, etl::handle<ValueNode> > signal_value_node_changed_; 
-
-       sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> > signal_value_node_child_added_;     
-
-       sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> > signal_value_node_child_removed_;   
-
-       /*
- -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
-       */
-
-public:
-
-       sigc::signal<void,String,etl::handle<sinfg::Layer> >& signal_group_pair_added() { return signal_group_pair_added_; }
-       sigc::signal<void,String,etl::handle<sinfg::Layer> >& signal_group_pair_removed() { return signal_group_pair_removed_; }
-
-       //!     Group Added
-       sigc::signal<void,String>& signal_group_added() { return signal_group_added_; }
-
-       //!     Group Removed
-       sigc::signal<void,String>& signal_group_removed() { return signal_group_removed_; }
-       
-       //! Group Changed
-       sigc::signal<void,String>& signal_group_changed() { return signal_group_changed_; }
-
-       //!     Layers Reordered
-       sigc::signal<void,int*>& signal_layers_reordered() { return signal_layers_reordered_; }
-       
-       //!     RendDesc Changed
-       sigc::signal<void>& signal_rend_desc_changed() { return signal_rend_desc_changed_; }
-       
-       //!     ID Changed
-       sigc::signal<void>& signal_id_changed() { return signal_id_changed_; }
-
-       //!     File name Changed
-       sigc::signal<void>& signal_file_name_changed();
-       
-       //!     Metadata Changed
-       sigc::signal<void, String>& signal_meta_data_changed() { return signal_meta_data_changed_; }
-
-       //!     Metadata Changed
-       sigc::signal<void>& signal_meta_data_changed(const String& key) { return signal_map_meta_data_changed_[key]; }
-       
-
-       sigc::signal<void, etl::handle<ValueNode> >& signal_value_node_changed() { return signal_value_node_changed_; } 
-
-       //!     Dirty
-       sigc::signal<void>& signal_dirty() { return signal_changed();   }
-
-       //! \writeme
-       sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> >& signal_value_node_child_added() { return signal_value_node_child_added_; }
-
-       //! \writeme
-       sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> >& signal_value_node_child_removed() { return signal_value_node_child_removed_; }
-
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-protected:
-
-       Canvas(const String &name);
-
-public:
-
-       ~Canvas();
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //! Returns the set of layers in group
-       std::set<etl::handle<Layer> > get_layers_in_group(const String&group);
-       
-       //! Gets all the groups
-       std::set<String> get_groups()const;
-       
-       //! Gets the number of groups in this canvas
-       int get_group_count()const;
-
-       //! Renames the given group
-       void rename_group(const String&old_name,const String&new_name);
-
-       //! \writeme
-       bool is_inline()const { return is_inline_; }
-
-       //! Returns a handle to the RendDesc for this Canvas
-       RendDesc &rend_desc() { return desc_; }
-
-       //! Returns a handle to the RendDesc for this Canvas
-       const RendDesc &rend_desc()const { return desc_; }
-
-       //! Gets the name of the canvas
-       const String & get_name()const { return name_; }
-
-       //! Sets the name of the canvas
-       void set_name(const String &x);
-
-       //! Gets the author of the canvas
-       const String & get_author()const { return author_; }
-
-       //! Sets the author of the canvas
-       void set_author(const String &x);
-
-       //! Gets the description of the canvas
-       const String & get_description()const { return description_; }
-
-       //! Sets the name of the canvas
-       void set_description(const String &x);
-
-       //! Gets the ID of the canvas
-       const String & get_id()const { return id_; }
-
-       //! Sets the ID of the canvas
-       void set_id(const String &x);
-       
-       //!     Returns the data string for the given meta data key
-       String get_meta_data(const String& key)const;
-
-       //!     Returns a list of meta data keys
-       std::list<String> get_meta_data_keys()const;
-
-       //! Sets a meta data key to a specific string
-       void set_meta_data(const String& key, const String& data);
-
-       //! Removes a meta data key
-       void erase_meta_data(const String& key);
-
-       //! \writeme
-       String get_relative_id(etl::loose_handle<const Canvas> x)const;
-
-       //! \internal \writeme
-       String _get_relative_id(etl::loose_handle<const Canvas> x)const;
-
-       //! Returns \c true if the Canvas is a root Canvas. \c false otherwise
-       bool is_root()const { return !parent_; }
-
-       //! Returns a handle to the parent Canvas.
-       /*! The returned handle will be empty if this is a root canvas */
-       LooseHandle parent()const { return parent_; }
-
-       LooseHandle get_root()const;
-       
-       //! Returns a list of all child canvases in this canvas
-       std::list<Handle> &children() { return children_; }
-
-       //! Returns a list of all child canvases in this canvas
-       const std::list<Handle> &children()const { return children_; }
-
-       //! Gets the color at the specified point
-       //Color get_color(const Point &pos)const;
-
-       //! Sets the time for all the layers in the canvas
-       void set_time(Time t)const;
-
-       //! \writeme
-       Time get_time()const { return cur_time_; }
-
-       //! Returns the number of layers in the canvas
-       int size()const;
-
-       //! Removes all the layers from the canvas
-       void clear();
-
-       //! Returns true if the canvas has no layers
-       bool empty()const;
-
-       //! Returns a reference to the ValueNodeList for this Canvas
-       // ValueNodeList &value_node_list() { return value_node_list_; }
-
-       //! Returns a reference to the ValueNodeList for this Canvas
-       const ValueNodeList &value_node_list()const;
-
-       //! Returns a reference to the KeyframeList for this Canvas
-       KeyframeList &keyframe_list();
-
-       //! Returns a reference to the KeyframeList for this Canvas
-       const KeyframeList &keyframe_list()const;
-
-       //! Finds the ValueNode in the Canvas with the given \a id
-       /*!     \return If found, returns a handle to the ValueNode.
-       **              Otherwise, returns an empty handle.
-       */
-       ValueNode::Handle find_value_node(const String &id);
-
-       //! \internal \writeme
-       ValueNode::Handle surefind_value_node(const String &id);
-
-       //! Finds the ValueNode in the Canvas with the given \a id
-       /*!     \return If found, returns a handle to the ValueNode.
-       **              Otherwise, returns an empty handle.
-       */
-       ValueNode::ConstHandle find_value_node(const String &id)const;
-
-       //! \writeme
-       void add_value_node(ValueNode::Handle x, const String &id);
-
-       //! \writeme
-       //void rename_value_node(ValueNode::Handle x, const String &id);
-
-       //! \writeme
-       void remove_value_node(ValueNode::Handle x);
-
-       //! \writeme
-       void remove_value_node(const String &id) { remove_value_node(find_value_node(id)); }
-
-       //! Finds a child Canvas in the Canvas with the given \a name
-       /*!     \return If found, returns a handle to the child Canvas.
-       **              If not found, it creates a new Canvas and returns it
-       **              If an error occurs, it returns an empty handle
-       */
-       Handle surefind_canvas(const String &id);
-
-       //! Finds a child Canvas in the Canvas with the given \a id
-       /*!     \return If found, returns a handle to the child Canvas.
-       **              Otherwise, returns an empty handle.
-       */
-       Handle find_canvas(const String &id);
-
-       //! Finds a child Canvas in the Canvas with the given \a id
-       /*!     \return If found, returns a handle to the child Canvas.
-       **              Otherwise, returns an empty handle.
-       */
-       ConstHandle find_canvas(const String &id)const;
-
-       //! Sets the file path for the Canvas
-       //void set_file_path(const String &);
-
-       //! Returns the file path from the file name
-       String get_file_path()const;
-
-       //! Sets the filename (with path)
-       void set_file_name(const String &);
-
-       //! Gets the filename (with path)
-       String get_file_name()const;
-       
-       //! Creates a new child canvas, and returns its handle
-       Handle new_child_canvas();
-
-       //! Creates a new child canvas with an ID of \aid, and returns its handle
-       Handle new_child_canvas(const String &id);
-
-       //! Adds the given canvas as a child
-       Handle add_child_canvas(Handle child_canvas, const String &id);
-
-       void remove_child_canvas(Handle child_canvas);
-
-       etl::handle<Layer> find_layer(const Point &pos);
-
-       int get_depth(etl::handle<Layer>)const;
-
-       Context get_context()const;
-
-       iterator end();
-
-       const_iterator end()const;
-
-       reverse_iterator rbegin();
-
-       const_reverse_iterator rbegin()const;
-
-       etl::handle<Layer> &back();
-       
-       void push_back(etl::handle<Layer> x);
-
-       void push_front(etl::handle<Layer> x);
-
-       void push_back_simple(etl::handle<Layer> x);
-
-       void insert(iterator iter,etl::handle<Layer> x);
-       void erase(iterator iter);
-       
-       const etl::handle<Layer> &back()const;
-
-       void set_inline(LooseHandle parent);
-
-       static Handle create();
-
-       static Handle create_inline(Handle parent);
-       
-       Handle clone(const GUID& deriv_guid=GUID())const;
-
-private:
-       void add_group_pair(String group, etl::handle<Layer> layer);
-       void remove_group_pair(String group, etl::handle<Layer> layer);
-
-protected:
-       virtual void on_changed();
-       virtual void get_times_vfunc(Node::time_set &set) const;
-}; // END of class Canvas
-
-void optimize_layers(Context context, Canvas::Handle op_canvas);
-
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/canvasbase.h b/synfig-core/trunk/src/sinfg/canvasbase.h
deleted file mode 100644 (file)
index 3fc5225..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasbase.h
-**     \brief Template Header
-**
-**     $Id: canvasbase.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_CANVASBASE_H
-#define __SINFG_CANVASBASE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <deque>
-#include <ETL/handle>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-namespace sinfg {
-
-class Layer;
-       
-typedef std::deque< etl::handle< Layer > > CanvasBase;
-       
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/color.cpp b/synfig-core/trunk/src/sinfg/color.cpp
deleted file mode 100644 (file)
index 584bdd5..0000000
+++ /dev/null
@@ -1,521 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file color.h
-**     \brief Color Class
-**
-**     $Id: color.cpp,v 1.2 2005/01/23 04:03:21 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include <ETL/angle>
-#include "color.h"
-#include <cstdio>
-
-#endif
-
-using namespace sinfg;
-using namespace etl;
-using namespace std;
-
-/* === M A C R O S ========================================================= */
-
-#define COLOR_EPSILON  (0.000001f)
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-
-
-#if 0
-Color&
-Color::rotate_uv(const Angle& theta)const
-{
-/*/
-       Color ret(*this);
-       ret.set_hue(ret.get_hue()+theta);
-       return ret;
-/*/
-       const float
-               a(angle::sin(theta).get()),
-               b(angle::cos(theta).get());
-       const float
-               u(get_u()),
-               v(get_v());
-       
-       return set_uv(b*u-a*v,a*u+b*v);
-       //return YUV(get_y(),b*u-a*v,a*u+b*v,get_a());
-//*/
-}
-#endif
-
-Color
-Color::clamped_negative()const
-{
-       Color ret=*this;
-               
-       if(ret.a_==0)
-               return alpha();
-
-       if(ret.a_<0)
-               ret=-ret;
-
-       if(ret.r_<0)
-       {
-               ret.g_-=ret.r_;
-               ret.b_-=ret.r_;
-               ret.r_=0.0f;
-       }
-       if(ret.g_<0)
-       {
-               ret.r_-=ret.g_;
-               ret.b_-=ret.g_;
-               ret.g_=0.0f;
-       }
-       if(ret.b_<0)
-       {
-               ret.r_-=ret.b_;
-               ret.g_-=ret.b_;
-               ret.b_=0.0f;
-       }
-
-       if(ret.r_>1) ret.r_=1;
-       if(ret.g_>1) ret.g_=1;
-       if(ret.b_>1) ret.b_=1;
-       if(ret.a_>1) ret.a_=1;
-
-       if(isnan(ret.get_r())) ret.r_=0.5;
-       if(isnan(ret.get_g())) ret.g_=0.5;
-       if(isnan(ret.get_b())) ret.b_=0.5;
-       if(isnan(ret.get_a())) ret.a_=1;
-
-/*
-       if(ret.r_>1) { ret.g_/=ret.r_; ret.b_/=ret.r_; ret.r_=1; }
-       if(ret.g_>1) { ret.r_/=ret.g_; ret.b_/=ret.g_; ret.g_=1; }
-       if(ret.b_>1) { ret.g_/=ret.b_; ret.r_/=ret.b_; ret.b_=1; }
-       if(ret.a_>1) ret.a_=1;
-*/
-
-       return ret;
-}
-
-Color
-Color::clamped()const
-{
-       Color ret(*this);
-       if(ret.get_r()<0)
-               ret.set_r(0);
-       if(ret.get_g()<0)
-               ret.set_g(0);
-       if(ret.get_b()<0)
-               ret.set_b(0);
-       if(ret.get_a()<0)
-               ret.set_a(0);
-
-       if(ret.r_>1) ret.r_=1;
-       if(ret.g_>1) ret.g_=1;
-       if(ret.b_>1) ret.b_=1;
-       if(ret.a_>1) ret.a_=1;
-
-       if(isnan(ret.get_r())) ret.r_=0.5;
-       if(isnan(ret.get_g())) ret.g_=0.5;
-       if(isnan(ret.get_b())) ret.b_=0.5;
-       if(isnan(ret.get_a())) ret.a_=1;
-
-       return(ret);
-}
-
-typedef Color (*blendfunc)(Color &,Color &,float);
-
-static Color
-blendfunc_COMPOSITE(Color &src,Color &dest,float amount)
-{
-       //c_dest'=c_src+(1.0-a_src)*c_dest
-       //a_dest'=a_src+(1.0-a_src)*a_dest
-
-       float a_src=src.get_a()*amount;
-       float a_dest=dest.get_a();
-
-       // if a_arc==0.0
-       //if(fabsf(a_src)<COLOR_EPSILON) return dest;
-       
-       // Scale the source and destination by their alpha values
-       src*=a_src;
-       dest*=a_dest;
-       
-       dest=src + dest*(1.0f-a_src);
-       
-       a_dest=a_src + a_dest*(1.0f-a_src);
-
-       // if a_dest!=0.0
-       if(fabsf(a_dest)>COLOR_EPSILON)
-       {
-               dest/=a_dest;
-               dest.set_a(a_dest);
-       }
-       else
-       {
-               dest=Color::alpha();
-       }
-       assert(dest.is_valid());
-       return dest;
-}
-
-static Color
-blendfunc_STRAIGHT(Color &src,Color &bg,float amount)
-{
-       //a_out'=(a_src-a_bg)*amount+a_bg
-       //c_out'=(((c_src*a_src)-(c_bg*a_bg))*amount+(c_bg*a_bg))/a_out'
-
-       // ie: if(amount==1.0)
-       //if(fabsf(amount-1.0f)<COLOR_EPSILON)return src;
-
-       Color out;
-       
-       float a_out((src.get_a()-bg.get_a())*amount+bg.get_a());
-       
-       // if a_out!=0.0
-       if(fabsf(a_out)>COLOR_EPSILON)
-//     if(a_out>COLOR_EPSILON || a_out<-COLOR_EPSILON)
-       {
-               out=((src*src.get_a()-bg*bg.get_a())*amount+bg*bg.get_a())/a_out;
-               out.set_a(a_out);
-       }
-       else
-               out=Color::alpha();
-
-       assert(out.is_valid());
-       return out;
-}
-
-static Color
-blendfunc_ONTO(Color &a,Color &b,float amount)
-{
-       float alpha(b.get_a());
-       return blendfunc_COMPOSITE(a,b.set_a(1.0f),amount).set_a(alpha);
-}
-
-static Color
-blendfunc_STRAIGHT_ONTO(Color &a,Color &b,float amount)
-{
-       a.set_a(a.get_a()*b.get_a());
-       return blendfunc_STRAIGHT(a,b,amount);
-}
-
-static Color
-blendfunc_BRIGHTEN(Color &a,Color &b,float amount)
-{
-       const float alpha(a.get_a()*amount);
-       
-       if(b.get_r()<a.get_r()*alpha)
-               b.set_r(a.get_r()*alpha);
-
-       if(b.get_g()<a.get_g()*alpha)
-               b.set_g(a.get_g()*alpha);
-
-       if(b.get_b()<a.get_b()*alpha)
-               b.set_b(a.get_b()*alpha);
-       
-       return b;
-}
-
-static Color
-blendfunc_DARKEN(Color &a,Color &b,float amount)
-{
-       const float alpha(a.get_a()*amount);
-       
-       if(b.get_r()>(a.get_r()-1.0f)*alpha+1.0f)
-               b.set_r((a.get_r()-1.0f)*alpha+1.0f);
-
-       if(b.get_g()>(a.get_g()-1.0f)*alpha+1.0f)
-               b.set_g((a.get_g()-1.0f)*alpha+1.0f);
-
-       if(b.get_b()>(a.get_b()-1.0f)*alpha+1.0f)
-               b.set_b((a.get_b()-1.0f)*alpha+1.0f);
-
-       
-       return b;
-}
-
-static Color
-blendfunc_ADD(Color &a,Color &b,float amount)
-{
-       const float alpha(a.get_a()*amount);
-
-       b.set_r(b.get_r()+a.get_r()*alpha);
-       b.set_g(b.get_g()+a.get_g()*alpha);
-       b.set_b(b.get_b()+a.get_b()*alpha);
-
-       return b;
-}
-
-static Color
-blendfunc_SUBTRACT(Color &a,Color &b,float amount)
-{
-       const float alpha(a.get_a()*amount);
-
-       b.set_r(b.get_r()-a.get_r()*alpha);
-       b.set_g(b.get_g()-a.get_g()*alpha);
-       b.set_b(b.get_b()-a.get_b()*alpha);
-
-       return b;
-}
-
-static Color
-blendfunc_DIFFERENCE(Color &a,Color &b,float amount)
-{
-       const float alpha(a.get_a()*amount);
-
-       b.set_r(abs(b.get_r()-a.get_r()*alpha));
-       b.set_g(abs(b.get_g()-a.get_g()*alpha));
-       b.set_b(abs(b.get_b()-a.get_b()*alpha));
-
-       return b;
-}
-
-static Color
-blendfunc_MULTIPLY(Color &a,Color &b,float amount)
-{
-       if(amount<0) a=~a, amount=-amount;
-
-       amount*=a.get_a();
-       b.set_r(((b.get_r()*a.get_r())-b.get_r())*(amount)+b.get_r());
-       b.set_g(((b.get_g()*a.get_g())-b.get_g())*(amount)+b.get_g());
-       b.set_b(((b.get_b()*a.get_b())-b.get_b())*(amount)+b.get_b());
-       return b;
-}
-
-static Color
-blendfunc_DIVIDE(Color &a,Color &b,float amount)
-{
-       amount*=a.get_a();
-
-       // We add COLOR_EPSILON in order to avoid a divide-by-zero condition.
-       // This causes DIVIDE to bias toward positive values, but the effect is
-       // really neglegable. There is a reason why we use COLOR_EPSILON--we
-       // want the change to be imperceptable.
-       
-       b.set_r(((b.get_r()/(a.get_r()+COLOR_EPSILON))-b.get_r())*(amount)+b.get_r());
-       b.set_g(((b.get_g()/(a.get_g()+COLOR_EPSILON))-b.get_g())*(amount)+b.get_g());
-       b.set_b(((b.get_b()/(a.get_b()+COLOR_EPSILON))-b.get_b())*(amount)+b.get_b());
-
-       return b;
-}
-
-static Color
-blendfunc_COLOR(Color &a,Color &b,float amount)
-{
-       Color temp(b);
-       temp.set_uv(a.get_u(),a.get_v());
-       return (temp-b)*amount*a.get_a()+b;                     
-}
-
-static Color
-blendfunc_HUE(Color &a,Color &b,float amount)
-{
-       Color temp(b);
-       temp.set_hue(a.get_hue());
-       return (temp-b)*amount*a.get_a()+b;
-}
-
-static Color
-blendfunc_SATURATION(Color &a,Color &b,float amount)
-{
-       Color temp(b);
-       temp.set_s(a.get_s());
-       return (temp-b)*amount*a.get_a()+b;
-}
-
-static Color
-blendfunc_LUMINANCE(Color &a,Color &b,float amount)
-{
-       Color temp(b);
-       temp.set_y(a.get_y());
-       return (temp-b)*amount*a.get_a()+b;
-}
-
-static Color
-blendfunc_BEHIND(Color &a,Color &b,float amount)
-{
-       if(a.get_a()==0)a.set_a(COLOR_EPSILON);         //!< \hack
-       a.set_a(a.get_a()*amount);
-       return blendfunc_COMPOSITE(b,a,1.0);
-}
-
-static Color
-blendfunc_ALPHA_BRIGHTEN(Color &a,Color &b,float amount)
-{
-       if(a.get_a()<b.get_a()*amount)
-               return a.set_a(a.get_a()*amount);
-       return b;
-}
-
-static Color
-blendfunc_ALPHA_DARKEN(Color &a,Color &b,float amount)
-{
-       if(a.get_a()*amount>b.get_a())
-               return a.set_a(a.get_a()*amount);
-       return b;
-}
-
-static Color
-blendfunc_SCREEN(Color &a,Color &b,float amount)
-{
-       if(amount<0) a=~a, amount=-amount;
-
-       a.set_r(1.0-(1.0f-a.get_r())*(1.0f-b.get_r()));
-       a.set_g(1.0-(1.0f-a.get_g())*(1.0f-b.get_g()));
-       a.set_b(1.0-(1.0f-a.get_b())*(1.0f-b.get_b()));
-       
-       return blendfunc_ONTO(a,b,amount);
-}
-
-static Color
-blendfunc_OVERLAY(Color &a,Color &b,float amount)
-{      
-       if(amount<0) a=~a, amount=-amount;
-
-       Color rm;
-       rm.set_r(b.get_r()*a.get_r());
-       rm.set_g(b.get_g()*a.get_g());
-       rm.set_b(b.get_b()*a.get_b());
-
-       Color rs;
-       rs.set_r(1.0-(1.0f-a.get_r())*(1.0f-b.get_r()));
-       rs.set_g(1.0-(1.0f-a.get_g())*(1.0f-b.get_g()));
-       rs.set_b(1.0-(1.0f-a.get_b())*(1.0f-b.get_b()));
-
-       Color& ret(a);
-       
-       ret.set_r(a.get_r()*rs.get_r() + (1.0-a.get_r())*rm.get_r());
-       ret.set_g(a.get_g()*rs.get_g() + (1.0-a.get_g())*rm.get_g());
-       ret.set_b(a.get_b()*rs.get_b() + (1.0-a.get_b())*rm.get_b());
-
-       return blendfunc_ONTO(ret,b,amount);
-}
-
-static Color
-blendfunc_HARD_LIGHT(Color &a,Color &b,float amount)
-{
-       if(amount<0) a=~a, amount=-amount;
-
-       if(a.get_r()>0.5f)      a.set_r(1.0-(1.0f-(a.get_r()*2.0f-1.0f))*(1.0f-b.get_r()));
-       else                            a.set_r(b.get_r()*(a.get_r()*2.0f));
-       if(a.get_g()>0.5f)      a.set_g(1.0-(1.0f-(a.get_g()*2.0f-1.0f))*(1.0f-b.get_g()));
-       else                            a.set_g(b.get_g()*(a.get_g()*2.0f));
-       if(a.get_b()>0.5f)      a.set_b(1.0-(1.0f-(a.get_b()*2.0f-1.0f))*(1.0f-b.get_b()));
-       else                            a.set_b(b.get_b()*(a.get_b()*2.0f));
-
-       return blendfunc_ONTO(a,b,amount);
-}
-
-static Color
-blendfunc_ALPHA_OVER(Color &a,Color &b,float amount)
-{
-       Color rm(b);
-
-       //multiply the inverse alpha channel with the one below us
-       rm.set_a((1-a.get_a())*b.get_a());
-
-       return blendfunc_STRAIGHT(rm,b,amount);
-}
-
-
-Color
-Color::blend(Color a, Color b,float amount, Color::BlendMethod type)
-{
-#if 0
-       if(isnan(a.get_r()) || isnan(a.get_g()) || isnan(a.get_b()))
-       {
-#ifdef _DEBUG
-               a=magenta().set_a(a.get_a());
-#else
-               a=black().set_a(a.get_a());
-#endif
-       }
-
-       if(isnan(b.get_r()) || isnan(b.get_g()) || isnan(b.get_b()))
-       {
-#ifdef _DEBUG
-               b=magenta().set_a(b.get_a());
-#else
-               b=black().set_a(b.get_a());
-#endif
-       }
-#endif
-       
-/*
-       if(!a.is_valid()&&b.is_valid())
-               return b;
-
-       if(a.is_valid()&&!b.is_valid())
-               return a;
-
-       if(!a.is_valid()||!b.is_valid())
-       {
-#ifdef _DEBUG
-               return magenta();
-#else
-               return black();
-#endif
-       }
-*/
-       
-       // No matter what blend method is being used,
-       // if the amount is equal to zero, then only B
-       // will shine through
-       if(fabsf(amount)<=COLOR_EPSILON)return b;
-       
-       assert(type<BLEND_END);
-       
-       const static blendfunc vtable[BLEND_END]=
-       {
-               blendfunc_COMPOSITE, 
-               blendfunc_STRAIGHT,
-               blendfunc_BRIGHTEN,
-               blendfunc_DARKEN,
-               blendfunc_ADD,
-               blendfunc_SUBTRACT,
-               blendfunc_MULTIPLY,
-               blendfunc_DIVIDE,
-               blendfunc_COLOR,
-               blendfunc_HUE,
-               blendfunc_SATURATION,
-               blendfunc_LUMINANCE,
-               blendfunc_BEHIND,
-               blendfunc_ONTO,
-               blendfunc_ALPHA_BRIGHTEN,
-               blendfunc_ALPHA_DARKEN,
-               blendfunc_SCREEN,
-               blendfunc_HARD_LIGHT,
-               blendfunc_DIFFERENCE,
-               blendfunc_ALPHA_OVER,
-               blendfunc_OVERLAY,
-               blendfunc_STRAIGHT_ONTO,
-       };
-       
-       return vtable[type](a,b,amount);
-}
diff --git a/synfig-core/trunk/src/sinfg/color.h b/synfig-core/trunk/src/sinfg/color.h
deleted file mode 100644 (file)
index 849acd7..0000000
+++ /dev/null
@@ -1,861 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file color.h
-**     \brief Color Class Implementation
-**
-**     $Id: color.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_COLOR_H
-#define __SINFG_COLOR_H
-
-/* === H E A D E R S ======================================================= */
-
-#ifndef SINFG_NO_ANGLE
-# include "angle.h"
-#endif
-
-//#include <cmath>
-#include <math.h>
-#include <cassert>
-#include "gamma.h"
-#include <string.h>
-
-#ifdef USE_HALF_TYPE
-#include <OpenEXR/half.h>
-#endif
-
-/* === M A C R O S ========================================================= */
-
-#ifndef isnan
-
-#ifdef WIN32
-#include <float.h>
-#ifndef isnan
-extern "C" { int _isnan(double x); }
-#define isnan _isnan
-#endif
-#endif
-
-#ifdef __APPLE__
-#define isnan __isnanf
-#endif
-
-#endif
-
-namespace sinfg {
-
-#ifdef USE_HALF_TYPE
-typedef half ColorReal;
-#else
-typedef float ColorReal;
-#endif
-
-static const float EncodeYUV[3][3]=
-{
-       { 0.299f, 0.587f, 0.114f },
-       { -0.168736f, -0.331264f, 0.5f },
-       { 0.5f, -0.418688f, -0.081312f }
-};
-
-static const float DecodeYUV[3][3]=
-{
-       { 1.0f, 0.0f, 1.402f },
-       { 1.0f, -0.344136f, -0.714136f },
-       { 1.0f, 1.772f, 0.0f }
-};
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-#ifdef USE_HALF_TYPE
-class ColorAccumulator;
-#endif
-
-
-
-
-/*!    \class Color
-**     \todo Writeme
-**     Future optimizations: lookup table for sqrt()?
-*/
-class Color
-{
-public:
-       typedef ColorReal value_type;
-
-private:
-       value_type a_, r_, g_, b_;
-
-public:
-
-       Color &
-       operator+=(const Color &rhs)
-       {
-               r_+=rhs.r_;
-               g_+=rhs.g_;
-               b_+=rhs.b_;
-               a_+=rhs.a_;
-               return *this;
-       }
-
-       Color &
-       operator-=(const Color &rhs)
-       {
-               r_-=rhs.r_;
-               g_-=rhs.g_;
-               b_-=rhs.b_;
-               a_-=rhs.a_;
-               return *this;
-       }
-
-       Color &
-       operator*=(const float &rhs)
-       {
-               r_*=rhs;
-               g_*=rhs;
-               b_*=rhs;
-               a_*=rhs;
-               return *this;
-       }
-
-       Color &
-       operator/=(const float &rhs)
-       {
-               const float temp(value_type(1)/rhs);
-               r_*=temp;
-               g_*=temp;
-               b_*=temp;
-               a_*=temp;
-               return *this;
-       }
-
-       Color
-       operator+(const Color &rhs)const
-       { return Color(*this)+=rhs; }
-
-       Color
-       operator-(const Color &rhs)const
-       { return Color(*this)-=rhs; }
-
-       Color
-       operator*(const float &rhs)const
-       { return Color(*this)*=rhs; }
-
-       Color
-       operator/(const float &rhs)const
-       { return Color(*this)/=rhs; }
-
-       bool
-       operator==(const Color &rhs)const
-       { return r_==rhs.r_ && g_==rhs.g_ && b_==rhs.b_ && a_==rhs.a_; }
-
-       bool
-       operator!=(const Color &rhs)const
-       { return r_!=rhs.r_ || g_!=rhs.g_ || b_!=rhs.b_ || a_!=rhs.a_; }
-
-       Color
-       operator-()const
-       { return Color(-r_,-g_,-b_,-a_); }
-
-       //! Effectively 1.0-color
-       Color
-       operator~()const
-       { return Color(1.0f-r_,1.0f-g_,1.0f-b_,a_); }
-
-       bool is_valid()const
-       { return !isnan(r_) && !isnan(g_) && !isnan(b_) && !isnan(a_); }
-       
-       Color premult_alpha() const
-       {
-               return Color (r_*a_, g_*a_, b_*a_, a_);
-       }
-       
-       Color demult_alpha() const
-       {
-               if(a_)
-               {
-                       const value_type inva = 1/a_;
-                       return Color (r_*inva, g_*inva, b_*inva, a_);
-               }else return alpha();
-       }
-
-public:
-       Color() /*:r_(0), g_(0), b_(0), a_(0)*/ { }
-       Color(const value_type &f) :a_(f),r_(f), g_(f), b_(f) { }
-       Color(int f) :a_(f),r_(f), g_(f), b_(f) { }
-
-       /*!     \param R Red
-       **      \param G Green
-       **      \param B Blue
-       **      \param A Opacity(alpha) */
-       Color(const value_type& R, const value_type& G, const value_type& B, const value_type& A=1):
-               a_(A),
-               r_(R),
-               g_(G),
-               b_(B) { }
-
-       /*!     \param C Source for color components
-       **      \param A Opacity(alpha) */
-       Color(const Color& c, const value_type& A):
-               a_(c.a_),
-               r_(c.r_),
-               g_(c.g_),
-               b_(c.b_) { }
-
-       
-       //!     Copy constructor
-       Color(const Color& c):
-               a_(c.a_),
-               r_(c.r_),
-               g_(c.g_),
-               b_(c.b_) { }
-       
-#ifdef USE_HALF_TYPE
-       friend class ColorAccumulator;
-       //!     Convert constructor
-       Color(const ColorAccumulator& c);
-#endif
-
-       //!     Copy constructor
-       //Color(const Color &c) { memcpy((void*)this, (const void*)&c, sizeof(Color)); }
-
-       /*const Color &operator=(const value_type &i)
-       {
-               r_ = g_ = b_ = a_ = i;
-               return *this;
-       }*/
-       //Color& operator=(const Color &c) { memcpy((void*)this, (const void*)&c, sizeof(Color)); return *this; }
-       
-       //! Returns the RED component
-       const value_type& get_r()const { return r_; }
-
-       //! Returns the GREEN component
-       const value_type& get_g()const { return g_; }
-
-       //! Returns the BLUE component
-       const value_type& get_b()const { return b_; }
-
-       //! Returns the amount of opacity (alpha)
-       const value_type& get_a()const { return a_; }
-       
-       //! Synonym for get_a(). \see get_a()
-       const value_type& get_alpha()const { return get_a(); }
-
-       //! Sets the RED component to \a x
-       Color& set_r(const value_type& x) { r_ = x; return *this; }
-
-       //! Sets the GREEN component to \a x
-       Color& set_g(const value_type& x) { g_ = x; return *this; }
-
-       //! Sets the BLUE component to \a x
-       Color& set_b(const value_type& x) { b_ = x; return *this; }
-
-       //! Sets the opacity (alpha) to \a x
-       Color& set_a(const value_type& x) { a_ = x; return *this; }
-       
-       //! Synonym for set_a(). \see set_a()
-       Color& set_alpha(const value_type& x) { return set_a(x); }
-
-       //! Returns color's luminance
-       float
-       get_y() const
-       {
-               return
-                       (float)get_r()*EncodeYUV[0][0]+
-                       (float)get_g()*EncodeYUV[0][1]+
-                       (float)get_b()*EncodeYUV[0][2];
-       }
-
-       
-       //! Returns U component of chromanance
-       float
-       get_u() const
-       {
-               return
-                       (float)get_r()*EncodeYUV[1][0]+
-                       (float)get_g()*EncodeYUV[1][1]+
-                       (float)get_b()*EncodeYUV[1][2];
-       }
-
-
-       //! Returns V component of chromanance
-       float
-       get_v() const
-       {
-               return
-                       (float)get_r()*EncodeYUV[2][0]+
-                       (float)get_g()*EncodeYUV[2][1]+
-                       (float)get_b()*EncodeYUV[2][2];
-       }
-
-       //! Returns the color's saturation
-       /*!     This is is the magnitude of the U and V components.
-       **      \see set_s() */
-       float
-       get_s() const
-       {
-               const float u(get_u()), v(get_v());
-               return sqrt(u*u+v*v);
-       }
-
-       //! Sets the luminance (\a y) and chromanance (\a u and \a v)
-       Color&
-       set_yuv(const float &y, const float &u, const float &v)
-       {
-               set_r(y*DecodeYUV[0][0]+u*DecodeYUV[0][1]+v*DecodeYUV[0][2]);
-               set_g(y*DecodeYUV[1][0]+u*DecodeYUV[1][1]+v*DecodeYUV[1][2]);
-               set_b(y*DecodeYUV[2][0]+u*DecodeYUV[2][1]+v*DecodeYUV[2][2]);
-               return *this;
-       }
-
-       //! Sets color luminance
-       Color& set_y(const float &y) { return set_yuv(y,get_u(),get_v()); }
-       
-       //! Set U component of chromanance
-       Color& set_u(const float &u) { return set_yuv(get_y(),u,get_v()); }
-       
-       //! Set V component of chromanance
-       Color& set_v(const float &v) { return set_yuv(get_y(),get_u(),v); }
-       
-       //! Set the U and V components of chromanance
-       Color& set_uv(const float& u, const float& v) { return set_yuv(get_y(),u,v); }
-               
-       //! Sets the color's saturation
-       /*!     \see get_s() */
-       Color&
-       set_s(const float &x)
-       {
-               float u(get_u()), v(get_v());
-               const float s(sqrt(u*u+v*v));
-               if(s)   
-               {
-                       u=(u/s)*x;
-                       v=(v/s)*x;
-                       return set_uv(u,v);
-               }
-               return *this;
-       }
-
-       //! YUV Color constructor
-       static Color YUV(const float& y, const float& u, const float& v, const value_type& a=1)
-               { return Color().set_yuv(y,u,v).set_a(a); }
-
-#ifndef SINFG_NO_ANGLE
-       //! Returns the hue of the chromanance
-       /*!     This is the angle of the U and V components.
-       **      \see set_hue() */
-       Angle
-       get_hue() const
-               { return Angle::tan(get_u(),get_v()); }
-
-       //! Synonym for get_hue(). \see get_hue()
-       Angle get_uv_angle() const { return get_hue(); }
-       
-       //! Sets the color's hue
-       /*!     \see get_hue() */
-       Color&
-       set_hue(const Angle& theta)
-       {
-               const float s(get_s());
-               const float
-                       u(s*(float)Angle::sin(theta).get()),
-                       v(s*(float)Angle::cos(theta).get());
-               return set_uv(u,v);
-       }
-
-       //! Synonym for set_hue(). \see set_hue()
-       Color& set_uv_angle(const Angle& theta) { return set_hue(theta); }
-       
-       //! Rotates the chromanance vector by amount specified by \a theta
-       Color& rotate_uv(const Angle& theta)
-       {
-               const float     a(Angle::sin(theta).get()),     b(Angle::cos(theta).get());
-               const float     u(get_u()),     v(get_v());
-               
-               return set_uv(b*u-a*v,a*u+b*v);
-       }
-               
-       //! Sets the luminance (\a y) and chromanance (\a s and \a theta).
-       /*!     \param y Luminance
-       **      \param s Saturation
-       **      \param theta Hue */
-       Color& set_yuv(const float& y, const float& s, const Angle& theta)
-       {
-               return
-                       set_yuv(
-                               y,
-                               s*(float)Angle::sin(theta).get(),
-                               s*(float)Angle::cos(theta).get()
-                       );
-       }
-
-       //! YUV color constructor where the chroma is in the saturation/hue form.
-       /*!     \param y Luminance
-       **      \param s Saturation
-       **      \param theta Hue
-       **      \param a Opacity (alpha) */
-       static Color YUV(const float& y, const float& s, const Angle& theta, const value_type& a=1)
-               { return Color().set_yuv(y,s,theta).set_a(a); }
-
-#endif
-
-       //! Clamps a color so that its values are in range. Ignores attempting to visualize negative colors.
-       Color clamped()const;
-       
-       //! Clamps a color so that its values are in range.
-       Color clamped_negative()const;
-
-       /* Preset Colors */
-
-       //! Preset Color Constructors
-       //@{
-#ifdef HAS_VIMAGE
-       static inline Color alpha() { return Color(0,0,0,0.0000001f); }
-#else
-       static inline Color alpha() { return Color(0,0,0,0); }
-#endif
-       static inline Color black() { return Color(0,0,0); }
-       static inline Color white() { return Color(1,1,1); }
-       static inline Color gray() { return Color(0.5f,0.5f,0.5f); }
-       static inline Color magenta() { return Color(1,0,1); }
-       static inline Color red() { return Color(1,0,0); }
-       static inline Color green() { return Color(0,1,0); }
-       static inline Color blue() { return Color(0,0,1); }
-       static inline Color cyan() { return Color(0,1,1); }
-       static inline Color yellow() { return Color(1,1,0); }
-       //@}
-       
-       //! \writeme
-       enum BlendMethod
-       {
-               BLEND_COMPOSITE=0,      //!< Color A is composited onto B (Taking into about A's alpha)
-               BLEND_STRAIGHT=1,       //!< Straight linear interpolation from A->B (Alpha ignored)
-               BLEND_BRIGHTEN=2,       //!< If composite is brighter than B, use composite. B otherwise.
-               BLEND_DARKEN=3,         //!< If composite is brighter than B, use composite. B otherwise.
-               BLEND_ADD=4,            //!< Simple A+B.
-               BLEND_SUBTRACT=5,       //!< Simple A-B.
-               BLEND_MULTIPLY=6,       //!< Simple A*B.
-               BLEND_DIVIDE=7,         //!< Simple B/A
-               BLEND_COLOR=8,          //!< Preserves the U and V channels of color A
-               BLEND_HUE=9,            //!< Preserves the angle of the UV vector of color A
-               BLEND_SATURATION=10,//!< Preserves the magnitude of the UV Vector of color A
-               BLEND_LUMINANCE=11,     //!< Preserves the Y channel of color A
-               BLEND_BEHIND=12,        //!< Similar to BLEND_COMPOSITE, except that B is composited onto A.
-               BLEND_ONTO=13,          //!< Similar to BLEND_COMPOSITE, except that B's alpha is maintained
-               BLEND_SCREEN=16,                //!< \writeme
-               BLEND_OVERLAY=20,               //!< \writeme
-               BLEND_DIFFERENCE=18,            //!< \writeme
-               BLEND_HARD_LIGHT=17,            //!< \writeme
-               
-               //! Deprecated
-               BLEND_ALPHA_BRIGHTEN=14,        //!< If A is less opaque than B, use A
-               BLEND_ALPHA_DARKEN=15,          //!< If A is more opaque than B, use B
-               BLEND_ALPHA_OVER=19,//!< multiply alphas and then straight blends that using the amount
-               BLEND_STRAIGHT_ONTO=21,//!< \writeme
-               
-               BLEND_END=22                    //!< \internal
-       };
-
-       /* Other */
-       static Color blend(Color a, Color b,float amount,BlendMethod type=BLEND_COMPOSITE);
-       
-       static bool is_onto(BlendMethod x)
-       {
-               return x==BLEND_BRIGHTEN
-                       || x==BLEND_DARKEN
-                       || x==BLEND_ADD
-                       || x==BLEND_SUBTRACT
-                       || x==BLEND_MULTIPLY
-                       || x==BLEND_DIVIDE
-                       || x==BLEND_COLOR
-                       || x==BLEND_HUE
-                       || x==BLEND_SATURATION
-                       || x==BLEND_LUMINANCE
-                       || x==BLEND_ONTO
-                       || x==BLEND_STRAIGHT_ONTO
-                       || x==BLEND_SCREEN
-                       || x==BLEND_OVERLAY
-                       || x==BLEND_DIFFERENCE
-                       || x==BLEND_HARD_LIGHT
-               ;
-       }
-/*protected:
-
-       value_type& operator[](const int i)
-       {
-               assert(i>=0);
-               assert(i<(signed)(sizeof(Color)/sizeof(value_type)));
-               return (&r_)[i];
-       }
-
-       const value_type& operator[](const int i)const
-       {
-               assert(i>=0);
-               assert(i<(signed)(sizeof(Color)/sizeof(value_type)));
-               return (&r_)[i];
-       }
-*/
-}; // END of class Color
-
-#ifndef USE_HALF_TYPE
-typedef Color ColorAccumulator;
-#else
-class ColorAccumulator
-{
-       friend class Color;
-public:
-       typedef float value_type;
-
-private:
-       value_type a_, r_, g_, b_;
-
-public:
-
-       ColorAccumulator &
-       operator+=(const ColorAccumulator &rhs)
-       {
-               r_+=rhs.r_;
-               g_+=rhs.g_;
-               b_+=rhs.b_;
-               a_+=rhs.a_;
-               return *this;
-       }
-
-       ColorAccumulator &
-       operator-=(const ColorAccumulator &rhs)
-       {
-               r_-=rhs.r_;
-               g_-=rhs.g_;
-               b_-=rhs.b_;
-               a_-=rhs.a_;
-               return *this;
-       }
-
-       ColorAccumulator &
-       operator*=(const float &rhs)
-       {
-               r_*=rhs;
-               g_*=rhs;
-               b_*=rhs;
-               a_*=rhs;
-               return *this;
-       }
-
-       ColorAccumulator &
-       operator/=(const float &rhs)
-       {
-               const float temp(value_type(1)/rhs);
-               r_*=temp;
-               g_*=temp;
-               b_*=temp;
-               a_*=temp;
-               return *this;
-       }
-
-       ColorAccumulator
-       operator+(const ColorAccumulator &rhs)const
-       { return Color(*this)+=rhs; }
-
-       ColorAccumulator
-       operator-(const ColorAccumulator &rhs)const
-       { return Color(*this)-=rhs; }
-
-       ColorAccumulator
-       operator*(const float &rhs)const
-       { return Color(*this)*=rhs; }
-
-       ColorAccumulator
-       operator/(const float &rhs)const
-       { return Color(*this)/=rhs; }
-
-       bool
-       operator==(const ColorAccumulator &rhs)const
-       { return r_==rhs.r_ && g_==rhs.g_ && b_==rhs.b_ && a_!=rhs.a_; }
-
-       bool
-       operator!=(const ColorAccumulator &rhs)const
-       { return r_!=rhs.r_ || g_!=rhs.g_ || b_!=rhs.b_ || a_!=rhs.a_; }
-
-       Color
-       operator-()const
-       { return ColorAccumulator(-r_,-g_,-b_,-a_); }
-
-       bool is_valid()const
-       { return !isnan(r_) && !isnan(g_) && !isnan(b_) && !isnan(a_); }
-
-public:
-       ColorAccumulator() { }
-
-       /*!     \param R Red
-       **      \param G Green
-       **      \param B Blue
-       **      \param A Opacity(alpha) */
-       ColorAccumulator(const value_type& R, const value_type& G, const value_type& B, const value_type& A=1):
-               a_(A),
-               r_(R),
-               g_(G),
-               b_(B) { }
-
-       //!     Copy constructor
-       ColorAccumulator(const ColorAccumulator& c):
-               a_(c.a_),
-               r_(c.r_),
-               g_(c.g_),
-               b_(c.b_) { }
-
-       //!     Converter
-       ColorAccumulator(const Color& c):
-               a_(c.a_),
-               r_(c.r_),
-               g_(c.g_),
-               b_(c.b_) { }
-
-       //! Returns the RED component
-       const value_type& get_r()const { return r_; }
-
-       //! Returns the GREEN component
-       const value_type& get_g()const { return g_; }
-
-       //! Returns the BLUE component
-       const value_type& get_b()const { return b_; }
-
-       //! Returns the amount of opacity (alpha)
-       const value_type& get_a()const { return a_; }
-       
-       //! Synonym for get_a(). \see get_a()
-       const value_type& get_alpha()const { return get_a(); }
-
-       //! Sets the RED component to \a x
-       ColorAccumulator& set_r(const value_type& x) { r_ = x; return *this; }
-
-       //! Sets the GREEN component to \a x
-       ColorAccumulator& set_g(const value_type& x) { g_ = x; return *this; }
-
-       //! Sets the BLUE component to \a x
-       ColorAccumulator& set_b(const value_type& x) { b_ = x; return *this; }
-
-       //! Sets the opacity (alpha) to \a x
-       ColorAccumulator& set_a(const value_type& x) { a_ = x; return *this; }
-       
-       //! Synonym for set_a(). \see set_a()
-       ColorAccumulator& set_alpha(const value_type& x) { return set_a(x); }
-};
-
-inline
-Color::Color(const ColorAccumulator& c):
-       a_(c.a_),
-       r_(c.r_),
-       g_(c.g_),
-       b_(c.b_) { }
-
-#endif
-
-
-
-
-
-enum PixelFormat
-{
-/* Bit Descriptions (ON/OFF)
-** ----+-------------
-** 0   Color Channels (Gray/RGB)
-** 1   Alpha Channel (WITH/WITHOUT)
-** 2   ZDepth  (WITH/WITHOUT)
-** 3   Endian (BGR/RGB)
-** 4   Alpha Location (Start/End)
-** 5   ZDepth Location (Start/End)
-** 6   Alpha/ZDepth Arangement (ZA,AZ)
-** 7   Alpha Range (Inverted,Normal)
-** 8   Z Range (Inverted,Normal)
-*/
-       PF_RGB=0,
-       PF_GRAY=(1<<0),                 //!< If set, use one grayscale channel. If clear, use three channels for RGB
-       PF_A=(1<<1),                    //!< If set, include alpha channel
-       PF_Z=(1<<2),                    //!< If set, include ZDepth channel
-       PF_BGR=(1<<3),                  //!< If set, reverse the order of the RGB channels
-       PF_A_START=(1<<4),              //!< If set, alpha channel is before the color data. If clear, it is after.
-       PF_Z_START=(1<<5),              //!< If set, ZDepth channel is before the color data. If clear, it is after.
-       PF_ZA=(1<<6),                   //!< If set, the ZDepth channel will be infront of the alpha channel. If clear, they are reversed.
-
-       PF_A_INV=(1<<7),                //!< If set, the alpha channel is stored as 1.0-a
-       PF_Z_INV=(1<<8),                //!< If set, the ZDepth channel is stored as 1.0-z
-       PF_RAW_COLOR=(1<<9)+(1<<1)      //!< If set, the data represents a raw Color datastructure, and all other bits are ignored.
-};
-
-inline PixelFormat operator|(PixelFormat lhs, PixelFormat rhs)
-       { return static_cast<PixelFormat>((int)lhs|(int)rhs); }
-       
-inline PixelFormat operator&(PixelFormat lhs, PixelFormat rhs)
-       { return static_cast<PixelFormat>((int)lhs&(int)rhs); }
-#define FLAGS(x,y)             (((x)&(y))==(y))
-
-//! Returns the number of channels that the given PixelFormat calls for
-inline int
-channels(PixelFormat x)
-{
-       int chan=0;
-       if(FLAGS(x,PF_GRAY))
-               ++chan;
-       else
-               chan+=3;
-       if(FLAGS(x,PF_A))
-               ++chan;
-       if(FLAGS(x,PF_Z))
-               ++chan;
-       if(FLAGS(x,PF_RAW_COLOR))
-               chan=sizeof(Color);
-               
-       return chan;
-}
-
-inline unsigned char *
-Color2PixelFormat(const Color &color, const PixelFormat &pf, unsigned char *out, const Gamma &gamma)
-{
-       if(FLAGS(pf,PF_RAW_COLOR))
-       {
-               Color *outcol=reinterpret_cast<Color *>(out);
-               *outcol=color;
-               out+=sizeof(color);
-               return out;
-       }
-
-       int alpha=(int)((FLAGS(pf,PF_A_INV)?(-(float)color.get_a()+1):(float)color.get_a())*255);
-       if(alpha<0)alpha=0;
-       if(alpha>255)alpha=255;
-               
-       if(FLAGS(pf,PF_ZA|PF_A_START|PF_Z_START))
-       {
-               if(FLAGS(pf,PF_Z_START))
-                       *out++/*=(unsigned char)(color.GetZ()*255.0f)*/;
-               if(FLAGS(pf,PF_A_START))
-                       *out++=static_cast<unsigned char>(alpha);
-       }
-       else
-       {
-               if(FLAGS(pf,PF_A_START))
-                       *out++=static_cast<unsigned char>(alpha);
-               if(FLAGS(pf,PF_Z_START))
-                       *out++/*=(unsigned char)(color.GetZ()*255.0f)*/;
-               
-       }
-
-       if(FLAGS(pf,PF_GRAY))
-               *out++=static_cast<unsigned char>(gamma.g_F32_to_U8(color.get_y()));
-       else
-       {
-               if(FLAGS(pf,PF_BGR))
-               {
-                       *out++=static_cast<unsigned char>(gamma.r_F32_to_U8(color.get_b()));
-                       *out++=static_cast<unsigned char>(gamma.g_F32_to_U8(color.get_g()));
-                       *out++=static_cast<unsigned char>(gamma.b_F32_to_U8(color.get_r()));
-               }
-               else
-               {
-                       *out++=static_cast<unsigned char>(gamma.r_F32_to_U8(color.get_r()));
-                       *out++=static_cast<unsigned char>(gamma.g_F32_to_U8(color.get_g()));
-                       *out++=static_cast<unsigned char>(gamma.b_F32_to_U8(color.get_b()));
-               }
-       }
-       
-       if(FLAGS(pf,PF_ZA))
-       {
-               if(!FLAGS(pf,PF_Z_START) && FLAGS(pf,PF_Z))
-                       out++;//*out++=(unsigned char)(color.GetZ()*255.0f);
-               if(!FLAGS(pf,PF_A_START) && FLAGS(pf,PF_A))
-                       *out++=static_cast<unsigned char>(alpha);
-       }
-       else
-       {
-               if(!FLAGS(pf,PF_Z_START) && FLAGS(pf,PF_Z))
-                       out++;//*out++=(unsigned char)(color.GetZ()*255.0f);
-               if(!FLAGS(pf,PF_A_START) && FLAGS(pf,PF_A))
-                       *out++=static_cast<unsigned char>(alpha);
-       }
-       return out;
-}
-
-inline void
-convert_color_format(unsigned char *dest, const Color *src, int w, PixelFormat pf,const Gamma &gamma)
-{
-       assert(w>=0);
-       while(w--)
-               dest=Color2PixelFormat((*(src++)).clamped(),pf,dest,gamma);
-}
-
-inline const unsigned char *
-PixelFormat2Color(Color &color, const PixelFormat &pf,const unsigned char *out)
-{
-       if(FLAGS(pf,PF_ZA|PF_A_START|PF_Z_START))
-       {
-               if(FLAGS(pf,PF_Z_START))
-                       out++;//color.SetZ((Color::value_type)*out++/255.0f);
-               if(FLAGS(pf,PF_A_START))
-                       color.set_a((float)*out++/255);
-       }
-       else
-       {
-               if(FLAGS(pf,PF_A_START))
-                       color.set_a((float)*out++/255);
-               if(FLAGS(pf,PF_Z_START))
-                       out++;//color.SetZ((Color::value_type)*out++/255.0f);
-       }
-
-       if(FLAGS(pf,PF_GRAY))
-               color.set_yuv((float)*out++/255,0,0);
-       else
-       {
-               if(FLAGS(pf,PF_BGR))
-               {
-                       color.set_b((float)*out++/255);
-                       color.set_g((float)*out++/255);
-                       color.set_r((float)*out++/255);
-               }
-               else
-               {
-                       color.set_r((float)*out++/255);
-                       color.set_g((float)*out++/255);
-                       color.set_b((float)*out++/255);
-               }
-       }
-       
-       if(FLAGS(pf,PF_ZA))
-       {
-               if(!FLAGS(pf,PF_Z_START) && FLAGS(pf,PF_Z))
-                       out++;//color.SetZ((Color::value_type)*out++/255.0f);
-               if(!FLAGS(pf,PF_A_START) && FLAGS(pf,PF_A))
-                       color.set_a((float)*out++/255);
-       }
-       else
-       {
-               if(!FLAGS(pf,PF_A_START) && FLAGS(pf,PF_A))
-                       color.set_a((float)*out++/255);
-               if(!FLAGS(pf,PF_Z_START) && FLAGS(pf,PF_Z))
-                       out++;//color.SetZ((Color::value_type)*out++/255.0f);
-       }
-       return out;
-}
-
-
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/context.cpp b/synfig-core/trunk/src/sinfg/context.cpp
deleted file mode 100644 (file)
index 617238d..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.cpp
-**     \brief Template File
-**
-**     $Id: context.cpp,v 1.4 2005/01/24 05:00:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "context.h"
-#include "layer.h"
-#include "string.h"
-#include "vector.h"
-#include "color.h"
-#include "surface.h"
-#include "renddesc.h"
-#include "valuenode.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-//#define SINFG_PROFILE_LAYERS
-//#define SINFG_DEBUG_LAYERS
-
-/* === G L O B A L S ======================================================= */
-
-#ifdef SINFG_PROFILE_LAYERS
-#include <ETL/clock>
-static int depth(0);
-static std::map<String,float> time_table;
-static std::map<String,int> run_table;
-static etl::clock profile_timer;
-static String curr_layer;
-static void
-_print_profile_report()
-{
-       sinfg::info(">>>> Profile Report: (Times are in msecs)");
-       std::map<String,float>::iterator iter;
-       float total_time(0);
-       for(iter=time_table.begin();iter!=time_table.end();++iter)
-       {
-               String layer(iter->first);
-               float time(iter->second);
-               int runs(run_table[layer]);
-               total_time+=time;
-               sinfg::info(" Layer \"%s\",\tExecs: %03d, Avg Time: %05.1f, Total Time: %05.1f",layer.c_str(),runs,time/runs*1000,time*1000);
-       }
-       sinfg::info("Total Time: %f seconds", total_time);
-       sinfg::info("<<<< End of Profile Report");
-}
-
-#endif
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Color
-Context::get_color(const Point &pos)const
-{
-       Context context(*this);
-               
-       while(!context->empty())
-       {       
-               // If this layer is active, then go
-               // ahead and break out of the loop
-               if((*context)->active())
-                       break;
-               
-               // Otherwise, we want to keep searching
-               // till we find either an active layer,
-               // or the end of the layer list
-               ++context;
-       }
-
-       // If this layer isn't defined, return alpha
-       if((context)->empty()) return Color::alpha();
-
-       RWLock::ReaderLock lock((*context)->get_rw_lock());
-
-       return (*context)->get_color(context+1, pos);
-}
-
-Rect
-Context::get_full_bounding_rect()const
-{
-       Context context(*this);
-               
-       while(!context->empty())
-       {       
-               // If this layer is active, then go
-               // ahead and break out of the loop
-               if((*context)->active())
-                       break;
-               
-               // Otherwise, we want to keep searching
-               // till we find either an active layer,
-               // or the end of the layer list
-               ++context;
-       }
-
-       if(context->empty())
-               return Rect::zero();
-
-       return (*context)->get_full_bounding_rect(*this+1);
-}
-
-
-/* Profiling will go like this:
-       Profile start = +, stop = -
-
-       +
-       -
-
-       time diff is recorded
-
-       to get the independent times we need to break at the one inside and record etc...
-       so it looks more like this:
-
-       +
-         -
-         +
-               -
-               +
-                       ...
-               -
-               +
-         -
-         +
-       -
-       
-       at each minus we must record all the info for that which we are worried about...
-       each layer can do work before or after the other work is done... so both values must be recorded...
-*/
-
-bool
-Context::accelerated_render(Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb) const
-{
-       #ifdef SINFG_PROFILE_LAYERS
-       String layer_name(curr_layer);
-       
-       //sum the pre-work done by layer above us... (curr_layer is layer above us...)
-       if(depth>0)
-       {
-               time_table[curr_layer]+=profile_timer();
-               //if(run_table.count(curr_layer))run_table[curr_layer]++;
-               //      else run_table[curr_layer]=1;
-       }
-       #endif
-
-       const Rect bbox(renddesc.get_rect());
-       
-       Context context(*this);
-       for(;!(context)->empty();++context)
-       {
-               // If we are not active
-               // then move on to next layer
-               if(!(*context)->active())
-                       continue;
-               
-               const Rect layer_bounds((*context)->get_bounding_rect());
-               
-               // If the box area is less than zero
-               // then move on to next layer
-               if(layer_bounds.area()<=0.0000000000001)
-                       continue;
-               
-               // If the boxes do not intersect
-               // then move on to next layer
-               if(!(layer_bounds && bbox))
-                       continue;
-               
-               // Break out of the loop--we have found a good layer
-               break;
-       }
-
-       // If this layer isn't defined, return alpha
-       if((context)->empty())
-       {
-#ifdef SINFG_DEBUG_LAYERS
-               sinfg::info("Context::accelerated_render(): Hit end of list");
-#endif
-               surface->set_wh(renddesc.get_w(),renddesc.get_h());
-               surface->clear();
-               #ifdef SINFG_PROFILE_LAYERS
-               profile_timer.reset();  
-               #endif
-               return true;
-       }
-
-#ifdef SINFG_DEBUG_LAYERS
-       sinfg::info("Context::accelerated_render(): Descending into %s",(*context)->get_name().c_str());
-#endif
-
-       try {
-               RWLock::ReaderLock lock((*context)->get_rw_lock());
-               
-       #ifdef SINFG_PROFILE_LAYERS
-       
-       //go down one layer :P
-       depth++;
-       curr_layer=(*context)->get_name();      //make sure the layer inside is referring to the correct layer outside
-       profile_timer.reset();                                                                          // +
-       bool ret((*context)->accelerated_render(context+1,surface,quality,renddesc, cb));
-       
-       //post work for the previous layer
-       time_table[curr_layer]+=profile_timer();                                                        //-
-       if(run_table.count(curr_layer))run_table[curr_layer]++;
-               else run_table[curr_layer]=1;
-
-       depth--;
-       curr_layer = layer_name; //we are now onto this layer (make sure the post gets recorded correctly...
-               
-       //print out the table it we're done...
-       if(depth==0) _print_profile_report(),time_table.clear(),run_table.clear();
-       profile_timer.reset();                                                                                          //+
-       return ret;
-       #else
-       return (*context)->accelerated_render(context+1,surface,quality,renddesc, cb);
-       #endif
-
-       }
-       catch(std::bad_alloc)
-       {
-               sinfg::error("Context::accelerated_render(): Layer \"%s\" threw a bad_alloc exception!",(*context)->get_name().c_str());
-#ifdef _DEBUG
-               return false;
-#else
-               ++context;
-               return context.accelerated_render(surface, quality, renddesc, cb);
-#endif
-       }
-       catch(...)
-       {
-               sinfg::error("Context::accelerated_render(): Layer \"%s\" threw an exception, rethrowing...",(*context)->get_name().c_str());
-               throw;          
-       }
-}
-
-void
-Context::set_time(Time time)const
-{
-       Context context(*this);
-       while(!(context)->empty())
-       {       
-               // If this layer is active, then go
-               // ahead and break out of the loop
-               if((*context)->active() && !(*context)->dirty_time_.is_equal(time))
-                       break;
-               
-               // Otherwise, we want to keep searching
-               // till we find either an active layer,
-               // or the end of the layer list
-               ++context;
-       }
-
-       // If this layer isn't defined, just return
-       if((context)->empty()) return;
-
-       // Set up a wrter lock
-       RWLock::WriterLock lock((*context)->get_rw_lock());
-
-       //sinfg::info("%s: dirty_time=%f",(*context)->get_name().c_str(),(float)(*context)->dirty_time_);
-       //sinfg::info("%s: time=%f",(*context)->get_name().c_str(),(float)time);
-
-       {
-               Layer::ParamList params;
-               Layer::DynamicParamList::const_iterator iter;
-               
-               for(iter=(*context)->dynamic_param_list().begin();iter!=(*context)->dynamic_param_list().end();iter++)
-                       params[iter->first]=(*iter->second)(time);
-               
-               (*context)->set_param_list(params);
-
-               (*context)->set_time(context+1,time);
-               (*context)->dirty_time_=time;
-
-       }
-}
-
-void
-Context::set_time(Time time,const Vector &pos)const
-{
-       set_time(time);
-/*
-       Context context(*this);
-       while(!(context)->empty())
-       {       
-               // If this layer is active, then go
-               // ahead and break out of the loop
-               if((*context)->active())
-                       break;
-               
-               // Otherwise, we want to keep searching
-               // till we find either an active layer,
-               // or the end of the layer list
-               ++context;
-       }
-
-       // If this layer isn't defined, just return
-       if((context)->empty()) return;
-
-       else
-       {
-               Layer::ParamList params;
-               Layer::DynamicParamList::const_iterator iter;
-               
-               for(iter=(*context)->dynamic_param_list().begin();iter!=(*context)->dynamic_param_list().end();iter++)
-                       params[iter->first]=(*iter->second)(time);
-               
-               (*context)->set_param_list(params);
-
-               (*context)->set_time(context+1,time,pos);
-       }
-*/
-}
-
-etl::handle<Layer>
-Context::hit_check(const Point &pos)const
-{
-       Context context(*this);
-       
-       while(!context->empty())
-       {       
-               // If this layer is active, then go
-               // ahead and break out of the loop
-               if((*context)->active())
-                       break;
-               
-               // Otherwise, we want to keep searching
-               // till we find either an active layer,
-               // or the end of the layer list
-               ++context;
-       }
-
-       // If this layer isn't defined, return an empty handle
-       if((context)->empty()) return 0;
-
-       return (*context)->hit_check(context+1, pos);
-}
diff --git a/synfig-core/trunk/src/sinfg/context.h b/synfig-core/trunk/src/sinfg/context.h
deleted file mode 100644 (file)
index a3a6c3f..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file context.h
-**     \brief Template Header
-**
-**     $Id: context.h,v 1.2 2005/01/24 03:08:17 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_CONTEXT_H
-#define __SINFG_CONTEXT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "canvasbase.h"
-#include "rect.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Vector;
-typedef Vector Point;
-class Color;
-class Surface;
-class RendDesc;
-class ProgressCallback;
-class Layer;
-class Time;
-class Rect;
-       
-/*!    \class Context
-**     \todo writeme
-**     \see Layer, Canvas */
-class Context : public CanvasBase::const_iterator
-{
-public:
-       Context() { }
-
-       Context(const CanvasBase::const_iterator &x):CanvasBase::const_iterator(x) { }
-
-       Context operator=(const CanvasBase::const_iterator &x)
-       { return CanvasBase::const_iterator::operator=(x); }
-       
-       /*!     \todo write me */
-       Color get_color(const Point &pos)const;
-
-       /*!     \todo write me */
-       bool accelerated_render(Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb) const;
-
-       /*!     \todo write me */
-       void set_time(Time time)const;
-
-       /*!     \writeme */
-       void set_time(Time time,const Vector &pos)const;
-
-       Rect get_full_bounding_rect()const;
-
-       /*! \writeme */
-       virtual etl::handle<Layer> hit_check(const Point &point)const;
-
-}; // END of class Context
-       
-}; // END of namespace sinfg
-       
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/curve_helper.cpp b/synfig-core/trunk/src/sinfg/curve_helper.cpp
deleted file mode 100644 (file)
index 62023f8..0000000
+++ /dev/null
@@ -1,703 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file curve_helper.cpp
-**     \brief Curve Helper File
-**
-**     $Id: curve_helper.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "curve_helper.h"
-
-#include <algorithm>
-#include <vector>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-#define ERR    1e-11
-const Real ERROR = 1e-11;
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-/* === E N T R Y P O I N T ================================================= */
-
-Real sinfg::find_closest(const etl::bezier<Point> &curve, const Point &point, 
-                               float step, Real *dout, float *tout)
-{
-#if 0
-       float time(curve.find_closest(point,4));
-       Real dist((curve(time)-point).mag());
-       if(dout) *dout=dist;
-       if(tout) *tout=time;
-       return time;
-#else  
-       Real d,closest = 1.0e50;
-       float t,time,closestt = -1;     
-       Vector p0,p1,end;
-       
-       if(dout && *dout > 0)
-               closest = *dout;
-
-       p0 = curve[0];
-       end = curve[3];
-
-       for(t = step; t < 1; t+=step, p0=p1)
-       {
-               p1 = curve(t);
-               d = line_point_distsq(p0,p1,point,time);
-               
-               if(d<closest)
-               {
-                       closest=d;
-                       closestt = t-step + time*step;//t+(time-1)*step; //time between [t-step,t]
-               }
-       }
-       
-       d = line_point_distsq(p0,end,point,time);
-       if(d<closest)
-       {
-               closest = d;
-               closestt= t-step + time*(1-t+step); //time between [t-step,1.0]
-       }
-
-       //set the time value if we found a closer point
-       if(closestt >=0)
-       {
-               if(tout) *tout = closestt;
-       }
-               
-       return closest;
-#endif
-}
-
-// Line and BezHull Definitions
-void BezHull::Bound(const etl::bezier<Point> &b)
-{
-       #if 1
-       
-       //with a starting vertex, find the only vertex that has all other vertices on it's right        
-       int i,j;
-       int first,cur,last;
-       
-       float d,ds;
-       
-       Vector n,vi;
-       Vector::value_type      deqn;
-       
-       //get left most vertex
-       d = b[0][0];
-       first = 0;
-       for(i = 1; i < 4; ++i)
-       {
-               if(b[i][0] < d)
-               {
-                       d = b[i][0];
-                       first = i;                      
-               }
-       }
-       cur = last = first;
-       size = 0;
-       
-       //find the farthest point with all points on right
-       ds = 0;
-       do //should reassign cur so it won't break on first step
-       {               
-               for(i = 0; i < 4; ++i)
-               {
-                       if(i == cur || i == last) continue;
-                       
-                       //rotate vector to right to make normal
-                       vi = -(b[i] - b[cur]).perp();
-                       d = vi.mag_squared();
-                       
-                       //we want only the farthest (solves the case with many points on a line)
-                       if(d > ds)
-                       {
-                               ds = d;
-                               deqn = n*b[cur];
-                               for(j = 0; j < 4; ++j)
-                               {
-                                       d = n*b[i] - deqn;
-                                       if(d < 0) break; //we're on left, nope!
-                               }
-                               
-                               //everyone is on right... yay! :)
-                               if(d >= 0)
-                               {
-                                       //advance point and add last one into hull
-                                       p[size++] = p[last];
-                                       last = cur;
-                                       cur = i;                                        
-                               }
-                       }
-               }
-       }while(cur != first);
-       
-       #else
-
-       //will work but does not keep winding order
-       
-       //convex hull alg.
-       //build set of line segs which have no points on other side...
-       //start with initial normal segments
-       
-       //start with single triangle
-       p[0] = b[0];
-       p[1] = b[1];
-       p[2] = b[2];
-       p[3] = b[3];
-       
-       //initial reject (if point is inside triangle don't care)
-       {
-               Vector v1,v2,vp;
-               
-               v1 = p[1]-p[0];
-               v2 = p[2]-p[0];
-               
-               vp = p[3]-p[0];
-
-               float   s = (vp*v1) / (v1*v1),
-                               t = (vp*v2) / (v2*v2);
-               
-               //if we're inside the triangle we don't this sissy point
-               if( s >= 0 && s <= 1 && t >= 0 && t <= 1 )
-               {
-                       size = 3;
-                       return;
-               }                       
-       }
-       
-       //expand triangle based on info...
-       bool line;
-       int index,i,j;
-       float ds,d;
-       
-       //distance from point to vertices
-       line = false;
-       index = 0;
-       ds = (p[0]-b[3]).mag_squared();
-       for(i = 1; i < 3; ++i)
-       {
-               d = (p[3]-p[i]).mag_squared();
-               if(d < ds)
-               {
-                       index = i;
-                       ds = d;                 
-               }
-       }
-       
-       //distance to line
-       float t;
-       j = 2;
-       for(i = 0; i < 3; j = i++)
-       {
-               d = line_point_distsq(p[j],p[i],b[4],t);
-               if(d < ds)
-               {
-                       index = j;
-                       ds = d;
-                       line = true;
-               }
-       }
-       
-       //We don't need no stinkin extra vertex, just replace
-       if(!line)
-       {
-               p[index] = p[3];
-               size = 3;
-       }else
-       {
-               //must expand volume to work with point...
-               //      after the index then
-               
-               /* Pattern:
-                       0 - push 1,2 -> 2,3
-                       1 - push 2 -> 3
-                       2 - none
-               */
-               for(i = 3; i > index+1; --i)
-               {
-                       p[i] = p[i-1];
-               }
-               
-               p[index] = b[3]; //recopy b3
-               size = 4;
-       }
-       
-       #endif
-}
-
-//Line Intersection
-int 
-sinfg::intersect(const Point &p1, const Vector &v1, float &t1, 
-                                       const Point &p2, const Vector &v2, float &t2)
-{
-       /* Parametric intersection:
-               l1 = p1 + tv1, l2 = p2 + sv2
-       
-               0 = p1+tv1-(p2+sv2)
-               group parameters: sv2 - tv1 = p1-p2
-       
-               ^ = transpose
-               invert matrix (on condition det != 0):
-               A[t s]^ = [p1-p2]^
-               
-               A = [-v1 v2]
-       
-               det = v1y.v2x - v1x.v2y
-       
-               if non 0 then A^-1 = invdet * | v2y -v2x |
-                                                                         | v1y -v1x |
-               
-               [t s]^ = A^-1 [p1-p2]^
-       */      
-       
-       Vector::value_type det = v1[1]*v2[0] - v1[0]*v2[1];
-       
-       //is determinant valid?
-       if(det > ERR || det < -ERR)
-       {
-               Vector p_p = p1-p2;
-                               
-               det = 1/det;
-               
-               t1 = det*(v2[1]*p_p[0] - v2[0]*p_p[1]);
-               t2 = det*(v1[1]*p_p[0] - v1[0]*p_p[1]);
-               
-               return 1;
-       }
-       
-       return 0;
-}
-
-//Returns the true or false intersection of a rectangle and a line
-int intersect(const Rect &r, const Point &p, const Vector &v)
-{
-       float t[4] = {0};
-       
-       /*get horizontal intersections and then vertical intersections 
-               and intersect them 
-       
-               Vertical planes - n = (1,0)
-               Horizontal planes - n = (0,1)
-
-               so if we are solving for ray with implicit line 
-       */
-       
-       //solve horizontal      
-       if(v[0] > ERR || v[0] < -ERR)
-       {
-               //solve for t0, t1
-               t[0] = (r.minx - p[0])/v[0];
-               t[1] = (r.maxx - p[0])/v[0];
-       }else
-       {
-               return (int)(p[1] >= r.miny && p[1] <= r.maxy);
-       }
-       
-       //solve vertical
-       if(v[1] > ERR || v[1] < -ERR)
-       {
-               //solve for t0, t1
-               t[2] = (r.miny - p[1])/v[1];
-               t[3] = (r.maxy - p[1])/v[1];
-       }else
-       {
-               return (int)(p[0] >= r.minx && p[0] <= r.maxx);
-       }
-
-       return (int)(t[0] <= t[3] && t[1] >= t[2]);
-}
-
-int sinfg::intersect(const Rect &r, const Point &p)
-{
-       return (p[1] < r.maxy && p[1] > r.miny) && p[0] > r.minx;
-}
-
-//returns 0 or 1 for true or false number of intersections of a ray with a bezier convex hull
-int intersect(const BezHull &bh, const Point &p, const Vector &v)
-{
-       float mint = 0, maxt = 1e20;
-
-       //polygon cliping
-       Vector n;
-       Vector::value_type      nv;
-       
-       Point last = bh.p[3];
-       for(int i = 0; i < bh.size; ++i)
-       {
-               n = (bh.p[i] - last).perp(); //rotate 90 deg.
-               
-               /*
-                       since rotated left
-                       if n.v  < 0 - going in
-                                       > 0 - going out
-                                       = 0 - parallel
-               */
-               nv = n*v;
-
-               //going OUT
-               if(nv > ERR)
-               {
-                       maxt = min(maxt,(float)((n*(p-last))/nv));
-               }else 
-               if( nv < -ERR) //going IN
-               {
-                       mint = max(mint,(float)((n*(p-last))/nv));
-               }else
-               {
-                       if( n*(p-last) > 0 ) //outside entirely
-                       {
-                               return 0;
-                       }
-               }
-               
-               last = bh.p[i];
-       }
-       
-       return 0;
-}
-
-int Clip(const Rect &r, const Point &p1, const Point &p2, Point *op1, Point *op2)
-{
-       float t1=0,t2=1;
-       Vector v=p2-p1;
-       
-       /*get horizontal intersections and then vertical intersections 
-               and intersect them 
-       
-               Vertical planes - n = (1,0)
-               Horizontal planes - n = (0,1)
-
-               so if we are solving for ray with implicit line 
-       */
-       
-       //solve horizontal
-       if(v[0] > ERR || v[0] < -ERR)
-       {
-               //solve for t0, t1
-               float   tt1 = (r.minx - p1[0])/v[0],
-                               tt2 = (r.maxx - p1[0])/v[0];
-               
-               //line in positive direction (normal comparisons
-               if(tt1 < tt2)
-               {
-                       t1 = max(t1,tt1);
-                       t2 = min(t2,tt2);
-               }else
-               {
-                       t1 = max(t1,tt2);
-                       t2 = min(t2,tt1);
-               }
-       }else
-       {
-               if(p1[1] < r.miny || p1[1] > r.maxy)
-                       return 0;
-       }
-       
-       //solve vertical
-       if(v[1] > ERR || v[1] < -ERR)
-       {
-               //solve for t0, t1
-               float   tt1 = (r.miny - p1[1])/v[1],
-                               tt2 = (r.maxy - p1[1])/v[1];
-               
-               //line in positive direction (normal comparisons
-               if(tt1 < tt2)
-               {
-                       t1 = max(t1,tt1);
-                       t2 = min(t2,tt2);
-               }else
-               {
-                       t1 = max(t1,tt2);
-                       t2 = min(t2,tt1);
-               }
-       }else
-       {
-               if(p1[0] < r.minx || p1[0] > r.maxx)
-                       return 0;
-       }
-
-       if(op1) *op1 = p1 + v*t1;
-       if(op2) *op2 = p1 + v*t2;
-               
-       return 1;
-}
-
-static void clean_bez(const bezier<Point> &b, bezier<Point> &out)
-{
-       bezier<Point> temp;
-
-       temp = b;       
-       temp.set_r(0);
-       temp.set_s(1);
-       
-       if(b.get_r() != 0)
-               temp.subdivide(0,&temp,b.get_r());
-       
-       if(b.get_s() != 1)
-               temp.subdivide(&temp,0,b.get_s());
-       
-       out = temp;
-}
-
-// CIntersect Definitions
-
-CIntersect::CIntersect()
-       : max_depth(10) //depth of 10 means timevalue parameters will have an approx. error bound of 2^-10
-{
-} 
-
-struct CIntersect::SCurve
-{
-       bezier<Point>   b;              //the current subdivided curve
-       float rt,st;
-       //float                         mid,    //the midpoint time value on this section of the subdivided curve
-       //                              scale;  //the current delta in time values this curve would be on original curve
-       
-       float   mag;                    //approximate sum of magnitudes of each edge of control polygon
-       Rect    aabb;                   //Axis Aligned Bounding Box for quick (albeit less accurate) collision
-
-       SCurve() {}
-
-       SCurve(const bezier<Point> &c,float rin, float sin)
-       :b(c),rt(rin),st(sin),mag(1) 
-       {
-               Bound(aabb,b);
-       }
-       
-       void Split(SCurve &l, SCurve &r) const
-       {
-               b.subdivide(&l.b,&r.b);
-               
-               l.rt = rt;
-               r.st = st;
-               l.st = r.rt = (rt+st)/2;
-
-               Bound(l.aabb,l.b);
-               Bound(r.aabb,r.b);
-       }
-};
-
-//Curve to the left of point test
-static int recurse_intersect(const CIntersect::SCurve &b, const Point &p1, int depthleft = 10)
-{
-       //reject when the line does not intersect the bounding box
-       if(!intersect(b.aabb,p1)) return 0;
-
-       //accept curves (and perform super detailed check for intersections)
-       //if the values are below tolerance
-       
-       //NOTE FOR BETTERING OF ALGORITHM: SHOULD ALSO/IN-PLACE-OF CHECK MAGNITUDE OF EDGES (or approximate)
-       if(depthleft <= 0)
-       {
-               //NOTE FOR IMPROVEMENT: Polish roots based on original curve
-               //                                              (may be too expensive to be effective)
-               int turn = 0;
-
-               for(int i = 0; i < 3; ++i)
-               {
-                       //intersect line segmentsssss
-                       
-                       //solve for the y_value
-                       Vector v = b.b[i+1] - b.b[i];
-
-                       if(v[1] > ERROR && v[1] < ERROR)
-                       {
-                               Real xi = (p1[1] - b.b[i][1])/v[1];
-       
-                               //and add in the turn (up or down) if it's valid                                
-                               if(xi < p1[0]) turn += (v[1] > 0) ? 1 : -1;
-                       }
-               }
-               
-               return turn;
-       }
-       
-       //subdivide the curve and continue
-       CIntersect::SCurve l1,r1;
-       b.Split(l1,r1); //subdivide left
-       
-       //test each subdivision against the point
-       return recurse_intersect(l1,p1) + recurse_intersect(r1,p1);
-}
-
-int intersect(const bezier<Point> &b, const Point &p)
-{
-       CIntersect::SCurve      sb;
-       clean_bez(b,sb.b);
-
-       sb.rt = 0; sb.st = 1;
-       sb.mag = 1; Bound(sb.aabb,sb.b);
-       
-       return recurse_intersect(sb,p); 
-}
-
-//Curve curve intersection
-void CIntersect::recurse_intersect(const SCurve &left, const SCurve &right, int depth)
-{      
-       //reject curves that do not overlap with bouding boxes
-       if(!intersect(left.aabb,right.aabb)) return;
-
-       //accept curves (and perform super detailed check for intersections)
-       //if the values are below tolerance
-       
-       //NOTE FOR BETTERING OF ALGORITHM: SHOULD ALSO/IN-PLACE-OF CHECK MAGNITUDE OF EDGES (or approximate)
-       if(depth >= max_depth)
-       {
-               //NOTE FOR IMPROVEMENT: Polish roots based on original curve with the Jacobian
-               //                                              (may be too expensive to be effective)
-               
-               //perform root approximation
-               //collide line segments
-               
-               float t,s;
-
-               for(int i = 0; i < 3; ++i)
-               {
-                       for(int j = 0; j < 3; ++j)
-                       {
-                               //intersect line segmentsssss
-                               if(intersect_line_segments(left.b[i],left.b[i+1],t,right.b[j],right.b[j+1],s))
-                               {
-                                       //We got one Jimmy
-                                       times.push_back(intersect_set::value_type(t,s));
-                               }                                       
-                       }
-               }                       
-               
-               return;
-       }
-       
-       //NOTE FOR IMPROVEMENT: only subdivide one curve and choose the one that has 
-       //                                              the highest approximated length
-       //fast approximation to curve length may be hard (accurate would 
-       // involve 3 square roots), could sum the squares which would be 
-       // quick but inaccurate
-       
-       SCurve l1,r1,l2,r2;     
-       left.Split(l1,r1);      //subdivide left
-       right.Split(l2,r2); //subdivide right
-       
-       //Test each cantidate against eachother
-       recurse_intersect(l1,l2);
-       recurse_intersect(l1,r2);
-       recurse_intersect(r1,l2);
-       recurse_intersect(r1,r2);
-}
-
-
-
-bool CIntersect::operator()(const bezier<Point> &c1, const bezier<Point> &c2)
-{
-       times.clear();
-       
-       //need to subdivide and check recursive bounding regions against eachother
-       //so track a list of dirty curves and compare compare compare
-       
-       
-       //temporary curves for subdivision
-       CIntersect                      intersector;
-       CIntersect::SCurve      left,right;
-       
-       //Make sure the parameters are normalized (so we don't compare unwanted parts of the curves, 
-       //      and don't miss any for that matter)
-       
-       //left curve
-       //Compile information about curve
-       clean_bez(c1,left.b);
-       left.rt = 0; left.st = 1;
-       Bound(left.aabb, left.b);
-       
-       //right curve
-       //Compile information about right curve
-       clean_bez(c2,right.b);
-       right.rt = 0; right.st = 1;
-       Bound(right.aabb, right.b);
-       
-       //Perform Curve intersection
-       intersector.recurse_intersect(left,right);
-       
-       //Get information about roots (yay! :P)
-       return times.size() != 0;
-}
-
-//point inside curve - return +/- hit up or down edge
-int intersect_scurve(const CIntersect::SCurve &b, const Point &p)
-{
-       //initial reject/approve etc.
-       
-       /*      
-                       *-----------*---------
-                       |                       |
-                       |                       |
-                       |                       |
-                       |         1             |    2
-                       |                       |       
-                       |                       |
-                       |                       |
-                       |                       |
-                       *-----------*--------
-               1,2 are only regions not rejected
-       */
-       if(p[0] < b.aabb.minx || p[1] < b.aabb.miny || p[1] > b.aabb.maxy)
-               return 0;
-       
-       //approve only if to the right of rect around 2 end points
-       {
-               Rect    r;
-               r.set_point(b.b[0][0],b.b[0][1]);
-               r.expand(b.b[3][0],b.b[3][1]);
-               
-               if(p[0] >= r.maxx && p[1] <= r.maxy && p[1] >= r.miny)
-               {
-                       float df = b.b[3][1] - b.b[0][1];
-                       
-                       return df >= 0 ? 1 : -1;
-               }
-       }
-       
-       //subdivide and check again!
-       CIntersect::SCurve      l,r;
-       b.Split(l,r);
-       return  intersect_scurve(l,p) + intersect_scurve(r,p);
-}
-
-int sinfg::intersect(const bezier<Point> &b, const Point &p)
-{
-       CIntersect::SCurve      c(b,0,1);
-       
-       return intersect_scurve(c,p);
-}
diff --git a/synfig-core/trunk/src/sinfg/curve_helper.h b/synfig-core/trunk/src/sinfg/curve_helper.h
deleted file mode 100644 (file)
index 3c4bd68..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file curve_helper.h
-**     \brief Curve Helper Header
-**
-**     $Id: curve_helper.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_CURVE_HELPER_H
-#define __SINFG_CURVE_HELPER_H
-
-/* === H E A D E R S ======================================================= */
-#include <ETL/bezier>
-
-#include "rect.h"
-#include "real.h"
-#include "vector.h"
-
-#include <vector>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-//line helper functions
-inline Real line_point_distsq(const Point &p1, const Point &p2, 
-                                                                               const Point &p, float &t)
-{
-       Vector v,vt;
-       
-       v = p2 - p1;
-       vt = p - p1;
-       
-       t = v.mag_squared() > 1e-12 ? (vt*v)/v.mag_squared() : 0; //get the projected time value for the current line
-       
-       //get distance to line segment with the time value clamped 0-1                  
-       if(t >= 1)      //use p+v
-       {
-               vt += v; //makes it pp - (p+v)  
-               t = 1;
-       }else if(t > 0) //use vt-proj
-       {
-               vt -= v * t; // vt - proj_v(vt) //must normalize the projection vector to work
-       }else
-       {
-               t = 0;
-       }
-       
-       //else use p
-       return vt.mag_squared();
-}
-
-
-//----- RAY CLASS AND FUNCTIONS --------------
-struct Ray
-{
-       Point   p;
-       Vector  v;
-       
-       Ray() {}
-       Ray(const Point &pin, const Vector &vin):p(pin), v(vin) {}
-};
-
-/* This algorithm calculates the INTERSECTION of 2 line segments 
-       (not the closest point or anything like that, just intersection)
-       //parameter values returned are [0,1]
-*/
-int intersect(const Point &p1, const Vector &v1, float &t1, 
-                               const Point &p2, const Vector &v2, float &t2);
-
-inline bool intersect_line_segments(const Point &a, const Point &b, float &tout,
-                                                                               const Point &c, const Point &d, float &sout)
-{
-       Vector v1(b-a), v2(d-c);
-               
-       //ok so treat both lines as parametric (so we can find the time values simultaneously)
-       float t,s;
-
-       if( intersect(a,v1,t, b,v2,s) && t >= 0 && t <= 1 && s >= 0 && s <= 1 )
-       {
-               tout = t;
-               sout = s;
-               return true;
-       }
-       
-       return false;   
-}
-
-//Find the closest point on the curve to a point (and return it's distance, and time value)
-Real find_closest(const etl::bezier<Point> &curve, const Point &point, float step, Real *closest, float *t);
-
-//----------- Rectangle helper functions ---------------
-
-template < typename T >
-inline void Bound(etl::rect<T> &r, const etl::bezier<Point> &b)
-{
-       r.set_point(b[0][0],b[0][1]);
-       r.expand(b[1][0],b[1][1]);
-       r.expand(b[2][0],b[2][1]);
-       r.expand(b[3][0],b[3][1]);
-}
-
-/*template < typename T >
-inline bool intersect(const etl::rect<T> &r1, const etl::rect<T> &r2)
-{
-       return (r1.minx < r2.maxx) &
-                       (r2.minx < r1.maxx) &
-                       (r1.miny < r2.maxy) &
-                       (r2.miny < r1.maxy);                    
-}*/
-
-//----- Convex Hull of a Bezier Curve --------------
-struct BezHull
-{
-       Point   p[4];   
-       int             size;
-       
-       void Bound(const etl::bezier<Point> &b);
-};
-
-//Line Intersection
-int intersect(const Rect &r1, const Point &p, const Vector &v);
-int intersect(const Rect &r1, const Point &p); //inside or to the right
-int intersect(const BezHull &bh, const Point &p, const Vector &v);
-//int intersect(const etl::bezier<Point> &b, const Point &p, const Vector &v);
-int intersect(const etl::bezier<Point> &b, const Point &p); //for use in containment tests for regions
-
-//Curve intersection object
-class CIntersect
-{
-public:
-       struct SCurve;
-private:
-       void recurse_intersect(const SCurve &left, const SCurve &right, int depth = 0);
-       
-public:
-       //size should be equal
-       typedef std::vector< std::pair<float,float > >  intersect_set;
-       intersect_set   times;
-
-       int             max_depth;
-
-       CIntersect();
-
-       bool operator()(const etl::bezier<Point> &b1, const etl::bezier<Point> &b2);
-};
-
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/curveset.cpp b/synfig-core/trunk/src/sinfg/curveset.cpp
deleted file mode 100644 (file)
index 1ff5455..0000000
+++ /dev/null
@@ -1,482 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file curveset.cpp
-**     \brief Curve Set Implementation File
-**
-**     $Id: curveset.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "curve_helper.h"
-#include "curveset.h"
-#include "blinepoint.h"
-#include <ETL/bezier>
-#include <vector>
-#include <list>
-#include <set>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-const Real ERROR = 1e-10;
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-/* === E N T R Y P O I N T ================================================= */
-template < typename T >
-inline bool Zero(const T &a, const T &tol = (T)ERROR)
-{
-       return a < tol && a > -tol;
-}
-
-CurvePoint::CurvePoint(const Point &pin, const Vector &left, const Vector &right)
-:p(pin),l(left),r(right)
-{
-}
-
-CurvePoint::CurvePoint(const BLinePoint &bpoint)
-{
-       p = bpoint.get_vertex();
-       
-       l = p + bpoint.get_tangent1()*(1/3.0f);
-       r = p + bpoint.get_tangent2()*(1/3.0f);
-}
-
-struct ipoint
-{
-       int     curveindex;
-       int             vertindex;
-       float   tvalue;
-       
-       ipoint  *next;
-       ipoint  *prev;
-       ipoint  *neighbor;
-       
-       int     go_in;  //going in = 1, coming out = -1
-       
-       ipoint()
-       {
-               next = this;
-               prev = this;
-               neighbor = 0;
-       }
-       
-       bool operator<(const ipoint &rhs) const
-       {
-               if(curveindex == rhs.curveindex)
-               {
-                       if(vertindex == rhs.vertindex)
-                       {
-                               return tvalue < rhs.tvalue;
-                       }else return vertindex < rhs.vertindex;
-               }else return curveindex < rhs.curveindex;
-       }
-       
-       bool operator >(const ipoint &rhs) const
-       {
-               return rhs < *this;
-       }
-       
-       void insert_after(ipoint *i)
-       {
-               //from: next - next.prev
-               //to: next* - i - next.prev*
-               
-               ipoint  *bef = this,
-                               *aft = next;
-               
-               //assuming the input point is not connected to anything, we don't have to do anything with it...
-               bef->next = i;
-               i->prev = bef;
-               aft->prev = i;
-               i->next = aft;          
-       }
-       
-       void insert_before(ipoint *i)
-       {
-               //from: prev.next - prev
-               //to: prev.next* - i - prev*
-               
-               ipoint  *bef = prev,
-                               *aft = this;
-               
-               //assuming the input point is not connected to anything, we don't have to do anything with it...
-               bef->next = i;
-               i->prev = bef;
-               aft->prev = i;
-               i->next = aft;                          
-       }
-       
-       void insert_sorted(ipoint *i)
-       {
-               ipoint *search = this;
-               
-               if(*i < *this)
-               {
-                       //we go forward
-                       search = this;
-                       do
-                       {
-                               search = search->next;
-                       }while(*i < *search && search != this); //ending conditions...
-                       
-                       //now we insert previously...
-                       search->insert_before(i);
-               }else if(*i > *this)
-               {
-                       //we go backwards...
-                       search = this;
-                       do
-                       {
-                               search = search->prev;
-                       }while(*i > *search && search != this); //ending conditions...
-                       
-                       //now we insert previously...
-                       search->insert_after(i);
-               }
-       }
-};
-
-enum SetOp
-{
-       INTERSECT       = 0,
-       UNION,
-       SUBTRACT,
-       INVSUBTRACT,
-       NUM_SETOPERATIONS
-};
-
-class PolygonClipper
-{
-public:
-       typedef vector<ipoint *>        CurveInts; //in no particular order
-
-       vector<CurveInts>       c1ints;
-       vector<CurveInts>       c2ints;
-       
-       //get the intersections
-       void GetIntersections(const CurveSet &lhs, const CurveSet &rhs)
-       {               
-               CIntersect      isect;
-               bezier<Point>   b1,b2;
-               
-               int i1,j1,ci1,s1;
-               int i2,j2,ci2,s2;
-               
-               //clear out so everyone's happy
-               c1ints.clear();
-               c2ints.clear();
-               
-               c1ints.resize(lhs.set.size());
-               c2ints.resize(rhs.set.size());
-               
-               //loop through everyone and be happy...
-               
-               //intersect each curve with each other curve, and we're good
-               for(ci1=0;ci1 < (int)lhs.set.size(); ++ci1)
-               {
-                       const CurveSet::region &cur1 = lhs.set[ci1];
-                       s1 = cur1.size();
-                       for(j1 = s1-1, i1=0; i1 < s1; j1 = i1++)
-                       {
-                               b1[0] = cur1[j1].p;
-                               b1[3] = cur1[i1].p;
-                               b1[1] = b1[0] + cur1[j1].r/3;
-                               b1[2] = b1[3] - cur1[i1].l/3;
-                               
-                               for(ci2=0;ci2 < (int)rhs.set.size(); ++ci2)
-                               {
-                                       const CurveSet::region &cur2 = rhs.set[ci2];
-                                       s2 = cur2.size();
-                                       for(j2 = s2-1, i2=0; i2 < s2; j2 = i2++)
-                                       {
-                                               b2[0] = cur2[j2].p;
-                                               b2[3] = cur2[i2].p;
-                                               b2[1] = b2[0] + cur2[j2].r/3;
-                                               b2[2] = b2[3] - cur2[i2].l/3;
-                                               
-                                               isect(b1,b2);
-
-                                               for(int index=0; index < (int)isect.times.size(); ++index)
-                                               {
-                                                       //prepare basic intersection information
-                                                       ipoint *ip1 = new ipoint, *ip2 = new ipoint;
-                                                       
-                                                       //set parameters
-                                                       ip1->curveindex = ci1; ip1->vertindex = j1; ip1->tvalue = isect.times[index].first;
-                                                       ip2->curveindex = ci2; ip2->vertindex = j2; ip2->tvalue = isect.times[index].second;
-                                                       
-                                                       //set neighbors
-                                                       ip1->neighbor = ip2;
-                                                       ip2->neighbor = ip1;
-                                                       
-                                                       //first one just goes on end of list
-                                                       c1ints[ci1].back()->insert_sorted(ip1);
-                                                       c1ints[ci1].push_back(ip1);     
-                                                       
-                                                       //second one must go in order
-                                                       c2ints[ci2].back()->insert_sorted(ip2);
-                                                       c2ints[ci2].push_back(ip2);
-                                                       
-                                                       //we're all good...
-                                               }
-                                       }                               
-                               }                                               
-                       }                               
-               }
-               
-               //Now figure out the containment properties of each int point
-               Point p;                
-               int inside = 0;
-               for(int i = 0; i < (int)c1ints.size(); ++i)
-               {
-                       if(c1ints[i].size() == 0) continue;
-                               
-                       //must test insideness for the edges
-                       ipoint *start, *iter;
-                       start = iter = c1ints[i].front();
-                       
-                       //i == iter->curveindex == the index of the current curve we're looking at
-                       
-                       //set the initial insideness on the other curve...
-                       p = lhs.set[i][iter->vertindex].p;
-                       inside = rhs.intersect(p)%2; //if it's inside by the even odd rule
-                       
-                       do
-                       {
-                               iter->go_in = inside? -1 : 1; //leaving if inside, or coming in if not
-                               inside = !inside;
-                               iter = iter->next;
-                       }while(iter != start); //I hope this isn't an infinite loop!
-               }
-               
-               //and curve 2
-               for(int i = 0; i < (int)c2ints.size(); ++i)
-               {
-                       if(c2ints[i].size() == 0) continue;
-                               
-                       //must test insideness for the edges
-                       ipoint *start, *iter;
-                       start = iter = c1ints[i].front();
-                       
-                       //set the initial insideness on the other curve...
-                       p = rhs.set[i][iter->vertindex].p;
-                       inside = lhs.intersect(p)%2; //if it's inside by the even odd rule
-                       
-                       do
-                       {
-                               iter->go_in = inside? -1 : 1; //leaving if inside, or coming in if not
-                               inside = !inside;
-                               iter = iter->next;
-                       }while(iter != start); //I hope this isn't an infinite loop!
-               }
-       }
-       
-       bool ConstructSet(CurveSet &c, const CurveSet &lhs, const CurveSet &rhs, int type)
-       {
-               bool in1,in2;
-               
-               switch(type)
-               {
-                       case INTERSECT: //1&2
-                       {
-                               in1 = true; in2 = true;
-                               break;
-                       }
-                       
-                       case UNION: //1|2
-                       {
-                               in1 = false; in2 = false;
-                               break;
-                       }
-                       
-                       case SUBTRACT: //1-2
-                       {
-                               in1 = true; in2 = false;
-                               break;                          
-                       }
-                       
-                       case INVSUBTRACT: //2-1
-                       {
-                               in1 = false; in2 = true;
-                               break;
-                       }
-                       
-                       default:
-                       {
-                               return false;
-                       }                               
-               }
-               
-               //traverse path based on inside flags
-               
-               //fill all the paths of native stuff
-               set<ipoint *>   ipset;
-               for(int ci=0; ci<(int)c1ints.size(); ++ci)
-               {
-                       for(int i=0; i < (int)c1ints[ci].size(); ++i)
-                       {
-                               ipset.insert(c1ints[ci][i]);
-                       }                               
-               }
-               
-               //
-               while(ipset.size() > 0)
-               {
-                       //start from one point (always on curveset 1) and traverse until we find it again
-                       ipoint *start, *iter;
-                       start = iter = *ipset.begin();
-                       
-                       //All the info to swap when we transition curves...
-                       const CurveSet *cur, *other;
-                       bool curin, otherin;
-                       bool delcur = true;
-                       
-                       set<ipoint *>::iterator deliter;
-                       
-                       int ci,i1,i2,size;
-                       float t1,t2;
-                       
-                       CurveSet::region        current;
-                       CurvePoint      cp;
-                       
-                       cur = &lhs; other = &rhs;
-                       curin = in1; otherin = in2;
-                       delcur = true;                                          
-                       
-                       do
-                       {
-                               //remove the current iter from the set
-                               if(delcur)
-                               {
-                                       deliter = ipset.find(iter);
-                                       if(deliter != ipset.end()) ipset.erase(deliter);
-                               }
-                               
-                               //go to next and accumulate information
-                               ci = iter->curveindex;
-                               i1 = iter->vertindex;
-                               t1 = iter->tvalue;                              
-                               iter = iter->next; //move to next and get its info
-                               
-                               i2 = iter->vertindex;
-                               t2 = iter->tvalue;
-                               
-                               size = cur->set[ci].size();
-                       
-                               //record all the stuff between us...                                                                                            
-                               //start on an intersection - get the curve point...
-                                                               
-                               
-                               //transition curves...
-                               iter = iter->neighbor;
-                               swap(cur,other);
-                               swap(curin,otherin);
-                               delcur = !delcur;
-                       }while(iter != start); //I hope THIS isn't an infinite loop                             
-               }
-                               
-               return true;
-       }
-};
-
-void CurveSet::SetClamp(int &i, int &si)
-{
-       if(si > 0 && si < (int)set.size())
-       {
-               if(i >= (int)set[si].size())
-               {
-                       i -= set[si].size();
-                       si++;
-               }else if (i < 0)
-               {
-                       i += set[si].size();
-                       si--;
-               }       
-       }
-}
-
-void CurveSet::CleanUp(int curve)
-{
-}
-
-/*     Detect intersections that are crazy happy good
-
-       Performance annoyances:
-       1) Recursing down to find an intersection at the end points that doesn't actually exist
-               (can be helped a bit by not including the edges of bouding rectaingles)
-       2) Intersecting curves is slow... oh well
-
-       Algorithm:
-       1) Inside out scheme, track when edges go into and come out of various objects etc.
-       
-       + doesn't require initial conditions
-       - only works with odd-even rule 
-*/
-
-CurveSet CurveSet::operator &(const CurveSet &rhs) const
-{
-       return *this;
-}
-
-CurveSet CurveSet::operator |(const CurveSet &rhs) const
-{
-       return *this;
-}
-
-CurveSet CurveSet::operator -(const CurveSet &rhs) const
-{
-       return *this;
-}
-
-int CurveSet::intersect(const Point &p) const
-{
-       int inter = 0, ci,i,j,s;
-       bezier<Point>   b;
-       
-       for(ci=0; ci < (int)set.size(); ++ci)
-       {
-               const vector<CurvePoint> &curve = set[ci];
-               s = curve.size();
-               for(j=s-1,i=0; i < s; j = i++)
-               {
-                       b[0] = curve[j].p; b[3] = curve[i].p;
-                       b[1] = b[0] + curve[j].r/3; b[2] = b[3] - curve[i].l/3;
-                       
-                       inter += sinfg::intersect(b,p);
-               }
-       }
-       
-       return inter;
-}
diff --git a/synfig-core/trunk/src/sinfg/curveset.h b/synfig-core/trunk/src/sinfg/curveset.h
deleted file mode 100644 (file)
index 963fd93..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file curveset.h
-**     \brief Curve Set Header
-**
-**     $Id: curveset.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_CURVESET_H
-#define __SINFG_CURVESET_H
-
-/* === H E A D E R S ======================================================= */
-#include "blinepoint.h"
-#include <vector>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-namespace sinfg
-{
-
-class BLinePoint;
-       
-struct CurvePoint
-{
-       Point   p;
-       Point   l,r;
-       
-       CurvePoint () {}
-       CurvePoint(const Point &pin, const Vector &left, const Vector &right);
-       
-       CurvePoint(const BLinePoint &bpoint);
-};
-       
-class CurveSet 
-{
-       bool            invert; //winding order...
-       
-       void CleanUp(int curve = 0);
-public:
-       
-       typedef std::vector<CurvePoint> region;
-       typedef std::vector<region>             set_type;
-       
-       set_type        set; //specifies a region object (assumes looping)
-
-       void SetClamp(int &i, int &si);
-
-       //actual stuff
-       CurveSet()
-       {
-       }
-       
-       //anything supporting iterator type operations
-       template < typename Iterator >
-       CurveSet(Iterator begin, Iterator end, bool invert = false)
-       {
-               set.push_back(std::vector<CurvePoint>(begin,end));
-               CleanUp(invert);
-       }
-       
-       CurveSet operator &(const CurveSet &rhs) const; //intersect
-       CurveSet operator |(const CurveSet &rhs) const; //union
-       CurveSet operator -(const CurveSet &rhs) const; //subtract
-       
-       
-       //Point containment
-       int intersect(const Point &p) const;
-};
-
-}
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/distance.cpp b/synfig-core/trunk/src/sinfg/distance.cpp
deleted file mode 100644 (file)
index c1a7e65..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file distance.cpp
-**     \brief Template File
-**
-**     $Id: distance.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "distance.h"
-#include "renddesc.h"
-#include "general.h"
-#include <ctype.h>
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define POINTS_PER_INCH        (72.0)
-
-/* === G L O B A L S ======================================================= */
-
-#define METERS_PER_UNIT  (rend_desc.get_physical_w()/abs(rend_desc.get_tl()[0]-rend_desc.get_br()[0]))
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Distance::Distance(const sinfg::String& str)
-{
-       (*this)=str;
-/*     int i(0);
-       float val;
-       int ret(strscanf(str,"%f%n",&val,&i));
-       sinfg::info("Distance::Distance(): ret=%d, val=%f",ret,val);
-       
-       if(ret<=0)
-       {
-               // Error
-               sinfg::error("Distance::Distance(): Bad value \"%s\"",str.c_str());
-               value_=0;
-       }
-       else
-               value_=val;
-       
-       sinfg::info("Distance::Distance(): system=\"%s\"",String(str.begin()+i,str.end()).c_str());
-       system_=ident_system(String(str.begin()+i,str.end()));
-*/
-}
-
-Distance&
-Distance::operator=(const sinfg::String& str)
-{
-       int i(0);
-       float val;
-       int ret(strscanf(str,"%f%n",&val,&i));
-       sinfg::info("Distance::Distance(): ret=%d, val=%f",ret,val);
-       
-       if(ret<=0)
-       {
-               // Error
-               sinfg::error("Distance::Distance(): Bad value \"%s\"",str.c_str());
-               return *this;
-       }
-       else
-               value_=val;
-
-       sinfg::String sys(str.begin()+i,str.end());
-
-       if(sys.size())
-               system_=ident_system(sys);
-       return *this;
-}
-
-sinfg::String
-Distance::get_string(int digits)const
-{
-       digits=min(9,max(0,digits));
-       String fmt(strprintf("%%.%01df%%s",digits));
-       return strprintf(fmt.c_str(),value_,system_name(system_).c_str());
-}
-
-void
-Distance::convert(Distance::System target, const RendDesc& rend_desc)
-{
-       value_=get(target,rend_desc);
-       system_=target;
-}
-
-Real
-Distance::get(Distance::System target, const RendDesc& rend_desc)const
-{
-       if(target==SYSTEM_UNITS)
-               return units(rend_desc);
-       if(target==SYSTEM_PIXELS)
-               return units(rend_desc)*METERS_PER_UNIT*rend_desc.get_x_res();
-       
-       return meters_to_system(meters(rend_desc),target);      
-}
-       
-Real
-Distance::meters()const
-{
-       switch(system_)
-       {
-               case SYSTEM_INCHES: return value_/39.3700787402;
-               case SYSTEM_POINTS: return value_/POINTS_PER_INCH/39.3700787402;
-               case SYSTEM_METERS: return value_;
-               case SYSTEM_CENTIMETERS: return value_/100.0;
-               case SYSTEM_MILLIMETERS: return value_/1000.0;
-               default: throw BadSystem();
-       }
-}
-
-Real
-Distance::meters(const RendDesc& rend_desc)const
-{
-       if(system_>SYSTEM_PIXELS)
-               return meters();
-       if(system_==SYSTEM_UNITS)
-               return value_*METERS_PER_UNIT;
-       if(system_==SYSTEM_PIXELS)
-               return value_/rend_desc.get_x_res();
-
-       throw BadSystem();
-}
-
-Real
-Distance::units(const RendDesc& rend_desc)const
-{
-       if(system_==SYSTEM_UNITS)
-               return value_;
-
-       Real ret;
-
-       if(system_>SYSTEM_PIXELS)
-               ret=meters();
-       else
-               ret=value_/rend_desc.get_x_res();
-
-       return ret/METERS_PER_UNIT;
-}
-
-
-Real // (static)
-Distance::meters_to_system(Real x,System target_system)
-{
-       switch(target_system)
-       {
-               case SYSTEM_INCHES: return x*39.3700787402;
-               case SYSTEM_POINTS: return x*39.3700787402*POINTS_PER_INCH;
-               case SYSTEM_METERS: return x;
-               case SYSTEM_CENTIMETERS: return x*100.0;
-               case SYSTEM_MILLIMETERS: return x*1000.0;
-               default: throw BadSystem();
-       }
-}
-
-Distance::System // (static)
-Distance::ident_system(const sinfg::String& x)
-{
-       sinfg::String str;
-
-       // Make it all upper case, and remove white space
-       for(unsigned int i=0;i<x.size();i++)if(x[i]!=' ' && x[i]!='\t')str+=toupper(x[i]);
-
-       // If it is plural, make it singular
-       if(str[str.size()-1]=='S')
-               str=sinfg::String(str.begin(),str.end()-1);
-       
-       if(str.empty() || str=="U" || str=="UNIT")
-               return SYSTEM_UNITS;
-       if(str=="PX" || str=="PIXEL")
-               return SYSTEM_PIXELS;
-       if(str=="PT" || str=="POINT")
-               return SYSTEM_POINTS;
-       if(str=="IN" || str=="\"" || str=="INCHE" || str=="INCH")
-               return SYSTEM_INCHES;
-       if(str=="M" || str=="METER")
-               return SYSTEM_METERS;
-       if(str=="CM" || str=="CENTIMETER")
-               return SYSTEM_CENTIMETERS;
-       if(str=="MM" || str=="MILLIMETER")
-               return SYSTEM_MILLIMETERS;
-       
-       sinfg::warning("Distance::ident_system(): Unknown distance system \"%s\"",x.c_str());
-       
-       return SYSTEM_UNITS;
-}
-
-sinfg::String  // (static)
-Distance::system_name(Distance::System system)
-{
-       switch(system)
-       {
-               case SYSTEM_UNITS:              return "u";
-               case SYSTEM_PIXELS:             return "px";
-               case SYSTEM_POINTS:             return "pt";
-               case SYSTEM_INCHES:             return "in";
-               case SYSTEM_METERS:             return "m";
-               case SYSTEM_MILLIMETERS:        return "mm";
-               case SYSTEM_CENTIMETERS:        return "cm";
-       
-               default:                                throw BadSystem();
-       }
-       return sinfg::String();
-}
-
-sinfg::String  // (static)
-Distance::system_local_name(Distance::System system)
-{
-       switch(system)
-       {
-               case SYSTEM_UNITS:              return _("Units");
-               case SYSTEM_PIXELS:             return _("Pixels");
-               case SYSTEM_POINTS:             return _("Points");
-               case SYSTEM_INCHES:             return _("Inches");
-               case SYSTEM_METERS:             return _("Meters");
-               case SYSTEM_MILLIMETERS:return _("Millimeters");
-               case SYSTEM_CENTIMETERS:return _("Centimeters");
-       
-               default:                                throw BadSystem();
-       }
-       return sinfg::String();
-}
diff --git a/synfig-core/trunk/src/sinfg/distance.h b/synfig-core/trunk/src/sinfg/distance.h
deleted file mode 100644 (file)
index 44d88bc..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file distance.h
-**     \brief Template Header
-**
-**     $Id: distance.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_DISTANCE_H
-#define __SINFG_DISTANCE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "real.h"
-#include "string.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class RendDesc;
-
-class Distance
-{
-public:
-       typedef Real value_type;
-       
-       enum System
-       {
-               SYSTEM_UNITS,           //!<
-               SYSTEM_PIXELS,          //!<
-               
-               SYSTEM_POINTS,          //!<
-               SYSTEM_INCHES,          //!<
-               SYSTEM_METERS,          //!<
-               SYSTEM_MILLIMETERS,     //!<
-               SYSTEM_CENTIMETERS,     //!<
-
-               SYSTEM_END                      //!< \internal
-       };
-
-       class BadSystem { };
-
-private:       
-       value_type value_;
-               
-       System system_;
-
-       
-public:
-
-       Distance(){ }
-       Distance(const value_type& value, System system):value_(value),system_(system) { }
-       explicit Distance(const sinfg::String& string);
-       
-       operator Real()const { return value_; }
-
-       Distance& operator=(const Real& rhs) { value_=rhs; return *this; }
-
-       Distance& operator=(const sinfg::String& rhs);
-
-       sinfg::String get_string(int digits=4)const;
-       
-       const System& get_system()const { return system_; }
-
-       const Real& get()const { return value_; }
-
-       Real get(System system, const RendDesc& rend_desc)const;
-       
-       void convert(System system, const RendDesc& rend_desc);
-       
-       Real meters()const;
-       Real meters(const RendDesc& rend_desc)const;
-       Real units(const RendDesc& rend_desc)const;
-       
-       static Real meters_to_system(Real x, System target_system);
-       static System ident_system(const sinfg::String& str);
-       static sinfg::String system_name(System system);
-       static sinfg::String system_local_name(System system);
-
-       const Distance& operator+=(const Distance &rhs) { value_+=meters_to_system(rhs.meters(),system_); return *this; }
-       const Distance& operator-=(const Distance &rhs) { value_-=meters_to_system(rhs.meters(),system_); return *this; }
-
-       const Distance& operator+=(const float &rhs) { value_+=rhs; return *this; }
-       const Distance& operator-=(const float &rhs) { value_-=rhs; return *this; }
-       const Distance& operator*=(const float &rhs) { value_*=rhs; return *this; }
-       const Distance& operator/=(const float &rhs) { value_/=rhs; return *this; }
-       
-/*
-       template<typename U> const Time& operator+=(const U &rhs) { value_+=rhs; return *this; }
-       template<typename U> const Time& operator-=(const U &rhs) { value_-=rhs; return *this; }
-       template<typename U> const Time& operator*=(const U &rhs) { value_*=rhs; return *this; }
-       template<typename U> const Time& operator/=(const U &rhs) { value_/=rhs; return *this; }
-
-       template<typename U> Time operator+(const U &rhs)const { return value_+rhs; }
-       template<typename U> Time operator-(const U &rhs)const { return value_-rhs; }
-       template<typename U> Time operator*(const U &rhs)const { return value_*rhs; }
-       template<typename U> Time operator/(const U &rhs)const { return value_/rhs; }
-       
-       Time operator-()const { return -value_; }
-*/
-}; // END of class Distance
-       
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/exception.cpp b/synfig-core/trunk/src/sinfg/exception.cpp
deleted file mode 100644 (file)
index e7b8e3a..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.cpp
-**     \brief Template File
-**
-**     $Id: exception.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "exception.h"
-#include "general.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Exception::BadLinkName::BadLinkName(const String &what):
-       std::runtime_error(what)
-//     std::runtime_error(_("Bad Link Name")+what.empty()?"":(String(": ")+what))
-{
-       sinfg::error("EXCEPTION: bad link name: "+what);
-}
-
-Exception::BadType::BadType(const String &what):
-       std::runtime_error(what)
-//     std::runtime_error(_("Bad Type")+what.empty()?"":(String(": ")+what))
-{
-       sinfg::error("EXCEPTION: bad type: "+what);
-}
-
-Exception::BadFrameRate::BadFrameRate(const String &what):
-       std::runtime_error(what)
-//     std::runtime_error(_("Bad Link Name")+what.empty()?"":(String(": ")+what))
-{
-       sinfg::error("EXCEPTION: bad frame rate: "+what);
-}
-
-Exception::BadTime::BadTime(const String &what):
-       std::runtime_error(what)
-//     std::runtime_error(_("Bad Link Name")+what.empty()?"":(String(": ")+what))
-{
-       sinfg::error("EXCEPTION: bad time: "+what);
-}
-
-Exception::NotFound::NotFound(const String &what):
-       std::runtime_error(what)
-//     std::runtime_error(_("Not Found")+what.empty()?"":(String(": ")+what))
-{
-//     sinfg::error("EXCEPTION: not found: "+what);
-}
-
-Exception::IDNotFound::IDNotFound(const String &what):
-       NotFound(what)
-//     std::runtime_error(_("Not Found")+what.empty()?"":(String(": ")+what))
-{
-//     sinfg::error("EXCEPTION: not found: "+what);
-}
-
-Exception::FileNotFound::FileNotFound(const String &what):
-       NotFound(what)
-//     std::runtime_error(_("Not Found")+what.empty()?"":(String(": ")+what))
-{
-       sinfg::error("EXCEPTION: file not found: "+what);
-}
-
-Exception::IDAlreadyExists::IDAlreadyExists(const String &what):
-       std::runtime_error(what)
-//     std::runtime_error(_("ID Already Exists")+what.empty()?"":(String(": ")+what))
-{
-       sinfg::error("EXCEPTION: id already exists: "+what);
-}
diff --git a/synfig-core/trunk/src/sinfg/exception.h b/synfig-core/trunk/src/sinfg/exception.h
deleted file mode 100644 (file)
index 32ed769..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file exception.h
-**     \brief Exceptions
-**
-**     $Id: exception.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_EXCEPTION_H
-#define __SINFG_EXCEPTION_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <stdexcept>
-#include "string_decl.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-namespace Exception {
-
-class BadLinkName : public std::runtime_error
-{
-public:
-       BadLinkName(const String &what);
-}; // END of class BadLinkName
-
-class BadType : public std::runtime_error
-{
-public:
-       BadType(const String &what);
-}; // END of class BadType
-
-class IDAlreadyExists : public std::runtime_error
-{
-public:
-       IDAlreadyExists(const String &what);
-};
-
-class NotFound : public std::runtime_error
-{
-public:
-       NotFound(const String &what);
-};
-
-class IDNotFound : public NotFound
-{
-public:
-       IDNotFound(const String &what);
-};
-
-class FileNotFound : public NotFound
-{
-public:
-       FileNotFound(const String &what);
-};
-
-class BadTime : public std::runtime_error
-{
-public:
-       BadTime(const String &what);
-};
-
-class BadFrameRate : public std::runtime_error
-{
-public:
-       BadFrameRate(const String &what);
-};
-
-}; // END of namespace Exception
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/gamma.cpp b/synfig-core/trunk/src/sinfg/gamma.cpp
deleted file mode 100644 (file)
index 1a5e31a..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file gamma.cpp
-**     \brief Template File
-**
-**     $Id: gamma.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "gamma.h"
-#include <cmath>
-#include <algorithm>
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-//using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-void
-Gamma::set_gamma(float x)
-{
-       gamma_r=gamma_g=gamma_b=x;
-       int i;
-       red_blue_level=1.0f;
-       for(i=0;i<65536;i++)
-       {
-               float f(float(i)/65536.0f);
-               f=pow(f,gamma_r);
-               table_r_U16_to_U8[i]=table_g_U16_to_U8[i]=table_b_U16_to_U8[i]=(unsigned char)(f*(255.0f-(black_level*255))+0.5f + black_level*255.0f);
-       }
-
-       for(i=0;i<256;i++)
-               table_r_U8_to_F32[i]=table_g_U8_to_F32[i]=table_b_U8_to_F32[i]=pow((float(i)/255.0f)*(1.0f-black_level)+black_level,gamma_r);
-}
-
-
-void
-Gamma::refresh_gamma_r()
-{
-       int i;
-//     const float scalar(min(red_blue_level,1.0f));
-       const float scalar(1.0f);
-       for(i=0;i<65536;i++)
-       {
-               float f(float(i)/65536.0f);
-               f=pow(f,gamma_r)*scalar;
-               table_r_U16_to_U8[i]=(unsigned char)(f*(255.0f-(black_level*255))+0.5f + black_level*255.0f);
-       }
-
-       for(i=0;i<256;i++)
-               table_r_U8_to_F32[i]=pow((float(i)/255.0f)*(1.0f-black_level)+black_level,gamma_r)*scalar;
-}
-
-void
-Gamma::refresh_gamma_g()
-{
-       int i;
-//     const float scalar(sqrt(min(red_blue_level,2.0f-red_blue_level)));
-       const float scalar(1.0f);
-       for(i=0;i<65536;i++)
-       {
-               float f(float(i)/65536.0f);
-               f=pow(f,gamma_g)*scalar;
-               table_g_U16_to_U8[i]=(unsigned char)(f*(255.0f-(black_level*255))+0.5f + black_level*255.0f);
-       }
-       for(i=0;i<256;i++)
-               table_g_U8_to_F32[i]=pow((float(i)/255.0f)*(1.0f-black_level)+black_level,gamma_g)*scalar;
-}
-
-void
-Gamma::refresh_gamma_b()
-{
-       int i;
-//     const float scalar(min(2.0f-red_blue_level,1.0f));
-       const float scalar(1.0f);
-       for(i=0;i<65536;i++)
-       {
-               float f(float(i)/65536.0f);
-               f=pow(f,gamma_b)*scalar;
-               table_b_U16_to_U8[i]=(unsigned char)(f*(255.0f-(black_level*255))+0.5f + black_level*255.0f);
-       }
-       for(i=0;i<256;i++)
-               table_b_U8_to_F32[i]=pow((float(i)/255.0f)*(1.0f-black_level)+black_level,gamma_b)*scalar;
-}
-
-void
-Gamma::set_gamma_r(float x)
-{
-       // If the gamma hasn't changed, then don't recompute the tables
-       if(x==gamma_r) return;
-
-       gamma_r=x;
-       refresh_gamma_r();
-}
-
-void
-Gamma::set_gamma_g(float x)
-{
-       // If the gamma hasn't changed, then don't recompute the tables
-       if(x==gamma_g) return;
-
-       gamma_g=x;
-       refresh_gamma_g();
-}
-
-void
-Gamma::set_gamma_b(float x)
-{
-       // If the gamma hasn't changed, then don't recompute the tables
-       if(x==gamma_b) return;
-
-       gamma_b=x;
-       refresh_gamma_b();
-}
-
-void
-Gamma::set_black_level(float x)
-{
-       // If the black_level hasn't changed, then don't recompute the tables
-       if(x==black_level) return;
-
-       black_level=x;
-       
-       // Rebuild tables
-       refresh_gamma_r();
-       refresh_gamma_g();
-       refresh_gamma_b();
-}
-
-void
-Gamma::set_red_blue_level(float x)
-{
-       // If the black_level hasn't changed, then don't recompute the tables
-       if(x==red_blue_level) return;
-
-       red_blue_level=x;
-       
-       // Rebuild tables
-       refresh_gamma_r();
-       refresh_gamma_g();
-       refresh_gamma_b();
-}
-
-void
-Gamma::set_all(float r, float g, float b, float black, float red_blue)
-{
-       // If nothing has changed, then don't recompute the tables
-       if(gamma_r==r && gamma_g==g && gamma_b==b && black_level==black && red_blue_level==red_blue)
-               return;
-       
-       gamma_r=r;
-       gamma_g=g;
-       gamma_b=b;
-       black_level=black;
-       red_blue_level=red_blue;
-
-       // Rebuild tables
-       refresh_gamma_r();
-       refresh_gamma_g();
-       refresh_gamma_b();
-}
diff --git a/synfig-core/trunk/src/sinfg/gamma.h b/synfig-core/trunk/src/sinfg/gamma.h
deleted file mode 100644 (file)
index b90894b..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file gamma.h
-**     \brief Template Header
-**
-**     $Id: gamma.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_GAMMA_H
-#define __SINFG_GAMMA_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <cmath>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Gamma
-**     \brief This class performs color correction on Color classes.
-**     \stub
-*/
-class Gamma
-{
-       float gamma_r;
-       float gamma_g;
-       float gamma_b;
-       float black_level;
-       float red_blue_level;
-       
-       unsigned char table_r_U16_to_U8[65536];
-       unsigned char table_g_U16_to_U8[65536];
-       unsigned char table_b_U16_to_U8[65536];
-
-       float table_r_U8_to_F32[256];
-       float table_g_U8_to_F32[256];
-       float table_b_U8_to_F32[256];
-       
-public:
-       Gamma(float x=1):black_level(0) { set_gamma(x); }
-
-       void set_gamma(float x);
-       void set_gamma_r(float x);
-       void set_gamma_g(float x);
-       void set_gamma_b(float x);
-       void set_black_level(float x);
-
-       void set_red_blue_level(float x);
-       void set_all(float r, float g, float b, float black, float red_blue=1.0f);
-
-       float get_gamma()const { return (gamma_r+gamma_g+gamma_b)*0.33333333; }
-       float get_gamma_r()const { return gamma_r; }
-       float get_gamma_g()const { return gamma_g; }
-       float get_gamma_b()const { return gamma_b; }
-       float get_black_level()const { return black_level; }
-       float get_red_blue_level()const { return red_blue_level; }
-       
-       void refresh_gamma_r();
-       void refresh_gamma_g();
-       void refresh_gamma_b();
-       
-       const unsigned char &r_U16_to_U8(int i)const { return table_r_U16_to_U8[i]; }
-       const unsigned char &g_U16_to_U8(int i)const { return table_g_U16_to_U8[i]; }
-       const unsigned char &b_U16_to_U8(int i)const { return table_b_U16_to_U8[i]; }
-
-       const unsigned char &r_F32_to_U8(float x)const { return table_r_U16_to_U8[(int)(x*65535.0f)]; }
-       const unsigned char &g_F32_to_U8(float x)const { return table_g_U16_to_U8[(int)(x*65535.0f)]; }
-       const unsigned char &b_F32_to_U8(float x)const { return table_b_U16_to_U8[(int)(x*65535.0f)]; }
-
-       unsigned short r_F32_to_U16(float x)const { return (unsigned short)table_r_U16_to_U8[(int)(x*65535.0f)]<<8; }
-       unsigned short g_F32_to_U16(float x)const { return (unsigned short)table_g_U16_to_U8[(int)(x*65535.0f)]<<8; }
-       unsigned short b_F32_to_U16(float x)const { return (unsigned short)table_b_U16_to_U8[(int)(x*65535.0f)]<<8; }
-
-       const float& r_U8_to_F32(int i)const { return table_r_U8_to_F32[i]; }
-       const float& g_U8_to_F32(int i)const { return table_g_U8_to_F32[i]; }
-       const float& b_U8_to_F32(int i)const { return table_b_U8_to_F32[i]; }
-
-       float r_F32_to_F32(float x)const { return static_cast<float>(pow(x,gamma_r)*(1.0f-black_level)+black_level); }
-       float g_F32_to_F32(float x)const { return static_cast<float>(pow(x,gamma_g)*(1.0f-black_level)+black_level); }
-       float b_F32_to_F32(float x)const { return static_cast<float>(pow(x,gamma_b)*(1.0f-black_level)+black_level); }
-}; // END of class Gamma
-       
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/general.h b/synfig-core/trunk/src/sinfg/general.h
deleted file mode 100644 (file)
index 2af68c5..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file general.h
-**     \brief General macros, classes, and prodecure declarations
-**
-**     $Id: general.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_GENERAL_H
-#define __SINFG_GENERAL_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/stringf>
-#include "string.h"
-#include "version.h"
-
-/* === M A C R O S ========================================================= */
-
-// Quick hack to keep stuff working until gettext support is added
-#ifndef _
-#define _(x)           (x)
-#define N_(x)          (x)
-//#define gettext(x)   (x)
-#endif
-
-#define SINFG_COPYRIGHT "Copyright (c) 2001-2004 Voria Software, LLC"
-
-
-#ifdef _DEBUG
-#ifdef __FUNC__
-#define DEBUGPOINT()   sinfg::warning(etl::strprintf(__FILE__":"__FUNC__":%d DEBUGPOINT",__LINE__))
-#define DEBUGINFO(x)   sinfg::warning(etl::strprintf(__FILE__":"__FUNC__":%d:DEBUGINFO:",__LINE__)+x)
-#else
-#define DEBUGPOINT()   sinfg::warning(etl::strprintf(__FILE__":%d DEBUGPOINT",__LINE__))
-#define DEBUGINFO(x)   sinfg::warning(etl::strprintf(__FILE__":%d:DEBUGINFO:",__LINE__)+x)
-#endif
-
-#else
-#define DEBUGPOINT()
-#define DEBUGINFO(x)
-#endif
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class ProgressCallback
-**     \todo writeme
-*/
-class ProgressCallback
-{
-public:
-
-       virtual ~ProgressCallback() { }
-       virtual bool task(const String &task) { return true; }
-       virtual bool error(const String &task) { return true; }
-       virtual bool warning(const String &task) { return true; }
-       virtual bool amount_complete(int current, int total) { return true; }
-       
-       virtual bool valid() const { return true; }
-};
-
-typedef ProgressCallback ProgressManager;
-
-/*!    \class SuperCallback
-**     \todo writeme
-*/
-class SuperCallback : public ProgressCallback
-{
-       ProgressCallback *cb;
-       int start,end,tot;
-       int w;
-public:
-
-       SuperCallback() { cb=NULL; }
-       SuperCallback(ProgressCallback *cb,int start, int end, int total):cb(cb),start(start),end(end),tot(total)
-       {
-               //make sure we don't "inherit" if our subcallback is invalid
-               if(!cb || !cb->valid())
-                       cb = NULL;
-               w=end-start;
-       }
-       virtual bool task(const String &task) { if(cb)return cb->task(task); return true; }
-       virtual bool error(const String &task) { if(cb)return cb->error(task); return true; }
-       virtual bool warning(const String &task) { if(cb)return cb->warning(task); return true; }
-       virtual bool amount_complete(int cur, int total) { if(cb)return cb->amount_complete(start+cur*w/total,tot); return true; }
-       
-       virtual bool valid() const { return cb != 0; }
-};
-
-/*! \class SoftwareExpired
-**     \brief This class is thrown when the software timeout has been reached.
-*/
-class SoftwareExpired
-{
-}; // END of class SoftwareExpired
-
-
-#ifdef DEATH_TIME
-inline void CHECK_EXPIRE_TIME() { if(time(0)>DEATH_TIME) throw SoftwareExpired(); }
-#else
-#define CHECK_EXPIRE_TIME() while(0){ }
-#endif
-
-/*
-extern bool add_to_module_search_path(const std:string &path);
-extern bool add_to_config_search_path(const std:string &path);
-*/
-
-//! Shutdown the sinfg environment
-extern void shutdown();
-
-//! Reports an error
-/*! Call this when an error occurs, describing what happened */
-extern void error(const char *format,...);
-extern void error(const String &str);
-
-//! Reports a warning
-/*! Call this when something questionable occurs, describing what happened */
-extern void warning(const char *format,...);
-extern void warning(const String &str);
-
-//! Reports some information
-/*! Call this to report various information. Please be sparse... */
-extern void info(const char *format,...);
-extern void info(const String &str);
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/gradient.cpp b/synfig-core/trunk/src/sinfg/gradient.cpp
deleted file mode 100644 (file)
index 8132809..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file gradient.cpp
-**     \brief Color Gradient Class Member Definitions
-**
-**     $Id: gradient.cpp,v 1.2 2005/01/21 19:29:10 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "gradient.h"
-#include "general.h"
-#include <stdexcept>
-#include "exception.h"
-
-#include <ETL/misc>
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::Gradient::Gradient(const Color &c1, const Color &c2)
-{
-       push_back(CPoint(0.0,c1));
-       push_back(CPoint(1.0,c2));
-}
-
-sinfg::Gradient::Gradient(const Color &c1, const Color &c2, const Color &c3)
-{
-       push_back(CPoint(0.0,c1));
-       push_back(CPoint(0.5,c2));
-       push_back(CPoint(1.0,c3));
-}
-
-// This sort algorithm MUST be stable
-// ie: it must not change the order of items with the same value.
-// I am using a bubble sort.
-// This algorithm will sort a nearly-sorted list at ~O(N), and
-// it will sort an inverse sorted list at ~O(N*N).
-void
-sinfg::Gradient::sort()
-{      
-       stable_sort(begin(),end());
-       /*
-       iterator iter;
-       iterator iter2,next;
-       
-       for(iter=begin();iter!=end();iter++)
-       {
-               for(next=iter, iter2=next--;iter2!=begin();iter2=next--)
-               {
-                       if(*iter<*next)
-                       {
-                               //insert(next,*iter);
-                               //erase(iter);
-                               iter_swap(next,iter);
-                               
-                               continue;
-                       }
-                       else
-                               break;
-               }
-       }
-       */
-}
-
-static sinfg::ColorAccumulator
-supersample_helper(const sinfg::Gradient::CPoint &color1, const sinfg::Gradient::CPoint &color2, float begin, float end, float &weight)
-{
-       if(color1.pos==color2.pos || color1.pos>=end || color2.pos<=begin)
-       {
-               weight=0;
-               return Color::alpha();
-       }               
-       if(color1.pos>=begin && color2.pos<end)
-       {
-               weight=color2.pos-color1.pos;
-               ColorAccumulator ret=Color::blend(color2.color,color1.color, 0.5, Color::BLEND_STRAIGHT);
-               ret.set_r(ret.get_r()*ret.get_a());
-               ret.set_g(ret.get_g()*ret.get_a());
-               ret.set_b(ret.get_b()*ret.get_a());
-               return ret*weight;
-       }
-       if(color1.pos>=begin && color2.pos>=end)
-       {
-               weight=end-color1.pos;
-               float pos((end+color1.pos)*0.5);
-               float amount((pos-color1.pos)/(color2.pos-color1.pos));
-               //if(abs(amount)>1)amount=(amount>0)?1:-1;
-               ColorAccumulator ret(Color::blend(color2.color,color1.color, amount, Color::BLEND_STRAIGHT));
-               ret.set_r(ret.get_r()*ret.get_a());
-               ret.set_g(ret.get_g()*ret.get_a());
-               ret.set_b(ret.get_b()*ret.get_a());
-               return ret*weight;
-       }
-       if(color1.pos<begin && color2.pos<end)
-       {
-               weight=color2.pos-begin;
-               float pos((begin+color2.pos)*0.5);
-               float amount((pos-color1.pos)/(color2.pos-color1.pos));
-               //if(abs(amount)>1)amount=(amount>0)?1:-1;
-               ColorAccumulator ret(Color::blend(color2.color,color1.color, amount, Color::BLEND_STRAIGHT));
-               ret.set_r(ret.get_r()*ret.get_a());
-               ret.set_g(ret.get_g()*ret.get_a());
-               ret.set_b(ret.get_b()*ret.get_a());
-               return ret*weight;
-       }
-       sinfg::error("color1.pos=%f",color1.pos);
-       sinfg::error("color2.pos=%f",color2.pos);
-       sinfg::error("begin=%f",begin);
-       sinfg::error("end=%f",end);
-
-       weight=0;
-       return Color::alpha();
-       
-//     assert(0);
-}
-       
-Color
-sinfg::Gradient::operator()(const Real &x,float supersample)const
-{
-       if(empty())
-               return Color(0,0,0,0);
-       if(supersample<0)
-               supersample=-supersample;
-       if(supersample>2.0)
-               supersample=2.0f;
-       
-       float begin_sample(x-supersample*0.5);
-       float end_sample(x+supersample*0.5);
-
-       if(size()==1 || end_sample<=front().pos || isnan(x))
-               return front().color;
-       
-       if(begin_sample>=back().pos)
-               return back().color;
-
-       /*
-       if(end_sample>=back().pos)
-               end_sample=back().pos;
-
-       if(begin_sample<=front().pos)
-               begin_sample=front().pos;
-       */
-       
-       const_iterator iter,next;
-
-       /*
-       //optimizize...
-       Real    left = x-supersample/2, right = x+supersample/2;
-       
-       if(left < front().pos) left = front().pos;
-       if(right > back().pos) right = back().pos;
-       
-       //find using binary search...
-       const_iterator iterl,iterr;
-       
-       //the binary search should give us the values BEFORE the point we're looking for...
-       iterl = binary_find(begin(),end(),left);
-       iterr = binary_find(iterl,end(),right);
-       
-       //now integrate over the range of left to right...
-       
-       if(iterl == iterr)
-       {
-               iterr++; //let's look at the next one shall we :)
-               
-               //interpolate neighboring colors
-               const Real one = iterr->pos - iterl->pos;
-               const Real lambda = (x - iterl->pos)/one;
-               
-               //(1-l)iterl + (l)iterr
-               return iterl->color.premult_alpha()*(1-lambda) + iterr->color.premult_alpha()*lambda;
-               
-               //return Color::blend(iterr->color,iterl->color,lambda,Color::BLEND_STRAIGHT);
-       }else
-       {
-               //itegration madness
-               const_iterator i = iterl, ie = iterr+1;
-               Real wlast = left;
-               
-               ColorAccumulator clast,cwork;
-               {
-                       const Real lambda = (x - iterl->pos)/(iterr->pos - iterl->pos);
-                       
-                       //premultiply because that's the form in which we can combine things...
-                       clast = iterl->color.premult_alpha()*(1-lambda) + iterr->color.premult_alpha()*lambda;
-                       //Color::blend((i+1)->color,i->color,(left - i->pos)/((i+1)->pos - i->pos),Color::BLEND_STRAIGHT);
-               }
-               
-               ColorAccumulator        accum = 0;
-               
-               //loop through all the trapezoids and integrate them as we go...
-               //      area of trap = (yi + yi1)*(xi1 - xi)
-               //      yi = clast, xi = wlast, yi1 = i->color, xi1 = i->pos            
-               
-               for(;i<=iterr; wlast=i->pos,clast=i->color.premult_alpha(),++i)
-               {
-                       const Real diff = i->pos - wlast;
-                       if(diff > 0) //only accumulate if there will be area to add
-                       {
-                               cwork = i->color.premult_alpha();
-                               accum += (cwork + clast)*diff;
-                       }
-               }
-               
-               {
-                       const_iterator ibef = i-1;                      
-                       const Real diff = right - ibef->pos;
-                       
-                       if(diff > 0)
-                       {
-                               const Real lambda = diff/(i->pos - ibef->pos);
-                               cwork = ibef->color.premult_alpha()*(1-lambda) + i->color.premult_alpha()*lambda;
-                               
-                               accum += (cwork + clast)*diff; //can probably optimize this more... but it's not too bad
-                       }
-               }
-               
-               accum /= supersample; //should be the total area it was sampled over...
-               return accum.demult_alpha();
-       }*/
-       
-       next=begin(),iter=next++;
-       
-       //add for optimization
-       next = binary_find(begin(),end(),(Real)begin_sample);
-       iter = next++;  
-       
-       //! As a future optimization, this could be performed faster
-       //! using a binary search.
-       for(;iter<end();iter=next++)
-       {
-               if(next==end() || x>=iter->pos &&  x<next->pos && iter->pos!=next->pos)
-               {
-                       // If the supersample region falls square in between
-                       // two CPoints, then we don't have to do anything special.
-                       if(next!=end() && (!supersample || (iter->pos<=begin_sample && next->pos>=end_sample)))
-                       {
-                               const Real dist(next->pos-iter->pos);
-                               const Real pos(x-iter->pos);
-                               const Real amount(pos/dist);
-                               return Color::blend(next->color,iter->color, amount, Color::BLEND_STRAIGHT);
-                       }
-                       // In this case our supersample region extends over one or more
-                       // CPoints. So, we need to calculate our coverage amount.
-                       ColorAccumulator pool(Color::alpha());
-                       float divisor(0.0),weight(0);
-                       
-                       const_iterator iter2,next2;
-                       iter2=iter;
-                       if(iter==begin() && iter->pos>x)
-                       {
-                               weight=x-iter->pos;
-                               //weight*=iter->color.get_a();
-                               pool+=ColorAccumulator(iter->color)*(float)iter->color.get_a()*weight;
-                               divisor+=weight;
-                       }
-                       else
-                       {
-                               while(iter2->pos>=begin_sample)
-                               {
-                                       if(iter2==begin())
-                                       {
-                                               weight=iter2->pos-(begin_sample);
-                                               //weight*=iter2->color.get_a();
-                                               pool+=ColorAccumulator(iter2->color)*(float)iter2->color.get_a()*weight;
-                                               divisor+=weight;
-                                               break;
-                                       }
-                                       next2=iter2--;
-                                       pool+=supersample_helper(*iter2, *next2, begin_sample, end_sample, weight);
-                                       divisor+=weight;
-                               }
-                       }
-                       
-                       next2=iter;
-                       iter2=next2++;
-                       while(iter2->pos<=end_sample)
-                       {
-                               if(next2==end())
-                               {
-                                       weight=(end_sample)-iter2->pos;
-                                       pool+=ColorAccumulator(iter2->color)*(float)iter2->color.get_a()*weight;
-                                       divisor+=weight;
-                                       break;
-                               }
-                               pool+=supersample_helper(*iter2, *next2, begin_sample, end_sample, weight);
-                               divisor+=weight;
-                               iter2=next2++;
-                       }
-                       
-                       if(divisor && pool.get_a() && pool.is_valid())
-                       {
-/*
-                               pool.set_r(pool.get_r()/pool.get_a());
-                               pool.set_g(pool.get_g()/pool.get_a());
-                               pool.set_b(pool.get_b()/pool.get_a());
-                               pool.set_a(pool.get_a()/divisor);
-*/
-                               pool/=divisor;
-                               pool.set_r(pool.get_r()/pool.get_a());
-                               pool.set_g(pool.get_g()/pool.get_a());
-                               pool.set_b(pool.get_b()/pool.get_a());
-                               if(pool.is_valid())
-                                       return pool;
-                               else
-                                       return Color::alpha();
-                       }
-                       else
-                               return Color::alpha();
-               }
-       }
-
-       // We should never get to this point.
-
-       sinfg::error("sinfg::Gradient::operator()(): Logic Error (x=%f)",x);
-       assert(0);
-       throw std::logic_error(strprintf("sinfg::Gradient::operator()(): Logic Error (x=%f)",x));
-}
-
-sinfg::Gradient::iterator
-sinfg::Gradient::proximity(const Real &x)
-{
-       iterator iter;
-       float dist(100000000);
-       float prev_pos(-0230);
-       // This algorithm requires a sorted list.
-       for(iter=begin();iter<end();iter++)
-       {
-               float new_dist;
-               
-               if(prev_pos==iter->pos)
-                       new_dist=(abs(x-iter->pos-0.00001));
-               else
-                       new_dist=(abs(x-iter->pos));
-               
-               if(new_dist>dist)
-               {
-                       iter--;
-                       return iter;
-               }
-               dist=new_dist;
-               prev_pos=iter->pos;
-       }
-       iter--;
-       return iter;
-}
-
-sinfg::Gradient::const_iterator
-sinfg::Gradient::proximity(const Real &x)const
-{
-       return const_cast<Gradient*>(this)->proximity(x);
-       /*
-       const_iterator iter;
-       float dist(100000000);
-       
-       // This algorithm requires a sorted list.
-       for(iter=begin();iter<end();iter++)
-       {
-               const float new_dist(abs(x-iter->pos));
-               if(new_dist>dist)
-               {
-                       iter--;
-                       return iter;
-               }
-               dist=new_dist;
-       }
-       iter--;
-       return iter;
-       */
-}
-
-sinfg::Gradient::iterator
-sinfg::Gradient::find(const UniqueID &id)
-{
-       iterator iter;
-       
-       for(iter=begin();iter<end();iter++)
-       {
-               if(id==*iter)
-                       return iter;
-       }
-       
-       throw Exception::NotFound("sinfg::Gradient::find(): Unable to find UniqueID in gradient");
-}
-       
-sinfg::Gradient::const_iterator
-sinfg::Gradient::find(const UniqueID &id)const
-{
-       const_iterator iter;
-       
-       for(iter=begin();iter<end();iter++)
-       {
-               if(id==*iter)
-                       return iter;
-       }
-       
-       throw Exception::NotFound("sinfg::Gradient::find()const: Unable to find UniqueID in gradient");
-}
diff --git a/synfig-core/trunk/src/sinfg/gradient.h b/synfig-core/trunk/src/sinfg/gradient.h
deleted file mode 100644 (file)
index 6bfe0a1..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file gradient.h
-**     \brief Color Gradient Class
-**
-**     $Id: gradient.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_GRADIENT_H
-#define __SINFG_GRADIENT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "real.h"
-#include "color.h"
-#include <vector>
-#include <utility>
-#include "uniqueid.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*! \struct GradientCPoint
-**     \brief \todo
-*/
-struct GradientCPoint : public UniqueID
-{
-       Real pos;
-       Color color;
-       
-       bool operator<(const GradientCPoint &rhs)const { return pos<rhs.pos; }
-       bool operator<(const Real &rhs)const { return pos<rhs; }
-       
-       GradientCPoint() { }
-       GradientCPoint(const Real &pos, const Color &color):pos(pos),color(color) { }
-}; // END of class GradientCPoint
-
-       
-/*! \class Gradient
-**     \brief Color Gradient Class
-*/
-class Gradient : public std::vector<GradientCPoint>
-{
-public:
-       typedef GradientCPoint CPoint;
-private:
-       
-public:
-       Gradient() { }
-       
-       //! Two-Tone Color Gradient Convience Constructor
-       Gradient(const Color &c1, const Color &c2);
-
-       //! Three-Tone Color Gradient Convience Constructor
-       Gradient(const Color &c1, const Color &c2, const Color &c3);
-
-       //! Alias for sort (Implemented for consistancy)
-       void sync() { sort(); }
-
-       //! You should call this function after changing stuff.
-       void sort();
-       
-       Color operator()(const Real &x, float supersample=0)const;
-
-       //! Returns the iterator of the CPoint closest to \a x
-       iterator proximity(const Real &x);
-
-       //! Returns the const_iterator of the CPoint closest to \a x
-       const_iterator proximity(const Real &x)const;
-
-       //! Returns the iterator of the CPoint with UniqueID \a id
-       iterator find(const UniqueID &id);
-       
-       //! Returns the const_iterator of the CPoint with UniqueID \a id
-       const_iterator find(const UniqueID &id)const;
-}; // END of class Gradient
-       
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/guid.cpp b/synfig-core/trunk/src/sinfg/guid.cpp
deleted file mode 100644 (file)
index 0c94eb5..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file guid.cpp
-**     \brief Template File
-**
-**     $Id: guid.cpp,v 1.4 2005/01/13 06:48:39 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define HASH_MAP_H <ext/hash_map>
-#define SUBTRACT_RNG_H <ext/functional>
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "guid.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <ETL/stringf>
-#include <functional>
-
-#ifdef _DEBUG
-#include "general.h"
-#endif
-
-#ifdef HASH_MAP_H
-#include HASH_MAP_H
-using namespace __gnu_cxx;
-#endif
-
-#ifdef SUBTRACT_RNG_H
-#include SUBTRACT_RNG_H
-using namespace __gnu_cxx;
-#endif
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define MANUAL_GUID_CALC
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-// A fast 32-bit linear congruential random number generator
-class quick_rng
-{
-       unsigned long next;
-public:
-       quick_rng(unsigned long seed=0):next(seed) { }
-
-       void set_seed(unsigned long x)
-       {
-               next=x;
-       }
-       
-       unsigned long i32()
-       {
-               static const unsigned long a(1664525);
-               static const unsigned long c(1013904223);
-               
-               return next=next*a+c;
-       }
-
-       unsigned long i16()
-       {
-               return i32()>>16;
-       }
-
-       float f()
-       {
-               static const float m(int(65535));
-               
-               return float(i16())/m;
-       }
-       
-       unsigned long operator()(const unsigned long& m)
-       {
-               if(m==65536)
-                       return i16();
-               else
-               if(m<=65536)
-                       return i16()%m;
-               else
-                       return i32()%m;
-       }
-};
-
-#define GUID_RNG quick_rng
-//#define GUID_RNG subtractive_rng
-
-
-
-#ifdef MANUAL_GUID_CALC
-#include <time.h>
-static GUID_RNG _a, _b;
-static void _set_up_rand_long_long(uint64_t &x);
-static void _get_rand_long_long(uint64_t &x);
-static void (*get_rand_long_long)(uint64_t&)=_set_up_rand_long_long;
-static void _set_up_rand_long_long(uint64_t &x)
-{
-#ifdef _DEBUG
-       sinfg::info("Starting up GUID system...");
-#endif
-       _a=GUID_RNG(time(0)+clock());
-       _b=GUID_RNG(clock());
-       get_rand_long_long=_get_rand_long_long;
-       _get_rand_long_long(x);
-}
-
-static void _get_rand_long_long(uint64_t &x)
-{
-       //subtractive_rng _c(clock());
-       unsigned short* data(reinterpret_cast<unsigned short *>(&x));
-       data[0]=_a(65536);      
-       data[1]=_a(65536);      
-       data[2]=_a(65536);      
-       data[3]=_a(65536);      
-}
-
-#else
-// Use OS-Dependent method
-
-#ifdef _WIN32
-// Win32
-static void get_rand_long_long(uint64_t &x)
-{
-       _GUID* guid(reinterpret_cast<_GUID*>(&x));
-       CoCreateGuid(guid);     
-}
-
-#else
-// Unix
-static int rand_fd;
-static void _set_up_rand_long_long(uint64_t &x);
-static void _get_rand_long_long(uint64_t &x);
-static void (*get_rand_long_long)(uint64_t&)=_set_up_rand_long_long;
-static void _set_up_rand_long_long(uint64_t &x)
-{
-#ifdef _DEBUG
-       sinfg::info("Starting up GUID system...");
-#endif
-       rand_fd=open("/dev/urandom",O_RDONLY);
-       get_rand_long_long=_get_rand_long_long;
-       _get_rand_long_long(x);
-}
-
-static void _get_rand_long_long(uint64_t &x){  read(rand_fd,&x,sizeof(x));}
-
-#endif
-#endif
-
-
-
-void
-sinfg::GUID::make_unique()
-{
-       get_rand_long_long(data.u_64.a);
-       get_rand_long_long(data.u_64.b);
-}
-
-sinfg::GUID
-sinfg::GUID::hasher(const String& str)
-{      
-#ifdef HASH_MAP_H
-       hash<const char*> string_hash_;
-       const unsigned int seed(
-               string_hash_(
-                       str.c_str()
-               )
-       );
-#else
-       const unsigned int seed(0x3B642879);
-       for(int i=0;i<str.size();i++)
-       {
-               seed^=(seed*str[i])*i
-               seed=(seed>>(32-(i%24)))^(seed<<(i%24))
-       }
-#endif
-       
-       GUID_RNG random(seed);
-       GUID ret(0);
-       ret.data.u_32.a=random(~(unsigned int)0);
-       ret.data.u_32.b=random(~(unsigned int)0);
-       ret.data.u_32.c=random(~(unsigned int)0);
-       ret.data.u_32.d=random(~(unsigned int)0);
-       return ret;
-}
-
-sinfg::GUID
-sinfg::GUID::hasher(int i)
-{
-       GUID ret(0);
-       GUID_RNG random(i);
-       ret.data.u_32.a=random(~(unsigned int)0);
-       ret.data.u_32.b=random(~(unsigned int)0);
-       ret.data.u_32.c=random(~(unsigned int)0);
-       ret.data.u_32.d=random(~(unsigned int)0);
-       return ret;
-}
-
-String
-sinfg::GUID::get_string()const
-{
-       return strprintf("%08X%08X%08X%08X",data.u_32.a,data.u_32.b,data.u_32.c,data.u_32.d);
-}
-
-sinfg::GUID::GUID(const String &str)
-{
-       strscanf(str,"%08X%08X%08X%08X",&data.u_32.a,&data.u_32.b,&data.u_32.c,&data.u_32.d);
-}
diff --git a/synfig-core/trunk/src/sinfg/guid.h b/synfig-core/trunk/src/sinfg/guid.h
deleted file mode 100644 (file)
index 791f29f..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file guid.h
-**     \brief Template Header
-**
-**     $Id: guid.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_GUID_H
-#define __SINFG_GUID_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "string.h"
-#include <stdint.h>
-#include <cassert>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-class GUID
-{
-       union {
-               struct {
-                       unsigned int a;
-                       unsigned int b;
-                       unsigned int c;
-                       unsigned int d;
-               } u_32;
-               struct {
-                       uint64_t a;
-                       uint64_t b;
-               } u_64;
-                       
-       } data;
-       
-public:
-       GUID()
-               { make_unique(); }      
-       GUID(const GUID& x):data(x.data)
-               { }
-       GUID(const int i){assert(!i); data.u_64.a=0;data.u_64.b=0;}
-
-       GUID(const String& str);
-       
-       static GUID zero() { return GUID(0); }
-       static GUID hasher(const String& str);
-       static GUID hasher(int i);
-
-       operator bool()const { return data.u_32.a||data.u_32.b||data.u_32.c||data.u_32.d; }
-       
-       uint64_t get_hi()const { return data.u_64.a; }
-       uint64_t get_lo()const { return data.u_64.b; }
-
-       uint64_t get_hi_hi()const { return data.u_32.a; }
-       uint64_t get_hi_lo()const { return data.u_32.b; }
-       uint64_t get_lo_hi()const { return data.u_32.c; }
-       uint64_t get_lo_lo()const { return data.u_32.d; }
-       
-       void make_unique();
-       String get_string()const;
-       
-       bool operator==(const GUID& rhs)const
-               { return data.u_64.a==rhs.data.u_64.a && data.u_64.b==rhs.data.u_64.b; }
-       bool operator!=(const GUID& rhs)const
-               { return data.u_64.a!=rhs.data.u_64.a || data.u_64.b!=rhs.data.u_64.b; }
-       bool operator<(const GUID& rhs)const
-               { return (data.u_64.a==rhs.data.u_64.a)?(data.u_64.b<rhs.data.u_64.b):(data.u_64.a<rhs.data.u_64.a); }
-       bool operator>(const GUID& rhs)const
-               { return (data.u_64.a==rhs.data.u_64.a)?(data.u_64.b>rhs.data.u_64.b):(data.u_64.a>rhs.data.u_64.a); }
-       bool operator<=(const GUID& rhs)const
-               { return operator<(rhs) || operator==(rhs); }
-       bool operator>=(const GUID& rhs)const
-               { return operator>(rhs) || operator==(rhs); }
-
-       //! Operator '^' (xor)
-       /*! If A ^ B == C, then C ^ B == A and B ^ A == C.
-       **      Also keep in mind that A ^ A == 0 and A ^ B ^ B = A. */
-       GUID& operator^=(const GUID& rhs)
-       {
-               data.u_32.a^=rhs.data.u_32.a;
-               data.u_32.b^=rhs.data.u_32.b;
-               data.u_32.c^=rhs.data.u_32.c;
-               data.u_32.d^=rhs.data.u_32.d;
-               return *this;
-       }
-       GUID operator^(const GUID& rhs)const { return GUID(*this)^=rhs; }
-       
-       //! Operator '%' (alt-xor)
-       /*! A % B != B % A. */
-       GUID& operator%=(const GUID& rhs)
-       {
-               data.u_32.a^=rhs.data.u_32.b;
-               data.u_32.b^=rhs.data.u_32.c;
-               data.u_32.c^=rhs.data.u_32.d;
-               data.u_32.d^=rhs.data.u_32.a;
-               return *this;
-       }
-       GUID operator%(const GUID& rhs)const { return GUID(*this)%=rhs; }
-
-};
-
-class GUIDHash
-{
-public:
-       size_t operator()(const GUID& guid)const
-       {
-               return
-                       guid.get_hi_hi()+
-                       guid.get_hi_lo()+
-                       guid.get_lo_hi()+
-                       guid.get_lo_lo();
-       }
-};
-
-};
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/guidset.h b/synfig-core/trunk/src/sinfg/guidset.h
deleted file mode 100644 (file)
index 7ca424c..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file guidset.h
-**     \brief Template Header
-**
-**     $Id: guidset.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_GUIDSET_H
-#define __SINFG_GUIDSET_H
-
-#define HASH_SET_H <ext/hash_set>
-
-/* === H E A D E R S ======================================================= */
-
-#include "guid.h"
-
-#ifdef HASH_SET_H
-#include HASH_SET_H
-#else
-#include <set>
-#endif
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-class GUIDSet : public
-#ifdef HASH_SET_H
-std::set<sinfg::GUID>
-#else
-std::hash_set<sinfg::GUID,sinfg::GUIDHash>
-#endif
-{
-}; // END of class GUIDSet
-       
-};
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/importer.cpp b/synfig-core/trunk/src/sinfg/importer.cpp
deleted file mode 100644 (file)
index 6fb66cb..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file importer.cpp
-**     \brief writeme
-**
-**     $Id: importer.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "canvas.h"
-#include "importer.h"
-#include "surface.h"
-#include <algorithm>
-#include "string.h"
-#include <map>
-#include <ctype.h>
-#include <functional>
-
-#endif
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-using namespace etl;
-using namespace std;
-using namespace sinfg;
-
-Importer::Book* sinfg::Importer::book_;
-
-map<String,Importer::LooseHandle> *__open_importers;
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-bool
-Importer::subsys_init()
-{
-       book_=new Book();
-       __open_importers=new map<String,Importer::LooseHandle>();
-       return true;
-}
-
-bool
-Importer::subsys_stop()
-{
-       delete book_;
-       delete __open_importers;
-       return true;
-}
-
-Importer::Book&
-Importer::book()
-{
-       return *book_;
-}
-
-Importer::Handle
-Importer::open(const String &filename)
-{
-       if(filename.empty())
-       {
-               sinfg::error(_("Importer::open(): Cannot open empty filename"));
-               return 0;
-       }
-       
-       // If we already have an importer open under that filename,
-       // then use it instead.
-       if(__open_importers->count(filename))
-       {
-               //sinfg::info("Found importer already open, using it...");
-               return (*__open_importers)[filename];
-       }
-       
-       if(find(filename.begin(),filename.end(),'.')==filename.end())
-       {
-               sinfg::error(_("Importer::open(): Couldn't find extension"));
-               return 0;
-       }
-               
-       String ext=string(filename.begin()+filename.find_last_of('.')+1,filename.end());
-       std::transform(ext.begin(),ext.end(),ext.begin(),&::tolower);
-       
-       
-       if(!Importer::book().count(ext))
-       {
-               sinfg::error(_("Importer::open(): Unknown file type -- ")+ext);
-               return 0;
-       }
-       
-       try {
-               Importer::Handle importer;
-               importer=Importer::book()[ext](filename.c_str());
-               (*__open_importers)[filename]=importer;
-               return importer;
-       }
-       catch (String str)
-       {
-               sinfg::error(str);
-       }
-       return 0;
-}
-
-Importer::Importer():
-       gamma_(2.2)
-{
-}
-
-
-Importer::~Importer()
-{
-       // Remove ourselves from the open importer list
-       map<String,Importer::LooseHandle>::iterator iter;
-       for(iter=__open_importers->begin();iter!=__open_importers->end();++iter)
-               if(iter->second==this)
-               {
-                       __open_importers->erase(iter);
-               }
-}
diff --git a/synfig-core/trunk/src/sinfg/importer.h b/synfig-core/trunk/src/sinfg/importer.h
deleted file mode 100644 (file)
index 40a5717..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file importer.h
-**     \brief writeme
-**
-**     $Id: importer.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_IMPORTER_H
-#define __SINFG_IMPORTER_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <map>
-//#include <cmath>
-#include <ETL/handle>
-#include "string.h"
-//#include "surface.h"
-//#include "general.h"
-//#include "vector.h"
-#include "time.h"
-#include "gamma.h"
-
-/* === M A C R O S ========================================================= */
-
-//! \writeme
-#define SINFG_IMPORTER_MODULE_EXT public: static const char name__[], version__[], ext__[],cvs_id__[]; static Importer *create(const char *filename);
-
-//! Sets the name of the importer
-#define SINFG_IMPORTER_SET_NAME(class,x) const char class::name__[]=x
-
-//! \writeme
-#define SINFG_IMPORTER_SET_EXT(class,x) const char class::ext__[]=x
-
-//! Sets the version of the importer
-#define SINFG_IMPORTER_SET_VERSION(class,x) const char class::version__[]=x
-
-//! Sets the CVS ID of the importer
-#define SINFG_IMPORTER_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
-
-//! \writeme
-#define SINFG_IMPORTER_INIT(class) sinfg::Importer* class::create(const char *filename) { return new class(filename); }
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Surface;
-class ProgressCallback;
-
-/*!    \class Importer
-**     \brief Used for importing bitmaps of various formats, including animations
-**     \todo Write more detailed description
-*/
-class Importer : public etl::shared_object
-{
-public:
-       typedef Importer* (*Factory)(const char *filename);
-       typedef std::map<String,Factory> Book;
-       static Book* book_;
-       
-       static Book& book();
-       
-       static bool subsys_init();
-       static bool subsys_stop();
-
-       typedef etl::handle<Importer> Handle;
-       typedef etl::loose_handle<Importer> LooseHandle;
-       typedef etl::handle<const Importer> ConstHandle;
-
-private:
-       Gamma gamma_;
-
-protected:
-       Importer();
-
-public:
-
-       Gamma& gamma() { return gamma_; }
-       const Gamma& gamma()const { return gamma_; }
-       
-       virtual ~Importer();
-
-       //! Gets a frame and puts it into \a surface
-       /*!     \param  surface Reference to surface to put frame into
-       **      \param  time    For animated importers, determines which frame to get.
-       **              For static importers, this parameter is unused.
-       **      \param  callback Pointer to callback class for progress, errors, etc.
-       **      \return \c true on success, \c false on error
-       **      \see ProgressCallback, Surface
-       */
-       virtual bool get_frame(Surface &surface,Time time, ProgressCallback *callback=NULL)=0;
-
-       //! Returns \c true if the importer pays attention to the \a time parameter of get_frame()
-       virtual bool is_animated() { return false; }
-
-       //! Attempts to open \a filename, and returns a handle to the associated Importer
-       static Handle open(const String &filename);
-};
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/interpolation.h b/synfig-core/trunk/src/sinfg/interpolation.h
deleted file mode 100644 (file)
index 43db1ea..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file interpolation.h
-**     \brief Template Header
-**
-**     $Id: interpolation.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_INTERPOLATION_H
-#define __SINFG_INTERPOLATION_H
-
-/* === H E A D E R S ======================================================= */
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg { 
-
-enum Interpolation
-{
-       INTERPOLATION_TCB,
-       INTERPOLATION_CONSTANT,
-       INTERPOLATION_LINEAR,
-       INTERPOLATION_HALT,
-       INTERPOLATION_MANUAL,
-       INTERPOLATION_UNDEFINED,
-       INTERPOLATION_NIL
-}; // END enum Interpolation
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/keyframe.cpp b/synfig-core/trunk/src/sinfg/keyframe.cpp
deleted file mode 100644 (file)
index b776a3e..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframe.cpp
-**     \brief Template File
-**
-**     $Id: keyframe.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include <algorithm>
-
-#include <ETL/stringf>
-
-#include "keyframe.h"
-#include "exception.h"
-#include "general.h"
-#include <ETL/misc>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Keyframe::Keyframe():
-       time_(0)
-{
-}
-
-Keyframe::Keyframe(const Time &time):
-       time_(time)
-{
-}
-
-Keyframe::~Keyframe()
-{
-}
-
-void
-KeyframeList::dump()const
-{
-       const_iterator iter;
-       int i;
-       sinfg::info(">>>>>>>>BEGIN KEYFRAME DUMP");
-       for(iter=begin(),i=0;iter!=end();++iter,i++)
-       {
-               sinfg::info("#%d, time: %s, desc: %s",i,iter->get_time().get_string().c_str(),iter->get_description().c_str());
-       }
-       sinfg::info("<<<<<<<<END KEYFRAME DUMP");
-}
-
-void
-KeyframeList::sync()
-{
-       //DEBUGPOINT();
-       //sinfg::info("PRE-SORT:");
-       //dump();       
-       sort(begin(),end());
-       //sinfg::info("POST-SORT:");
-       //dump();
-       //DEBUGPOINT();
-}
-
-KeyframeList::iterator
-KeyframeList::find(const UniqueID &x)
-{
-       KeyframeList::iterator iter;
-       iter=std::find(begin(),end(),x);
-       if(iter==end())
-               throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find UniqueID %d",x.get_uid()));
-       return iter;
-}
-
-KeyframeList::const_iterator
-KeyframeList::find(const UniqueID &x)const
-{
-       KeyframeList::const_iterator iter;
-       iter=std::find(begin(),end(),x);
-       if(iter==end())
-               throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find UniqueID %d",x.get_uid()));
-       return iter;
-}
-
-KeyframeList::iterator
-KeyframeList::add(const Keyframe &x)
-{
-       push_back(x);
-       iterator ret(end());
-       ret--;
-       assert(x==*ret);
-       sync();
-       return ret;
-}
-
-void
-KeyframeList::erase(const UniqueID &x)
-{
-       std::vector<Keyframe>::erase(find(x));
-}
-
-KeyframeList::iterator
-KeyframeList::find(const Time &x)
-{
-       KeyframeList::iterator iter;
-       iter=binary_find(begin(),end(),x);
-       if(iter!=end() && iter->get_time().is_equal(x))
-               return iter;
-/*     iter++;
-       if(iter!=end() && iter->get_time().is_equal(x))
-               return iter;
-*/
-       throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find Keyframe %s",x.get_string().c_str()));
-}
-
-KeyframeList::iterator
-KeyframeList::find_next(const Time &x)
-{
-       KeyframeList::iterator iter(binary_find(begin(),end(),x));
-
-       if(iter!=end())
-       {
-               if(iter->get_time().is_more_than(x))
-                       return iter;
-               ++iter;
-               if(iter!=end())
-               {
-                       if(iter->get_time().is_more_than(x))
-                               return iter;
-/*                     ++iter;
-                       if(iter!=end() && iter->get_time().is_more_than(x))
-                               return iter;
-*/
-               }
-       }
-       
-       throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find next Keyframe %s",x.get_string().c_str()));
-}
-
-
-KeyframeList::iterator
-KeyframeList::find_prev(const Time &x)
-{
-       KeyframeList::iterator iter(binary_find(begin(),end(),x));
-
-       if(iter!=end())
-       {
-               if(iter->get_time()+Time::epsilon()<x)
-                       return iter;
-               if(iter!=begin() && (--iter)->get_time()+Time::epsilon()<x)
-                       return iter;
-       }
-       throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find prev Keyframe %s",x.get_string().c_str()));
-
-}
-
-
-
-KeyframeList::const_iterator
-KeyframeList::find(const Time &x)const
-{
-       return const_cast<KeyframeList*>(this)->find(x);
-}
-
-
-KeyframeList::const_iterator
-KeyframeList::find_next(const Time &x)const
-{
-       return const_cast<KeyframeList*>(this)->find_next(x);
-
-}
-
-
-KeyframeList::const_iterator
-KeyframeList::find_prev(const Time &x)const
-{
-       return const_cast<KeyframeList*>(this)->find_prev(x);
-
-}
-
-void
-KeyframeList::find_prev_next(const Time& time, Time &prev, Time &next)const
-{
-       try { prev=find_prev(time)->get_time(); }
-       catch(...) { prev=Time::begin(); }
-       try { next=find_next(time)->get_time(); }
-       catch(...) { next=Time::end(); }
-}
-
-void
-KeyframeList::insert_time(const Time& location, const Time& delta)
-{
-//     sinfg::info("KeyframeList::insert_time(): loc=%s, delta=%s",location.get_string().c_str(),delta.get_string().c_str());
-       if(!delta)
-               return;
-       try
-       {
-               iterator iter(find_next(location));
-               for(;iter!=end();++iter)
-               {
-                       iter->set_time(iter->get_time()+delta);
-               }
-               sync();
-       }
-       catch(Exception::NotFound) { }
-}
diff --git a/synfig-core/trunk/src/sinfg/keyframe.h b/synfig-core/trunk/src/sinfg/keyframe.h
deleted file mode 100644 (file)
index 0639898..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframe.h
-**     \brief Template Header
-**
-**     $Id: keyframe.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_KEYFRAME_H
-#define __SINFG_KEYFRAME_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/handle>
-#include <vector>
-#include "string.h"
-#include "time.h"
-#include "uniqueid.h"
-#include "guid.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-//! \writeme
-class Keyframe :  public UniqueID
-{
-public:
-
-       Time time_;
-       String desc_;
-       GUID guid_;
-       
-public:
-
-       Keyframe();
-
-       Keyframe(const Time &time);
-
-       ~Keyframe();
-
-       void set_time(Time x) { time_=x; }
-       
-       Time get_time()const { return time_; }
-
-       void set_description(String x) { desc_=x; }
-       
-       String get_description()const { return desc_; }
-
-       const GUID& get_guid()const { return guid_; }
-       void set_guid(const GUID& x) { guid_=x; }
-
-       using UniqueID::operator<;
-       using UniqueID::operator==;
-       using UniqueID::operator!=;
-       using UniqueID::operator=;
-       
-       bool operator<(const Keyframe &rhs)const { return time_<rhs.time_; }
-       bool operator<(const Time &rhs)const { return time_<rhs; }
-
-//     bool operator==(const Keyframe &rhs)const { return id_==rhs.id_; }
-       bool operator==(const Time &rhs)const { return time_==rhs; }
-
-//     bool operator!=(const Keyframe &rhs)const { return id_!=rhs.id_; }
-       bool operator!=(const Time &rhs)const { return time_!=rhs; }
-}; // END of class Keyframe
-
-class KeyframeList : public std::vector<Keyframe>
-{
-
-public:
-
-       iterator add(const Keyframe &x);
-
-       void erase(const UniqueID &x);
-
-       iterator find(const UniqueID &x);
-
-       const_iterator find(const UniqueID &x)const;
-
-       //! Finds the keyframe at an exact point in time
-       iterator find(const Time &x);
-
-       //! Finds the keyframe after that point in time
-       iterator find_next(const Time &x);
-
-       //! Finds the keyframe before that point in time
-       iterator find_prev(const Time &x);
-
-       const_iterator find(const Time &x)const;
-       const_iterator find_next(const Time &x)const;
-       const_iterator find_prev(const Time &x)const;
-       
-       void find_prev_next(const Time& time, Time &prev, Time &next)const;
-
-       void insert_time(const Time& location, const Time& delta);
-
-       void dump()const;
-       void sync();    
-};
-
-//typedef std::list<Keyframe> KeyframeList;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer.cpp b/synfig-core/trunk/src/sinfg/layer.cpp
deleted file mode 100644 (file)
index 24597cf..0000000
+++ /dev/null
@@ -1,564 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer.cpp
-**     \brief Layer class implementation
-**
-**     $Id: layer.cpp,v 1.2 2005/01/24 03:08:17 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "canvas.h"
-#include "layer.h"
-#include "render.h"
-#include "value.h"
-#include "layer_bitmap.h"
-#include "layer_mime.h"
-#include "context.h"
-#include "paramdesc.h"
-
-#include "layer_solidcolor.h"
-#include "layer_polygon.h"
-#include "layer_pastecanvas.h"
-#include "layer_motionblur.h"
-
-#include "valuenode_const.h"
-
-#include "transform.h"
-#include "rect.h"
-#include "guid.h"
-
-#include <sigc++/adaptors/bind.h>
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace etl;
-using namespace std;
-using namespace sinfg;
-
-/* === G L O B A L S ======================================================= */
-
-static Layer::Book* _layer_book;
-
-struct _LayerCounter
-{
-       static int counter;
-       ~_LayerCounter()
-       {
-               if(counter)
-                       sinfg::error("%d layers not yet deleted!",counter);
-       }
-} _layer_counter;
-
-int _LayerCounter::counter(0);
-
-/* === P R O C E D U R E S ================================================= */
-
-Layer::Book&
-Layer::book()
-{
-       return *_layer_book;
-}
-
-void
-Layer::register_in_book(const BookEntry &entry)
-{
-       book()[entry.name]=entry;
-}
-
-bool
-Layer::subsys_init()
-{
-       _layer_book=new Book();
-
-#define INCLUDE_LAYER(class)   sinfg::Layer::book()[sinfg::String(class::name__)]=BookEntry(class::create,class::name__,class::local_name__,class::category__,class::cvs_id__,class::version__)
-#define LAYER_ALIAS(class,alias)       sinfg::Layer::book()[sinfg::String(alias)]=sinfg::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);
-
-#undef INCLUDE_LAYER
-
-       return true;
-}
-
-bool
-Layer::subsys_stop()
-{
-       delete _layer_book;
-       return true;
-}
-
-/* === M E T H O D S ======================================================= */
-
-Layer::Layer():
-       active_(true),
-       z_depth_(0.0f),
-       dirty_time_(Time::end())
-{
-       _LayerCounter::counter++;
-}
-
-Layer::LooseHandle
-sinfg::Layer::create(const String &name)
-{
-       if(!book().count(name))
-       {
-               return Layer::LooseHandle(new Layer_Mime(name));
-       }
-       
-       Layer* layer(book()[name].factory());
-       return Layer::LooseHandle(layer);
-}
-
-sinfg::Layer::~Layer()
-{
-       _LayerCounter::counter--;
-       while(!dynamic_param_list_.empty())
-       {
-               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
-sinfg::Layer::set_canvas(etl::loose_handle<sinfg::Canvas> x)
-{
-       if(canvas_!=x)
-       {
-               parent_death_connect_.disconnect();
-               canvas_=x;
-               if(x)
-               {
-                       parent_death_connect_=x->signal_deleted().connect(
-                               sigc::bind(
-                                       sigc::mem_fun(
-                                               *this,
-                                               &Layer::set_canvas
-                                       ),
-                                       etl::loose_handle<sinfg::Canvas>(0)
-                               )
-                       );
-               }
-               on_canvas_set();
-       }
-}
-
-void
-sinfg::Layer::on_canvas_set()
-{
-}
-
-etl::loose_handle<sinfg::Canvas>
-sinfg::Layer::get_canvas()const
-{
-       return canvas_;
-}
-
-int
-Layer::get_depth()const
-{
-       if(!get_canvas())
-               return -1;
-       return get_canvas()->get_depth(const_cast<sinfg::Layer*>(this));
-}
-
-void
-Layer::set_active(bool x)
-{
-       if(active_!=x)
-       {
-               active_=x;
-
-               Node::on_changed();
-               signal_status_changed_();
-       }
-}
-
-void
-Layer::set_description(const String& x)
-{
-       if(description_!=x)
-       {
-               description_=x;
-               signal_description_changed_();          
-       }
-}
-
-bool
-Layer::connect_dynamic_param(const String& param, etl::loose_handle<ValueNode> value_node)
-{
-       ValueNode::Handle previous(dynamic_param_list_[param]);
-
-       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;
-}
-
-bool
-Layer::disconnect_dynamic_param(const String& param)
-{
-       ValueNode::Handle previous(dynamic_param_list_[param]);
-
-       if(previous)
-       {
-               dynamic_param_list_.erase(param);
-               remove_child(previous.get());
-               changed();
-       }
-       return true;
-}
-
-void
-Layer::on_changed()
-{
-       dirty_time_=Time::end();
-       if(active())
-               Node::on_changed();
-}
-
-bool
-Layer::set_param(const String &param, const ValueBase &value)
-{
-       if(param=="z_depth" && value.same_as(z_depth_))
-       {
-               z_depth_=value.get(z_depth_);
-               return true;
-       }
-       return false;
-}
-
-etl::handle<Transform>
-Layer::get_transform()const
-{
-       return 0;
-}
-
-float
-Layer::get_z_depth(const sinfg::Time& t)const
-{
-       if(!dynamic_param_list().count("z_depth"))
-               return z_depth_;
-       return (*dynamic_param_list().find("z_depth")->second)(t).get(Real());
-}
-
-Layer*
-Layer::simple_clone()const
-{
-       if(!book().count(get_name())) return 0;
-       Layer *ret = create(get_name()).get();
-       ret->set_canvas(get_canvas());
-       ret->set_description(get_description());
-       ret->set_param_list(get_param_list());
-       return ret;
-}
-
-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
-       ParamList param_list(get_param_list());
-       for(ParamList::const_iterator iter(param_list.begin()); iter != param_list.end(); ++iter)
-       {
-               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())
-                       {
-                               // This parameter is an inlinecanvas! we need to clone it
-                               // before we set it as aparameter.
-                               Canvas::Handle new_canvas(canvas->clone(deriv_guid));
-                               ValueBase value(new_canvas);
-                               ret->set_param(iter->first, value);
-                               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)
-       {
-               // Make sure we clone inlinecanvases
-               if(iter->second->get_type()==ValueBase::TYPE_CANVAS)
-               {
-                       Canvas::Handle canvas((*iter->second)(0).get(Canvas::Handle()));
-                       if(canvas->is_inline())
-                       {
-                               Canvas::Handle new_canvas(canvas->clone(deriv_guid));
-                               ValueBase value(new_canvas);
-                               ret->connect_dynamic_param(iter->first,ValueNode_Const::create(value));
-                               continue;
-                       }
-               }
-               
-               if(iter->second->is_exported())
-                       ret->connect_dynamic_param(iter->first,iter->second);
-               else
-                       ret->connect_dynamic_param(iter->first,iter->second->clone(deriv_guid));
-       }
-
-       //ret->set_canvas(0);
-       
-       return ret;
-}
-
-Rect
-Layer::get_full_bounding_rect(Context context)const
-{
-       if(active())
-               return context.get_full_bounding_rect()|get_bounding_rect();
-       return context.get_full_bounding_rect();
-}
-
-Rect
-Layer::get_bounding_rect()const
-{
-       return Rect::full_plane();
-}
-
-bool
-Layer::set_param_list(const ParamList &list)
-{
-       bool ret=true;
-       if(!list.size())
-               return false;
-       ParamList::const_iterator iter(list.begin());
-       for(;iter!=list.end();++iter)
-       {
-               if(!set_param(iter->first, iter->second))ret=false;
-       }
-       return ret;
-}
-
-Layer::ParamList
-Layer::get_param_list()const
-{
-       ParamList ret;
-
-       Vocab vocab(get_param_vocab());
-
-       Vocab::const_iterator iter=vocab.begin();
-       for(;iter!=vocab.end();++iter)
-       {
-               ret[iter->get_name()]=get_param(iter->get_name());
-       }
-       return ret;
-}
-
-ValueBase
-Layer::get_param(const String & param)const
-{
-       if(param=="z_depth")
-               return get_z_depth();
-
-       return ValueBase();
-}
-
-String
-Layer::get_version()const
-{
-       return get_param("version__").get(String());
-}
-
-bool
-Layer::set_version(const String &ver)
-{
-       return false;
-}
-
-void
-Layer::reset_version()
-{
-}
-
-
-void
-Layer::set_time(Context context, Time time)const
-{
-       context.set_time(time);
-       dirty_time_=time;
-}
-
-void
-Layer::set_time(Context context, Time time, const Point &pos)const
-{
-       context.set_time(time,pos);
-       dirty_time_=time;
-}
-
-Color
-Layer::get_color(Context context, const Point &pos)const
-{
-       return context.get_color(pos);
-}
-
-sinfg::Layer::Handle
-Layer::hit_check(sinfg::Context context, const sinfg::Point &pos)const
-{
-       return context.hit_check(pos);
-}
-
-/*     The default accelerated renderer
-**     is anything but accelerated...
-*/
-bool
-Layer::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)  const
-{
-       handle<Target> target=surface_target(surface);
-       if(!target)
-       {
-               if(cb)cb->error(_("Unable to create surface target"));
-               return false;
-       }
-       RendDesc desc=renddesc;
-       target->set_rend_desc(&desc);
-
-       // When we render, we want to
-       // make sure that we are rendered too...
-       // Since the context iterator is for
-       // the layer after us, we need to back up.
-       // This could be considered a hack, as
-       // it is a possibility that we are indeed
-       // not the previous layer.
-       --context;
-
-       return render(context,target,desc,cb);
-       //return render_threaded(context,target,desc,cb,2);
-}
-
-String
-Layer::get_name()const
-{
-       return get_param("name__").get(String());
-}
-
-String
-Layer::get_local_name()const
-{
-       return get_param("local_name__").get(String());
-}
-
-
-Layer::Vocab
-Layer::get_param_vocab()const
-{
-       Layer::Vocab ret;
-
-       ret.push_back(ParamDesc(z_depth_,"z_depth")
-               .set_local_name(_("Z Depth"))
-               .set_animation_only(true)
-       );
-
-       return ret;
-}
-
-void
-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();            
-               set.insert(tset.begin(),tset.end());
-       }
-}
-
-
-void
-Layer::add_to_group(const String&x)
-{
-       if(x==group_)
-               return;
-       if(!group_.empty())
-               remove_from_all_groups();
-       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()
-{
-       if(group_.empty())
-               return;
-       signal_removed_from_group()(group_);
-       group_.clear();
-}
-       
-String
-Layer::get_group()const
-{
-       return group_;
-}
diff --git a/synfig-core/trunk/src/sinfg/layer.h b/synfig-core/trunk/src/sinfg/layer.h
deleted file mode 100644 (file)
index 923e8f3..0000000
+++ /dev/null
@@ -1,453 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer.h
-**     \brief Layer Class Header
-**
-**     $Id: layer.h,v 1.2 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_H
-#define __SINFG_LAYER_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "string_decl.h"
-#include <map>
-#include <ETL/handle>
-#include "real.h"
-#include "string.h"
-#include <sigc++/signal.h>
-#include <sigc++/connection.h>
-#include "node.h"
-#include "time.h"
-#include "guid.h"
-
-/* === M A C R O S ========================================================= */
-
-//! \writeme
-#define SINFG_LAYER_MODULE_EXT public: static const char name__[], version__[], cvs_id__[], local_name__[], category__[]; static Layer *create();
-
-//! Sets the name of the layer
-#define SINFG_LAYER_SET_NAME(class,x) const char class::name__[]=x
-
-//! Sets the local name of the layer
-#define SINFG_LAYER_SET_LOCAL_NAME(class,x) const char class::local_name__[]=x;
-
-//! Sets the categpru of the layer
-#define SINFG_LAYER_SET_CATEGORY(class,x) const char class::category__[]=x
-
-//! Sets the version string for the layer
-#define SINFG_LAYER_SET_VERSION(class,x) const char class::version__[]=x
-
-//! Sets the CVS ID string for the layer
-#define SINFG_LAYER_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
-
-//! \writeme
-#define SINFG_LAYER_INIT(class) sinfg::Layer* class::create() { return new class(); }
-
-//! \writeme
-#define IMPORT_PLUS(x,y) if(param==#x && value.same_as(x)) { value.put(&x);{y;}return true;}
-
-//! \writeme
-#define IMPORT_AS(x,y) if(param==y && value.same_as(x)) { value.put(&x); return true;}
-
-//! \writeme
-#define IMPORT(x) IMPORT_AS(x,#x)
-
-//! \writeme
-#define EXPORT_AS(x,y) if(param==y) { return ValueBase(x); }
-
-//! \writeme
-#define EXPORT(x)                                      EXPORT_AS(x,#x)
-
-//! \writeme
-#define EXPORT_NAME()  if(param=="Name" || param=="name" || param=="name__") { return name__; } if(param=="local_name__") { return local_name__; }
-
-//! \writeme
-#define EXPORT_VERSION()       if(param=="Version" || param=="version" || param=="version__") { return version__; }
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Canvas;
-class Vector;
-typedef Vector Point;
-class Canvas;
-class ParamDesc;
-class ParamVocab;
-class ValueNode;
-class ValueBase;
-class Time;
-class Surface;
-class RendDesc;
-class ProgressCallback;
-class Context;
-class Color;
-class Transform;
-class Rect;
-class GUID;
-
-
-/*!    \class Layer
-**     \todo writeme
-**     \see Canvas
-*/
-class Layer : public Node
-{
-       friend class ValueNode;
-       friend class Context;
-               
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public:
-
-       //! Type that represents a pointer to a layer's constructor
-       typedef Layer* (*Factory)();
-
-       struct BookEntry
-       {
-               Factory factory;
-               String name;
-               String local_name;
-               String category;
-               String cvs_id;
-               String version;
-               BookEntry() { }
-               BookEntry(Factory factory, const String& name,const String& local_name,const String& category,const String& cvs_id,const String& version):
-                       factory(factory),name(name),local_name(local_name),category(category),cvs_id(cvs_id),version(version) { }
-       };
-
-       typedef std::map<String,BookEntry> Book;
-
-       static void register_in_book(const BookEntry &);
-
-       static Book& book();
-       
-       static bool subsys_init();
-
-       static bool subsys_stop();
-
-       typedef std::map<String,ValueBase> ParamList;
-
-       typedef etl::handle<Layer> Handle;
-
-       typedef etl::loose_handle<Layer> LooseHandle;
-
-       typedef etl::handle<const Layer> ConstHandle;
-
-       typedef std::map<String,etl::rhandle<ValueNode> > DynamicParamList;
-
-       //! A list type which describes all the parameters that a layer has.
-       /*! \see get_param_vocab() */
-       typedef ParamVocab Vocab;
-
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-private:
-
-       /*! \c true if the layer is visible, \c is it is to be skipped
-       **      \see set_active(), enable(), disable, active()
-       */
-       bool active_;
-
-       //! Handle to the canvas to which this layer belongs
-       etl::loose_handle<Canvas> canvas_;
-
-       DynamicParamList dynamic_param_list_;
-
-       //! A description of what this layer does
-       String description_;
-
-       //! \writeme
-       float z_depth_;
-       
-       //! \writeme
-       mutable Time dirty_time_;
-       
-       //! Contains the name of the group that this layer belongs to
-       String group_;
-       
-       //! \writeme
-       sigc::connection parent_death_connect_;
-       
-       /*
- -- ** -- S I G N A L S -------------------------------------------------------
-       */
-
-private:
-
-       //!     Status Changed
-       sigc::signal<void> signal_status_changed_;      
-       
-       //!     Parameter changed
-       sigc::signal<void,String> signal_param_changed_;        
-
-       //!     Description Changed
-       sigc::signal<void> signal_description_changed_; 
-
-       //!     Moved
-       sigc::signal<void, int, etl::handle<Canvas> > signal_moved_;    
-
-       sigc::signal<void, String> signal_added_to_group_;      
-
-       sigc::signal<void, String> signal_removed_from_group_;  
-
-       /*
- -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
-       */
-
-public:
-
-       //!     Status Changed
-       sigc::signal<void>& signal_status_changed() { return signal_status_changed_; }  
-       
-       //!     Parameter changed
-       sigc::signal<void,String>& signal_param_changed() { return signal_param_changed_; }
-
-       //!     Description Changed
-       sigc::signal<void>& signal_description_changed() { return signal_description_changed_;} 
-
-       //!     Moved
-       sigc::signal<void, int, etl::handle<Canvas> >& signal_moved() { return signal_moved_; }
-
-       sigc::signal<void, String>& signal_added_to_group() { return signal_added_to_group_; }  
-
-       sigc::signal<void, String>& signal_removed_from_group() { return signal_removed_from_group_; }  
-
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-protected:
-
-       Layer();
-
-public:
-       virtual ~Layer();
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       virtual void on_canvas_set();
-
-       //! Adds this layer to the given layer group
-       void add_to_group(const String&);
-       
-       //! Removes this layer from the given layer group
-       void remove_from_group(const String&);
-       
-       //! Removes this layer from all layer groups
-       void remove_from_all_groups();
-       
-       //! Gets the name of the group that this layer belongs to
-       String get_group()const;
-
-       //! \todo writeme
-       //DynamicParamList &dynamic_param_list() { return dynamic_param_list_; }
-
-       //! \todo writeme
-       const DynamicParamList &dynamic_param_list()const { return dynamic_param_list_; }
-
-       bool connect_dynamic_param(const String& param, etl::loose_handle<ValueNode>);
-       bool disconnect_dynamic_param(const String& param);
-               
-       //! Enables the layer for rendering (Making it \em active)
-       void enable() { set_active(true); }
-
-       //! Disables the layer for rendering. (Making it \em inactive)
-       /*! When a layer is disabled, it will be skipped when the
-       **      canvas is rendered. */
-       void disable() { set_active(false); }
-
-       //! Sets the 'active' flag for the Layer to the state described by \a x
-       /*! When a layer is disabled, it will be skipped when the
-       **      canvas is rendered. */
-       void set_active(bool x);
-
-       //! Returns that status of the 'active' flag
-       bool active()const { return active_; }
-
-       //! Returns the position of the layer in the canvas.
-       /*! Returns negative on error */
-       int get_depth()const;
-
-       //! \writeme
-       float get_z_depth()const { return z_depth_; }
-
-       //! \writeme
-       float get_z_depth(const sinfg::Time& t)const;
-
-       //! \writeme
-       void set_z_depth(float x) { z_depth_=x; }
-       
-       //! Sets the Canvas that this Layer is a part of
-       void set_canvas(etl::loose_handle<Canvas> canvas);
-       
-       //! Returns a handle to the Canvas to which this Layer belongs
-       etl::loose_handle<Canvas> get_canvas()const;
-       
-       //! \writeme
-       const String& get_description()const { return description_; }
-
-       //! \writeme
-       void set_description(const String& x);
-       
-       /*
- --    ** -- V I R T U A L   F U N C T I O N S -----------------------------------
-       */
-
-public:
-       virtual Rect get_bounding_rect()const;
-
-       virtual Rect get_full_bounding_rect(Context context)const;
-
-       //! Returns a string containing the name of the Layer
-       virtual String get_name()const; 
-
-       //! Returns a string containing the localized name of the Layer
-       virtual String get_local_name()const;
-
-       //! Gets the paramater vocabulary
-       virtual Vocab get_param_vocab()const;
-
-       //! Gets the version string for this layer
-       virtual String get_version()const;
-
-       //! \writeme
-       virtual etl::handle<Transform> get_transform()const;
-
-       //! Sets the virtual version to use for backwards-compatibility
-       /*!
-       **      \see reset_version() */
-       virtual bool set_version(const String &ver);
-
-       //! Resets the virtual version
-       /*!
-       **      \see set_version() */
-       virtual void reset_version();
-
-       //!     Sets the parameter described by \a param to \a value.
-       /*!     \param param The name of the parameter to set
-       **      \param value What the parameter is to be set to.
-       **      \return \c true on success, \c false upon rejection or failure.
-       **              If it returns \c false, then the Layer is assumed to remain unchanged.
-       **      \sa get_param()
-       **      \todo \a param should be of the type <tt>const String \&param</tt>
-       */
-       virtual bool set_param(const String &param, const ValueBase &value);
-
-       //!     Sets a list of parameters
-       virtual bool set_param_list(const ParamList &);
-
-       //! Get the value of the specified parameter.
-       /*!     \return The requested parameter value, or (upon failure) a NIL ValueBase.
-       **      \sa set_param()
-       **      \todo \a param should be of the type <tt>const String \&</tt>
-       */
-       virtual ValueBase get_param(const String &param)const;
-
-       //! Get a list of all of the parameters and their values
-       virtual ParamList get_param_list()const;
-
-       //! Sets the \a time for the selected Layer and those under it
-       /*!     \param context          Context iterator refering to next Layer.
-       **      \param time                     writeme
-       **      \see Handle::set_time()
-       */
-       virtual void set_time(Context context, Time time)const;
-
-       //! Sets the \a time for the selected Layer and those under it for a specific \a point
-       /*!     \param context          Context iterator refering to next Layer.
-       **      \param time                     writeme
-       **      \param point            writeme
-       **      \see Handle::set_time()
-       **      \todo \a point should be of the type <tt>const Point \&</tt> */
-       virtual void set_time(Context context, Time time, const Point &point)const;
-
-       //! Gets the color of the Canvas at \a point
-       /*!     \param context          Context iterator refering to next Layer.
-       **      \param point            Point which indicates where the desired Color should come from
-       **      \todo \a point should be of the type <tt>const Point \&</tt>
-       **      \see Handle::get_color()
-       */
-       virtual Color get_color(Context context, const Point &point)const;
-
-       //! Renders the Canvas to the given Surface in an accelerated manner
-       /*!     \param context          Context iterator refering to next Layer.
-       **      \param surface          Pointer to Surface to render to.
-       **      \param quality          The requested quality-level to render at.
-       **      \param rend_desc        The associated RendDesc.
-       **      \param callback         Pointer to callback object. May be NULL if there is no callback.
-       **      \return \c true on success, \c false on failure
-       **      \see Handle::accelerated_render()
-       */
-       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &rend_desc, ProgressCallback *callback)const;
-
-       //! Checks to see if a part of the layer is directly under \a point
-       /*!     \param context          Context iterator refering to next Layer.
-       **      \param point            The point to check
-       **      \return         The handle of the layer under \a point. If there is not
-       **                              a layer under \a point, then returns an empty handle. */
-       virtual Handle hit_check(Context context, const Point &point)const;
-
-       //! Duplicates the Layer
-       virtual Handle clone(const GUID& deriv_guid=GUID())const;
-
-       //! Duplicates the Layer without duplicating the value nodes
-       virtual Layer *simple_clone()const;
-
-protected:
-
-       //! This is called whenever a parameter is changed
-       virtual void on_changed();
-
-       //! Called to figure out the animation time information
-       virtual void get_times_vfunc(Node::time_set &set) const;
-
-       /*
- --    ** -- S T A T I C  F U N C T I O N S --------------------------------------
-       */
-
-public:
-
-       //! Creates a Layer of type \a type
-       /*!     If the Layer type is unknown, then a Mime layer is created in its place.
-       **      \param type     A string describing the name of the layer to construct.
-       **      \return Always returns a handle to a new Layer.
-       **      \see Mime
-       */
-       static Layer::LooseHandle create(const String &type);
-
-}; // END of class Layer
-
-}; // END of namespace sinfg
-
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer_bitmap.cpp b/synfig-core/trunk/src/sinfg/layer_bitmap.cpp
deleted file mode 100644 (file)
index c7eb0c2..0000000
+++ /dev/null
@@ -1,488 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_bitmap.cpp
-**     \brief Template Header
-**
-**     $Id: layer_bitmap.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "layer_bitmap.h"
-#include "layer.h"
-#include "time.h"
-#include "string.h"
-#include "vector.h"
-
-#include "context.h"
-#include "time.h"
-#include "color.h"
-#include "surface.h"
-#include "renddesc.h"
-#include "target.h"
-
-#include "general.h"
-#include "paramdesc.h"
-#include <ETL/misc>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace sinfg;
-using namespace std;
-using namespace etl;
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::Layer_Bitmap::Layer_Bitmap():
-    Layer_Composite    (1.0,Color::BLEND_COMPOSITE),
-       tl                              (-0.5,0.5),
-       br                              (0.5,-0.5),
-       c                               (1),
-       surface                 (128,128),
-       gamma_adjust    (1.0)
-{
-}
-       
-bool
-sinfg::Layer_Bitmap::set_param(const String & param, ValueBase value)
-{
-       IMPORT(tl);
-       IMPORT(br);
-       IMPORT(c);
-       if(param=="gamma_adjust"&& value.get_type()==ValueBase::TYPE_REAL)
-       {
-               gamma_adjust=1.0/value.get(Real());
-               //gamma_adjust.set_gamma(1.0/value.get(Real()));
-               return true;
-       }
-       
-       return Layer_Composite::set_param(param,value);
-}
-
-ValueBase
-sinfg::Layer_Bitmap::get_param(const String & param)const
-{
-       EXPORT(tl);
-       EXPORT(br);
-       EXPORT(c);
-       if(param=="gamma_adjust")
-               return 1.0/gamma_adjust;
-
-       if(param=="_width")
-       {
-               return surface.get_w();
-       }
-       if(param=="_height")
-       {
-               return surface.get_h();
-       }
-       
-       return Layer_Composite::get_param(param);
-}
-
-Layer::Vocab
-Layer_Bitmap::get_param_vocab()const
-{
-       Layer::Vocab ret(Layer_Composite::get_param_vocab());
-       
-       ret.push_back(ParamDesc("tl")
-               .set_local_name(_("Top-Left"))
-               .set_description(_("Upper left-hand Corner of image"))
-       );
-
-       ret.push_back(ParamDesc("br")
-               .set_local_name(_("Bottom-Right"))
-               .set_description(_("Lower right-hand Corner of image"))
-       );
-
-       ret.push_back(ParamDesc("c")
-               .set_local_name(_("Interpolation"))
-               .set_description(_("What type of interpolation to use"))
-               .set_hint("enum")
-               .add_enum_value(0,"nearest",_("Nearest Neighbor"))
-               .add_enum_value(1,"linear",_("Linear"))
-               .add_enum_value(2,"cosine",_("Cosine"))
-               .add_enum_value(3,"cubic",_("Cubic"))
-       );
-
-       ret.push_back(ParamDesc("gamma_adjust")
-               .set_local_name(_("Gamma Adjustment"))
-       );
-
-       return ret;
-}
-
-sinfg::Layer::Handle
-Layer_Bitmap::hit_check(sinfg::Context context, const sinfg::Point &pos)const
-{
-       Point surface_pos;
-       surface_pos=pos-tl;
-       
-       surface_pos[0]/=br[0]-tl[0];
-       if(surface_pos[0]<=1.0 && surface_pos[0]>=0.0)
-       {
-               surface_pos[1]/=br[1]-tl[1];
-               if(surface_pos[1]<=1.0 && surface_pos[1]>=0.0)
-               {
-                       return const_cast<Layer_Bitmap*>(this);
-               }
-       }
-       
-       return context.hit_check(pos);
-}
-
-inline
-const Color&
-sinfg::Layer_Bitmap::filter(const Color& c)const
-{
-       if(gamma_adjust==1.0)
-               return c;
-       static Color x;
-       x=c;
-       
-       x.set_r(powf((float)x.get_r(),gamma_adjust));
-       x.set_g(powf((float)x.get_g(),gamma_adjust));
-       x.set_b(powf((float)x.get_b(),gamma_adjust));
-       return x;
-}
-
-Color
-sinfg::Layer_Bitmap::get_color(Context context, const Point &pos)const
-{
-       Point surface_pos;
-
-       if(!get_amount())
-               return context.get_color(pos);
-       
-       surface_pos=pos-tl;
-       
-       surface_pos[0]/=br[0]-tl[0];
-       if(surface_pos[0]<=1.0 && surface_pos[0]>=0.0)
-       {
-               surface_pos[1]/=br[1]-tl[1];
-               if(surface_pos[1]<=1.0 && surface_pos[1]>=0.0)
-               {
-                       surface_pos[0]*=surface.get_w();
-                       surface_pos[1]*=surface.get_h();
-                               
-                       Color ret(Color::alpha());
-
-                       switch(c)
-                       {
-                       case 6: // Undefined
-                       case 5: // Undefined
-                       case 4: // Undefined
-                       case 3: // Cubic
-                               ret=surface.cubic_sample(surface_pos[0],surface_pos[1]);
-                               break;
-
-                       case 2: // Cosine
-                               ret=surface.cosine_sample(surface_pos[0],surface_pos[1]);
-                               break;
-                       case 1: // Linear
-                               ret=surface.linear_sample(surface_pos[0],surface_pos[1]);
-                               break;
-                       case 0: // Nearest Neighbor
-                       default:
-                               {
-                                       int x(min(surface.get_w()-1,max(0,round_to_int(surface_pos[0]))));
-                                       int y(min(surface.get_h()-1,max(0,round_to_int(surface_pos[1]))));
-                                       ret= surface[y][x];
-                               }
-                       break;
-                       }
-                       
-                       ret=filter(ret);
-                       
-                       if(get_amount()==1 && get_blend_method()==Color::BLEND_STRAIGHT)
-                               return ret;
-                       else
-                               return Color::blend(ret,context.get_color(pos),get_amount(),get_blend_method());
-               }
-       }
-       
-       return context.get_color(pos);
-}
-
-bool
-Layer_Bitmap::accelerated_render(Context context,Surface *out_surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)  const
-{
-       int interp=c;
-       if(quality>=10)
-               interp=0;
-       else if(quality>=5 && interp>1)
-               interp=1;
-
-       // We can only handle NN and Linear at the moment
-       //if(interp>1)
-       //      return Layer_Composite::accelerated_render(context,out_surface,quality,renddesc,cb);
-       
-       //if we don't actually have a valid surface just skip us
-       if(!surface.is_valid())
-       {
-               // Render what is behind us
-               return context.accelerated_render(out_surface,quality,renddesc,cb);
-       }
-                       
-       SuperCallback subcb(cb,1,10000,10001+renddesc.get_h());
-
-       if(     get_amount()==1 &&
-               get_blend_method()==Color::BLEND_STRAIGHT &&
-               renddesc.get_tl()==tl &&
-               renddesc.get_br()==br)
-       {
-               // Check for the trivial case
-               if(surface.get_w()==renddesc.get_w() && surface.get_h()==renddesc.get_h() && gamma_adjust==1.0f)
-               {
-                       if(cb && !cb->amount_complete(0,100)) return false;
-                       *out_surface=surface;
-                       if(cb && !cb->amount_complete(100,100)) return false;
-                       return true;
-               }
-               out_surface->set_wh(renddesc.get_w(),renddesc.get_h());
-       }
-       else
-       {
-               // Render what is behind us
-               if(!context.accelerated_render(out_surface,quality,renddesc,&subcb))
-                       return false;
-       }
-       
-       if(cb && !cb->amount_complete(10000,10001+renddesc.get_h())) return false;
-
-       Point   obr     = renddesc.get_br(),
-                       otl = renddesc.get_tl();
-       
-       //Vector::value_type pw=renddesc.get_w()/(renddesc.get_br()[0]-renddesc.get_tl()[0]);
-       //Vector::value_type ph=renddesc.get_h()/(renddesc.get_br()[1]-renddesc.get_tl()[1]);
-       
-       //A = representation of input (just tl,br)      //just a scaling right now
-       //B = representation of output (just tl,br)     //just a scaling right now
-       //sa = scaling for input (0,1) -> (0,w/h)
-       //sb = scaling for output (0,1) -> (0,w/h)
-       
-       float   inwf = br[0] - tl[0];
-       float   inhf = br[1] - tl[1];
-       
-       float   outwf = obr[0] - otl[0];
-       float   outhf = obr[1] - otl[1];
-       
-       int             inw = surface.get_w();
-       int             inh = surface.get_h();
-               
-       int             outw = renddesc.get_w();
-       int             outh = renddesc.get_h();
-               
-       //need to get the input coords in output space, so we can clip
-       
-       //get the desired corners of the bitmap (in increasing order) in integers
-       //floating point corners
-       float x1f = (tl[0] - otl[0])*outw/outwf;
-       float x2f = (br[0] - otl[0])*outw/outwf;
-       float y1f = (tl[1] - otl[1])*outh/outhf;
-       float y2f = (br[1] - otl[1])*outh/outhf;
-       
-       if(x1f > x2f) swap(x1f,x2f);
-       if(y1f > y2f) swap(y1f,y2f);
-       
-       int x_start = max(0,(int)floor(x1f));   //probably floor
-       int x_end       = min(outw,(int)ceil(x2f));     //probably ceil
-       int y_start = max(0,(int)floor(y1f));   //probably floor
-       int y_end       = min(outh,(int)ceil(y2f));     //probably ceil
-       
-       //need to get the x,y,dx,dy values from output space to input, so we can do fast interpolation
-       
-       //get the starting position in input space... for interpolating
-       
-       // in int -> out float:
-       // Sb(B^-1)A(Sa^-1) x
-       float inx_start = (((x_start/*+0.5f*/)*outwf/outw + otl[0]) - tl[0])*inw/inwf; //may want to bias this (center of pixel)???
-       float iny_start = (((y_start/*+0.5f*/)*outhf/outh + otl[1]) - tl[1])*inh/inhf; //may want to bias this (center of pixel)???
-       
-       //calculate the delta values in input space for one pixel movement in output space
-       //same matrix but with a vector instead of a point...
-       float indx = outwf*(inw)/((outw)*inwf);         //translations died
-       float indy = outhf*(inh)/((outh)*inhf);         //translations died
-       
-       //perhaps use a DDA algorithm... if faster... 
-       //   will still want pixel fractions to be floating point since colors are
-
-       //sinfg::info("xstart:%d ystart:%d xend:%d yend:%d",x_start,y_start,x_end,y_end);
-       
-       //start drawing at the start of the bitmap (either origin or corner of input...)
-       //and get other info
-       Surface::alpha_pen pen(out_surface->get_pen(x_start,y_start));
-       pen.set_alpha(get_amount());
-       pen.set_blend_method(get_blend_method());
-       
-       //check if we should use the downscale filtering
-       if(quality <= 7)
-       {
-               //the stride of the value should be inverted because we want to downsample 
-               //when the stride is small, not big
-               //int multw = (int)ceil(indx);
-               //int multh = (int)ceil(indy);
-               
-               if(indx > 1.7 || indy > 1.7)
-               {
-                       /*sinfg::info("Decided to downsample? ratios - (%f,%f) -> (%d,%d)", 
-                                               indx, indy, multw, multh);      */              
-                       
-                       //use sample rect here...
-                       
-                       float iny, inx;
-                       int x,y;
-                       
-                       //Point sample - truncate
-                       iny = iny_start;//+0.5f;
-                       for(y = y_start; y < y_end; ++y, pen.inc_y(), iny += indy)
-                       {
-                               inx = inx_start;//+0.5f;
-                               for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
-                               {
-                                       Color rc = surface.sample_rect_clip(inx,iny,inx+indx,iny+indy);
-                                       pen.put_value(filter(rc));
-                               }
-                               pen.dec_x(x_end-x_start);
-                       }
-                       
-                       //Color c = (*out_surface)[0][0];
-                       //sinfg::info("ValueBase of first pixel = (%f,%f,%f,%f)",c.get_r(),c.get_g(),c.get_b(),c.get_a());
-                       
-                       return true;
-               }
-       }
-       
-       //perform normal interpolation
-       if(interp==0)
-       {       
-               //sinfg::info("Decided to do nearest neighbor");
-               float iny, inx;
-               int x,y;
-               
-               //Point sample - truncate
-               iny = iny_start;//+0.5f;
-               for(y = y_start; y < y_end; y++, pen.inc_y(), iny += indy)
-               {
-                       inx = inx_start;//+0.5f;
-                       int yclamp = min(inh-1, max(0, round_to_int(iny)));
-                       for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
-                       {
-                               int xclamp = min(inw-1, max(0, round_to_int(inx)));
-                               Color c = filter(surface[yclamp][xclamp]);
-                               pen.put_value(c); //must get rid of the clip
-                       }
-                       pen.dec_x(x_end-x_start);
-               }
-       }
-       else
-       if(interp==1)
-       {
-               //bilinear filtering
-               
-               //float         xmf,xpf,ymf,ypf;
-               //int           xm,xp,ym,yp;
-               float   inx,iny;
-               int             x,y;
-               
-               //can probably buffer for x values...
-               
-               //loop and based on inx,iny sample input image
-               iny = iny_start;
-               for(y = y_start; y < y_end; y++, pen.inc_y(), iny += indy)
-               {
-                       inx = inx_start;
-                       for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
-                       {
-                               pen.put_value(filter(surface.linear_sample(inx,iny)));
-                       }
-                       pen.dec_x(x_end-x_start);
-                       
-               }
-       }       
-       else
-       if(interp==2)
-       {
-               //cosine filtering
-               
-               //float         xmf,xpf,ymf,ypf;
-               //int           xm,xp,ym,yp;
-               float   inx,iny;
-               int             x,y;
-               
-               //can probably buffer for x values...
-               
-               //loop and based on inx,iny sample input image
-               iny = iny_start;
-               for(y = y_start; y < y_end; y++, pen.inc_y(), iny += indy)
-               {
-                       inx = inx_start;
-                       for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
-                       {
-                               pen.put_value(filter(surface.cosine_sample(inx,iny)));
-                       }
-                       pen.dec_x(x_end-x_start);
-                       
-               }
-       }       
-       else
-       {
-               //cubic filtering
-               
-               //float         xmf,xpf,ymf,ypf;
-               //int           xm,xp,ym,yp;
-               float   inx,iny;
-               int             x,y;
-               
-               //can probably buffer for x values...
-               
-               //loop and based on inx,iny sample input image
-               iny = iny_start;
-               for(y = y_start; y < y_end; y++, pen.inc_y(), iny += indy)
-               {
-                       inx = inx_start;
-                       for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
-                       {
-                               pen.put_value(filter(surface.cubic_sample(inx,iny)));
-                       }
-                       pen.dec_x(x_end-x_start);
-                       
-               }
-       }       
-
-       return true;
-}
-
-Rect
-Layer_Bitmap::get_bounding_rect()const
-{
-       return Rect(tl,br);
-}
diff --git a/synfig-core/trunk/src/sinfg/layer_bitmap.h b/synfig-core/trunk/src/sinfg/layer_bitmap.h
deleted file mode 100644 (file)
index cb34471..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_bitmap.h
-**     \brief Template Header
-**
-**     $Id: layer_bitmap.h,v 1.2 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_BITMAP_H
-#define __SINFG_LAYER_BITMAP_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "layer_composite.h"
-#include "surface.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Layer_Bitmap
-**     \todo writeme
-*/
-class Layer_Bitmap : public Layer_Composite, public Layer_NoDeform
-{
-       const Color& filter(const Color& c)const;
-public:
-       typedef etl::handle<Layer_Bitmap> Handle;       
-
-       Point tl;
-       Point br;
-       int c;
-       mutable Surface surface;
-       
-       Real gamma_adjust;
-       
-       Layer_Bitmap();
-       
-       virtual bool set_param(const String & param, ValueBase value);
-
-       virtual ValueBase get_param(const String & param)const;
-
-       virtual Color get_color(Context context, const Point &pos)const;
-       
-       virtual Vocab get_param_vocab()const;
-
-       virtual Rect get_bounding_rect()const;
-
-       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &rend_desc, ProgressCallback *callback)const;
-
-       virtual sinfg::Layer::Handle hit_check(sinfg::Context context, const sinfg::Point &point)const;
-}; // END of class Layer_Bitmap
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer_composite.cpp b/synfig-core/trunk/src/sinfg/layer_composite.cpp
deleted file mode 100644 (file)
index 038d68f..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_composite.cpp
-**     \brief Template File
-**
-**     $Id: layer_composite.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "layer_composite.h"
-#include "context.h"
-#include "time.h"
-#include "color.h"
-#include "surface.h"
-#include "renddesc.h"
-#include "target.h"
-
-#include "layer_bitmap.h"
-
-#include "general.h"
-#include "render.h"
-#include "paramdesc.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-bool
-Layer_Composite::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc_, ProgressCallback *cb)  const
-{
-       RendDesc renddesc(renddesc_);
-       
-       if(!amount_)
-               return context.accelerated_render(surface,quality,renddesc,cb);
-
-       CanvasBase image;
-
-       SuperCallback stageone(cb,0,50000,100000);
-       SuperCallback stagetwo(cb,50000,100000,100000);
-
-       Layer_Bitmap::Handle surfacelayer(new class Layer_Bitmap());
-
-       Context iter;
-       
-       for(iter=context;*iter;iter++)
-               image.push_back(*iter);
-
-       image.push_front(surfacelayer.get());
-
-       // We want to go ahead and schedule any other
-       // layers...
-//     while(dynamic_cast<Layer_Composite*>(context->get()))
-//     while(context->get() &&
-//             &context->get()->AcceleratedRender==
-//             &Layer_Composite::AcceleratedRender)
-//             image.push_back(*(context++));
-
-       image.push_back(0);     // Alpha black
-
-       // Render the backdrop
-       if(!context.accelerated_render(&surfacelayer->surface,quality,renddesc,&stageone))
-               return false;
-
-       if(quality<=4)surfacelayer->c=3;else
-       if(quality<=5)surfacelayer->c=2;
-       else if(quality<=6)surfacelayer->c=1;
-       else surfacelayer->c=0;
-       surfacelayer->tl=renddesc.get_tl();
-       surfacelayer->br=renddesc.get_br();
-       surfacelayer->set_blend_method(Color::BLEND_STRAIGHT);
-
-       image.push_front(const_cast<sinfg::Layer_Composite*>(this));
-
-       // Set up a surface target
-       Target::Handle target(surface_target(surface));
-       
-       if(!target)
-       {
-               if(cb)cb->error(_("Unable to create surface target"));
-               return false;
-       }
-       
-       RendDesc desc(renddesc);
-       
-       target->set_rend_desc(&desc);
-
-       // Render the scene
-       return render(Context(image.begin()),target,desc,&stagetwo);
-       //return render_threaded(Context(image.begin()),target,desc,&stagetwo,2);
-}
-
-Rect
-Layer_Composite::get_full_bounding_rect(Context context)const
-{
-       if(is_disabled() || Color::is_onto(get_blend_method()))
-               return context.get_full_bounding_rect();
-
-       return context.get_full_bounding_rect()|get_bounding_rect();
-}
-
-Layer::Vocab
-Layer_Composite::get_param_vocab()const
-{
-       Layer::Vocab ret(Layer::get_param_vocab());
-
-       ret.push_back(ParamDesc(amount_,"amount")
-               .set_local_name(_("Amount"))
-       );
-       ret.push_back(ParamDesc(blend_method_,"blend_method")
-               .set_local_name(_("Blend Method"))
-       );
-
-       return ret;
-}
-
-bool
-Layer_Composite::set_param(const String & param, const ValueBase &value)
-{
-       if(param=="amount" && value.same_as(amount_))
-               amount_=value.get(amount_);
-       else
-       if(param=="blend_method" && value.same_as(int()))
-               blend_method_=static_cast<Color::BlendMethod>(value.get(int()));
-       else
-               return Layer::set_param(param,value);
-       return true;
-}
-
-ValueBase
-Layer_Composite::get_param(const String & param)const
-{
-       if(param=="amount")
-               return get_amount();
-       if(param=="blend_method")
-               return static_cast<int>(get_blend_method());
-       return Layer::get_param(param);
-}
diff --git a/synfig-core/trunk/src/sinfg/layer_composite.h b/synfig-core/trunk/src/sinfg/layer_composite.h
deleted file mode 100644 (file)
index c9bc3a0..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_composite.h
-**     \brief Composite Layer Class Implementation
-**
-**     $Id: layer_composite.h,v 1.2 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_COMPOSITE_H
-#define __SINFG_LAYER_COMPOSITE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "layer.h"
-#include "color.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Layer_NoDeform {};
-
-
-/*!    \class Layer_Composite
-**     \brief Base class for layers that put stuff ontop of lower layers
-*/
-class Layer_Composite : public Layer
-{
-private:
-
-       float amount_;
-
-       Color::BlendMethod blend_method_;
-
-protected:
-
-       Layer_Composite(
-               float   amount=1.0,
-               Color::BlendMethod      blend_method=Color::BLEND_COMPOSITE
-       ):
-               amount_                         (amount),
-               blend_method_           (blend_method)
-       { }
-
-public:
-
-       float get_amount()const { return amount_; }
-
-       Layer_Composite& set_amount(float x) { amount_=x; return *this; }
-
-       Color::BlendMethod get_blend_method()const { return blend_method_; }
-
-       Layer_Composite& set_blend_method(Color::BlendMethod x) { blend_method_=x; return *this; }
-
-       bool is_solid_color()const { return amount_==1.0f && blend_method_==Color::BLEND_STRAIGHT; }
-       
-       bool is_disabled()const { return amount_==0.0f; }
-       
-       virtual Vocab get_param_vocab()const;
-
-       virtual bool set_param(const String &param, const ValueBase &value);
-
-       virtual ValueBase get_param(const String &param)const;
-
-       virtual Rect get_full_bounding_rect(Context context)const;
-
-       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
-}; // END of class Layer_Composite
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer_mime.cpp b/synfig-core/trunk/src/sinfg/layer_mime.cpp
deleted file mode 100644 (file)
index 5168f5f..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_mime.cpp
-**     \brief Template File
-**
-**     $Id: layer_mime.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "layer_mime.h"
-
-#include "layer.h"
-#include "time.h"
-#include "string.h"
-#include "vector.h"
-
-#include "context.h"
-#include "time.h"
-#include "color.h"
-#include "surface.h"
-#include "renddesc.h"
-#include "target.h"
-
-#include "general.h"
-#include "paramdesc.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Layer_Mime::Layer_Mime(String x):name(x)
-{
-       // Throw a bogus default version onto the parameter list.
-       param_list["Version"]="9";
-}
-
-String
-Layer_Mime::get_version()const
-{
-       return get_param("Version").get(String());
-}
-
-bool
-Layer_Mime::set_version(const String &ver)
-{
-       return set_param("Version",ver);
-}
-
-String
-Layer_Mime::get_local_name()const
-{
-       return _("[MIME]")+get_name();
-}
-
-bool
-Layer_Mime::set_param(const String &param, const ValueBase &value)
-{
-       // Don't try to set the name
-       if(param=="name" || param=="Name" || param=="name__")
-               return false;
-
-       // Otherwise, remember this parameter's value
-       param_list[param]=value;
-       return true;
-}
-
-ValueBase
-Layer_Mime::get_param(const String &param)const
-{
-       // If they are requesting the name of
-       // the layer, just return it
-       if(param=="name" || param=="Name" || param=="name__")
-               return ValueBase(name);
-
-       // Otherwise, return the stored parameter value
-       map<string,ValueBase>::const_iterator iter=param_list.find(param);
-       if(iter!=param_list.end())
-               return iter->second;
-       return ValueBase();
-}
-
-Color
-Layer_Mime::get_color(Context context, const Point &pos)const
-{
-       // A Layer_Mime layer should do nothing at all.
-       return context.get_color(pos);
-}
-
-bool
-Layer_Mime::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
-{
-       // A Layer_Mime layer should do nothing at all.
-       return context.accelerated_render(surface,quality,renddesc,cb);
-}
-
-Layer::Vocab
-Layer_Mime::get_param_vocab()const
-{
-       Layer::Vocab ret;
-       map<string,ValueBase>::const_iterator iter;
-
-       // Construct the vocabulary from the stored
-       // parameters
-       for(iter=param_list.begin();iter!=param_list.end();iter++)
-       {
-               // Make sure that we don't add the version
-               // into the vocabulary
-               if(iter->first!="Version")
-                       ret.push_back(ParamDesc(iter->first));
-       }
-       
-       // ... and return it
-       return ret;
-}
diff --git a/synfig-core/trunk/src/sinfg/layer_mime.h b/synfig-core/trunk/src/sinfg/layer_mime.h
deleted file mode 100644 (file)
index 3754061..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_mime.h
-**     \brief Template Header
-**
-**     $Id: layer_mime.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_MIME_H
-#define __SINFG_LAYER_MIME_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "layer.h"
-#include "string.h"
-#include <map>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Layer_Mime
-**     The mime layer is a layer that is used when an unknown
-**     layer type is requested. This allows people without
-**     all of the correct layers installed to still work with
-**     that composition.
-*/
-class Layer_Mime : public Layer
-{
-       std::map<String,ValueBase> param_list;
-       String name;
-public:
-       Layer_Mime(String name);
-
-       virtual String get_version()const;
-
-       virtual bool set_version(const String &ver);
-
-       virtual bool set_param(const String &param, const ValueBase &value);
-
-       virtual ValueBase get_param(const String &param)const;
-
-       virtual Color get_color(Context context, const Point &pos)const;
-       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
-
-       virtual Vocab get_param_vocab()const;
-       virtual String get_local_name()const;
-
-};
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer_motionblur.cpp b/synfig-core/trunk/src/sinfg/layer_motionblur.cpp
deleted file mode 100644 (file)
index 38287bb..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_motionblur.h
-**     \brief Template Header
-**
-**     $Id: layer_motionblur.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "string.h"
-#include "layer_motionblur.h"
-#include "time.h"
-#include "context.h"
-#include "paramdesc.h"
-#include "renddesc.h"
-#include "surface.h"
-#include "value.h"
-#include "valuenode.h"
-#include "canvas.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace sinfg;
-using namespace etl;
-using namespace std;
-
-/* === G L O B A L S ======================================================= */
-
-SINFG_LAYER_INIT(Layer_MotionBlur);
-SINFG_LAYER_SET_NAME(Layer_MotionBlur,"MotionBlur");
-SINFG_LAYER_SET_LOCAL_NAME(Layer_MotionBlur,_("Motion Blur"));
-SINFG_LAYER_SET_CATEGORY(Layer_MotionBlur,_("Blurs"));
-SINFG_LAYER_SET_VERSION(Layer_MotionBlur,"0.1");
-SINFG_LAYER_SET_CVS_ID(Layer_MotionBlur,"$Id: layer_motionblur.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $");
-
-/* === M E M B E R S ======================================================= */
-
-Layer_MotionBlur::Layer_MotionBlur():
-       Layer_Composite (1.0,Color::BLEND_STRAIGHT),
-       aperture                (0)
-{
-}
-       
-bool
-Layer_MotionBlur::set_param(const String &param, const ValueBase &value)
-{
-
-       IMPORT(aperture);               
-       return Layer_Composite::set_param(param,value);
-}
-
-ValueBase
-Layer_MotionBlur::get_param(const String &param)const
-{
-       EXPORT(aperture);
-       
-       EXPORT_NAME();
-       EXPORT_VERSION();
-               
-       return Layer_Composite::get_param(param);
-}
-
-void
-Layer_MotionBlur::set_time(Context context, Time time)const
-{
-       context.set_time(time);
-       time_cur=time;
-}
-
-void
-Layer_MotionBlur::set_time(Context context, Time time, const Point &pos)const
-{
-       context.set_time(time,pos);
-       time_cur=time;
-}
-
-Color
-Layer_MotionBlur::get_color(Context context, const Point &pos)const
-{
-/*     if(aperture)
-       {
-               Time time(time_cur);
-               time+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) *aperture -aperture*0.5;
-               context.set_time(time, pos);
-       }       
-*/
-       return context.get_color(pos);
-}
-
-Layer::Vocab
-Layer_MotionBlur::get_param_vocab()const
-{
-       Layer::Vocab ret;
-       //ret=Layer_Composite::get_param_vocab();
-       
-       ret.push_back(ParamDesc("aperture")
-               .set_local_name(_("Aperature"))
-               .set_description(_("Shutter Time"))
-       );
-       
-       return ret;
-}
-
-bool
-Layer_MotionBlur::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
-{
-       if(aperture && quality<10)
-       {
-               //int x, y;
-               SuperCallback subimagecb;
-               int samples=1;
-               switch(quality)
-               {
-                       case 1: // Production Quality
-                               samples=32;
-                               break;
-                       case 2: // Excellent Quality
-                               samples=24;
-                               break;
-                       case 3: // Good Quality
-                               samples=16;
-                               break;
-                       case 4: // Moderate Quality
-                               samples=12;
-                               break;
-                       case 5: // Draft Quality
-                               samples=7;
-                               break;
-                       case 6:
-                               samples=6;
-                               break;
-                       case 7:
-                               samples=5;
-                               break;
-                       case 8:
-                               samples=3;
-                               break;
-                       case 9:
-                               samples=3;
-                               break;
-                       case 10: // Rough Quality
-            default:                   
-                               samples=1;
-                               break;
-                               
-               }
-       
-               Surface tmp;
-               int i;
-
-               surface->set_wh(renddesc.get_w(),renddesc.get_h());
-               surface->clear();
-               
-               for(i=0;i<samples;i++)
-               {
-                       subimagecb=SuperCallback(cb,i*(5000/samples),(i+1)*(5000/samples),5000);
-                       context.set_time(time_cur+(aperture/samples)*i-aperture*0.5);
-                       if(!context.accelerated_render(&tmp,quality,renddesc,&subimagecb))
-                               return false;
-                       for(int y=0;y<renddesc.get_h();y++)
-                               for(int x=0;x<renddesc.get_w();x++)
-                                       (*surface)[y][x]+=tmp[y][x].premult_alpha();
-               }
-               for(int y=0;y<renddesc.get_h();y++)
-                       for(int x=0;x<renddesc.get_w();x++)
-                               (*surface)[y][x]=((*surface)[y][x]/(float)samples).demult_alpha();
-       }
-       else
-               return context.accelerated_render(surface,quality,renddesc,cb);
-       
-       return true;
-}
diff --git a/synfig-core/trunk/src/sinfg/layer_motionblur.h b/synfig-core/trunk/src/sinfg/layer_motionblur.h
deleted file mode 100644 (file)
index 5799a7c..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_motionblur.h
-**     \brief Template Header
-**
-**     $Id: layer_motionblur.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_MOTIONBLUR_H__
-#define __SINFG_LAYER_MOTIONBLUR_H__
-
-/* === H E A D E R S ======================================================= */
-
-#include "layer_composite.h"
-#include "time.h"
-
-/* === S T R U C T S & C L A S S E S ======================================= */
-
-namespace sinfg {
-       
-class Layer_MotionBlur : public sinfg::Layer_Composite
-{
-       SINFG_LAYER_MODULE_EXT
-
-private:
-
-       Time aperture;
-
-       mutable Time time_cur;
-
-public:
-
-       Layer_MotionBlur();
-       
-       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
-       
-       virtual ValueBase get_param(const String & param)const;
-
-       virtual Color get_color(Context context, const Point &pos)const;
-
-       virtual void set_time(Context context, Time time)const;
-
-       virtual void set_time(Context context, Time time, const Point &pos)const;
-       
-       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
-
-       virtual Vocab get_param_vocab()const;
-
-}; // END of class Layer_MotionBlur
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer_pastecanvas.cpp b/synfig-core/trunk/src/sinfg/layer_pastecanvas.cpp
deleted file mode 100644 (file)
index e3a71f0..0000000
+++ /dev/null
@@ -1,419 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_pastecanvas.h
-**     \brief Template Header
-**
-**     $Id: layer_pastecanvas.cpp,v 1.3 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "layer_pastecanvas.h"
-#include "string.h"
-#include "time.h"
-#include "context.h"
-#include "paramdesc.h"
-#include "renddesc.h"
-#include "surface.h"
-#include "value.h"
-#include "valuenode.h"
-#include "canvas.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace etl;
-using namespace std;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define MAX_DEPTH 10
-
-//#ifdef __APPLE__
-//#define SINFG_NO_CLIP
-//#endif
-
-/* === C L A S S E S ======================================================= */
-
-class depth_counter    // Makes our recursive depth counter exception-safe
-{
-       int *depth;
-public:
-       depth_counter(int &x):depth(&x) { (*depth)++; }
-       ~depth_counter() { (*depth)--; }
-};
-
-/* === G L O B A L S ======================================================= */
-
-SINFG_LAYER_INIT(Layer_PasteCanvas);
-SINFG_LAYER_SET_NAME(Layer_PasteCanvas,"PasteCanvas");
-SINFG_LAYER_SET_LOCAL_NAME(Layer_PasteCanvas,_("Paste Canvas"));
-SINFG_LAYER_SET_CATEGORY(Layer_PasteCanvas,_("Default"));
-SINFG_LAYER_SET_VERSION(Layer_PasteCanvas,"0.1");
-SINFG_LAYER_SET_CVS_ID(Layer_PasteCanvas,"$Id: layer_pastecanvas.cpp,v 1.3 2005/01/24 03:08:18 darco Exp $");
-
-/* === M E T H O D S ======================================================= */
-
-Layer_PasteCanvas::Layer_PasteCanvas():
-       origin(0,0),
-       zoom(0),
-       time_offset(0)
-{
-       children_lock=false;
-       do_not_muck_with_time_=false;
-       curr_time=Time::begin();
-}
-
-Layer_PasteCanvas::~Layer_PasteCanvas()
-{
-/*     if(canvas)
-               canvas->parent_set.erase(this);
-*/
-
-       //if(canvas)DEBUGINFO(strprintf("%d",canvas->count()));
-       
-       set_sub_canvas(0);
-
-       //if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
-       //      canvas->unref();
-}
-
-String
-Layer_PasteCanvas::get_local_name()const
-{
-       if(!canvas)     return _("Pasted Canvas");
-       if(canvas->is_inline()) return _("Inline Canvas");
-       if(canvas->get_root()==get_canvas()->get_root()) return '[' + canvas->get_id() + ']';
-               
-       return '[' + canvas->get_file_name() + ']';
-}
-
-Layer::Vocab
-Layer_PasteCanvas::get_param_vocab()const
-{
-       Layer::Vocab ret(Layer_Composite::get_param_vocab());
-       
-       ret.push_back(ParamDesc("origin")
-               .set_local_name(_("Origin"))
-               .set_description(_("Point where you want the origin to be"))
-       );
-       ret.push_back(ParamDesc("canvas")
-               .set_local_name(_("Canvas"))
-               .set_description(_("Canvas to paste"))
-       );
-       ret.push_back(ParamDesc("zoom")
-               .set_local_name(_("Zoom"))
-               .set_description(_("Size of canvas"))
-       );
-
-       ret.push_back(ParamDesc("time_offset")
-               .set_local_name(_("Time Offset"))
-       );
-
-       ret.push_back(ParamDesc("children_lock")
-               .set_local_name(_("Children Lock"))
-       );
-       
-       return ret;
-}
-
-bool
-Layer_PasteCanvas::set_param(const String & param, const ValueBase &value)
-{
-       IMPORT(origin);
-       
-       if(param=="canvas" && value.same_as(Canvas::Handle()))
-       {
-               set_sub_canvas(value.get(Canvas::Handle()));
-               return true;
-       }
-
-//     IMPORT(canvas);
-       IMPORT(children_lock);
-       IMPORT(zoom);
-       IMPORT(time_offset);
-       
-       return Layer_Composite::set_param(param,value);
-}
-
-void
-Layer_PasteCanvas::set_sub_canvas(etl::handle<sinfg::Canvas> x)
-{
-       if(canvas && !do_not_muck_with_time_)
-               remove_child(canvas.get());
-       
-       if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
-               canvas->unref();
-       
-       child_changed_connection.disconnect();
-       
-       canvas=x;
-       
-       /*if(canvas)
-               child_changed_connection=canvas->signal_changed().connect(
-                       sigc::mem_fun(
-                               *this,
-                               &Layer_PasteCanvas::changed
-                       )
-               );
-       */
-       if(canvas)
-               bounds=(canvas->get_context().get_full_bounding_rect()-canvas->rend_desc().get_focus())*exp(zoom)+origin+canvas->rend_desc().get_focus();
-       
-       if(canvas && !do_not_muck_with_time_)
-               add_child(canvas.get());
-
-       if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
-               canvas->ref();
-       
-       if(canvas)
-               on_canvas_set();
-}
-
-// This is called whenever the parent canvas gets set/changed
-void
-Layer_PasteCanvas::on_canvas_set()
-{
-       //sinfg::info("before count()=%d",count());
-       if(get_canvas() && canvas && canvas->is_inline() && canvas->parent()!=get_canvas())
-       {
-               //sinfg::info("during count()=%d",count());
-               canvas->set_inline(get_canvas());
-       }
-       //sinfg::info("after count()=%d",count());
-}
-
-ValueBase
-Layer_PasteCanvas::get_param(const String& param)const
-{
-       EXPORT(origin);
-       EXPORT(canvas);
-       EXPORT(zoom);
-       EXPORT(time_offset);
-       EXPORT(children_lock);
-       
-       EXPORT_NAME();
-       EXPORT_VERSION();
-
-       return Layer_Composite::get_param(param);
-}
-
-void
-Layer_PasteCanvas::set_time(Context context, Time time)const
-{
-       if(depth==MAX_DEPTH)return;depth_counter counter(depth);
-       curr_time=time;
-       
-       context.set_time(time);
-       if(canvas)
-       {
-               canvas->set_time(time);
-               
-               bounds=(canvas->get_context().get_full_bounding_rect()-canvas->rend_desc().get_focus())*exp(zoom)+origin+canvas->rend_desc().get_focus();
-       }
-       else
-               bounds=Rect::zero();
-}
-
-sinfg::Layer::Handle
-Layer_PasteCanvas::hit_check(sinfg::Context context, const sinfg::Point &pos)const
-{
-       if(depth==MAX_DEPTH)return 0;depth_counter counter(depth);
-
-       Point target_pos=(pos-canvas->rend_desc().get_focus()-origin)/exp(zoom)+canvas->rend_desc().get_focus();
-
-       if(canvas && get_amount() && canvas->get_context().get_color(target_pos).get_a()>=0.25)
-       {
-               if(!children_lock)
-               {
-                       return canvas->get_context().hit_check(target_pos);
-               }
-               return const_cast<Layer_PasteCanvas*>(this);
-       }
-       else
-               return context.hit_check(pos);
-}
-
-Color
-Layer_PasteCanvas::get_color(Context context, const Point &pos)const
-{
-       if(!canvas || !get_amount())
-               return context.get_color(pos);
-
-       if(depth==MAX_DEPTH)return Color::alpha();depth_counter counter(depth);
-
-       Point target_pos=(pos-canvas->rend_desc().get_focus()-origin)/exp(zoom)+canvas->rend_desc().get_focus();
-       
-       return Color::blend(canvas->get_context().get_color(target_pos),context.get_color(pos),get_amount(),get_blend_method());
-}
-
-
-bool
-Layer_PasteCanvas::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
-{
-       if(cb && !cb->amount_complete(0,10000)) return false;
-
-       if(depth==MAX_DEPTH)
-       {
-               DEBUGPOINT();
-               // if we are at the extent of our depth,
-               // then we should just return whatever is under us.
-               return context.accelerated_render(surface,quality,renddesc,cb);
-       }
-       depth_counter counter(depth);
-               
-       if(!canvas || !get_amount())
-               return context.accelerated_render(surface,quality,renddesc,cb);
-       
-       if(!do_not_muck_with_time_ &&   curr_time!=Time::begin() && canvas->get_time()!=curr_time+time_offset)
-       {
-               canvas->set_time(curr_time+time_offset);
-       }
-       
-       SuperCallback stageone(cb,0,4500,10000);
-       SuperCallback stagetwo(cb,4500,9000,10000);
-       SuperCallback stagethree(cb,9000,9999,10000);
-
-       RendDesc desc(renddesc);
-       Vector::value_type zoomfactor=1.0/exp(zoom);
-       desc.clear_flags();
-       desc.set_tl((desc.get_tl()-canvas->rend_desc().get_focus()-origin)*zoomfactor+canvas->rend_desc().get_focus());
-       desc.set_br((desc.get_br()-canvas->rend_desc().get_focus()-origin)*zoomfactor+canvas->rend_desc().get_focus());
-       desc.set_flags(RendDesc::PX_ASPECT);
-
-       if(is_solid_color() || context->empty())
-       {
-               surface->set_wh(renddesc.get_w(),renddesc.get_h());
-               surface->clear();
-       }
-       else if(!context.accelerated_render(surface,quality,renddesc,&stageone))
-               return false;
-       Color::BlendMethod blend_method(get_blend_method());
-       
-       const Rect full_bounding_rect(canvas->get_context().get_full_bounding_rect());
-
-       if(context->empty())
-       {
-               if(Color::is_onto(blend_method))
-                       return true;
-                       
-               if(blend_method==Color::BLEND_COMPOSITE)
-                       blend_method=Color::BLEND_STRAIGHT;
-       }
-       else
-       if(!etl::intersect(context.get_full_bounding_rect(),full_bounding_rect))
-       {
-               if(Color::is_onto(blend_method))
-                       return true;
-                       
-               if(blend_method==Color::BLEND_COMPOSITE)
-                       blend_method=Color::BLEND_STRAIGHT;
-       }
-       
-#ifndef SINFG_NO_CLIP
-       {
-               //sinfg::info("PasteCanv Clip");
-               Rect area(desc.get_rect()&full_bounding_rect);
-                               
-               Point min(area.get_min());
-               Point max(area.get_max());
-
-               if(desc.get_tl()[0]>desc.get_br()[0])
-                       swap(min[0],max[0]);
-               if(desc.get_tl()[1]>desc.get_br()[1])
-                       swap(min[1],max[1]);
-
-               const int 
-                       x(floor_to_int((min[0]-desc.get_tl()[0])/desc.get_pw())),
-                       y(floor_to_int((min[1]-desc.get_tl()[1])/desc.get_ph())),
-                       w(ceil_to_int((max[0]-desc.get_tl()[0])/desc.get_pw())-x),
-                       h(ceil_to_int((max[1]-desc.get_tl()[1])/desc.get_ph())-y);
-                               
-               desc.set_subwindow(x,y,w,h);
-       
-               Surface pastesurface;
-               
-               if(area.area()<=0.000001 || desc.get_w()==0 || desc.get_h()==0)
-               {
-                       if(cb && !cb->amount_complete(10000,10000)) return false;
-
-                       return true;
-               }
-
-               if(!canvas->get_context().accelerated_render(&pastesurface,quality,desc,&stagetwo))
-                       return false;
-               
-               Surface::alpha_pen apen(surface->get_pen(x,y));
-       
-               apen.set_alpha(get_amount());
-               apen.set_blend_method(blend_method);
-       
-               pastesurface.blit_to(apen);
-       }
-#else
-       {
-               Surface pastesurface;
-       
-               if(!canvas->get_context().accelerated_render(&pastesurface,quality,desc,&stagetwo))
-                       return false;
-       
-               Surface::alpha_pen apen(surface->begin());
-       
-               apen.set_alpha(get_amount());
-               apen.set_blend_method(blend_method);
-       
-               pastesurface.blit_to(apen);
-       }
-#endif
-       
-       if(cb && !cb->amount_complete(10000,10000)) return false;
-
-       return true;
-}
-
-Rect
-Layer_PasteCanvas::get_bounding_rect()const
-{
-       return bounds;
-}
-
-void Layer_PasteCanvas::get_times_vfunc(Node::time_set &set) const
-{
-       Node::time_set tset;
-       if(canvas) tset = canvas->get_times();
-
-       Node::time_set::iterator        i = tset.begin(),
-                                                                       end = tset.end();       
-       
-       //Make sure we offset the time...
-       //TODO: SOMETHING STILL HAS TO BE DONE WITH THE OTHER DIRECTION 
-       //              (recursing down the tree needs to take this into account too...)
-       for(; i != end; ++i)
-       {
-               set.insert(*i + time_offset);
-       }
-               
-       Layer::get_times_vfunc(set);
-}
diff --git a/synfig-core/trunk/src/sinfg/layer_pastecanvas.h b/synfig-core/trunk/src/sinfg/layer_pastecanvas.h
deleted file mode 100644 (file)
index 652bf7a..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_pastecanvas.h
-**     \brief Template Header
-**
-**     $Id: layer_pastecanvas.h,v 1.2 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_PASTEIMAGE_H
-#define __SINFG_LAYER_PASTEIMAGE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "layer_composite.h"
-#include "color.h"
-#include "vector.h"
-#include "real.h"
-#include "time.h"
-#include "canvasbase.h"
-#include "canvas.h"
-#include "rect.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-class Layer_PasteCanvas : public Layer_Composite, public Layer_NoDeform
-{
-       SINFG_LAYER_MODULE_EXT
-private:
-
-       Vector origin;
-
-       etl::loose_handle<sinfg::Canvas> canvas;
-
-       //! Recursion depth counter
-       mutable int depth;
-
-       Real zoom;
-
-       Time time_offset;
-
-       mutable Time curr_time;
-
-       bool optimize_layers(sinfg::Context context,sinfg::CanvasBase&)const;
-
-       bool do_not_muck_with_time_;
-       
-       bool children_lock;
-
-       mutable Rect bounds;
-
-       sigc::connection child_changed_connection;
-public:
-
-       virtual void on_canvas_set();
-
-       void set_do_not_muck_with_time(bool x=true) { do_not_muck_with_time_=true; }
-
-       etl::handle<sinfg::Canvas> get_sub_canvas()const { return canvas; }
-       void set_sub_canvas(etl::handle<sinfg::Canvas> x);
-       
-       Real get_zoom()const { return zoom; }
-
-       Time get_time_offset()const { return time_offset; }
-
-       Point get_origin()const { return origin; }
-
-       Layer_PasteCanvas();
-       virtual ~Layer_PasteCanvas();
-
-       virtual String get_local_name()const;
-       
-       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
-
-       virtual ValueBase get_param(const String & param)const;
-
-       virtual Color get_color(Context context, const Point &pos)const;
-
-       virtual void set_time(Context context, Time time)const;
-
-       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
-
-       virtual Vocab get_param_vocab()const;
-
-       virtual sinfg::Rect get_bounding_rect()const;
-
-       virtual sinfg::Layer::Handle hit_check(sinfg::Context context, const sinfg::Point &point)const;
-       
-protected:
-       virtual void get_times_vfunc(Node::time_set &set) const;        
-
-}; // END of class Layer_PasteCanvas
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer_polygon.cpp b/synfig-core/trunk/src/sinfg/layer_polygon.cpp
deleted file mode 100644 (file)
index 7cd2e2c..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_polygon.cpp
-**     \brief Template Header
-**
-**     $Id: layer_polygon.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "layer_polygon.h"
-#include "string.h"
-#include "time.h"
-#include "context.h"
-#include "paramdesc.h"
-#include "renddesc.h"
-#include "surface.h"
-#include "value.h"
-#include "valuenode.h"
-//#include "ETL/bezier"
-#include <vector>
-
-#include <deque>
-using std::deque;
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace sinfg;
-using namespace std;
-using namespace etl;
-
-/* === G L O B A L S ======================================================= */
-
-SINFG_LAYER_INIT(Layer_Polygon);
-SINFG_LAYER_SET_NAME(Layer_Polygon,"polygon");
-SINFG_LAYER_SET_LOCAL_NAME(Layer_Polygon,_("Polygon"));
-SINFG_LAYER_SET_CATEGORY(Layer_Polygon,_("Geometry"));
-SINFG_LAYER_SET_VERSION(Layer_Polygon,"0.1");
-SINFG_LAYER_SET_CVS_ID(Layer_Polygon,"$Id: layer_polygon.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $");
-
-/* === C L A S S E S ======================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Layer_Polygon::Layer_Polygon():
-       Layer_Shape             (1.0,Color::BLEND_COMPOSITE),
-       vector_list             (0)
-{
-       vector_list.push_back(Point(0,0.5));
-       vector_list.push_back(Point(-0.333333,0));
-       vector_list.push_back(Point(0.333333,0));
-       sync();
-}
-
-Layer_Polygon::~Layer_Polygon()
-{
-}
-
-void
-Layer_Polygon::sync()
-{
-/*
-       int i,pointcount=vector_list.size();
-
-       if(pointcount<3)
-               return;
-
-       //Layer_Shape::clear();
-       //clear();
-
-       // Build edge table
-       move_to(vector_list[0][0],vector_list[0][1]);
-       
-       for(i = 1;i < pointcount; i++)
-       {
-               if(isnan(vector_list[i][0]) || isnan(vector_list[i][1]))
-                       break;
-               line_to(vector_list[i][0],vector_list[i][1]);
-       }
-       close();
-       //endpath();
-*/
-}
-
-void
-Layer_Polygon::add_polygon(const vector<Point> &point_list)
-{
-       int i,pointcount=point_list.size();
-
-       if(pointcount<3)
-               return;
-
-       //Layer_Shape::clear();
-       //clear();
-
-       // Build edge table
-       move_to(point_list[0][0],point_list[0][1]);
-       
-       for(i = 1;i < pointcount; i++)
-       {
-               if(isnan(point_list[i][0]) || isnan(point_list[i][1]))
-                       break;
-               line_to(point_list[i][0],point_list[i][1]);
-       }
-       close();
-       //endpath();
-}
-
-void
-Layer_Polygon::clear()
-{
-       Layer_Shape::clear();
-       vector_list.clear();
-}
-       
-bool
-Layer_Polygon::set_param(const String & param, const ValueBase &value)
-{
-       if(     param=="vector_list" && value.same_as(vector_list))
-       {
-               vector_list=value;
-               Layer_Shape::clear();
-               add_polygon(value);
-               sync();
-               return true;
-       }
-       
-       return Layer_Shape::set_param(param,value);
-}
-
-ValueBase
-Layer_Polygon::get_param(const String &param)const
-{
-       EXPORT(vector_list);
-
-       EXPORT_NAME();
-       EXPORT_VERSION();
-               
-       return Layer_Shape::get_param(param);   
-}
-
-Layer::Vocab
-Layer_Polygon::get_param_vocab()const
-{
-       Layer::Vocab ret(Layer_Shape::get_param_vocab());
-       
-       ret.push_back(ParamDesc("vector_list")
-               .set_local_name(_("Vector List"))
-               .set_origin("offset")
-       );
-       
-       return ret;
-}
diff --git a/synfig-core/trunk/src/sinfg/layer_polygon.h b/synfig-core/trunk/src/sinfg/layer_polygon.h
deleted file mode 100644 (file)
index 0f2bce3..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_polygon.h
-**     \brief Template Header
-**
-**     $Id: layer_polygon.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_POLYGON_H
-#define __SINFG_LAYER_POLYGON_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "layer_shape.h"
-#include "color.h"
-#include "vector.h"
-#include <list>
-#include <vector>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-/*!    \class Layer_Polygon
-**     \beief writeme
-**     \todo This layer needs to support multiple polygons */
-class Layer_Polygon : public Layer_Shape
-{
-       SINFG_LAYER_MODULE_EXT
-       
-private:
-               
-       //exported data
-       std::vector< Point >    vector_list;
-
-protected:
-
-       Layer_Polygon();
-
-public:
-
-       ~Layer_Polygon();
-
-       //! Adds a polygon to the layer
-       /*!     The edge data is automaticly added to the
-       **      EdgeTable, so there is no need to call sync()
-       **      after adding a polygon using this function.
-       **      \param point_list A list containing the
-       **              points that define the polygon's parameter.
-       */
-       void add_polygon(const std::vector<Point> &point_list);
-
-       //! Clears out any polygon data
-       /*!     Also clears out the EdgeTable, so there is no
-       **      need to call sync() after using this function.
-       */
-       void clear();
-
-       //! Updates EdgeTable so it will reflect the parameter data
-       void sync();
-       
-       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
-
-       virtual ValueBase get_param(const String & param)const;
-       
-       virtual Vocab get_param_vocab()const;
-
-private:
-       class           PolySpan;
-       bool render_polyspan(Surface *surface,PolySpan &polyspan)const;
-}; // END of Layer_Polygon
-
-}; // END of namespace sinfg
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer_shape.cpp b/synfig-core/trunk/src/sinfg/layer_shape.cpp
deleted file mode 100644 (file)
index 6c60616..0000000
+++ /dev/null
@@ -1,3073 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_shape.cpp
-**     \brief Template Header
-**
-**     $Id: layer_shape.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "layer_shape.h"
-#include "string.h"
-#include "time.h"
-#include "context.h"
-#include "paramdesc.h"
-#include "renddesc.h"
-#include "surface.h"
-#include "value.h"
-#include "valuenode.h"
-#include "float.h"
-#include "blur.h"
-
-#include "curve_helper.h"
-
-#include <vector>
-
-#include <deque>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace sinfg;
-using namespace std;
-using namespace etl;
-
-/* === G L O B A L S ======================================================= */
-
-SINFG_LAYER_INIT(Layer_Shape);
-SINFG_LAYER_SET_NAME(Layer_Shape,"shape");
-SINFG_LAYER_SET_LOCAL_NAME(Layer_Shape,_("Shape"));
-SINFG_LAYER_SET_CATEGORY(Layer_Shape,_("Internal"));
-SINFG_LAYER_SET_VERSION(Layer_Shape,"0.1");
-SINFG_LAYER_SET_CVS_ID(Layer_Shape,"$Id: layer_shape.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $");
-
-#define EPSILON        1e-12
-
-template < class T >
-inline bool IsZero(const T &n)
-{
-       return (n < EPSILON) && (n > -EPSILON);
-}
-
-/* === C L A S S E S ======================================================= */
-
-//Assumes 64 byte aligned structures if at all
-struct Primitive
-{
-       int             operation;
-       int             number;
-       
-       //Point data[0];
-       
-       enum Operations
-       {
-               NONE = -1,
-               MOVE_TO = 0,            //(x,y)+                                after first point treated as line_to
-               CLOSE,                          //                                              NOT RUNLENGTH enabled
-               LINE_TO,                        //(x,y)+                                continuous func
-               CONIC_TO,                       //(x1,y1,x,y)+                  "   "
-               CONIC_TO_SMOOTH,        //(x,y)+                                "   "
-               CUBIC_TO,                       //(x1,y1,x2,y2,x,y)+    "   "
-               CUBIC_TO_SMOOTH,        //(x2,y2,x,y)+                  "   "
-               END
-       };
-};
-
-//******** CURVE FUNCTIONS *****************
-const int      MAX_SUBDIVISION_SIZE = 64;
-const int      MIN_SUBDIVISION_DRAW_LEVELS = 4;
-
-static void Subd_Conic_Stack(Point *arc)
-{
-       /*
-       
-       b0
-       *               0+1 a
-       b1 b    *               1+2*1+2 a
-       *               1+2     b       *
-       b2              *               
-       *               
-                       
-       0.1.2 ->        0.1 2 3.4
-       
-       */
-       
-       Real a,b;
-       
-       
-       arc[4][0] = arc[2][0];
-       b = arc[1][0];          
-       
-       a = arc[1][0] = (arc[0][0] + b)/2;
-       b = arc[3][0] = (arc[4][0] + b)/2;      
-       arc[2][0] = (a + b)/2;
-       
-       
-       arc[4][1] = arc[2][1];
-       b = arc[1][1];
-       
-       a = arc[1][1] = (arc[0][1] + b)/2;
-       b = arc[3][1] = (arc[4][1] + b)/2;
-       arc[2][1] = (a + b)/2;
-       
-       /* //USING SIMD
-       
-       arc[4] = arc[2];
-       
-       arc[3] = (arc[2] + arc[1])/2;
-       arc[1] = (arc[0] + arc[1])/2;
-
-       arc[2] = (arc[1] + arc[3])/2;
-       
-       */
-       
-}
-
-static void Subd_Cubic_Stack(Point *arc)
-{
-       Real a,b,c;
-       
-       /*
-       
-       b0
-       *               0+1 a
-       b1 b    *               1+2*1+2 a
-       *               1+2     b       *                       0+3*1+3*2+3
-       b2 c    *               1+2*2+2 b       *
-       *               2+3     c       *
-       b3              *
-       *               
-       
-       0.1 2.3 ->      0.1 2 3 4 5.6
-       
-       */
-       
-       arc[6][0] = arc[3][0];
-       
-       b = arc[1][0];
-       c = arc[2][0];
-       
-       a = arc[1][0] = (arc[0][0] + b)/2;
-       b = (b + c)/2;
-       c = arc[5][0] = (arc[6][0] + c)/2;
-       
-       a = arc[2][0] = (a + b)/2;
-       b = arc[4][0] = (b + c)/2;
-       
-       arc[3][0] = (a + b)/2;
-       
-       
-       arc[6][1] = arc[3][1];
-       
-       b = arc[1][1];
-       c = arc[2][1];
-       
-       a = arc[1][1] = (arc[0][1] + b)/2;
-       b = (b + c)/2;
-       c = arc[5][1] = (arc[6][1] + c)/2;
-       
-       a = arc[2][1] = (a + b)/2;
-       b = arc[4][1] = (b + c)/2;
-       
-       arc[3][1] = (a + b)/2;
-       
-       /* //USING SIMD
-       temp
-       
-       arc[6] = arc[3];
-       
-       //backwards to avoid overwriting
-       arc[5] = (arc[2] + arc[3])/2;
-       temp = (arc[1] + arc[2])/2;
-       arc[1] = (arc[0] + arc[1])/2;
-       
-       arc[4] = (temp + arc[5])/2;
-       arc[2] = (arc[1] + temp)/2;
-       
-       arc[3] = (arc[2] + arc[4])/2;
-       
-       */
-}
-
-//************** PARAMETRIC RENDERER SUPPORT STRUCTURES ****************
-
-// super segment
-struct MonoSegment
-{
-       Rect    aabb;
-       int             ydir;
-       vector<Point>   pointlist;
-       
-       MonoSegment(int dir = 0, Real x0 = 0, Real x1 = 0, Real y0 = 0, Real y1 = 0)
-       { 
-               aabb.minx = x0;
-               aabb.maxx = x1;
-               aabb.miny = y0;
-               aabb.maxy = y1;
-
-               ydir = dir;
-       }
-       
-       int intersect(Real x,Real y) const
-       {
-               if((y < aabb.miny) | (y > aabb.maxy) | (x < aabb.minx)) return 0;
-               if(x > aabb.maxx) return ydir;
-       
-               //int i = 0;
-               //int size = pointlist.size();
-               //vector<Point>::const_iterator end = pointlist.end();
-               vector<Point>::const_iterator p = pointlist.begin();
-               
-               //assumes that the rect culled away anything that would be beyond the edges
-               if(ydir > 0)
-               {
-                       while(y > (*++p)[1]);
-               }
-               else
-               {
-                       while(y < (*++p)[1]);
-               }
-               
-               //for the loop to break there must have been a slope (straight line would do nothing)
-               //vector<Point>::const_iterator p1 = p-1;
-               Real dy = p[-1][1] - p[0][1];
-               Real dx = p[-1][0] - p[0][0];
-               
-               assert(dy != 0);
-               
-               Real xi = p[0][0] + (y - p[0][1]) * dx / dy;
-               return (x > xi)*ydir;
-       }
-};
-
-struct CurveArray
-{
-       Rect    aabb;   //not necessarily as effective - can only reject values
-       vector<Point>   pointlist;      //run length - p0, p1, p2, p3 = p10, p11, p12, p13 = p20 ...
-       vector<char>    degrees;
-       
-       CurveArray(Real x0 = 0, Real x1 = 0, Real y0 = 0, Real y1 = 0)
-       { 
-               aabb.set(x0,y0,x1,y1);
-       }
-       
-       void reset(Real x0 = 0, Real x1 = 0, Real y0 = 0, Real y1 = 0)
-       {
-               aabb.set(x0,y0,x1,y1);
-               pointlist.clear();
-               degrees.clear();
-       }
-       
-       int size () const
-       {
-               return degrees.size();
-       }
-       
-       void Start(Point m)
-       {               
-               reset(m[0],m[0],m[1],m[1]);
-               pointlist.push_back(m);         
-       }
-       
-       void AddCubic(Point p1, Point p2, Point dest)
-       {
-               aabb.expand(p1[0],p1[1]);
-               aabb.expand(p2[0],p2[1]);
-               aabb.expand(dest[0],dest[1]);
-               
-               pointlist.push_back(p1);
-               pointlist.push_back(p2);
-               pointlist.push_back(dest);
-               
-               degrees.push_back(3);
-       }
-       
-       void AddConic(Point p1, Point dest)
-       {
-               aabb.expand(p1[0],p1[1]);
-               aabb.expand(dest[0],dest[1]);
-               
-               pointlist.push_back(p1);
-               pointlist.push_back(dest);
-               
-               degrees.push_back(2);
-       }
-       
-       static int intersect_conic(Real x, Real y, Point *p, int level = 0)
-       {
-               Real ymin,ymax,xmin,xmax;
-               int intersects = 0;
-               
-               //sort the overall curve ys - degenerate detection
-               ymin = min(p[0][1],p[2][1]);
-               ymax = max(p[0][1],p[2][1]);
-               
-               xmin = min(min(p[0][0],p[1][0]),p[2][0]);
-               xmax = max(max(p[0][0],p[1][0]),p[2][0]);
-               
-               //to the left, to the right and out of range y, or completely out of range y
-               if( x < xmin ) return 0;
-               if( x > xmax  & (y > ymax | y < ymin) ) return 0;
-               if( (y > ymax & y > p[1][1]) | (y < ymin & y < p[1][1]) ) return 0;
-                       
-               //degenerate line max
-               if(ymin == ymax == p[1][1])
-                       return 0;
-               
-               //degenerate accept - to the right and crossing the base line
-               if(x > xmax)
-               {
-                       return (y <= ymax & y >= ymin);
-               }
-
-               //solve for curve = y
-               
-               //real roots: 
-               //0 roots       - 0 intersection
-               //1 root        - get x, and figure out x
-               //2 roots (non-double root)     - get 2 xs, and count xs to the left
-               
-               //for conic we can assume 1 intersection for monotonic curve
-               Real    a = p[2][1] -   2*p[1][1] +     p[0][1],
-                               b =                     2*p[1][1] -     2*p[0][1],
-                               c =                                                     p[0][1]         -       y;
-               
-               Real t1 = -1, t2 = -1;
-               
-               if(a == 0)
-               {
-                       //linear - easier :)
-                       if(b == 0) return 0; //may not need this check
-                               
-                       t1 = - c / b; //bt + c = 0 solved
-               }else
-               {
-                       //2 degree polynomial
-                       Real b2_4ac = b*b - 4*a*c;
-                       
-                       //if there are double/no roots - no intersections (in real #s that is)
-                       if(b2_4ac <= 0)
-                       {
-                               return 0;
-                       }
-                       
-                       b2_4ac = sqrt(b2_4ac);
-                       
-                       t1 = (-b - b2_4ac) / 2*a,
-                       t2 = (-b + b2_4ac) / 2*a;
-               }
-               
-               //calculate number of intersections             
-               if(t1 >= 0 & t1 <= 1)
-               {
-                       const Real t = t1;
-                       const Real invt = 1 - t;
-                       
-                       //find x val and it counts if it's to the left of the point
-                       const Real xi = invt*invt*p[0][0] + 2*t*invt*p[1][0] + t*t*p[2][0];
-                       const Real dy_t = 2*a*t + b;
-                       
-                       if(dy_t)
-                       {
-                               intersects += (x >= xi) * ( dy_t > 0 ? 1 : -1);
-                       }
-               }
-
-               if(t2 >= 0 & t2 <= 1)
-               {
-                       const Real t = t2;
-                       const Real invt = 1 - t;
-                       
-                       //find x val and it counts if it's to the left of the point
-                       const Real xi = invt*invt*p[0][0] + 2*t*invt*p[1][0] + t*t*p[2][0];
-                       const Real dy_t = 2*a*t + b;
-                       
-                       if(dy_t)
-                       {
-                               intersects += (x >= xi) * ( dy_t > 0 ? 1 : -1);
-                       }
-               }
-               
-               return intersects;
-       }
-       
-       static int      quadratic_eqn(Real a, Real b, Real c, Real *t0, Real *t1)
-       {
-               const Real b2_4ac = b*b - 4*a*c;
-               
-               //degenerate reject (can't take sqrt)
-               if(b2_4ac < 0)
-               {
-                       return 0;
-               }
-               
-               const Real sqrtb2_4ac = sqrt(b2_4ac);           
-               const Real signb = b < 0 ? -1 : 1;
-               const Real q = - 0.5 * (b + signb * sqrtb2_4ac);
-               
-               *t0 = q/a;
-               *t1 = c/q;
-               
-               return sqrtb2_4ac == 0 ? 1 : 2;
-       }
-       
-       //Newton-Raphson root polishing (we don't care about bounds, assumes very near the desired root)
-       static Real polish_cubicroot(Real a, Real b, Real c, Real d, Real t, Real *dpdt)
-       {
-               const Real cn[4] = {a,b,c,d};
-               Real p,dp,newt,oldpmag=FLT_MAX;
-               
-               //eval cubic eqn and it's derivative
-               for(;;)
-               {
-                       p = cn[0]*t + cn[1];
-                       dp = cn[0];
-                       
-                       for(int i = 2; i < 4; i++)
-                       {
-                               dp = p + dp*t;
-                               p = cn[i] + p*t;
-                       }
-                       
-                       if(dp == 0)
-                       {
-                               sinfg::warning("polish_cubicroot: Derivative should not vanish!!!");
-                               return t;
-                       }
-
-                       newt = t - p/dp;
-
-                       if(newt == t || fabs(p) >= oldpmag)
-                       {
-                               *dpdt = dp;
-                               return t;
-                       }
-                       
-                       t = newt;                               
-                       oldpmag = fabs(p);
-               }
-       }
-       
-       static int intersect_cubic(Real x, Real y, Point *p, int level = 0)
-       {
-               const Real INVALIDROOT = -FLT_MAX;
-               Real ymin,ymax,xmin,xmax;
-               Real ymin2,ymax2,ymintot,ymaxtot;
-               int intersects = 0;
-               
-               //sort the overall curve ys and xs - degenerate detection
-               
-               //open span for the two end points
-               ymin = min(p[0][1],p[3][1]);
-               ymax = max(p[0][1],p[3][1]);
-               
-               //other points etc.
-               ymin2 = min(p[1][1],p[2][1]);
-               ymax2 = max(p[1][1],p[2][1]);
-               
-               ymintot = min(ymin,ymin2);
-               ymaxtot = max(ymax,ymax2);
-                               
-               //the entire curve control polygon is in this x range
-               xmin = min(min(p[0][0],p[1][0]),min(p[2][0],p[3][0]));
-               xmax = max(max(p[0][0],p[1][0]),max(p[2][0],p[3][0]));
-                               
-               //outside all y boundaries (no intersect)
-               if( (y > ymaxtot) || (y < ymintot) ) return 0;
-               
-               //left of curve (no intersect)
-               if(x < xmin) return 0;
-               
-               //right of curve (and outside base range)
-               if( x > xmax )
-               {
-                       if( (y > ymax) | (y < ymin) ) return 0;
-                               
-                       //degenerate accept - to the right and inside the [ymin,ymax] range (already rejected if out of range)
-                       const Real n = p[3][1] - p[0][1];
-                       
-                       //extract the sign from the value (we need valid data)
-                       return n < 0 ? -1 : 1;
-               }
-                       
-               //degenerate horizontal line max -- doesn't happen enough to check for
-               if( ymintot == ymaxtot ) return 0;
-               
-               //calculate roots:
-               // can have 0,1,2, or 3 real roots
-               // if any of them are double then reject the two...
-               
-               // y-coefficients for f_y(t) - y = 0
-               Real    a = p[3][1]     - 3*p[2][1]     + 3*p[1][1]     -   p[0][1],
-                               b =                       3*p[2][1]     - 6*p[1][1]     + 3*p[0][1],
-                               c =                                                       3*p[1][1]     - 3*p[0][1],
-                               d =                                                                             p[0][1] - y;
-               
-               Real    ax = p[3][0]    - 3*p[2][0]     + 3*p[1][0]     -   p[0][0],
-                               bx =                      3*p[2][0]     - 6*p[1][0]     + 3*p[0][0],
-                               cx =                                              3*p[1][0]     - 3*p[0][0],
-                               dx =                                                                            p[0][0];
-               
-               Real t1 = INVALIDROOT, t2 = INVALIDROOT, t3 = INVALIDROOT, t, dydt;
-               
-               if(a == 0)
-               {
-                       //only 2nd degree
-                       if(b == 0)
-                       {
-                               //linear
-                               if(c == 0) return 0;
-                                       
-                               t1 = - d / c; //equation devolved into: ct + d = 0 - solve...
-                       }else
-                       {
-                               //0 roots = 0 intersections, 1 root = 2 intersections at the same place (0 effective)
-                               if(quadratic_eqn(a,b,c,&t1,&t2) != 2) return 0;
-                       }                       
-               }else
-               {
-                       //cubic - sigh....
-                       
-                       //algorithm courtesy of Numerical Recipes in C (algorithm copied from pg. 184/185)
-                       Real an = b / a,
-                                bn = c / a,
-                                cn = d / a;
-                       
-                       //if cn is 0 (or really really close), then we can simplify this...
-                       if(IsZero(cn))
-                       {
-                               t3 = 0;
-
-                               //0 roots = 0 intersections, 1 root = 2 intersections at the same place (0 effective)
-                               if(quadratic_eqn(a,b,c,&t1,&t2) != 2)
-                               {
-                                       t1 = t2 = INVALIDROOT;
-                               }
-                       }
-                       else
-                       {                       
-                               //otherwise run the normal cubic root equation
-                               Real Q = (an*an - 3.0*bn) / 9.0;
-                               Real R = ((2.0*an*an - 9.0*bn)*an + 27.0*cn)/54.0;
-                               
-                               if(R*R < Q*Q*Q)
-                               {
-                                       Real theta = acos(R / sqrt(Q*Q*Q));
-                                       
-                                       t1 = -2.0*sqrt(Q)*cos(theta/3) - an/3.0;
-                                       t2 = -2.0*sqrt(Q)*cos((theta+2*PI)/3.0) - an/3.0;
-                                       t3 = -2.0*sqrt(Q)*cos((theta-2*PI)/3.0) - an/3.0;
-                                       
-                                       //don't need to reorder,l just need to eliminate double/triple roots
-                                       //if(t3 == t2 & t1 == t2) t2 = t3 = INVALIDROOT;
-                                       if(t3 == t2) t2 = t3 = INVALIDROOT;
-                                       if(t1 == t2) t1 = t2 = INVALIDROOT;
-                                       if(t1 == t3) t1 = t3 = INVALIDROOT;
-                               }else
-                               {
-                                       Real signR = R < 0 ? -1 : 1;
-                                       Real A = - signR * pow(signR*R + sqrt(R*R - Q*Q*Q),1/3.0);
-                                       
-                                       Real B;
-                                       if(A == 0) B = 0;
-                                       else B = Q / A;
-       
-                                       //single real root in this case
-                                       t1 = (A + B) - an/3.0;
-                               }
-                       }
-               }
-               
-               //if(t1 != INVALIDROOT)
-               {
-                       t = t1;//polish_cubicroot(a,b,c,d,t1,&dydt);
-                       if(t >= 0 & t < 1)
-                       {
-                               //const Real invt = 1 - t;
-                               
-                               //find x val and it counts if it's to the left of the point
-                               const Real xi = ((ax*t + bx)*t + cx)*t + dx;
-                               dydt = (3*a*t + 2*b)*t + c;
-                               
-                               if(dydt)
-                               {
-                                       intersects += (x >= xi) * ( dydt > 0 ? 1 : -1);
-                               }
-                       }
-               }
-
-               //if(t2 != INVALIDROOT)
-               {
-                       t = t2;//polish_cubicroot(a,b,c,d,t2,&dydt);
-                       if(t >= 0 & t < 1)
-                       {
-                               //const Real invt = 1 - t;
-                               
-                               //find x val and it counts if it's to the left of the point
-                               const Real xi = ((ax*t + bx)*t + cx)*t + dx;
-                               dydt = (3*a*t + 2*b)*t + c;
-                               
-                               if(dydt)
-                               {
-                                       intersects += (x >= xi) * ( dydt > 0 ? 1 : -1);
-                               }
-                       }
-               }
-
-               //if(t3 != INVALIDROOT)
-               {
-                       t = t3;//polish_cubicroot(a,b,c,d,t3,&dydt);
-                       if(t >= 0 & t < 1)
-                       {
-                               //const Real invt = 1 - t;
-                               
-                               //find x val and it counts if it's to the left of the point
-                               const Real xi = ((ax*t + bx)*t + cx)*t + dx;
-                               dydt = (3*a*t + 2*b)*t + c;
-                               
-                               if(dydt)
-                               {
-                                       intersects += (x >= xi) * ( dydt > 0 ? 1 : -1);
-                               }
-                       }
-               }
-               
-               return intersects;
-       }
-       
-       int intersect(Real x,Real y, Point *table) const
-       {               
-               if((y < aabb.miny) | (y > aabb.maxy) | (x < aabb.minx)) return 0;
-                       
-               int i, curdeg, intersects = 0;
-               const int numcurves = degrees.size();
-               
-               vector<Point>::const_iterator   p = pointlist.begin();
-                                       
-               for(i=0; i < numcurves; i++)
-               {
-                       curdeg = degrees[i];
-                       
-                       switch(curdeg)
-                       {
-                               case 2:
-                               {
-                                       table[0] = *p++;
-                                       table[1] = *p++;
-                                       table[2] = *p;  //we want to include the last point for the next curve
-                                       
-                                       intersects += intersect_conic(x,y,table);
-                                       
-                                       break;
-                               }
-                               
-                               case 3:
-                               {
-                                       table[0] = *p++;
-                                       table[1] = *p++;
-                                       table[2] = *p++;
-                                       table[3] = *p;  //we want to include the last point for the next curve
-                                       
-                                       intersects += intersect_cubic(x,y,table);
-                                       
-                                       break;
-                               }
-                               
-                               default:
-                               {
-                                       warning("Invalid degree (%d) inserted into the list (index: %d)\n", curdeg, i);
-                                       return 0;
-                               }
-                       }                               
-               }
-               
-               return intersects;
-       }
-};
-
-struct Layer_Shape::Intersector
-{      
-       Rect    aabb;
-       bool    initaabb;
-       
-       int     flags;
-       
-       enum IntersectorFlags
-       {
-               NotClosed = 0x8000
-       };
-       
-       enum PrimitiveType
-       {
-               TYPE_NONE = 0,
-               TYPE_LINE,
-               TYPE_CURVE
-       };
-       
-       Real    cur_x,cur_y;
-       Real    close_x,close_y;
-       
-       vector<MonoSegment>                             segs;   //monotonically increasing 
-       vector<CurveArray>                              curves; //big array of consecutive curves
-       
-       int                                                             prim;
-       Vector                                                  tangent;
-       
-       Intersector()
-       {
-               clear();
-       }
-       
-       bool notclosed()
-       {
-               return (flags & NotClosed) | (cur_x != close_x) | (cur_y != close_y);
-       }
-       
-       void move_to(Real x, Real y)
-       {
-               close();
-               
-               close_x = cur_x = x;
-               close_y = cur_y = y;
-               
-               tangent[0] = tangent[1] = 0;
-               
-               if(initaabb) 
-               {
-                       aabb.set_point(x,y);
-                       initaabb = false;
-               }else aabb.expand(x,y);
-               
-               prim = TYPE_NONE;
-       }
-       
-       void line_to(Real x, Real y)
-       {
-               int dir = (y > cur_y)*1 + (-1)*(y < cur_y);
-               
-               //check for context (if not line start a new segment)
-               //if we're not in line mode (cover's 0 set case), or if directions are different (not valid for 0 direction)
-               if(prim != TYPE_LINE || (dir && segs.back().ydir != dir))
-               {
-                       MonoSegment             seg(dir,x,x,y,y);
-                       
-                       seg.aabb.expand(cur_x,cur_y);
-                       seg.pointlist.push_back(Point(cur_x,cur_y));
-                       seg.pointlist.push_back(Point(x,y));
-                       segs.push_back(seg);
-               }
-               //add to the last segment, because it works
-               else
-               {                       
-                       segs.back().pointlist.push_back(Point(x,y));
-                       segs.back().aabb.expand(x,y);
-               }
-
-
-                                               
-               cur_x = x;
-               cur_y = y;
-               aabb.expand(x,y); //expand the entire things bounding box
-               
-               tangent[0] = x - cur_x;
-               tangent[1] = x - cur_y;
-               
-               flags |= NotClosed;
-               prim = TYPE_LINE;
-       }
-       
-       void conic_to_smooth(Real x, Real y)
-       {
-               const Real x1 = tangent[0]/2.0 + cur_x;
-               const Real y1 = tangent[1]/2.0 + cur_y;
-               
-               conic_to(x1,y1,x,y);
-       }
-       
-       void conic_to(Real x1, Real y1, Real x, Real y)
-       {
-               //if we're not already a curve start one
-               if(prim != TYPE_CURVE)
-               {
-                       CurveArray      c;
-
-                       c.Start(Point(cur_x,cur_y));
-                       c.AddConic(Point(x1,y1),Point(x,y));
-                       
-                       curves.push_back(c);
-               }else
-               {
-                       curves.back().AddConic(Point(x1,y1),Point(x,y));
-               }
-               
-               cur_x = x;
-               cur_y = y;
-               
-               aabb.expand(x1,y1);
-               aabb.expand(x,y);
-               
-               tangent[0] = 2*(x - x1);
-               tangent[1] = 2*(y - y1);
-               
-               flags |= NotClosed;
-               prim = TYPE_CURVE;
-       }
-       
-       void curve_to_smooth(Real x2, Real y2, Real x, Real y)
-       {
-               Real x1 = tangent[0]/3.0 + cur_x;
-               Real y1 = tangent[1]/3.0 + cur_y;
-               
-               curve_to(x1,y1,x2,y2,x,y);              
-       }
-       
-       void curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y)
-       {
-               //if we're not already a curve start one
-               if(prim != TYPE_CURVE)
-               {
-                       CurveArray      c;
-
-                       c.Start(Point(cur_x,cur_y));
-                       c.AddCubic(Point(x1,y1),Point(x2,y2),Point(x,y));
-                       
-                       curves.push_back(c);
-               }else
-               {
-                       curves.back().AddCubic(Point(x1,y1),Point(x2,y2),Point(x,y));
-               }
-               
-               cur_x = x;
-               cur_y = y;
-               
-               //expand bounding box around ALL of it
-               aabb.expand(x1,y1);
-               aabb.expand(x2,y2);
-               aabb.expand(x,y);
-               
-               tangent[0] = 3*(x - x2);
-               tangent[1] = 3*(y - y2);
-               
-               flags |= NotClosed;
-               prim = TYPE_CURVE;
-       }
-       
-       void close()
-       {
-               if(flags & NotClosed)
-               {
-                       if(cur_x != close_x || cur_y != close_y)
-                       {
-                               line_to(close_x,close_y);
-                       }
-                       
-                       flags &= ~NotClosed;
-               }
-       }
-       
-       //assumes the line to count the intersections with is (-1,0)
-       int     intersect (Real x, Real y) const
-       {
-               int inter = 0;
-               unsigned int i;
-               vector<MonoSegment>::const_iterator s = segs.begin();
-               vector<CurveArray>::const_iterator c = curves.begin();          
-               
-               Point   memory[3*MAX_SUBDIVISION_SIZE + 1];
-               
-               for(i = 0; i < segs.size(); i++,s++)
-               {
-                       inter += s->intersect(x,y);
-               }
-               
-               for(i=0; i < curves.size(); i++,c++)
-                       inter += c->intersect(x,y,memory);
-               
-               return inter;
-       }
-       
-       //intersect an arbitrary line
-       //int   intersect (Real x, Real y, Real vx, Real vy) {return 0;}
-       
-       void clear()
-       { 
-               segs.clear();
-               curves.clear();
-               
-               flags = 0;
-               cur_x = cur_y = close_x = close_y = 0;
-               prim = TYPE_NONE;
-               tangent[0] = tangent[1] = 0;
-               initaabb = true;
-       }
-};
-
-//*********** SCANLINE RENDERER SUPPORT STRUCTURES ***************
-struct PenMark
-{
-       int y,x;
-       Real cover,area;
-       
-       PenMark(){}     
-       PenMark(int xin, int yin, Real c, Real a)
-               :y(yin),x(xin),cover(c),area(a) {}
-       
-       void set(int xin, int yin, Real c, Real a)      { y = yin; x = xin; cover = c; area = a;        }
-       
-       void setcoord(int xin, int yin)                         { y = yin; x = xin;     }
-       
-       void setcover(Real c, Real a)                           { cover = c; area = a; }
-       void addcover(Real c, Real a)                           { cover += c; area += a; }
-       
-       bool operator < (const PenMark &rhs) const
-       {
-               return y == rhs.y ? x < rhs.x : y < rhs.y;
-       }
-};
-
-typedef rect<int> ContextRect;
-
-class Layer_Shape::PolySpan
-{
-public:
-       typedef deque<PenMark>  cover_array;
-
-       Point                   arc[3*MAX_SUBDIVISION_SIZE + 1];
-
-       cover_array             covers;
-       PenMark                 current;
-
-       int                             open_index;
-
-       //ending position of last primitive
-       Real                    cur_x;
-       Real                    cur_y;
-
-       //starting position of current primitive list
-       Real                    close_x;
-       Real                    close_y;
-       
-       //flags for the current segment
-       int                             flags;
-
-       //the window that will be drawn (used for clipping)
-       ContextRect             window;
-
-       //for assignment to flags value
-       enum PolySpanFlags
-       {
-               NotSorted = 0x8000,
-               NotClosed =     0x4000
-       };
-       
-       //default constructor - 0 everything
-       PolySpan() :current(0,0,0,0),flags(NotSorted)
-       {
-               cur_x = cur_y = close_x = close_y = 0;
-               open_index = 0;
-       }
-       
-       bool notclosed() const
-       {
-               return (flags & NotClosed) | (cur_x != close_x) | (cur_y != close_y);
-       }
-       
-       //0 out all the variables involved in processing 
-       void clear()
-       {
-               covers.clear();
-               cur_x = cur_y = close_x = close_y = 0;
-               open_index = 0;         
-               current.set(0,0,0,0);
-               flags = NotSorted;
-       }
-
-       //add the current cell, but only if there is information to add 
-       void addcurrent()
-       {
-               if(current.cover || current.area)
-               {
-                       covers.push_back(current);
-               }
-       }
-       
-       //move to the next cell (cover values 0 initially), keeping the current if necessary
-       void move_pen(int x, int y)
-       {
-               if(y != current.y | x != current.x)
-               {
-                       addcurrent();
-                       current.set(x,y,0,0);
-               }
-       }
-       
-       //close the primitives with a line (or rendering will not work as expected)
-       void close()
-       {
-               if(flags & NotClosed)
-               {
-                       if(cur_x != close_x || cur_y != close_y)
-                       {
-                               line_to(close_x,close_y);
-                               addcurrent();
-                               current.setcover(0,0);
-                       }
-                       flags &= ~NotClosed;
-               }
-       }
-       
-       // Not recommended - destroys any separation of spans currently held
-       void merge_all()
-       {
-               sort(covers.begin(),covers.end());
-               open_index = 0;
-       }
-       
-       //will sort the marks if they are not sorted
-       void sort_marks()
-       {
-               if(flags & NotSorted)
-               {
-                       //only sort the open index                      
-                       addcurrent();
-                       current.setcover(0,0);
-                       
-                       sort(covers.begin() + open_index,covers.end());
-                       flags &= ~NotSorted;
-               }
-       }
-       
-       //encapsulate the current sublist of marks (used for drawing)
-       void encapsulate_current()
-       {
-               //sort the current list then reposition the open list section
-               sort_marks();
-               open_index = covers.size();
-       }
-       
-       //move to start a new primitive list (enclose the last primitive if need be)
-       void move_to(Real x, Real y)
-       {
-               close();
-               if(isnan(x))x=0;
-               if(isnan(y))y=0;
-               move_pen((int)floor(x),(int)floor(y));
-               close_y = cur_y = y;
-               close_x = cur_x = x;
-       }
-
-       //primitive_to functions
-       void line_to(Real x, Real y);
-       void conic_to(Real x1, Real y1, Real x, Real y);
-       void cubic_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y);
-       
-       void draw_scanline(int y, Real x1, Real y1, Real x2, Real y2);
-       void draw_line(Real x1, Real y1, Real x2, Real y2);
-       
-       Real ExtractAlpha(Real area)
-       {
-               //non-zero winding style
-               if(area < 0) area = -area;
-               if(area > 1) area = 1;
-                       
-               //even-odd winding style
-               /*if(area < 0) area = -area;
-               
-               while(area > 2) area -= 2;
-               if(area > 1) area = 1-area; //want pyramid like thing
-               */
-               //broken? - yep broken
-                               
-               return area;
-       }
-};
-
-/* === M E T H O D S ======================================================= */
-
-Layer_Shape::Layer_Shape(const Real &a, const Color::BlendMethod m):
-       Layer_Composite (a,m),
-       edge_table              (new Intersector),
-       color                   (Color::black()),
-       offset                  (0,0),
-       invert                  (false),
-       antialias               (true),
-       blurtype                (Blur::FASTGAUSSIAN),
-       feather                 (0),
-       bytestream              (0),
-       lastbyteop              (Primitive::NONE),
-       lastoppos               (-1)
-{
-}
-
-Layer_Shape::~Layer_Shape()
-{
-       delete edge_table;
-}
-
-void
-Layer_Shape::clear()
-{
-       edge_table->clear();
-       bytestream.clear();
-}
-       
-bool
-Layer_Shape::set_param(const String & param, const ValueBase &value)
-{
-       IMPORT(color);
-       IMPORT(offset);
-       IMPORT(invert);
-       IMPORT(antialias);
-       IMPORT(feather);
-       IMPORT(blurtype);
-       
-       return Layer_Composite::set_param(param,value);
-}
-
-ValueBase
-Layer_Shape::get_param(const String &param)const
-{
-       EXPORT(color);
-       EXPORT(offset);
-       EXPORT(invert);
-       EXPORT(antialias);
-       EXPORT(feather);
-       EXPORT(blurtype);
-       
-       EXPORT_NAME();
-       EXPORT_VERSION();
-               
-       return Layer_Composite::get_param(param);
-}
-
-Layer::Vocab
-Layer_Shape::get_param_vocab()const
-{
-       Layer::Vocab ret(Layer_Composite::get_param_vocab());
-       
-       ret.push_back(ParamDesc("color")
-               .set_local_name(_("Color"))
-               .set_description(_("Layer_Shape Color"))
-       );
-       ret.push_back(ParamDesc("offset")
-               .set_local_name(_("Position"))
-       );
-       ret.push_back(ParamDesc("invert")
-               .set_local_name(_("Invert"))
-       );
-       ret.push_back(ParamDesc("antialias")
-               .set_local_name(_("Antialiasing"))
-       );      
-       ret.push_back(ParamDesc("feather")
-               .set_local_name(_("Feather"))
-               .set_is_distance()
-       );
-       ret.push_back(ParamDesc("blurtype")
-               .set_local_name(_("Type of Feather"))
-               .set_description(_("Type of feathering to use"))
-               .set_hint("enum")
-               .add_enum_value(Blur::BOX,"box",_("Box Blur"))
-               .add_enum_value(Blur::FASTGAUSSIAN,"fastgaussian",_("Fast Gaussian Blur"))
-               .add_enum_value(Blur::CROSS,"cross",_("Cross-Hatch Blur"))
-               .add_enum_value(Blur::GAUSSIAN,"gaussian",_("Gaussian Blur"))
-               .add_enum_value(Blur::DISC,"disc",_("Disc Blur"))
-       );
-       
-       return ret;
-}
-
-sinfg::Layer::Handle
-Layer_Shape::hit_check(sinfg::Context context, const sinfg::Point &p)const
-{
-       Point pos(p-offset);
-               
-       int intercepts = edge_table->intersect(pos[0],pos[1]);
-
-       // If we have an odd number of intercepts, we are inside.
-       // If we have an even number of intercepts, we are outside.
-       bool intersect = ((!!intercepts) ^ invert);
-
-       if(get_amount() == 0 || get_blend_method() == Color::BLEND_ALPHA_OVER)
-       {
-               intersect = false;
-       }
-
-       if(intersect)
-       {
-               sinfg::Layer::Handle tmp;
-               if(get_blend_method()==Color::BLEND_BEHIND && (tmp=context.hit_check(p)))
-                       return tmp;
-               if(Color::is_onto(get_blend_method()))
-               {
-                       //if there's something in the lower layer then we're set...
-                       if(!context.hit_check(p).empty())
-                               return const_cast<Layer_Shape*>(this);
-               }else if(get_blend_method() == Color::BLEND_ALPHA_OVER)
-               {
-                       sinfg::info("layer_shape::hit_check - we've got alphaover");
-                       //if there's something in the lower layer then we're set...
-                       if(color.get_a() < 0.1 && get_amount() > .9)
-                       {
-                               sinfg::info("layer_shape::hit_check - can see through us... so nothing");
-                               return Handle();
-                       }else return context.hit_check(p);
-               }else
-                       return const_cast<Layer_Shape*>(this);
-       }
-
-       return context.hit_check(p);
-}
-
-Color
-Layer_Shape::get_color(Context context, const Point &p)const
-{
-       Point pp = p;
-       
-       if(feather)
-               pp = Blur(feather,feather,blurtype)(p);
-       
-       Point pos(pp-offset);
-               
-       int intercepts = edge_table->intersect(pos[0],pos[1]);
-
-       // If we have an odd number of intercepts, we are inside.
-       // If we have an even number of intercepts, we are outside.
-       bool intersect = ((!!intercepts) ^ invert);
-       
-       if(!intersect)
-               return context.get_color(pp);
-
-       //Ok, we're inside... bummmm ba bum buM...
-       if(get_blend_method() == Color::BLEND_STRAIGHT && get_amount() == 1)
-               return color;
-       else
-               return Color::blend(color,context.get_color(p),get_amount(),get_blend_method());
-}
-
-//************** SCANLINE RENDERING *********************
-void Layer_Shape::PolySpan::line_to(Real x, Real y)    
-{      
-       Real n[4];
-       bool afterx = false;
-       
-       const Real xin(x), yin(y);
-       
-       Real dx = x - cur_x;
-       Real dy = y - cur_y;
-       
-       //CLIP IT!!!!
-       try {
-       //outside y - ignore entirely
-       if(      (cur_y >= window.maxy & y >= window.maxy)
-               |(cur_y <  window.miny & y <  window.miny) )
-       {
-               cur_x = x;
-               cur_y = y;      
-       }
-       else //not degenerate - more complicated
-       {
-               if(dy > 0) //be sure it's not tooooo small
-               {                               
-                       // cur_y ... window.miny ... window.maxy ... y
-                       
-                       //initial degenerate - initial clip
-                       if(cur_y < window.miny)
-                       {
-                               //new clipped start point (must also move pen)
-                               n[2] = cur_x + (window.miny - cur_y) * dx / dy;
-                               
-                               cur_x = n[2];
-                               cur_y = window.miny;
-                               move_pen((int)floor(cur_x),window.miny);
-                       }
-                       
-                       //generate data for the ending clipped info                     
-                       if(y > window.maxy)
-                       {
-                               //intial line to intersection (and degenerate)
-                               n[2] = x + (window.maxy - y) * dx / dy;
-       
-                               //intersect coords
-                               x = n[2];
-                               y = window.maxy;
-                       }
-               }
-               else
-               {
-                       //initial degenerate - initial clip
-                       if(cur_y > window.maxy)
-                       {                               
-                               //new clipped start point (must also move pen)
-                               n[2] = cur_x + (window.maxy - cur_y) * dx / dy;
-                               
-                               cur_x = n[2];
-                               cur_y = window.maxy;
-                               move_pen((int)floor(cur_x),window.maxy);
-                       }
-                       
-                       //generate data for the ending clipped info                     
-                       if(y < window.miny)
-                       {
-                               //intial line to intersection (and degenerate)
-                               n[2] = x + (window.miny - y) * dx / dy;
-       
-                               //intersect coords
-                               x = n[2];
-                               y = window.miny;
-                       }
-               }
-               
-               //all degenerate - but require bounded clipped values
-               if(   (cur_x >= window.maxx && x >= window.maxx)
-                       ||(cur_x <  window.minx && x <  window.minx) )
-               {
-                       //clip both vertices - but only needed in the x direction
-                       cur_x = max(cur_x,      (Real)window.minx);
-                       cur_x = min(cur_x,      (Real)window.maxx);
-                       
-                       //clip the dest values - y is already clipped                           
-                       x = max(x,(Real)window.minx);
-                       x = min(x,(Real)window.maxx);
-                       
-                       //must start at new point...
-                       move_pen((int)floor(cur_x),(int)floor(cur_y));
-                       
-                       draw_line(cur_x,cur_y,x,y);
-                       
-                       cur_x = xin;
-                       cur_y = yin;
-               }                               
-               else
-               {
-                       //clip x
-                       if(dx > 0)
-                       {
-                               //initial degenerate - initial clip
-                               if(cur_x < window.minx)
-                               {
-                                       //need to draw an initial segment from clippedx,cur_y to clippedx,intersecty
-                                       n[2] = cur_y + (window.minx - cur_x) * dy / dx;
-                                       
-                                       move_pen(window.minx,(int)floor(cur_y));
-                                       draw_line(window.minx,cur_y,window.minx,n[2]);
-                                       
-                                       cur_x = window.minx;
-                                       cur_y = n[2];
-                               }
-                               
-                               //generate data for the ending clipped info                     
-                               if(x > window.maxx)
-                               {
-                                       //intial line to intersection (and degenerate)
-                                       n[2] = y + (window.maxx - x) * dy / dx;
-                                       
-                                       n[0] = window.maxx;
-                                       n[1] = y;
-               
-                                       //intersect coords
-                                       x = window.maxx;
-                                       y = n[2];
-                                       afterx = true;
-                               }
-                       }else
-                       {
-                               //initial degenerate - initial clip
-                               if(cur_x > window.maxx)
-                               {
-                                       //need to draw an initial segment from clippedx,cur_y to clippedx,intersecty
-                                       n[2] = cur_y + (window.maxx - cur_x) * dy / dx;
-                                       
-                                       move_pen(window.maxx,(int)floor(cur_y));
-                                       draw_line(window.maxx,cur_y,window.maxx,n[2]);
-                                       
-                                       cur_x = window.maxx;
-                                       cur_y = n[2];
-                               }
-                               
-                               //generate data for the ending clipped info                     
-                               if(x < window.minx)
-                               {
-                                       //intial line to intersection (and degenerate)
-                                       n[2] = y + (window.minx - x) * dy / dx;
-                                       
-                                       n[0] = window.minx;
-                                       n[1] = y;
-               
-                                       //intersect coords
-                                       x = window.minx;
-                                       y = n[2];
-                                       afterx = true;
-                               }
-                       }
-                       
-                       move_pen((int)floor(cur_x),(int)floor(cur_y));
-                       //draw the relevant line (clipped)
-                       draw_line(cur_x,cur_y,x,y);
-                       
-                       if(afterx)
-                       {
-                               draw_line(x,y,n[0],n[1]);
-                       }
-                               
-                       cur_x = xin;
-                       cur_y = yin;
-               }
-       }
-       } catch(...) { sinfg::error("line_to: cur_x=%f, cur_y=%f, x=%f, y=%f", cur_x, cur_y, x, y); throw; }
-
-       flags |= NotClosed|NotSorted;
-}
-
-static inline bool clip_conic(const Point *const p, const ContextRect &r)
-{
-       const Real minx = min(min(p[0][0],p[1][0]),p[2][0]);
-       const Real miny = min(min(p[0][1],p[1][1]),p[2][1]);
-       const Real maxx = max(max(p[0][0],p[1][0]),p[2][0]);
-       const Real maxy = max(max(p[0][1],p[1][1]),p[2][1]);
-
-       return  (minx > r.maxx) |
-                       (maxx < r.minx) |
-                       (miny > r.maxy) |
-                       (maxy < r.miny);
-}
-
-static inline bool clip_cubic(const Point *const p, const ContextRect &r)
-{
-       /*const Real minx = min(min(p[0][0],p[1][0]),min(p[2][0],p[3][0]));
-       const Real miny = min(min(p[0][1],p[1][1]),min(p[2][1],p[3][1]));
-       const Real maxx = max(max(p[0][0],p[1][0]),max(p[2][0],p[3][1]));
-       const Real maxy = max(max(p[0][1],p[1][1]),max(p[2][1],p[3][1]));
-
-       return  (minx > r.maxx) ||
-                       (maxx < r.minx) ||
-                       (miny > r.maxy) ||
-                       (maxy < r.miny);*/
-       
-       return  ((p[0][0] > r.maxx) & (p[1][0] > r.maxx) & (p[2][0] > r.maxx) & (p[3][0] > r.maxx)) |
-                       ((p[0][0] < r.minx) & (p[1][0] < r.minx) & (p[2][0] < r.minx) & (p[3][0] < r.minx)) |
-                       ((p[0][1] > r.maxy) & (p[1][1] > r.maxy) & (p[2][1] > r.maxy) & (p[3][1] > r.maxy)) |
-                       ((p[0][1] < r.miny) & (p[1][1] < r.miny) & (p[2][1] < r.miny) & (p[3][1] < r.miny));
-}
-
-static inline Real max_edges_cubic(const Point *const p)
-{
-       const Real x1 = p[1][0] - p[0][0];
-       const Real y1 = p[1][1] - p[0][1];
-       
-       const Real x2 = p[2][0] - p[1][0];
-       const Real y2 = p[2][1] - p[1][1];
-       
-       const Real x3 = p[3][0] - p[2][0];
-       const Real y3 = p[3][1] - p[2][1];
-       
-       const Real d1 = x1*x1 + y1*y1;
-       const Real d2 = x2*x2 + y2*y2;
-       const Real d3 = x3*x3 + y3*y3;
-       
-       return max(max(d1,d2),d3);
-}
-
-static inline Real max_edges_conic(const Point *const p)
-{
-       const Real x1 = p[1][0] - p[0][0];
-       const Real y1 = p[1][1] - p[0][1];
-       
-       const Real x2 = p[2][0] - p[1][0];
-       const Real y2 = p[2][1] - p[1][1];
-       
-       const Real d1 = x1*x1 + y1*y1;
-       const Real d2 = x2*x2 + y2*y2;
-       
-       return max(d1,d2);
-}
-
-void Layer_Shape::PolySpan::conic_to(Real x1, Real y1, Real x, Real y)
-{
-       Point *current = arc;
-       int             level = 0;
-       int     num = 0;
-       bool    onsecond = false;
-       
-       arc[0] = Point(x,y);
-       arc[1] = Point(x1,y1);
-       arc[2] = Point(cur_x,cur_y);
-       
-       //just draw the line if it's outside
-       if(clip_conic(arc,window))
-       {
-               line_to(x,y);
-               return;
-       }
-       
-       //Ok so it's not super degenerate, subdivide and draw (run through minimum subdivision levels first)
-       while(current >= arc)
-       {
-               if(num >= MAX_SUBDIVISION_SIZE)
-               {
-                       warning("Curve subdivision somehow ran out of space while tesselating!");
-                       
-                       //do something...
-                       assert(0);
-                       return;
-               }else
-               //if the curve is clipping then draw degenerate
-               if(clip_conic(current,window))
-               {
-                       line_to(current[0][0],current[0][1]); //backwards so front is destination
-                       current -= 2;
-                       if(onsecond) level--;
-                       onsecond = true;
-                       num--;
-                       continue;
-               }else
-               //if we are not at the level minimum
-               if(level < MIN_SUBDIVISION_DRAW_LEVELS)
-               {
-                       Subd_Conic_Stack(current);
-                       current += 2;           //cursor on second curve
-                       level ++;
-                       num ++;
-                       onsecond = false;
-                       continue;
-               }else
-               //split it again, if it's too big
-               if(max_edges_conic(current) > 0.25) //distance of .5 (cover no more than half the pixel)
-               {
-                       Subd_Conic_Stack(current);
-                       current += 2;           //cursor on second curve
-                       level ++;
-                       num ++;
-                       onsecond = false;
-               }
-               else    //NOT TOO BIG? RENDER!!!
-               {
-                       //cur_x,cur_y = current[2], so we need to go 1,0
-                       line_to(current[1][0],current[1][1]);
-                       line_to(current[0][0],current[0][1]);
-                       
-                       current -= 2;
-                       if(onsecond) level--;
-                       num--;
-                       onsecond = true;
-               }
-       }
-}
-
-void Layer_Shape::PolySpan::cubic_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y)
-{
-       Point *current = arc;
-       int             num = 0;
-       int             level = 0;
-       bool    onsecond = false;
-       
-       arc[0] = Point(x,y);
-       arc[1] = Point(x2,y2);
-       arc[2] = Point(x1,y1);
-       arc[3] = Point(cur_x,cur_y);
-       
-       //just draw the line if it's outside
-       if(clip_cubic(arc,window))
-       {
-               line_to(x,y);
-               return;
-       }
-       
-       //Ok so it's not super degenerate, subdivide and draw (run through minimum subdivision levels first)
-       while(current >= arc) //once current goes below arc, there are no more curves left
-       {
-               if(num >= MAX_SUBDIVISION_SIZE)
-               {
-                       warning("Curve subdivision somehow ran out of space while tesselating!");
-                       
-                       //do something...
-                       assert(0);
-                       return;
-               }else
-               
-               //if we are not at the level minimum 
-               if(level < MIN_SUBDIVISION_DRAW_LEVELS)
-               {
-                       Subd_Cubic_Stack(current);
-                       current += 3;           //cursor on second curve
-                       level ++;
-                       num ++;
-                       onsecond = false;
-                       continue;
-               }else
-               //if the curve is clipping then draw degenerate
-               if(clip_cubic(current,window))
-               {
-                       line_to(current[0][0],current[0][1]); //backwards so front is destination
-                       current -= 3;
-                       if(onsecond) level--;
-                       onsecond = true;
-                       num --;
-                       continue;
-               }               
-               else
-               //split it again, if it's too big
-               if(max_edges_cubic(current) > 0.25) //could use max_edges<3>
-               {
-                       Subd_Cubic_Stack(current);
-                       current += 3;           //cursor on second curve
-                       level ++;
-                       num ++;
-                       onsecond = false;
-               }
-               else //NOT TOO BIG? RENDER!!!
-               {
-                       //cur_x,cur_y = current[3], so we need to go 2,1,0
-                       line_to(current[2][0],current[2][1]);
-                       line_to(current[1][0],current[1][1]);
-                       line_to(current[0][0],current[0][1]);
-                       
-                       current -= 3;
-                       if(onsecond) level--;
-                       num --;
-                       onsecond = true;
-               }
-       }       
-}
-
-//******************** LINE ALGORITHMS ****************************
-// THESE CALCULATE THE AREA AND THE COVER FOR THE MARKS, TO THEN SCAN CONVERT 
-// - BROKEN UP INTO SCANLINES (draw_line - y intersections), 
-//   THEN THE COVER AND AREA PER TOUCHED PIXEL IS CALCULATED (draw_scanline - x intersections)
-void Layer_Shape::PolySpan::draw_scanline(int y, Real x1, Real fy1, Real x2, Real fy2)
-{
-       int     ix1 = (int)floor(x1);
-       int     ix2 = (int)floor(x2);
-       Real fx1 = x1 - ix1;
-       Real fx2 = x2 - ix2;
-       
-       Real dx,dy,dydx,mult;
-       
-       dx = x2 - x1;
-       dy = fy2 - fy1;
-       
-       //case horizontal line
-       if(fy1 == fy2)
-       {
-               move_pen(ix2,y); //pen needs to be at the last coord
-               return;
-       }
-       
-       //case all in same pixel
-       if(ix1 == ix2)  //impossible for degenerate case (covered by the previous cases)
-       {
-               current.addcover(dy,(fx1 + fx2)*dy/2); //horizontal trapazoid area
-               return;
-       }
-
-       if(dx > 0)
-       {
-               // ---->        fx1...1  0...1  ...  0...1  0...fx2
-               dydx = dy / dx;
-               
-               //set initial values
-               //Iterate through the covered pixels
-               mult = (1 - fx1)*dydx;  //next y intersection diff value (at 1)
-               
-               //first pixel
-               current.addcover(mult,(1 + fx1)*mult/2);        // fx1,fy1,1,fy@1 - starting trapazoidal area
-                       
-               //move to the next pixel
-               fy1 += mult;
-               ix1++;
-               
-               move_pen(ix1,y);
-               
-               //set up for whole ones
-               while(ix1 != ix2)
-               {
-                       //trapezoid(0,y1,1,y1+dydx);
-                       current.addcover(dydx,dydx/2);  //accumulated area 1/2 the cover                        
-                       
-                       //move to next pixel (+1)
-                       ix1++;
-                       fy1 += dydx;
-                       move_pen(ix1,y);
-               }
-               
-               //last pixel
-               //final y-pos - last intersect pos
-               mult = fx2 * dydx;
-               current.addcover(mult,(0+fx2)*mult/2);
-       }else
-       {
-               // fx2...1  0...1  ...  0...1  0...fx1   <----
-               //mult = (0 - fx1) * dy / dx;
-               //neg sign sucked into dydx
-               dydx = -dy / dx;
-               
-               //set initial values
-               //Iterate through the covered pixels
-               mult = fx1*dydx;        //next y intersection diff value
-               
-               //first pixel
-               current.addcover(mult,fx1*mult/2);      // fx1,fy1,0,fy@0 - starting trapazoidal area
-               
-               //move to next pixel
-               fy1 += mult;
-               ix1--;
-               
-               move_pen(ix1,y);
-               
-               //set up for whole ones
-               while(ix1 != ix2)
-               {
-                       //trapezoid(0,y1,1,y1+dydx);
-                       current.addcover(dydx,dydx/2);  //accumulated area 1/2 the cover                        
-                       
-                       //move to next pixel (-1)
-                       fy1 += dydx;
-                       ix1--;
-                       move_pen(ix1,y);
-               }
-               
-               //last pixel
-               mult = fy2 - fy1; //final y-pos - last intersect pos
-               
-               current.addcover(mult,(fx2+1)*mult/2);
-       }
-}
-
-void Layer_Shape::PolySpan::draw_line(Real x1, Real y1, Real x2, Real y2)
-{
-       int iy1 = (int)floor(y1);
-       int iy2 = (int)floor(y2);
-       Real fy1 = y1 - iy1;
-       Real fy2 = y2 - iy2;
-
-       assert(!isnan(fy1));
-       assert(!isnan(fy2));
-       
-       Real dx,dy,dxdy,mult,x_from,x_to;
-       
-       const Real SLOPE_EPSILON = 1e-10;
-       
-       //case all one scanline
-       if(iy1 == iy2)
-       {
-               draw_scanline(iy1,x1,y1,x2,y2);
-               return;
-       }
-       
-       //difference values
-       dy = y2 - y1;
-       dx = x2 - x1;   
-       
-       //case vertical line
-       if(dx < SLOPE_EPSILON && dx > -SLOPE_EPSILON)
-       {
-               //calc area and cover on vertical line          
-               if(dy > 0)
-               {
-                       // ---->        fx1...1  0...1  ...  0...1  0...fx2
-                       Real sub;
-                                               
-                       int      ix1 = (int)floor(x1);
-                       Real fx1 = x1 - ix1;
-                       
-                       //current pixel
-                       sub = 1 - fy1;
-                       
-                       current.addcover(sub,fx1*sub);
-               
-                       //next pixel
-                       iy1++;
-
-                       //move pen to next pixel
-                       move_pen(ix1,iy1);
-                                               
-                       while(iy1 != iy2)
-                       {                                       
-                               //accumulate cover
-                               current.addcover(1,fx1);
-                               
-                               //next pixel
-                               iy1++;
-                               move_pen(ix1,iy1);
-                       }
-                       
-                       //last pixel
-                       current.addcover(fy2,fy2*fx1);
-               }else
-               {
-                       Real sub;
-                                               
-                       int      ix1 = (int)floor(x1);
-                       Real fx1 = x1 - ix1;
-                       
-                       //current pixel
-                       sub = 0 - fy1;
-                       
-                       current.addcover(sub,fx1*sub);
-               
-                       //next pixel
-                       iy1--;
-                       
-                       move_pen(ix1,iy1);
-                       
-                       while(iy1 != iy2)
-                       {
-                               //accumulate in current pixel
-                               current.addcover(-1,-fx1);
-                               
-                               //move to next
-                               iy1--;
-                               move_pen(ix1,iy1);
-                       }
-                       
-                       current.addcover(fy2-1,(fy2-1)*fx1);
-               }
-               return;
-       }
-
-       //case normal line - guaranteed dx != 0 && dy != 0
-       
-       //calculate the initial intersection with "next" scanline
-       if(dy > 0)
-       {
-               dxdy = dx / dy;
-               
-               mult = (1 - fy1) * dxdy;
-               
-               //x interset scanline           
-               x_from = x1 + mult;
-               draw_scanline(iy1,x1,fy1,x_from,1);
-       
-               //move to next line
-               iy1++;
-               
-               move_pen((int)floor(x_from),iy1);
-               
-               while(iy1 != iy2)
-               {
-                       //keep up on the x axis, and render the current scanline
-                       x_to = x_from + dxdy;
-                       draw_scanline(iy1,x_from,0,x_to,1);
-                       x_from = x_to;
-                       
-                       //move to next pixel
-                       iy1++;
-                       move_pen((int)floor(x_from),iy1);
-               }
-               
-               //draw the last one, fractional
-               draw_scanline(iy2,x_from,0,x2,fy2);
-               
-       }else
-       {
-               dxdy = -dx / dy;
-               
-               mult = fy1 * dxdy;
-               
-               //x interset scanline
-               x_from = x1 + mult;
-               draw_scanline(iy1,x1,fy1,x_from,0);
-               
-               //each line after
-               iy1--;
-               
-               move_pen((int)floor(x_from),iy1);
-               
-               while(iy1 != iy2)
-               {
-                       x_to = x_from + dxdy;
-                       draw_scanline(iy1,x_from,1,x_to,0);
-                       x_from = x_to;
-                       
-                       iy1--;
-                       move_pen((int)floor(x_from),iy1);
-               }
-               //draw the last one, fractional
-               draw_scanline(iy2,x_from,1,x2,fy2);
-       }
-}
-
-//****** LAYER PEN OPERATIONS (move_to, line_to, etc.) ******
-void Layer_Shape::move_to(Real x, Real y)
-{
-       //const int sizeblock = sizeof(Primitive)+sizeof(Point);
-       Primitive       op;
-       Point           p(x,y);
-       
-       op.operation = Primitive::MOVE_TO;
-       op.number = 1;  //one point for now
-       
-       if(lastbyteop == Primitive::MOVE_TO)
-       {
-               char *ptr = &bytestream[lastoppos];
-               memcpy(ptr,&op,sizeof(op));
-               memcpy(ptr+sizeof(op),&p,sizeof(p));
-       }
-       else //make a new op
-       {
-               lastbyteop = Primitive::MOVE_TO;
-               lastoppos = bytestream.size();
-               
-               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
-       }
-       
-       edge_table->move_to(x,y);
-}
-
-void Layer_Shape::close()
-{
-       Primitive op;
-       
-       op.operation = Primitive::CLOSE;
-       op.number = 0;
-       
-       if(lastbyteop == Primitive::CLOSE)
-       {
-       }else
-       {
-               lastbyteop = Primitive::CLOSE;
-               lastoppos = bytestream.size();
-               
-               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1)); //insert header
-       }
-       
-       edge_table->close();
-       //should not affect the bounding box since it would just be returning to old point...
-}
-
-void Layer_Shape::endpath()
-{
-       Primitive op;
-       
-       op.operation = Primitive::END;
-       op.number = 0;
-       
-       if(lastbyteop == Primitive::END | lastbyteop == Primitive::NONE)
-       {
-       }else
-       {
-               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));
-       }
-       //should not affect the bounding box since it would just be returning to old point... if at all
-}
-
-void Layer_Shape::line_to(Real x, Real y)
-{
-       assert(!isnan(x));
-       assert(!isnan(y));
-       
-       //const int sizeblock = sizeof(Primitive)+sizeof(Point);
-       Primitive       op;
-       Point           p(x,y);
-       
-       op.operation = Primitive::LINE_TO;
-       op.number = 1;  //one point for now
-       
-       if(lastbyteop == Primitive::MOVE_TO | lastbyteop == Primitive::LINE_TO)
-       {
-               //only need to insert the point
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
-               
-               Primitive * prim = (Primitive *)&bytestream[lastoppos];
-               prim->number++; //increment number of points in the list
-       }else
-       {
-               lastbyteop = Primitive::LINE_TO;
-               lastoppos = bytestream.size();
-               
-               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
-       }
-       
-       edge_table->line_to(x,y);
-}
-
-void Layer_Shape::conic_to(Real x1, Real y1, Real x, Real y)
-{
-       //const int sizeblock = sizeof(Primitive)+sizeof(Point)*2;
-       Primitive       op;
-       Point           p(x,y);
-       Point           p1(x1,y1);
-       
-       op.operation = Primitive::CONIC_TO;
-       op.number = 2;  //2 points for now
-       
-       if(lastbyteop == Primitive::CONIC_TO)
-       {
-               //only need to insert the new points
-               bytestream.insert(bytestream.end(),(char*)&p1,(char*)(&p1+1));
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
-               
-               Primitive * prim = (Primitive *)&bytestream[lastoppos];
-               prim->number += 2; //increment number of points in the list
-       }else
-       {
-               lastbyteop = Primitive::CONIC_TO;
-               lastoppos = bytestream.size();
-               
-               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
-               bytestream.insert(bytestream.end(),(char*)&p1,(char*)(&p1+1));  //insert the bytes for data
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
-       }
-       
-       edge_table->conic_to(x1,y1,x,y);
-}
-
-void Layer_Shape::conic_to_smooth(Real x, Real y)                              //x1,y1 derived from current tangent
-{
-       //const int sizeblock = sizeof(Primitive)+sizeof(Point);
-       Primitive       op;
-       Point           p(x,y);
-       
-       op.operation = Primitive::CONIC_TO_SMOOTH;
-       op.number = 1;  //2 points for now
-       
-       if(lastbyteop == Primitive::CONIC_TO_SMOOTH)
-       {
-               //only need to insert the new point
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
-               
-               Primitive * prim = (Primitive *)&bytestream[lastoppos];
-               prim->number += 1; //increment number of points in the list
-       }else
-       {
-               lastbyteop = Primitive::CONIC_TO_SMOOTH;
-               lastoppos = bytestream.size();
-               
-               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
-       }
-       
-       edge_table->conic_to_smooth(x,y);
-}
-
-void Layer_Shape::curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y)
-{
-       //const int sizeblock = sizeof(Primitive)+sizeof(Point)*3;
-       Primitive       op;
-       Point           p(x,y);
-       Point           p1(x1,y1);
-       Point           p2(x2,y2);
-       
-       op.operation = Primitive::CUBIC_TO;
-       op.number = 3;  //3 points for now
-       
-       if(lastbyteop == Primitive::CUBIC_TO)
-       {
-               //only need to insert the new points
-               bytestream.insert(bytestream.end(),(char*)&p1,(char*)(&p1+1));
-               bytestream.insert(bytestream.end(),(char*)&p2,(char*)(&p2+1));
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
-               
-               Primitive * prim = (Primitive *)&bytestream[lastoppos];
-               prim->number += 3; //increment number of points in the list
-       }else
-       {
-               lastbyteop = Primitive::CUBIC_TO;
-               lastoppos = bytestream.size();
-               
-               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
-               bytestream.insert(bytestream.end(),(char*)&p1,(char*)(&p1+1));  //insert the bytes for data
-               bytestream.insert(bytestream.end(),(char*)&p2,(char*)(&p2+1));  //insert the bytes for data
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
-       }
-       
-       edge_table->curve_to(x1,y1,x2,y2,x,y);
-}
-
-void Layer_Shape::curve_to_smooth(Real x2, Real y2, Real x, Real y)            //x1,y1 derived from current tangent
-{
-       //const int sizeblock = sizeof(Primitive)+sizeof(Point)*3;
-       Primitive       op;
-       Point           p(x,y);
-       Point           p2(x2,y2);
-       
-       op.operation = Primitive::CUBIC_TO_SMOOTH;
-       op.number = 2;  //3 points for now
-       
-       if(lastbyteop == Primitive::CUBIC_TO_SMOOTH)
-       {
-               //only need to insert the new points
-               bytestream.insert(bytestream.end(),(char*)&p2,(char*)(&p2+1));
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
-               
-               Primitive * prim = (Primitive *)&bytestream[lastoppos];
-               prim->number += 2; //increment number of points in the list
-       }else
-       {
-               lastbyteop = Primitive::CUBIC_TO_SMOOTH;
-               lastoppos = bytestream.size();
-               
-               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
-               bytestream.insert(bytestream.end(),(char*)&p2,(char*)(&p2+1));  //insert the bytes for data
-               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
-       }
-}
-
-// ACCELERATED RENDER FUNCTION - TRANSLATE BYTE CODE INTO FUNCTION CALLS
-
-bool Layer_Shape::render_polyspan(Surface *surface, PolySpan &polyspan, 
-                                                               Color::BlendMethod got_blend_method, Color::value_type got_amount) const
-{
-       Surface::alpha_pen p(surface->begin(),got_amount,_BlendFunc(got_blend_method));
-       PolySpan::cover_array::iterator cur_mark = polyspan.covers.begin();
-       PolySpan::cover_array::iterator end_mark = polyspan.covers.end();
-
-       Real cover,area,alpha;
-       
-       int     y,x;
-       
-       p.set_value(color);
-       cover = 0;
-       
-       if(cur_mark == end_mark)
-       {
-               //no marks at all
-               if(invert)
-               {
-                       p.move_to(polyspan.window.minx,polyspan.window.miny);
-                       p.put_block(polyspan.window.maxy - polyspan.window.miny,polyspan.window.maxx - polyspan.window.minx);
-               }
-               return true;
-       }
-       
-       //fill initial rect / line
-       if(invert)
-       {
-               //fill all the area above the first vertex
-               p.move_to(polyspan.window.minx,polyspan.window.miny);
-               y = polyspan.window.miny;
-               int l = polyspan.window.maxx - polyspan.window.minx;
-       
-               p.put_block(cur_mark->y - polyspan.window.miny,l);
-               
-               //fill the area to the left of the first vertex on that line
-               l = cur_mark->x - polyspan.window.minx;
-               p.move_to(polyspan.window.minx,cur_mark->y);
-               if(l) p.put_hline(l);
-       }
-       
-       for(;;)
-       {
-               y = cur_mark->y;
-               x = cur_mark->x;
-               
-               p.move_to(x,y);
-               
-               area = cur_mark->area;
-               cover += cur_mark->cover;
-                       
-               //accumulate for the current pixel
-               while(++cur_mark != polyspan.covers.end())
-               {
-                       if(y != cur_mark->y | x != cur_mark->x)
-                               break;
-                       
-                       area += cur_mark->area;
-                       cover += cur_mark->cover;
-               }
-               
-               //draw pixel - based on covered area
-               if(area)        //if we're ok, draw the current pixel
-               {
-                       alpha = polyspan.ExtractAlpha(cover - area);
-                       if(invert) alpha = 1 - alpha;
-                       
-                       if(!antialias)
-                       {
-                               if(alpha >= .5) p.put_value();
-                       }
-                       else if(alpha) p.put_value_alpha(alpha);
-                       
-                       p.inc_x();
-                       x++;
-               }
-               
-               //if we're done, don't use iterator and exit
-               if(cur_mark == end_mark) break;
-                       
-               //if there is no more live pixels on this line, goto next
-               if(y != cur_mark->y)
-               {
-                       if(invert)
-                       {
-                               //fill the area at the end of the line
-                               p.put_hline(polyspan.window.maxx - x);                          
-                               
-                               //fill area at the beginning of the next line
-                               p.move_to(polyspan.window.minx,cur_mark->y);
-                               p.put_hline(cur_mark->x - polyspan.window.minx);
-                       }
-                       
-                       cover = 0;                      
-                       
-                       continue;
-               }
-               
-               //draw span to next pixel - based on total amount of pixel cover
-               if(x < cur_mark->x)
-               {                               
-                       alpha = polyspan.ExtractAlpha(cover);
-                       if(invert) alpha = 1 - alpha;
-
-                       if(!antialias)
-                       {
-                               if(alpha >= .5) p.put_hline(cur_mark->x - x);
-                       }
-                       else if(alpha) p.put_hline(cur_mark->x - x,alpha);
-               }
-       }
-       
-       //fill the after stuff
-       if(invert)
-       {
-               //fill the area at the end of the line
-               p.put_hline(polyspan.window.maxx - x);                          
-               
-               //fill area at the beginning of the next line
-               p.move_to(polyspan.window.minx,y+1);
-               p.put_block(polyspan.window.maxy - y - 1,polyspan.window.maxx - polyspan.window.minx);
-       }
-       
-       return true;
-}
-
-bool Layer_Shape::render_polyspan(etl::surface<float> *surface, PolySpan &polyspan) const
-{
-       etl::surface<float>::pen p(surface->begin());
-       PolySpan::cover_array::iterator cur_mark = polyspan.covers.begin();
-       PolySpan::cover_array::iterator end_mark = polyspan.covers.end();
-
-       Real cover,area,alpha;
-       
-       int     y,x;
-       
-       cover = 0;      
-               
-       //the pen always writes 1 (unless told to do otherwise)
-       p.set_value(1);
-       
-       if(cur_mark == end_mark)
-       {
-               //no marks at all
-               if(invert)
-               {
-                       p.move_to(polyspan.window.minx,polyspan.window.miny);
-                       p.put_block(polyspan.window.maxy - polyspan.window.miny,polyspan.window.maxx - polyspan.window.minx);
-               }
-               return true;
-       }
-       
-       //fill initial rect / line
-       if(invert)
-       {
-               //fill all the area above the first vertex
-               p.move_to(polyspan.window.minx,polyspan.window.miny);
-               y = polyspan.window.miny;
-               int l = polyspan.window.maxx - polyspan.window.minx;
-       
-               p.put_block(cur_mark->y - polyspan.window.miny,l);
-               
-               //fill the area to the left of the first vertex on that line
-               l = cur_mark->x - polyspan.window.minx;
-               p.move_to(polyspan.window.minx,cur_mark->y);
-               if(l) p.put_hline(l);
-               
-               for(;;)
-               {
-                       y = cur_mark->y;
-                       x = cur_mark->x;
-                       
-                       p.move_to(x,y);
-                       
-                       area = cur_mark->area;
-                       cover += cur_mark->cover;
-                               
-                       //accumulate for the current pixel
-                       while(++cur_mark != polyspan.covers.end())
-                       {
-                               if(y != cur_mark->y | x != cur_mark->x)
-                                       break;
-                               
-                               area += cur_mark->area;
-                               cover += cur_mark->cover;
-                       }
-                       
-                       //draw pixel - based on covered area
-                       if(area)        //if we're ok, draw the current pixel
-                       {
-                               alpha = 1 - polyspan.ExtractAlpha(cover - area);                                
-                               if(!antialias)
-                               {
-                                       if(alpha >= .5) p.put_value();
-                               }
-                               else if(alpha) p.put_value(alpha);
-                               
-                               p.inc_x();
-                               x++;
-                       }
-                       
-                       //if we're done, don't use iterator and exit
-                       if(cur_mark == end_mark) break;
-                               
-                       //if there is no more live pixels on this line, goto next
-                       if(y != cur_mark->y)
-                       {
-                               //fill the area at the end of the line
-                               p.put_hline(polyspan.window.maxx - x);
-                               
-                               //fill area at the beginning of the next line
-                               p.move_to(polyspan.window.minx,cur_mark->y);
-                               p.put_hline(cur_mark->x - polyspan.window.minx);
-                       
-                               cover = 0;                      
-                               
-                               continue;
-                       }
-                       
-                       //draw span to next pixel - based on total amount of pixel cover
-                       if(x < cur_mark->x)
-                       {                               
-                               alpha = 1 - polyspan.ExtractAlpha(cover);
-                               if(!antialias)
-                               {
-                                       if(alpha >= .5) p.put_hline(cur_mark->x - x);
-                               }
-                               else if(alpha) p.put_hline(cur_mark->x - x,alpha);
-                       }
-               }
-               
-               //fill the area at the end of the line
-               p.put_hline(polyspan.window.maxx - x);                          
-               
-               //fill area at the beginning of the next line
-               p.move_to(polyspan.window.minx,y+1);
-               p.put_block(polyspan.window.maxy - y - 1,polyspan.window.maxx - polyspan.window.minx);
-       }else
-       {
-               for(;;)
-               {
-                       y = cur_mark->y;
-                       x = cur_mark->x;
-                       
-                       p.move_to(x,y);
-                       
-                       area = cur_mark->area;
-                       cover += cur_mark->cover;
-                               
-                       //accumulate for the current pixel
-                       while(++cur_mark != polyspan.covers.end())
-                       {
-                               if(y != cur_mark->y | x != cur_mark->x)
-                                       break;
-                               
-                               area += cur_mark->area;
-                               cover += cur_mark->cover;
-                       }
-                       
-                       //draw pixel - based on covered area
-                       if(area)        //if we're ok, draw the current pixel
-                       {
-                               alpha = polyspan.ExtractAlpha(cover - area);
-                               if(!antialias)
-                               {
-                                       if(alpha >= .5) p.put_value();
-                               }
-                               else if(alpha) p.put_value(alpha);
-                               
-                               p.inc_x();
-                               x++;
-                       }
-                       
-                       //if we're done, don't use iterator and exit
-                       if(cur_mark == end_mark) break;
-                               
-                       //if there is no more live pixels on this line, goto next
-                       if(y != cur_mark->y)
-                       {                               
-                               cover = 0;                      
-                               
-                               continue;
-                       }
-                       
-                       //draw span to next pixel - based on total amount of pixel cover
-                       if(x < cur_mark->x)
-                       {                               
-                               alpha = polyspan.ExtractAlpha(cover);
-                               if(!antialias)
-                               {
-                                       if(alpha >= .5) p.put_hline(cur_mark->x - x);
-                               }
-                               else if(alpha) p.put_hline(cur_mark->x - x,alpha);
-                       }
-               }
-       }
-       
-       return true;
-}
-
-bool
-Layer_Shape::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
-{
-       const unsigned int w = renddesc.get_w();
-       const unsigned int h = renddesc.get_h();
-       
-       const Real pw = abs(renddesc.get_pw());
-       const Real ph = abs(renddesc.get_ph());
-       
-       //const Real OFFSET_EPSILON = 1e-8;
-       SuperCallback stageone(cb,1,10000,15001+renddesc.get_h());
-       SuperCallback stagetwo(cb,10000,10001+renddesc.get_h(),15001+renddesc.get_h());
-       SuperCallback stagethree(cb,10001+renddesc.get_h(),15001+renddesc.get_h(),15001+renddesc.get_h());
-       
-       // Render what is behind us
-       
-       //clip if it satisfies the invert solid thing
-       if(is_solid_color() && invert)
-       {               
-               Rect aabb = edge_table->aabb;
-               Point tl = renddesc.get_tl() - offset;
-               
-               Real    pw = renddesc.get_pw(),
-                               ph = renddesc.get_ph();
-
-               Rect    nrect;
-               
-               Real    pixelfeatherx = abs(feather/pw),
-                               pixelfeathery = abs(feather/ph);
-               
-               nrect.set_point((aabb.minx - tl[0])/pw,(aabb.miny - tl[1])/ph);
-               nrect.expand((aabb.maxx - tl[0])/pw,(aabb.maxy - tl[1])/ph);
-                               
-               RendDesc        optdesc(renddesc);
-               
-               //make sure to expand so we gain subpixels rather than lose them
-               nrect.minx = floor(nrect.minx-pixelfeatherx); nrect.miny = floor(nrect.miny-pixelfeathery);
-               nrect.maxx = ceil(nrect.maxx+pixelfeatherx); nrect.maxy = ceil(nrect.maxy+pixelfeathery);
-               
-               //make sure the subwindow is clipped with our tile window (minimize useless drawing)
-               set_intersect(nrect,nrect,Rect(0,0,renddesc.get_w(),renddesc.get_h()));
-               
-               //must resize the surface first
-               surface->set_wh(renddesc.get_w(),renddesc.get_h());
-               surface->clear();
-               
-               //only render anything if it's visible from our current tile
-               if(nrect.valid())
-               {
-                       //set the subwindow to the viewable pixels and render it to the subsurface
-                       optdesc.set_subwindow((int)nrect.minx, (int)nrect.miny,
-                               (int)(nrect.maxx - nrect.minx), (int)(nrect.maxy - nrect.miny));
-                       
-                       Surface optimizedbacksurf;
-                       if(!context.accelerated_render(&optimizedbacksurf,quality,optdesc,&stageone))
-                               return false;
-                       
-                       //blit that onto the original surface so we can pretend that nothing ever happened
-                       Surface::pen p = surface->get_pen((int)nrect.minx,(int)nrect.miny); 
-                       optimizedbacksurf.blit_to(p);
-               }
-       }else
-       {
-               if(!context.accelerated_render(surface,quality,renddesc,&stageone))
-                       return false;
-       }
-       
-       if(cb && !cb->amount_complete(10000,10001+renddesc.get_h())) return false;
-               
-       if(feather)
-       {
-               //we have to blur rather than be crappy
-               
-               //so make a separate surface
-               RendDesc        workdesc(renddesc);
-               
-               etl::surface<float>     shapesurface;
-
-               //the expanded size = 1/2 the size in each direction rounded up
-               int     halfsizex = (int) (abs(feather*.5/pw) + 3),
-                       halfsizey = (int) (abs(feather*.5/ph) + 3);
-                       
-               //expand by 1/2 size in each direction on either side
-               switch(blurtype)
-               {
-                       case Blur::DISC:
-                       case Blur::BOX:
-                       case Blur::CROSS:
-                       {
-                               workdesc.set_subwindow(-max(1,halfsizex),-max(1,halfsizey),w+2*max(1,halfsizex),h+2*max(1,halfsizey));
-                               break;
-                       }
-                       case Blur::FASTGAUSSIAN:
-                       {
-                               if(quality < 4)
-                               {
-                                       halfsizex*=2;
-                                       halfsizey*=2;
-                               }
-                               workdesc.set_subwindow(-max(1,halfsizex),-max(1,halfsizey),w+2*max(1,halfsizex),h+2*max(1,halfsizey));
-                               break;                          
-                       }
-                       case Blur::GAUSSIAN:
-                       {                               
-                       #define GAUSSIAN_ADJUSTMENT             (0.05)
-                               Real    pw = (Real)workdesc.get_w()/(workdesc.get_br()[0]-workdesc.get_tl()[0]);
-                               Real    ph = (Real)workdesc.get_h()/(workdesc.get_br()[1]-workdesc.get_tl()[1]);
-                               
-                               pw=pw*pw;
-                               ph=ph*ph;
-       
-                               halfsizex = (int)(abs(pw)*feather*GAUSSIAN_ADJUSTMENT+0.5);
-                               halfsizey = (int)(abs(ph)*feather*GAUSSIAN_ADJUSTMENT+0.5);
-       
-                               halfsizex = (halfsizex + 1)/2;
-                               halfsizey = (halfsizey + 1)/2;
-                               workdesc.set_subwindow( -halfsizex, -halfsizey, w+2*halfsizex, h+2*halfsizey );
-                                                       
-                               break;
-                       }
-               }
-               
-               shapesurface.set_wh(workdesc.get_w(),workdesc.get_h());
-               shapesurface.clear();
-               
-               //render the shape
-               if(!render_shape(&shapesurface,quality,workdesc,&stagetwo))return false;
-               
-               //blur the image
-               Blur(feather,feather,blurtype,&stagethree)(shapesurface,workdesc.get_br()-workdesc.get_tl(),shapesurface);
-               
-               //blend with stuff below it...          
-               unsigned int u = halfsizex, v = halfsizey, x = 0, y = 0;
-               for(y = 0; y < h; y++,v++)
-               {
-                       u = halfsizex;
-                       for(x = 0; x < w; x++,u++)
-                       {
-                               float a = shapesurface[v][u];
-                               if(a)
-                               {
-                                       //a = floor(a*255+0.5f)/255;
-                                       (*surface)[y][x]=Color::blend(color,(*surface)[y][x],a*get_amount(),get_blend_method());
-                               }
-                               //else (*surface)[y][x] = worksurface[v][u];
-                       }
-               }
-               
-               //we are done
-               if(cb && !cb->amount_complete(100,100))
-               {
-                       sinfg::warning("Layer_Shape: could not set amount complete");
-                       return false;
-               }
-               
-               return true;
-       }else
-       {
-               //might take out to reduce code size
-               return render_shape(surface,true,quality,renddesc,&stagetwo);
-       }
-
-}
-
-bool
-Layer_Shape::render_shape(Surface *surface,bool useblend,int quality,
-                                                       const RendDesc &renddesc, ProgressCallback *cb)const
-{
-       int tmp(0);
-       
-       SuperCallback   progress(cb,0,renddesc.get_h(),renddesc.get_h());
-               
-       // If our amount is set to zero, no need to render anything
-       if(!get_amount())
-               return true;
-       
-       //test new polygon renderer
-       // Build edge table
-       // Width and Height of a pixel
-       const int       w = renddesc.get_w();
-       const int       h = renddesc.get_h();
-       const Real      pw = renddesc.get_w()/(renddesc.get_br()[0]-renddesc.get_tl()[0]);
-       const Real      ph = renddesc.get_h()/(renddesc.get_br()[1]-renddesc.get_tl()[1]);
-       
-       const Point     tl = renddesc.get_tl();
-       
-       Vector tangent (0,0);
-               
-       PolySpan        span;
-       
-       //optimization for tesselating only inside tiles
-       span.window.minx = 0;
-       span.window.miny = 0;
-       span.window.maxx = w;
-       span.window.maxy = h;
-
-       //pointers for processing the bytestream
-       const char *current     = &bytestream[0];
-       const char *end                 = &bytestream[bytestream.size()];       
-       
-       int     operation       = Primitive::NONE;
-       int number              = 0;
-       int curnum;
-       
-       Primitive       *curprim;
-       Point           *data;
-       
-       Real x,y,x1,y1,x2,y2;
-
-
-       while(current < end)
-       {
-               tmp++;
-
-               try {
-               
-               //get the op code safely
-               curprim = (Primitive *)current;
-               
-               //advance past indices
-               current += sizeof(Primitive);
-               if(current > end)
-               {
-                       warning("Layer_Shape::accelerated_render - Error in the byte stream, not enough space for next declaration");
-                       return false;                   
-               }
-               
-               //get the relevant data
-               operation       = curprim->operation;
-               number          = curprim->number;
-               
-               if(operation == Primitive::END)
-                       break;
-               
-               if(operation == Primitive::CLOSE)
-               {
-                       if(span.notclosed())
-                       {
-                               tangent[0] = span.close_x - span.cur_x;
-                               tangent[1] = span.close_y - span.cur_y;
-                               span.close();                                           
-                       }
-                       continue;
-               }
-               
-               data = (Point*)current;
-               current += sizeof(Point)*number;
-               
-               //check data positioning
-               if(current > end)
-               {
-                       warning("Layer_Shape::accelerated_render - Error in the byte stream, in sufficient data space for declared number of points");
-                       return false;
-               }
-
-               } catch(...) { sinfg::error("Layer_Shape::render_shape()1: Caught an exception after %d loops, rethrowing...", tmp); throw; }
-
-               //transfer all the data - RLE optimized
-               for(curnum=0; curnum < number;)
-               {                       
-                       switch(operation)
-                       {
-                               case Primitive::MOVE_TO:
-                               {
-                                       x = data[curnum][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       if(curnum == 0)
-                                       {
-                                               span.move_to(x,y);
-                                               
-                                               tangent[0] = 0;
-                                               tangent[1] = 0;
-                                       }
-                                       else
-                                       {
-                                               tangent[0] = x - span.cur_x;
-                                               tangent[1] = y - span.cur_y;
-                                               
-                                               span.line_to(x,y);
-                                       }
-                                       
-                                       curnum++; //only advance one point
-                                       
-                                       break;
-                               }
-                               
-                               case Primitive::LINE_TO:
-                               {
-                                       x = data[curnum][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       tangent[0] = x - span.cur_x;
-                                       tangent[1] = y - span.cur_y;
-                                       
-                                       span.line_to(x,y);
-                                       curnum++;
-                                       break;
-                               }
-                               
-                               case Primitive::CONIC_TO:
-                               {
-                                       x = data[curnum+1][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum+1][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       x1 = data[curnum][0];
-                                       x1 = (x1 - tl[0] + offset[0])*pw;
-                                       y1 = data[curnum][1];
-                                       y1 = (y1 - tl[1] + offset[1])*ph;
-                                       
-                                       tangent[0] = 2*(x - x1);
-                                       tangent[1] = 2*(y - y1);
-                                       
-                                       span.conic_to(x1,y1,x,y);
-                                       curnum += 2;
-                                       break;
-                               }
-                               
-                               case Primitive::CONIC_TO_SMOOTH:
-                               {
-                                       x = data[curnum][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       x1 = span.cur_x + tangent[0]/2;
-                                       y1 = span.cur_y + tangent[1]/2;
-
-                                       tangent[0] = 2*(x - x1);
-                                       tangent[1] = 2*(y - y1);
-                                       
-                                       span.conic_to(x1,y1,x,y);
-                                       curnum ++;
-                                       
-                                       break;
-                               }
-                               
-                               case Primitive::CUBIC_TO:
-                               {
-                                       x = data[curnum+2][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum+2][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       x2 = data[curnum+1][0];
-                                       x2 = (x2 - tl[0] + offset[0])*pw;
-                                       y2 = data[curnum+1][1];
-                                       y2 = (y2 - tl[1] + offset[1])*ph;
-                                       
-                                       x1 = data[curnum][0];
-                                       x1 = (x1 - tl[0] + offset[0])*pw;
-                                       y1 = data[curnum][1];
-                                       y1 = (y1 - tl[1] + offset[1])*ph;
-                                       
-                                       tangent[0] = 2*(x - x2);
-                                       tangent[1] = 2*(y - y2);
-                                       
-                                       span.cubic_to(x1,y1,x2,y2,x,y);
-                                       curnum += 3;
-                                       
-                                       break;
-                               }
-                               
-                               case Primitive::CUBIC_TO_SMOOTH:
-                               {
-                                       x = data[curnum+1][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum+1][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       x2 = data[curnum][0];
-                                       x2 = (x2 - tl[0] + offset[0])*pw;
-                                       y2 = data[curnum][1];
-                                       y2 = (y2 - tl[1] + offset[1])*ph;
-                                       
-                                       x1 = span.cur_x + tangent[0]/3.0;                                       
-                                       y1 = span.cur_y + tangent[1]/3.0;
-                                       
-                                       tangent[0] = 2*(x - x2);
-                                       tangent[1] = 2*(y - y2);
-                                       
-                                       span.cubic_to(x1,y1,x2,y2,x,y);
-                                       curnum += 2;
-                                       
-                                       break;
-                               }
-                       }
-               }
-       }
-       
-       //sort the bastards so we can render everything
-       span.sort_marks();
-       
-       return render_polyspan(surface, span, 
-                       useblend?get_blend_method():Color::BLEND_STRAIGHT, 
-                       useblend?get_amount():1.0);
-}
-
-bool
-Layer_Shape::render_shape(surface<float> *surface,int quality,
-                                                       const RendDesc &renddesc, ProgressCallback *cb)const
-{
-       // If our amount is set to zero, no need to render anything
-       if(!get_amount())
-               return true;
-       
-       //test new polygon renderer
-       // Build edge table
-       // Width and Height of a pixel
-       const int       w = renddesc.get_w();
-       const int       h = renddesc.get_h();
-       const Real      pw = renddesc.get_w()/(renddesc.get_br()[0]-renddesc.get_tl()[0]);
-       const Real      ph = renddesc.get_h()/(renddesc.get_br()[1]-renddesc.get_tl()[1]);
-       
-       const Point     tl = renddesc.get_tl();
-       
-       Vector tangent (0,0);
-               
-       PolySpan        span;
-       
-       //optimization for tesselating only inside tiles
-       span.window.minx = 0;
-       span.window.miny = 0;
-       span.window.maxx = w;
-       span.window.maxy = h;
-
-       //pointers for processing the bytestream
-       const char *current     = &bytestream[0];
-       const char *end                 = &bytestream[bytestream.size()];       
-       
-       int     operation       = Primitive::NONE;
-       int number              = 0;
-       int curnum;
-       
-       Primitive       *curprim;
-       Point           *data;
-       
-       Real x,y,x1,y1,x2,y2;
-       
-       while(current < end)
-       {
-               //get the op code safely
-               curprim = (Primitive *)current;
-               
-               //advance past indices
-               current += sizeof(Primitive);
-               if(current > end)
-               {
-                       warning("Layer_Shape::accelerated_render - Error in the byte stream, not enough space for next declaration");
-                       return false;                   
-               }
-               
-               //get the relevant data
-               operation       = curprim->operation;
-               number          = curprim->number;
-               
-               if(operation == Primitive::END)
-                       break;
-               
-               if(operation == Primitive::CLOSE)
-               {
-                       if(span.notclosed())
-                       {
-                               tangent[0] = span.close_x - span.cur_x;
-                               tangent[1] = span.close_y - span.cur_y;
-                               span.close();                                           
-                       }
-                       continue;
-               }
-               
-               data = (Point*)current;
-               current += sizeof(Point)*number;
-               
-               //check data positioning
-               if(current > end)
-               {
-                       warning("Layer_Shape::accelerated_render - Error in the byte stream, in sufficient data space for declared number of points");
-                       return false;
-               }
-
-               //transfer all the data
-               for(curnum=0; curnum < number;)
-               {                       
-                       switch(operation)
-                       {
-                               case Primitive::MOVE_TO:
-                               {
-                                       x = data[curnum][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       if(curnum == 0)
-                                       {
-                                               span.move_to(x,y);
-                                               
-                                               tangent[0] = 0;
-                                               tangent[1] = 0;
-                                       }
-                                       else
-                                       {
-                                               tangent[0] = x - span.cur_x;
-                                               tangent[1] = y - span.cur_y;
-                                               
-                                               span.line_to(x,y);
-                                       }
-                                       
-                                       curnum++; //only advance one point
-                                       
-                                       break;
-                               }
-                               
-                               case Primitive::LINE_TO:
-                               {
-                                       x = data[curnum][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       tangent[0] = x - span.cur_x;
-                                       tangent[1] = y - span.cur_y;
-                                       
-                                       span.line_to(x,y);
-                                       curnum++;
-                                       break;
-                               }
-                               
-                               case Primitive::CONIC_TO:
-                               {
-                                       x = data[curnum+1][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum+1][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       x1 = data[curnum][0];
-                                       x1 = (x1 - tl[0] + offset[0])*pw;
-                                       y1 = data[curnum][1];
-                                       y1 = (y1 - tl[1] + offset[1])*ph;
-                                       
-                                       tangent[0] = 2*(x - x1);
-                                       tangent[1] = 2*(y - y1);
-                                       
-                                       span.conic_to(x1,y1,x,y);
-                                       curnum += 2;
-                                       break;
-                               }
-                               
-                               case Primitive::CONIC_TO_SMOOTH:
-                               {
-                                       x = data[curnum][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       x1 = span.cur_x + tangent[0]/2;
-                                       y1 = span.cur_y + tangent[1]/2;
-
-                                       tangent[0] = 2*(x - x1);
-                                       tangent[1] = 2*(y - y1);
-                                       
-                                       span.conic_to(x1,y1,x,y);
-                                       curnum ++;
-                                       
-                                       break;
-                               }
-                               
-                               case Primitive::CUBIC_TO:
-                               {
-                                       x = data[curnum+2][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum+2][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       x2 = data[curnum+1][0];
-                                       x2 = (x2 - tl[0] + offset[0])*pw;
-                                       y2 = data[curnum+1][1];
-                                       y2 = (y2 - tl[1] + offset[1])*ph;
-                                       
-                                       x1 = data[curnum][0];
-                                       x1 = (x1 - tl[0] + offset[0])*pw;
-                                       y1 = data[curnum][1];
-                                       y1 = (y1 - tl[1] + offset[1])*ph;
-                                       
-                                       tangent[0] = 2*(x - x2);
-                                       tangent[1] = 2*(y - y2);
-                                       
-                                       span.cubic_to(x1,y1,x2,y2,x,y);
-                                       curnum += 3;
-                                       
-                                       break;
-                               }
-                               
-                               case Primitive::CUBIC_TO_SMOOTH:
-                               {
-                                       x = data[curnum+1][0];
-                                       x = (x - tl[0] + offset[0])*pw;
-                                       y = data[curnum+1][1];
-                                       y = (y - tl[1] + offset[1])*ph;
-                                       
-                                       x2 = data[curnum][0];
-                                       x2 = (x2 - tl[0] + offset[0])*pw;
-                                       y2 = data[curnum][1];
-                                       y2 = (y2 - tl[1] + offset[1])*ph;
-                                       
-                                       x1 = span.cur_x + tangent[0]/3.0;                                       
-                                       y1 = span.cur_y + tangent[1]/3.0;
-                                       
-                                       tangent[0] = 2*(x - x2);
-                                       tangent[1] = 2*(y - y2);
-                                       
-                                       span.cubic_to(x1,y1,x2,y2,x,y);
-                                       curnum += 2;
-                                       
-                                       break;
-                               }
-                       }
-               }
-       }
-       
-       //sort the bastards so we can render everything
-       span.sort_marks();
-       
-       return render_polyspan(surface, span);
-}
-
-Rect
-Layer_Shape::get_bounding_rect()const
-{
-       if(invert)
-               return Rect::full_plane();
-
-       Rect bounds(edge_table->aabb+offset);
-       bounds.expand(max((bounds.get_min()-bounds.get_max()).mag()*0.01,feather));
-       
-       
-       return bounds;
-}
diff --git a/synfig-core/trunk/src/sinfg/layer_shape.h b/synfig-core/trunk/src/sinfg/layer_shape.h
deleted file mode 100644 (file)
index f88a894..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_shape.h
-**     \brief Template Header
-**
-**     $Id: layer_shape.h,v 1.2 2005/01/24 03:08:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_SHAPE_H
-#define __SINFG_LAYER_SHAPE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "layer_composite.h"
-#include "color.h"
-#include "vector.h"
-#include "blur.h"
-
-#include <vector>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-/*!    \class Layer_Shape
-**     \beief writeme                  */
-class Layer_Shape : public Layer_Composite, public Layer_NoDeform
-{
-       SINFG_LAYER_MODULE_EXT
-       
-private:
-       
-       //internal cacheing
-       struct Intersector;
-       Intersector     *edge_table;
-       
-       //exported data
-       Color                                   color;
-       
-       Point   offset;
-       bool    invert;
-       bool    antialias;
-       
-       int             blurtype;
-       Real    feather;
-       
-       std::vector< char >     bytestream;
-       
-       //for use in creating the bytestream
-       int                                             lastbyteop;
-       int                                             lastoppos;
-
-protected:
-
-       Layer_Shape(const Real &a = 1.0, const Color::BlendMethod m = Color::BLEND_COMPOSITE);
-
-public:
-
-       ~Layer_Shape();
-
-       //! Clears out any data
-       /*!     Also clears out the Intersector
-       */
-       void clear();
-       //void sync();
-
-       void move_to(Real x, Real y);
-       void line_to(Real x, Real y);
-       void conic_to(Real x1, Real y1, Real x, Real y);
-       void conic_to_smooth(Real x, Real y);                           //x1,y1 derived from current tangent
-       void curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y);
-       void curve_to_smooth(Real x2, Real y2, Real x, Real y); //x1,y1 derived from current tangent
-       void close();
-       void endpath();
-
-       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
-       virtual ValueBase get_param(const String & param)const;
-       
-       virtual Vocab get_param_vocab()const;
-
-       virtual Color get_color(Context context, const Point &pos)const;
-       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
-       virtual sinfg::Layer::Handle hit_check(sinfg::Context context, const sinfg::Point &point)const;
-       virtual Rect get_bounding_rect()const;
-
-private:
-       class           PolySpan;
-       bool render_polyspan(Surface *surface,PolySpan &polyspan,
-                                               Color::BlendMethod method,Color::value_type amount)const;
-       bool render_polyspan(etl::surface<float> *surface,PolySpan &polyspan)const;
-       virtual bool render_shape(Surface *surface,bool useblend,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
-       virtual bool render_shape(etl::surface<float> *surface,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
-}; // END of Layer_Shape
-
-}; // END of namespace sinfg
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/layer_solidcolor.cpp b/synfig-core/trunk/src/sinfg/layer_solidcolor.cpp
deleted file mode 100644 (file)
index ca895c9..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_solidcolor.cpp
-**     \brief Template Header
-**
-**     $Id: layer_solidcolor.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "layer_solidcolor.h"
-#include "string.h"
-#include "time.h"
-#include "context.h"
-#include "paramdesc.h"
-#include "renddesc.h"
-#include "surface.h"
-#include "value.h"
-#include "valuenode.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace etl;
-using namespace std;
-using namespace sinfg;
-
-/* === G L O B A L S ======================================================= */
-
-SINFG_LAYER_INIT(Layer_SolidColor);
-SINFG_LAYER_SET_NAME(Layer_SolidColor,"SolidColor");
-SINFG_LAYER_SET_LOCAL_NAME(Layer_SolidColor,_("Solid Color"));
-SINFG_LAYER_SET_CATEGORY(Layer_SolidColor,_("Geometry"));
-SINFG_LAYER_SET_VERSION(Layer_SolidColor,"0.1");
-SINFG_LAYER_SET_CVS_ID(Layer_SolidColor,"$Id: layer_solidcolor.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $");
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-/* === E N T R Y P O I N T ================================================= */
-
-Layer_SolidColor::Layer_SolidColor():
-       Layer_Composite(1.0,Color::BLEND_STRAIGHT),
-       color(Color::black())
-{
-}
-       
-bool
-Layer_SolidColor::set_param(const String & param, const ValueBase &value)
-{
-       IMPORT(color);
-       
-       return Layer_Composite::set_param(param,value);
-}
-
-ValueBase
-Layer_SolidColor::get_param(const String &param)const
-{
-       EXPORT(color);
-
-       EXPORT_NAME();
-       EXPORT_VERSION();
-               
-       return Layer_Composite::get_param(param);       
-}
-
-Layer::Vocab
-Layer_SolidColor::get_param_vocab()const
-{
-       Layer::Vocab ret(Layer_Composite::get_param_vocab());
-       
-       ret.push_back(ParamDesc("color")
-               .set_local_name(_("Color"))
-       );
-       
-       return ret;
-}
-
-sinfg::Layer::Handle
-Layer_SolidColor::hit_check(sinfg::Context context, const sinfg::Point &point)const
-{
-       if(get_blend_method()==Color::BLEND_STRAIGHT && get_amount()>=0.5)
-               return const_cast<Layer_SolidColor*>(this);
-       else
-       if(get_blend_method()==Color::BLEND_COMPOSITE && get_amount()*color.get_a()>=0.5)
-               return const_cast<Layer_SolidColor*>(this);
-       
-       Layer::Handle layer(context.hit_check(point));
-       
-       return layer?layer:const_cast<Layer_SolidColor*>(this);
-}
-
-Color
-Layer_SolidColor::get_color(Context context, const Point &pos)const
-{
-       if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
-               return color;
-       else
-               return Color::blend(color,context.get_color(pos),get_amount(),get_blend_method());
-}
-       
-bool
-Layer_SolidColor::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
-{
-       if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
-       {
-               // Mark our progress as starting
-               if(cb && !cb->amount_complete(0,1000))
-                       return false;
-               
-               surface->set_wh(renddesc.get_w(),renddesc.get_h());
-               surface->fill(color);
-
-               // Mark our progress as finished
-               if(cb && !cb->amount_complete(1000,1000))
-                       return false;
-
-               return true;
-       }
-
-       SuperCallback supercb(cb,0,9500,10000);
-
-       if(!context.accelerated_render(surface,quality,renddesc,&supercb))
-               return false;
-
-       int x,y;
-
-       Surface::alpha_pen apen(surface->begin());
-
-       apen.set_value(color);
-       apen.set_alpha(get_amount());
-       apen.set_blend_method(get_blend_method());
-
-       for(y=0;y<renddesc.get_h();y++,apen.inc_y(),apen.dec_x(x))
-               for(x=0;x<renddesc.get_w();x++,apen.inc_x())
-                       apen.put_value();
-
-       // Mark our progress as finished
-       if(cb && !cb->amount_complete(10000,10000))
-               return false;
-
-       return true;
-}
diff --git a/synfig-core/trunk/src/sinfg/layer_solidcolor.h b/synfig-core/trunk/src/sinfg/layer_solidcolor.h
deleted file mode 100644 (file)
index 07f8106..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layer_solidcolor.h
-**     \brief Template Header
-**
-**     $Id: layer_solidcolor.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LAYER_SOLIDCOLOR_H
-#define __SINFG_LAYER_SOLIDCOLOR_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "layer_composite.h"
-#include "color.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Layer_SolidColor : public Layer_Composite, public Layer_NoDeform
-{
-       SINFG_LAYER_MODULE_EXT
-       
-private:
-
-       Color color;
-
-public:
-       
-       Layer_SolidColor();
-       
-       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
-
-       virtual ValueBase get_param(const String & param)const;
-
-       virtual Color get_color(Context context, const Point &pos)const;
-       
-       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
-       
-       virtual Vocab get_param_vocab()const;
-
-       virtual sinfg::Layer::Handle hit_check(sinfg::Context context, const sinfg::Point &point)const;
-
-}; // END of class Layer_SolidColor
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/listimporter.cpp b/synfig-core/trunk/src/sinfg/listimporter.cpp
deleted file mode 100644 (file)
index b138d66..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file listimporter.cpp
-**     \brief Template File
-**
-**     $Id: listimporter.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "listimporter.h"
-#include "general.h"
-#include <fstream>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define LIST_IMPORTER_CACHE_SIZE       20
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ListImporter::ListImporter(const String &filename)
-{
-       fps=15;
-
-       ifstream stream(filename.c_str());
-
-       if(!stream)
-       {
-               sinfg::error("Unable to open "+filename);
-               return;
-       }
-       String line;
-       String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPERATOR;
-       while(!stream.eof())
-       {
-               getline(stream,line);
-               if(line.empty())
-                       continue;
-               // If we have a framerate, then use it
-               if(line.find(String("FPS "))==0)
-               {
-                       fps=atof(String(line.begin()+4,line.end()).c_str());
-                       //sinfg::warning("FPS=%f",fps);
-                       if(!fps)
-                               fps=15;
-                       continue;
-               }
-               filename_list.push_back(prefix+line);
-       }
-}
-
-Importer*
-ListImporter::create(const char *filename)
-{
-       return new ListImporter(filename);
-}
-
-ListImporter::~ListImporter()
-{
-}
-
-bool
-ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
-{
-//                     DEBUGPOINT();
-       int frame=static_cast<int>(time*fps);
-//                     DEBUGPOINT();
-       
-       if(!filename_list.size())
-       {
-               if(cb)cb->error(_("No images in list"));
-               else sinfg::error(_("No images in list"));
-               return false;
-       }
-       
-//                     DEBUGPOINT();
-       if(frame<0)frame=0;
-       if(frame>=(signed)filename_list.size())frame=filename_list.size()-1;
-       
-//                     DEBUGPOINT();
-       // See if that frame is cached
-       std::list<std::pair<int,Surface> >::iterator iter;
-       for(iter=frame_cache.begin();iter!=frame_cache.end();++iter)
-       {
-               if(iter->first==frame)
-               {
-//                     DEBUGPOINT();
-                       surface.mirror(iter->second);
-                       return static_cast<bool>(surface);
-               }
-       }
-               
-       Importer::Handle importer(Importer::open(filename_list[frame]));
-       
-//     DEBUGPOINT();
-
-       if(!importer)
-       {
-               if(cb)cb->error(_("Unable to open ")+filename_list[frame]);
-               else sinfg::error(_("Unable to open ")+filename_list[frame]);
-               return false;
-       }
-       
-//     DEBUGPOINT();
-
-       if(!importer->get_frame(surface,0,cb))
-       {
-               if(cb)cb->error(_("Unable to get frame from ")+filename_list[frame]);
-               else sinfg::error(_("Unable to get frame from ")+filename_list[frame]);
-               return false;
-       }
-               
-//     DEBUGPOINT();
-
-       if(frame_cache.size()>=LIST_IMPORTER_CACHE_SIZE)
-               frame_cache.pop_front();
-
-//     DEBUGPOINT();
-
-       frame_cache.push_back(std::pair<int,Surface>(frame,surface));   
-
-//     DEBUGPOINT();
-
-       surface.mirror(frame_cache.back().second);
-
-//     DEBUGPOINT();
-
-       return static_cast<bool>(surface);
-}
-
-bool
-ListImporter::is_animated()
-{
-       return true;
-}
diff --git a/synfig-core/trunk/src/sinfg/listimporter.h b/synfig-core/trunk/src/sinfg/listimporter.h
deleted file mode 100644 (file)
index 3af78e1..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file listimporter.h
-**     \brief Template Header
-**
-**     $Id: listimporter.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LISTIMPORTER_H
-#define __SINFG_LISTIMPORTER_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "importer.h"
-#include "surface.h"
-#include <ETL/smart_ptr>
-#include <vector>
-//#include <deque>
-#include <list>
-#include <utility>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class ListImporter
-**     \todo Write more detailed description
-*/
-class ListImporter : public Importer
-{
-       float fps;
-       std::vector<String> filename_list;
-       std::list<std::pair<int,Surface> > frame_cache;
-protected:
-       ListImporter(const String &filename);
-
-public:
-
-       virtual ~ListImporter();
-
-       virtual bool get_frame(Surface &surface,Time time, ProgressCallback *callback=NULL);
-
-       virtual bool is_animated();
-
-       static Importer* create(const char *filename);
-};
-       
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/loadcanvas.cpp b/synfig-core/trunk/src/sinfg/loadcanvas.cpp
deleted file mode 100644 (file)
index 8f1fd68..0000000
+++ /dev/null
@@ -1,2364 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file loadcanvas.cpp
-**     \brief writeme
-**
-**     $Id: loadcanvas.cpp,v 1.3 2005/01/04 23:40:44 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include <cstdlib>
-#include <cstdio>
-#include <cstring>
-#include <ETL/stringf>
-#include <libxml++/libxml++.h>
-#include <vector>
-#include <stdexcept>
-#include <iostream>
-
-#include "loadcanvas.h"
-#include "valuenode.h"
-#include "valuenode_subtract.h"
-#include "valuenode_animated.h"
-#include "valuenode_composite.h"
-#include "valuenode_const.h"
-#include "valuenode_linear.h"
-#include "valuenode_dynamiclist.h"
-#include "valuenode_reference.h"
-#include "valuenode_scale.h"
-#include "valuenode_timedswap.h"
-#include "valuenode_twotone.h"
-#include "valuenode_stripes.h"
-#include "valuenode_segcalctangent.h"
-#include "valuenode_segcalcvertex.h"
-#include "valuenode_bline.h"
-
-#include "layer.h"
-#include "string.h"
-
-#include "exception.h"
-
-#include "gradient.h"
-
-#include <map>
-#include <sigc++/bind.h>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace sinfg;
-using namespace etl;
-
-/*
-class test_class {
-static int bleh;
-public:
-       test_class() { assert(!bleh); bleh++; sinfg::info("test_class: initi: %d",bleh); }
-       ~test_class() { assert(bleh); sinfg::info("test_class: uninit: %d",bleh); bleh--; }
-};
-int test_class::bleh(0);
-
-test_class test_class_instance;
-*/     
-
-/* === M A C R O S ========================================================= */
-
-inline bool is_whitespace(char x) { return ((x)=='\n' || (x)=='\t' || (x)==' '); }
-
-/* === P R O C E D U R E S ================================================= */
-
-static std::map<String, Canvas::LooseHandle>* open_canvas_map_(0);
-
-std::map<sinfg::String, etl::loose_handle<Canvas> >& sinfg::get_open_canvas_map()
-{
-       if(!open_canvas_map_)
-               open_canvas_map_=new std::map<String, Canvas::LooseHandle>;
-       return *open_canvas_map_;
-}
-
-static void _remove_from_open_canvas_map(Canvas *x) { get_open_canvas_map().erase(etl::absolute_path(x->get_file_name())); }
-
-static void _canvas_file_name_changed(Canvas *x)
-{
-       std::map<sinfg::String, etl::loose_handle<Canvas> >::iterator iter;
-       
-       for(iter=get_open_canvas_map().begin();iter!=get_open_canvas_map().end();++iter)
-               if(iter->second==x)
-                       break;
-       assert(iter!=get_open_canvas_map().end());
-       if(iter==get_open_canvas_map().end())
-               return;
-       get_open_canvas_map().erase(iter->first);
-       get_open_canvas_map()[etl::absolute_path(x->get_file_name())]=x;
-       
-}
-
-Canvas::Handle
-sinfg::open_canvas(const String &filename)
-{
-       CanvasParser parser;
-
-       parser.set_allow_errors(true);
-
-       Canvas::Handle canvas=parser.parse_from_file(filename);
-
-       if(parser.error_count())
-               return Canvas::Handle();
-       
-       return canvas;
-}
-
-Canvas::Handle
-sinfg::open_canvas_as(const String &filename,const String &as)
-{
-       CanvasParser parser;
-
-       parser.set_allow_errors(true);
-
-       Canvas::Handle canvas=parser.parse_from_file_as(filename,as);
-
-       if(parser.error_count())
-               return Canvas::Handle();
-       
-       return canvas;
-}
-
-Canvas::Handle
-sinfg::string_to_canvas(const String &data)
-{
-       CanvasParser parser;
-
-       parser.set_allow_errors(true);
-
-       Canvas::Handle canvas=parser.parse_from_string(data);
-
-       if(parser.error_count())
-               return Canvas::Handle();
-
-       return canvas;
-}
-
-/* === M E T H O D S ======================================================= */
-
-void
-CanvasParser::error_unexpected_element(xmlpp::Node *element,const String &got, const String &expected)
-{
-       error(element,strprintf(_("Unexpected element <%s>, Expected <%s>"),got.c_str(),expected.c_str()));
-}
-
-void
-CanvasParser::error_unexpected_element(xmlpp::Node *element,const String &got)
-{
-       error(element,strprintf(_("Unexpected element <%s>"),got.c_str()));
-}
-
-void
-CanvasParser::warning(xmlpp::Node *element, const String &text)
-{
-       string str=strprintf("%s:<%s>:%d: warning: ",filename.c_str(),element->get_name().c_str(),element->get_line())+text;
-       //sinfg::warning(str);
-       cerr<<str<<endl;
-       total_warnings_++;
-       if(total_warnings_>=max_warnings_)
-               fatal_error(element, _("Too many warnings"));
-}
-
-void
-CanvasParser::error(xmlpp::Node *element, const String &text)
-{
-       string str=strprintf("%s:<%s>:%d: error: ",filename.c_str(),element->get_name().c_str(),element->get_line())+text;
-       total_errors_++;
-       if(!allow_errors_)
-               throw runtime_error(str);
-       cerr<<str<<endl;
-       //      sinfg::error(str);
-}
-
-void
-CanvasParser::fatal_error(xmlpp::Node *element, const String &text)
-{
-       string str=strprintf("%s:<%s>:%d:",filename.c_str(),element->get_name().c_str(),element->get_line())+text;
-       throw runtime_error(str);
-}
-
-
-
-Keyframe
-CanvasParser::parse_keyframe(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="keyframe");
-
-       if(!element->get_attribute("time"))
-       {
-               error(element,strprintf(_("<%s> is missing \"%s\" attribute"),"real","time"));
-               return Keyframe();
-       }
-       
-       Keyframe ret(Time(element->get_attribute("time")->get_value(),canvas->rend_desc().get_frame_rate()));
-
-
-       if(element->get_children().empty())
-               return ret;
-       
-       if(element->get_child_text()->get_content().empty())
-               return ret;
-       
-       ret.set_description(element->get_child_text()->get_content());
-
-       return ret;     
-}
-
-
-Real
-CanvasParser::parse_real(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="real");
-
-       if(!element->get_children().empty())
-               warning(element, strprintf(_("<%s> should not contain anything"),"real"));
-
-       if(!element->get_attribute("value"))
-       {
-               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"real"));
-               return false;
-       }
-
-       string val=element->get_attribute("value")->get_value();
-
-       return atof(val.c_str());
-}
-
-Time
-CanvasParser::parse_time(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="time");
-
-       if(!element->get_children().empty())
-               warning(element, strprintf(_("<%s> should not contain anything"),"time"));
-
-       if(!element->get_attribute("value"))
-       {
-               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"time"));
-               return false;
-       }
-
-       string val=element->get_attribute("value")->get_value();
-
-       return Time(val,canvas->rend_desc().get_frame_rate());
-}
-
-int
-CanvasParser::parse_integer(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="integer");
-
-       if(!element->get_children().empty())
-               warning(element, strprintf(_("<%s> should not contain anything"),"integer"));
-
-       if(!element->get_attribute("value"))
-       {
-               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"integer"));
-               return false;
-       }
-
-       string val=element->get_attribute("value")->get_value();
-
-       return atoi(val.c_str());
-}
-
-Vector
-CanvasParser::parse_vector(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="vector");
-
-       if(element->get_children().empty())
-       {
-               error(element, "Undefined value in <vector>");
-               return Vector();
-       }
-
-       Vector vect;
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child=dynamic_cast<xmlpp::Element*>((xmlpp::Node*)*iter);
-               if(!child)
-                       continue;
-               else
-               if(child->get_name()=="x")
-               {
-                       if(child->get_children().empty())
-                       {
-                               error(element, "Undefined value in <x>");
-                               return Vector();
-                       }
-                       xmlpp::TextNode *text=dynamic_cast<xmlpp::TextNode*>(child->get_children().front());
-                       if(!text)
-                       {
-                               error(element,"I need a number, not an element!");
-                               return Vector();                                
-                       }
-                       vect[0]=atof(text->get_content().c_str());
-               }
-               else
-               if(child->get_name()=="y")
-               {
-                       if(child->get_children().empty())
-                       {
-                               error(element, "Undefined value in <y>");
-                               return Vector();
-                       }
-                       xmlpp::TextNode *text=dynamic_cast<xmlpp::TextNode*>(child->get_children().front());
-                       if(!text)
-                       {
-                               error(element,"I need a number, not an element!");
-                               return Vector();                                
-                       }
-                       vect[1]=atof(text->get_content().c_str());
-               }
-               else
-                       error_unexpected_element(child,child->get_name());
-       }
-       return vect;
-}
-
-Color
-CanvasParser::parse_color(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="color");
-
-       if(element->get_children().empty())
-       {
-               error(element, "Undefined value in <color>");
-               return Color();
-       }
-
-       Color color;
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               if(child->get_name()=="r")
-               {
-                       if(child->get_children().empty())
-                       {
-                               error(element, "Undefined value in <r>");
-                               return Color();
-                       }
-                       color.set_r(atof(child->get_child_text()->get_content().c_str()));
-               }
-               else
-               if(child->get_name()=="g")
-               {
-                       if(child->get_children().empty())
-                       {
-                               error(element, "Undefined value in <g>");
-                               return Color();
-                       }
-                       color.set_g(atof(child->get_child_text()->get_content().c_str()));
-               }
-               else
-               if(child->get_name()=="b")
-               {
-                       if(child->get_children().empty())
-                       {
-                               error(element, "Undefined value in <b>");
-                               return Color();
-                       }
-                       color.set_b(atof(child->get_child_text()->get_content().c_str()));
-               }
-               else
-               if(child->get_name()=="a")
-               {
-                       if(child->get_children().empty())
-                       {
-                               error(element, "Undefined value in <a>");
-                               return Color();
-                       }
-                       color.set_a(atof(child->get_child_text()->get_content().c_str()));
-               }
-               else
-                       error_unexpected_element(child,child->get_name());
-       }
-
-       return color;
-}
-
-sinfg::String
-CanvasParser::parse_string(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="string");
-
-       if(element->get_children().empty())
-       {
-               warning(element, "Undefined value in <string>");
-               return sinfg::String();
-       }
-       
-       if(element->get_child_text()->get_content().empty())
-       {
-               warning(element, "Content element of <string> appears to be empty");
-               return sinfg::String();
-       }
-       
-       return element->get_child_text()->get_content();
-}
-
-bool
-CanvasParser::parse_bool(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="bool");
-
-       if(!element->get_children().empty())
-               warning(element, strprintf(_("<%s> should not contain anything"),"bool"));
-
-       if(!element->get_attribute("value"))
-       {
-               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"bool"));
-               return false;
-       }
-
-       string val=element->get_attribute("value")->get_value();
-
-       if(val=="true" || val=="1")
-               return true;
-       if(val=="false" || val=="0")
-               return false;
-
-       error(element,strprintf(_("Bad value \"%s\" in <%s>"),val.c_str(),"bool"));
-       
-       return false;
-}
-
-Gradient
-CanvasParser::parse_gradient(xmlpp::Element *node,Canvas::Handle canvas)
-{
-       assert(node->get_name()=="gradient");
-       Gradient ret;
-       
-       xmlpp::Element::NodeList list = node->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               {
-                       Gradient::CPoint cpoint;
-                       cpoint.color=parse_color(child,canvas);
-
-                       if(!child->get_attribute("pos"))
-                       {
-                               error(child,strprintf(_("<%s> is missing \"pos\" attribute"),"gradient"));
-                               return Gradient();
-                       }
-
-                       cpoint.pos=atof(child->get_attribute("pos")->get_value().c_str());
-                       
-                       ret.push_back(cpoint);
-               }
-       }
-       ret.sort();
-       return ret;
-}
-
-ValueBase
-CanvasParser::parse_list(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       vector<ValueBase> value_list;
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               {
-                       value_list.push_back(parse_value(child,canvas));
-                       if(!value_list.back().is_valid())
-                       {
-                               value_list.pop_back();
-                               error(child,"Bad ValueBase");
-                               continue;
-                       }
-               }
-       }
-       return value_list;
-}
-
-Segment
-CanvasParser::parse_segment(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="segment");
-
-       if(element->get_children().empty())
-       {
-               error(element, "Undefined value in <segment>");
-               return Segment();
-       }
-
-       Segment seg;
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               if(child->get_name()=="p1")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <p1>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="vector")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
-                               continue;
-                       }
-
-                       seg.p1=parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-               }
-               else
-               if(child->get_name()=="t1")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <t1>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="vector")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
-                               continue;
-                       }
-
-                       seg.t1=parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-               }
-               else
-               if(child->get_name()=="p2")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <p2>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="vector")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
-                               continue;
-                       }
-
-                       seg.p2=parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-               }
-               else
-               if(child->get_name()=="t2")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <t2>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="vector")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
-                               continue;
-                       }
-
-                       seg.t2=parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-               }
-               else
-                       error_unexpected_element(child,child->get_name());
-       }
-       return seg;
-}
-
-BLinePoint
-CanvasParser::parse_bline_point(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="bline_point");
-       if(element->get_children().empty())
-       {
-               error(element, "Undefined value in <bline_point>");
-               return BLinePoint();
-       }
-
-       BLinePoint ret;
-       ret.set_split_tangent_flag(false);
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               // Vertex
-               if(child->get_name()[0]=='v' || child->get_name()=="p1")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <vertex>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="vector")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
-                               continue;
-                       }
-
-                       ret.set_vertex(parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas));
-               }
-               else
-               // Tangent 1 
-               if(child->get_name()=="t1" || child->get_name()=="tangent")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <t1>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="vector")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
-                               continue;
-                       }
-
-                       ret.set_tangent1(parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas));
-               }
-               else
-               // Tangent 2 
-               if(child->get_name()=="t2")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <t2>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="vector")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
-                               continue;
-                       }
-
-                       ret.set_tangent2(parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas));
-                       ret.set_split_tangent_flag(true);
-               }
-               else
-               // width
-               if(child->get_name()=="width")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <width>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="real")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"real");
-                               continue;
-                       }
-
-                       ret.set_width(parse_real(dynamic_cast<xmlpp::Element*>(*iter),canvas));
-               }
-               else
-               // origin
-               if(child->get_name()=="origin")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(element, "Undefined value in <origin>");
-                               continue;
-                       }
-
-                       if((*iter)->get_name()!="real")
-                       {
-                               error_unexpected_element((*iter),(*iter)->get_name(),"real");
-                               continue;
-                       }
-
-                       ret.set_origin(parse_real(dynamic_cast<xmlpp::Element*>(*iter),canvas));
-               }
-               else
-                       error_unexpected_element(child,child->get_name());
-       }
-       return ret;
-}
-
-Angle
-CanvasParser::parse_angle(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="angle");
-
-       if(!element->get_children().empty())
-               warning(element, strprintf(_("<%s> should not contain anything"),"angle"));
-
-       if(!element->get_attribute("value"))
-       {
-               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"angle"));
-               return Angle();
-       }
-
-       string val=element->get_attribute("value")->get_value();
-
-       return Angle::deg(atof(val.c_str()));
-}
-
-ValueBase
-CanvasParser::parse_value(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       if(element->get_name()=="real")
-               return parse_real(element,canvas);
-       else
-       if(element->get_name()=="time")
-               return parse_time(element,canvas);
-       else
-       if(element->get_name()=="integer")
-               return parse_integer(element,canvas);
-       else
-       if(element->get_name()=="string")
-               return parse_string(element,canvas);
-       else
-       if(element->get_name()=="vector")
-       {
-               return parse_vector(element,canvas);
-       }
-       else
-       if(element->get_name()=="color")
-               return parse_color(element,canvas);
-       else
-       if(element->get_name()=="segment")
-               return parse_segment(element,canvas);
-       else
-       if(element->get_name()=="list")
-               return parse_list(element,canvas);
-       else
-       if(element->get_name()=="gradient")
-               return parse_gradient(element,canvas);
-       else
-       if(element->get_name()=="bool")
-               return parse_bool(element,canvas);
-       else
-       //if(element->get_name()=="canvas")
-       //      return parse_canvas(element,canvas,true);       // inline canvas
-       //else
-       if(element->get_name()=="angle" || element->get_name()=="degrees" || element->get_name()=="radians" || element->get_name()=="rotations")
-               return parse_angle(element,canvas);
-       else
-       if(element->get_name()=="bline_point")
-               return parse_bline_point(element,canvas);
-       else
-       if(element->get_name()=="canvas")
-               return ValueBase(parse_canvas(element,canvas,true));
-       else
-       {
-               DEBUGPOINT();
-               error_unexpected_element(element,element->get_name());
-       }
-
-       return ValueBase();
-}
-
-
-
-
-ValueNode_Animated::Handle
-CanvasParser::parse_animated(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="hermite" || element->get_name()=="animated");
-
-       if(!element->get_attribute("type"))
-       {
-               error(element,"Missing attribute \"type\" in <animated>");
-               return ValueNode_Animated::Handle();
-       }
-
-       ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value());
-
-       if(!type)
-       {
-               error(element,"Bad type in <animated>");
-               return ValueNode_Animated::Handle();
-       }
-       
-       ValueNode_Animated::Handle value_node=ValueNode_Animated::create(type);
-
-       if(!value_node)
-       {
-               error(element,strprintf(_("Unable to create <animated> with type \"%s\""),ValueBase::type_name(type).c_str()));
-               return ValueNode_Animated::Handle();
-       }
-
-       value_node->set_root_canvas(canvas->get_root());
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               if(child->get_name()=="waypoint")
-               {
-                       if(!child->get_attribute("time"))
-                       {
-                               error(child,_("<waypoint> is missing attribute \"time\""));
-                               continue;
-                       }
-
-                       Time time(child->get_attribute("time")->get_value(),canvas->rend_desc().get_frame_rate());
-
-                       
-                       ValueNode::Handle waypoint_value_node;
-                       
-                       if(child->get_attribute("use"))
-                       {
-                               waypoint_value_node=canvas->surefind_value_node(child->get_attribute("use")->get_value());
-                       }
-                       else
-                       {
-                               if(child->get_children().empty())
-                               {
-                                       error(child, strprintf(_("<%s> is missing its data"),"waypoint"));
-                                       continue;
-                               }
-       
-                               xmlpp::Element::NodeList list = child->get_children();
-                               xmlpp::Element::NodeList::iterator iter;
-       
-                               // Search for the first non-text XML element
-                               for(iter = list.begin(); iter != list.end(); ++iter)
-                                       if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-       
-                               if(iter==list.end())
-                               {
-                                       error(child, strprintf(_("<%s> is missing its data"),"waypoint"));
-                                       continue;
-                               }
-                               
-                               waypoint_value_node=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-                               
-                               /*
-                               ValueBase data=parse_value(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-       
-                               if(!data.is_valid())
-                               {
-                                       error(child,_("Bad data for <waypoint>"));
-                                       continue;
-                               }
-                               */
-                               if(!waypoint_value_node)
-                               {
-                                       error(child,_("Bad data for <waypoint>"));
-                                       continue;
-                               }
-                               
-                               /*! HACK -- This is a temporary fix to help repair some
-                               **      weirdness that is currently going on (10-21-2004).
-                               **      This short circuits the linking of waypoints,
-                               **      a feature which is so obscure that we can get
-                               **      away with something like this pretty easily.
-                               */
-                               waypoint_value_node=waypoint_value_node->clone();
-                               
-                               // Warn if there is trash after the param value
-                               for(iter++; iter != list.end(); ++iter)
-                                       if(dynamic_cast<xmlpp::Element*>(*iter))
-                                               warning((*iter),strprintf(_("Unexpected element <%s> after <waypoint> data, ignoring..."),(*iter)->get_name().c_str()));
-                       }
-
-
-                       try {
-                               ValueNode_Animated::WaypointList::iterator waypoint=value_node->new_waypoint(time,waypoint_value_node);
-
-                       if(child->get_attribute("tension"))
-                       {
-                               sinfg::String str(child->get_attribute("tension")->get_value());
-                               waypoint->set_tension(atof(str.c_str()));
-                       }
-                       if(child->get_attribute("temporal-tension"))
-                       {
-                               sinfg::String str(child->get_attribute("temporal-tension")->get_value());
-                               waypoint->set_time_tension(atof(str.c_str()));
-                       }
-                       if(child->get_attribute("continuity"))
-                       {
-                               sinfg::String str(child->get_attribute("continuity")->get_value());
-                               waypoint->set_continuity(atof(str.c_str()));
-                       }
-                       if(child->get_attribute("bias"))
-                       {
-                               sinfg::String str(child->get_attribute("bias")->get_value());
-                               waypoint->set_bias(atof(str.c_str()));
-                       }
-
-                       if(child->get_attribute("before"))
-                       {
-                               string val=child->get_attribute("before")->get_value();
-                               if(val=="halt")
-                                       waypoint->set_before(INTERPOLATION_HALT);
-                               else if(val=="constant")
-                                       waypoint->set_before(INTERPOLATION_CONSTANT);
-                               else if(val=="linear")
-                                       waypoint->set_before(INTERPOLATION_LINEAR);
-                               else if(val=="manual")
-                                       waypoint->set_before(INTERPOLATION_MANUAL);
-                               else if(val=="auto")
-                                       waypoint->set_before(INTERPOLATION_TCB);
-                               else
-                                       error(child,strprintf(_("\"%s\" not a valid value for attribute \"%s\" in <%s>"),val.c_str(),"before","waypoint"));
-                       }
-                       
-                       if(child->get_attribute("after"))
-                       {
-                               string val=child->get_attribute("after")->get_value();
-                               if(val=="halt")
-                                       waypoint->set_after(INTERPOLATION_HALT);
-                               else if(val=="constant")
-                                       waypoint->set_after(INTERPOLATION_CONSTANT);
-                               else if(val=="linear")
-                                       waypoint->set_after(INTERPOLATION_LINEAR);
-                               else if(val=="manual")
-                                       waypoint->set_after(INTERPOLATION_MANUAL);
-                               else if(val=="auto")
-                                       waypoint->set_after(INTERPOLATION_TCB);
-                               else
-                                       error(child,strprintf(_("\"%s\" not a valid value for attribute \"%s\" in <%s>"),val.c_str(),"before","waypoint"));
-                       }
-                       }
-                       catch(Exception::BadTime x)
-                       {
-                               warning(child,x.what());
-                       }
-                       continue;
-
-               }
-               else
-                       error_unexpected_element(child,child->get_name());
-       }
-       value_node->changed();
-       return value_node;
-}
-
-// This function is a phase-out hack for the timed swap value node
-etl::handle<ValueNode_Animated>
-CanvasParser::parse_timedswap(xmlpp::Element *node,Canvas::Handle canvas)
-{
-       ValueNode_TimedSwap::Handle timed_swap(parse_linkable_value_node(node,canvas));
-       
-       assert(timed_swap);
-
-       ValueNode_Animated::Handle animated(ValueNode_Animated::create(timed_swap->get_type()));
-
-       animated->set_root_canvas(canvas->get_root());
-       
-       assert(animated);
-       
-       Time swap_time, swap_length;
-       (*timed_swap->get_swap_time())(0).put(&swap_time);
-       (*timed_swap->get_swap_length())(0).put(&swap_length);
-       
-       animated->new_waypoint(swap_time-swap_length,timed_swap->get_before());
-       animated->new_waypoint(swap_time,timed_swap->get_after());
-       
-       return animated;
-}
-
-
-handle<ValueNode_Subtract>
-CanvasParser::parse_subtract(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="subtract");
-
-       handle<ValueNode_Subtract> value_node;
-       handle<ValueNode> lhs,rhs,scalar;
-
-       if(element->get_attribute("type"))
-       {
-               ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value());
-
-               if(!type)
-               {
-                       error(element,"Bad type in <subtract>");
-                       return ValueNode_Subtract::Handle();
-               }
-               value_node=ValueNode_Subtract::create(type);
-       }
-       else
-               value_node=ValueNode_Subtract::create();
-
-       if(!value_node)
-       {
-               error(element,strprintf(_("Unable to create <subtract>")));
-               return handle<ValueNode_Subtract>();
-       }
-
-       //if(element->get_attribute("scalar"))
-       //{
-       //      value_node->set_scalar(atof(element->get_attribute("scalar")->get_value().c_str()));
-       //}
-
-       try
-       {
-               if(element->get_attribute("scalar"))
-               {
-                       // This is for compatibility with older versions of the file format
-                       String value(element->get_attribute("scalar")->get_value());
-                       if((value[0]<='9' && value[0]>='0')      || value[0]=='-')
-                       {
-                               warning(element, _("Use of a real value where the ID should be is deprecated"));
-                               value_node->set_scalar(atof(value.c_str()));
-                       }
-                       else
-                               value_node->set_scalar(canvas->surefind_value_node(value));
-                       scalar=value_node->get_scalar();
-               }
-
-               if(element->get_attribute("lhs"))
-               {
-                       lhs=canvas->surefind_value_node(element->get_attribute("lhs")->get_value());
-                       value_node->set_lhs(lhs);                       
-               }
-       
-               if(element->get_attribute("rhs"))
-               {
-                       rhs=canvas->surefind_value_node(element->get_attribute("rhs")->get_value());
-                       value_node->set_rhs(rhs);
-               }
-       }
-       catch (Exception::IDNotFound)
-       {
-               error(element,"attribute in <subtract> references unknown ID");
-       }
-       catch (Exception::FileNotFound)
-       {
-               error(element,"Unable to open external file referenced in ID");
-       }
-       
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               if(child->get_name()=="lhs")
-               {
-                       if(lhs)
-                       {
-                               error(child,"LHS component of <subtract> already defined!");
-                               continue;
-                       }
-
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(child,_("<lhs> is missing its contents"));
-                               continue;
-                       }
-
-                       lhs=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-
-                       if(lhs)
-                               value_node->set_lhs(lhs);
-                       else
-                       {
-                               error((*iter),"Parse of LHS ValueNode failed");
-                       }
-
-                       // \todo do a search for more elements and warn if they are found
-               }
-               else
-               if(child->get_name()=="rhs")
-               {
-                       if(rhs)
-                       {
-                               error(child,"RHS component of <subtract> already defined!");
-                               continue;
-                       }
-
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(child,_("<rhs> is missing its contents"));
-                               continue;
-                       }
-
-                       rhs=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-
-                       if(rhs)
-                               value_node->set_rhs(rhs);
-                       else
-                       {
-                               error((*iter),"Parse of RHS ValueNode failed");
-                       }
-
-                       // \todo do a search for more elements and warn if they are found
-               }
-               else
-               if(child->get_name()=="scalar")
-               {
-                       if(scalar)
-                       {
-                               error(child,"scalar component of <subtract> already defined!");
-                               continue;
-                       }
-
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(child,_("<scalar> is missing its contents"));
-                               continue;
-                       }
-
-                       scalar=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-
-                       if(scalar)
-                               value_node->set_scalar(scalar);
-                       else
-                       {
-                               error((*iter),"Parse of scalar ValueNode failed");
-                       }
-
-                       // \todo do a search for more elements and warn if they are found
-               }
-               else
-                       error_unexpected_element(child,child->get_name());
-       }
-
-       if(!value_node->get_rhs() || !value_node->get_lhs() || !value_node->get_scalar())
-               error(element,"<subtract> is missing LHS, RHS, or SCALAR");
-
-       if(value_node->get_rhs() == value_node->get_lhs())
-               warning(element,"LHS is equal to RHS in <subtract>, so this value_node will always be zero!");
-
-       return value_node;
-}
-
-etl::handle<LinkableValueNode>
-CanvasParser::parse_linkable_value_node(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       handle<LinkableValueNode> value_node;
-       ValueBase::Type type;
-       
-       // Determine the type
-       if(element->get_attribute("type"))
-       {
-               type=ValueBase::ident_type(element->get_attribute("type")->get_value());
-
-               if(!type)
-               {
-                       error(element,"Bad type in ValueNode");
-                       return 0;
-               }
-       }
-       else
-       {
-               error(element,"Missing type in ValueNode");
-               return 0;
-       }
-
-       value_node=LinkableValueNode::create(element->get_name(),type);
-               
-       if(!value_node)
-       {
-               error(element,"Unknown ValueNode type "+element->get_name());
-               return 0;
-       }               
-
-       if(value_node->get_type()!=type)
-       {
-               error(element,"ValueNode did not accept type");
-               return 0;
-       }               
-
-       value_node->set_root_canvas(canvas->get_root());
-
-       int i;
-       for(i=0;i<value_node->link_count();i++)
-       {
-               if(element->get_attribute(value_node->link_name(i)))
-               try {
-                       String id(element->get_attribute(value_node->link_name(i))->get_value());
-                       
-                       if(!value_node->set_link(i,
-                                       canvas->surefind_value_node(
-                                               id
-                                       )
-                               )
-                       ) error(element,strprintf(_("Unable to set link \"%s\" to ValueNode \"%s\" (link #%d in \"%s\")"),value_node->link_name(i).c_str(),id.c_str(),i,value_node->get_name().c_str()));                       
-               }
-               catch(Exception::IDNotFound)
-               {
-                       error(element,"Unable to resolve "+element->get_attribute(value_node->link_name(i))->get_value());
-               }
-               catch(Exception::FileNotFound)
-               {
-                       error(element,"Unable to open file referenced in "+element->get_attribute(value_node->link_name(i))->get_value());
-               }
-               catch(...)
-               {
-                       error(element,strprintf(_("Unknown Exception thrown when referencing ValueNode \"%s\""),
-                               element->get_attribute(value_node->link_name(i))->get_value().c_str()));
-                       throw;
-               }
-       }               
-       
-
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               try
-               {
-                       if(!child)
-                               continue;
-                       int index=value_node->get_link_index_from_name(child->get_name());
-
-                       xmlpp::Element::NodeList list = child->get_children();
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                       if(iter==list.end())
-                       {
-                               error(child,_("element is missing its contents"));
-                               continue;
-                       }
-
-                       ValueNode::Handle link=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-
-                       if(!link)
-                       {
-                               error((*iter),"Parse of ValueNode failed");
-                       }
-                       else
-                       if(!value_node->set_link(index,link))
-                       {
-                               //error(dynamic_cast<xmlpp::Element*>(*iter),strprintf("Unable to connect value node ('%s' of type '%s') to link %d",link->get_name().c_str(),ValueBase::type_name(link->get_type()).c_str(),index));
-                               error(element,strprintf("Unable to connect value node ('%s' of type '%s') to link %d",link->get_name().c_str(),ValueBase::type_name(link->get_type()).c_str(),index));
-                       }
-
-                       // \todo do a search for more elements and warn if they are found
-                       
-               }
-               catch(Exception::BadLinkName)
-               {
-                       error_unexpected_element(child,child->get_name());
-               }
-               catch(...)
-               {
-                       error(child,strprintf(_("Unknown Exception thrown when working on element \"%s\""),child->get_name().c_str()));
-                       throw;
-               }
-       }
-
-       return value_node;
-}
-
-handle<ValueNode_Composite>
-CanvasParser::parse_composite(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="composite");
-
-       if(!element->get_attribute("type"))
-       {
-               error(element,"Missing attribute \"type\" in <composite>");
-               return handle<ValueNode_Composite>();
-       }
-
-       ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value());
-
-       if(!type)
-       {
-               error(element,"Bad type in <composite>");
-               return handle<ValueNode_Composite>();
-       }
-
-       handle<ValueNode_Composite> value_node=ValueNode_Composite::create(type);
-       handle<ValueNode> c[6];
-
-       if(!value_node)
-       {
-               error(element,strprintf(_("Unable to create <composite>")));
-               return handle<ValueNode_Composite>();
-       }
-
-       int i;
-
-       for(i=0;i<value_node->link_count();i++)
-       {
-               string name=strprintf("c%d",i+1);
-               if(c[i])
-               {
-                       error(element,name+" was already defined in <composite>");
-                       continue;
-               }
-               if(element->get_attribute(name))
-               {
-                       c[i]=canvas->surefind_value_node(element->get_attribute(name)->get_value());
-                       if(c[i])
-                       {
-                               if(!value_node->set_link(i,c[i]))
-                               {
-                                       error(element,'"'+name+"\" attribute in <composite> has bad type");
-                               }
-                       }
-                       else
-                               error(element,'"'+name+"\" attribute in <composite> references unknown ID");
-               }
-       }
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               for(i=0;i<value_node->link_count();i++)
-               {
-                       string name=strprintf("c%d",i+1);
-                       if(child->get_name()==name)
-                       {
-                               if(c[i])
-                               {
-                                       error(child,name+" was already defined in <composite>");
-                                       break;
-                               }
-
-                               xmlpp::Element::NodeList list = child->get_children();
-                               xmlpp::Element::NodeList::iterator iter;
-
-                               // Search for the first non-text XML element
-                               for(iter = list.begin(); iter != list.end(); ++iter)
-                                       if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                               if(iter==list.end())
-                               {
-                                       error(child,strprintf(_("<%s> is missing its contents"),name.c_str()));
-                                       break;
-                               }
-
-                               c[i]=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-
-                               if(!c[i])
-                               {
-                                       error((*iter),"Parse of "+name+" ValueNode failed");
-                                       break;
-                               }
-
-                               if(!value_node->set_link(i,c[i]))
-                               {
-                                       error(child,strprintf(_("<%s> has a bad value"),name.c_str()));
-                                       break;
-                               }                                       
-
-                               // \todo do a search for more elements and warn if they are found
-                               break;
-                       }
-               }
-               // somewhat of a hack, but it works
-               if(i==value_node->link_count()) error_unexpected_element(child,child->get_name());
-       }
-
-       switch(value_node->link_count())
-       {
-       case 1:
-               if(!value_node->get_link(0))
-               {
-                       error(element,"<composite> is missing parameters");
-                       return handle<ValueNode_Composite>();
-               }
-               break;
-       case 2:
-               if(!value_node->get_link(0) ||!value_node->get_link(1))
-               {
-                       error(element,"<composite> is missing parameters");
-                       return handle<ValueNode_Composite>();
-               }
-               break;
-       case 3:
-               if(!value_node->get_link(0) ||!value_node->get_link(1) ||!value_node->get_link(2))
-               {
-                       error(element,"<composite> is missing parameters");
-                       return handle<ValueNode_Composite>();
-               }
-               break;
-       case 4:
-               if(!value_node->get_link(0) ||!value_node->get_link(1) ||!value_node->get_link(2) ||!value_node->get_link(3))
-               {
-                       error(element,"<composite> is missing parameters");
-                       return handle<ValueNode_Composite>();
-               }
-               break;
-    }
-       return value_node;
-}
-
-// This will also parse a bline
-handle<ValueNode_DynamicList>
-CanvasParser::parse_dynamic_list(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="dynamic_list" || element->get_name()=="bline");
-       
-       const float fps(canvas?canvas->rend_desc().get_frame_rate():0);
-
-       if(!element->get_attribute("type"))
-       {
-               error(element,"Missing attribute \"type\" in <dynamic_list>");
-               return handle<ValueNode_DynamicList>();
-       }
-
-       ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value());
-
-       if(!type)
-       {
-               error(element,"Bad type in <dynamic_list>");
-               return handle<ValueNode_DynamicList>();
-       }
-
-       handle<ValueNode_DynamicList> value_node;
-       handle<ValueNode_BLine> bline_value_node;
-
-       if(element->get_name()=="bline")
-       {
-               value_node=bline_value_node=ValueNode_BLine::create();
-               if(element->get_attribute("loop"))
-               {
-                       String loop=element->get_attribute("loop")->get_value();
-                       if(loop=="true" || loop=="1" || loop=="TRUE" || loop=="True")
-                               bline_value_node->set_loop(true);
-                       else
-                               bline_value_node->set_loop(false);
-               }
-               
-       }               
-       else
-               value_node=ValueNode_DynamicList::create(type);
-
-       if(!value_node)
-       {
-               error(element,strprintf(_("Unable to create <dynamic_list>")));
-               return handle<ValueNode_DynamicList>();
-       }
-
-       value_node->set_root_canvas(canvas->get_root());
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               if(child->get_name()=="entry")
-               {
-                       ValueNode_DynamicList::ListEntry list_entry;
-                       
-                       // Parse begin/end waypoints
-                       {
-                               typedef sinfg::ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
-                               typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-
-                               String begin_sequence;
-                               String end_sequence;
-                               
-                               ActivepointList &timing_info(list_entry.timing_info);
-                               
-                               if(child->get_attribute("begin"))
-                                       begin_sequence=child->get_attribute("begin")->get_value();
-
-                               if(child->get_attribute("on"))
-                                       begin_sequence=child->get_attribute("on")->get_value();
-
-                               if(child->get_attribute("end"))
-                                       end_sequence=child->get_attribute("end")->get_value();
-
-                               if(child->get_attribute("off"))
-                                       end_sequence=child->get_attribute("off")->get_value();
-                               
-                               // clear out any auto-start
-                               if(!begin_sequence.empty())
-                                       timing_info.clear();
-                               
-                               //! \optimize
-                               while(!begin_sequence.empty())
-                               {
-                                       String::iterator iter(find(begin_sequence.begin(),begin_sequence.end(),','));
-                                       String timecode(begin_sequence.begin(), iter);                                          
-                                       int priority=0;
-                                       
-                                       // If there is a priority, then grab it and remove
-                                       // it from the timecode
-                                       if(timecode[0]=='p')
-                                       {
-                                               //priority=timecode[1]-'0';
-                                               //timecode=String(timecode.begin()+3,timecode.end());
-                                               int space=timecode.find_first_of(' ');
-                                               priority=atoi(String(timecode,1,space-1).c_str());
-                                               timecode=String(timecode.begin()+space+1,timecode.end());
-                                               //sinfg::info("priority: %d      timecode: %s",priority,timecode.c_str());
-                                       }
-                                       
-                                       timing_info.push_back(
-                                               Activepoint(
-                                                       Time(
-                                                               timecode,
-                                                               fps
-                                                       ),
-                                                       true,   // Mark as a "on" activepoint
-                                                       priority
-                                               )
-                                       );
-                                       
-                                       if(iter==begin_sequence.end())
-                                               begin_sequence.clear();
-                                       else
-                                               begin_sequence=String(iter+1,begin_sequence.end());
-                               }
-
-                               //! \optimize
-                               while(!end_sequence.empty())
-                               {
-                                       String::iterator iter(find(end_sequence.begin(),end_sequence.end(),','));
-                                       String timecode(end_sequence.begin(),   iter);                                          
-                                       int priority=0;
-                                       
-                                       // If there is a priority, then grab it and remove
-                                       // it from the timecode
-                                       if(timecode[0]=='p')
-                                       {
-                                               //priority=timecode[1]-'0';
-                                               //timecode=String(timecode.begin()+3,timecode.end());
-                                               int space=timecode.find_first_of(' ');
-                                               priority=atoi(String(timecode,1,space-1).c_str());
-                                               timecode=String(timecode.begin()+space+1,timecode.end());
-                                               //sinfg::info("priority: %d      timecode: %s",priority,timecode.c_str());
-                                       }
-                               
-                                       timing_info.push_back(
-                                               Activepoint(
-                                                       Time(
-                                                               timecode,
-                                                               fps
-                                                       ),
-                                                       false,  // Mark as a "off" activepoint
-                                                       priority
-                                               )
-                                       );
-                                       if(iter==end_sequence.end())
-                                               end_sequence.clear();
-                                       else
-                                               end_sequence=String(iter+1,end_sequence.end());
-                               }
-                               
-                               timing_info.sort();
-                       }
-
-                       if(child->get_attribute("use"))
-                       {
-                               string id=child->get_attribute("use")->get_value();
-                               try
-                               {
-                                       list_entry.value_node=canvas->surefind_value_node(id);
-                               }
-                               catch(Exception::IDNotFound)
-                               {
-                                       error(child,"\"use\" attribute in <entry> references unknown ID -- "+id);
-                                       continue;
-                               }
-                       }
-                       else
-                       {
-                               xmlpp::Element::NodeList list = child->get_children();
-                               xmlpp::Element::NodeList::iterator iter;
-
-                               // Search for the first non-text XML element
-                               for(iter = list.begin(); iter != list.end(); ++iter)
-                                       if(dynamic_cast<xmlpp::Element*>(*iter)) break;
-
-                               if(iter==list.end())
-                               {
-                                       error(child,strprintf(_("<entry> is missing its contents or missing \"use\" element")));
-                                       continue;
-                               }
-
-                               list_entry.value_node=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-
-                               if(!list_entry.value_node)
-                                       error((*iter),"Parse of ValueNode failed");
-
-                               // \todo do a search for more elements and warn if they are found
-
-                       }
-
-                       value_node->add(list_entry);
-                       value_node->set_link(value_node->link_count()-1,list_entry.value_node);
-               }
-               else
-                       error_unexpected_element(child,child->get_name());
-       }
-       return value_node;
-}
-
-handle<ValueNode>
-CanvasParser::parse_value_node(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       handle<ValueNode> value_node;
-       assert(element);
-       
-       GUID guid;
-       
-       if(element->get_attribute("guid"))
-       {
-               guid=GUID(element->get_attribute("guid")->get_value())^canvas->get_root()->get_guid();
-               value_node=guid_cast<ValueNode>(guid);
-               if(value_node)
-                       return value_node;
-       }
-       
-       // If ValueBase::ident_type() recognises the name, then we know it's a ValueBase
-       if(element->get_name()!="canvas" && ValueBase::ident_type(element->get_name()))
-       {       
-               ValueBase data=parse_value(element,canvas);
-
-               if(!data.is_valid())
-               {
-                       error(element,strprintf(_("Bad data in <%s>"),element->get_name().c_str()));
-                       return value_node;
-               }
-
-               // We want to convert this ValueBase into a
-               // ValueNode_Const. That way, we can treat the
-               // ID like any other Datanode. Think of this
-               // as a shorthand for creating constant ValueNodes.
-
-               value_node=ValueNode_Const::create(data);
-       }
-       else
-       if(element->get_name()=="hermite" || element->get_name()=="animated")
-               value_node=parse_animated(element,canvas);
-       else
-       if(element->get_name()=="subtract")
-               value_node=parse_subtract(element,canvas);
-       else
-       if(element->get_name()=="composite")
-               value_node=parse_composite(element,canvas);
-       else
-       if(element->get_name()=="dynamic_list")
-               value_node=parse_dynamic_list(element,canvas);
-       else
-       if(element->get_name()=="bline") // This is not a typo. The dynamic list parser will parse a bline.
-               value_node=parse_dynamic_list(element,canvas);
-       else
-       if(element->get_name()=="timed_swap")
-               value_node=parse_timedswap(element,canvas);
-       else
-       if(LinkableValueNode::book().count(element->get_name()))        
-               value_node=parse_linkable_value_node(element,canvas);
-       else
-       if(element->get_name()=="canvas")
-               value_node=ValueNode_Const::create(parse_canvas(element,canvas,true));
-       else
-       {
-               error_unexpected_element(element,element->get_name());
-               error(element, "Expected a ValueNode");
-       }
-
-       
-       value_node->set_root_canvas(canvas->get_root());
-       
-       
-       // If we were successful, and our element has
-       // an ID attribute, go ahead and add it to the
-       // value_node list
-       if(value_node && element->get_attribute("id"))
-       {
-               string id=element->get_attribute("id")->get_value();
-
-               //value_node->set_id(id);
-
-               // If there is already a value_node in the list
-               // with the same ID, then that is an error
-               try { canvas->add_value_node(value_node,id); }
-               catch(Exception::BadLinkName)
-               {
-                       warning(element,strprintf(_("Bad ID \"%s\""),id.c_str()));
-                       return value_node;                      
-               }
-               catch(Exception::IDAlreadyExists)
-               {
-                       error(element,strprintf(_("Duplicate ID \"%s\""),id.c_str()));
-                       return value_node;
-               }
-               catch(...)
-               {
-                       error(element,strprintf(_("Unknown Exception thrown when adding ValueNode \"%s\""),id.c_str()));
-                       throw;
-               }
-       }
-       value_node->set_guid(guid);
-       return value_node;
-}
-
-void
-CanvasParser::parse_canvas_defs(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       assert(element->get_name()=="defs");
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               if(child->get_name()=="canvas")
-                       parse_canvas(child, canvas);
-               else
-                       parse_value_node(child,canvas);
-       }
-}
-
-Layer::Handle
-CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas)
-{
-       
-       assert(element->get_name()=="layer");
-       Layer::Handle layer;
-
-       if(!element->get_attribute("type"))
-       {
-               error(element,_("Missing \"type\" attribute to \"layer\" element"));
-               return Layer::Handle();
-       }
-
-       layer=Layer::create(element->get_attribute("type")->get_value());
-       layer->set_canvas(canvas);
-
-       if(element->get_attribute("group"))
-       {
-               layer->add_to_group(
-                       element->get_attribute("group")->get_value()
-               );
-       }
-
-       // Handle the version attribute
-       if(element->get_attribute("version"))
-       {
-               String version(element->get_attribute("version")->get_value());
-               if(version>layer->get_version())
-                       warning(element,_("Installed layer version is larger than layer version in file"));
-               if(version!=layer->get_version())
-                       layer->set_version(version);
-       }
-
-       // Handle the description
-       if(element->get_attribute("desc"))
-               layer->set_description(element->get_attribute("desc")->get_value());
-       
-       if(element->get_attribute("active"))
-               layer->set_active(element->get_attribute("active")->get_value()=="false"?false:true);
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(!child)
-                       continue;
-               else
-               if(child->get_name()=="name")
-                       warning(child,_("<name> entry for <layer> is not yet supported. Ignoring..."));
-               else
-               if(child->get_name()=="desc")
-                       warning(child,_("<desc> entry for <layer> is not yet supported. Ignoring..."));
-               else
-               if(child->get_name()=="param")
-               {
-                       xmlpp::Element::NodeList list = child->get_children();
-
-                       if(!child->get_attribute("name"))
-                       {
-                               error(child,_("Missing \"name\" attribute for <param>."));
-                               continue;
-                       }
-
-                       String param_name=child->get_attribute("name")->get_value();
-
-                       if(child->get_attribute("use"))
-                       {
-                               // If the "use" attribute is used, then the
-                               // element should be empty. Warn the user if
-                               // we find otherwise.
-                               if(!list.empty())
-                                       warning(child,_("Found \"use\" attribute for <param>, but it wasn't empty. Ignoring contents..."));
-
-                               String str=     child->get_attribute("use")->get_value();
-
-                               if(layer->get_param(param_name).get_type()==ValueBase::TYPE_CANVAS)
-                               {
-                                       if(!layer->set_param(param_name,canvas->surefind_canvas(str)))
-                                               error((*iter),_("Layer rejected canvas link"));
-                               }
-                               else
-                               try
-                               {
-                                       handle<ValueNode> value_node=canvas->surefind_value_node(str);
-
-                                       // Assign the value_node to the dynamic parameter list
-                                       layer->connect_dynamic_param(param_name,value_node);
-                       }
-                               catch(Exception::IDNotFound)
-                               {
-                                       error(child,strprintf(_("Unknown ID (%s) referenced in <param>"),str.c_str()));
-                               }
-
-                               continue;
-                       }
-
-                       xmlpp::Element::NodeList::iterator iter;
-
-                       // Search for the first non-text XML element
-                       for(iter = list.begin(); iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter))
-                                       break;
-                               //if(!(!dynamic_cast<xmlpp::Element*>(*iter) && (*iter)->get_name()=="text"||(*iter)->get_name()=="comment"   )) break;
-
-                       if(iter==list.end())
-                       {
-                               error(child,_("<param> is either missing its contents, or missing a \"use\" attribute."));
-                               continue;
-                       }
-
-                       // If we recognise the element name as a
-                       // ValueBase, then treat is at one
-                       if(/*(*iter)->get_name()!="canvas" && */ValueBase::ident_type((*iter)->get_name()) && !dynamic_cast<xmlpp::Element*>(*iter)->get_attribute("guid"))
-                       {
-                               ValueBase data=parse_value(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-
-                               if(!data.is_valid())
-                               {
-                                       error((*iter),_("Bad data for <param>"));
-                                       continue;
-                               }
-
-                               // Set the layer's parameter, and make sure that
-                               // the layer liked it
-                               if(!layer->set_param(param_name,data))
-                               {
-                                       warning((*iter),_("Layer rejected value for <param>"));
-                                       continue;
-                               }
-                       }
-                       else    // ... otherwise, we assume that it is a ValueNode
-                       {
-                               handle<ValueNode> value_node=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
-
-                               if(!value_node)
-                               {
-                                       error((*iter),_("Bad data for <param>"));
-                                       continue;
-                               }
-
-                               // Assign the value_node to the dynamic parameter list
-                               layer->connect_dynamic_param(param_name,value_node);
-                       }
-
-                       // Warn if there is trash after the param value
-                       for(iter++; iter != list.end(); ++iter)
-                               if(dynamic_cast<xmlpp::Element*>(*iter))
-                                       warning((*iter),strprintf(_("Unexpected element <%s> after <param> data, ignoring..."),(*iter)->get_name().c_str()));
-                       continue;                               
-               }
-               else
-                       error_unexpected_element(child,child->get_name());
-       }
-
-       layer->reset_version();
-       return layer;
-}
-
-Canvas::Handle
-CanvasParser::parse_canvas(xmlpp::Element *element,Canvas::Handle parent,bool inline_, String filename)
-{
-       
-       if(element->get_name()!="canvas")
-       {
-               error_unexpected_element(element,element->get_name(),"canvas");
-               return Canvas::Handle();
-       }
-       Canvas::Handle canvas;
-
-       
-       
-       if(parent && (element->get_attribute("id") || inline_))
-       {
-               if(inline_)
-               {
-                       canvas=Canvas::create_inline(parent);
-               }
-               else
-               {
-                       try
-                       {
-                               canvas=parent->find_canvas(element->get_attribute("id")->get_value());
-                       }
-                       catch(...)
-                       {
-                               canvas=parent->new_child_canvas(element->get_attribute("id")->get_value());
-                       }
-               }
-               canvas->rend_desc().clear_flags();
-       }
-       else
-       {
-               canvas=Canvas::create();
-               if(filename=="/dev/stdin")
-                       canvas->set_file_name("./stdin.sif");
-               else
-                       canvas->set_file_name(filename);
-               canvas->rend_desc().clear_flags();
-       }
-
-       if(element->get_attribute("guid"))
-       {
-               GUID guid(element->get_attribute("guid")->get_value());
-               if(guid_cast<Canvas>(guid))
-                       return guid_cast<Canvas>(guid);
-               else
-                       canvas->set_guid(guid);
-       }
-
-       if(element->get_attribute("width"))
-               canvas->rend_desc().set_w(atoi(element->get_attribute("width")->get_value().c_str()));
-
-       if(element->get_attribute("height"))
-               canvas->rend_desc().set_h(atoi(element->get_attribute("height")->get_value().c_str()));
-
-       if(element->get_attribute("xres"))
-               canvas->rend_desc().set_x_res(atof(element->get_attribute("xres")->get_value().c_str()));
-
-       if(element->get_attribute("yres"))
-               canvas->rend_desc().set_y_res(atof(element->get_attribute("yres")->get_value().c_str()));
-
-       
-       if(element->get_attribute("fps"))
-               canvas->rend_desc().set_frame_rate(atof(element->get_attribute("fps")->get_value().c_str()));
-
-       if(element->get_attribute("start-time"))
-               canvas->rend_desc().set_time_start(Time(element->get_attribute("start-time")->get_value(),canvas->rend_desc().get_frame_rate()));
-
-       if(element->get_attribute("begin-time"))
-               canvas->rend_desc().set_time_start(Time(element->get_attribute("begin-time")->get_value(),canvas->rend_desc().get_frame_rate()));
-
-       if(element->get_attribute("end-time"))
-               canvas->rend_desc().set_time_end(Time(element->get_attribute("end-time")->get_value(),canvas->rend_desc().get_frame_rate()));
-
-       if(element->get_attribute("antialias"))
-               canvas->rend_desc().set_antialias(atoi(element->get_attribute("antialias")->get_value().c_str()));
-
-       if(element->get_attribute("view-box"))
-       {
-               string values=element->get_attribute("view-box")->get_value();
-               Vector
-                       tl,
-                       br;
-               tl[0]=atof(string(values.data(),values.find(' ')).c_str());
-               values=string(values.begin()+values.find(' ')+1,values.end());
-               tl[1]=atof(string(values.data(),values.find(' ')).c_str());
-               values=string(values.begin()+values.find(' ')+1,values.end());
-               br[0]=atof(string(values.data(),values.find(' ')).c_str());
-               values=string(values.begin()+values.find(' ')+1,values.end());
-               br[1]=atof(values.c_str());
-
-               canvas->rend_desc().set_tl(tl);
-               canvas->rend_desc().set_br(br);
-       }
-
-       if(element->get_attribute("bgcolor"))
-       {
-               string values=element->get_attribute("bgcolor")->get_value();
-               Color bg;
-               
-               bg.set_r(atof(string(values.data(),values.find(' ')).c_str()));
-               values=string(values.begin()+values.find(' ')+1,values.end());
-               
-               bg.set_g(atof(string(values.data(),values.find(' ')).c_str()));
-               values=string(values.begin()+values.find(' ')+1,values.end());
-               
-               bg.set_b(atof(string(values.data(),values.find(' ')).c_str()));
-               values=string(values.begin()+values.find(' ')+1,values.end());
-               
-               bg.set_a(atof(values.c_str()));
-
-               canvas->rend_desc().set_bg_color(bg);
-       }
-
-       if(element->get_attribute("focus"))
-       {
-               string values=element->get_attribute("focus")->get_value();
-               Vector focus;
-
-               focus[0]=atof(string(values.data(),values.find(' ')).c_str());
-               values=string(values.begin()+values.find(' ')+1,values.end());
-               focus[1]=atof(values.c_str());
-
-               canvas->rend_desc().set_focus(focus);
-       }
-
-       canvas->rend_desc().set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
-
-       xmlpp::Element::NodeList list = element->get_children();
-       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-       {
-               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
-               if(child)
-               {
-                       if(child->get_name()=="defs")
-                       {
-                               if(canvas->is_inline())
-                                       error(child,_("Inline canvas cannot have a <defs> section"));
-                               parse_canvas_defs(child, canvas);
-                       }
-                       else
-                       if(child->get_name()=="keyframe")
-                       {
-                               if(canvas->is_inline())
-                               {
-                                       warning(child,_("Inline canvas cannot have keyframes"));
-                                       continue;
-                               }
-
-                               canvas->keyframe_list().add(parse_keyframe(child,canvas));
-                               canvas->keyframe_list().sync();
-                       }
-                       else
-                       if(child->get_name()=="meta")
-                       {
-                               if(canvas->is_inline())
-                               {
-                                       warning(child,_("Inline canvases cannot have metadata"));
-                                       continue;
-                               }
-                               
-                               String name,content;
-                               
-                               if(!child->get_attribute("name"))
-                               {
-                                       warning(child,_("<meta> must have a name"));
-                                       continue;
-                               }
-
-                               if(!child->get_attribute("content"))
-                               {
-                                       warning(child,_("<meta> must have content"));
-                                       continue;
-                               }
-                                       
-                               canvas->set_meta_data(child->get_attribute("name")->get_value(),child->get_attribute("content")->get_value());
-                       }
-                       else if(child->get_name()=="name")
-                       {
-                               xmlpp::Element::NodeList list = child->get_children();
-       
-                               // If we don't have any name, warn
-                               if(list.empty())
-                                       warning(child,_("blank \"name\" entitity"));
-       
-                               string tmp;
-                               for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-                                       if(dynamic_cast<xmlpp::TextNode*>(*iter))tmp+=dynamic_cast<xmlpp::TextNode*>(*iter)->get_content();
-                               canvas->set_name(tmp);
-                       }
-                       else
-                       if(child->get_name()=="desc")
-                       {
-                               
-                               xmlpp::Element::NodeList list = child->get_children();
-       
-                               // If we don't have any description, warn
-                               if(list.empty())
-                                       warning(child,_("blank \"desc\" entitity"));
-       
-                               string tmp;
-                               for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-                                       if(dynamic_cast<xmlpp::TextNode*>(*iter))tmp+=dynamic_cast<xmlpp::TextNode*>(*iter)->get_content();
-                               canvas->set_description(tmp);
-                       }
-                       else
-                       if(child->get_name()=="author")
-                       {
-                               
-                               xmlpp::Element::NodeList list = child->get_children();
-       
-                               // If we don't have any description, warn
-                               if(list.empty())
-                                       warning(child,_("blank \"author\" entitity"));
-       
-                               string tmp;
-                               for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
-                                       if(dynamic_cast<xmlpp::TextNode*>(*iter))tmp+=dynamic_cast<xmlpp::TextNode*>(*iter)->get_content();
-                               canvas->set_author(tmp);
-                       }
-                       else
-                       if(child->get_name()=="layer")
-                       {
-                               //if(canvas->is_inline())
-                               //      canvas->push_front(parse_layer(child,canvas->parent()));
-                               //else
-                                       canvas->push_front(parse_layer(child,canvas));
-                       }
-                       else
-                               error_unexpected_element(child,child->get_name());
-               }
-//             else
-//             if((child->get_name()=="text"||child->get_name()=="comment") && child->has_child_text())
-//                     continue;
-       }
-
-       if(canvas->value_node_list().placeholder_count())
-       {
-               error(element,strprintf(_("Canvas %s has undefined ValueNodes"),canvas->get_id().c_str()));     
-       }
-
-       return canvas;
-}
-
-Canvas::Handle
-CanvasParser::parse_from_file(const String &file)
-{
-       return parse_from_file_as(file,file);
-}
-
-Canvas::Handle
-CanvasParser::parse_from_file_as(const String &file,const String &as)
-{
-       CHECK_EXPIRE_TIME();
-       try
-       {
-               if(get_open_canvas_map().count(etl::absolute_path(as)))
-                       return get_open_canvas_map()[etl::absolute_path(as)];
-
-               filename=as;
-               total_warnings_=0;
-               xmlpp::DomParser parser(file);
-               if(parser)
-               {
-                       Canvas::Handle canvas(parse_canvas(parser.get_document()->get_root_node(),0,false,as));
-                       get_open_canvas_map()[etl::absolute_path(as)]=canvas;
-                       canvas->signal_deleted().connect(sigc::bind(sigc::ptr_fun(_remove_from_open_canvas_map),canvas.get()));
-                       canvas->signal_file_name_changed().connect(sigc::bind(sigc::ptr_fun(_canvas_file_name_changed),canvas.get()));
-
-
-
-                       const ValueNodeList& value_node_list(canvas->value_node_list());
-                       
-                       again:
-                       ValueNodeList::const_iterator iter;
-                       for(iter=value_node_list.begin();iter!=value_node_list.end();++iter)
-                       {
-                               ValueNode::Handle value_node(*iter);
-                               if(value_node->is_exported() && value_node->get_id().find("Unnamed")==0)
-                               {
-                                       canvas->remove_value_node(value_node);
-                                       goto again;
-                               }
-                       }
-
-                       return canvas;
-               }
-       }
-       catch(Exception::BadLinkName) { sinfg::error("BadLinkName Thrown"); }
-       catch(Exception::BadType) { sinfg::error("BadType Thrown"); }
-       catch(Exception::FileNotFound) { sinfg::error("FileNotFound Thrown"); }
-       catch(Exception::IDNotFound) { sinfg::error("IDNotFound Thrown"); }
-       catch(Exception::IDAlreadyExists) { sinfg::error("IDAlreadyExists Thrown"); }
-       catch(const std::exception& ex)
-       {
-               sinfg::error("Standard Exception: "+String(ex.what()));
-               return Canvas::Handle();
-       }
-       catch(const String& str)
-       {
-               cerr<<str<<endl;
-               //      sinfg::error(str);
-               return Canvas::Handle();
-       }
-       return Canvas::Handle();
-}
-
-Canvas::Handle
-CanvasParser::parse_from_string(const String &data)
-{
-       CHECK_EXPIRE_TIME();
-
-       try
-       {
-               filename=_("<INTERNAL>");
-               total_warnings_=0;
-               xmlpp::DomParser parser;
-               parser.parse_memory(data);
-               xmlpp::Element *root=parser.get_document()->get_root_node();
-               if(parser)
-               {
-                       Canvas::Handle canvas(parse_canvas(root));
-                       canvas->signal_deleted().connect(sigc::bind(sigc::ptr_fun(_remove_from_open_canvas_map),canvas.get()));
-                       canvas->signal_file_name_changed().connect(sigc::bind(sigc::ptr_fun(_canvas_file_name_changed),canvas.get()));
-
-                       const ValueNodeList& value_node_list(canvas->value_node_list());
-                       again:
-                       ValueNodeList::const_iterator iter;
-                       for(iter=value_node_list.begin();iter!=value_node_list.end();++iter)
-                       {
-                               ValueNode::Handle value_node(*iter);
-                               if(value_node->is_exported() && value_node->get_id().find("Unnamed")==0)
-                               {
-                                       canvas->remove_value_node(value_node);
-                                       goto again;
-                               }
-                       }
-                       
-                       return canvas;
-               }
-       }
-       catch(Exception::BadLinkName) { sinfg::error("BadLinkName Thrown"); }
-       catch(Exception::BadType) { sinfg::error("BadType Thrown"); }
-       catch(Exception::FileNotFound) { sinfg::error("FileNotFound Thrown"); }
-       catch(Exception::IDNotFound) { sinfg::error("IDNotFound Thrown"); }
-       catch(Exception::IDAlreadyExists) { sinfg::error("IDAlreadyExists Thrown"); }
-       catch(const std::exception& ex)
-       {
-               sinfg::error("Standard Exception: "+String(ex.what()));
-               return Canvas::Handle();
-       }
-       catch(const String& str)
-       {
-               cerr<<str<<endl;
-               //      sinfg::error(str);
-               return Canvas::Handle();
-       }
-       return Canvas::Handle();
-}
diff --git a/synfig-core/trunk/src/sinfg/loadcanvas.h b/synfig-core/trunk/src/sinfg/loadcanvas.h
deleted file mode 100644 (file)
index f27ace1..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file loadcanvas.h
-**     \brief writeme
-**
-**     $Id: loadcanvas.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_LOADCANVAS_H
-#define __SINFG_LOADCANVAS_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "string.h"
-#include "canvas.h"
-#include "valuenode.h"
-#include "vector.h"
-#include "value.h"
-#include "valuenode_subtract.h"
-#include "valuenode_animated.h"
-#include "valuenode_composite.h"
-#include "valuenode_const.h"
-#include "valuenode_linear.h"
-#include "valuenode_dynamiclist.h"
-#include "valuenode_reference.h"
-#include "valuenode_timedswap.h"
-#include "keyframe.h"
-#include "guid.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace xmlpp { class Node; class Element; };
-
-namespace sinfg {
-
-/*!    \class CanvasParser
-**     \todo writeme
-*/
-class CanvasParser
-{
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-private:
-
-       int max_warnings_;
-
-    int total_warnings_;
-
-    int total_errors_;
-
-       bool allow_errors_;
-
-       String filename;
-
-       String path;
-
-       GUID guid_;
-
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-public:
-
-       CanvasParser():
-               max_warnings_   (1000),
-               total_warnings_ (0),
-               total_errors_   (0),
-               allow_errors_   (false)
-       { }
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //! \todo writeme
-       CanvasParser &set_allow_errors(bool x) { allow_errors_=x; return *this; }
-
-       //! Sets the maximum number of warnings before a fatal error is thrown
-       CanvasParser &set_max_warnings(int i) { max_warnings_=i; return *this; }
-
-       //! Returns the maximum number of warnings before a fatal_error is thrown
-       int get_max_warnings() { return max_warnings_; }
-
-       //! Returns the number of errors in the last parse
-       int error_count()const { return total_errors_; }
-
-       //! Returns the number of warnings in the last parse
-       int warning_count()const { return total_warnings_; }
-
-       void set_path(const sinfg::String& x) { path=x; }
-
-       const sinfg::String& get_path()const { return path; }
-       
-       //! \todo writeme
-       Canvas::Handle parse_from_file(const String &filename);
-
-       Canvas::Handle parse_from_file_as(const String &filename,const String &as);
-
-       //! \todo writeme
-       Canvas::Handle parse_from_string(const String &data);
-
-private:
-
-       // Error/Warning handling functions
-
-       void error(xmlpp::Node *node,const String &text);
-       void fatal_error(xmlpp::Node *node,const String &text);
-       void warning(xmlpp::Node *node,const String &text);
-       void error_unexpected_element(xmlpp::Node *node,const String &got, const String &expected);
-       void error_unexpected_element(xmlpp::Node *node,const String &got);
-
-       // Parsing Functions
-
-       Canvas::Handle parse_canvas(xmlpp::Element *node,Canvas::Handle parent=0,bool inline_=false, String path=".");
-       void parse_canvas_defs(xmlpp::Element *node,Canvas::Handle canvas);
-       etl::handle<Layer> parse_layer(xmlpp::Element *node,Canvas::Handle canvas);
-       ValueBase parse_value(xmlpp::Element *node,Canvas::Handle canvas);
-       etl::handle<ValueNode> parse_value_node(xmlpp::Element *node,Canvas::Handle canvas);
-
-       // ValueBase Parsing Functions
-
-       Real parse_real(xmlpp::Element *node,Canvas::Handle canvas);
-       Time parse_time(xmlpp::Element *node,Canvas::Handle canvas);
-       int parse_integer(xmlpp::Element *node,Canvas::Handle canvas);
-       Vector parse_vector(xmlpp::Element *node,Canvas::Handle canvas);
-       Color parse_color(xmlpp::Element *node,Canvas::Handle canvas);
-       Angle parse_angle(xmlpp::Element *node,Canvas::Handle canvas);
-       String parse_string(xmlpp::Element *node,Canvas::Handle canvas);
-       bool parse_bool(xmlpp::Element *node,Canvas::Handle canvas);
-       Segment parse_segment(xmlpp::Element *node,Canvas::Handle canvas);
-       ValueBase parse_list(xmlpp::Element *node,Canvas::Handle canvas);
-       Gradient parse_gradient(xmlpp::Element *node,Canvas::Handle canvas);
-       BLinePoint parse_bline_point(xmlpp::Element *node,Canvas::Handle canvas);
-
-       Keyframe parse_keyframe(xmlpp::Element *node,Canvas::Handle canvas);
-
-       // ValueNode Parsing Functions
-
-       etl::handle<ValueNode_Animated> parse_animated(xmlpp::Element *node,Canvas::Handle canvas);
-       etl::handle<ValueNode_Subtract> parse_subtract(xmlpp::Element *node,Canvas::Handle canvas);
-       etl::handle<ValueNode_Animated> parse_timedswap(xmlpp::Element *node,Canvas::Handle canvas);
-       etl::handle<LinkableValueNode> parse_linkable_value_node(xmlpp::Element *node,Canvas::Handle canvas);
-       etl::handle<ValueNode_Composite> parse_composite(xmlpp::Element *node,Canvas::Handle canvas);
-       etl::handle<ValueNode_DynamicList> parse_dynamic_list(xmlpp::Element *node,Canvas::Handle canvas);
-
-}; // END of CanvasParser
-
-/* === E X T E R N S ======================================================= */
-
-//!    Loads a canvas from \a filename
-/*!    \return The Canvas's handle on success, an empty handle on failure */
-extern Canvas::Handle open_canvas(const String &filename);
-extern Canvas::Handle open_canvas_as(const String &filename,const String &as);
-
-//! Retrieves a Canvas from a string in XML format
-extern Canvas::Handle string_to_canvas(const String &data);
-
-std::map<sinfg::String, etl::loose_handle<Canvas> >& get_open_canvas_map();
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/main.cpp b/synfig-core/trunk/src/sinfg/main.cpp
deleted file mode 100644 (file)
index b253c3b..0000000
+++ /dev/null
@@ -1,437 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file main.cpp
-**     \brief \writeme
-**
-**     $Id: main.cpp,v 1.3 2005/01/10 07:40:26 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-//#define SINFG_NO_ANGLE
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include <iostream>
-#include "version.h"
-#include "general.h"
-#include "module.h"
-#include <cstdlib>
-#include <ltdl.h>
-#include <stdexcept>
-#include "target.h"
-#include <ETL/stringf>
-#include "listimporter.h"
-#include "color.h"
-#include "vector.h"
-#include <fstream>
-#include "layer.h"
-#include "valuenode.h"
-
-#include "main.h"
-#include "loadcanvas.h"
-
-#include "guid.h"
-
-#include "mutex.h"
-
-#ifdef DEATH_TIME
-#include <time.h>
-#endif
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define MODULE_LIST_FILENAME   "sinfg_modules.cfg"
-
-/* === S T A T I C S ======================================================= */
-
-static etl::reference_counter sinfg_ref_count_(0);
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-
-
-
-
-
-
-
-const char *
-sinfg::get_version()
-{
-#ifdef VERSION
-       return VERSION;
-#else
-       return "Unknown";
-#endif
-}
-
-const char *
-sinfg::get_build_date()
-{
-       return __DATE__;
-}
-
-const char *
-sinfg::get_build_time()
-{
-       return __TIME__;
-}
-
-extern const char *get_build_time();
-
-bool
-sinfg::check_version_(int version,int vec_size, int color_size,int canvas_size,int layer_size)
-{
-       bool ret=true;
-
-       CHECK_EXPIRE_TIME();
-       
-       if(version!=SINFG_LIBRARY_VERSION)
-       {
-               sinfg::error(_("API Version mismatch (LIB:%d, PROG:%d)"),SINFG_LIBRARY_VERSION,version);
-               ret=false;
-       }
-       if(vec_size!=sizeof(Vector))
-       {
-               sinfg::error(_("Size of Vector mismatch (app:%d, lib:%d)"),vec_size,sizeof(Vector));
-               ret=false;
-       }
-       if(color_size!=sizeof(Color))
-       {
-               sinfg::error(_("Size of Color mismatch (app:%d, lib:%d)"),color_size,sizeof(Color));
-               ret=false;
-       }
-       if(canvas_size!=sizeof(Canvas))
-       {
-               sinfg::error(_("Size of Canvas mismatch (app:%d, lib:%d)"),canvas_size,sizeof(Canvas));
-               ret=false;
-       }
-       if(layer_size!=sizeof(Layer))
-       {
-               sinfg::error(_("Size of Layer mismatch (app:%d, lib:%d)"),layer_size,sizeof(Layer));
-               ret=false;
-       }
-       
-       return ret;
-}
-
-static void broken_pipe_signal (int sig)  {
-       sinfg::warning("Broken Pipe...");
-}
-
-bool retrieve_modules_to_load(String filename,std::list<String> &modules_to_load)
-{
-       if(filename=="standard")
-       {
-               return false;
-/*
-               if(find(modules_to_load.begin(),modules_to_load.end(),"trgt_bmp")==modules_to_load.end())
-                       modules_to_load.push_back("trgt_bmp");
-               if(find(modules_to_load.begin(),modules_to_load.end(),"trgt_gif")==modules_to_load.end())
-                       modules_to_load.push_back("trgt_gif");
-               if(find(modules_to_load.begin(),modules_to_load.end(),"trgt_dv")==modules_to_load.end())
-                       modules_to_load.push_back("trgt_dv");
-               if(find(modules_to_load.begin(),modules_to_load.end(),"mod_ffmpeg")==modules_to_load.end())
-                       modules_to_load.push_back("mod_ffmpeg");
-               if(find(modules_to_load.begin(),modules_to_load.end(),"mod_imagemagick")==modules_to_load.end())
-                       modules_to_load.push_back("mod_imagemagick");
-               if(find(modules_to_load.begin(),modules_to_load.end(),"lyr_std")==modules_to_load.end())
-                       modules_to_load.push_back("lyr_std");
-               if(find(modules_to_load.begin(),modules_to_load.end(),"lyr_freetype")==modules_to_load.end())
-                       modules_to_load.push_back("lyr_freetype");
-#ifdef HAVE_LIBPNG
-               if(find(modules_to_load.begin(),modules_to_load.end(),"trgt_png")==modules_to_load.end())
-                       modules_to_load.push_back("trgt_png");
-#endif
-#ifdef HAVE_OPENEXR
-               if(find(modules_to_load.begin(),modules_to_load.end(),"mod_openexr")==modules_to_load.end())
-                       modules_to_load.push_back("mod_openexr");
-#endif
-*/
-       }
-       else
-       {
-               std::ifstream file(filename.c_str());
-               if(!file)
-               {
-               //      warning("Cannot open "+filename);
-                       return false;
-               }
-               while(file)
-               {
-                       String modulename;
-                       getline(file,modulename);
-                       if(!modulename.empty() && find(modules_to_load.begin(),modules_to_load.end(),modulename)==modules_to_load.end())
-                               modules_to_load.push_back(modulename);                  
-               }
-       }
-
-       
-       
-       return true;
-}
-
-
-
-
-
-sinfg::Main::Main(const sinfg::String& basepath,ProgressCallback *cb):
-       ref_count_(sinfg_ref_count_)
-{
-       if(ref_count_.count())
-               return;
-
-       sinfg_ref_count_.reset();
-       ref_count_=sinfg_ref_count_;
-       
-       // Add initialization after this point
-
-
-       CHECK_EXPIRE_TIME();
-
-       String prefix=basepath+"/..";
-       int i;
-#ifdef _DEBUG
-       std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
-#endif
-       
-#if defined(HAVE_SIGNAL_H) && defined(SIGPIPE)
-       signal(SIGPIPE, broken_pipe_signal);
-#endif
-       
-       //_config_search_path=new vector"string.h"();
-       
-       // Init the subsystems
-       if(cb)cb->amount_complete(0, 100);
-       if(cb)cb->task(_("Starting Subsystem \"Modules\""));
-       if(!Module::subsys_init(prefix))
-               throw std::runtime_error(_("Unable to initialize subsystem \"Module\""));
-
-       if(cb)cb->task(_("Starting Subsystem \"Layers\""));
-       if(!Layer::subsys_init())
-       {
-               Module::subsys_stop();
-               throw std::runtime_error(_("Unable to initialize subsystem \"Layers\""));
-       }
-
-       if(cb)cb->task(_("Starting Subsystem \"Targets\""));
-       if(!Target::subsys_init())
-       {
-               Layer::subsys_stop();
-               Module::subsys_stop();
-               throw std::runtime_error(_("Unable to initialize subsystem \"Targets\""));
-       }
-       
-       if(cb)cb->task(_("Starting Subsystem \"Importers\""));
-       if(!Importer::subsys_init())
-       {
-               Target::subsys_stop();
-               Layer::subsys_stop();
-               Module::subsys_stop();
-               throw std::runtime_error(_("Unable to initialize subsystem \"Importers\""));
-       }
-
-       if(cb)cb->task(_("Starting Subsystem \"ValueNodes\""));
-       if(!ValueNode::subsys_init())
-       {
-               Importer::subsys_stop();
-               Target::subsys_stop();
-               Layer::subsys_stop();
-               Module::subsys_stop();
-               throw std::runtime_error(_("Unable to initialize subsystem \"ValueNodes\""));
-       }
-       
-       // Load up the list importer
-       Importer::book()[String("lst")]=ListImporter::create;
-               
-
-       
-       // Load up the modules  
-       std::list<String> modules_to_load;
-       std::vector<String> locations;
-       
-       if(!getenv("SYNFIG_MODULE_LIST"))
-       {
-               locations.push_back("standard");
-               locations.push_back("./"MODULE_LIST_FILENAME);  //1
-               locations.push_back("../etc/"MODULE_LIST_FILENAME);     //1
-               locations.push_back("~/.sinfg/"MODULE_LIST_FILENAME); //2
-               locations.push_back(prefix+"/etc/"+MODULE_LIST_FILENAME); //3
-               locations.push_back("/usr/local/etc/"MODULE_LIST_FILENAME);
-       #ifdef SYSCONFDIR
-               locations.push_back(SYSCONFDIR"/"MODULE_LIST_FILENAME);
-       #endif
-       #ifdef __APPLE__
-               locations.push_back("/Library/Frameworks/synfig.framework/Resources/"MODULE_LIST_FILENAME);
-               locations.push_back("/Library/Synfig/"MODULE_LIST_FILENAME);
-               locations.push_back("~/Library/Synfig/"MODULE_LIST_FILENAME);
-       #endif
-       #ifdef WIN32
-               locations.push_back("C:\\Program Files\\Synfig\\etc\\"MODULE_LIST_FILENAME);
-       #endif
-       }
-       else
-       {
-               locations.push_back(getenv("SYNFIG_MODULE_LIST"));
-       }
-/*     
-       const char *locations[]=
-       {
-               "standard",     //0
-               "./"MODULE_LIST_FILENAME,       //1
-               "../etc/"MODULE_LIST_FILENAME,  //1
-               "~/.sinfg/"MODULE_LIST_FILENAME, //2
-               "/usr/local/lib/sinfg/modules/"MODULE_LIST_FILENAME, //3
-               "/usr/local/etc/"MODULE_LIST_FILENAME,
-#ifdef SYSCONFDIR
-               SYSCONFDIR"/"MODULE_LIST_FILENAME,
-#endif
-#ifdef __APPLE__
-               "/Library/Frameworks/sinfg.framework/Resources/"MODULE_LIST_FILENAME,
-               "/Library/SINFG/"MODULE_LIST_FILENAME,
-               "~/Library/SINFG/"MODULE_LIST_FILENAME,
-#endif
-#ifdef WIN32
-               "C:\\Program Files\\SINFG\\etc\\"MODULE_LIST_FILENAME,
-#endif
-       };
-*/
-       
-       for(i=0;i<locations.size();i++)
-               if(retrieve_modules_to_load(locations[i],modules_to_load))
-                       if(cb)cb->task(strprintf(_("Loading modules from %s"),locations[i].c_str()));
-       
-       std::list<String>::iterator iter;
-       
-       for(i=0,iter=modules_to_load.begin();iter!=modules_to_load.end();++iter,i++)
-       {
-               Module::Register(*iter,cb);
-               if(cb)cb->amount_complete((i+1)*100,modules_to_load.size()*100);
-       }
-       
-//     load_modules(cb);
-       
-       CHECK_EXPIRE_TIME();
-
-       
-       if(cb)cb->amount_complete(100, 100);
-       if(cb)cb->task(_("DONE"));
-}
-
-sinfg::Main::~Main()
-{
-       ref_count_.detach();
-       if(!sinfg_ref_count_.unique())
-               return;
-       sinfg_ref_count_.detach();
-
-       // Add deinitialization after this point
-
-       if(get_open_canvas_map().size())
-       {
-               sinfg::warning("Canvases still open!");
-               std::map<sinfg::String, etl::loose_handle<Canvas> >::iterator iter;
-               for(iter=get_open_canvas_map().begin();iter!=get_open_canvas_map().end();++iter)
-               {
-                       sinfg::warning("%s: count()=%d",iter->first.c_str(), iter->second.count());
-               }
-       }
-               
-       ValueNode::subsys_stop();
-       Importer::subsys_stop();
-       Target::subsys_stop();
-       Layer::subsys_stop();
-
-       /*! \fixme For some reason, uncommenting the next
-       **      line will cause things to crash. This needs to be
-       **      looked into at some point. */
-       //Module::subsys_stop();
-
-#if defined(HAVE_SIGNAL_H) && defined(SIGPIPE)
-       signal(SIGPIPE, SIG_DFL);
-#endif
-}
-
-
-
-
-
-
-
-
-
-void
-sinfg::error(const char *format,...)
-{
-       va_list args;
-       va_start(args,format);
-       error(vstrprintf(format,args));
-}
-
-void
-sinfg::error(const String &str)
-{
-       static Mutex mutex; Mutex::Lock lock(mutex);
-       cerr<<"sinfg("<<getpid()<<"): "<<_("error")<<": "+str<<endl;
-}
-
-void
-sinfg::warning(const char *format,...)
-{
-       va_list args;
-       va_start(args,format);
-       warning(vstrprintf(format,args));
-}
-
-void
-sinfg::warning(const String &str)
-{
-       static Mutex mutex; Mutex::Lock lock(mutex);
-       cerr<<"sinfg("<<getpid()<<"): "<<_("warning")<<": "+str<<endl;
-}
-
-void
-sinfg::info(const char *format,...)
-{
-       va_list args;
-       va_start(args,format);
-       info(vstrprintf(format,args));
-}
-
-void
-sinfg::info(const String &str)
-{
-       static Mutex mutex; Mutex::Lock lock(mutex);
-       cerr<<"sinfg("<<getpid()<<"): "<<_("info")<<": "+str<<endl;
-}
diff --git a/synfig-core/trunk/src/sinfg/main.h b/synfig-core/trunk/src/sinfg/main.h
deleted file mode 100644 (file)
index b1eeab4..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file main.h
-**     \brief Template Header
-**
-**     $Id: main.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_MAIN_H
-#define __SINFG_MAIN_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/ref_count>
-#include "general.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-/*!    \class sinfg::Main
-**     \brief \writeme
-**
-**     \writeme
-*/
-class Main
-{
-       etl::reference_counter ref_count_;
-public:
-       Main(const sinfg::String& basepath,ProgressCallback *cb=0);
-       ~Main();
-
-       static void load_modules(ProgressCallback *cb=0);
-
-       const etl::reference_counter& ref_count()const { return ref_count_; }
-}; // END of class Main
-
-}; // END if namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/module.cpp b/synfig-core/trunk/src/sinfg/module.cpp
deleted file mode 100644 (file)
index f893b74..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file module.cpp
-**     \brief writeme
-**
-**     $Id: module.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "module.h"
-#include "general.h"
-#include <ltdl.h>
-#include <ETL/stringf>
-#endif
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-Module::Book *sinfg::Module::book_;
-
-/* === P R O C E D U R E S ================================================= */
-
-bool
-Module::subsys_init(const String &prefix)
-{
-       #ifndef SINFG_LTDL_NO_STATIC
-       //LTDL_SET_PRELOADED_SYMBOLS();
-       #endif
-       
-       if(lt_dlinit())
-       {
-               error(_("Errors on lt_dlinit()"));
-               error(lt_dlerror());
-               return false;
-       }
-
-       lt_dladdsearchdir(".");
-       lt_dladdsearchdir("~/.sinfg/modules");
-       lt_dladdsearchdir((prefix+"/lib/sinfg/modules").c_str());
-#ifdef LIBDIR
-       lt_dladdsearchdir(LIBDIR"/sinfg/modules");
-#endif
-#ifdef __APPLE__
-       lt_dladdsearchdir("/Library/Frameworks/sinfg.framework/Resources/modules");
-#endif
-       lt_dladdsearchdir("/usr/local/lib/sinfg/modules");
-       lt_dladdsearchdir(".");
-       
-       book_=new Book;
-       return true;
-}
-
-bool
-Module::subsys_stop()
-{
-       delete book_;
-       
-       lt_dlexit();
-       return true;
-}
-
-bool
-register_default_modules()
-{
-       return true;
-}
-
-Module::Book&
-Module::book()
-{
-       return *book_;
-}
-
-void
-sinfg::Module::Register(Module::Handle mod)
-{
-       book()[mod->Name()]=mod;
-}
-
-bool
-sinfg::Module::Register(const String &module_name, ProgressCallback *callback)
-{
-       lt_dlhandle module;
-
-       if(callback)callback->task(strprintf(_("Attempting to register \"%s\""),module_name.c_str()));
-
-       module=lt_dlopenext((string("lib")+module_name).c_str());
-       if(!module)module=lt_dlopenext(module_name.c_str());
-       
-       if(!module)
-       {
-               if(callback)callback->error(strprintf(_("Unable to find module \"%s\" (%s)"),module_name.c_str(),lt_dlerror()));
-               return false;
-       }
-
-       if(callback)callback->task(strprintf(_("Found module \"%s\""),module_name.c_str()));
-       
-       Module::constructor_type constructor=NULL;
-       Handle mod;
-
-       if(!constructor)
-       {
-//             if(callback)callback->task(string("looking for -> ")+module_name+"_LTX_new_instance()");
-               constructor=(Module::constructor_type )lt_dlsym(module,(module_name+"_LTX_new_instance").c_str());
-       }
-
-       if(!constructor)
-       {
-//             if(callback)callback->task(string("looking for -> lib")+module_name+"_LTX_new_instance()");
-               constructor=(Module::constructor_type )lt_dlsym(module,(string("lib")+module_name+"_LTX_new_instance").c_str());
-       }
-       if(!constructor)
-       {
-//             if(callback)callback->task(string("looking for -> lib")+module_name+"_LTX_new_instance()");
-               constructor=(Module::constructor_type )lt_dlsym(module,(string("_lib")+module_name+"_LTX_new_instance").c_str());
-       }
-       if(!constructor)
-       {
-//             if(callback)callback->task(string("looking for -> lib")+module_name+"_LTX_new_instance()");
-               constructor=(Module::constructor_type )lt_dlsym(module,(string("_")+module_name+"_LTX_new_instance").c_str());
-       }
-       
-       if(constructor)
-       {
-//             if(callback)callback->task(strprintf("Executing callback for \"%s\"",module_name.c_str()));
-               mod=handle<Module>((*constructor)(callback));
-       }
-       else
-       {
-               if(callback)callback->error(strprintf(_("Unable to find entrypoint in module \"%s\" (%s)"),module_name.c_str(),lt_dlerror()));
-               return false;
-       }
-
-//     if(callback)callback->task(strprintf("Done executing callback for \"%s\"",module_name.c_str()));
-
-       if(mod)
-       {
-//             if(callback)callback->task(strprintf("Registering \"%s\"",module_name.c_str()));
-               Register(mod);
-       }
-       else
-       {
-               if(callback)callback->error(_("Entrypoint did not return a module."));
-               return false;
-    }
-
-       if(callback)callback->task(strprintf(_("Success for \"%s\""),module_name.c_str()));
-       
-       return false;
-}
diff --git a/synfig-core/trunk/src/sinfg/module.h b/synfig-core/trunk/src/sinfg/module.h
deleted file mode 100644 (file)
index 31d3bae..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file module.h
-**     \brief writeme
-**
-**     $Id: module.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_MODULE_H
-#define __SINFG_MODULE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "general.h"
-#include <ETL/handle>
-#include <map>
-#include "string.h"
-#include <utility>
-#include "vector.h"
-#include "color.h"
-#include "layer.h"
-#include "canvas.h"
-
-//#include "value.h"
-
-/* === M A C R O S ========================================================= */
-
-//! Marks the start of a module description
-#define MODULE_DESC_BEGIN(x) struct x##_modclass : public sinfg::Module { x##_modclass(sinfg::ProgressCallback *callback=NULL); 
-
-//! Sets the localized name of the module
-#define MODULE_NAME(x)                         virtual const char * Name() { return x; }
-
-//! Sets a localized description of the module
-#define MODULE_DESCRIPTION(x)  virtual const char * Desc() { return x; }
-
-//! Sets the name of the module's author
-#define MODULE_AUTHOR(x)               virtual const char * Author() { return x; }
-
-//! Sets the version string for the module
-#define MODULE_VERSION(x)              virtual const char * Version() { return x; }
-
-//! Sets the copyright string for the module
-#define MODULE_COPYRIGHT(x)            virtual const char * Copyright() { return x; }
-
-//! Describes the module's construction function
-#define MODULE_CONSTRUCTOR(x)  bool constructor_(sinfg::ProgressCallback *cb) { return x(cb); }
-
-//! Describes the module's destruction function
-#define MODULE_DESTRUCTOR(x)   virtual void destructor_() { return x(); }
-
-//! Marks the end of a module description
-#define MODULE_DESC_END };
-
-//#if 0
-#ifdef __APPLE__
-//! Marks the start of a module's inventory
-#define MODULE_INVENTORY_BEGIN(x)  extern "C" {                \
-       sinfg::Module* _##x##_LTX_new_instance(sinfg::ProgressCallback *cb) \
-       { if(SINFG_CHECK_VERSION()){x##_modclass *mod=new x##_modclass(cb); mod->constructor_(cb); return mod; }\
-       if(cb)cb->error(#x": Unable to load module due to version mismatch."); return NULL; } \
-       }; x##_modclass::x##_modclass(sinfg::ProgressCallback *cb) { 
-#else
-//! Marks the start of a module's inventory
-#define MODULE_INVENTORY_BEGIN(x)  extern "C" {                \
-       sinfg::Module* x##_LTX_new_instance(sinfg::ProgressCallback *cb) \
-       { if(SINFG_CHECK_VERSION()){x##_modclass *mod=new x##_modclass(cb); mod->constructor_(cb); return mod; }\
-       if(cb)cb->error(#x": Unable to load module due to version mismatch."); return NULL; } \
-       }; x##_modclass::x##_modclass(sinfg::ProgressCallback *cb) { 
-#endif
-
-//! Marks the start of the layers in the module's inventory
-#define BEGIN_LAYERS {
-
-//! DEPRECATED - use @INCLUDE_LAYER()
-//#define LAYER(x) sinfg::Layer::book()[sinfg::String(x::name__)]=x::create;
-#define LAYER(class)   sinfg::Layer::register_in_book(sinfg::Layer::BookEntry(class::create,class::name__,class::local_name__,class::category__,class::cvs_id__,class::version__));
-#define LAYER_ALIAS(class,alias)       sinfg::Layer::register_in_book(sinfg::Layer::BookEntry(class::create,alias,alias,_("Do Not Use"),class::cvs_id__,class::version__));
-
-//! Marks the end of the layers in the module's inventory
-#define END_LAYERS }
-
-//! Marks the start of the targets in the module's inventory
-#define BEGIN_TARGETS {
-
-#define TARGET(x) sinfg::Target::book()[sinfg::String(x::name__)]=std::pair<sinfg::Target::Factory,sinfg::String>(x::create,sinfg::String(x::ext__));sinfg::Target::ext_book()[sinfg::String(x::ext__)]=x::name__;
-
-#define TARGET_EXT(x,y) sinfg::Target::ext_book()[sinfg::String(y)]=x::name__;
-
-//! Marks the end of the targets in the module's inventory
-#define END_TARGETS }
-
-//! Marks the start of the importers in the module's inventory
-#define BEGIN_IMPORTERS {
-
-#define IMPORTER(x) sinfg::Importer::book()[sinfg::String(x::ext__)]=x::create;
-
-#define IMPORTER_EXT(x,y) sinfg::Importer::book()[sinfg::String(y)]=x::create;
-
-//! Marks the end of the importers in the module's inventory
-#define END_IMPORTERS }
-
-//! Marks the end of a module's inventory
-#define MODULE_INVENTORY_END   }
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ProgressCallback;
-
-/*!    \class Module
-**     \todo writeme
-*/
-class Module : public etl::shared_object
-{
-public:
-       bool constructor_(sinfg::ProgressCallback *cb) { return true; }
-       virtual void destructor_() { }
-       
-       typedef etl::handle<Module> Handle;
-       typedef etl::loose_handle<Module> LooseHandle;
-       typedef etl::handle<const Module> ConstHandle;
-       
-public:
-       typedef Module*(*constructor_type)(ProgressCallback *);
-       typedef std::map<String, Handle > Book;
-private:
-       static Book* book_;
-public:
-       static Book& book();
-
-       static bool subsys_init(const String &prefix);
-       static bool subsys_stop();
-       static bool register_default_modules();
-
-       static void Register(Handle mod);
-       static bool Register(const String &module_name, ProgressCallback *cb=NULL);
-       static inline void Register(Module *mod) { Register(Handle(mod)); }
-       
-       virtual const char * Name() { return " "; }
-       virtual const char * Desc() { return " "; }
-       virtual const char * Author() { return " "; }
-       virtual const char * Version() { return " "; }
-       virtual const char * Copyright() { return SINFG_COPYRIGHT; }
-
-       virtual ~Module() { destructor_(); }
-};
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/mutex.cpp b/synfig-core/trunk/src/sinfg/mutex.cpp
deleted file mode 100644 (file)
index 4ede578..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file mutex.cpp
-**     \brief Template File
-**
-**     $Id: mutex.cpp,v 1.3 2005/01/12 00:55:46 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "mutex.h"
-
-#ifdef HAVE_LIBPTHREAD
-#define USING_PTHREADS 1
-#else
-#ifdef _WIN32
-#define USING_WIN32_THREADS 1
-#endif
-#endif
-
-#ifdef USING_WIN32_THREADS
-#include <windows.h>
-#endif
-
-#ifdef USING_PTHREADS
-#include <pthread.h>
-#endif
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-//using namespace std;
-//using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-
-
-
-
-
-bool
-Mutex::is_locked()
-{
-       if(try_lock())
-       {
-               unlock();
-               return false;
-       }
-       return true;
-}
-
-void
-RecMutex::unlock_all()
-{
-       while(is_locked()) unlock();
-}
-
-#ifdef USING_PTHREADS
-Mutex::Mutex()
-{
-       pthread_mutex_t*const mtx_ptr(new pthread_mutex_t);
-
-       pthread_mutexattr_t attr;
-       pthread_mutexattr_init(&attr);
-
-       //#ifdef PTHREAD_PRIO_INHERIT
-       //pthread_mutexattr_setprioceiling(&attr,PTHREAD_PRIO_INHERIT);
-       //#endif
-
-       //#ifdef PTHREAD_MUTEX_RECURSIVE
-       //pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
-       //#endif
-
-       pthread_mutex_init(mtx_ptr,&attr);
-       pthread_mutexattr_destroy(&attr);
-       
-       blackbox=mtx_ptr;
-}
-
-Mutex::~Mutex()
-{
-       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
-       pthread_mutex_destroy(mtx_ptr);
-       delete mtx_ptr;
-}
-
-void
-Mutex::lock()
-{
-       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
-       pthread_mutex_lock(mtx_ptr);
-}
-
-void
-Mutex::unlock()
-{
-       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
-       pthread_mutex_unlock(mtx_ptr);
-}
-
-bool
-Mutex::try_lock()
-{
-       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
-       return !(bool) pthread_mutex_trylock(mtx_ptr);
-}
-
-
-RecMutex::RecMutex()
-{
-       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
-       pthread_mutexattr_t attr;
-
-       // Backtrack and get rid of the non-recursive mutex
-       pthread_mutex_destroy(mtx_ptr);
-
-       pthread_mutexattr_init(&attr);
-
-       pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
-
-       pthread_mutex_init(mtx_ptr,&attr);
-       pthread_mutexattr_destroy(&attr);
-}
-
-
-
-RWLock::RWLock()
-{
-       pthread_rwlock_t*const rwlock_ptr(new pthread_rwlock_t);
-       
-       pthread_rwlock_init(rwlock_ptr, NULL);
-       
-       blackbox=rwlock_ptr;
-}
-
-RWLock::~RWLock()
-{
-       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
-
-       pthread_rwlock_destroy(rwlock_ptr);
-       
-       delete rwlock_ptr;
-}
-
-void
-RWLock::reader_lock()
-{
-       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
-
-       pthread_rwlock_rdlock(rwlock_ptr);
-}
-
-void
-RWLock::reader_unlock()
-{
-       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
-
-       pthread_rwlock_unlock(rwlock_ptr);
-}
-
-bool
-RWLock::reader_trylock()
-{
-       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
-
-       return !pthread_rwlock_tryrdlock(rwlock_ptr);
-}
-
-void
-RWLock::writer_lock()
-{
-       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
-
-       pthread_rwlock_wrlock(rwlock_ptr);
-}
-
-void
-RWLock::writer_unlock()
-{
-       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
-
-       pthread_rwlock_unlock(rwlock_ptr);
-}
-
-bool
-RWLock::writer_trylock()
-{
-       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
-
-       return !pthread_rwlock_trywrlock(rwlock_ptr);
-}
-
-#endif
-
-#ifdef USING_WIN32_THREADS
-Mutex::Mutex()
-{
-       HANDLE& mtx(*reinterpret_cast<HANDLE*>(&blackbox));
-       mtx=CreateMutex(NULL, FALSE, NULL);
-}
-
-Mutex::~Mutex()
-{
-       HANDLE mtx(reinterpret_cast<HANDLE>(blackbox));
-       CloseHandle(mtx);
-}
-
-void
-Mutex::lock()
-{
-       HANDLE mtx(reinterpret_cast<HANDLE>(blackbox));
-       WaitForSingleObject(mtx, INFINITE);
-}
-
-void
-Mutex::unlock()
-{
-       HANDLE mtx(reinterpret_cast<HANDLE>(blackbox));
-       ReleaseMutex(mtx);
-}
-
-bool
-Mutex::try_lock()
-{
-       HANDLE mtx(reinterpret_cast<HANDLE>(blackbox));
-       return WaitForSingleObject(mtx, 0)==WAIT_FAILED;
-}
-
-
-RecMutex::RecMutex()
-{
-       // Win32 mutexes are recursive by default.
-}
-
-
-RWLock::RWLock()
-{
-}
-
-RWLock::~RWLock()
-{
-}
-
-void
-RWLock::reader_lock()
-{
-}
-
-void
-RWLock::reader_unlock()
-{
-}
-
-bool
-RWLock::reader_trylock()
-{
-}
-
-void
-RWLock::writer_lock()
-{
-}
-
-void
-RWLock::writer_unlock()
-{
-}
-
-bool
-RWLock::writer_trylock()
-{
-}
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/mutex.h b/synfig-core/trunk/src/sinfg/mutex.h
deleted file mode 100644 (file)
index 04dfb25..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file mutex.h
-**     \brief Template Header
-**
-**     $Id: mutex.h,v 1.2 2005/01/10 07:40:26 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_MUTEX_H
-#define __SINFG_MUTEX_H
-
-/* === H E A D E R S ======================================================= */
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class RecMutex;
-
-class Mutex
-{
-       friend class RecMutex;
-
-protected:
-       void* blackbox;
-       
-public:
-       
-       class Lock
-       {
-               Mutex& mutex;
-       public:
-               Lock(Mutex& x):mutex(x) { mutex.lock(); }
-               ~Lock() { mutex.unlock(); }
-       };
-       
-       Mutex();
-       ~Mutex();
-       
-       void lock();
-       void unlock();
-       bool try_lock();
-       bool is_locked();
-       
-private:
-       //! Non-copyable
-       Mutex(const Mutex&);
-       
-       //! Non-assignable
-       void operator=(const Mutex&);
-};
-
-class RecMutex : public Mutex
-{
-public:
-       RecMutex();
-
-       void unlock_all();
-};
-
-class RWLock
-{
-       void* blackbox;
-       
-public:
-       
-       class ReaderLock
-       {
-               RWLock& rw_lock;
-       public:
-               ReaderLock(RWLock& x):rw_lock(x) { rw_lock.reader_lock(); }
-               ~ReaderLock() { rw_lock.reader_unlock(); }
-       };
-       class WriterLock
-       {
-               RWLock& rw_lock;
-       public:
-               WriterLock(RWLock& x):rw_lock(x) { rw_lock.writer_lock(); }
-               ~WriterLock() { rw_lock.writer_unlock(); }
-       };
-       
-       RWLock();
-       ~RWLock();
-
-       void reader_lock();
-       void reader_unlock();
-       bool reader_trylock();
-
-       void writer_lock();
-       void writer_unlock();
-       bool writer_trylock();
-};
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/node.cpp b/synfig-core/trunk/src/sinfg/node.cpp
deleted file mode 100644 (file)
index fdd2bfe..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file node.cpp
-**     \brief Template File
-**
-**     $Id: node.cpp,v 1.5 2005/01/07 03:29:12 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define HASH_MAP_H <ext/hash_map>
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "node.h"
-#include "proto/nodebase.h"
-
-#ifdef HASH_MAP_H
-#include HASH_MAP_H
-using namespace __gnu_cxx;
-#else
-#include <map>
-#endif
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-// About BE_FRUGAL_WITH_GUIDS
-// If this macro is set, then a GUID will NOT
-// be calculated until the first call to get_guid()
-// This also means that the node doesn't get
-// added to the database until get_guid() is called
-// for the first time, or set_guid() is called.
-// If it is expensive to calculate GUIDs, then
-// this can improve performance a tad in
-// some cases. Otherwise, it doesn't change
-// much of anything.
-#define BE_FRUGAL_WITH_GUIDS 1
-
-#ifndef __sys_clock
-#ifndef _WIN32
-# include <time.h>
-# define __sys_clock   ::clock
-#else
-# ifdef __GNUG__
-#  include <time.h>
-#  define __sys_clock  ::clock
-# else
-typedef int clock_t;
-extern clock_t _clock();
-#  define CLOCKS_PER_SEC 1000
-#  define __sys_clock  _clock
-# endif
-#endif
-#endif
-
-/* === G L O B A L S ======================================================= */
-
-#ifdef HASH_MAP_H
-typedef hash_map<GUID,Node*,GUIDHash> GlobalNodeMap;
-#else
-typedef map<GUID,Node*> GlobalNodeMap;
-#endif
-
-static GlobalNodeMap* global_node_map_;
-
-static GlobalNodeMap& global_node_map()
-{
-       if(!global_node_map_)
-               global_node_map_=new GlobalNodeMap;
-       return *global_node_map_;
-}
-
-/* === P R O C E D U R E S ================================================= */
-
-sinfg::Node*
-sinfg::find_node(const GUID& guid)
-{
-       if(global_node_map().count(guid)==0)
-               return 0;
-       return global_node_map()[guid];
-}
-
-static void
-refresh_node(sinfg::Node* node, GUID old_guid)
-{
-       assert(global_node_map().count(old_guid));
-       global_node_map().erase(old_guid);
-       assert(!global_node_map().count(old_guid));
-       global_node_map()[node->get_guid()]=node;
-}
-
-/* === M E T H O D S ======================================================= */
-
-void
-TimePoint::absorb(const TimePoint& x)
-{
-       if(get_guid()==x.get_guid())
-               return;
-       set_guid(get_guid()^x.get_guid());
-       
-       if(get_after()==INTERPOLATION_NIL)
-               set_after(x.get_after());
-       if(get_before()==INTERPOLATION_NIL)
-               set_before(x.get_before());
-       
-       if(get_after()!=x.get_after() && x.get_after()!=INTERPOLATION_NIL)
-               set_after(INTERPOLATION_UNDEFINED);
-       if(get_before()!=x.get_before() && x.get_before()!=INTERPOLATION_NIL)
-               set_before(INTERPOLATION_UNDEFINED);    
-}
-
-TimePointSet::iterator
-TimePointSet::insert(const TimePoint& x)
-{
-       iterator iter(find(x));
-       if(iter!=end())
-       {
-               const_cast<TimePoint&>(*iter).absorb(x);
-               return iter;
-       }
-       return std::set<TimePoint>::insert(x).first;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Node::Node():
-       guid_(0),
-       bchanged(true),
-       deleting_(false)
-{
-#ifndef BE_FRUGAL_WITH_GUIDS
-       guid_.make_unique();
-       assert(guid_);
-       assert(!global_node_map().count(guid_));
-       global_node_map()[guid_]=this;  
-#endif
-}
-
-Node::~Node()
-{
-       begin_delete();
-
-       if(guid_)
-       {
-               assert(global_node_map().count(guid_));
-               global_node_map().erase(guid_);
-               assert(!global_node_map().count(guid_));
-       }
-}
-
-void
-Node::changed()
-{
-       time_last_changed_=__sys_clock();
-       on_changed();
-}
-
-
-//! Gets the GUID for this value node
-const GUID&
-Node::get_guid()const
-{
-#ifdef BE_FRUGAL_WITH_GUIDS
-       if(!guid_)
-       {
-               guid_.make_unique();
-               assert(guid_);
-               assert(!global_node_map().count(guid_));
-               global_node_map()[guid_]=this;  
-       }
-#endif
-       
-       return guid_;
-}
-
-//! Sets the GUID for this value node
-void
-Node::set_guid(const GUID& x)
-{
-       assert(x);
-
-#ifdef BE_FRUGAL_WITH_GUIDS
-       if(!guid_)
-       {
-               guid_=x;
-               assert(!global_node_map().count(guid_));
-               global_node_map()[guid_]=this;  
-       }
-       else
-#endif
-       if(guid_!=x)
-       {
-               GUID oldguid(guid_);
-               guid_=x;
-               refresh_node(this, oldguid);
-               on_guid_changed(oldguid);
-       }
-}
-
-int
-Node::get_time_last_changed()const
-{
-       return time_last_changed_;
-}
-
-void
-Node::add_child(Node*x)
-{
-       x->parent_set.insert(this);
-}
-
-void
-Node::remove_child(Node*x)
-{
-       if(x->parent_set.count(this)) x->parent_set.erase(this);
-}
-
-int
-Node::parent_count()const
-{
-       return parent_set.size();
-}
-
-const Node::time_set &
-Node::get_times() const
-{
-       if(bchanged)
-       {
-               times.clear();
-               get_times_vfunc(times);
-               bchanged = false;
-       }
-       
-       //set the output set...
-       return times;
-}
-
-void
-Node::begin_delete()
-{
-       if(!deleting_)
-       {
-               deleting_=true; signal_deleted()();
-       }
-}
-
-void
-Node::on_changed()
-{
-       bchanged = true;
-       signal_changed()();
-
-       std::set<Node*>::iterator iter;
-       for(iter=parent_set.begin();iter!=parent_set.end();++iter)
-       {
-               (*iter)->changed();
-       }
-}
-
-void
-Node::on_guid_changed(GUID guid)
-{
-       signal_guid_changed()(guid);
-}
diff --git a/synfig-core/trunk/src/sinfg/node.h b/synfig-core/trunk/src/sinfg/node.h
deleted file mode 100644 (file)
index ac87725..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file node.h
-**     \brief Template Header
-**
-**     $Id: node.h,v 1.3 2005/01/10 07:40:26 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_PARENTNODE_H
-#define __SINFG_PARENTNODE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sigc++/signal.h>
-#include <set>
-#include "time.h"
-#include "guid.h"
-#include <ETL/handle>
-#include "interpolation.h"
-#include "mutex.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class TimePoint
-{
-       GUID guid;
-       Time time;
-       Interpolation before,after;
-public:
-
-       TimePoint(const Time& x=Time::begin()):
-               guid(0),
-               time(x),
-               before(INTERPOLATION_NIL),
-               after(INTERPOLATION_NIL)
-       {
-       }
-
-       const GUID& get_guid()const { return guid; }
-       const Time& get_time()const { return time; }
-       Interpolation get_before()const { return before; }
-       Interpolation get_after()const { return after; }
-
-       void set_guid(const GUID& x) { guid=x; }
-       void set_time(const Time& x) { time=x; }
-       void set_before(Interpolation x) { before=x; }
-       void set_after(Interpolation x) { after=x; }
-       
-       void absorb(const TimePoint& x);
-}; // END of class TimePoint
-
-inline TimePoint operator+(TimePoint lhs,const Time& rhs)
-       { lhs.set_time(lhs.get_time()+rhs); return lhs; }
-
-inline bool operator<(const TimePoint& lhs,const TimePoint& rhs)
-       { return lhs.get_time()<rhs.get_time(); }
-
-inline bool operator<(const TimePoint& lhs,const Time& rhs)
-       { return lhs.get_time()<rhs; }
-
-inline bool operator<(const Time& lhs,const TimePoint& rhs)
-       { return lhs<rhs.get_time(); }
-
-inline bool operator==(const TimePoint& lhs,const TimePoint& rhs)
-       { return lhs.get_time()==rhs.get_time(); }
-
-inline bool operator!=(const TimePoint& lhs,const TimePoint& rhs)
-       { return lhs.get_time()!=rhs.get_time(); }
-
-class TimePointSet : public std::set<TimePoint>
-{
-public:
-       iterator insert(const TimePoint& x);
-
-       template <typename ITER> void insert(ITER begin, ITER end)
-               { for(;begin!=end;++begin) insert(*begin); }
-
-}; // END of class TimePointSet
-       
-class Node : public etl::rshared_object
-{
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public: 
-       
-       //! \writeme
-       typedef TimePointSet    time_set;
-
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-private:
-
-       //! \writeme
-       GUID guid_;
-
-       //! cached time values for all the childrens
-       mutable time_set        times;
-
-       //! \writeme
-       mutable bool            bchanged;
-
-       //! \writeme
-       mutable int time_last_changed_;
-
-       //! \writeme
-       mutable RWLock rw_lock_;
-       
-       //! \writeme
-       bool deleting_;
-
-public:
-
-       //! \todo This should really be private
-       std::set<Node*>         parent_set;
-
-       /*
- -- ** -- S I G N A L S -------------------------------------------------------
-       */
-
-private:
-       
-       sigc::signal<void> signal_changed_;
-
-       //!     GUID Changed
-       /*! \note The second parameter is the *OLD* guid! */
-       sigc::signal<void,GUID> signal_guid_changed_;   
-
-       //!     Deleted
-       sigc::signal<void> signal_deleted_;     
-
-       /*
- -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
-       */
-
-public:
-
-       sigc::signal<void>& signal_deleted() { return signal_deleted_; }
-
-       sigc::signal<void>& signal_changed() { return signal_changed_; }
-
-       //!     GUID Changed
-       /*! \note The second parameter is the *OLD* guid! */
-       sigc::signal<void,GUID>& signal_guid_changed() { return signal_guid_changed_; }
-
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-protected:
-
-       Node();
-
-       // This class cannot be copied -- use clone() if necessary
-private:
-       Node(const Node &x);
-
-public:
-       virtual ~Node();
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-       
-public:
-
-       void changed();
-
-       //! Gets the GUID for this value node
-       const GUID& get_guid()const;
-
-       //! Sets the GUID for this value node
-       void set_guid(const GUID& x);
-
-       int get_time_last_changed()const;
-       
-       void add_child(Node*x);
-
-       void remove_child(Node*x);
-
-       int parent_count()const;
-       
-       const time_set &get_times() const;
-
-       RWLock& get_rw_lock()const { return rw_lock_; }
-       
-protected:
-       
-       void begin_delete();
-       
-       /*
- --    ** -- V I R T U A L   F U N C T I O N S -----------------------------------
-       */
-
-protected:
-       virtual void on_changed();
-
-       virtual void on_guid_changed(GUID guid);
-
-       /*!     Function to be overloaded that fills 
-       */
-       virtual void get_times_vfunc(time_set &set) const = 0;
-};     
-
-sinfg::Node* sinfg::find_node(const sinfg::GUID& guid);
-
-template<typename T> etl::handle<T>
-guid_cast(const sinfg::GUID& guid)
-{
-       return etl::handle<T>::cast_dynamic(sinfg::find_node(guid));
-}
-
-typedef etl::handle<Node> NodeHandle;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/palette.cpp b/synfig-core/trunk/src/sinfg/palette.cpp
deleted file mode 100644 (file)
index 4ff3a66..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.cpp
-**     \brief Template File
-**
-**     $Id: palette.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "palette.h"
-#include "surface.h"
-#include "general.h"
-#include <fstream>
-#include <iostream>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define PALETTE_FILE_COOKIE    "SINFGPAL1.0"
-
-/* === G L O B A L S ======================================================= */
-
-bool weight_less_than(const PaletteItem& lhs,const PaletteItem& rhs)
-{
-       return lhs.weight<rhs.weight;
-}
-
-bool luma_less_than(const PaletteItem& lhs,const PaletteItem& rhs)
-{
-       return lhs.color.get_y()<rhs.color.get_y();
-}
-
-bool luma_less_than(const PaletteItem& lhs,const float& rhs)
-{
-       return lhs.color.get_y()<rhs;
-}
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Palette::Palette():
-       name_(_("Unnamed"))
-{
-}
-
-Palette::Palette(const String& name_):
-       name_(name_)
-{
-}
-
-void
-PaletteItem::add(const Color& x,int xweight)
-{
-       color=(color*weight+x*xweight)/(weight+xweight);
-       weight+=xweight;
-}
-
-Palette::Palette(const Surface& surface, int max_colors):
-       name_(_("Surface Palette"))
-{      
-       max_colors-=2;
-       for(int y=0;y<surface.get_h();y++)
-               for(int x=0;x<surface.get_w();x++)
-               {
-                       float dist;
-                       Color color(surface[y][x]);
-                                               
-                       if(empty())
-                       {
-                               push_back(color);
-                               continue;
-                       }
-
-                       if(color.get_a()==0)
-                       {
-                               if(front().color.get_a()!=0)
-                                       insert(begin(),Color(1,0,1,0));
-                               front().weight+=400;
-                               continue;
-                       }
-
-                       iterator iter(find_closest(color,&dist));
-                       if(sqrt(dist)<0.005)
-                       {
-                               iter->add(color);
-                               continue;
-                       }
-                       
-                       /*if(size()>=max_colors)
-                       {
-                               iterator iterlight(find_light());
-                               PaletteItem light(*iterlight);
-                               erase(iterlight);
-                               find_closest(light.color)->add(light.color,light.weight);
-                       }
-                       */
-                       
-                       push_back(color);
-                       continue;                       
-               }
-       sort(rbegin(),rend());
-
-       iterator iter;
-
-       iterator best_match(begin());
-       while((signed)size()>max_colors)
-       {
-               PaletteItem item(back());
-               pop_back();
-               find_closest(item.color)->add(item.color,item.weight);
-       }
-       push_back(Color::black());
-       push_back(Color::white());
-
-//     sort(begin(),end(),&luma_less_than);
-}
-
-Palette::const_iterator
-Palette::find_closest(const Color& color, float* dist)const
-{
-       // For the sake of avoiding cut-and-paste
-       // bugs, we'll just use the non-const
-       // find_closest()... It doesn't change anything
-       // anyway.
-       return const_cast<Palette*>(this)->find_closest(color,dist);
-}
-
-Palette::iterator
-Palette::find_closest(const Color& color, float* dist)
-{
-       iterator iter;
-
-       iterator best_match(begin());
-       float best_dist(1000000);
-
-       const float prep_y(powf(color.get_y(),2.2f)*color.get_a());
-       const float prep_u(color.get_u());
-       const float prep_v(color.get_v());
-       
-       for(iter=begin();iter!=end();++iter)
-       {
-               const float diff_y(prep_y-powf(iter->color.get_y(),2.2f)*iter->color.get_a());
-               const float diff_u(prep_u-iter->color.get_u());
-               const float diff_v(prep_v-iter->color.get_v());
-               const float diff_a(color.get_a()-iter->color.get_a());
-
-
-               const float dist(
-                       diff_y*diff_y*1.5f+
-                       diff_a*diff_a+
-
-                       diff_u*diff_u+  
-                       diff_v*diff_v
-                       
-                       // cross product
-                       /*abs(
-                               prep_u*iter->color.get_u()-     
-                               prep_v*iter->color.get_v()
-                       )*/
-               );
-               if(dist<best_dist)
-               {
-                       best_dist=dist;
-                       best_match=iter;
-               }
-       }
-       if(dist)
-               *dist=best_dist;
-       
-       return best_match;
-}
-
-
-Palette::iterator
-Palette::find_heavy()
-{
-       iterator iter;
-
-       iterator best_match(begin());
-       
-       for(iter=begin();iter!=end();++iter)
-       {
-               if(iter->weight>best_match->weight)
-                       best_match=iter;
-       }
-       
-       return best_match;
-}
-
-Palette::iterator
-Palette::find_light()
-{
-       iterator iter;
-
-       iterator best_match(begin());
-       
-       for(iter=begin();iter!=end();++iter)
-       {
-               if(iter->weight<best_match->weight)
-                       best_match=iter;
-       }
-       
-       return best_match;
-}
-
-Palette
-Palette::grayscale(int steps)
-{
-       Palette ret;
-       for(int i=0;i<steps;i++)
-       {
-               float amount(i/(steps-1));
-               float y(powf(amount,2.2f));
-               ret.push_back(
-                       PaletteItem(
-                               Color(y,y,y),
-                               strprintf(_("%0.2f%% Gray"),amount)
-                       )
-               );
-       }
-       return ret;
-}
-
-void
-Palette::save_to_file(const sinfg::String& filename)const
-{
-       const_iterator iter;
-
-       std::ofstream file(filename.c_str());
-       
-       if(!file)
-               throw strprintf(_("Unable to open %s for write"),filename.c_str());
-       
-       file<<PALETTE_FILE_COOKIE<<endl;
-       file<<name_<<endl;      
-       for(iter=begin();iter!=end();++iter)
-       {
-               file<<iter->name<<endl;
-               file
-                       <<iter->color.get_r()<<endl
-                       <<iter->color.get_g()<<endl
-                       <<iter->color.get_b()<<endl
-                       <<iter->color.get_a()<<endl;
-               
-       }
-}
-
-Palette
-Palette::load_from_file(const sinfg::String& filename)
-{
-       std::ifstream file(filename.c_str());
-       
-       if(!file)
-               throw strprintf(_("Unable to open %s for read"),filename.c_str());
-       
-       Palette ret;
-       String line;
-       
-       getline(file,line);
-
-       if(line!=PALETTE_FILE_COOKIE)
-               throw strprintf(_("%s does not appear to be a palette file"),filename.c_str());
-
-       getline(file,ret.name_);
-       
-       while(!file.eof())
-       {
-               PaletteItem item;
-               getline(file,item.name);
-               if(!file.eof())break;
-
-               getline(file,line);
-               if(!file.eof())break;
-               item.color.set_r(atof(line.c_str()));
-
-               getline(file,line);
-               if(!file.eof())break;
-               item.color.set_g(atof(line.c_str()));
-
-               getline(file,line);
-               if(!file.eof())break;
-               item.color.set_b(atof(line.c_str()));
-
-               getline(file,line);
-               if(!file.eof())break;
-               item.color.set_a(atof(line.c_str()));
-               
-               ret.push_back(item);
-       }
-       
-       return ret;
-}
diff --git a/synfig-core/trunk/src/sinfg/palette.h b/synfig-core/trunk/src/sinfg/palette.h
deleted file mode 100644 (file)
index 066e4e0..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file Palette.h
-**     \brief Template Header
-**
-**     $Id: palette.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_PALETTE_H
-#define __SINFG_PALETTE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "color.h"
-#include "string.h"
-#include <vector>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Surface;
-       
-struct PaletteItem
-{
-       Color color;
-       String name;
-       int weight;
-       
-       PaletteItem():weight(1) { }
-
-       PaletteItem(const Color& color, const String& name, int weight=1):
-               color(color),name(name),weight(weight) { }
-
-       PaletteItem(const Color& color, int weight=1):
-               color(color),weight(weight) { }
-               
-       void add(const Color& x, int weight=1);
-               
-       bool operator<(const PaletteItem& rhs)const { return weight<rhs.weight; }
-}; // END of struct PaletteItem
-
-class Palette : public std::vector<PaletteItem>
-{
-       String name_;
-       
-public:
-       Palette();
-       Palette(const String& name_);
-       
-       /*! Generates a palette for the given
-       **      surface
-       */
-       Palette(const Surface& surface, int size=256);
-
-       iterator find_closest(const Color& color, float* dist=0);
-       const_iterator find_closest(const Color& color, float* dist=0)const;
-
-       iterator find_heavy();
-       
-       iterator find_light();
-
-       static Palette grayscale(int steps=16);
-
-       void save_to_file(const sinfg::String& filename)const;
-
-       static Palette load_from_file(const sinfg::String& filename);
-}; // END of class Palette
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/paramdesc.cpp b/synfig-core/trunk/src/sinfg/paramdesc.cpp
deleted file mode 100644 (file)
index 0734782..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file paramdesc.cpp
-**     \brief Template File
-**
-**     $Id: paramdesc.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "paramdesc.h"
-#include "value.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ParamDesc::ParamDesc(sinfg::Color::BlendMethod, const String &a):
-       name_                   (a),
-       local_name_             (a),
-       scalar_                 (1.0),
-       critical_               (true),
-       hidden_                 (false),
-       invisible_duck_ (false),
-               is_distance_    (false),
-               animation_only_ (false)
-{
-       set_local_name(_("Blend Method"))
-       .set_hint("enum")
-       .add_enum_value(Color::BLEND_COMPOSITE,"composite",_("Composite"))
-       .add_enum_value(Color::BLEND_STRAIGHT,"straight",_("Straight"))
-       .add_enum_value(Color::BLEND_ONTO,"onto",_("Onto"))
-       .add_enum_value(Color::BLEND_STRAIGHT_ONTO,"straightonto",_("StraightOnto"))
-       .add_enum_value(Color::BLEND_BEHIND,"behind",_("Behind"))
-       .add_enum_value(Color::BLEND_SCREEN,"screen",_("Screen"))
-       .add_enum_value(Color::BLEND_OVERLAY,"overlay",_("Overlay"))
-       .add_enum_value(Color::BLEND_HARD_LIGHT,"hard_light",_("Hard Light"))
-       .add_enum_value(Color::BLEND_MULTIPLY,"multiply",_("Multiply"))
-       .add_enum_value(Color::BLEND_DIVIDE,"divide",_("Divide"))
-       .add_enum_value(Color::BLEND_ADD,"add",_("Add"))
-       .add_enum_value(Color::BLEND_SUBTRACT,"subtract",_("Subtract"))
-       .add_enum_value(Color::BLEND_DIFFERENCE,"difference",_("Difference"))
-       .add_enum_value(Color::BLEND_BRIGHTEN,"brighten",_("Brighten"))
-       .add_enum_value(Color::BLEND_DARKEN,"darken",_("Darken"))
-       .add_enum_value(Color::BLEND_COLOR,"color",_("Color"))
-       .add_enum_value(Color::BLEND_HUE,"hue",_("Hue"))
-       .add_enum_value(Color::BLEND_SATURATION,"saturation",_("Saturation"))
-       .add_enum_value(Color::BLEND_LUMINANCE,"luminance",_("Luminance"))
-// These are deprecated
-       .add_enum_value(Color::BLEND_ALPHA_OVER,"alphaover",_("Alpha Over"))
-//     .add_enum_value(Color::BLEND_ALPHA_BRIGHTEN,"alphabrighten",_("Alpha Brighten"))
-//     .add_enum_value(Color::BLEND_ALPHA_DARKEN,"alphadarken",_("Alpha Darken"))
-       ; // end of enums
-}
-
-ParamDesc::ParamDesc(const ValueBase&, const String &a):
-       name_                   (a),
-       local_name_             (a),
-       scalar_                 (1.0),
-       critical_               (true),
-       hidden_                 (false),
-       invisible_duck_ (false),
-               is_distance_    (false),
-               animation_only_ (false)
-{
-}
diff --git a/synfig-core/trunk/src/sinfg/paramdesc.h b/synfig-core/trunk/src/sinfg/paramdesc.h
deleted file mode 100644 (file)
index 3daf7a3..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file paramdesc.h
-**     \brief ParamDesc Class Implementation
-**
-**     $Id: paramdesc.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_PARAMDESC_H
-#define __SINFG_PARAMDESC_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "string.h"
-#include "real.h"
-#include "color.h"
-#include <list>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueBase;
-       
-/*!    \class ParamDesc
-**     \brief Parameter Description Class
-**     \todo writeme
-*/
-class ParamDesc
-{
-public:
-
-       //! \writeme
-       struct EnumData
-       {
-               int value;
-               String name;
-               String local_name;
-               EnumData(int value, const String &name, const String &local_name):
-                       value(value),
-                       name(name),
-                       local_name(local_name)
-               {
-               }
-       };
-       
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-private:
-       String name_;                   //! The actual parameter name
-       String local_name_;     //! Localized name
-       String desc_;                   //! Short description of parameter (Think tooltops)
-       String group_;                  //! Which group this parameter is a member of (optional)
-       String hint_;                   //! Parameter hint
-       String origin_;                 //! Parameter origin
-       String connect_;
-       String box_;
-       Real scalar_;                   //! Scalar value for visual editing
-       bool critical_;
-       bool hidden_;
-       bool invisible_duck_;
-       bool is_distance_;
-       bool animation_only_;
-
-       std::list<EnumData> enum_list_;
-       
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-public:
-
-       ParamDesc(const String &a="IM_A_BUG_SO_REPORT_ME"):
-               name_                   (a),
-               local_name_             (a),
-               scalar_                 (1.0),
-               critical_               (true),
-               hidden_                 (false),
-               invisible_duck_ (false),
-               is_distance_    (false),
-               animation_only_ (false)
-       { }
-
-       ParamDesc(const ValueBase&, const String &a);
-
-       ParamDesc(sinfg::Color::BlendMethod, const String &a);
-
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //! \writeme
-       const std::list<EnumData> &get_enum_list()const { return enum_list_; }
-       
-       //! Sets the localized name of the parameter.
-       ParamDesc &set_local_name(const String &n) { local_name_=n; return *this; }
-
-       //! Sets the localized description of the parameter.
-       ParamDesc &set_description(const String &d) { desc_=d; return *this; }
-
-       //! Sets the group that this parameter is a member of
-       ParamDesc &set_group(const String &n) { group_=n; return *this; }
-
-       //! Sets a "hint" for the parameter.
-       ParamDesc &set_hint(const String &h) { hint_=h; return *this; }
-
-       //! \writeme
-       ParamDesc &set_connect(const String &h) { connect_=h; return *this; }
-
-       //! \writeme
-       ParamDesc &set_box(const String &h) { box_=h; return *this; }
-
-       //! Sets a flag regarding the duck visibility
-       ParamDesc &set_invisible_duck(bool x=true) { invisible_duck_=x; return *this; }
-
-       //! Returns the flag regarding duck visibility
-       bool get_invisible_duck() { return invisible_duck_; }
-
-       
-       //! \writeme
-       ParamDesc &set_animation_only(bool x=true) { animation_only_=x; return *this; }
-
-       //! \writeme
-       bool get_animation_only() { return animation_only_; }
-
-       
-       //! Sets which parameter is to be used as the origin when the user edits visually.
-       ParamDesc &set_origin(const String &h) { origin_=h; return *this; }
-
-       //! Sets the scalar value for the parameter
-       /*! This value determines how the value is to be presented
-       **      to the user when editing visually. */
-       ParamDesc &set_scalar(const Real &n) { scalar_=n; return *this; }
-       ParamDesc &set_scalar(const String &h) { hint_=h; return *this; }
-
-       //!     Marks the parameter as not necessary for saving or copying
-       ParamDesc &not_critical() { critical_=false; return *this; }
-
-       //!     \writeme
-       ParamDesc &hidden() { hidden_=true; return *this; }
-
-       //!     Marks the parameter as only readable. Implies not_critical()
-       /*!     \todo This function needs to be written, as it is only a stub */
-       ParamDesc &read_only() { return *this; }
-
-       //!     Marks the parameter as only writable. Implies not_critical()
-       /*!     \todo This function needs to be written, as it is only a stub */
-       ParamDesc &write_only() { return *this; }
-
-       //! Adds a description of a possible enumeration value
-       /*!     Only relevant if the parameter is of an integer type and hint set to \c "enum" . */
-       ParamDesc &add_enum_value(int val, const String &enum_name,const String &enum_local_name)
-               { enum_list_.push_back(EnumData(val,enum_name,enum_local_name)); return *this; }
-
-       //! Returns the localized name of the parameter
-       const String &get_local_name()const { return local_name_; }
-
-       //! Returns the name of the parameter
-       const String &get_name()const { return name_; }
-
-       //! Returns the localized description of the parameter
-       const String &get_description()const { return desc_; }
-
-       //! Returns the paramater's group
-       const String &get_group()const { return group_; }
-
-       //! Returns a "hint" about the parameter, regarding how it is to be displayed to the user
-       const String &get_hint()const { return hint_; }
-
-       //! Returns the name of the parameter that is defined as the "origin". Used for visual editing.
-       const String &get_origin()const { return origin_; }
-
-       //! \writeme
-       const String &get_connect()const { return connect_; }
-
-               //! \writeme
-       const String &get_box()const { return box_; }
-
-       //! Returns the scalar value for the parameter. Used for visual editing.
-       const Real &get_scalar()const { return scalar_; }
-
-       //! Returns \c true if the layer is critical, \c false otherwise.
-       bool get_critical()const { return critical_; }
-
-       //! Returns \c true if the layer is hidden, \c false otherwise.
-       bool get_hidden()const { return hidden_; }
-
-       
-       
-       ParamDesc& set_is_distance(bool x=true) { is_distance_=x; return *this;}
-       bool get_is_distance()const { return is_distance_; }
-}; // END of class ParamDesc
-
-class ParamVocab : public std::list< ParamDesc >
-{
-};
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/pch.h b/synfig-core/trunk/src/sinfg/pch.h
deleted file mode 100644 (file)
index 08a60d6..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ========================================================================
-** Sinfg
-** Pre-Compiled Header
-** $Id: pch.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
-**
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
-**
-** === N O T E S ===========================================================
-**
-** ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_PCH_H
-#define __SINFG_PCH_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <iostream>
-#include "sinfg.h"
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/polynomial_root.cpp b/synfig-core/trunk/src/sinfg/polynomial_root.cpp
deleted file mode 100644 (file)
index e9cf76d..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.cpp
-**     \brief Template File
-**
-**     $Id: polynomial_root.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "polynomial_root.h"
-#include <complex>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-//using namespace etl;
-//using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-typedef complex<float> Complex;
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-#define EPSS 1.0e-7
-#define MR 8
-#define MT 10
-#define MAXIT (MT*MR)
-
-/*EPSS is the estimated fractional roundoff error.  We try to break (rare) limit
-cycles with MR different fractional values, once every MT steps, for MAXIT total allowed iterations.
-*/
-
-/*     Explanation:
-       
-       A polynomial can be represented like so:
-       Pn(x) = (x - x1)(x - x2)...(x - xn)     where xi = complex roots
-
-       We can get the following:
-       ln|Pn(x)| = ln|x - x1| + ln|x - x2| + ... + ln|x - xn|  
-       
-       G := d ln|Pn(x)| / dx =
-       +1/(x-x1) + 1/(x-x2) + ... + 1/(x-xn)
-       
-       and
-       
-       H := - d2 ln|Pn(x)| / d2x =
-       +1/(x-x1)^2 + 1/(x-x2)^2 + ... + 1/(x-xn)^2
-       
-       which gives
-       H = [Pn'/Pn]^2 - Pn''/Pn
-       
-       Laguerre's formula guesses that the root we are seeking x1 is located 
-       some distance a from our current guess x, and all the other roots are
-       located at distance b.
-       
-       Using this:
-       
-       1/a + (n-1)/b = G
-       
-       and 
-       
-       1/a^2 + (n-1)/b^2 = H
-
-       which yields this solution for a:
-       
-       a = n / G +- sqrt( (n-1)(nH - G^2) )
-       
-       where +- is determined by which ever yields the largest magnitude for the denominator.
-       a can easily be complex since the factor inside the square-root can be negative.
-       
-       This method iterates (x=x-a) until a is sufficiently small.
-*/
-
-/* Given the degree m and the m+1 complex coefficients a[0..m] of the polynomial sum(i=0,m){a[i]x^i},
-and given a complex value x, this routine improves x by laguerre's method until it converges,
-within the acheivable roundoff limit, to a root of teh given polynomial.  The number of iterations taken 
-is returned as its.
-*/
-void laguer(Complex a[], int m, Complex *x, int *its)
-{
-       int iter,j;
-       float abx, abp, abm, err;
-       Complex dx,x1,b,d,f,g,h,sq,gp,gm,g2;
-       
-       //Fractions used to break a limit cycle
-       static float frac[MR+1] = {0.0,0.5,0.25,0.75,0.13,0.38,0.62,0.88,1.0};
-       
-       for(iter = 1; iter <= MAXIT; ++iter)
-       {
-               *its = iter; //number of iterations so far
-               
-               b       = a[m];         //the highest coefficient
-               err     = abs(b);       //its magnitude
-               
-               d = f = Complex(0,0); //clear variables for use
-               abx = abs(*x);  //the magnitude of the current root
-               
-               //Efficent computation of the polynomial and it's first 2 derivatives
-               for(j = m-1; j >= 0; --j)
-               {
-                       f = (*x)*f + d;
-                       d = (*x)*d + b;
-                       b = (*x)*b + a[j];
-                       
-                       err = abs(b) + abx*err;
-               }
-               
-               //Estimate the roundoff error in evaluation polynomial
-               err *= EPSS;
-               
-               //Are we on the root?
-               if(abs(b) < err)
-               {
-                       return;
-               }
-               
-               //General case: use Laguerre's formula
-               //a = n / G +- sqrt( (n-1)(nH - G^2) )
-               //x = x - a
-               
-               g = d / b;      //get G
-               g2 = g * g; //for the sqrt calc
-               
-               h = g2 - 2.0f * (f / b);        //get H
-               
-               sq = pow( (float)(m-1) * ((float)m*h - g2), 0.5f ); //get the sqrt
-               
-               //get the denominator
-               gp = g + sq;
-               gm = g - sq;
-
-               abp = abs(gp);
-               abm = abs(gm);          
-               
-               //get the denominator with the highest magnitude
-               if(abp < abm)
-               {
-                       abp = abm;
-                       gp = gm;
-               }
-                       
-               //if the denominator is positive do one thing, otherwise do the other
-               dx = (abp > 0.0) ? (float)m / gp : polar((1+abx),(float)iter);
-               x1 = *x - dx;
-               
-               //Have we converged?
-               if( *x == x1 )
-               {
-                       return;
-               }
-               
-               //Every so often take a fractional step, to break any limit cycle (itself a rare occurrence).
-               if( iter % MT )
-               {
-                       *x = x1;
-               }else
-               {
-                       *x = *x - (frac[iter/MT]*dx);
-               }
-       }
-       
-       //very unusual - can occur only for complex roots.  Try a different starting guess for the root.
-       //nrerror("too many iterations in laguer");
-       return;
-}
-
-#define EPS 2.0e-6
-#define MAXM 100       //a small number, and maximum anticipated value of m..
-
-/*     Given the degree m ad the m+1 complex coefficients a[0..m] of the polynomial a0 + a1*x +...+ an*x^n
-       the routine successively calls laguer and finds all m complex roots in roots[1..m].
-       The boolean variable polish should be input as true (1) if polishing (also by Laguerre's Method)
-       is desired, false (0) if teh roots will be subsequently polished by other means.
-*/
-void RootFinder::find_all_roots(bool polish)
-{
-       int i,its,j,jj;
-       Complex x,b,c;
-       int m = coefs.size()-1;
-       
-       //make sure roots is big enough
-       roots.resize(m);
-       
-       if(workcoefs.size() < MAXM) workcoefs.resize(MAXM);
-
-       //Copy the coefficients for successive deflation
-       for(j = 0; j <= m; ++j)
-       {
-               workcoefs[j] = coefs[j];
-       }
-       
-       //Loop over each root to be found
-       for(j = m-1; j >= 0; --j)
-       {
-               //Start at 0 to favor convergence to smallest remaining root, and find the root
-               x = Complex(0,0);               
-               laguer(&workcoefs[0],j+1,&x,&its); //must add 1 to get the degree
-               
-               //if it is close enough to a real root, then make it so
-               if(abs(x.imag()) <= 2.0*EPS*abs(x.real()))
-               {
-                       x = Complex(x.real());
-               }
-               
-               roots[j] = x;
-               
-               //forward deflation
-               
-               //the degree is j+1 since j(0,m-1)
-               b = workcoefs[j+1];
-               for(jj = j; jj >= 0; --jj)
-               {
-                       c = workcoefs[jj];
-                       workcoefs[jj] = b;
-                       b = x*b + c;
-               }
-       }
-       
-       //Polish the roots using the undeflated coefficients
-       if(polish)
-       {
-               for(j = 0; j < m; ++j)
-               {
-                       laguer(&coefs[0],m,&roots[j],&its);
-               }
-       }
-       
-       //Sort roots by their real parts by straight insertion
-       for(j = 1; j < m; ++j)
-       {
-               x = roots[j];
-               for( i = j-1; i >= 1; --i)
-               {
-                       if(roots[i].real() <= x.real()) break;
-                       roots[i+1] = roots[i];
-               }
-               roots[i+1] = x;
-       }
-}
diff --git a/synfig-core/trunk/src/sinfg/polynomial_root.h b/synfig-core/trunk/src/sinfg/polynomial_root.h
deleted file mode 100644 (file)
index a1a5c31..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file polynomial_root.h
-**     \brief Polynomial Root Finder Header
-**
-**     $Id: polynomial_root.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_POLYNOMIAL_ROOT_H
-#define __SINFG_POLYNOMIAL_ROOT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <complex>
-#include <vector>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-template < typename T = float, typename F = float >
-class Polynomial : public std::vector<T> //a0 + a1x + a2x^2 + ... + anx^n
-{              
-public:
-       
-       //Will maintain all lower constants
-       void degree(unsigned int d, const T & def = (T)0) { resize(d+1,def); }
-       unsigned int degree()const { return size() - 1; }
-       
-       const Polynomial & operator+=(const Polynomial &p)
-       {
-               if(p.size() > size())
-                       resize(p.size(), (T)0);
-               
-               for(int i = 0; i < p.size(); ++i)
-               {
-                       (*this)[i] += p[i];
-               }
-               return *this;
-       }
-       
-       const Polynomial & operator-=(const Polynomial &p)
-       {
-               if(p.size() > size())
-                       resize(p.size(), (T)0);
-               
-               for(int i = 0; i < p.size(); ++i)
-               {
-                       (*this)[i] -= p[i];
-               }
-               return *this;
-       }
-       
-       const Polynomial & operator*=(const Polynomial &p)
-       {
-               if(p.size() < 1)
-               {
-                       resize(0);
-                       return *this;
-               }
-               
-               unsigned int i,j;
-               std::vector<T> nc(*this);
-               
-               //in place for constant stuff
-               for(i = 0; i < nc.size(); ++i)
-               {
-                       (*this)[i] *= p[0];
-               }
-               
-               if(p.size() < 2) return *this;
-                       
-               resize(size() + p.degree());            
-               for(int i = 0; i < nc.size(); ++i)
-               {
-                       for(int j = 1; j < p.size(); ++j)
-                       {
-                               nc[i+j] += nc[i]*p[j];
-                       }
-               }
-               
-               return *this;
-       }       
-};
-
-class RootFinder
-{
-       std::vector< std::complex<float> >      workcoefs;
-       int     its;
-       
-public:
-       std::vector< std::complex<float> >      coefs; //the number of coefficients determines the degree of polynomial
-
-       std::vector< std::complex<float> >      roots;
-
-       void find_all_roots(bool polish);
-};
-
-
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/proto/Makefile b/synfig-core/trunk/src/sinfg/proto/Makefile
deleted file mode 100644 (file)
index 68ce978..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-
-M4=m4
-
-PROTO_PP=$(M4) proto.m4
-
-FILES=nodebase.h
-
-all: $(FILES)
-
-clean:
-       $(RM) $(FILES)
-
-SUFFIXES=.px .h
-
-.SUFFIXES: $(SUFFIXES)
-
-.px.h: proto.m4
-       $(PROTO_PP) $< > $@
diff --git a/synfig-core/trunk/src/sinfg/proto/nodebase.px b/synfig-core/trunk/src/sinfg/proto/nodebase.px
deleted file mode 100644 (file)
index 19b4ea2..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file nodebase.h
-**     \brief Template Header
-**
-**     $Id: template.h,v 1.1.1.1 2005/01/04 01:23:09 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_NODEBASE_H
-#define __SINFG_NODEBASE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "../protocol.h"
-#include "../string.h"
-#include "../guid.h"
-#include <sigc++/slot.h>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-namespace Proto {
-
-typedef int Query;
-typedef int NodeList;
-
-class NodeBase : public Protocol
-{
-public:
-
-       PX_DEFINE_DATA(guid, GUID)
-
-       PX_DEFINE_FUNC(func_test, float, int, int)
-
-       PX_DEFINE_DATA(id, String)
-
-       PX_DEFINE_DATA(root, NodeHandle)
-
-       PX_DEFINE_FUNC(signal_changed, sigc::signal<void>)
-       PX_DEFINE_FUNC(signal_deleted, sigc::signal<void>)
-               
-       PX_DEFINE_FUNC_CONST(get_parents, const NodeList)
-       PX_DEFINE_FUNC_CONST(get_children, const NodeList)
-
-       PX_DEFINE_FUNC(query_children, NodeList, Query)
-
-}; // END of class Proto::NodeBase
-
-}; // END of namespace Proto
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/proto/proto.m4 b/synfig-core/trunk/src/sinfg/proto/proto.m4
deleted file mode 100644 (file)
index 91800eb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-dnl
-
- define(`forloop',
-               `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
- define(`_forloop',
-               `$4`'ifelse($1, `$3', ,
-                          `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
-
-define(`_PRINT_ARGS',`dnl
-ifelse($#,1,,`$2 v$1`'ifelse($#,2,,`, _PRINT_ARGS(incr($1), shift(shift($@)))')')dnl
-')dnl
-
-define(`_PRINT_ARGS2',`dnl
-ifelse($#,1,,`v$1`'ifelse($#,2,,`, _PRINT_ARGS2(incr($1), shift(shift($@)))')')dnl
-')dnl
-
-dnl PX_DEFINE_FUNC(func_name, ret_type, args...)
-define(`PX_DEFINE_FUNC',`
-       sigc::slot< $2`'ifelse($#,2,,`, shift(shift($@))') > _slot_$1;
-       $2 $1(ifelse($#,2,,`_PRINT_ARGS(1,shift(shift($@)))')) {
-               return _slot_$1(ifelse($#,2,,`_PRINT_ARGS2(1,shift(shift($@)))'));
-       }
-')dnl
-
-dnl PX_DEFINE_FUNC_CONST(func_name, ret_type, args...)
-define(`PX_DEFINE_FUNC_CONST',`
-       sigc::slot< $2`'ifelse($#,2,,`, shift(shift($@))') > _slot_$1_const;
-       $2 $1(ifelse($#,2,,`_PRINT_ARGS(1,shift(shift($@)))'))const {
-               return _slot_$1_const(ifelse($#,2,,`_PRINT_ARGS2(1,shift(shift($@)))'));
-       }
-')dnl
-
-define(`PX_DEFINE_DATA', `dnl
-PX_DEFINE_FUNC_CONST(get_$1, $2)
-PX_DEFINE_FUNC(set_$1, void, $2)
-')dnl
-
diff --git a/synfig-core/trunk/src/sinfg/protocol.h b/synfig-core/trunk/src/sinfg/protocol.h
deleted file mode 100644 (file)
index 33ec3f1..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file protocol.h
-**     \brief Template Header
-**
-**     $Id: template.h,v 1.1.1.1 2005/01/04 01:23:09 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_PROTOCOL_H
-#define __SINFG_PROTOCOL_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sigc++/signal.h>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Object
-{
-public:
-       
-       sigc::signal_
-       bool find_protocol(Protocol& proto)
-       {
-               
-       }
-};
-
-class Protocol
-{
-public:
-       class Type;
-       
-}; // END of class Protocol
-
-class Protocol::Type
-{
-}; // END of class Protocol::Type
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/real.h b/synfig-core/trunk/src/sinfg/real.h
deleted file mode 100644 (file)
index edc65ed..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file real.h
-**     \brief Provides the sinfg::Real typedef
-**
-**     $Id: real.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_REAL_H
-#define __SINFG_REAL_H
-
-/* === T Y P E D E F S ===================================================== */
-
-namespace sinfg {
-
-/*!    \typedef Real
-**     \todo writeme
-*/
-typedef double Real;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/rect.cpp b/synfig-core/trunk/src/sinfg/rect.cpp
deleted file mode 100644 (file)
index a420ea0..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file rect.cpp
-**     \brief Template File
-**
-**     $Id: rect.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "rect.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Rect
-Rect::full_plane()
-{
-       const double infinity(HUGE_VAL);
-       return Rect(
-               -infinity,
-               -infinity,
-               infinity,
-               infinity
-       );
-}
diff --git a/synfig-core/trunk/src/sinfg/rect.h b/synfig-core/trunk/src/sinfg/rect.h
deleted file mode 100644 (file)
index 87f8dc5..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file rect.h
-**     \brief Rectangle Class
-**
-**     $Id: rect.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_RECT_H
-#define __SINFG_RECT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/rect>
-#include "real.h"
-#include "vector.h"
-#include <limits>
-#include <cmath>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Rect : public etl::rect<Real>
-{
-public:
-
-       using etl::rect<Real>::set_point;
-       using etl::rect<Real>::expand;
-       using etl::rect<Real>::set;
-
-       static Rect full_plane();
-
-       static Rect zero()
-       {
-               return Rect(
-                       0,
-                       0,
-                       0,
-                       0
-               );
-       }
-
-       Rect() { }
-
-       Rect(const Point& x) { set_point(x); }
-
-       Rect(const Point& min, const Point& max) { set_point(min); expand(max); }
-
-       Rect(const value_type &x1,const value_type &y1) { set_point(x1,y1); }
-       
-       Rect(const value_type &x1,const value_type &y1,
-                       const value_type &x2,const value_type &y2)
-       {
-               set_point(x1,y1);
-               expand(x2,y2);
-       }
-               
-       void set_point(const Point& max) { set_point(max[0],max[1]);    }
-       
-       Rect& expand(const Point& max) { expand(max[0],max[1]); return *this; }
-
-       Rect& expand(const Real& r) { minx-=r; miny-=r; maxx+=r; maxy+=r; return *this; }
-
-       Rect& expand_x(const Real& r) { minx-=r; maxx+=r; return *this; }
-
-       Rect& expand_y(const Real& r) { miny-=r; maxy+=r; return *this; }
-       
-       Rect& set(const Point& min,const Point& max) { set(min[0],min[1],max[0],max[1]); return *this; }
-       
-       Point get_min()const { return Point(minx,miny); }
-       Point get_max()const { return Point(maxx,maxy); }
-       
-       bool is_inside(const Point& x) { return x[0]>minx && x[0]<maxx && x[1]>miny && x[1]<maxy; }
-               
-       Real area()const
-       {
-               return (maxx-minx)*(maxy-miny);
-       }
-       
-       // Operators
-       
-       Rect& operator+=(const Vector& rhs)
-       {
-               minx+=rhs[0]; miny+=rhs[1];
-               maxx+=rhs[0]; maxy+=rhs[1];
-               return *this;
-       }
-
-       Rect& operator-=(const Vector& rhs)
-       {
-               minx-=rhs[0]; miny-=rhs[1];
-               maxx-=rhs[0]; maxy-=rhs[1];
-               return *this;
-       }
-
-       Rect& operator*=(const Real& rhs)
-       {
-               minx*=rhs; miny*=rhs;
-               maxx*=rhs; maxy*=rhs;
-               return *this;
-       }
-
-       Rect& operator/=(Real rhs)
-       {
-               rhs=1.0/rhs; // Avoid doing several divisions
-               minx*=rhs; miny*=rhs;
-               maxx*=rhs; maxy*=rhs;
-               return *this;
-       }
-
-       Rect& operator&=(const Rect& rhs)
-       {
-               if(rhs.area()>0.00000001 && area()>0.00000001)
-                       etl::set_intersect(*this,*this,rhs);
-               else
-                       *this=zero();
-               return *this;
-       }
-
-       Rect& operator|=(const Rect& rhs)
-       {
-               if(rhs.area()>0.00000001 && area()>0.00000001)
-                       etl::set_union(*this,*this,rhs);
-               else
-               {
-                       if(area()<rhs.area())
-                               *this=rhs;
-               }
-               return *this;
-       }
-
-       Rect operator+(const Vector& rhs)const { return Rect(*this)+=rhs; }
-
-       Rect operator-(const Vector& rhs)const { return Rect(*this)-=rhs; }
-
-       Rect operator*(const Real& rhs)const { return Rect(*this)*=rhs; }
-
-       Rect operator/(const Real& rhs)const { return Rect(*this)/=rhs; }
-
-       Rect operator&(const Rect& rhs)const { return Rect(*this)&=rhs; }
-
-       Rect operator|(const Rect& rhs)const { return Rect(*this)|=rhs; }
-
-       bool operator&&(const Rect& rhs)const { return etl::intersect(*this, rhs); }
-
-       bool is_valid()const { return valid(); }
-}; // END of class Rect
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/renddesc.cpp b/synfig-core/trunk/src/sinfg/renddesc.cpp
deleted file mode 100644 (file)
index 0973b81..0000000
+++ /dev/null
@@ -1,558 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file renddesc.h_
-**     \brief RendDesc
-**
-**     $Id: renddesc.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "renddesc.h"
-#include <ETL/misc>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-RendDesc &
-RendDesc::apply(const RendDesc &x)
-{
-       operator=(x);
-       return *this;
-}
-
-const Color &
-RendDesc::get_bg_color()const
-{
-       return background;
-}
-
-RendDesc &
-RendDesc::set_bg_color(const Color &bg)
-{
-       background=bg; return *this;
-}
-
-Real
-RendDesc::get_physical_w()const
-{
-       return (Real)get_w()/get_x_res();
-}
-
-Real
-RendDesc::get_physical_h()const
-{
-       return (Real)get_h()/get_y_res();
-}
-
-RendDesc&
-RendDesc::set_physical_w(Real w)
-{
-       set_w(round_to_int(w*get_x_res()));
-       return *this;
-}
-
-RendDesc&
-RendDesc::set_physical_h(Real h)
-{
-       set_h(round_to_int(h*get_y_res()));
-       return *this;
-}
-
-int
-RendDesc::get_w()const
-{
-       return w_;
-}
-
-RendDesc &
-RendDesc::set_w(int x)
-{
-       if(FLAGS(flags,LINK_PX_ASPECT))
-       {
-               h_=h_*x/w_;
-               w_=x;
-       }
-       else if(FLAGS(flags,LINK_PX_AREA))
-       {
-               //! \writeme
-               w_=x;
-       }
-       else if(FLAGS(flags,PX_ASPECT))
-       {
-               Vector d=br_-tl_;
-               float old_span=get_span();
-
-               // If we should preserve image width
-               if(             FLAGS(flags,IM_W)
-                       || (FLAGS(flags,IM_ZOOMIN) && d[1]>d[1]/x*w_)
-                       || (FLAGS(flags,IM_ZOOMOUT) && d[1]<d[1]/x*w_))
-               {
-                       br_[1]-=focus[1];
-                       br_[1]=br_[1]/x*w_;
-                       br_[1]+=focus[1];
-                       tl_[1]-=focus[1];
-                       tl_[1]=tl_[1]/x*w_;
-                       tl_[1]+=focus[1];
-               } else
-               {
-                       br_[0]-=focus[0];
-                       br_[0]=br_[0]/w_*x;
-                       br_[0]+=focus[0];
-                       tl_[0]-=focus[0];
-                       tl_[0]=tl_[0]/w_*x;
-                       tl_[0]+=focus[0];
-               }
-
-               w_=x;
-
-               if(FLAGS(flags,IM_SPAN))
-                       set_span(old_span);
-       }
-       else if(FLAGS(flags,PX_AREA))
-       {
-               //! \writeme
-               w_=x;
-       }
-       else
-               w_=x;
-
-       return *this;
-}
-
-int
-RendDesc::get_h()const
-{
-       return h_;
-}
-
-RendDesc &
-RendDesc::set_h(int y)
-{
-       if(FLAGS(flags,LINK_PX_ASPECT))
-       {
-               w_=w_*y/h_;
-               h_=y;
-       }
-       else if(FLAGS(flags,LINK_PX_AREA))
-       {
-               //! \writeme
-               h_=y;
-       }
-       else if(FLAGS(flags,PX_ASPECT))
-       {
-               Vector d=br_-tl_;
-               float old_span=get_span();
-
-               // If we should preserve image width
-               if(             FLAGS(flags,IM_W)
-                       || (FLAGS(flags,IM_ZOOMIN) && d[0]>d[0]/y*h_)
-                       || (FLAGS(flags,IM_ZOOMOUT) && d[0]<d[0]/y*h_))
-               {
-                       br_[0]-=focus[0];
-                       br_[0]=br_[0]/y*h_;
-                       br_[0]+=focus[0];
-                       tl_[0]-=focus[0];
-                       tl_[0]=tl_[0]/y*h_;
-                       tl_[0]+=focus[0];
-               } else
-               {
-                       br_[1]-=focus[1];
-                       br_[1]=br_[1]/h_*y;
-                       br_[1]+=focus[1];
-                       tl_[1]-=focus[1];
-                       tl_[1]=tl_[1]/h_*y;
-                       tl_[1]+=focus[1];
-               }
-
-               h_=y;
-
-               if(FLAGS(flags,IM_SPAN))
-                       set_span(old_span);
-       }
-       else if(FLAGS(flags,PX_AREA))
-       {
-               //! \writeme
-               h_=y;
-       }
-       else
-               h_=y;
-
-       return *this;
-}
-
-RendDesc &
-RendDesc::set_wh(int x, int y)
-{
-       // FIXME: This is a working hack...
-       set_w(x);
-       set_h(y);
-
-       return *this;
-}
-
-Real
-RendDesc::get_x_res()const
-{
-       return x_res;
-}
-
-RendDesc &
-RendDesc::set_x_res(Real x)
-{
-       x_res=x; return *this;
-}
-
-Real
-RendDesc::get_y_res()const
-{
-       return y_res;
-}
-
-RendDesc &
-RendDesc::set_y_res(Real y)
-{
-       y_res=y; return *this;
-}
-
-int
-RendDesc::get_frame_start()const
-{
-       return time_begin*frame_rate;
-}
-
-RendDesc &
-RendDesc::set_frame_start(int x)
-{
-       return set_time_start(Time(x)/frame_rate);
-}
-
-int
-RendDesc::get_frame_end()const
-{
-       return time_end*frame_rate;
-}
-
-RendDesc &
-RendDesc::set_frame_end(int x)
-{
-       return set_time_end(Time(x)/frame_rate);
-}
-
-
-const Time
-RendDesc::get_time_start()const
-{
-       return time_begin;
-}
-
-RendDesc &
-RendDesc::set_time_start(Time x)
-{
-       if(x>time_end)
-               time_begin=time_end=x;
-       else
-               time_begin=x;
-       return *this;
-}
-
-
-const Time
-RendDesc::get_time_end()const
-{
-       return time_end;
-}
-
-RendDesc &
-RendDesc::set_time_end(Time x)
-{
-       if(x<time_begin)
-               time_end=time_begin=x;
-       else
-               time_end=x;
-       return *this;
-}
-
-RendDesc &
-RendDesc::set_time(Time x)
-{
-       time_end=time_begin=x;
-       return *this;
-}
-
-RendDesc &
-RendDesc::set_frame(int x)
-{
-       return set_time(Time(x)/frame_rate);
-}
-
-const float &
-RendDesc::get_frame_rate()const
-{
-       return frame_rate;
-}
-
-RendDesc &
-RendDesc::set_frame_rate(float x)
-{
-       frame_rate=x;
-       return *this;
-}
-
-const bool &
-RendDesc::get_interlaced()const
-{
-       return interlaced;
-}
-
-RendDesc &
-RendDesc::set_interlaced(bool x)
-{ interlaced=x; return *this; }        
-
-//! Return the status of the clamp flag
-const bool &
-RendDesc::get_clamp()const
-{ return clamp; }
-
-//! Set the clamp flag
-RendDesc &
-RendDesc::set_clamp(bool x)
-{ clamp=x; return *this; }     
-
-//! Set constraint flags
-RendDesc &
-RendDesc::set_flags(const int &x)
-{ flags=x; return *this; }
-
-//! Clear constraint flags
-RendDesc &
-RendDesc::clear_flags()
-{ flags=0; return *this; }
-
-int
-RendDesc::get_flags()const
-{ return flags; }
-
-
-//!    Return the aspect ratio of a single pixel
-Real
-RendDesc::get_pixel_aspect()const
-{
-       Vector tmp=br_-tl_;
-       tmp[0]/=w_;
-       tmp[1]/=h_;
-       tmp[0]/=tmp[1];
-       if(tmp[0]<0.0)
-               return -tmp[0];
-       return tmp[0];
-}
-
-//!    Return the aspect ratio of the entire image
-Real
-RendDesc::get_image_aspect()const
-{
-       Point tmp=br_-tl_;
-       tmp[0]/=tmp[1];
-       if(tmp[0]<0.0)
-               return -tmp[0];
-       return tmp[0];
-}
-
-
-//! Return the antialias amount
-const int &
-RendDesc::get_antialias()const
-{ return a; }
-
-//! Set the antilaias amount
-RendDesc &
-RendDesc::set_antialias(const int &x)
-{ a=x; return *this; }
-
-
-//! Return the distance from the bottom-right to the top-left
-Real
-RendDesc::get_span()const
-{
-       return (br_-tl_).mag();
-}
-
-//! Set the span distance
-RendDesc &
-RendDesc::set_span(const Real &x)
-{
-       Vector::value_type ratio=x/get_span();
-
-       if(!FLAGS(flags,IM_W|IM_H) || FLAGS(flags,IM_ASPECT))
-       {
-               br_-=focus;
-               br_=br_*ratio;
-               br_+=focus;
-               tl_-=focus;
-               tl_=tl_*ratio;
-               tl_+=focus;
-       }
-       else if(FLAGS(flags,IM_W))
-       {
-               //! \writeme or fix me
-               br_-=focus;
-               br_=br_*ratio;
-               br_+=focus;
-               tl_-=focus;
-               tl_=tl_*ratio;
-               tl_+=focus;
-       }else // IM_H
-       {
-               //! \writeme or fix me
-               br_-=focus;
-               br_=br_*ratio;
-               br_+=focus;
-               tl_-=focus;
-               tl_=tl_*ratio;
-               tl_+=focus;
-       }
-
-       return *this;
-}
-
-
-/*
-const Gamma &
-RendDesc::get_gamma()const
-{ return gamma; }      
-
-RendDesc &
-RendDesc::set_gamma(const Gamma &x)
-{ gamma=x; return *this;  }
-*/
-
-const Point &
-RendDesc::get_focus()const
-{ return focus; }
-
-RendDesc &
-RendDesc::set_focus(const Point &x)
-{ focus=x; return *this; }
-
-
-const Point &
-RendDesc::get_tl()const
-{ return tl_; }
-
-const Point &
-RendDesc::get_br()const
-{ return br_; }
-
-RendDesc &
-RendDesc::set_tl(const Point &x)
-{
-       if(FLAGS(flags,PX_ASPECT))
-       {
-               Vector new_size(x-br_);
-               new_size[0]=abs(new_size[0]);
-               new_size[1]=abs(new_size[1]);
-       
-               Vector old_size(tl_-br_);
-               old_size[0]=abs(old_size[0]);
-               old_size[1]=abs(old_size[1]);
-               
-               if(new_size[0]!=old_size[0])
-                       w_=round_to_int(new_size[0]*w_/old_size[0]);
-       
-               if(new_size[1]!=old_size[1])
-                       h_=round_to_int(new_size[1]*h_/old_size[1]);
-       }
-       
-       tl_=x; return *this;
-}
-
-RendDesc &
-RendDesc::set_br(const Point &x)
-{
-       if(FLAGS(flags,PX_ASPECT))
-       {
-               Vector new_size(x-tl_);
-               new_size[0]=abs(new_size[0]);
-               new_size[1]=abs(new_size[1]);
-       
-               Vector old_size(tl_-br_);
-               old_size[0]=abs(old_size[0]);
-               old_size[1]=abs(old_size[1]);
-               
-               if(new_size[0]!=old_size[0])
-                       w_=round_to_int(new_size[0]*w_/old_size[0]);
-       
-               if(new_size[1]!=old_size[1])
-                       h_=round_to_int(new_size[1]*h_/old_size[1]);
-       }
-       br_=x; return *this;
-}
-
-RendDesc &
-RendDesc::set_viewport(const Point &__tl, const Point &__br)
-{ tl_=__tl; br_=__br; return *this; }
-
-RendDesc &
-RendDesc::set_viewport(Real a,Real b,Real c,Real d)
-{ tl_=Point(a,b); br_=Point(c,d); return *this; }
-
-Real
-RendDesc::get_pw()const
-{
-       return (br_[0] - tl_[0]) / w_;
-}
-
-Real
-RendDesc::get_ph()const
-{
-       return (br_[1] - tl_[1]) / h_;
-}
-
-RendDesc &
-RendDesc::set_subwindow(int x, int y, int w, int h)
-{
-       const Real pw(get_pw());
-       const Real ph(get_ph());
-       
-       tl_[0]+=pw*x;
-       tl_[1]+=ph*y;
-
-       br_[0]-=pw*(w_-(x+w));
-       br_[1]-=ph*(h_-(y+h));
-
-       w_=w;
-       h_=h;
-       
-       return *this;
-}
diff --git a/synfig-core/trunk/src/sinfg/renddesc.h b/synfig-core/trunk/src/sinfg/renddesc.h
deleted file mode 100644 (file)
index 1498fe8..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file renddesc.h
-**     \brief Template Header
-**
-**     $Id: renddesc.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_RENDERDESC_H
-#define __SINFG_RENDERDESC_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "vector.h"
-#include "color.h"
-#include "types.h"
-#include <cmath>
-#include "rect.h"
-
-/* === M A C R O S ========================================================= */
-
-#ifndef DPM2DPI
-#define DPM2DPI(x)     (float(x)/39.3700787402f)
-#define DPI2DPM(x)     (float(x)*39.3700787402f)
-#endif
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class RendDesc
-**     \todo writeme
-*/
-class RendDesc
-{
-public:
-       enum Lock
-       {
-               PX_ASPECT=(1<<0),
-               PX_AREA=(1<<1),
-               PX_W=(1<<2),
-               PX_H=(1<<3),
-               
-               IM_ASPECT=(1<<4),
-               IM_SPAN=(1<<5),
-               IM_W=(1<<6),
-               IM_H=(1<<7),
-               IM_ZOOMIN=(1<<8),
-               IM_ZOOMOUT=(1<<9),
-                               
-               LINK_PX_ASPECT=(1<<10),
-               LINK_PX_AREA=(1<<11),
-               LINK_IM_ASPECT=(1<<12),
-               LINK_IM_SPAN=(1<<13),
-               LINK_IM_CENTER=(1<<14)
-       };
-       
-private:
-       int w_,h_;
-       Real x_res;
-       Real y_res;
-       Point tl_, br_;
-       Point focus;
-       int a;
-       //Gamma gamma;
-       Color background;
-       int flags;
-       bool interlaced;
-       bool clamp;
-
-       float frame_rate;
-       Time time_begin, time_end;
-               
-public:
-
-       enum
-       {
-               ANTIALIAS_UNIFORM,
-               ANTIALIAS_MONTE_CARLO,
-               ANTIALIAS_JITTERED,
-               ANTIALIAS_ADAPTIVE,
-               ANTIALIAS_QUINTCUNX
-       } AntialiasFilter;
-
-       //! Default Constructor
-       RendDesc():
-               w_                      (480),
-               h_                      (270),
-               x_res           (DPI2DPM(72.0f)),
-               y_res           (DPI2DPM(72.0f)),
-               tl_                     (-4,2.25),
-               br_                     (4,-2.25),
-               focus           (0,0),
-               a                       (2),
-               background      (Color::gray()),
-               flags           (0),
-               interlaced      (false),
-               clamp           (false),
-               frame_rate      (24),
-               time_begin      (0),
-               time_end        (0)
-       { }
-       
-       //! \writeme
-       RendDesc &apply(const RendDesc &x);
-       
-       //! \writeme
-       const Color &get_bg_color()const;
-
-       //! \writeme
-       RendDesc &set_bg_color(const Color &bg);
-
-       //! Return the width of the composition in pixels
-       int get_w()const;
-
-       //! Set the width of the composition in pixels.
-       /*! The other parameters are adjusted according to the
-       **      constraints placed on the flags.
-       */
-       RendDesc &set_w(int x);
-
-       //! Return the height of the composition in pixels
-       int     get_h()const;
-
-       //! Set the height of the composition in pixels.
-       /*! The other parameters are adjusted according to the
-       **      constraints placed on the flags.
-       */
-       RendDesc &set_h(int y);
-
-       //!     Sets the width and height of the composition in pixels
-       RendDesc &set_wh(int x, int y);
-
-    //! Returns the horizontal resolution (in dots per meter)
-       Real get_x_res()const;
-
-       //! Sets the horizontal resolution (in dots per meter)
-       RendDesc &set_x_res(Real x);
-       
-    //! Returns the vertical resolution (in dots per meter)
-       Real get_y_res()const;
-
-       //! Sets the vertical resolution (in dots per meter)
-       RendDesc &set_y_res(Real y);
-
-
-       //! Return the physical width of the composition in meters
-       Real get_physical_w()const;
-
-       //! Return the physical height of the composition in meters
-       Real get_physical_h()const;
-
-       //! Set the physical width of the composition in meters
-       RendDesc &set_physical_w(Real w);
-
-       //! Set the physical height of the composition in meters
-       RendDesc &set_physical_h(Real h);
-
-
-       //!     Return the index of the first frame
-       int get_frame_start()const;
-
-       //! Set the index of the first frame
-       RendDesc &set_frame_start(int x);
-       
-       //!     Return the index of the last frame
-       int get_frame_end()const;
-       
-       //! Set the index of the last frame
-       RendDesc &set_frame_end(int x);
-
-       //!     Return the starting time of the animation
-       const Time get_time_start()const;
-       
-       //!     Set the time that the animation will start
-       RendDesc &set_time_start(Time x);
-
-       //! Return the end time of the animation
-       const Time get_time_end()const;
-       
-       //!     Set the time that the animation will end
-       RendDesc &set_time_end(Time x);
-
-       //!     Setup for one frame at the given time
-       RendDesc &set_time(Time x);
-
-       //!     Setup for one frame
-       RendDesc &set_frame(int x);
-
-       //!     Return the frame rate (frames-per-second)
-       const float &get_frame_rate()const;
-       
-       //! Set the frame rate (frames-per-second)
-       RendDesc &set_frame_rate(float x);
-
-       //! Return the status of the interlaced flag
-       const bool &get_interlaced()const;
-       
-       //! Set the interlace flag
-       RendDesc &set_interlaced(bool x);
-
-       //! Return the status of the clamp flag
-       const bool &get_clamp()const;
-       
-       //! Set the clamp flag
-       RendDesc &set_clamp(bool x);
-
-       //! Set constraint flags
-       RendDesc &set_flags(const int &x);
-       
-       //! Clear constraint flags
-       RendDesc &clear_flags();
-
-       //! Get constraint flags
-       int get_flags()const;
-
-       //!     Return the aspect ratio of a single pixel
-       Point::value_type get_pixel_aspect()const;
-
-       //!     Return the aspect ratio of the entire image
-       Point::value_type get_image_aspect()const;
-       
-       //! Return the antialias amount
-       const int &get_antialias()const;
-
-       //! Set the antilaias amount
-       RendDesc &set_antialias(const int &x);
-
-       //! Return the distance from the bottom-right to the top-left
-       Real get_span()const;
-
-       //! Set the span distance
-       RendDesc& set_span(const Real &x);
-
-       //const Gamma &get_gamma()const;
-
-       //RendDesc &set_gamma(const Gamma &x);
-
-       const Point &get_focus()const;
-
-       RendDesc &set_focus(const Point &x);
-
-       const Point &get_tl()const;
-       
-       RendDesc &set_tl(const Point &x);
-
-       const Point &get_br()const;
-       
-       RendDesc &set_br(const Point &x);
-       
-       Rect get_rect()const { return Rect(get_tl(),get_br()); }
-
-       RendDesc &set_viewport(const Point &__tl, const Point &__br);
-       
-       RendDesc &set_viewport(Vector::value_type a,Vector::value_type b,Vector::value_type c,Vector::value_type d);
-
-       //! Returns the width of one pixel
-       Real get_pw()const;
-
-       //! Returns the height of one pixel
-       Real get_ph()const;
-
-       //! Sets viewport to represent the screen at the give pixel coordinates
-       RendDesc &set_subwindow(int x, int y, int w, int h);
-};     // END of class RendDesc
-
-//! This operator allows the combining of RendDesc::Lock flags using the '|' operator
-/*!    \see RendDesc::Lock, RendDesc */
-inline RendDesc::Lock operator|(RendDesc::Lock lhs, RendDesc::Lock rhs)
-{
-       return static_cast<RendDesc::Lock>((int)lhs|(int)rhs);
-}
-
-//! This operator allows the masking of RendDesc::Lock flags using the '&' operator
-/*!    \see RendDesc::Lock, RendDesc */
-inline RendDesc::Lock operator&(RendDesc::Lock lhs, RendDesc::Lock rhs)
-{
-       return static_cast<RendDesc::Lock>((int)lhs&(int)rhs);
-}
-
-//! This operator allows the inverting of RendDesc::Lock flags using the '~' operator
-/*!    \see RendDesc::Lock, RendDesc */
-inline RendDesc::Lock operator~(RendDesc::Lock rhs)
-{
-       return static_cast<RendDesc::Lock>(~(int)rhs);
-}
-
-//! This operator is for checking RendDesc::Lock flags.
-/*! Don't think of it as "less then or equal to", but think of it
-**     like an arrow. Is \a rhs inside of \a lhs ?
-**     \see RendDesc::Lock, RendDesc */
-inline bool operator<=(RendDesc::Lock lhs, RendDesc::Lock rhs)
-{
-       return static_cast<int>(lhs) & static_cast<int>(rhs)==static_cast<int>(rhs);
-}
-
-
-}; /* end namespace sinfg */
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/render.cpp b/synfig-core/trunk/src/sinfg/render.cpp
deleted file mode 100644 (file)
index acfcbe3..0000000
+++ /dev/null
@@ -1,525 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file render.cpp
-**     \brief Renderer
-**
-**     $Id: render.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#include <sys/types.h>
-#include <signal.h>
-#endif
-
-#include "render.h"
-#include "target.h"
-#include "canvas.h"
-#include <ETL/handle>
-#include <cassert>
-#include "context.h"
-#include "surface.h"
-
-#endif
-
-using namespace std;
-using namespace sinfg;
-using namespace etl;
-
-/* === M A C R O S ========================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-bool
-sinfg::parametric_render(
-       Context context,
-       Surface &surface,
-       const RendDesc &desc,
-       ProgressCallback *callback
-)
-{
-       Point::value_type
-               u,v,            // Current location in image
-               su,sv,          // Starting locations
-               du, dv,         // Distance between pixels
-               dsu,dsv;        // Distance between subpixels
-
-       bool
-               no_clamp=!desc.get_clamp();
-       
-       int
-               w(desc.get_w()),
-               h(desc.get_h()),
-               a(desc.get_antialias());
-       
-       Point
-               tl(desc.get_tl()),
-               br(desc.get_br());
-       
-       //Gamma
-       //      gamma(desc.get_gamma());
-
-       int
-               x,y,            // Current location on output bitmap
-               x2,y2;          // Subpixel counters
-
-       Color::value_type
-               pool;           // Alpha pool (for correct alpha antialiasing)
-       
-       // Calculate the number of channels
-       //chan=channels(desc.get_pixel_format());
-               
-       // Calculate the distance between pixels
-       du=(br[0]-tl[0])/(Point::value_type)w;
-       dv=(br[1]-tl[1])/(Point::value_type)h;
-
-       // Calculate the distance between sub pixels
-       dsu=du/(Point::value_type)a;
-       dsv=dv/(Point::value_type)a;
-
-       // Calculate the starting points
-       //su=tl[0]+(du-dsu)/(Point::value_type)2.0;
-       //sv=tl[1]-(dv-dsv)/(Point::value_type)2.0;
-       su=tl[0];
-       sv=tl[1];
-       
-       surface.set_wh(desc.get_w(),desc.get_h());
-
-       assert(surface);
-       
-       // Loop through all horizontal lines
-       for(y=0,v=sv;y<h;y++,v+=dv)
-       {
-               // Set the current pixel pointer
-               // to the start of the line
-               Color *colordata=surface[y];
-
-               assert(colordata);
-               
-               // If we have a callback that we need
-               // to report to, do so now.
-               if(callback)
-                       if( callback->amount_complete(y,h) == false )
-                       {
-                               // If the callback returns false,
-                               // then the render has been aborted.
-
-                               return false;
-                       }
-
-               // Loop through every pixel in row
-               for(x=0,u=su;x<w;x++,u+=du)
-               {
-                       Color &c(*(colordata++));
-                       c=Color::alpha();
-
-                       // Loop through all subpixels
-                       for(y2=0,pool=0;y2<a;y2++)
-                               for(x2=0;x2<a;x2++)
-                               {
-                                       Color color=context.get_color(
-                                               Point(
-                                                       u+(Point::value_type)(x2)*dsu,
-                                                       v+(Point::value_type)(y2)*dsv
-                                                       )
-                                               );
-                                       if(!no_clamp)
-                                       {
-                                               color=color.clamped();
-                                               c+=color*color.get_a();
-                                               pool+=color.get_a();
-                                       }
-                                       else
-                                       {
-                                               c+=color*color.get_a();
-                                               pool+=color.get_a();
-                                       }
-                               }
-                       if(pool)
-                               c/=pool;
-               }
-       }
-       
-       // Give the callback one more last call,
-       // this time with the full height as the
-       // current line
-       if(callback)
-               callback->amount_complete(h,h);
-
-       // Report our success
-       return(true);
-}
-
-bool
-sinfg::render(
-       Context context,
-       Target_Scanline::Handle target,
-       const RendDesc &desc,
-       ProgressCallback *callback)
-{
-       Point::value_type
-               u,v,            // Current location in image
-               su,sv,          // Starting locations
-               du, dv,         // Distance between pixels
-               dsu,dsv;        // Distance between subpixels
-
-       bool
-               no_clamp=!desc.get_clamp();
-       
-       int
-               w(desc.get_w()),
-               h(desc.get_h()),
-               a(desc.get_antialias());
-       
-       Point
-               tl(desc.get_tl()),
-               br(desc.get_br());
-       
-       //Gamma
-       //      gamma(desc.get_gamma());
-
-       int
-               x,y,            // Current location on output bitmap
-               x2,y2;          // Subpixel counters
-
-       Color::value_type
-               pool;           // Alpha pool (for correct alpha antialiasing)
-
-       assert(target);
-       
-       // If we do not have a a target then bail
-       if(!target)
-               return false;
-       
-       // Calculate the number of channels
-       //chan=channels(desc.get_pixel_format());
-               
-       // Calculate the distance between pixels
-       du=(br[0]-tl[0])/(Point::value_type)w;
-       dv=(br[1]-tl[1])/(Point::value_type)h;
-
-       // Calculate the distance between sub pixels
-       dsu=du/(Point::value_type)a;
-       dsv=dv/(Point::value_type)a;
-
-       // Calculate the starting points
-       su=tl[0]+(du-dsu)/(Point::value_type)2.0;
-       sv=tl[1]-(dv-dsv)/(Point::value_type)2.0;
-
-       // Mark the start of a new frame.
-       if(!target->start_frame(callback))
-               return false;
-                       
-       // Loop through all horizontal lines
-       for(y=0,v=sv;y<h;y++,v+=dv)
-       {
-               // Set the current pixel pointer
-               // to the start of the line
-               Color *colordata=target->start_scanline(y);
-
-               if(!colordata)
-               {
-                       if(callback)callback->error(_("Target panic"));
-                       else throw(string(_("Target panic")));
-                       return false;
-               }
-               
-               // If we have a callback that we need
-               // to report to, do so now.
-               if(callback)
-                       if( callback->amount_complete(y,h) == false )
-                       {
-                               // If the callback returns false,
-                               // then the render has been aborted.
-                               // Exit gracefuly.
-
-                               target->end_scanline();
-                               target->end_frame();
-                               return false;
-                       }
-
-               // Loop through every pixel in row
-               for(x=0,u=su;x<w;x++,u+=du)
-               {
-                       Color &c(*(colordata++));
-                       c=Color::alpha();
-
-                       // Loop through all subpixels
-                       for(y2=0,pool=0;y2<a;y2++)
-                               for(x2=0;x2<a;x2++)
-                               {
-                                       Color color=context.get_color(
-                                               Point(
-                                                       u+(Point::value_type)(x2)*dsu,
-                                                       v+(Point::value_type)(y2)*dsv
-                                                       )
-                                               );
-                                       if(!no_clamp)
-                                       {
-                                               color=color.clamped();
-                                               c+=color*color.get_a();
-                                               pool+=color.get_a();
-                                       }
-                                       else
-                                       {
-                                               c+=color*color.get_a();
-                                               pool+=color.get_a();
-                                       }
-                               }
-                       if(pool)
-                               c/=pool;
-               }
-
-               // Send the buffer to the render target.
-               // If anything goes wrong, cleanup and bail.
-               if(!target->end_scanline())
-               {
-                       if(callback)callback->error(_("Target panic"));
-                       else throw(string(_("Target panic")));
-                       return false;
-               }
-       }
-       
-       // Finish up the target's frame
-       target->end_frame();
-
-       // Give the callback one more last call,
-       // this time with the full height as the
-       // current line
-       if(callback)
-               callback->amount_complete(h,h);
-
-       // Report our success
-       return(true);
-}
-
-bool
-sinfg::render_threaded(
-       Context context,
-       Target_Scanline::Handle target,
-       const RendDesc &desc,
-       ProgressCallback *callback,
-       int threads)
-{
-#ifndef WIN32
-    struct _render_thread
-    {
-               int
-                       pipe_read,
-                       pipe_write,
-                       pid;
-               _render_thread()
-               {
-                       pipe(&pipe_read);
-                       pid=0;
-               }
-               ~_render_thread()
-               {
-                       close(pipe_read);
-                       close(pipe_write);
-                       if(pid)
-                       {
-                               kill(pid,9);
-                       }
-               }
-    } *render_thread;
-    
-    int i, mythread=-1;
-       
-       Point::value_type
-               u,v,            // Current location in image
-               su,sv,          // Starting locations
-               du, dv,         // Distance between pixels
-               dsu,dsv;        // Distance between subpixels
-
-       bool
-               no_clamp=!desc.get_clamp();
-       
-       int
-               w(desc.get_w()),
-               h(desc.get_h()),
-               a(desc.get_antialias());
-       
-       Point
-               tl(desc.get_tl()),
-               br(desc.get_br());
-       
-       int
-               x,y,            // Current location on output bitmap
-               x2,y2;          // Subpixel counters
-
-       Color::value_type
-               pool;           // Alpha pool (for correct alpha antialiasing)
-
-       assert(target);
-       
-       // If we do not have a a target then bail
-       if(!target)
-               return false;
-                       
-       // Calculate the distance between pixels
-       du=(br[0]-tl[0])/(Point::value_type)w;
-       dv=(br[1]-tl[1])/(Point::value_type)h;
-
-       // Calculate the distance between sub pixels
-       dsu=du/(Point::value_type)a;
-       dsv=dv/(Point::value_type)a;
-
-       // Calculate the starting points
-       su=tl[0]+(du-dsu)/(Point::value_type)2.0;
-       sv=tl[1]-(dv-dsv)/(Point::value_type)2.0;
-
-    render_thread=new _render_thread[threads];
-    
-       // Start the forks
-    for(i=0;i<threads;i++)
-    {
-               int pid=fork();
-               if(pid==0)
-               {
-               mythread=i;
-               goto renderthread;
-               }
-               render_thread[i].pid=pid;
-    }
-    
-       // Mark the start of a new frame.
-       if(!target->start_frame(callback))
-               return false;
-
-    for(y=0;y<h;y++)
-    {
-               // Set the current pixel pointer
-               // to the start of the line
-               Color *colordata(target->start_scanline(y));
-
-               if(!colordata)
-               {
-                       if(callback)callback->error(_("Target panic"));
-                       else throw(string(_("Target panic")));
-                       return false;
-               }
-               
-               // If we have a callback that we need
-               // to report to, do so now.
-               if(callback)
-                       if( callback->amount_complete(y,h) == false )
-                       {
-                               // If the callback returns false,
-                               // then the render has been aborted.
-                               // Exit gracefuly.
-
-                               target->end_scanline();
-                               target->end_frame();
-                               delete [] render_thread;
-                               return false;
-                       }
-                               
-               read(render_thread[y%threads].pipe_read,colordata,w*sizeof(Color));
-               
-               // Send the buffer to the render target.
-               // If anything goes wrong, cleanup and bail.
-               if(!target->end_scanline())
-               {
-                       delete [] render_thread;
-                       if(callback)callback->error(_("Target panic"));
-                       else throw(string(_("Target panic")));
-                       return false;
-               }
-    }
-
-       // Finish up the target's frame
-       target->end_frame();
-
-       // Give the callback one more last call,
-       // this time with the full height as the
-       // current line
-       if(callback)
-               callback->amount_complete(h,h);
-    
-    delete [] render_thread;
-    return true;
-
-renderthread:
-       
-       // Change the random seed, so that each thread has a different one
-       srand(mythread*20+threads+time(0));
-       
-       Color *buffer(new Color[w]);
-
-       // Loop through all horizontal lines
-       for(y=mythread,v=sv+dv*(Real)mythread;y<h;y+=threads,v+=dv*(Real)threads)
-       {
-               // Set the current pixel pointer
-               // to the start of the line
-               Color* colordata(buffer);
-               
-               // Loop through every pixel in row
-               for(x=0,u=su;x<w;x++,u+=du)
-               {
-                       Color &c(*(colordata++));
-                       c=Color::alpha();
-
-                       // Loop through all subpixels
-                       for(y2=0,pool=0;y2<a;y2++)
-                               for(x2=0;x2<a;x2++)
-                               {
-                                       Color color=context.get_color(
-                                               Point(
-                                                       u+(Point::value_type)(x2)*dsu,
-                                                       v+(Point::value_type)(y2)*dsv
-                                                       )
-                                               );
-                                       if(!no_clamp)
-                                       {
-                                               color=color.clamped();
-                                               c+=color*color.get_a();
-                                               pool+=color.get_a();
-                                       }
-                                       else
-                                       {
-                                               c+=color*color.get_a();
-                                               pool+=color.get_a();
-                                       }
-                               }
-                       if(pool)
-                               c/=pool;
-               }
-               
-               // Send the buffer to the primary thread.
-               write(render_thread[mythread].pipe_write,buffer,w*sizeof(Color));
-       }
-       
-       delete [] buffer;
-       
-    _exit(0);
-       return false;   
-#else
-       return render(context, target, desc, callback);
-
-#endif 
-}
diff --git a/synfig-core/trunk/src/sinfg/render.h b/synfig-core/trunk/src/sinfg/render.h
deleted file mode 100644 (file)
index 30b3364..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file render.h
-**     \brief Template Header
-**
-**     $Id: render.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_RENDER_H
-#define __SINFG_RENDER_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "target_scanline.h"
-#include "vector.h"
-#include "color.h"
-#include "renddesc.h"
-#include "general.h"
-#include "layer.h"
-#include "canvas.h"
-#include <ETL/handle>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-//! Renders starting at \a context to \a target
-/*! \warning \a Target::set_rend_desc() must have
-**             already been called on \a target before
-**             you call this function!
-*/
-extern bool render(Context context, Target_Scanline::Handle target, const RendDesc &desc,ProgressCallback *);
-
-extern bool parametric_render(Context context, Surface &surface, const RendDesc &desc,ProgressCallback *);
-
-extern bool render_threaded(   Context context,
-       Target_Scanline::Handle target,
-       const RendDesc &desc,
-       ProgressCallback *callback,
-       int threads);
-
-}; /* end namespace sinfg */
-
-/* -- E N D ----------------------------------------------------------------- */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/savecanvas.cpp b/synfig-core/trunk/src/sinfg/savecanvas.cpp
deleted file mode 100644 (file)
index 32c8203..0000000
+++ /dev/null
@@ -1,755 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file savecanvas.cpp
-**     \brief Writeme
-**
-**     $Id: savecanvas.cpp,v 1.2 2005/01/07 03:29:12 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "savecanvas.h"
-#include "general.h"
-#include "valuenode.h"
-#include "valuenode_subtract.h"
-#include "valuenode_animated.h"
-#include "valuenode_composite.h"
-#include "valuenode_const.h"
-#include "valuenode_linear.h"
-#include "valuenode_dynamiclist.h"
-#include "valuenode_reference.h"
-#include "valuenode_segcalctangent.h"
-#include "valuenode_segcalcvertex.h"
-#include "valuenode_bline.h"
-#include "time.h"
-#include "keyframe.h"
-#include "layer.h"
-#include "string.h"
-#include "paramdesc.h"
-
-#include <libxml++/libxml++.h>
-#include <ETL/stringf>
-#include "gradient.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define COLOR_VALUE_TYPE_FORMAT                "%f"
-#define        VECTOR_VALUE_TYPE_FORMAT        "%0.10f"
-#define        TIME_TYPE_FORMAT                        "%0.3f"
-#define        VIEW_BOX_FORMAT                         "%f %f %f %f"
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-xmlpp::Element* encode_canvas(xmlpp::Element* root,Canvas::ConstHandle canvas);
-xmlpp::Element* encode_value_node(xmlpp::Element* root,ValueNode::ConstHandle value_node,Canvas::ConstHandle canvas);
-
-xmlpp::Element* encode_keyframe(xmlpp::Element* root,const Keyframe &kf, float fps)
-{
-       root->set_name("keyframe");
-       root->set_attribute("time",kf.get_time().get_string(fps));
-       if(!kf.get_description().empty())
-               root->set_child_text(kf.get_description());
-       return root;
-}
-
-
-xmlpp::Element* encode_real(xmlpp::Element* root,Real v)
-{
-       root->set_name("real");
-       root->set_attribute("value",strprintf(VECTOR_VALUE_TYPE_FORMAT,v));
-       return root;
-}
-
-xmlpp::Element* encode_time(xmlpp::Element* root,Time t, float fps=0)
-{
-       root->set_name("time");
-       //root->set_attribute("value",t.get_string(fps));
-       root->set_attribute("value",t.get_string());
-       return root;
-}
-
-xmlpp::Element* encode_integer(xmlpp::Element* root,int i)
-{
-       root->set_name("integer");
-       root->set_attribute("value",strprintf("%i",i));
-       return root;
-}
-
-xmlpp::Element* encode_bool(xmlpp::Element* root,bool b)
-{
-       root->set_name("bool");
-       root->set_attribute("value",b?"true":"false");
-       return root;
-}
-
-xmlpp::Element* encode_string(xmlpp::Element* root,const String &str)
-{
-       root->set_name("string");
-       root->set_child_text(str);
-       return root;
-}
-
-xmlpp::Element* encode_vector(xmlpp::Element* root,Vector vect)
-{
-       root->set_name("vector");
-       root->add_child("x")->set_child_text(strprintf(VECTOR_VALUE_TYPE_FORMAT,(float)vect[0]));
-       root->add_child("y")->set_child_text(strprintf(VECTOR_VALUE_TYPE_FORMAT,(float)vect[1]));
-       return root;
-}
-
-xmlpp::Element* encode_color(xmlpp::Element* root,Color color)
-{
-       root->set_name("color");
-       root->add_child("r")->set_child_text(strprintf(COLOR_VALUE_TYPE_FORMAT,(float)color.get_r()));
-       root->add_child("g")->set_child_text(strprintf(COLOR_VALUE_TYPE_FORMAT,(float)color.get_g()));
-       root->add_child("b")->set_child_text(strprintf(COLOR_VALUE_TYPE_FORMAT,(float)color.get_b()));
-       root->add_child("a")->set_child_text(strprintf(COLOR_VALUE_TYPE_FORMAT,(float)color.get_a()));
-       return root;
-}
-
-xmlpp::Element* encode_angle(xmlpp::Element* root,Angle theta)
-{
-       root->set_name("angle");
-       root->set_attribute("value",strprintf("%f",(float)Angle::deg(theta).get()));
-       return root;
-}
-
-xmlpp::Element* encode_segment(xmlpp::Element* root,Segment seg)
-{
-       root->set_name("segment");
-       encode_vector(root->add_child("p1")->add_child("vector"),seg.p1);
-       encode_vector(root->add_child("t1")->add_child("vector"),seg.t1);
-       encode_vector(root->add_child("p2")->add_child("vector"),seg.p2);
-       encode_vector(root->add_child("t2")->add_child("vector"),seg.t2);
-       return root;
-}
-
-xmlpp::Element* encode_bline_point(xmlpp::Element* root,BLinePoint bline_point)
-{
-       root->set_name(ValueBase::type_name(ValueBase::TYPE_BLINEPOINT));
-
-       encode_vector(root->add_child("vertex")->add_child("vector"),bline_point.get_vertex());
-       encode_vector(root->add_child("t1")->add_child("vector"),bline_point.get_tangent1());
-
-       if(bline_point.get_split_tangent_flag())
-               encode_vector(root->add_child("t2")->add_child("vector"),bline_point.get_tangent2());
-       
-       encode_real(root->add_child("width")->add_child("real"),bline_point.get_width());
-       encode_real(root->add_child("origin")->add_child("real"),bline_point.get_origin());
-       return root;
-}
-
-xmlpp::Element* encode_gradient(xmlpp::Element* root,Gradient x)
-{
-       root->set_name("gradient");
-       
-       Gradient::const_iterator iter;
-       x.sort();
-       for(iter=x.begin();iter!=x.end();iter++)
-       {
-               xmlpp::Element *cpoint(encode_color(root->add_child("color"),iter->color));
-               cpoint->set_attribute("pos",strprintf("%f",iter->pos));
-       }
-       return root;
-}
-
-
-xmlpp::Element* encode_value(xmlpp::Element* root,const ValueBase &data,Canvas::ConstHandle canvas=0);
-
-xmlpp::Element* encode_list(xmlpp::Element* root,std::list<ValueBase> list, Canvas::ConstHandle canvas=0)
-{
-       root->set_name("list");
-       
-       while(!list.empty())
-       {
-               encode_value(root->add_child("value"),list.front(),canvas);
-               list.pop_front();
-       }
-
-       return root;
-}
-
-xmlpp::Element* encode_value(xmlpp::Element* root,const ValueBase &data,Canvas::ConstHandle canvas)
-{
-       switch(data.get_type())
-       {
-       case ValueBase::TYPE_REAL:
-               return encode_real(root,data.get(Real()));
-       case ValueBase::TYPE_TIME:
-               if(canvas)
-                       return encode_time(root,data.get(Time()),canvas->rend_desc().get_frame_rate());
-               else
-                       return encode_time(root,data.get(Time()));
-       case ValueBase::TYPE_INTEGER:
-               return encode_integer(root,data.get(int()));
-       case ValueBase::TYPE_COLOR:
-               return encode_color(root,data.get(Color()));
-       case ValueBase::TYPE_VECTOR:
-               return encode_vector(root,data.get(Vector()));
-       case ValueBase::TYPE_ANGLE:
-               return encode_angle(root,data.get(Angle()));
-       case ValueBase::TYPE_BOOL:
-               return encode_bool(root,data.get(bool()));
-       case ValueBase::TYPE_STRING:
-               return encode_string(root,data.get(String()));
-       case ValueBase::TYPE_SEGMENT:
-               return encode_segment(root,data.get(Segment()));
-       case ValueBase::TYPE_BLINEPOINT:
-               return encode_bline_point(root,data.get(BLinePoint()));
-       case ValueBase::TYPE_GRADIENT:
-               return encode_gradient(root,data.get(Gradient()));
-       case ValueBase::TYPE_LIST:
-               return encode_list(root,data,canvas);
-       case ValueBase::TYPE_CANVAS:
-               return encode_canvas(root,data.get(Canvas::Handle()).get());
-       case ValueBase::TYPE_NIL:
-               sinfg::error("Encountered NIL ValueBase");
-               root->set_name("nil");
-               return root;
-       default:
-               sinfg::error(strprintf("Unknown value(%s), cannot create XML representation!",ValueBase::type_name(data.get_type()).c_str()));
-               root->set_name("nil");
-               return root;
-       }
-}
-
-xmlpp::Element* encode_animated(xmlpp::Element* root,ValueNode_Animated::ConstHandle value_node,Canvas::ConstHandle canvas=0)
-{
-       assert(value_node);
-       root->set_name("animated");
-
-       root->set_attribute("type",ValueBase::type_name(value_node->get_type()));
-
-       const ValueNode_Animated::WaypointList &waypoint_list=value_node->waypoint_list();
-       ValueNode_Animated::WaypointList::const_iterator iter;
-
-       for(iter=waypoint_list.begin();iter!=waypoint_list.end();++iter)
-       {
-               xmlpp::Element *waypoint_node=root->add_child("waypoint");
-               //waypoint_node->set_attribute("time",iter->get_time().get_string(canvas->rend_desc().get_frame_rate()));
-               waypoint_node->set_attribute("time",iter->get_time().get_string());
-
-               //waypoint_node->add_child(encode_value(iter->get_value(),canvas));
-               if(iter->get_value_node()->is_exported())
-                       waypoint_node->set_attribute("use",iter->get_value_node()->get_relative_id(canvas));
-               else
-                       encode_value_node(waypoint_node->add_child("value_node"),iter->get_value_node(),canvas);
-                                       
-               switch(iter->get_before())
-               {
-               case INTERPOLATION_HALT:
-                       waypoint_node->set_attribute("before","halt");
-                       break;
-               case INTERPOLATION_LINEAR:
-                       waypoint_node->set_attribute("before","linear");
-                       break;
-               case INTERPOLATION_MANUAL:
-                       waypoint_node->set_attribute("before","manual");
-                       break;
-               case INTERPOLATION_CONSTANT:
-                       waypoint_node->set_attribute("before","constant");
-                       break;
-               case INTERPOLATION_TCB:
-                       // This is the default value, so don't add a new attribute
-                       break;
-               default:
-                       error("Unknown waypoint type for \"before\" attribute");
-               }
-
-               switch(iter->get_after())
-               {
-               case INTERPOLATION_HALT:
-                       waypoint_node->set_attribute("after","halt");
-                       break;
-               case INTERPOLATION_LINEAR:
-                       waypoint_node->set_attribute("after","linear");
-                       break;
-               case INTERPOLATION_MANUAL:
-                       waypoint_node->set_attribute("after","manual");
-                       break;
-               case INTERPOLATION_CONSTANT:
-                       waypoint_node->set_attribute("after","constant");
-                       break;
-               case INTERPOLATION_TCB:
-                       // This is the default value, so don't add a new attribute
-                       break;
-               default:
-                       error("Unknown waypoint type for \"before\" attribute");
-               }
-
-               if(iter->get_tension()!=0.0)
-                       waypoint_node->set_attribute("tension",strprintf("%f",iter->get_tension()));
-               if(iter->get_time_tension()!=0.0)
-                       waypoint_node->set_attribute("temporal-tension",strprintf("%f",iter->get_time_tension()));
-               if(iter->get_continuity()!=0.0)
-                       waypoint_node->set_attribute("continuity",strprintf("%f",iter->get_continuity()));
-               if(iter->get_bias()!=0.0)
-                       waypoint_node->set_attribute("bias",strprintf("%f",iter->get_bias()));
-
-       }
-
-       return root;
-}
-
-xmlpp::Element* encode_composite(xmlpp::Element* root,ValueNode_Composite::ConstHandle value_node,Canvas::ConstHandle canvas=0)
-{
-       assert(value_node);
-       root->set_name("composite");
-
-       root->set_attribute("type",ValueBase::type_name(value_node->get_type()));
-
-       int i;
-       for(i=0;i<value_node->link_count();i++)
-       {
-               string name(strprintf("c%d",i+1));
-               assert(value_node->get_link(i));
-               if(value_node->get_link(i)->is_exported())
-                       root->set_attribute(name,value_node->get_link(i)->get_relative_id(canvas));
-               else
-                       encode_value_node(root->add_child(name)->add_child("value_node"),value_node->get_link(i).constant(),canvas);
-       }
-
-       return root;
-}
-
-xmlpp::Element* encode_subtract(xmlpp::Element* root,ValueNode_Subtract::ConstHandle value_node,Canvas::ConstHandle canvas=0)
-{
-       assert(value_node);
-       root->set_name("subtract");
-
-       ValueNode::ConstHandle lhs=value_node->get_lhs();
-       ValueNode::ConstHandle rhs=value_node->get_rhs();
-       ValueNode::ConstHandle scalar=value_node->get_scalar();
-
-       assert(lhs);
-       assert(rhs);
-
-       root->set_attribute("type",ValueBase::type_name(value_node->get_type()));
-
-       if(lhs==rhs)
-               warning("LHS is equal to RHS, this <subtract> will always be zero!");
-
-       //if(value_node->get_scalar()!=1)
-       //      root->set_attribute("scalar",strprintf(VECTOR_VALUE_TYPE_FORMAT,value_node->get_scalar()));
-
-       if(!scalar->get_id().empty())
-               root->set_attribute("scalar",scalar->get_relative_id(canvas));
-       else
-               encode_value_node(root->add_child("scalar")->add_child("value_node"),scalar,canvas);
-
-       if(!lhs->get_id().empty())
-               root->set_attribute("lhs",lhs->get_relative_id(canvas));
-       else
-               encode_value_node(root->add_child("lhs")->add_child("value_node"),lhs,canvas);
-
-       if(!rhs->get_id().empty())
-               root->set_attribute("rhs",rhs->get_relative_id(canvas));
-       else
-               encode_value_node(root->add_child("rhs")->add_child("value_node"),rhs,canvas);
-
-       return root;
-}
-
-xmlpp::Element* encode_dynamic_list(xmlpp::Element* root,ValueNode_DynamicList::ConstHandle value_node,Canvas::ConstHandle canvas=0)
-{
-       assert(value_node);
-//     const float fps(canvas?canvas->rend_desc().get_frame_rate():0);
-       const float fps(0);
-       
-       root->set_name(value_node->get_name());
-
-       root->set_attribute("type",ValueBase::type_name(value_node->get_contained_type()));
-
-       vector<ValueNode_DynamicList::ListEntry>::const_iterator iter;
-
-       ValueNode_BLine::ConstHandle bline_value_node(ValueNode_BLine::ConstHandle::cast_dynamic(value_node));
-       
-       if(bline_value_node)
-       {
-               if(bline_value_node->get_loop())
-                       root->set_attribute("loop","true");
-               else
-                       root->set_attribute("loop","false");
-       }
-       
-       for(iter=value_node->list.begin();iter!=value_node->list.end();++iter)
-       {
-               xmlpp::Element  *entry_node=root->add_child("entry");
-               assert(iter->value_node);
-               if(!iter->value_node->get_id().empty())
-                       entry_node->set_attribute("use",iter->value_node->get_relative_id(canvas));
-               else
-                       encode_value_node(entry_node->add_child("value_node"),iter->value_node,canvas);
-
-               // process waypoints
-               {
-                       typedef sinfg::ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
-                       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-                       String begin_sequence;
-                       String end_sequence;
-
-                       const ActivepointList& timing_info(iter->timing_info);
-                       ActivepointList::const_iterator entry_iter;
-                       
-                       for(entry_iter=timing_info.begin();entry_iter!=timing_info.end();++entry_iter)
-                               if(entry_iter->state==true)
-                               {
-                                       if(entry_iter->priority)
-                                               begin_sequence+=strprintf("p%d ",entry_iter->priority);
-                                       begin_sequence+=entry_iter->time.get_string(fps)+", ";
-                               }       
-                               else
-                               {
-                                       if(entry_iter->priority)
-                                               end_sequence+=strprintf("p%d ",entry_iter->priority);
-                                       end_sequence+=entry_iter->time.get_string(fps)+", ";
-                               }
-                       
-                       // If this is just a plane-jane vanilla entry,
-                       // then don't bother with begins and ends
-                       if(end_sequence.empty() && begin_sequence=="SOT, ")
-                               begin_sequence.clear();
-                       
-                       if(!begin_sequence.empty())
-                       {
-                               // Remove the last ", " stuff
-                               begin_sequence=String(begin_sequence.begin(),begin_sequence.end()-2);
-                               // Add the attribute
-                               entry_node->set_attribute("on",begin_sequence);                         
-                       }                               
-
-                       if(!end_sequence.empty())
-                       {
-                               // Remove the last ", " stuff
-                               end_sequence=String(end_sequence.begin(),end_sequence.end()-2);
-                               // Add the attribute
-                               entry_node->set_attribute("off",end_sequence);                          
-                       }                               
-               }
-       }
-
-       return root;
-}
-
-// Generic linkable data node entry
-xmlpp::Element* encode_linkable_value_node(xmlpp::Element* root,LinkableValueNode::ConstHandle value_node,Canvas::ConstHandle canvas=0)
-{
-       assert(value_node);
-       root->set_name(value_node->get_name());
-
-       root->set_attribute("type",ValueBase::type_name(value_node->get_type()));
-
-       int i;
-       for(i=0;i<value_node->link_count();i++)
-       {
-               ValueNode::ConstHandle link=value_node->get_link(i).constant();
-               if(!link)
-                       throw runtime_error("Bad link");
-               if(link->is_exported())
-                       root->set_attribute(value_node->link_name(i),link->get_relative_id(canvas));
-               else
-                       encode_value_node(root->add_child(value_node->link_name(i))->add_child("value_node"),link,canvas);
-       }
-
-       return root;
-}
-
-xmlpp::Element* encode_value_node(xmlpp::Element* root,ValueNode::ConstHandle value_node,Canvas::ConstHandle canvas)
-{
-       assert(value_node);
-
-       if(ValueNode_Animated::ConstHandle::cast_dynamic(value_node))
-               encode_animated(root,ValueNode_Animated::ConstHandle::cast_dynamic(value_node),canvas);
-       else
-       if(ValueNode_Composite::ConstHandle::cast_dynamic(value_node))
-               encode_composite(root,ValueNode_Composite::ConstHandle::cast_dynamic(value_node),canvas);
-       else
-       if(ValueNode_Subtract::ConstHandle::cast_dynamic(value_node))
-               encode_subtract(root,ValueNode_Subtract::ConstHandle::cast_dynamic(value_node),canvas);
-       else
-       if(ValueNode_DynamicList::ConstHandle::cast_dynamic(value_node))
-               encode_dynamic_list(root,ValueNode_DynamicList::ConstHandle::cast_dynamic(value_node),canvas);
-       else if(ValueNode_Const::ConstHandle::cast_dynamic(value_node))
-       {
-               encode_value(root,ValueNode_Const::ConstHandle::cast_dynamic(value_node)->get_value(),canvas);
-       }
-       else
-       if(LinkableValueNode::ConstHandle::cast_dynamic(value_node))
-               encode_linkable_value_node(root,LinkableValueNode::ConstHandle::cast_dynamic(value_node),canvas);
-       else
-       {
-               error(_("Unknown ValueNode Type (%s), cannot create an XML representation"),value_node->get_local_name().c_str());
-               root->set_name("nil");
-       }
-
-       assert(root);
-
-       if(!value_node->get_id().empty())
-               root->set_attribute("id",value_node->get_id());
-
-       if(value_node->rcount()>1)
-               root->set_attribute("guid",(value_node->get_guid()^canvas->get_root()->get_guid()).get_string());
-
-       return root;
-}
-
-xmlpp::Element* encode_layer(xmlpp::Element* root,Layer::ConstHandle layer)
-{
-       root->set_name("layer");
-
-       root->set_attribute("type",layer->get_name());
-       root->set_attribute("active",layer->active()?"true":"false");
-
-       if(!layer->get_version().empty())
-               root->set_attribute("version",layer->get_version());
-       if(!layer->get_description().empty())
-               root->set_attribute("desc",layer->get_description());
-       if(!layer->get_group().empty())
-               root->set_attribute("group",layer->get_group());
-
-       Layer::Vocab vocab(layer->get_param_vocab());
-       Layer::Vocab::const_iterator iter;
-
-       const Layer::DynamicParamList &dynamic_param_list=layer->dynamic_param_list();
-
-       for(iter=vocab.begin();iter!=vocab.end();++iter)
-       {
-               // Handle dynamic parameters
-               if(dynamic_param_list.count(iter->get_name()))
-               {
-                       xmlpp::Element *node=root->add_child("param");
-                       node->set_attribute("name",iter->get_name());
-
-                       handle<const ValueNode> value_node=dynamic_param_list.find(iter->get_name())->second;
-
-                       // If the valuenode.has no ID, then it must be defined in-place
-                       if(value_node->get_id().empty())
-                       {
-                               encode_value_node(node->add_child("value_node"),value_node,layer->get_canvas().constant());
-                       }
-                       else
-                       {
-                               node->set_attribute("use",value_node->get_relative_id(layer->get_canvas()));
-                       }
-               }
-               else  // Handle normal parameters
-               if(iter->get_critical())
-               {
-                       ValueBase value=layer->get_param(iter->get_name());
-                       if(!value.is_valid())
-                       {
-                               error("Layer doesn't know it's own vocabulary -- "+iter->get_name());
-                               continue;
-                       }
-
-                       if(value.get_type()==ValueBase::TYPE_CANVAS && !value.get(Canvas::LooseHandle())->is_inline())
-                       {
-                               Canvas::Handle child(value.get(Canvas::LooseHandle()));
-                               
-                               if(!value.get(Canvas::Handle()))
-                                       continue;
-                               xmlpp::Element *node=root->add_child("param");
-                               node->set_attribute("name",iter->get_name());
-                               node->set_attribute("use",child->get_relative_id(layer->get_canvas()));
-                               continue;
-                       }
-                       xmlpp::Element *node=root->add_child("param");
-                       node->set_attribute("name",iter->get_name());
-
-                       encode_value(node->add_child("value"),value,layer->get_canvas().constant());
-               }               
-       }
-
-
-       return root;
-}
-
-xmlpp::Element* encode_canvas(xmlpp::Element* root,Canvas::ConstHandle canvas)
-{
-       assert(canvas);
-       const RendDesc &rend_desc=canvas->rend_desc();
-       root->set_name("canvas");
-       
-       if(canvas->is_root())
-               root->set_attribute("version","0.1");
-
-       if(!canvas->get_id().empty() && !canvas->is_root() && !canvas->is_inline())
-               root->set_attribute("id",canvas->get_id());
-
-       if(!canvas->parent() || canvas->parent()->rend_desc().get_w()!=canvas->rend_desc().get_w())
-               root->set_attribute("width",strprintf("%d",rend_desc.get_w()));
-
-       if(!canvas->parent() || canvas->parent()->rend_desc().get_h()!=canvas->rend_desc().get_h())
-               root->set_attribute("height",strprintf("%d",rend_desc.get_h()));
-
-       if(!canvas->parent() || canvas->parent()->rend_desc().get_x_res()!=canvas->rend_desc().get_x_res())
-               root->set_attribute("xres",strprintf("%f",rend_desc.get_x_res()));
-
-       if(!canvas->parent() || canvas->parent()->rend_desc().get_y_res()!=canvas->rend_desc().get_y_res())
-               root->set_attribute("yres",strprintf("%f",rend_desc.get_y_res()));
-
-
-       if(!canvas->parent() ||
-               canvas->parent()->rend_desc().get_tl()!=canvas->rend_desc().get_tl() ||
-               canvas->parent()->rend_desc().get_br()!=canvas->rend_desc().get_br())
-       root->set_attribute("view-box",strprintf(VIEW_BOX_FORMAT,
-               rend_desc.get_tl()[0],
-               rend_desc.get_tl()[1],
-               rend_desc.get_br()[0],
-               rend_desc.get_br()[1])
-       );
-
-       if(!canvas->parent() || canvas->parent()->rend_desc().get_antialias()!=canvas->rend_desc().get_antialias())
-               root->set_attribute("antialias",strprintf("%d",rend_desc.get_antialias()));
-
-       if(!canvas->parent())
-               root->set_attribute("fps",strprintf(TIME_TYPE_FORMAT,rend_desc.get_frame_rate()));
-
-       if(!canvas->parent() || canvas->parent()->rend_desc().get_time_start()!=canvas->rend_desc().get_time_start())
-               root->set_attribute("begin-time",rend_desc.get_time_start().get_string(rend_desc.get_frame_rate()));
-
-       if(!canvas->parent() || canvas->parent()->rend_desc().get_time_end()!=canvas->rend_desc().get_time_end())
-               root->set_attribute("end-time",rend_desc.get_time_end().get_string(rend_desc.get_frame_rate()));
-       
-       if(!canvas->is_inline())
-       {
-               root->set_attribute("bgcolor",strprintf(VIEW_BOX_FORMAT,
-                       rend_desc.get_bg_color().get_r(),
-                       rend_desc.get_bg_color().get_g(),
-                       rend_desc.get_bg_color().get_b(),
-                       rend_desc.get_bg_color().get_a())
-               );
-
-               if(!canvas->get_name().empty())
-                       root->add_child("name")->set_child_text(canvas->get_name());
-               if(!canvas->get_description().empty())
-                       root->add_child("desc")->set_child_text(canvas->get_description());
-               if(!canvas->get_author().empty())
-                       root->add_child("author")->set_child_text(canvas->get_description());
-
-               std::list<String> meta_keys(canvas->get_meta_data_keys());
-               while(!meta_keys.empty())
-               {
-                       xmlpp::Element* meta_element(root->add_child("meta"));
-                       meta_element->set_attribute("name",meta_keys.front());
-                       meta_element->set_attribute("content",canvas->get_meta_data(meta_keys.front()));
-                       meta_keys.pop_front();
-               }
-               for(KeyframeList::const_iterator iter=canvas->keyframe_list().begin();iter!=canvas->keyframe_list().end();++iter)
-                       encode_keyframe(root->add_child("keyframe"),*iter,canvas->rend_desc().get_frame_rate());
-       }
-       
-       // Output the <defs> section
-       if(!canvas->is_inline() && !canvas->value_node_list().empty() || !canvas->children().empty())
-       {
-               xmlpp::Element *node=root->add_child("defs");
-               const ValueNodeList &value_node_list(canvas->value_node_list());
-
-               for(ValueNodeList::const_iterator iter=value_node_list.begin();iter!=value_node_list.end();++iter)
-               {
-                       // If the value_node is a constant, then use the shorthand
-                       if(handle<ValueNode_Const>::cast_dynamic(*iter))
-                       {
-                               ValueNode_Const::Handle value_node(ValueNode_Const::Handle::cast_dynamic(*iter));
-                               reinterpret_cast<xmlpp::Element*>(encode_value(node->add_child("value"),value_node->get_value()))->set_attribute("id",value_node->get_id());
-                               continue;
-                       }
-                       encode_value_node(node->add_child("value_node"),*iter,canvas);
-                       // writeme
-               }
-
-               for(Canvas::Children::const_iterator iter=canvas->children().begin();iter!=canvas->children().end();++iter)
-               {
-                       encode_canvas(node->add_child("canvas"),*iter);
-               }
-       }       
-
-       Canvas::const_reverse_iterator iter;
-
-       for(iter=canvas->rbegin();iter!=canvas->rend();++iter)
-               encode_layer(root->add_child("layer"),*iter);   
-
-       return root;
-}
-
-bool
-sinfg::save_canvas(const String &filename, Canvas::ConstHandle canvas)
-{
-       sinfg::String tmp_filename(filename+".TMP");
-
-       try
-       {
-               assert(canvas);
-               xmlpp::Document document;
-       
-               encode_canvas(document.create_root_node("canvas"),canvas);
-       
-               document.write_to_file_formatted(tmp_filename);
-       }
-       catch(...) { sinfg::error("sinfg::save_canvas(): Caught unknown exception"); return false; }
-       
-       
-#ifdef _WIN32
-       // On Win32 platforms, rename() has bad behavior. work around it.
-       char old_file[80]="sif.XXXXXXXX";
-       mktemp(old_file);
-       rename(filename.c_str(),old_file);      
-       if(rename(tmp_filename.c_str(),filename.c_str())!=0)
-       {
-               rename(old_file,tmp_filename.c_str());
-               sinfg::error("sinfg::save_canvas(): Unable to rename file to correct filename, errno=%d",errno);
-               return false;
-       }
-       remove(old_file);
-#else
-       if(rename(tmp_filename.c_str(),filename.c_str())!=0)
-       {
-               sinfg::error("sinfg::save_canvas(): Unable to rename file to correct filename, errno=%d",errno);
-               return false;
-       }
-#endif
-
-       return true;
-}
-
-String
-sinfg::canvas_to_string(Canvas::ConstHandle canvas)
-{
-       assert(canvas);
-
-       xmlpp::Document document;
-
-       encode_canvas(document.create_root_node("canvas"),canvas);
-
-       return document.write_to_string_formatted();
-}
diff --git a/synfig-core/trunk/src/sinfg/savecanvas.h b/synfig-core/trunk/src/sinfg/savecanvas.h
deleted file mode 100644 (file)
index e519415..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file savecanvas.h
-**     \brief writeme
-**
-**     $Id: savecanvas.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_SAVECANVAS_H
-#define __SINFG_SAVECANVAS_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "string.h"
-#include "canvas.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/* === E X T E R N S ======================================================= */
-
-//!    Saves a canvas to \a filename
-/*!    \return \c true on success, \c false on error. */
-bool save_canvas(const String &filename, Canvas::ConstHandle canvas);
-
-//! Stores a Canvas in a string in XML format
-String canvas_to_string(Canvas::ConstHandle canvas);
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/segment.h b/synfig-core/trunk/src/sinfg/segment.h
deleted file mode 100644 (file)
index 10b1ab3..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file segment.h
-**     \brief Template Header
-**
-**     $Id: segment.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_SEGMENT_H
-#define __SINFG_SEGMENT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "vector.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-/*!    \struct Segment
-**     \todo writeme
-*/
-struct Segment
-{
-       Point   p1,p2;
-       Vector  t1,t2;
-
-       Segment() { }
-       Segment(Point p1,Vector t1,Point p2, Vector t2):
-               p1(p1),
-               p2(p2),
-               t1(t1),
-               t2(t2)
-       { }
-       Segment(Point p1,Point p2):
-               p1(p1),
-               p2(p2),
-               t1(p2-p1),
-               t2(p2-p1)
-       { }
-}; // END of struct Segment
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/sinfg.h b/synfig-core/trunk/src/sinfg/sinfg.h
deleted file mode 100644 (file)
index 6f2c4e8..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file sinfg.h
-**     \brief Primary Header for Sinfg
-**
-**     $Id: sinfg.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG__
-#define __SINFG__
-
-#ifndef __cplusplus
-#error Sorry, Sinfg only supports C++ at this time. See README for details.
-#endif
-
-#warning The use of this header is deprecated. Please use the individual header files.
-
-/* === M A C R O S ========================================================= */
-
-/*! \def SINFG_LEAN
-**     \brief Define this to remove unused features, speeding up compile time.
-**
-**     Define SINFG_LEAN if your plug-in
-**     or program doesn't use the sinfg::Angle class
-**     or the rendering subsystem. This can speed up
-**     compiles. You may also wish to individualy
-**     use the macros SINFG_NO_ANGLE and
-**     SINFG_NO_RENDER.
-**     \see SINFG_NO_ANGLE, SINFG_NO_RENDER
-*/
-#ifdef SINFG_LEAN
-# ifndef SINFG_NO_ANGLE
-#  define SINFG_NO_ANGLE
-# endif
-# ifndef SINFG_NO_RENDER
-#  define SINFG_NO_RENDER
-# endif
-#endif
-
-/*!    \def SINFG_LAYER
-**     The SINFG_LAYER macro is useful for when you
-**     are compiling layers, and can help to improve
-**     build time.
-*/
-#ifdef SINFG_LAYER
-# ifndef SINFG_NO_RENDER
-#  define SINFG_NO_RENDER
-# endif
-# define SINFG_NO_LOADSAVE
-#endif
-
-/*!    \def SINFG_TARGET
-**     The SINFG_TARGET macro is useful for when you
-**     are compiling render targets, and can help to
-**     improve build time.
-*/
-#ifdef SINFG_TARGET
-# ifdef SINFG_NO_RENDER
-#  error You defined SINFG_TARGET, but also SINFG_NO_RENDER. This doesnt make sense.
-# endif
-# ifndef SINFG_NO_ANGLE
-#  define SINFG_NO_ANGLE
-# endif
-# define SINFG_NO_LOADSAVE
-#endif
-
-/*!    \def SINFG_MODULE
-**     \todo Writeme
-*/
-#ifdef SINFG_MODULE
-# define SINFG_NO_LOADSAVE
-#endif
-
-/*! \namespace sinfg
-**     \brief Where every function and class of the sinfg library can be found
-**     \todo Writeme
-*/
-
-/* === H E A D E R S ======================================================= */
-
-#include "version.h"
-#include "general.h"
-#include "module.h"
-#include "color.h"
-#include "canvas.h"
-#include "layer.h"
-#include "vector.h"
-#include "types.h"
-#include "segment.h"
-
-#ifndef SINFG_NO_RENDER
-# include "render.h"
-#endif
-
-#ifndef SINFG_LAYER
-#include "target.h"
-#endif
-
-#include "valuenode.h"
-#include "valuenode_subtract.h"
-//#include "valuenode_animated.h"
-#include "valuenode_composite.h"
-#include "valuenode_const.h"
-#include "valuenode_linear.h"
-#include "valuenode_dynamiclist.h"
-#include "valuenode_reference.h"
-
-#ifndef SINFG_NO_LOADSAVE
-# include "savecanvas.h"
-# include "loadcanvas.h"
-#endif
-
-#include "importer.h"
-#include "surface.h"
-
-#include "string.h"
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/sinfg.nsh b/synfig-core/trunk/src/sinfg/sinfg.nsh
deleted file mode 100644 (file)
index f7c484a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-; The stuff to install\r
-Section "Synfig Core"\r
-\r
-  SectionIn RO\r
-  \r
-  ; Set output path to the installation directory.\r
-  SetOutPath "$INSTDIR\bin"\r
-  \r
-  ; Put file there\r
-  File "src\sinfg\.libs\libsinfg-0.dll"\r
-\r
-SectionEnd\r
-\r
-Section "un.Synfig Core"\r
-       Delete "$INSTDIR\bin\libsinfg-0.dll"\r
-       RMDir "$INSTDIR"\r
-SectionEnd\r
-\r
-\r
diff --git a/synfig-core/trunk/src/sinfg/smartfile.h b/synfig-core/trunk/src/sinfg/smartfile.h
deleted file mode 100644 (file)
index 25d2de3..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file smartfile.h
-**     \brief Template Header
-**
-**     $Id: smartfile.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_SMARTFILE_H
-#define __SINFG_SMARTFILE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <cstdio>
-#include <ETL/smart_ptr>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-struct _FILE_deleter
-{
-       void operator()(FILE* x)const { if(x!=stdout && x!=stdin) fclose(x); }
-};
-       
-typedef etl::smart_ptr<FILE,_FILE_deleter> SmartFILE;
-       
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/string.h b/synfig-core/trunk/src/sinfg/string.h
deleted file mode 100644 (file)
index 58d8bec..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file string.h
-**     \brief Template Header
-**
-**     $Id: string.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_STRING_H
-#define __SINFG_STRING_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <string>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-/*
-namespace std
-{
-template<class _CharT> struct char_traits;
-template<> struct char_traits<char>;
-template<typename _Alloc> class allocator;
-template<typename _CharT, typename _Traits,typename _Alloc>class basic_string;
-typedef basic_string<char,char_traits<char>,allocator<char> >    string;
-
-}; // END of namespace std
-*/
-
-namespace sinfg
-{
-
-/*!    \typedef String
-**     \todo writeme
-*/
-typedef std::string String;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/string_decl.h b/synfig-core/trunk/src/sinfg/string_decl.h
deleted file mode 100644 (file)
index 17cbd61..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file string_decl.h
-**     \brief Template Header
-**
-**     $Id: string_decl.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_STRING_DECL_H
-#define __SINFG_STRING_DECL_H
-
-/* === H E A D E R S ======================================================= */
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace std
-{
-template<class _CharT> struct char_traits;
-template<> struct char_traits<char>;
-template<typename _Alloc> class allocator;
-template<typename _CharT, typename _Traits,typename _Alloc>class basic_string;
-typedef basic_string<char,char_traits<char>,allocator<char> >    string;
-
-}; // END of namespace std
-
-namespace sinfg
-{
-
-/*!    \typedef String
-**     \todo writeme
-*/
-typedef std::string String;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/surface.cpp b/synfig-core/trunk/src/sinfg/surface.cpp
deleted file mode 100644 (file)
index fb905b7..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/* ========================================================================
-** Sinfg
-** Template File
-** $Id: surface.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
-**
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
-**
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
-**
-** === N O T E S ===========================================================
-**
-** ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "canvas.h"
-#include "surface.h"
-#include "target_scanline.h"
-#include "general.h"
-
-#ifdef HAS_VIMAGE
-#include <Accelerate/Accelerate.h>
-#endif
-
-#endif
-
-using namespace sinfg;
-using namespace std;
-using namespace etl;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-class target2surface : public sinfg::Target_Scanline
-{
-public:
-       Surface *surface;
-       bool     sized;
-public:
-       target2surface(Surface *surface);
-       virtual ~target2surface();
-
-       virtual bool set_rend_desc(sinfg::RendDesc *newdesc);
-       
-       virtual bool start_frame(sinfg::ProgressCallback *cb);
-       
-       virtual void end_frame();
-
-       virtual Color * start_scanline(int scanline);
-
-       virtual bool end_scanline();
-};
-
-target2surface::target2surface(Surface *surface):surface(surface)
-{
-}
-
-target2surface::~target2surface()
-{
-}
-
-bool
-target2surface::set_rend_desc(sinfg::RendDesc *newdesc)
-{
-       assert(newdesc);
-       assert(surface);
-       desc=*newdesc;
-       return sinfg::Target_Scanline::set_rend_desc(newdesc);
-}
-       
-bool
-target2surface::start_frame(sinfg::ProgressCallback *cb) 
-{ 
-       if(surface->get_w() != desc.get_w() || surface->get_h() != desc.get_h())
-       {
-               surface->set_wh(desc.get_w(),desc.get_h());
-       }
-       return true; 
-}
-       
-void
-target2surface::end_frame()
-{
-       return;
-}
-       
-Color *
-target2surface::start_scanline(int scanline)
-{
-       return (*surface)[scanline];
-}
-
-bool
-target2surface::end_scanline()
-{
-       return true;
-}
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Target_Scanline::Handle
-sinfg::surface_target(Surface *surface)
-{
-       return Target_Scanline::Handle(new target2surface(surface));
-}
-
-void
-sinfg::Surface::clear()
-{
-#ifdef HAS_VIMAGE
-       fill(Color(0.5,0.5,0.5,0.0000001));
-#else
-       etl::surface<Color, ColorAccumulator, ColorPrep>::clear();
-#endif
-}
-
-void
-sinfg::Surface::blit_to(alpha_pen& pen, int x, int y, int w, int h)
-{
-       static const float epsilon(0.00001);
-       const float alpha(pen.get_alpha());
-       if(     pen.get_blend_method()==Color::BLEND_STRAIGHT && fabs(alpha-1.0f)<epsilon )
-       {
-               if(x>=get_w() || y>=get_w())
-                       return;
-
-               //clip source origin
-               if(x<0)
-               {
-                       w+=x;   //decrease
-                       x=0;            
-               }
-               
-               if(y<0)
-               {
-                       h+=y;   //decrease
-                       y=0;            
-               }
-                               
-               //clip width against dest width
-               w = min(w,pen.end_x()-pen.x());
-               h = min(h,pen.end_y()-pen.y());
-               
-               //clip width against src width
-               w = min(w,get_w()-x);           
-               h = min(h,get_h()-y);   
-
-               if(w<=0 || h<=0)
-                       return;
-                               
-               for(int i=0;i<h;i++)
-               {
-                       char* src(static_cast<char*>(static_cast<void*>(operator[](y)+x))+i*get_w()*sizeof(Color));
-                       char* dest(static_cast<char*>(static_cast<void*>(pen.x()))+i*pen.get_width()*sizeof(Color));
-                       memcpy(dest,src,w*sizeof(Color));
-               }
-               return;
-       }
-       
-#ifdef HAS_VIMAGE      
-       if(     pen.get_blend_method()==Color::BLEND_COMPOSITE && fabs(alpha-1.0f)<epsilon )
-       {
-               if(x>=get_w() || y>=get_w())
-                       return;
-
-               //clip source origin
-               if(x<0)
-               {
-                       //u-=x; //increase
-                       w+=x;   //decrease
-                       x=0;            
-               }
-               
-               if(y<0)
-               {
-                       //v-=y; //increase
-                       h+=y;   //decrease
-                       y=0;            
-               }
-                               
-               //clip width against dest width
-               w = min(w,pen.end_x()-pen.x());
-               h = min(h,pen.end_y()-pen.y());
-               
-               //clip width against src width
-               w = min(w,get_w()-x);           
-               h = min(h,get_h()-y);   
-
-               if(w<=0 || h<=0)
-                       return;
-
-
-
-               vImage_Buffer top,bottom;
-               vImage_Buffer& dest(bottom);
-               
-               top.data=static_cast<void*>(operator[](y)+x);
-               top.height=h;
-               top.width=w;
-               //top.rowBytes=get_w()*sizeof(Color); //! \fixme this should get the pitch!!
-               top.rowBytes=get_pitch();
-
-               bottom.data=static_cast<void*>(pen.x());
-               bottom.height=h;
-               bottom.width=w;
-               //bottom.rowBytes=pen.get_width()*sizeof(Color); //! \fixme this should get the pitch!!
-               bottom.rowBytes=pen.get_pitch(); //! \fixme this should get the pitch!!
-                               
-               vImage_Error ret;
-               ret=vImageAlphaBlend_ARGBFFFF(&top,&bottom,&dest,kvImageNoFlags);
-               
-               assert(ret!=kvImageNoError);
-               
-               return;
-       }
-#endif
-       etl::surface<Color, ColorAccumulator, ColorPrep>::blit_to(pen,x,y,w,h);
-}
-
diff --git a/synfig-core/trunk/src/sinfg/surface.h b/synfig-core/trunk/src/sinfg/surface.h
deleted file mode 100644 (file)
index 976b159..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file surface.h
-**     \brief Surface and Pen Definitions
-**
-**     $Id: surface.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_SURFACE_H
-#define __SINFG_SURFACE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "color.h"
-#include "renddesc.h"
-#include <ETL/pen>
-#include <ETL/surface>
-#include <ETL/handle>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Target;
-class Target_Scanline;
-
-class ColorPrep
-{
-public:
-       ColorAccumulator cook(Color x)const
-       {
-               x.set_r(x.get_r()*x.get_a());
-               x.set_g(x.get_g()*x.get_a());
-               x.set_b(x.get_b()*x.get_a());
-               return x;
-       }
-       Color uncook(ColorAccumulator x)const
-       {
-               if(!x.get_a())
-                       return Color::alpha();
-               
-               const float a(1.0f/x.get_a());
-               
-               x.set_r(x.get_r()*a);
-               x.set_g(x.get_g()*a);
-               x.set_b(x.get_b()*a);
-               return x;
-       }
-};
-
-/*!    \class Surface
-**     \brief Bitmap Surface
-**     \todo writeme
-*/
-class Surface : public etl::surface<Color, ColorAccumulator, ColorPrep>
-{
-public:
-       typedef Color value_type;
-       class alpha_pen;
-
-       Surface() { }
-
-       Surface(const size_type::value_type &w, const size_type::value_type &h):
-               etl::surface<Color, ColorAccumulator,ColorPrep>(w,h) { }
-
-       Surface(const size_type &s):
-               etl::surface<Color, ColorAccumulator,ColorPrep>(s) { }
-
-       template <typename _pen>
-       Surface(const _pen &_begin, const _pen &_end):
-               etl::surface<Color, ColorAccumulator,ColorPrep>(_begin,_end) { }
-
-       template <class _pen> void blit_to(_pen &pen)
-       { return blit_to(pen,0,0, get_w(),get_h()); }
-
-       template <class _pen> void
-       blit_to(_pen& DEST_PEN, int x, int y, int w, int h)
-       {
-               etl::surface<Color, ColorAccumulator, ColorPrep>::blit_to(DEST_PEN,x,y,w,h);
-       }
-
-       void clear();
-
-       void blit_to(alpha_pen& DEST_PEN, int x, int y, int w, int h);
-};     // END of class Surface
-
-#ifndef DOXYGEN_SKIP
-
-/*! \internal Used by Pen_Alpha */
-struct _BlendFunc
-{
-       Color::BlendMethod blend_method;
-
-       _BlendFunc(Color::BlendMethod b= Color::BLEND_COMPOSITE):blend_method(b) { }
-
-       Color operator()(const Color &a,const Color &b,const Color::value_type &t)const
-       {
-               return Color::blend(b,a,t,blend_method);
-       }
-};     // END of class _BlendFunc
-
-#endif
-
-/*!    \class Surface::alpha_pen
-**     \brief Alpha-Blending Pen
-**
-**     This pen works like a normal alpha pen, except that it supports
-**     a variety of blending methods. Use set_blend_method() to select
-**     which blending method you want to use.
-**     The default blending method is Color::BLEND_COMPOSITE.
-**     \see Color::BlendMethod
-*/
-class Surface::alpha_pen : public etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc >
-{
-public:
-       alpha_pen() { }
-       alpha_pen(const etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc > &x):
-               etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc >(x)
-       { }
-       
-       alpha_pen(const etl::generic_pen<Color, ColorAccumulator>& pen, const Color::value_type &a = 1, const _BlendFunc &func = _BlendFunc()):
-               etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc >(pen,a,func)
-       { }
-
-       //! Sets the blend method to that described by \a method
-       void set_blend_method(Color::BlendMethod method) { affine_func_.blend_method=method; }
-
-       //! Returns the blend method being used for this pen
-       Color::BlendMethod get_blend_method()const { return affine_func_.blend_method; }
-};     // END of class Surface::alpha_pen
-
-//! Creates a target that will render to \a surface
-etl::handle<Target_Scanline> surface_target(Surface *surface);
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/surfacenew.cpp b/synfig-core/trunk/src/sinfg/surfacenew.cpp
deleted file mode 100644 (file)
index 42814f6..0000000
+++ /dev/null
@@ -1,705 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file surfacenew.cpp
-**     \brief Template File
-**
-**     $Id: surfacenew.cpp,v 1.1 2005/01/21 19:29:10 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "surfacenew.h"
-#include <ETL/ref_count>
-#include "mutex.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-class SurfaceNew::ChannelData
-{
-private:
-       etl::reference_counter ref_count_;
-
-       float* data_;
-       float* origin_;
-       
-       int w_,h_,stride_;
-       
-public:
-
-       RWLock rw_lock;
-
-       ChannelData():
-               is_defined_(false),
-               data_(0),
-               origin_(0),
-               w_(0),
-               h_(0)
-       {
-       }
-       
-       ~ChannelData()
-       {
-               if(ref_count_.unique())
-                       delete [] data_;
-       }
-       
-       void set_wh(int w, int h)
-       {
-               w_=w;
-               h_=h;
-               stride_=w;
-               
-               if(data_&&ref_count_.is_unique())
-                       delete [] data_;
-                       
-               ref_count.make_unique();
-               data_=new float [w_*h_];
-               origin_=data_;
-               clear();
-       }
-       
-       void crop(int x, int y, int w, int h)
-       {
-               origin_=origin+y*stride_+x;
-               w_=w;
-               h_=h;
-       }
-       
-       int get_stride()const
-       {
-               return stride_;
-       }
-       
-       void clear()
-       {
-               for(int i=0;i<h;i++)
-                       bzero(origin_+stride_*i,w_*sizeof(float));
-       }
-
-       void fill(float v)
-       {
-               float* ptr(get_data());
-               
-               for(int y=0;y<h;y++,ptr+=stride_)
-                       for(int i=0;i<w_;i++)
-                               ptr[i]=v;
-       }
-
-       float* get_data() { return origin_; }
-
-       void make_unique()
-       {
-               if(!ref_count_.unique())
-               {
-                       ref_count_.make_unique();
-                       float* old_data(origin_);
-                       int old_stride;
-                       
-                       data_=new float [w_*h_];
-                       origin_=data_;
-                       stride_=w_;
-                       
-                       for(int i=0;i<h;i++)
-                               memcpy(data_+i*stride_,old_data+i*old_stride,sizeof(float)*w_);
-               }
-       }
-}; // END of class ChannelData
-
-/* === M E T H O D S ======================================================= */
-
-SurfaceNew::SurfaceNew():
-       w_(0),
-       h_(0),
-       color_system_(COLORSYS_RGB),
-       premult_flag_(false)
-{
-}
-
-SurfaceNew~SurfaceNew()
-{
-}
-
-SurfaceNew::Handle
-SurfaceNew::create(int w, int h, ColorSystem sys=COLORSYS_RGB)
-{
-       Handle ret(new SurfaceNew);
-       
-       ret.set_wh(w,h);
-       ret.set_color_system(sys);
-       
-       return ret;
-}
-
-SurfaceNew::Handle
-SurfaceNew::create(const Surface&)
-{
-       // ***WRITEME***
-       return 0;
-}
-
-SurfaceNew::Handle
-SurfaceNew::create(HandleConst orig)
-{
-       Lock lock(orig);
-       
-       Handle ret(new SurfaceNew);
-
-       ret.w_=orig.w_;
-       ret.h_=orig.h_;
-       ret.color_system_=orig.color_system_;
-       ret.premult_flag_=orig.premult_flag_;
-       ret.channel_map_=orig.channel_map_;
-       
-       return ret;
-}
-
-Handle
-SurfaceNew::crop(HandleConst, int x, int y, int w, int h)
-{
-       Lock lock(orig);
-       
-       Handle ret(new SurfaceNew);
-
-       ret.w_=orig.w_;
-       ret.h_=orig.h_;
-       ret.color_system_=orig.color_system_;
-       ret.premult_flag_=orig.premult_flag_;
-       ret.channel_map_=orig.channel_map_;
-
-       std::map<Channel,ChannelData>::iterator iter;
-       for(iter=ret.channel_map_.begin();iter!=ret.channel_map_.end();++iter)
-               iter->crop(x,y,w,h);
-       
-       return ret;
-}
-
-int
-SurfaceNew::get_w()const
-{
-       return w_;
-}
-       
-int
-SurfaceNew::get_h()const
-{
-       return h_;
-}
-       
-void
-SurfaceNew::set_wh(int w, int h)
-{
-       if(w!=w_ || h!=h_)
-       {
-               w_=w;
-               h_=h;
-               channel_map_.clear();
-       }
-}
-
-SurfaceNew::ColorSystem
-SurfaceNew::get_color_system()const
-{
-       return color_system_;
-}
-
-void
-SurfaceNew::set_color_system(SurfaceNew::ColorSystem x)
-{
-       color_system_=x;
-}
-
-Color
-SurfaceNew::get_color(int x, int y)const
-{
-       // This operation is rather expensive, as it should be.
-       // I want to discurage people from using it all over the place.
-       
-       Color ret(
-               lock_channel_const(CHAN_R).get_value(x,y),
-               lock_channel_const(CHAN_G).get_value(x,y),
-               lock_channel_const(CHAN_B).get_value(x,y),
-               lock_channel_const(CHAN_A).get_value(x,y)
-       );
-       
-       if(get_premult())
-       {
-               ret=ret.demult_alpha();
-       }
-       
-       return ret;
-}
-       
-void
-SurfaceNew::lock()
-{
-       mutex_.lock();
-}
-       
-void
-SurfaceNew::unlock()
-{
-       mutex_.unlock();
-}
-       
-bool
-SurfaceNew::trylock()
-{
-       return mutex_.trylock();
-}
-       
-SurfaceNew::ChannelLock
-SurfaceNew::lock_channel(SurfaceNew::Channel chan)
-{
-       if(!is_channel_defined(chan)
-               channel_map_[chan].set_wh(get_w(),get_h());
-       else
-               channel_map_[chan].make_unique();
-
-       ChannelLockConst channel_lock;
-       
-       channel_lock.surface_=this;
-       channel_lock.channel_=chan;
-
-       channel_map_[chan].rw_lock.writer_lock();
-       
-       return channel_lock;
-}
-
-SurfaceNew::ChannelLockConst
-SurfaceNew::lock_channel_const(SurfaceNew::Channel chan)const
-{
-       if(!is_channel_defined(chan)
-               channel_map_[chan].set_wh(get_w(),get_h());
-
-       ChannelLockConst channel_lock;
-       
-       channel_lock.surface_=this;
-       channel_lock.channel_=chan;
-
-       channel_map_[chan].rw_lock.reader_lock();
-       
-       return channel_lock;
-}
-
-SurfaceNew::ChannelLock
-SurfaceNew::lock_channel_alpha(SurfaceNew::Channel chan)
-{
-       // Change this when per-channel alpha
-       // is implemented
-       return lock_channel(CHAN_A);
-}
-
-SurfaceNew::ChannelLockConst
-SurfaceNew::lock_channel_alpha_const(SurfaceNew::Channel chan)const
-{
-       // Change this when per-channel alpha
-       // is implemented
-       return lock_channel_const(CHAN_A);
-}
-
-bool
-SurfaceNew::is_channel_defined(Channel chan)const
-{
-       return channel_map_.count(chan);
-}
-
-bool
-SurfaceNew::get_premult()const
-{
-       return premult_flag_;
-}
-
-void
-SurfaceNew::set_premult(bool x)
-{
-       if(x==premult_flag_)
-               return;
-               
-       premult_flag_=x;
-       
-       for(int i=0;i<3;i++)
-       {
-               Channel chan;
-               if(get_color_system()==COLORSYS_RGB)switch(i)
-               {
-                       case 0: chan=CHAN_R;
-                       case 1: chan=CHAN_G;
-                       case 2: chan=CHAN_B;
-               }
-               else
-               if(get_color_system()==COLORSYS_YUV)switch(i)
-               {
-                       case 0: chan=CHAN_Y;
-                       case 1: chan=CHAN_U;
-                       case 2: chan=CHAN_V;
-               }
-               
-               // If this channel isn't defined, then
-               // skip it and move on to the next one
-               if(!is_channel_defined(chan))
-                       continue;
-                       
-               ChannelLock color_channel(lock_channel(chan));
-               ChannelLockConst alpha_channel(lock_channel_alpha_const(chan));
-               const int w(get_w());
-               const int h(get_h());
-               
-               float* color_ptr(color_channel.get_data_ptr());
-               const float* alpha_ptr(alpha_channel.get_data_ptr());
-               
-               const int color_pitch(color_channel.get_data_ptr_stride()-w);
-               const int alpha_pitch(alpha_channel.get_data_ptr_stride()-w);
-               
-               if(premult_flag_)
-               {
-                       for(int y=0;y<h;y++,color_ptr+=color_pitch,alpha_ptr+=alpha_pitch)
-                               for(int x=0;x<w;x++,color_ptr++,alpha_ptr++)
-                                       *color_ptr *= *alpha_ptr;
-               }
-               else
-               {
-                       for(int y=0;y<h;y++,color_ptr+=color_pitch,alpha_ptr+=alpha_pitch)
-                               for(int x=0;x<w;x++,color_ptr++,alpha_ptr++)
-                                       *color_ptr /= *alpha_ptr;
-               }
-       }
-}
-
-void
-SurfaceNew::blit(
-       Handle dest, int x_dest, int y_dest,
-       HandleConst src, int x_src, int y_src, int w_src, int h_src,
-       float amount=1.0, Color::BlendMethod bm=Color::BLEND_COMPOSITE
-)
-{
-       blit(
-               dest,
-               x_dest,
-               y_dest,
-               crop(
-                       src,
-                       x,
-                       y,
-                       w,
-                       h
-               ),
-               amount,
-               bm
-       );
-}
-
-void
-SurfaceNew::blit(
-       Handle dest, int x_dest, int y_dest,
-       HandleConst src
-       float amount=1.0, Color::BlendMethod bm=Color::BLEND_COMPOSITE
-)
-{
-       int w(src->get_w()), h(src->get_h);
-       
-       // Clip
-       {
-               int x(0), y(0);
-               
-               if(x_dest+w>dest.get_w())
-                       w=dest.get_w()-x_dest;
-               if(y_dest+h>dest.get_h())
-                       h=dest.get_h()-y_dest;
-               if(x_dest<0)
-               {
-                       x-=x_dest;
-                       w+=x_dest;
-               }
-               if(y_dest<0)
-               {
-                       y-=y_dest;
-                       h+=y_dest;
-               }
-               src=crop(src,x,y,w,h);
-       }
-       
-       dest=crop(dest,x_dest,y_dest,w,h);
-
-       if(bm==Color::BLEND_STRAIGHT)
-       {
-               chan_mlt(dest,amount/(1.0-amount));
-               chan_add(dest,src);
-               chan_mlt(dest,(1.0-amount)/amount);
-       }
-       
-       if(bm==Color::BLEND_COMPOSITE)
-       {
-               
-       }
-}
-
-
-
-// -----------------------------------------------------------------------------------
-
-SurfaceChannelLockConst::SurfaceChannelLockConst():
-       data_ptr_checked_out_(false)
-{
-}
-
-SurfaceChannelLockConst::~SurfaceChannelLockConst()
-{
-       if(data_ptr_checked_out_)
-               release_data_ptr();
-               
-       if(surface_ && ref_count_.is_unique())
-               return surface->channel_map_[channel_].rw_lock.reader_unlock();
-       surface=0;
-}
-
-SurfaceChannel
-SurfaceChannelLockConst::get_channel()const
-{
-       return channel_;
-}
-
-int
-SurfaceChannelLockConst::get_w()const
-{
-       return surface_->get_w();
-}
-       
-int
-SurfaceChannelLockConst::get_h()const
-{
-       return surface_->get_h();
-}
-       
-float
-SurfaceChannelLockConst::get_value(int x, int y)
-{
-       // WOW! CRAZY SLOW!
-       const ChannelData& channel_data(surface_->channel_map_[channel_]);
-       return *(channel_data.get_data()+y*channel_data.get_stride()+x);
-}
-
-const float*
-SurfaceChannelLockConst::get_data_ptr()const
-{
-       data_ptr_checked_out_=true;
-       
-       // WOW! CRAZY SLOW!
-       return surface_->channel_map_[channel_].get_data();
-}
-
-int
-SurfaceChannelLockConst::get_data_ptr_stride()const
-{
-       return surface_->channel_map_[channel_].get_stride();
-}
-
-void
-SurfaceChannelLockConst::release_data_ptr()const
-{
-       data_ptr_checked_out_=false;
-}
-
-SurfaceChannelLockConst::operator bool()const
-{
-       return static_cast<bool>(surface_);
-}
-
-// -----------------------------------------------------------------------------------
-
-SurfaceChannelLock::SurfaceChannelLock()
-{
-}
-
-SurfaceChannelLock::~SurfaceChannelLock()
-{
-       if(data_ptr_checked_out_)
-               release_data_ptr();
-
-       if(surface_ && ref_count_.is_unique())
-               return surface_->channel_map_[channel_].rw_lock.writer_unlock();
-       surface=0;
-}
-
-void
-SurfaceChannelLock::clear()
-{
-       return surface_->channel_map_[channel_].clear();
-}
-
-void
-SurfaceChannelLock::fill(float v)
-{
-       return surface_->channel_map_[channel_].fill(v);
-}
-
-void
-SurfaceChannelLock::set_value(int x, int y, float v)
-{
-       // WOW! CRAZY SLOW!
-       const ChannelData& channel_data(surface_->channel_map_[channel_]);
-       *(channel_data.get_data()+y*channel_data.get_stride()+x)=v;
-}
-
-float*
-SurfaceChannelLock::get_data_ptr()
-{
-       data_ptr_checked_out_=true;
-
-       // WOW! CRAZY SLOW!
-       return surface_->channel_map_[channel_].get_data();
-}
-
-
-
-// -----------------------------------------------------------------------------------
-
-
-
-void
-SurfaceNew::chan_mlt(ChannelLock& dest, float x)
-{
-       float* ptr(dest.get_data_ptr());
-       const int w(dest.get_w());
-       const int h(dest.get_h());
-       const int pitch(dest.get_data_pitch()-w);
-       
-       int(y=0;y<h;y++,ptr+=pitch)
-               int(x=0;x<w;x++,ptr++)
-                       *ptr*=x;
-}
-
-void
-SurfaceNew::chan_mlt(ChannelLock& dest, const ChannelLockConst& x)
-{
-       float* d_ptr(dest.get_data_ptr());
-       const float* s_ptr(x.get_data_ptr());
-       const int w(dest.get_w());
-       const int h(dest.get_h());
-       const int d_pitch(dest.get_data_stride()-w);
-       const int s_pitch(x.get_data_stride()-w);
-       
-       int(y=0;y<h;y++,d_ptr+=d_pitch,s_ptr+=s_pitch)
-               int(x=0;x<w;x++,d_ptr++,s_ptr++)
-                       *d_ptr *= *s_ptr;
-}
-
-void
-SurfaceNew::chan_div(ChannelLock& dest, float x)
-{
-       float* ptr(dest.get_data_ptr());
-       const int w(dest.get_w());
-       const int h(dest.get_h());
-       const int pitch(dest.get_data_pitch()-w);
-       
-       int(y=0;y<h;y++,ptr+=pitch)
-               int(x=0;x<w;x++,ptr++)
-                       *ptr/=x;
-}
-
-void
-SurfaceNew::chan_div(ChannelLock& dest, const ChannelLockConst& x)
-{
-       float* d_ptr(dest.get_data_ptr());
-       const float* s_ptr(x.get_data_ptr());
-       const int w(dest.get_w());
-       const int h(dest.get_h());
-       const int d_pitch(dest.get_data_stride()-w);
-       const int s_pitch(x.get_data_stride()-w);
-       
-       int(y=0;y<h;y++,d_ptr+=d_pitch,s_ptr+=s_pitch)
-               int(x=0;x<w;x++,d_ptr++,s_ptr++)
-                       *d_ptr /= *s_ptr;
-}
-
-void
-SurfaceNew::chan_add(ChannelLock& dest, float x)
-{
-       float* ptr(dest.get_data_ptr());
-       const int w(dest.get_w());
-       const int h(dest.get_h());
-       const int pitch(dest.get_data_pitch()-w);
-       
-       int(y=0;y<h;y++,ptr+=pitch)
-               int(x=0;x<w;x++,ptr++)
-                       *ptr+=x;
-}
-
-void
-SurfaceNew::chan_add(ChannelLock& dest, const ChannelLockConst& x)
-{
-       float* d_ptr(dest.get_data_ptr());
-       const float* s_ptr(x.get_data_ptr());
-       const int w(dest.get_w());
-       const int h(dest.get_h());
-       const int d_pitch(dest.get_data_stride()-w);
-       const int s_pitch(x.get_data_stride()-w);
-       
-       int(y=0;y<h;y++,d_ptr+=d_pitch,s_ptr+=s_pitch)
-               int(x=0;x<w;x++,d_ptr++,s_ptr++)
-                       *d_ptr += *s_ptr;
-}
-
-void
-SurfaceNew::chan_sub(ChannelLock& dest, float x)
-{
-       float* ptr(dest.get_data_ptr());
-       const int w(dest.get_w());
-       const int h(dest.get_h());
-       const int pitch(dest.get_data_pitch()-w);
-       
-       int(y=0;y<h;y++,ptr+=pitch)
-               int(x=0;x<w;x++,ptr++)
-                       *ptr-=x;
-}
-
-void
-SurfaceNew::chan_sub(ChannelLock& dest, const ChannelLockConst& x)
-{
-       float* d_ptr(dest.get_data_ptr());
-       const float* s_ptr(x.get_data_ptr());
-       const int w(dest.get_w());
-       const int h(dest.get_h());
-       const int d_pitch(dest.get_data_stride()-w);
-       const int s_pitch(x.get_data_stride()-w);
-       
-       int(y=0;y<h;y++,d_ptr+=d_pitch,s_ptr+=s_pitch)
-               int(x=0;x<w;x++,d_ptr++,s_ptr++)
-                       *d_ptr -= *s_ptr;
-}
-
-
-
diff --git a/synfig-core/trunk/src/sinfg/surfacenew.h b/synfig-core/trunk/src/sinfg/surfacenew.h
deleted file mode 100644 (file)
index 173baca..0000000
+++ /dev/null
@@ -1,399 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file surfacenew.h
-**     \brief Template Header
-**
-**     $Id: surfacenew.h,v 1.1 2005/01/21 19:29:10 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_SURFACENEW_H
-#define __SINFG_SURFACENEW_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/handle>
-#include <ETL/ref_count>
-#include "color.h"
-#include "mutex.h"
-#include <map>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Surface;
-class SurfaceChannelLock;
-class SurfaceChannelLockConst;
-
-//! \writeme
-enum SurfaceColorSystem
-{
-       COLORSYS_RGB,
-       COLORSYS_YUV,
-       
-       COLORSYS_END
-}; // END of enum SurfaceColorSystem
-
-//! \writeme
-enum SurfaceChannel
-{
-       CHAN_A,
-       CHAN_R,
-       CHAN_G,
-       CHAN_B,
-
-       CHAN_Y,
-       CHAN_U,
-       CHAN_V,
-
-       CHAN_END
-}; // END of enum SurfaceChannel
-
-class SurfaceNew : etl::shared_object
-{
-       friend class SurfaceChannelLock;
-
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public: 
-
-       //! \writeme
-       typedef etl::handle<SurfaceNew> Handle;
-
-       //! \writeme
-       typedef etl::handle<const SurfaceNew> HandleConst;
-       
-       //! \writeme
-       typedef etl::loose_handle<SurfaceNew> LooseHandle;
-
-       //! \writeme
-       typedef SurfaceChannel;
-
-       //! \writeme
-       typedef SurfaceChannelLock ChannelLock;
-
-       //! \writeme
-       typedef SurfaceChannelLockConst ChannelLockConst;
-
-       //! \writeme
-       typedef SurfaceColorSystem;
-       
-       //! \writeme
-       class Lock
-       {
-               Handle x;
-       public:
-               Lock(const Handle& x):x(x) { x->lock(); }
-               void unlock() { if(x){ x->unlock(); x=0; } }
-               ~Lock() { unlock(); }           
-       }; // END of class Lock
-       friend class Lock;
-       
-private:
-
-       //! \writeme
-       class ChannelData;
-       
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-private:
-       
-       //! \writeme
-       RecMutex mutex_;
-       
-       //! \writeme
-       int w_,h_;
-
-       //! \writeme
-       ColorSystem color_system_;
-       
-       //! \writeme
-       bool premult_flag_;
-
-       //! \writeme
-       std::map<Channel,ChannelData> channel_map_;
-       
-       /*
- -- ** -- S I G N A L S -------------------------------------------------------
-       */
-
-private:
-
-       /*
- -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
-       */
-
-public:
-
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-protected:
-       
-       //! \writeme
-       SurfaceNew();
-
-public:
-
-       //! \writeme
-       virtual ~SurfaceNew();
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //! \writeme
-       int get_w()const;
-       
-       //! \writeme
-       int get_h()const;
-       
-       //! \writeme
-       void set_wh(int w, int h);
-
-       //! \writeme
-       ColorSystem get_color_system()const;
-
-       //! \writeme
-       void set_color_system(ColorSystem x);
-
-       //! Should only be used in certain circumstances
-       Color get_color(int x, int y)const;
-       
-       //! \writeme
-       void lock();
-       
-       //! \writeme
-       void unlock();
-       
-       //! \writeme
-       bool trylock();
-       
-       //! \writeme
-       ChannelLock lock_channel(Channel chan);
-
-       //! \writeme
-       ChannelLockConst lock_channel_const(Channel chan)const;
-
-       //! \writeme
-       ChannelLock lock_channel_alpha(Channel chan);
-
-       //! \writeme
-       ChannelLockConst lock_channel_alpha_const(Channel chan)const;
-
-       //! \writeme
-       bool is_channel_defined(Channel chan)const;
-       
-       //! \writeme
-       bool get_premult()const;
-
-       //! \writeme
-       void set_premult();
-       
-       /*
- --    ** -- S T A T I C   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //! Normal SurfaceNew Constructor
-       static Handle create(int w=0, int h=0, ColorSystem sys=COLORSYS_RGB);
-
-       //! Converts an old Surface to a SurfaceNew
-       static Handle create(const Surface&);
-
-       //! Dupilcates a surface
-       static Handle create(HandleConst);
-
-       //! Creates a cropped copy of a surface
-       static Handle crop(HandleConst, int x, int y, int w, int h);
-       
-       static void blit(
-               Handle dest,
-               int x_dest,
-               int y_dest,
-               HandleConst src,
-               float amount=1.0,
-               Color::BlendMethod bm=Color::BLEND_COMPOSITE
-       );
-       
-       static void blit(
-               Handle dest,
-               int x_dest,
-               int y_dest,
-               Handle src,
-               int x_src,
-               int y_src,
-               int w_src,
-               int h_src,
-               float amount=1.0,
-               Color::BlendMethod bm=Color::BLEND_COMPOSITE
-       );
-       
-       
-       static void chan_mlt(ChannelLock& dest, float x);
-       static void chan_mlt(ChannelLock& dest, const ChannelLockConst& x);
-
-       static void chan_div(ChannelLock& dest, float x);
-       static void chan_div(ChannelLock& dest, const ChannelLockConst& x);
-
-       static void chan_add(ChannelLock& dest, float x);
-       static void chan_add(ChannelLock& dest, const ChannelLockConst& x);
-
-       static void chan_sub(ChannelLock& dest, float x);
-       static void chan_sub(ChannelLock& dest, const ChannelLockConst& x);
-}; // END of class SurfaceNew
-
-//! \writeme
-class SurfaceChannelLockConst
-{
-       friend class SurfaceNew;
-
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public: 
-
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-protected:
-       
-       //! \writeme
-       SurfaceNew::Handle surface_;
-       
-       //! \writeme
-       etl::reference_counter ref_count_;
-
-       //! \writeme
-       SurfaceChannel channel_;
-
-       //! \writeme
-       bool data_ptr_checked_out_;
-       
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-public:
-
-       SurfaceChannelLockConst();
-       
-       //! \writeme
-       ~SurfaceChannelLockConst();
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-       
-       //! \writeme
-       SurfaceChannel get_channel()const;
-       
-       //! \writeme
-       int get_w()const;
-       
-       //! \writeme
-       int get_h()const;
-       
-       //! \writeme
-       float get_value(int x, int y);
-       
-       //! \writeme
-       const float* get_data_ptr()const;
-       
-       //! \writeme
-       int get_data_ptr_stride()const;
-       
-       //! Releases the pointer obtained with get_data_ptr()
-       void release_data_ptr()const;
-       
-       //! \writeme
-       operator bool()const;
-}; // END of class SurfaceChannelLockConst
-
-
-//! \writeme
-class SurfaceChannelLock : public SurfaceChannelLockConst
-{
-       friend class SurfaceNew;
-
-       using SurfaceChannelLock::get_data_ptr;
-       
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public: 
-
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-private:
-       
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-public:
-
-       //! \writeme
-       SurfaceChannelLock();
-
-       //! \writeme
-       ~SurfaceChannelLock();
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //! \writeme
-       void clear();
-       
-       //! \writeme
-       void fill(float value);
-               
-       //! \writeme
-       void set_value(int x, int y, float v);
-
-       float* get_data_ptr();
-}; // END of class ChannelLock
-
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/target.cpp b/synfig-core/trunk/src/sinfg/target.cpp
deleted file mode 100644 (file)
index 5fb1790..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target.cpp
-**     \brief Target Class Implementation
-**
-**     $Id: target.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "target.h"
-#include "string.h"
-#include "canvas.h"
-#include "target_null.h"
-#include "target_null_tile.h"
-
-using namespace sinfg;
-using namespace etl;
-using namespace std;
-
-sinfg::Target::Book* sinfg::Target::book_;
-sinfg::Target::ExtBook* sinfg::Target::ext_book_;
-
-static sinfg::Gamma* default_gamma_;
-
-/* === P R O C E D U R E S ================================================= */
-
-bool
-Target::subsys_init()
-{
-       book_=new sinfg::Target::Book();
-       ext_book_=new sinfg::Target::ExtBook();
-       
-       default_gamma_=new sinfg::Gamma(1.0/2.2);
-       //default_gamma_->set_black_level(0.05); // Default to 5% black level.
-       
-       book()["null"]=std::pair<sinfg::Target::Factory,String>(Target_Null::create,"null");
-       ext_book()["null"]="null";
-       book()["null-tile"]=std::pair<sinfg::Target::Factory,String>(Target_Null_Tile::create,"null-tile");
-       ext_book()["null-tile"]="null-tile";
-
-       return true;
-}
-
-bool
-Target::subsys_stop()
-{
-       delete book_;
-       delete ext_book_;
-       delete default_gamma_;
-       return true;
-}
-
-Target::Book&
-Target::book()
-{
-       return *book_;
-}
-
-Target::ExtBook&
-Target::ext_book()
-{
-       return *ext_book_;
-}
-
-
-/* === M E T H O D S ======================================================= */
-
-Target::Target():
-       quality_(4),
-       gamma_(*default_gamma_),
-       remove_alpha(false)
-{
-}
-
-void
-sinfg::Target::set_canvas(Canvas::Handle c)
-{
-       canvas=c;
-       RendDesc desc=canvas->rend_desc();
-       set_rend_desc(&desc);
-}
-
-
-Target::Handle
-Target::create(const String &name, const String &filename)
-{
-       if(!book().count(name))
-               return handle<Target>();
-               
-       return Target::Handle(book()[name].first(filename.c_str()));
-}
diff --git a/synfig-core/trunk/src/sinfg/target.h b/synfig-core/trunk/src/sinfg/target.h
deleted file mode 100644 (file)
index e2c48cc..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target.h
-**     \brief Target Class Implementation
-**
-**     $Id: target.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TARGET_H
-#define __SINFG_TARGET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "string_decl.h"
-#include <utility>
-//#include <list>
-#include <map>
-#include <ETL/handle>
-#include "renddesc.h"
-//#include "general.h"
-#include "color.h"
-#include "canvas.h"
-
-/* === M A C R O S ========================================================= */
-
-//! \writeme
-#define SINFG_TARGET_MODULE_EXT public: static const char name__[], version__[], ext__[],cvs_id__[]; static Target *create(const char *filename);
-
-//! Sets the name of the target
-#define SINFG_TARGET_SET_NAME(class,x) const char class::name__[]=x
-
-//! \writeme
-#define SINFG_TARGET_SET_EXT(class,x) const char class::ext__[]=x
-
-//! Sets the version of the target
-#define SINFG_TARGET_SET_VERSION(class,x) const char class::version__[]=x
-
-//! Sets the CVS ID of the target
-#define SINFG_TARGET_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
-
-//! \writeme
-#define SINFG_TARGET_INIT(class) sinfg::Target* class::create(const char *filename) { return new class(filename); }
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Surface;
-class RendDesc;
-class Canvas;
-class ProgressCallback;
-
-/*!    \class Target
-**     \brief Render-target
-**     \todo writeme
-*/
-class Target : public etl::shared_object
-{
-public:
-       typedef etl::handle<Target> Handle;
-       typedef etl::loose_handle<Target> LooseHandle;
-       typedef etl::handle<const Target> ConstHandle;
-
-       typedef Target* (*Factory)(const char *filename);
-
-       //! A type for a map of targets, indexed by the name of the Target
-       typedef std::map<String,std::pair<Factory,String> > Book;
-
-       typedef std::map<String,String> ExtBook;
-
-       //! Target Book, indexed by the target's name
-       static Book* book_;
-
-       //! Map of target names indexed by associated file extension
-       static ExtBook* ext_book_;
-       
-       static Book& book();
-       static ExtBook& ext_book();
-
-       static bool subsys_init();
-       static bool subsys_stop();
-       
-       //! Adjusted Render description set by set_rend_desc()
-       RendDesc desc;
-
-       etl::handle<Canvas> canvas;
-
-       int quality_;
-       Gamma gamma_;
-
-       bool remove_alpha;
-       
-       bool avoid_time_sync_;
-       
-protected:
-
-       Target();
-
-public:
-       virtual ~Target() { }
-
-       int get_quality()const { return quality_; }
-       
-       void set_quality(int q) { quality_=q; }
-       
-       void set_avoid_time_sync(bool x=true) { avoid_time_sync_=x; }
-
-       bool get_avoid_time_sync()const { return avoid_time_sync_; }
-       
-       bool get_remove_alpha()const { return remove_alpha; }
-
-       void set_remove_alpha(bool x=true) { remove_alpha=x; }
-       
-       Gamma &gamma() { return gamma_; }
-
-       const Gamma &gamma()const { return gamma_; }
-
-       virtual void set_canvas(etl::handle<Canvas> c);
-
-       const etl::handle<Canvas> &get_canvas()const { return canvas; }
-
-       RendDesc &rend_desc() { return desc; }
-       const RendDesc &rend_desc()const { return desc; }
-       
-       //! Renders the canvas to the target
-       virtual bool render(ProgressCallback *cb=NULL)=0;
-
-       //! Sets the RendDesc for the Target to \a desc.
-       /*!     If there are any parts of \a desc that the render target
-       **      is not capable of doing, the render target will adjust
-       **      \a desc to fit it's needs.
-       */
-       virtual bool set_rend_desc(RendDesc *d) { desc=*d; return true; }
-
-       virtual bool init() { return true; }
-
-       //! Creates a new Target described by \a type, outputing to a file described by \a filename.
-       static Handle create(const String &type, const String &filename);
-}; // END of class Target
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#include "canvas.h"
-#endif
diff --git a/synfig-core/trunk/src/sinfg/target_multi.cpp b/synfig-core/trunk/src/sinfg/target_multi.cpp
deleted file mode 100644 (file)
index 0e22b63..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_multi.cpp
-**     \brief Template File
-**
-**     $Id: target_multi.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "target_multi.h"
-#include "string.h"
-#include "surface.h"
-#include "canvas.h"
-#include "context.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Target_Multi::Target_Multi(Target_Scanline::Handle a,Target_Scanline::Handle b):
-       a(a),
-       b(b)
-{
-}
-
-Target_Multi::~Target_Multi()
-{
-}
-
-void
-Target_Multi::set_canvas(etl::handle<Canvas> c)
-{
-       canvas=c;
-       RendDesc desc=canvas->rend_desc();
-       a->set_canvas(c);
-       b->set_canvas(c);
-       set_rend_desc(&desc);
-}
-
-bool
-Target_Multi::set_rend_desc(RendDesc *d)
-{
-       desc=*d;
-       return a->set_rend_desc(d) && b->set_rend_desc(d);
-}
-
-bool
-Target_Multi::init()
-{
-       return a->init() && b->init();
-}
-
-bool
-Target_Multi::add_frame(const sinfg::Surface *surface)
-{
-       return a->add_frame(surface) && b->add_frame(surface);
-}
-
-bool
-Target_Multi::start_frame(ProgressCallback *cb)
-{
-       return a->start_frame(cb) && b->start_frame(cb);
-}
-
-void
-Target_Multi::end_frame()
-{
-       a->end_frame();
-       b->end_frame();
-}
-
-Color *
-Target_Multi::start_scanline(int scanline)
-{
-       buffer_a=a->start_scanline(scanline);
-       buffer_b=b->start_scanline(scanline);
-       return buffer_a;
-}
-
-bool
-Target_Multi::end_scanline()
-{
-       memcpy(buffer_b,buffer_a,sizeof(Color)*desc.get_w());
-       return a->end_scanline() && b->end_scanline();
-}
diff --git a/synfig-core/trunk/src/sinfg/target_multi.h b/synfig-core/trunk/src/sinfg/target_multi.h
deleted file mode 100644 (file)
index c086d37..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_multi.h
-**     \brief Template Header
-**
-**     $Id: target_multi.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TARGET_MULTI_H
-#define __SINFG_TARGET_MULTI_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "target_scanline.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Target_Multi
-**     \brief Render-target
-**     \todo writeme
-*/
-class Target_Multi : public Target_Scanline
-{
-       Target_Scanline::Handle a,b;
-       Color *buffer_a;
-       Color *buffer_b;
-public:
-
-       Target_Multi(Target_Scanline::Handle a,Target_Scanline::Handle b);
-       virtual ~Target_Multi();
-       virtual bool add_frame(const sinfg::Surface *surface);
-       virtual bool start_frame(ProgressCallback *cb=NULL);
-       virtual void end_frame();
-       virtual Color * start_scanline(int scanline);
-       virtual bool end_scanline();
-       
-       virtual void set_canvas(etl::handle<Canvas> c);
-       virtual bool set_rend_desc(RendDesc *d);
-       virtual bool init();
-}; // END of class Target_Multi
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/target_null.cpp b/synfig-core/trunk/src/sinfg/target_null.cpp
deleted file mode 100644 (file)
index 50b97c6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_null.cpp
-**     \brief Template File
-**
-**     $Id: target_null.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-//#include "target_null.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-//using namespace std;
-//using namespace etl;
-//using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-/* === E N T R Y P O I N T ================================================= */
diff --git a/synfig-core/trunk/src/sinfg/target_null.h b/synfig-core/trunk/src/sinfg/target_null.h
deleted file mode 100644 (file)
index ae95bfc..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_null.h
-**     \brief Template Header
-**
-**     $Id: target_null.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TARGET_NULL_H
-#define __SINFG_TARGET_NULL_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "target_scanline.h"
-#include "general.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Target_Null
-**     \brief A target which renders to nothing. Useful for benchmarks and other tests.
-**     \todo writeme
-*/
-class Target_Null : public Target_Scanline
-{
-       Color *buffer;
-       
-       Target_Null():buffer(0) { }
-       
-public:
-
-       ~Target_Null() { delete buffer; } 
-
-       virtual bool start_frame(ProgressCallback *cb=NULL)
-               { delete buffer; buffer=new Color[desc.get_w()*sizeof(Color)]; return true; }
-
-       virtual void end_frame() { delete buffer; buffer=0; return; }
-
-       virtual Color * start_scanline(int scanline) { return buffer; }
-
-       virtual bool end_scanline() { return true; }
-       
-       static Target* create(const char *filename=0) { return new Target_Null(); }
-}; // END of class Target_Null
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/target_null_tile.cpp b/synfig-core/trunk/src/sinfg/target_null_tile.cpp
deleted file mode 100644 (file)
index 7e4333f..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_null_tile.cpp
-**     \brief Template File
-**
-**     $Id: target_null_tile.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-//#include "target_null.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-//using namespace std;
-//using namespace etl;
-//using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-/* === E N T R Y P O I N T ================================================= */
diff --git a/synfig-core/trunk/src/sinfg/target_null_tile.h b/synfig-core/trunk/src/sinfg/target_null_tile.h
deleted file mode 100644 (file)
index 2d7627c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_null_tile.h
-**     \brief Template Header
-**
-**     $Id: target_null_tile.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TARGET_NULL_TILE_H
-#define __SINFG_TARGET_NULL_TILE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "target_tile.h"
-#include "general.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Target_Null_Tile
-**     \brief A target which renders to nothing using tiles. Useful for benchmarks and other tests.
-**     \todo writeme
-*/
-class Target_Null_Tile : public Target_Tile
-{
-       Target_Null_Tile() { }
-       
-public:
-
-       ~Target_Null_Tile() {  } 
-       virtual bool add_tile(const sinfg::Surface &surface, int x, int y) { return true; }
-
-       virtual bool start_frame(ProgressCallback *cb=NULL)
-               { return true; }
-
-       virtual void end_frame() { return; }
-       
-       static Target* create(const char *filename=0) { return new Target_Null_Tile(); }
-}; // END of class Target_Null_Tile
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/target_scanline.cpp b/synfig-core/trunk/src/sinfg/target_scanline.cpp
deleted file mode 100644 (file)
index e1cea2d..0000000
+++ /dev/null
@@ -1,499 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_scanline.cpp
-**     \brief Template File
-**
-**     $Id: target_scanline.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "target_scanline.h"
-#include "string.h"
-#include "surface.h"
-#include "render.h"
-#include "canvas.h"
-#include "context.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define SINFG_OPTIMIZE_LAYER_TREE 1
-
-#define PIXEL_RENDERING_LIMIT 1500000
-
-#define USE_PIXELRENDERING_LIMIT 0
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Target_Scanline::Target_Scanline():
-       threads_(2)
-{
-       curr_frame_=0;
-}
-
-int
-Target_Scanline::next_frame(Time& time)
-{
-       int
-               total_frames(1),
-               frame_start(0),
-               frame_end(0);
-       Time
-               time_start(0),
-               time_end(0);
-
-       // If the description's end frame is equal to
-       // the start frame, then it is assumed that we
-       // are rendering only one frame. Correct it.
-       if(desc.get_frame_end()==desc.get_frame_start())
-               desc.set_frame_end(desc.get_frame_start()+1);
-
-       frame_start=desc.get_frame_start();
-       frame_end=desc.get_frame_end();
-       time_start=desc.get_time_start();
-       time_end=desc.get_time_end();
-       
-       // Calculate the number of frames
-       total_frames=frame_end-frame_start;
-       if(total_frames<=0)total_frames=1;
-       
-       //RendDesc rend_desc=desc;
-       //rend_desc.set_gamma(1);
-
-//     int total_tiles(total_tiles());
-       time=(time_end-time_start)*curr_frame_/total_frames+time_start;
-       curr_frame_++;
-
-/*     sinfg::info("curr_frame_: %d",curr_frame_);
-       sinfg::info("total_frames: %d",total_frames);
-       sinfg::info("time_end: %s",time_end.get_string().c_str());
-       sinfg::info("time_start: %s",time_start.get_string().c_str());
-*/
-//     sinfg::info("time: %s",time.get_string().c_str());
-
-       return total_frames- curr_frame_+1;
-}
-bool
-sinfg::Target_Scanline::render(ProgressCallback *cb)
-{
-       SuperCallback super_cb;
-       int
-//             i=0,
-               total_frames,
-               quality=get_quality(),
-               frame_start,
-               frame_end;
-       Time
-               t=0,
-               time_start,
-               time_end;
-
-       assert(canvas);
-       curr_frame_=0;
-
-       init();
-       
-       // If the description's end frame is equal to
-       // the start frame, then it is assumed that we
-       // are rendering only one frame. Correct it.
-       if(desc.get_frame_end()==desc.get_frame_start())
-               desc.set_frame_end(desc.get_frame_start()+1);
-
-       frame_start=desc.get_frame_start();
-       frame_end=desc.get_frame_end();
-       time_start=desc.get_time_start();
-       time_end=desc.get_time_end();
-       
-       // Calculate the number of frames
-       total_frames=frame_end-frame_start;
-       
-       
-       //RendDesc rend_desc=desc;
-               
-       try {
-       // Grab the time
-       int i=next_frame(t);
-       
-       //sinfg::info("1time_set_to %s",t.get_string().c_str());
-       
-       if(i>1)
-       do{
-       
-       //if(total_frames>1)
-       //for(i=0,t=time_start;i<total_frames;i++)
-       //{
-               //t=((time_end-time_start)*((Real)i/(Real)total_frames)).round(desc.get_frame_rate())+time_start;
-
-               // If we have a callback, and it returns
-               // false, go ahead and bail. (it may be a user cancel)
-               if(cb && !cb->amount_complete(total_frames-(i-1),total_frames))
-                       return false;
-               
-               // Set the time that we wish to render
-               if(!get_avoid_time_sync() || canvas->get_time()!=t)
-                       canvas->set_time(t);
-               
-               Context context;
-               
-               #ifdef SINFG_OPTIMIZE_LAYER_TREE
-               Canvas::Handle op_canvas(Canvas::create());
-               optimize_layers(canvas->get_context(), op_canvas);
-               context=op_canvas->get_context();
-               #else
-               context=canvas->get_context();
-               #endif
-               
-               // If the quality is set to zero, then we
-               // use the parametric scanline-renderer.
-               if(quality==0)
-               {
-                       if(threads_<=0)
-                       {
-                               if(!sinfg::render(context,this,desc,0))
-                                       return false;
-                       }
-                       else
-                       {
-                               if(!sinfg::render_threaded(context,this,desc,0,threads_))
-                                       return false;
-                       }
-               }
-               else // If quality is set otherwise, then we use the accelerated renderer
-               {
-                       #if USE_PIXELRENDERING_LIMIT
-                       if(desc.get_w()*desc.get_h() > PIXEL_RENDERING_LIMIT)
-                       {                                       
-                               sinfg::info("Render BROKEN UP! (%d pixels)", desc.get_w()*desc.get_h());
-                                                               
-                               Surface surface;                                
-                               int rowheight = PIXEL_RENDERING_LIMIT/desc.get_w();
-                               int rows = desc.get_h()/rowheight;
-                               int lastrowheight = desc.get_h() - rows*rowheight;
-                               
-                               rows++;
-                               
-                               sinfg::info("\t blockh=%d,remh=%d,totrows=%d", rowheight,lastrowheight,rows);                           
-                               
-                               // loop through all the full rows
-                               if(!start_frame())
-                               {
-                                       throw(string("add_frame(): target panic on start_frame()"));
-                                       return false;
-                               }
-                               
-                               for(int i=0; i < rows; ++i)
-                               {
-                                       RendDesc        blockrd = desc;
-                                       
-                                       //render the strip at the normal size unless it's the last one...
-                                       if(i == rows)
-                                       {
-                                               if(!lastrowheight) break;
-                                               blockrd.set_subwindow(0,i*rowheight,desc.get_w(),lastrowheight);
-                                       }
-                                       else
-                                       {
-                                               blockrd.set_subwindow(0,i*rowheight,desc.get_w(),rowheight);
-                                       }
-                                       
-                                       if(!context.accelerated_render(&surface,quality,blockrd,0))
-                                       {
-                                               if(cb)cb->error(_("Accelerated Renderer Failure"));
-                                               return false;
-                                       }else
-                                       {
-                                               int y;
-                                               int rowspan=sizeof(Color)*surface.get_w();
-                                               Surface::pen pen = surface.begin();
-                                               
-                                               int yoff = i*rowheight;
-                                               
-                                               for(y = 0; y < blockrd.get_h(); y++, pen.inc_y())
-                                               {
-                                                       Color *colordata= start_scanline(y + yoff);
-                                                       if(!colordata)
-                                                       {
-                                                               throw(string("add_frame(): call to start_scanline(y) returned NULL"));
-                                                               return false;
-                                                       }
-                                                       
-                                                       if(get_remove_alpha())
-                                                       {
-                                                               for(int i = 0; i < surface.get_w(); i++)
-                                                                       colordata[i] = Color::blend(surface[y][i],desc.get_bg_color(),1.0f);
-                                                       }
-                                                       else
-                                                               memcpy(colordata,surface[y],rowspan);
-                                               
-                                                       if(!end_scanline())
-                                                       {
-                                                               throw(string("add_frame(): target panic on end_scanline()"));
-                                                               return false;
-                                                       }
-                                               }
-                                       }
-                               }       
-
-                               end_frame();                            
-                               
-                       }else //use normal rendering...
-                       {
-                       #endif
-                               Surface surface;
-                               
-                               if(!context.accelerated_render(&surface,quality,desc,0))
-                               {
-                                       // For some reason, the accelerated renderer failed.
-                                       if(cb)cb->error(_("Accelerated Renderer Failure"));
-                                       return false;
-                               }
-                               else
-                               {
-                                       // Put the surface we renderer
-                                       // onto the target.
-                                       if(!add_frame(&surface))
-                                       {
-                                               if(cb)cb->error(_("Unable to put surface on target"));
-                                               return false;
-                                       }
-                               }
-                       #if USE_PIXELRENDERING_LIMIT
-                       }
-                       #endif
-               }
-       }while((i=next_frame(t)));
-    else
-    {
-               // Set the time that we wish to render
-               if(!get_avoid_time_sync() || canvas->get_time()!=t)
-                       canvas->set_time(t);
-               Context context;
-               
-               #ifdef SINFG_OPTIMIZE_LAYER_TREE
-               Canvas::Handle op_canvas(Canvas::create());
-               optimize_layers(canvas->get_context(), op_canvas);
-               context=op_canvas->get_context();
-               #else
-               context=canvas->get_context();
-               #endif
-               
-               // If the quality is set to zero, then we
-               // use the parametric scanline-renderer.
-               if(quality==0)
-               {
-                       if(threads_<=0)
-                       {
-                               if(!sinfg::render(context,this,desc,cb))
-                                       return false;
-                       }
-                       else
-                       {
-                               if(!sinfg::render_threaded(context,this,desc,cb,threads_))
-                                       return false;
-                       }
-               }
-               else // If quality is set otherwise, then we use the accelerated renderer
-               {
-                       #if USE_PIXELRENDERING_LIMIT
-                       if(desc.get_w()*desc.get_h() > PIXEL_RENDERING_LIMIT)
-                       {
-                               sinfg::info("Render BROKEN UP! (%d pixels)", desc.get_w()*desc.get_h());
-                               
-                               Surface surface;                                
-                               int totalheight = desc.get_h();                         
-                               int rowheight = PIXEL_RENDERING_LIMIT/desc.get_w();
-                               int rows = desc.get_h()/rowheight;
-                               int lastrowheight = desc.get_h() - rows*rowheight;
-                               
-                               rows++;
-                               
-                               sinfg::info("\t blockh=%d,remh=%d,totrows=%d", rowheight,lastrowheight,rows);                           
-                               
-                               // loop through all the full rows
-                               if(!start_frame())
-                               {
-                                       throw(string("add_frame(): target panic on start_frame()"));
-                                       return false;
-                               }
-                               
-                               for(int i=0; i < rows; ++i)
-                               {
-                                       RendDesc        blockrd = desc;
-                                       
-                                       //render the strip at the normal size unless it's the last one...
-                                       if(i == rows)
-                                       {
-                                               if(!lastrowheight) break;
-                                               blockrd.set_subwindow(0,i*rowheight,desc.get_w(),lastrowheight);
-                                       }
-                                       else
-                                       {
-                                               blockrd.set_subwindow(0,i*rowheight,desc.get_w(),rowheight);
-                                       }
-                                       
-                                       SuperCallback   sc(cb, i*rowheight, (i+1)*rowheight, totalheight);
-                                       
-                                       if(!context.accelerated_render(&surface,quality,blockrd,&sc))
-                                       {
-                                               if(cb)cb->error(_("Accelerated Renderer Failure"));
-                                               return false;
-                                       }else
-                                       {
-                                               int y;
-                                               int rowspan=sizeof(Color)*surface.get_w();
-                                               Surface::pen pen = surface.begin();
-                                               
-                                               int yoff = i*rowheight;
-                                               
-                                               for(y = 0; y < blockrd.get_h(); y++, pen.inc_y())
-                                               {
-                                                       Color *colordata= start_scanline(y + yoff);
-                                                       if(!colordata)
-                                                       {
-                                                               throw(string("add_frame(): call to start_scanline(y) returned NULL"));
-                                                               return false;
-                                                       }
-                                                       
-                                                       if(get_remove_alpha())
-                                                       {
-                                                               for(int i = 0; i < surface.get_w(); i++)
-                                                                       colordata[i] = Color::blend(surface[y][i],desc.get_bg_color(),1.0f);
-                                                       }
-                                                       else
-                                                               memcpy(colordata,surface[y],rowspan);
-                                               
-                                                       if(!end_scanline())
-                                                       {
-                                                               throw(string("add_frame(): target panic on end_scanline()"));
-                                                               return false;
-                                                       }
-                                               }
-                                       }
-                                       
-                                       //I'm done with this part
-                                       sc.amount_complete(100,100);
-                               }       
-
-                               end_frame();                            
-                               
-                       }else
-                       {
-                       #endif                  
-                               Surface surface;
-                               
-                               if(!context.accelerated_render(&surface,quality,desc,cb))
-                               {
-                                       if(cb)cb->error(_("Accelerated Renderer Failure"));
-                                       return false;
-                               }
-                               else
-                               {
-                                       // Put the surface we renderer
-                                       // onto the target.
-                                       if(!add_frame(&surface))
-                                       {
-                                               if(cb)cb->error(_("Unable to put surface on target"));
-                                               return false;
-                                       }
-                               }
-                       #if USE_PIXELRENDERING_LIMIT
-                       }
-                       #endif
-               }
-       }
-       
-       }
-       catch(String str)
-       {
-               if(cb)cb->error(_("Caught string :")+str);
-               return false;
-       }
-       catch(std::bad_alloc)
-       {
-               if(cb)cb->error(_("Ran out of memory (Probably a bug)"));
-               return false;
-       }
-       catch(...)
-       {
-               if(cb)cb->error(_("Caught unknown error, rethrowing..."));
-               throw;
-       }
-       return true;
-}
-
-bool
-Target_Scanline::add_frame(const Surface *surface)
-{
-       assert(surface);
-
-
-       int y;
-       int rowspan=sizeof(Color)*surface->get_w();
-       Surface::const_pen pen=surface->begin();
-       
-       if(!start_frame())
-       {
-               throw(string("add_frame(): target panic on start_frame()"));
-               return false;
-       }
-               
-       for(y=0;y<surface->get_h();y++,pen.inc_y())
-       {
-               Color *colordata= start_scanline(y);
-               if(!colordata)
-               {
-                       throw(string("add_frame(): call to start_scanline(y) returned NULL"));
-                       return false;
-               }
-               
-               if(get_remove_alpha())
-               {
-                       for(int i=0;i<surface->get_w();i++)
-                               colordata[i]=Color::blend((*surface)[y][i],desc.get_bg_color(),1.0f);
-               }
-               else
-                       memcpy(colordata,(*surface)[y],rowspan);
-       
-               if(!end_scanline())
-               {
-                       throw(string("add_frame(): target panic on end_scanline()"));
-                       return false;
-               }
-       }
-       
-       end_frame();
-       
-       return true;
-}
diff --git a/synfig-core/trunk/src/sinfg/target_scanline.h b/synfig-core/trunk/src/sinfg/target_scanline.h
deleted file mode 100644 (file)
index b3aa862..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_scanline.h
-**     \brief Template Header
-**
-**     $Id: target_scanline.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TARGET_SCANLINE_H
-#define __SINFG_TARGET_SCANLINE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "target.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Target_Scanline
-**     \brief Render-target
-**     \todo writeme
-*/
-class Target_Scanline : public Target
-{
-       int threads_;
-       int curr_frame_;
-
-public:
-       typedef etl::handle<Target_Scanline> Handle;
-       typedef etl::loose_handle<Target_Scanline> LooseHandle;
-       typedef etl::handle<const Target_Scanline> ConstHandle;
-
-       Target_Scanline();
-
-       //! Renders the canvas to the target
-       virtual bool render(ProgressCallback *cb=NULL);
-
-       //! Marks the start of a frame
-       /*! \return \c true on success, \c false upon an error.
-       **      \see end_frame(), start_scanline()
-       */
-       virtual bool start_frame(ProgressCallback *cb=NULL)=0;
-
-       virtual int next_frame(Time& time);
-
-       //! Marks the end of a frame
-       /*! \see start_frame() */
-       virtual void end_frame()=0;
-
-       //! Marks the start of a scanline
-       /*!     \param scanline Which scanline is going to be rendered.
-       **      \return The address where the target wants the scanline
-       **              to be written.
-       **      \warning Must be called after start_frame()
-       **      \see end_scanline(), start_frame()
-       */
-       virtual Color * start_scanline(int scanline)=0;
-
-       //! Marks the end of a scanline
-       /*! Takes the data that was put at the address returned to by start_scanline()
-       **      and does whatever it is supose to do with it.
-       **      \return \c true on success, \c false on failure.
-       **      \see start_scanline()
-       */
-       virtual bool end_scanline()=0;
-       
-       void set_threads(int x) { threads_=x; }
-
-       int get_threads()const { return threads_; }
-
-       bool add_frame(const sinfg::Surface *surface);
-private:
-}; // END of class Target_Scanline
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/target_tile.cpp b/synfig-core/trunk/src/sinfg/target_tile.cpp
deleted file mode 100644 (file)
index e8232e2..0000000
+++ /dev/null
@@ -1,426 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_tile.cpp
-**     \brief Template File
-**
-**     $Id: target_tile.cpp,v 1.2 2005/01/12 06:46:45 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "target_tile.h"
-#include "string.h"
-#include "surface.h"
-#include "render.h"
-#include "canvas.h"
-#include "context.h"
-#include "general.h"
-#include <ETL/clock>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-const unsigned int     DEF_TILE_WIDTH = 64;
-const unsigned int     DEF_TILE_HEIGHT= 64;
-
-#define SINFG_OPTIMIZE_LAYER_TREE      1
-#ifdef _DEBUG
-#define SINFG_DISPLAY_EFFICIENCY       1
-#endif
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Target_Tile::Target_Tile():
-       threads_(2),
-       tile_w_(DEF_TILE_WIDTH),
-       tile_h_(DEF_TILE_HEIGHT),
-       curr_tile_(0),
-       clipping_(true)
-{
-       curr_frame_=0;
-}
-
-int
-Target_Tile::next_frame(Time& time)
-{
-       int
-               total_frames(1),
-               frame_start(0),
-               frame_end(0);
-       Time
-               time_start(0),
-               time_end(0);
-
-       // If the description's end frame is equal to
-       // the start frame, then it is assumed that we
-       // are rendering only one frame. Correct it.
-       if(desc.get_frame_end()==desc.get_frame_start())
-               desc.set_frame_end(desc.get_frame_start()+1);
-
-       frame_start=desc.get_frame_start();
-       frame_end=desc.get_frame_end();
-       time_start=desc.get_time_start();
-       time_end=desc.get_time_end();
-       
-       // Calculate the number of frames
-       total_frames=frame_end-frame_start;
-       if(total_frames<=0)total_frames=1;
-       
-       //RendDesc rend_desc=desc;
-       //rend_desc.set_gamma(1);
-
-//     int total_tiles(total_tiles());
-       time=(time_end-time_start)*curr_frame_/total_frames+time_start;
-       curr_frame_++;
-
-/*     sinfg::info("curr_frame_: %d",curr_frame_);
-       sinfg::info("total_frames: %d",total_frames);
-       sinfg::info("time_end: %s",time_end.get_string().c_str());
-       sinfg::info("time_start: %s",time_start.get_string().c_str());
-*/
-//     sinfg::info("time: %s",time.get_string().c_str());
-
-       return total_frames- curr_frame_+1;
-}
-
-int
-Target_Tile::next_tile(int& x, int& y)
-{
-       // Width of the image(in tiles)
-       int tw(rend_desc().get_w()/tile_w_);
-       int th(rend_desc().get_h()/tile_h_);
-
-       // Add the last tiles (which will be clipped)
-       if(rend_desc().get_w()%tile_w_!=0)tw++;
-       if(rend_desc().get_h()%tile_h_!=0)th++;
-       
-       x=(curr_tile_%tw)*tile_h_;
-       y=(curr_tile_/tw)*tile_w_;
-
-       curr_tile_++;
-       return (tw*th)-curr_tile_+1;
-}
-
-bool
-sinfg::Target_Tile::render_frame_(Context context,ProgressCallback *cb)
-{
-       if(tile_w_<=0||tile_h_<=0)
-       {
-               if(cb)cb->error(_("Bad Tile Size"));
-               return false;
-       }
-       const RendDesc &rend_desc(desc);
-#define total_tiles total_tiles()
-
-       etl::clock total_time;
-       etl::clock::value_type work_time(0);
-       etl::clock::value_type find_tile_time(0);
-       etl::clock::value_type add_tile_time(0);
-       total_time.reset();
-       
-       // If the quality is set to zero, then we
-       // use the parametric scanline-renderer.
-       if(get_quality()==0)
-       {
-               Surface surface;
-               
-               RendDesc tile_desc;
-               int x,y,w,h;
-               int i;
-               etl::clock tile_timer;
-               tile_timer.reset();
-               while((i=next_tile(x,y)))
-               {
-                       find_tile_time+=tile_timer();
-                       SuperCallback   super(cb,(total_tiles-i+1)*1000,(total_tiles-i+2)*1000,total_tiles*1000);
-                       if(!super.amount_complete(0,1000))
-                               return false;
-                       //if(cb && !cb->amount_complete(total_tiles-i,total_tiles))
-                       //      return false;
-
-                       // Perform clipping on the tile
-                       if(clipping_)
-                       {
-                               w=x+tile_w_<rend_desc.get_w()?tile_w_:rend_desc.get_w()-x;
-                               h=y+tile_h_<rend_desc.get_h()?tile_h_:rend_desc.get_h()-y;
-                               if(w<=0||h<=0)continue;
-                       }
-                       else
-                       {
-                               w=tile_w_;
-                               h=tile_h_;
-                       }
-
-                       tile_desc=rend_desc;
-                       tile_desc.set_subwindow(x,y,w,h);
-                       if(!parametric_render(context, surface, tile_desc,&super))
-                       {
-                               // For some reason, the parametric renderer failed.
-                               if(cb)cb->error(_("Parametric Renderer Failure"));
-                               return false;
-                       }
-                       else
-                       {
-                               if(!surface)
-                               {
-                                       if(cb)cb->error(_("Bad surface"));
-                                       return false;
-                               }
-                               if(get_remove_alpha())
-                                       for(int i=0;i<surface.get_w()*surface.get_h();i++)
-                                               surface[0][i]=Color::blend(surface[0][i],desc.get_bg_color(),1.0f);
-                               
-                               // Add the tile to the target
-                               if(!add_tile(surface,x,y))
-                               {
-                                       if(cb)cb->error(_("add_tile():Unable to put surface on target"));
-                                       return false;
-                               }
-                       }
-               tile_timer.reset();
-               }
-       }
-       else // If quality is set otherwise, then we use the accelerated renderer
-       {
-               Surface surface;
-               
-               RendDesc tile_desc;
-               int x,y,w,h;
-               int i;
-               etl::clock tile_timer;
-               tile_timer.reset();
-               while((i=next_tile(x,y)))
-               {
-                       find_tile_time+=tile_timer();
-                       SuperCallback   super(cb,(total_tiles-i)*1000,(total_tiles-i+1)*1000,total_tiles*1000);
-                       if(!super.amount_complete(0,1000))
-                               return false;
-//                     if(cb && !cb->amount_complete(total_tiles-i,total_tiles))
-//                             return false;
-                       // Perform clipping on the tile
-                       if(clipping_)
-                       {
-                               w=x+tile_w_<rend_desc.get_w()?tile_w_:rend_desc.get_w()-x;
-                               h=y+tile_h_<rend_desc.get_h()?tile_h_:rend_desc.get_h()-y;
-                               if(w<=0||h<=0)continue;
-                       }
-                       else
-                       {
-                               w=tile_w_;
-                               h=tile_h_;
-                       }
-
-                       tile_desc=rend_desc;
-                       tile_desc.set_subwindow(x,y,w,h);
-                       
-                       etl::clock timer2;
-                       timer2.reset();
-                       
-                       if(!context.accelerated_render(&surface,get_quality(),tile_desc,&super))
-                       {
-                               // For some reason, the accelerated renderer failed.
-                               if(cb)cb->error(_("Accelerated Renderer Failure"));
-                               return false;
-                       }
-                       else
-                       {
-                               work_time+=timer2();
-                               if(!surface)
-                               {
-                                       if(cb)cb->error(_("Bad surface"));
-                                       return false;
-                               }
-                               if(get_remove_alpha())
-                                       for(int i=0;i<surface.get_w()*surface.get_h();i++)
-                                               surface[0][i]=Color::blend(surface[0][i],desc.get_bg_color(),1.0f);
-
-                               etl::clock timer;
-                               timer.reset();
-                               // Add the tile to the target
-                               if(!add_tile(surface,x,y))
-                               {
-                                       if(cb)cb->error(_("add_tile():Unable to put surface on target"));
-                                       return false;
-                               }
-                               add_tile_time+=timer();
-                       }
-                       tile_timer.reset();
-               }
-       }
-       if(cb && !cb->amount_complete(total_tiles,total_tiles))
-               return false;
-       
-#if SINFG_DISPLAY_EFFICIENCY==1
-       sinfg::info(">>>>>> Render Time: %fsec, Find Tile Time: %fsec, Add Tile Time: %fsec, Total Time: %fsec",work_time,find_tile_time,add_tile_time,total_time());
-       sinfg::info(">>>>>> FRAME EFICIENCY: %f%%",(100.0f*work_time/total_time()));
-#endif
-#undef total_tiles
-       return true;
-}
-
-bool
-sinfg::Target_Tile::render(ProgressCallback *cb)
-{
-       SuperCallback super_cb;
-       int
-               i=0,
-               total_frames,
-               frame_start,
-               frame_end;
-       Time
-               t=0,
-               time_start,
-               time_end;
-
-       assert(canvas);
-       curr_frame_=0;
-       init();
-       
-       // If the description's end frame is equal to
-       // the start frame, then it is assumed that we
-       // are rendering only one frame. Correct it.
-       if(desc.get_frame_end()==desc.get_frame_start())
-               desc.set_frame_end(desc.get_frame_start()+1);
-
-       frame_start=desc.get_frame_start();
-       frame_end=desc.get_frame_end();
-       time_start=desc.get_time_start();
-       time_end=desc.get_time_end();
-       
-       // Calculate the number of frames
-       total_frames=frame_end-frame_start;
-       
-       
-       
-       try {
-               // Grab the time
-               i=next_frame(t);
-               
-               //sinfg::info("1time_set_to %s",t.get_string().c_str());
-               
-               if(i>=1)
-               {
-               do
-               {
-                       curr_tile_=0;
-                       
-                       // If we have a callback, and it returns
-                       // false, go ahead and bail. (maybe a use cancel)
-                       if(cb && !cb->amount_complete(total_frames-(i-1),total_frames))
-                               return false;
-                       
-                       if(!start_frame(cb))
-                               return false;
-
-                       // Set the time that we wish to render
-                       //if(!get_avoid_time_sync() || canvas->get_time()!=t)
-                               canvas->set_time(t);
-                       
-                       Context context;
-                       
-                       #ifdef SINFG_OPTIMIZE_LAYER_TREE
-                       Canvas::Handle op_canvas(Canvas::create());
-                       optimize_layers(canvas->get_context(), op_canvas);
-                       context=op_canvas->get_context();
-                       #else
-                       context=canvas->get_context();
-                       #endif
-                       
-/*
-                       #ifdef SINFG_OPTIMIZE_LAYER_TREE
-                       Context context;
-                       Canvas::Handle op_canvas(Canvas::create());
-                       // Set the time that we wish to render
-                       canvas->set_time(t);
-                       optimize_layers(canvas->get_context(), op_canvas);
-                       context=op_canvas->get_context();
-                       #else
-                       Context context;
-                       // Set the time that we wish to render
-                       canvas->set_time(t);
-                       context=canvas->get_context();
-                       #endif
-*/
-                       
-                       if(!render_frame_(context,0))
-                               return false;
-                       end_frame();
-               }while((i=next_frame(t)));
-               //sinfg::info("tilerenderer: i=%d, t=%s",i,t.get_string().c_str());
-               }
-               else
-               {
-                       curr_tile_=0;
-       
-                       if(!start_frame(cb))
-                               return false;
-
-                       // Set the time that we wish to render
-//                     if(!get_avoid_time_sync() || canvas->get_time()!=t)
-                               canvas->set_time(t);
-
-                       //sinfg::info("2time_set_to %s",t.get_string().c_str());
-
-                       Context context;
-                       
-                       #ifdef SINFG_OPTIMIZE_LAYER_TREE
-                       Canvas::Handle op_canvas(Canvas::create());
-                       optimize_layers(canvas->get_context(), op_canvas);
-                       context=op_canvas->get_context();
-                       #else
-                       context=canvas->get_context();
-                       #endif
-               
-                       if(!render_frame_(context, cb))
-                               return false;
-                       end_frame();
-               }
-       
-       }
-       catch(String str)
-       {
-               if(cb)cb->error(_("Caught string :")+str);
-               return false;
-       }
-       catch(std::bad_alloc)
-       {
-               if(cb)cb->error(_("Ran out of memory (Probably a bug)"));
-               return false;
-       }
-       catch(...)
-       {
-               if(cb)cb->error(_("Caught unknown error, rethrowing..."));
-               throw;
-       }
-       return true;
-}
diff --git a/synfig-core/trunk/src/sinfg/target_tile.h b/synfig-core/trunk/src/sinfg/target_tile.h
deleted file mode 100644 (file)
index c585373..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file target_tile.h
-**     \brief Template Header
-**
-**     $Id: target_tile.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TARGET_TILE_H
-#define __SINFG_TARGET_TILE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "target.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Target_Tile
-**     \brief Render-target
-**     \todo writeme
-*/
-class Target_Tile : public Target
-{
-       int threads_;
-       int tile_w_;
-       int tile_h_;
-       int curr_tile_;
-       int curr_frame_;
-       bool clipping_;
-public:
-       typedef etl::handle<Target_Tile> Handle;
-       typedef etl::loose_handle<Target_Tile> LooseHandle;
-       typedef etl::handle<const Target_Tile> ConstHandle;
-
-       Target_Tile();
-
-       //! Renders the canvas to the target
-       virtual bool render(ProgressCallback *cb=NULL);
-
-       //! Determines which tile needs to be rendered next.
-       /*!     Most cases will not have to redefine this function. 
-       **      The default should be adequate in nearly all situations.
-       **      \returns The number of tiles left to go <i>plus one</i>.
-       **              This means that whenever this function returns zero,
-       **              there are no more tiles to render and that any value
-       **              in \a x or \a y should be disregarded. */
-       virtual int next_tile(int& x, int& y);
-
-       virtual int next_frame(Time& time);
-
-       //! Adds the tile at \a x , \a y contained in \a surface 
-       virtual bool add_tile(const sinfg::Surface &surface, int x, int y)=0;
-
-       virtual int total_tiles()const
-       {
-               // Width of the image(in tiles)
-               const int tw(rend_desc().get_w()/tile_w_+(rend_desc().get_w()%tile_w_?1:0));
-               const int th(rend_desc().get_h()/tile_h_+(rend_desc().get_h()%tile_h_?1:0));
-               
-               return tw*th;
-       }
-
-       //! Marks the start of a frame
-       /*! \return \c true on success, \c false upon an error.
-       **      \see end_frame(), start_scanline()
-       */
-       virtual bool start_frame(ProgressCallback *cb=NULL)=0;
-
-       //! Marks the end of a frame
-       /*! \see start_frame() */
-       virtual void end_frame()=0;
-       
-       void set_threads(int x) { threads_=x; }
-
-       int get_threads()const { return threads_; }
-
-       void set_tile_w(int w) { tile_w_=w; }
-
-       int get_tile_w()const { return tile_w_; }
-
-       void set_tile_h(int h) { tile_h_=h; }
-
-       int get_tile_h()const { return tile_h_; }
-       
-       bool get_clipping()const { return clipping_; }
-
-       void set_clipping(bool x) { clipping_=x; }
-       
-private:
-       
-       bool render_frame_(Context context,ProgressCallback *cb=0);
-       
-}; // END of class Target_Tile
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/time.cpp b/synfig-core/trunk/src/sinfg/time.cpp
deleted file mode 100644 (file)
index e225633..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file time.cpp
-**     \brief Template File
-**
-**     $Id: time.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "time.h"
-#include <ETL/stringf>
-#include <ETL/misc>
-#include "general.h"
-#include <cmath>
-#include <cassert>
-#include <ctype.h>
-#include <math.h>
-
-#ifndef isnan
-
-#ifdef WIN32
-#include <float.h>
-#ifndef isnan
-extern "C" { int _isnan(double x); }
-#define isnan _isnan
-#endif
-#endif
-
-#ifdef __APPLE__
-#define isnan __isnan
-#endif
-
-#endif
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-#define tolower ::tolower
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Time::Time(const String &str_, float fps):
-       value_(0)
-{
-       String str(str_);
-       std::transform(str.begin(),str.end(),str.begin(),&tolower);
-
-       // Start/Begin Of Time
-       if(str=="SOT" || str=="BOT")
-       {
-               operator=(begin());
-               return;
-       }
-       // End Of Time
-       if(str=="EOT")
-       {
-               operator=(end());
-               return;
-       }
-
-
-       unsigned int pos=0;
-       int read;
-       float amount;
-       
-       // Now try to read it in the letter-abreviated format
-       while(pos<str.size() && sscanf(String(str,pos).c_str(),"%f%n",&amount,&read))
-       {
-               pos+=read;
-               if(pos>=str.size() || read==0)
-               {
-                       // Throw up a warning if there are no units
-                       // and the amount isn't zero. There is no need
-                       // to warn about units if the value is zero
-                       // it is the only case where units are irrelevant.
-                       if(amount!=0)
-                               sinfg::warning("Time(): No unit provided in time code, assuming SECONDS (\"%s\")",str.c_str());
-                       value_+=amount;
-                       return;
-               }
-               switch(str[pos])
-               {
-                       case 'h':
-                       case 'H':
-                               value_+=amount*3600;
-                               break;
-                       case 'm':
-                       case 'M':
-                               value_+=amount*60;
-                               break;
-                       case 's':
-                       case 'S':
-                               value_+=amount;
-                               break;
-                       case 'f':
-                       case 'F':
-                               if(fps)
-                                       value_+=amount/fps;
-                               else
-                                       sinfg::warning("Time(): Individual frames referenced, but frame rate is unknown");
-                               break;
-                       case ':':
-                               // try to read it in as a traditional time format
-                               {
-                                       int hour,minute,second;
-                                       float frame;
-                                       if(fps && sscanf(str.c_str(),"%d:%d:%d.%f",&hour,&minute,&second,&frame)==4)
-                                       {
-                                                       value_=frame/fps+(hour*3600+minute*60+second);
-                                                       return;
-                                       }
-                       
-                                       if(sscanf(str.c_str(),"%d:%d:%d",&hour,&minute,&second)==3)
-                                       {
-                                               value_=hour*3600+minute*60+second;
-                                               return;
-                                       }
-                               }
-                               sinfg::warning("Time(): Bad time format");
-                               break;
-
-                       default:
-                               value_+=amount;
-                               sinfg::warning("Time(): Unexpected character '%c' when parsing time string \"%s\"",str[pos],str.c_str());
-                               break;
-               }
-               pos++;
-               amount=0;
-       }
-}
-
-String
-Time::get_string(float fps, Time::Format format)const
-{
-       Time time(*this);
-       
-       if(time<=begin())
-               return "SOT";   // Start Of Time
-       if(time>=end())
-               return "EOT";   // End Of Time
-       
-       if(fps<0)fps=0;
-       
-       if(ceil(time.value_)-time.value_<epsilon_())
-               time.value_=ceil(time.value_);
-       
-       int hour,minute;
-       
-       hour=time/3600;time-=hour*3600;
-       minute=time/60;time-=minute*60;
-       
-       if(format<=FORMAT_VIDEO)
-       {
-               int second;
-               second=time;time-=second;
-
-               if(fps)
-               {
-                       int frame;
-                       frame=round_to_int(time*fps);
-
-                       return strprintf("%02d:%02d:%02d.%02d",hour,minute,second,frame);
-               }
-               else
-                       return strprintf("%02d:%02d:%02d",hour,minute,second);
-       }
-       
-       String ret;
-
-       if(format<=FORMAT_FULL || hour)
-               ret+=strprintf(format<=FORMAT_NOSPACES?"%dh":"%dh ",hour);
-       
-       if(format<=FORMAT_FULL || hour || minute)
-               ret+=strprintf(format<=FORMAT_NOSPACES?"%dm":"%dm ",minute);
-       
-       if(fps)
-       {
-               int second;
-               float frame;
-               second=time;time-=second;
-               frame=time*fps;
-               if(format<=FORMAT_FULL || second)
-                       ret+=strprintf(format<=FORMAT_NOSPACES?"%ds":"%ds ",(int)second);
-               
-               if(abs(frame-floor(frame)>=epsilon_()))
-                       ret+=strprintf("%0.3ff",frame);
-               else
-                       ret+=strprintf("%0.0ff",frame);
-       }
-       else
-       {
-               float second;
-               second=time;
-               if(abs(second-floor(second))>=epsilon_())
-                       ret+=strprintf("%0.8fs",second);
-               else
-                       ret+=strprintf("%0.0fs",second);
-       }
-       
-       return ret;
-}
-
-Time
-Time::round(float fps)const
-{
-       assert(fps>0);
-
-       value_type time(*this);
-
-       time*=fps;
-
-       if(abs(time-floor(time))<0.5)
-               return floor(time)/fps;
-       else
-               return ceil(time)/fps;
-}
-
-//! \writeme
-bool
-Time::is_valid()const
-{
-       return !isnan(value_);
-}
diff --git a/synfig-core/trunk/src/sinfg/time.h b/synfig-core/trunk/src/sinfg/time.h
deleted file mode 100644 (file)
index ca29908..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file time.h
-**     \brief Template Header
-**
-**     $Id: time.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TIME_H
-#define __SINFG_TIME_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "string_decl.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Time
-**     \todo writeme
-**     \see TimeFormat, time_to_string(), string_to_time()
-*/
-class Time
-{
-public:
-       typedef double value_type;
-
-       /*!     \enum Format
-       **      \todo writeme
-       **      \see Time, get_string() */
-       enum Format
-       {
-               FORMAT_NORMAL=0,                //!< Represents the default method of printing the time
-               FORMAT_NOSPACES=(1<<0), //!< Remove any whitespace
-               FORMAT_FULL=(1<<1),             //!< Do not remove units that have "zero" value
-               FORMAT_VIDEO=(1<<2),    //!< Use the HH:MM:SS.ff format
-       
-               FORMAT_END=(1<<4)               //!< \internal Not used
-       }; // END of enum Format
-
-private:
-       value_type value_;
-
-       static const value_type epsilon_() { return static_cast<value_type>(0.0005); }
-
-public:
-       Time() { }
-
-       Time(const value_type &x):value_(x) { }
-
-       Time(int x):value_(x) { }
-
-       Time(int hour, int minute, float second):value_(static_cast<value_type>(second+hour*3600+minute*60)) { }
-
-       //! Constructs Time from the given string.
-       /*!     \note If the string references frames, then the
-       **      frame rate (\afps) should be provided from the
-       **      correct source. (Which is most likely the RendDesc
-       **      of the current Canvas)
-       **      The frame count will be ignored if the
-       **      FPS is not given. */
-       Time(const String &string, float fps=0);
-
-       //! Marks the exclusive negative boundary of time
-       static const Time begin() { return static_cast<sinfg::Time>(-32767.0f*512.0f); }
-       
-       //! Marks the exclusive positive boundary of time
-       static const Time end() { return static_cast<sinfg::Time>(32767.0f*512.0f); }
-
-       //! Marks zero time
-       static const Time zero() { return static_cast<sinfg::Time>(0); }
-       
-       //! The amount of allowable error in calculations
-       static const Time epsilon() { return static_cast<sinfg::Time>(epsilon_()); }
-       
-       //! Returns a string describing the current time value
-       /*!     \see Format */
-       String get_string(float fps=0, Time::Format format=FORMAT_NORMAL)const;
-       
-       //! \writeme
-       bool is_valid()const;
-       
-       //! Rounds time to the nearest frame for the given frame rate, \a fps
-       Time round(float fps)const;
-
-       bool is_equal(const Time& rhs)const { return (value_>rhs.value_)?value_-rhs.value_<=epsilon_():rhs.value_-value_<=epsilon_(); }
-       bool is_less_than(const Time& rhs)const { return rhs.value_-value_ > epsilon_(); }
-       bool is_more_than(const Time& rhs)const { return value_-rhs.value_ > epsilon_(); }
-       
-       operator double()const { return value_; }
-
-       template<typename U> bool operator<(const U& rhs)const { return value_<rhs; }
-       template<typename U> bool operator>(const U& rhs)const { return value_>rhs; }
-       template<typename U> bool operator<=(const U& rhs)const { return value_<=rhs; }
-       template<typename U> bool operator>=(const U& rhs)const { return value_>=rhs; }
-       template<typename U> bool operator==(const U& rhs)const { return value_==rhs; }
-       template<typename U> bool operator!=(const U& rhs)const { return value_!=rhs; }
-
-#if 0
-       bool operator<(const Time& rhs)const { return value_<rhs.value_; }
-       bool operator>(const Time& rhs)const { return value_>rhs.value_; }
-       bool operator<=(const Time& rhs)const { return value_<=rhs.value_; }
-       bool operator>=(const Time& rhs)const { return value_>=rhs.value_; }
-       bool operator==(const Time& rhs)const { return value_==rhs.value_; }
-       bool operator!=(const Time& rhs)const { return value_!=rhs.value_; }
-#else
-       bool operator<(const Time& rhs)const { return is_less_than(rhs); }
-       bool operator>(const Time& rhs)const { return is_more_than(rhs); }
-       bool operator<=(const Time& rhs)const { return is_less_than(rhs)||is_equal(rhs); }
-       bool operator>=(const Time& rhs)const { return is_more_than(rhs)||is_equal(rhs); }
-       bool operator==(const Time& rhs)const { return is_equal(rhs); }
-       bool operator!=(const Time& rhs)const { return !is_equal(rhs); }
-#endif
-       
-       template<typename U> const Time& operator+=(const U &rhs) { value_+=static_cast<value_type>(rhs); return *this; }
-       template<typename U> const Time& operator-=(const U &rhs) { value_-=static_cast<value_type>(rhs); return *this; }
-       template<typename U> const Time& operator*=(const U &rhs) { value_*=static_cast<value_type>(rhs); return *this; }
-       template<typename U> const Time& operator/=(const U &rhs) { value_/=static_cast<value_type>(rhs); return *this; }
-
-       template<typename U> Time operator+(const U &rhs)const { return value_+static_cast<value_type>(rhs); }
-       template<typename U> Time operator-(const U &rhs)const { return value_-static_cast<value_type>(rhs); }
-       template<typename U> Time operator*(const U &rhs)const { return value_*static_cast<value_type>(rhs); }
-       template<typename U> Time operator/(const U &rhs)const { return value_/static_cast<value_type>(rhs); }
-       
-       Time operator-()const { return -value_; }
-}; // END of class Time
-
-//! This operator allows the combining of Time::Format flags using the '|' operator
-/*!    \see Time::Format, Time::get_string() */
-inline Time::Format operator|(Time::Format lhs, Time::Format rhs)
-{ return static_cast<Time::Format>((int)lhs|(int)rhs); }
-
-//! This operator is for checking Time::Format flags.
-/*! Don't think of it as "less then or equal to", but think of it
-**     like an arrow. Is \a rhs inside of \a lhs ?
-**     \see Time::Format, Time::get_string() */
-inline bool operator<=(Time::Format lhs, Time::Format rhs)
-{ return (static_cast<int>(lhs) & static_cast<int>(rhs))==static_cast<int>(rhs); }
-
-}; // END of namespace sinfg
-       
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/timepointcollect.cpp b/synfig-core/trunk/src/sinfg/timepointcollect.cpp
deleted file mode 100644 (file)
index 9300a8a..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.cpp
-**     \brief Template File
-**
-**     $Id: timepointcollect.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "timepointcollect.h"
-#include "valuenode_animated.h"
-#include "layer.h"
-#include "canvas.h"
-#include "value.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-//! \writeme
-int
-sinfg::waypoint_collect(set<Waypoint, std::less<UniqueID> >& waypoint_set,const Time& time, const etl::handle<Node>& node)
-{      
-       const TimePointSet& timepoint_set(node->get_times());
-
-       // Check to see if there is anything in here at the given time
-       if(timepoint_set.find(time)==timepoint_set.end())
-               return 0;
-
-       // Check if we are a linkable value node
-       LinkableValueNode::Handle linkable_value_node;
-       linkable_value_node=linkable_value_node.cast_dynamic(node);
-       if(linkable_value_node)
-       {
-               const int link_count(linkable_value_node->link_count());
-               int i,ret(0);
-               for(i=0;i<link_count;i++)
-               {
-                       ret+=waypoint_collect(waypoint_set,time,linkable_value_node->get_link(i).get());
-               }
-               return ret;
-       }
-
-       // Check if we are a layer
-       Layer::Handle layer;
-       layer=layer.cast_dynamic(node);
-       if(layer)
-       {
-               const Layer::DynamicParamList& dyn_param_list(layer->dynamic_param_list());
-               Layer::DynamicParamList::const_iterator iter;
-               int ret(0);
-               for(iter=dyn_param_list.begin();iter!=dyn_param_list.end();++iter)
-               {
-                       ret+=waypoint_collect(waypoint_set,time,iter->second);
-               }
-               ValueBase canvas_value(layer->get_param("canvas"));
-               if(canvas_value.get_type()==ValueBase::TYPE_CANVAS)
-               {
-                       ret+=waypoint_collect(waypoint_set,time,Canvas::Handle(canvas_value.get(Canvas::Handle())));
-               }
-               return ret;
-       }
-
-       // Check if we are a canvas
-       Canvas::Handle canvas;
-       canvas=canvas.cast_dynamic(node);
-       if(canvas)
-       {
-               Canvas::const_iterator iter;
-               int ret(0);
-               for(iter=canvas->begin();iter!=canvas->end();++iter)
-                       ret+=waypoint_collect(waypoint_set,time,*iter);
-               return ret;
-       }
-
-       // Check if we are an animated value node
-       ValueNode_Animated::Handle value_node_animated;
-       value_node_animated=value_node_animated.cast_dynamic(node);
-       if(value_node_animated)
-       {
-               try{
-                       Waypoint waypoint=*value_node_animated->find(time);
-                       
-                       // If it is already in the waypoint set, then
-                       // don't bother adding it again
-                       if(waypoint_set.find(waypoint)!=waypoint_set.end())
-                       {
-                               return 0;
-                       }
-                       waypoint_set.insert(waypoint);
-                       return 1;
-               }catch(...)
-               {
-                       return 0;
-               }
-       }
-
-       return 0;
-}
-
-//! \writeme
-int
-sinfg::activepoint_collect(set<Activepoint, std::less<UniqueID> >& activepoint_set,const Time& time, const etl::handle<Node>& node)
-{
-       const TimePointSet& timepoint_set(node->get_times());
-
-       // Check to see if there is anything in here at the given time
-       if(timepoint_set.find(time)==timepoint_set.end());
-               return 0;
-
-       return 0;
-}
diff --git a/synfig-core/trunk/src/sinfg/timepointcollect.h b/synfig-core/trunk/src/sinfg/timepointcollect.h
deleted file mode 100644 (file)
index 8825f25..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timepointcollect.h
-**     \brief Template Header
-**
-**     $Id: timepointcollect.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TIMEPOINTCOLLECT_H
-#define __SINFG_TIMEPOINTCOLLECT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <set>
-#include "activepoint.h"
-#include "waypoint.h"
-#include "node.h"
-#include "time.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-//! \writeme
-int waypoint_collect(std::set<Waypoint, std::less<UniqueID> >& waypoint_set,const Time& time, const etl::handle<Node>& node);
-
-//! \writeme
-int activepoint_collect(std::set<Activepoint, std::less<UniqueID> >& activepoint_set,const Time& time, const etl::handle<Node>& node);
-       
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/transform.cpp b/synfig-core/trunk/src/sinfg/transform.cpp
deleted file mode 100644 (file)
index 17826f4..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.cpp
-**     \brief Template File
-**
-**     $Id: transform.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "transform.h"
-#include <algorithm>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::GUID
-TransformStack::get_guid()const
-{
-       GUID ret(0);
-       
-       for(const_iterator iter(begin());iter!=end();++iter)
-               ret%=(*iter)->get_guid();
-       return ret;
-}
-
-sinfg::Vector
-TransformStack::perform(const sinfg::Vector& x)const
-{
-       sinfg::Vector ret(x);
-       
-       for(const_reverse_iterator iter(rbegin());iter!=rend();++iter)
-               ret=(*iter)->perform(ret);
-       
-       return ret;
-}
-
-sinfg::Vector
-TransformStack::unperform(const sinfg::Vector& x)const
-{
-       sinfg::Vector ret(x);
-       
-       for(const_iterator iter(begin());iter!=end();++iter)
-               ret=(*iter)->unperform(ret);
-       
-       return ret;
-}
-
-sinfg::Rect
-TransformStack::perform(const sinfg::Rect& x)const
-{
-       Point min(x.get_min());
-       Point max(x.get_max());
-       Rect ret(perform(min),perform(max));
-
-       std::swap(min[1],max[1]);
-       ret
-               .expand(perform(min))
-               .expand(perform(max))
-       ;
-       return ret;
-}
-
-sinfg::Rect
-TransformStack::unperform(const sinfg::Rect& x)const
-{
-       Point min(x.get_min());
-       Point max(x.get_max());
-       Rect ret(unperform(min),unperform(max));
-
-       std::swap(min[1],max[1]);
-       ret
-               .expand(unperform(min))
-               .expand(unperform(max))
-       ;
-       return ret;
-}
-
-sinfg::Rect
-Transform::perform(const sinfg::Rect& x)const
-{
-       if(x.area()>1000000000000.0)
-               return Rect::full_plane();
-
-       Point min(x.get_min());
-       Point max(x.get_max());
-
-       Rect ret(perform(min),perform(max));
-
-       std::swap(min[1],max[1]);
-       ret
-               .expand(perform(min))
-               .expand(perform(max))
-       ;
-       return ret;
-}
-
-sinfg::Rect
-Transform::unperform(const sinfg::Rect& x)const
-{
-       if(x.area()>1000000000000.0)
-               return Rect::full_plane();
-
-       Point min(x.get_min());
-       Point max(x.get_max());
-               
-       Rect ret(unperform(min),unperform(max));
-
-       std::swap(min[1],max[1]);
-       ret
-               .expand(unperform(min))
-               .expand(unperform(max))
-       ;
-       return ret;
-}
diff --git a/synfig-core/trunk/src/sinfg/transform.h b/synfig-core/trunk/src/sinfg/transform.h
deleted file mode 100644 (file)
index 61fdd6d..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file transform.h
-**     \brief Template Header
-**
-**     $Id: transform.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TRANSFORM_H
-#define __SINFG_TRANSFORM_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/handle>
-#include "vector.h"
-#include <list>
-#include "rect.h"
-#include "guid.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Transform : public etl::shared_object
-{
-       GUID guid_;
-       
-public:
-       typedef etl::handle<Transform> Handle;
-
-protected:
-       Transform(const GUID& guid=GUID(0)):guid_(guid) { }
-
-public:
-
-       const GUID& get_guid()const { return guid_; }
-
-       virtual ~Transform() { }
-       virtual sinfg::Vector perform(const sinfg::Vector& x)const=0;
-       virtual sinfg::Vector unperform(const sinfg::Vector& x)const=0;
-
-       virtual sinfg::Rect perform(const sinfg::Rect& x)const;
-       virtual sinfg::Rect unperform(const sinfg::Rect& x)const;
-
-}; // END of class Transform
-
-class TransformStack : public std::list<Transform::Handle>
-{
-public:
-       GUID get_guid()const;
-
-       sinfg::Vector perform(const sinfg::Vector& x)const;
-       sinfg::Vector unperform(const sinfg::Vector& x)const;
-       
-       sinfg::Rect perform(const sinfg::Rect& x)const;
-       sinfg::Rect unperform(const sinfg::Rect& x)const;
-       
-       void push(const Transform::Handle& x) { if(x)push_back(x); }
-       void pop() { pop_back(); }
-}; // END of class TransformStack
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/types.h b/synfig-core/trunk/src/sinfg/types.h
deleted file mode 100644 (file)
index d7239a2..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file types.h
-**     \brief Template Header
-**
-**     $Id: types.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_TYPES_H
-#define __SINFG_TYPES_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <cmath>
-
-#ifndef SINFG_NO_ANGLE
-#include "angle.h"
-#endif
-
-#include "time.h"
-#include "vector.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/uniqueid.cpp b/synfig-core/trunk/src/sinfg/uniqueid.cpp
deleted file mode 100644 (file)
index 904b83c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file uniqueid.cpp
-**     \brief Template File
-**
-**     $Id: uniqueid.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "uniqueid.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace sinfg;
-
-/* === G L O B A L S ======================================================= */
-
-static int uniqueid_pool_(0);
-
-/* === M E T H O D S ======================================================= */
-
-int
-sinfg::UniqueID::next_id()
-{
-       return ++uniqueid_pool_;
-}
diff --git a/synfig-core/trunk/src/sinfg/uniqueid.h b/synfig-core/trunk/src/sinfg/uniqueid.h
deleted file mode 100644 (file)
index c8f396f..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file uniqueid.h
-**     \brief Template Header
-**
-**     $Id: uniqueid.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_UNIQUEID_H
-#define __SINFG_UNIQUEID_H
-
-/* === H E A D E R S ======================================================= */
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-       
-class UniqueIDLessThan;
-       
-/*! \class UniqueID
-**     \brief \todo
-*/
-class UniqueID
-{
-       friend class UniqueIDLessThan;
-       
-       int id_;
-       
-       explicit UniqueID(int id_):id_(id_) { }
-       
-       static int next_id();
-       
-public:
-       
-       //! Returns the internal unique identifier for this object.
-       /*! The return value from this isn't really useful for
-       **      much other than debug output. Nonetheless, that is
-       **      one step above useless, so here it is. */
-       const int &get_uid()const { return id_; }
-       
-       UniqueID():id_(next_id()) { }
-       
-       void make_unique() { id_=next_id(); }
-       
-       static const UniqueID nil() { return UniqueID(0); }
-       
-       operator bool()const { return static_cast<bool>(id_); }
-
-       void mimic(const UniqueID& x) { id_=x.id_; }
-       
-       bool operator==(const UniqueID &rhs)const { return id_==rhs.id_; }
-       bool operator!=(const UniqueID &rhs)const { return id_!=rhs.id_; }
-       bool operator<(const UniqueID &rhs)const { return id_<rhs.id_; }
-}; // END of class UniqueID
-
-/*! \class UniqueIDLessThan
-**     \brief A function class used for sorting based on UniqueIDs
-*/
-class UniqueIDLessThan
-{
-public:
-       bool operator()(const UniqueID &lhs, const UniqueID &rhs)const
-       { return lhs.id_<rhs.id_; }
-};
-
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/value.cpp b/synfig-core/trunk/src/sinfg/value.cpp
deleted file mode 100644 (file)
index b942308..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file value.cpp
-**     \brief Template Header
-**
-**     $Id: value.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "value.h"
-#include "general.h"
-#include <ETL/stringf>
-#include "canvas.h"
-#include "gradient.h"
-
-
-
-#include "vector.h"
-#include "time.h"
-#include "segment.h"
-#include "color.h"
-
-#endif
-
-using namespace sinfg;
-using namespace std;
-using namespace etl;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueBase::ValueBase():type(TYPE_NIL),data(0),ref_count(0),loop_(0)
-{
-}
-
-ValueBase::ValueBase(Type x):
-       type(x),
-       data(0),
-       loop_(0)
-{
-
-       switch(type)
-       {
-       case TYPE_BOOL:
-               static_cast<bool*>(data)=new bool();
-               break;
-       case TYPE_INTEGER:
-               static_cast<int*>(data)=new int();
-               break;
-       case TYPE_ANGLE:
-               static_cast<Angle*>(data)=new Angle();
-               break;
-       case TYPE_VECTOR:
-               static_cast<Vector*>(data)=new Vector();
-               break;
-       case TYPE_TIME:
-               static_cast<Time*>(data)=new Time();
-               break;
-       case TYPE_REAL:
-               static_cast<Real*>(data)=new Real();
-               break;
-       case TYPE_COLOR:
-               static_cast<Color*>(data)=new Color();
-               break;
-       case TYPE_SEGMENT:
-               static_cast<Segment*>(data)=new Segment();
-               break;
-       case TYPE_BLINEPOINT:
-               static_cast<BLinePoint*>(data)=new BLinePoint();
-               break;
-       case TYPE_LIST:
-               static_cast<list_type*>(data)=new list_type();
-               break;
-       case TYPE_STRING:
-               static_cast<String*>(data)=new String();
-               break;
-       case TYPE_GRADIENT:
-               static_cast<Gradient*>(data)=new Gradient();
-               break;
-       case TYPE_CANVAS:
-               static_cast<etl::handle<Canvas>*>(data)=new etl::handle<Canvas>();
-               break;
-       default:
-               break;
-       }
-}
-
-ValueBase::~ValueBase()
-{
-       clear();
-}
-
-const char*
-ValueBase::get(const char*)const
-{
-       return get(String()).c_str();
-}
-
-
-
-
-void
-ValueBase::set(Canvas* x)
-{
-       clear();
-       if(x && x->is_inline())
-       {
-               _set(etl::handle<Canvas>(x));
-       }
-       else
-       {
-               _set(etl::loose_handle<Canvas>(x));
-       }
-       assert(get(x)==x);
-}
-
-void
-ValueBase::set(etl::loose_handle<Canvas> x)
-{
-       clear();
-       if(x && x->is_inline())
-       {
-               _set(etl::handle<Canvas>(x));
-       }
-       else
-       {
-               _set(etl::loose_handle<Canvas>(x));
-       }
-       assert(get(x)==x);
-}
-
-void
-ValueBase::set(etl::handle<Canvas> x)
-{
-       clear();
-       if(x && x->is_inline())
-       {
-               _set(etl::handle<Canvas>(x));
-       }
-       else
-       {
-               _set(etl::loose_handle<Canvas>(x));
-       }
-       assert(get(x)==x);
-}
-
-void
-ValueBase::set(const list_type &x)
-{
-       _set(x);
-}
-
-void
-ValueBase::set(const char* x)
-{
-       _set(String(x));
-}
-
-bool
-ValueBase::is_valid()const
-{
-       return type>TYPE_NIL && type<TYPE_END && ref_count;
-}
-
-bool
-ValueBase::empty()const
-{
-       return !is_valid() || ((type==TYPE_LIST)?get_list().empty():false);
-}
-
-ValueBase::Type
-ValueBase::get_contained_type()const
-{
-       if(type!=TYPE_LIST || empty())
-               return TYPE_NIL;
-       return get_list().front().get_type();
-}
-
-ValueBase&
-ValueBase::operator=(const ValueBase& x)
-{
-       if(data!=x.data)
-       {
-               clear();
-               type=x.type;
-               data=x.data;
-               ref_count=x.ref_count;
-       }
-       loop_=x.loop_;
-       return *this;
-}
-
-void
-ValueBase::clear()
-{
-       if(ref_count.unique() && data)
-       {
-               switch(type)
-               {
-               case TYPE_BOOL:
-                       delete static_cast<bool*>(data);
-                       break;
-               case TYPE_INTEGER:
-                       delete static_cast<int*>(data);
-                       break;
-               case TYPE_ANGLE:
-                       delete static_cast<Angle*>(data);
-                       break;
-               case TYPE_VECTOR:
-                       delete static_cast<Vector*>(data);
-                       break;
-               case TYPE_TIME:
-                       delete static_cast<Time*>(data);
-                       break;
-               case TYPE_REAL:
-                       delete static_cast<Real*>(data);
-                       break;
-               case TYPE_COLOR:
-                       delete static_cast<Color*>(data);
-                       break;
-               case TYPE_SEGMENT:
-                       delete static_cast<Segment*>(data);
-                       break;
-               case TYPE_BLINEPOINT:
-                       delete static_cast<BLinePoint*>(data);
-                       break;
-               case TYPE_LIST:
-                       delete static_cast<list_type*>(data);
-                       break;
-               case TYPE_STRING:
-                       delete static_cast<String*>(data);
-                       break;
-               case TYPE_GRADIENT:
-                       delete static_cast<Gradient*>(data);
-                       break;
-
-
-               case TYPE_CANVAS:
-               {
-                       etl::handle<Canvas> canvas(get(etl::loose_handle<Canvas>()));
-                       if(canvas && canvas->is_inline())
-                       {
-                               delete static_cast<etl::handle<Canvas>*>(data);
-                       }
-                       else
-                       {
-                               delete static_cast<etl::loose_handle<Canvas>*>(data);
-                       }
-                       break;
-               }
-               default:
-                       break;
-               }
-       }
-       
-       ref_count.detach();
-       data=0;
-       type=TYPE_NIL;
-}
-
-
-String
-ValueBase::type_name(Type id)
-{
-       switch(id)
-       {
-       case TYPE_REAL:
-               return "real";
-       case TYPE_TIME:
-               return "time";
-       case TYPE_INTEGER:
-               return "integer";
-       case TYPE_BOOL:
-               return "bool";
-       case TYPE_ANGLE:
-               return "angle";
-       case TYPE_VECTOR:
-               return "vector";
-       case TYPE_COLOR:
-               return "color";
-       case TYPE_STRING:
-               return "string";
-       case TYPE_CANVAS:
-               return "canvas";
-       case TYPE_LIST:
-               return "list";
-       case TYPE_SEGMENT:
-               return "segment";
-       case TYPE_GRADIENT:
-               return "gradient";
-       case TYPE_BLINEPOINT:
-               return "bline_point";
-       case TYPE_NIL:
-               return "nil";
-       default:
-               break;
-       }
-       sinfg::warning("Encountered unknown ValueBase with an Type of %d",id);
-//     assert(0);
-       return "UNKNOWN";
-}
-
-ValueBase::Type
-ValueBase::ident_type(const String &str)
-{
-       if(str=="nil" || str=="null")
-               return TYPE_NIL;
-       else if(str=="time" || str==_("time"))
-               return TYPE_TIME;
-       else if(str=="real" || str=="float" || str==_("real"))
-               return TYPE_REAL;
-       else if(str=="integer" || str=="int" || str==_("integer"))
-               return TYPE_INTEGER;
-       else if(str=="bool" || str==_("bool"))
-               return TYPE_BOOL;
-       else if(str=="angle" || str=="degrees" || str=="radians" || str=="rotations")
-               return TYPE_ANGLE;
-       else if(str=="vector" || str=="point")
-               return TYPE_VECTOR;
-       else if(str=="color")
-               return TYPE_COLOR;
-       else if(str=="string")
-               return TYPE_STRING;
-       else if(str=="canvas")
-               return TYPE_CANVAS;
-       else if(str=="list")
-               return TYPE_LIST;
-       else if(str=="segment")
-               return TYPE_SEGMENT;
-       else if(str=="gradient")
-               return TYPE_GRADIENT;
-       else if(str=="bline_point" || str=="blinepoint")
-               return TYPE_BLINEPOINT;
-
-       return TYPE_NIL;
-}
-
-bool
-ValueBase::operator==(const ValueBase& rhs)const
-{
-       if(get_type()!=rhs.get_type())
-               return false;
-       if(data==rhs.data)
-               return true;
-       
-       switch(get_type())
-       {
-       case TYPE_TIME:
-               return get(Time()).is_equal(rhs.get(Time()));
-       case TYPE_REAL:
-               return abs(get(Real())-rhs.get(Real()))<=0.00000000000001;
-       case TYPE_INTEGER:
-               return get(int())==rhs.get(int());
-       case TYPE_BOOL:
-               return get(bool())==rhs.get(bool());
-       case TYPE_ANGLE:
-               return get(Angle())==rhs.get(Angle());
-       case TYPE_VECTOR:
-               return get(Vector()).is_equal_to(rhs.get(Vector()));
-       case TYPE_COLOR:
-               return get(Color())==rhs.get(Color());
-       case TYPE_STRING:
-               return get(String())==rhs.get(String());
-       case TYPE_CANVAS:
-               return get(Canvas::LooseHandle())==rhs.get(Canvas::LooseHandle());
-       case TYPE_LIST:
-               return get_list()==rhs.get_list();
-       case TYPE_SEGMENT:
-//             return get(Segment())==rhs.get(Segment());
-       case TYPE_GRADIENT:
-//             return get(Gradient())==rhs.get(Gradient());
-       case TYPE_BLINEPOINT:
-//             return get(BLinePoint())==rhs.get(BLinePoint());
-       case TYPE_NIL:
-       default:
-               return false;
-               break;
-       }
-       return false;
-}
diff --git a/synfig-core/trunk/src/sinfg/value.h b/synfig-core/trunk/src/sinfg/value.h
deleted file mode 100644 (file)
index 6c9ab9c..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file value.h
-**     \brief Template Header
-**
-**     $Id: value.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUE_H
-#define __SINFG_VALUE_H
-
-/* === H E A D E R S ======================================================= */
-
-//#include "vector.h"
-//#include "time.h"
-#include "segment.h"
-//#include "color.h"
-#include "string.h"
-#include <list>
-#include <vector>
-#include <ETL/trivial>
-#include <ETL/handle>
-#include "general.h"
-//#include "gradient.h"
-#include "blinepoint.h"
-#include "exception.h"
-
-#ifndef SINFG_NO_ANGLE
-#include "angle.h"
-#endif
-
-#include <ETL/ref_count>
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Canvas;
-class Vector;
-class Time;
-class Segment;
-class Gradient;
-class BLinePoint;
-class Color;
-       
-/*!    \class ValueBase
-**     \todo writeme
-*/
-class ValueBase
-{
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public:
-
-       //! \writeme
-       enum Type
-       {
-               TYPE_NIL=0,                     //!< Represents an empty value
-               
-               TYPE_BOOL,
-               TYPE_INTEGER,
-               TYPE_ANGLE,                     //!< Angle
-
-               // All types after this point are larger than 32 bits
-               
-               TYPE_TIME,                      //!< Time
-               TYPE_REAL,                      //!< Real
-
-               // All types after this point are larger than 64 bits
-               
-               TYPE_VECTOR,            //!< Vector
-               TYPE_COLOR,                     //!< Color
-               TYPE_SEGMENT,           //!< Segment
-               TYPE_BLINEPOINT,        //!< BLinePoint
-
-               // All types after this point require construction/destruction
-               
-               TYPE_LIST,                      //!< List
-               TYPE_CANVAS,            //!< Canvas
-               TYPE_STRING,            //!< String
-               TYPE_GRADIENT,          //!< Color Gradient
-
-               TYPE_END                        //!< Not a valid type, used for sanity checks
-       };
-       
-private:
-
-       typedef std::vector<ValueBase> list_type;
-
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-protected:
-       
-       Type type;
-       void *data;
-       etl::reference_counter ref_count;
-       bool loop_;     
-
-       /*
- --    ** -- C O N S T R U C T O R S -----------------------------------
-       */
-       
-public:
-
-       //! \writeme
-       ValueBase();
-
-       //! \writeme
-       template <typename T>
-       ValueBase(const T &x, bool loop_=false):
-               type(TYPE_NIL),data(0),ref_count(0),loop_(loop_)
-               { set(x); }
-
-       //! \writeme
-       ValueBase(Type x);
-
-       //! \writeme
-       ~ValueBase();
-               
-       /*
- --    ** -- O P E R A T O R S ---------------------------------------------------
-       */
-
-public:
-
-       //! \writeme
-       template <class T> ValueBase& operator=(const T& x)
-               { set(x); return *this; }
-
-       //! \writeme
-       ValueBase& operator=(const ValueBase& x);       
-
-       //! \writeme
-       bool operator==(const ValueBase& rhs)const;
-
-       //! \writeme
-       bool operator!=(const ValueBase& rhs)const { return !operator==(rhs); }
-
-       //!     Constant index operator for when value is of type TYPE_LIST
-       const ValueBase &operator[](int index)const
-               { assert(type==TYPE_LIST); assert(index>0); return get_list()[index]; }
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //! \writeme
-       void clear();
-
-       //! \writeme
-       bool get_loop()const { return loop_; }
-
-       //! \writeme
-       void set_loop(bool x) { loop_=x; }      
-               
-       //! \writeme
-       bool empty()const;
-
-       //! \writeme
-       Type get_contained_type()const;
-       
-       //! Returns true if the contained value is defined and valid.
-       bool is_valid()const;
-
-       //!     Returns a string containing the name of the type
-       String type_name()const { return type_name(type); }
-
-       //! Returns the type of the contained value
-       const Type & get_type()const { return type; }
-       
-       //! Checks the type of the parameter against itself. Returns true if they are of the same type.
-       template <class T> bool
-       same_as(const T &x)const
-       {
-               const Type testtype(get_type(x));
-               
-               if(testtype==type)return true;
-               if(     (type==TYPE_REAL || type==TYPE_TIME) &&
-                       (testtype==TYPE_REAL || testtype==TYPE_TIME) )
-                       return true;
-               return false;
-       }
-       
-       
-       // === GET MEMBERS ========================================================     
-       template <typename T>
-       const T &get(const T& x)const
-       {
-               assert(is_valid() && same_as(x));
-               return *static_cast<const T*>(data);
-       }
-       float get(const float &)const { return get(Real()); }
-       etl::loose_handle<Canvas> get(const etl::handle<Canvas>&)const
-               { return get(etl::loose_handle<Canvas>()); }
-       etl::loose_handle<Canvas> get(Canvas*)const
-               { return get(etl::loose_handle<Canvas>()); }
-       const char* get(const char*)const;
-       const list_type& get_list()const { return get(list_type()); }
-       // ========================================================================
-       
-       
-       
-       // === PUT MEMBERS ========================================================     
-       template <typename T>
-       void put(T* x)const
-       {
-               assert(same_as(*x));
-               *x=*static_cast<const T*>(data);
-       }
-       void put(float* x)const { *x=get(Real()); }
-       void put(char** x)const;
-       // ========================================================================
-
-       
-       
-       // === SET MEMBERS ========================================================     
-       template <typename T> void set(const T& x) { _set(x); }
-       void set(const float &x) { _set(Real(x)); }
-       void set(const list_type &x);
-       void set(const char* x);        
-       void set(Canvas*x);
-       void set(etl::loose_handle<Canvas> x);
-       void set(etl::handle<Canvas> x);
-       template <class T> void set(const std::vector<T> &x)
-               { _set(list_type(x.begin(),x.end())); }
-       template <class T> void set(const std::list<T> &x)
-               { _set(list_type(x.begin(),x.end())); } 
-       // ========================================================================
-
-               
-       /*
- --    ** -- S T A T I C   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //!     Returns a string containing the name of the given Type
-       static String type_name(Type id);
-
-       //!     Returns a the corresponding Type of the described type
-       static Type ident_type(const String &str);
-
-
-       // === GET TYPE MEMBERS ===================================================     
-       static const Type get_type(bool) { return TYPE_BOOL; }
-       static const Type get_type(int) { return TYPE_INTEGER; }
-       static const Type get_type(const Time&) { return TYPE_TIME; }
-       static const Type get_type(const Real&) { return TYPE_REAL; }
-       static const Type get_type(const float&) { return TYPE_REAL; }
-       static const Type get_type(const Vector&) { return TYPE_VECTOR; }
-       static const Type get_type(const Color&) { return TYPE_COLOR; }
-       static const Type get_type(const Segment&) { return TYPE_SEGMENT; }
-       static const Type get_type(const BLinePoint&) { return TYPE_BLINEPOINT; }
-       static const Type get_type(const String&) { return TYPE_STRING; }
-       static const Type get_type(const Gradient&) { return TYPE_GRADIENT; }
-       static const Type get_type(Canvas*) { return TYPE_CANVAS; }
-       static const Type get_type(const etl::handle<Canvas>&)
-               { return TYPE_CANVAS; }
-       static const Type get_type(const etl::loose_handle<Canvas>&)
-               { return TYPE_CANVAS; } 
-       static const Type get_type(const list_type&) { return TYPE_LIST; }
-       template <class T> static const Type get_type(const std::vector<T> &x)
-               { return TYPE_LIST; }
-       template <class T> static const Type get_type(const std::list<T> &x)
-               { return TYPE_LIST; }
-       // ========================================================================
-
-               
-       /*
- --    ** -- C A S T   O P E R A T O R S -----------------------------------------
-       */
-
-public:
-
-       template <class T>
-       operator std::list<T>()const
-       {
-               assert(type==TYPE_LIST);
-               std::list<T> ret(get_list().begin(),get_list().end());
-               return ret;
-       }
-       template <class T>
-       operator std::vector<T>()const
-       {
-               assert(type==TYPE_LIST);
-               std::vector<T> ret(get_list().begin(),get_list().end());
-               return ret;
-       }
-       operator const list_type&()const { return get_list(); }
-       //operator const Color&()const { return get(Color()); }
-       //operator const Real&()const { return get(Real()); }
-       //operator const Time&()const { return get(Time()); }
-       
-       operator const Vector&()const {  return get(Vector()); }
-       operator const BLinePoint&()const {  return get(BLinePoint()); }
-       //operator const int&()const {  return get(int()); }
-       //operator const String&()const {  return get(String()); }
-       //operator const char *()const {  return get(String()).c_str(); }
-       operator const Segment&()const { return get(Segment()); }
-
-       /*
- --    ** -- O T H E R -----------------------------------------------------------
-       */
-
-public:
-
-#ifdef USE_HALF_TYPE
-       half get(const half &)const { return get(Real()); }
-       void put(half*x)const { *x=get(Real()); }
-       void set(const half &x) { _set(Real(x)); }
-       static const Type get_type(const half&) { return TYPE_REAL; }
-       operator half()const { return get(Real()); }
-#endif
-       
-#ifndef SINFG_NO_ANGLE
-       operator const Angle&()const { return get(Angle()); }
-       static const Type get_type(const Angle&) { return TYPE_ANGLE; }
-#endif
-
-       
-private:
-       
-       template <typename T> void
-       _set(const T& x)
-       {
-               const Type newtype(get_type(x));
-               
-               assert(newtype!=TYPE_NIL);
-               
-               if(newtype==type)
-               {
-                       if(ref_count.unique())
-                       {
-                               *reinterpret_cast<T*>(data)=x;
-                               return;
-                       }
-               }
-
-               clear();
-
-               type=newtype;
-               ref_count.reset();
-               data=new T(x);
-       }       
-}; // END of class ValueBase
-
-
-/*!    \class Value
-**     \todo writeme
-*/
-template <class T>
-class Value : public ValueBase
-{
-public:
-       Value(const T &x):ValueBase(x)
-       {
-       }
-       
-       Value(const ValueBase &x):ValueBase(x)
-       {
-               if(!x.same_as(T()))
-                       throw Exception::BadType("Value<T>(ValueBase): Type Mismatch");
-       }
-       
-       Value()
-       {
-       }
-       
-       T get()const { return ValueBase::get(T()); }
-
-       void put(T* x)const     { ValueBase::put(x); }
-       
-       void set(const T& x) { ValueBase::operator=(x); }
-
-       Value<T>& operator=(const T& x) { set(x); return *this; }
-
-       Value<T>& operator=(const Value<T>& x) { return ValueBase::operator=(x); }
-
-       Value<T>& operator=(const ValueBase& x)
-       {
-               if(!x.same_as(T()))
-                       throw Exception::BadType("Value<T>(ValueBase): Type Mismatch");
-               return ValueBase::operator=(x);
-       }
-       
-}; // END of class Value
-
-/*
-template <>
-class Value< std::list<CT> > : public ValueBase
-{
-public:
-       Value(const T &x):ValueBase(x)
-       {
-       }
-       Value(const ValueBase &x):ValueBase(x)
-       {
-               if(!x.same_as(T()))
-                       throw Exception::BadType("Value<T>(ValueBase): Type Mismatch");
-       }
-       Value()
-       {
-       }
-       
-       T get()const { return ValueBase::get(T()); }
-
-       void put(T* x)const     { ValueBase::put(x); }
-       
-       void set(const T& x) { ValueBase::operator=(x); }
-
-       Value<T>& operator=(const T& x) { set(x); return *this; }
-
-       Value<T>& operator=(const Value<T>& x) { return ValueBase::operator=(x); }
-
-       Value<T>& operator=(const ValueBase& x)
-       {
-               if(!x.same_as(T()))
-                       throw Exception::BadType("Value<T>(ValueBase): Type Mismatch");
-               return ValueBase::operator=(x);
-       }
-       
-}; // END of class Value
-*/
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode.cpp b/synfig-core/trunk/src/sinfg/valuenode.cpp
deleted file mode 100644 (file)
index 5358530..0000000
+++ /dev/null
@@ -1,501 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file value_node.cpp
-**     \brief Template File
-**
-**     $Id: valuenode.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#define SINFG_NO_ANGLE
-
-//#define HAS_HASH_MAP 1
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode.h"
-#include "general.h"
-#include "canvas.h"
-
-#include "valuenode_const.h"
-#include "valuenode_linear.h"
-#include "valuenode_composite.h"
-#include "valuenode_reference.h"
-#include "valuenode_scale.h"
-#include "valuenode_segcalctangent.h"
-#include "valuenode_segcalcvertex.h"
-#include "valuenode_stripes.h"
-#include "valuenode_subtract.h"
-#include "valuenode_timedswap.h"
-#include "valuenode_twotone.h"
-#include "valuenode_bline.h"
-#include "valuenode_dynamiclist.h"
-#include "valuenode_radialcomposite.h"
-#include "valuenode_gradientrotate.h"
-#include "valuenode_sine.h"
-
-#include "layer.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-static int value_node_count(0);
-
-static LinkableValueNode::Book *book_;
-
-
-ValueNode::LooseHandle
-sinfg::find_value_node(const GUID& guid)
-{
-       return guid_cast<ValueNode>(guid);
-}
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-bool
-ValueNode::subsys_init()
-{
-       book_=new LinkableValueNode::Book();
-
-#define ADD_VALUENODE(c,n) (*book_)[n].factory=reinterpret_cast<LinkableValueNode::Factory>(&c::create); (*book_)[n].check_type=&c::check_type;(*book_)[n].local_name=n
-#define ADD_VALUENODE2(c,n) (*book_)[n].factory=reinterpret_cast<LinkableValueNode::Factory>(&c::create_from); (*book_)[n].check_type=&c::check_type;(*book_)[n].local_name=n
-
-       ADD_VALUENODE(ValueNode_Linear,"linear");
-       ADD_VALUENODE(ValueNode_Composite,"composite");
-       ADD_VALUENODE(ValueNode_RadialComposite,"radial_composite");
-       ADD_VALUENODE(ValueNode_Reference,"reference");
-       ADD_VALUENODE(ValueNode_Scale,"scale");
-       ADD_VALUENODE(ValueNode_SegCalcTangent,"segcalctangent");
-       ADD_VALUENODE(ValueNode_SegCalcVertex,"segcalcvertex");
-       ADD_VALUENODE(ValueNode_Stripes,"stripes");
-       ADD_VALUENODE(ValueNode_Subtract,"subtract");
-       //ADD_VALUENODE(ValueNode_TimedSwap,"timed_swap");
-       ADD_VALUENODE(ValueNode_TwoTone,"twotone");
-       ADD_VALUENODE(ValueNode_BLine,"bline");
-       ADD_VALUENODE2(ValueNode_DynamicList,"dynamic_list");
-       ADD_VALUENODE(ValueNode_GradientRotate,"gradient_rotate");
-       ADD_VALUENODE(ValueNode_Sine,"sine");
-       
-#undef ADD_VALUENODE
-       return true;
-}
-
-bool
-ValueNode::subsys_stop()
-{
-       delete book_;
-/*     if(global_value_node_map.size() || value_node_count)
-       {
-               if(value_node_count)
-                       sinfg::error("%d ValueNodes haven't been destroyed yet!",value_node_count);
-
-               if(global_value_node_map.size()!=value_node_count)
-                       sinfg::error("value node count mismatch! map.size()!=value_node_count (%d!=%d)",global_value_node_map.size(),value_node_count);
-               
-               GlobalValueNodeMap::iterator iter;              
-               for(iter=global_value_node_map.begin();iter!=global_value_node_map.end();++iter)
-               {
-                       if(!iter->second->is_exported())
-                               sinfg::info("%s: count:%d name:%s type:%s",
-                                       iter->first.get_string().c_str(),
-                                       iter->second->count(),
-                                       iter->second->get_name().c_str(),
-                                       ValueBase::type_name(iter->second->get_type()).c_str()
-                               );
-                       else
-                               sinfg::info("%s: id:%s count:%d name:%s type:%s",
-                                       iter->first.get_string().c_str(),
-                                       iter->second->get_id().c_str(),
-                                       iter->second->count(),
-                                       iter->second->get_name().c_str(),
-                                       ValueBase::type_name(iter->second->get_type()).c_str()
-                               );
-               }
-       }
-*/
-       return true;
-}
-
-ValueNode::ValueNode(ValueBase::Type type):type(type)
-{
-       value_node_count++;
-}
-
-LinkableValueNode::Book&
-LinkableValueNode::book()
-{
-       return *book_;
-}
-
-LinkableValueNode::Handle
-LinkableValueNode::create(const String &name, const ValueBase& x)
-{
-       if(!book().count(name))
-               return 0;
-       return book()[name].factory(x);
-}
-
-bool
-LinkableValueNode::check_type(const String &name, ValueBase::Type x)
-{
-       if(!book().count(name) || !book()[name].check_type)
-               return false;
-       return book()[name].check_type(x);
-}
-
-bool
-LinkableValueNode::set_link(int i,ValueNode::Handle x)
-{
-       ValueNode::Handle previous(get_link(i));
-       
-       if(set_link_vfunc(i,x))
-       {
-               if(previous)
-                       remove_child(previous.get());
-               add_child(x.get());
-               
-               if(!x->is_exported() && get_parent_canvas())
-               {
-                       x->set_parent_canvas(get_parent_canvas());
-               }
-               changed();
-               return true;
-       }
-       return false;
-}
-
-ValueNode::LooseHandle
-LinkableValueNode::get_link(int i)const
-{
-       return get_link_vfunc(i);
-}
-
-void
-LinkableValueNode::unlink_all()
-{
-       for(int i=0;i<link_count();i++)
-       {
-               ValueNode::LooseHandle value_node(get_link(i));
-               if(value_node)
-                       value_node->parent_set.erase(this);
-       }
-}
-
-ValueNode::~ValueNode()
-{
-       value_node_count--;
-       
-       begin_delete();
-
-       //DEBUGPOINT();
-}
-
-void
-ValueNode::on_changed()
-{
-       if(get_parent_canvas())
-               get_parent_canvas()->signal_value_node_changed()(this);
-       else if(get_root_canvas() && get_parent_canvas())
-               get_root_canvas()->signal_value_node_changed()(this);
-       
-       Node::on_changed();
-}
-
-int
-ValueNode::replace(etl::handle<ValueNode> x)
-{
-       if(x.get()==this)
-               return 0;
-       
-       while(parent_set.size())
-       {
-               (*parent_set.begin())->add_child(x.get());
-               (*parent_set.begin())->remove_child(this);
-               //x->parent_set.insert(*parent_set.begin());
-               //parent_set.erase(parent_set.begin());
-       }
-       int r(RHandle(this).replace(x));
-       x->changed();
-       return r;
-}
-
-void
-ValueNode::set_id(const String &x)
-{
-       if(name!=x)
-       {
-               name=x;
-               signal_id_changed_();
-       }
-}
-
-ValueNodeList::ValueNodeList():
-       placeholder_count_(0)
-{
-}
-
-bool
-ValueNodeList::count(const String &id)const
-{
-       const_iterator iter;
-
-       if(id.empty())
-               return false;
-
-       for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
-
-       if(iter==end())
-               return false;
-
-       return true;
-}
-
-ValueNode::Handle
-ValueNodeList::find(const String &id)
-{
-       iterator iter;
-
-       if(id.empty())
-               throw Exception::IDNotFound("Empty ID");
-
-       for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
-
-       if(iter==end())
-               throw Exception::IDNotFound("ValueNode in ValueNodeList: "+id);
-
-       return *iter;
-}
-
-ValueNode::ConstHandle
-ValueNodeList::find(const String &id)const
-{
-       const_iterator iter;
-
-       if(id.empty())
-               throw Exception::IDNotFound("Empty ID");
-
-       for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
-
-       if(iter==end())
-               throw Exception::IDNotFound("ValueNode in ValueNodeList: "+id);
-
-       return *iter;
-}
-
-ValueNode::Handle
-ValueNodeList::surefind(const String &id)
-{
-       if(id.empty())
-               throw Exception::IDNotFound("Empty ID");
-       
-       ValueNode::Handle value_node;
-       
-       try
-       {
-               value_node=find(id);
-       }
-       catch(Exception::IDNotFound)
-       {
-               value_node=PlaceholderValueNode::create();
-               value_node->set_id(id);
-               push_back(value_node);
-               placeholder_count_++;
-       }
-
-       return value_node;
-}
-
-bool
-ValueNodeList::erase(ValueNode::Handle value_node)
-{
-       assert(value_node);
-
-       iterator iter;
-
-       for(iter=begin();iter!=end();++iter)
-               if(value_node.get()==iter->get())
-               {
-                       std::list<ValueNode::RHandle>::erase(iter);
-                       if(PlaceholderValueNode::Handle::cast_dynamic(value_node))
-                               placeholder_count_--;
-                       return true;
-               }
-       return false;
-}
-
-bool
-ValueNodeList::add(ValueNode::Handle value_node)
-{
-       if(!value_node)
-               return false;
-       if(value_node->get_id().empty())
-               return false;
-
-       try
-       {
-               ValueNode::RHandle other_value_node=find(value_node->get_id());
-               if(PlaceholderValueNode::Handle::cast_dynamic(other_value_node))
-               {
-                       other_value_node->replace(value_node);
-                       placeholder_count_--;
-                       return true;
-               }
-
-               return false;
-       }
-       catch(Exception::IDNotFound)
-       {       
-               push_back(value_node);
-               return true;
-       }
-       
-       return false;
-}
-
-void
-ValueNodeList::audit()
-{
-       iterator iter,next;
-
-       for(next=begin(),iter=next++;iter!=end();iter=next++)
-               if(iter->count()==1)
-                       std::list<ValueNode::RHandle>::erase(iter);
-}
-
-
-String
-PlaceholderValueNode::get_name()const
-{
-       return "placeholder";
-}
-
-String
-PlaceholderValueNode::get_local_name()const
-{
-       return _("Placeholder");
-}
-
-ValueNode*
-PlaceholderValueNode::clone(const GUID& deriv_guid)const
-{
-       ValueNode* ret(new PlaceholderValueNode());
-       ret->set_guid(get_guid()^deriv_guid);
-       return ret;
-}
-
-PlaceholderValueNode::Handle
-PlaceholderValueNode::create(ValueBase::Type type)
-{
-       return new PlaceholderValueNode(type);
-}
-
-ValueBase
-PlaceholderValueNode::operator()(Time t)const
-{
-       assert(0);
-       return ValueBase();
-}
-
-PlaceholderValueNode::PlaceholderValueNode(ValueBase::Type type):
-       ValueNode(type)
-{
-}
-
-ValueNode*
-LinkableValueNode::clone(const GUID& deriv_guid)const
-{
-       { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
-
-       int i;
-       LinkableValueNode *ret=create_new();
-       ret->set_guid(get_guid()^deriv_guid);
-       
-       for(i=0;i<link_count();i++)
-       {
-               ValueNode::Handle link=get_link_vfunc(i);
-               if(!link->is_exported())
-               {
-                       ValueNode::LooseHandle value_node(find_value_node(link->get_guid()^deriv_guid));
-                       if(!value_node)
-                               value_node=link->clone(deriv_guid);
-                       ret->set_link(i,value_node);
-               }
-               else
-                       ret->set_link(i,link);
-       }
-
-       return ret;
-}
-
-String
-ValueNode::get_relative_id(etl::loose_handle<const Canvas> x)const
-{
-       assert(is_exported());
-       assert(canvas_);
-       
-       if(x.get()==canvas_.get())
-               return get_id();
-       
-       return canvas_->_get_relative_id(x)+':'+get_id();
-}
-
-void
-ValueNode::set_parent_canvas(etl::loose_handle<Canvas> x)
-{
-       canvas_=x; if(x) root_canvas_=x->get_root();
-}
-
-void
-ValueNode::set_root_canvas(etl::loose_handle<Canvas> x)
-{
-       root_canvas_=x->get_root();
-}
-
-void LinkableValueNode::get_times_vfunc(Node::time_set &set) const
-{
-       ValueNode::LooseHandle  h;
-       
-       int size = link_count();
-               
-       //just add it to the set...
-       for(int i=0; i < size; ++i)
-       {
-               h = get_link(i);
-
-               if(h)
-               {
-                       const Node::time_set &tset = h->get_times();
-                       set.insert(tset.begin(),tset.end());
-               }
-       }
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode.h b/synfig-core/trunk/src/sinfg/valuenode.h
deleted file mode 100644 (file)
index a9d9f89..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode.h
-**     \brief Template Header
-**
-**     $Id: valuenode.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_H
-#define __SINFG_VALUENODE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "vector.h"
-#include "value.h"
-#include "string.h"
-#include <ETL/handle>
-#include <ETL/stringf>
-#include "exception.h"
-#include <map>
-#include <sigc++/signal.h>
-#include "guid.h"
-
-#ifndef SINFG_NO_ANGLE
-#include <ETL/angle>
-#endif
-
-#include "node.h"
-
-#include <set>
-
-/* === M A C R O S ========================================================= */
-
-// This is a hack for GCC 3.0.4... which has a broken dynamic_cast<>
-// It is deprecated, and will be removed soon.
-#if ( __GNUC__ == 3 ) && ( __GNUC__MINOR__ == 0 )
-# define DCAST_HACK_BASECLASS()        int cast__
-# define DCAST_HACK_ID(x)              static const int my_cast__(void) { return x; }
-# define DCAST_HACK_ENABLE()   cast__=my_cast__()
-#else
-# define DCAST_HACK_BASECLASS()
-# define DCAST_HACK_ID(x)
-# define DCAST_HACK_ENABLE()
-#endif
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class Canvas;
-class LinkableValueNode;
-class Layer;
-       
-/*!    \class ValueNode
-**     \todo writeme
-*/
-class ValueNode : public sinfg::Node
-{
-       friend class Layer;
-       friend class LinkableValueNode;
-               
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public:
-
-       typedef etl::handle<ValueNode> Handle;
-
-       typedef etl::loose_handle<ValueNode> LooseHandle;
-
-       typedef etl::handle<const ValueNode> ConstHandle;
-
-       typedef etl::rhandle<ValueNode> RHandle;
-
-
-       static bool subsys_init();
-
-       static bool subsys_stop();
-
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-
-private:
-       ValueBase::Type type;
-       String name;
-       etl::loose_handle<Canvas> canvas_;
-       etl::loose_handle<Canvas> root_canvas_;
-       
-       /*
- -- ** -- S I G N A L S -------------------------------------------------------
-       */
-
-private:
-
-       //!     ValueBase Changed
-       sigc::signal<void> signal_value_changed_;       
-
-       //!     Children Reordered
-       sigc::signal<void,int*> signal_children_reordered_;     
-
-       //!     Child Changed
-       sigc::signal<void,int> signal_child_changed_;   
-
-       //!     Child Removed
-       sigc::signal<void,int> signal_child_removed_;   
-
-       //!     Child Inserted
-       sigc::signal<void,int> signal_child_inserted_;  
-
-       //!     ID Changed
-       sigc::signal<void> signal_id_changed_;  
-
-       /*
- -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
-       */
-
-public:
-
-       //!     ValueBase Changed
-       sigc::signal<void>& signal_value_changed() { return signal_value_changed_; }
-
-       //!     Children Reordered
-       sigc::signal<void,int*>& signal_children_reordered() { return signal_children_reordered_; }
-
-       //!     Child Changed
-       sigc::signal<void,int>& signal_child_changed() { return signal_child_changed_; }
-
-       //!     Child Removed
-       sigc::signal<void,int>& signal_child_removed() { return signal_child_removed_; }
-
-       //!     Child Inserted
-       sigc::signal<void,int>& signal_child_inserted() { return signal_child_inserted_; }
-
-       //!     ID Changed
-       sigc::signal<void>& signal_id_changed() { return signal_id_changed_; }
-
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-protected:
-       
-       ValueNode(ValueBase::Type type=ValueBase::TYPE_NIL);
-
-public:
-
-       virtual ~ValueNode();
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       //! Returns the value of the ValueNode at time \a t
-       virtual ValueBase operator()(Time t)const
-               { return ValueBase(); }
-
-       //! \internal Sets the id of the ValueNode
-       void set_id(const String &x);
-
-       //! Returns the id of the ValueNode
-       /*!     The ID is used for keeping track of a
-       **      specific instance of a ValueNode. */
-       const String &get_id()const { return name; }
-
-       //! Returns the name of the ValueNode type
-       virtual String get_name()const=0;
-
-       //! Returns the localized name of the ValueNode type
-       virtual String get_local_name()const=0;
-
-
-       //! \writeme
-       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const=0;
-
-       //! \writeme
-       bool is_exported()const { return !get_id().empty(); }
-       
-       //! Returns the type of the ValueNode
-       ValueBase::Type get_type()const { return type; }
-
-       //! Returns a handle to the parent canvas, if it has one.
-       etl::loose_handle<Canvas> get_parent_canvas()const { return canvas_; }
-
-       //! Returns a handle to the parent canvas, if it has one.
-       etl::loose_handle<Canvas> get_root_canvas()const { return root_canvas_; }
-       
-       //! \writeme
-       void set_parent_canvas(etl::loose_handle<Canvas> x);
-
-       //! \writeme
-       void set_root_canvas(etl::loose_handle<Canvas> x);
-       
-       //! \writeme
-       String get_relative_id(etl::loose_handle<const Canvas> x)const;
-       
-       int replace(etl::handle<ValueNode> x);
-       
-protected:
-       //! Sets the type of the ValueNode
-       void set_type(ValueBase::Type t) { type=t; }
-
-       virtual void on_changed();
-       
-public:
-       DCAST_HACK_BASECLASS();
-       DCAST_HACK_ID(0);
-}; // END of class ValueNode
-
-/*!    \class PlaceholderValueNode
-**     \todo writeme
-*/
-class PlaceholderValueNode : public ValueNode
-{
-public:
-       typedef etl::handle<PlaceholderValueNode> Handle;
-       typedef etl::loose_handle<PlaceholderValueNode> LooseHandle;
-       typedef etl::handle<const PlaceholderValueNode> ConstHandle;
-       typedef etl::rhandle<PlaceholderValueNode> RHandle;
-
-private:
-
-       PlaceholderValueNode(ValueBase::Type type=ValueBase::TYPE_NIL);
-
-public:
-       
-       virtual ValueBase operator()(Time t)const;
-
-       virtual String get_name()const;
-
-       virtual String get_local_name()const;
-
-       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
-
-       static Handle create(ValueBase::Type type=ValueBase::TYPE_NIL);
-
-protected:
-       virtual void get_times_vfunc(Node::time_set &set) const {}
-}; // END of class PlaceholderValueNode
-
-
-/*!    \class LinkableValueNode
-**     \todo writeme
-*/
-class LinkableValueNode : public ValueNode
-{
-       friend class ValueNode;
-public:
-
-       typedef etl::handle<LinkableValueNode> Handle;
-
-       typedef etl::loose_handle<LinkableValueNode> LooseHandle;
-
-       typedef etl::handle<const LinkableValueNode> ConstHandle;
-
-       typedef etl::rhandle<LinkableValueNode> RHandle;
-
-
-       //! Type that represents a pointer to a ValueNode's constructor
-       typedef LinkableValueNode* (*Factory)(const ValueBase&);
-
-       typedef bool (*CheckType)(ValueBase::Type);
-
-       struct BookEntry
-       {
-               String local_name;
-               Factory factory;
-               CheckType check_type;           
-       };
-       
-       typedef std::map<String,BookEntry> Book;
-
-       static Book& book();
-
-       static Handle create(const String &name, const ValueBase& x);
-
-       static bool check_type(const String &name, ValueBase::Type x);
-
-public:
-       LinkableValueNode(ValueBase::Type type=ValueBase::TYPE_NIL):
-               ValueNode(type) { }
-
-protected:
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x)=0;
-
-       void unlink_all();
-
-public:
-       
-       virtual int link_count()const=0;
-
-       virtual String link_local_name(int i)const=0;
-
-       virtual String link_name(int i)const=0;
-
-       virtual int get_link_index_from_name(const String &name)const=0;
-               
-       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
-
-       bool set_link(int i,ValueNode::Handle x);
-       bool set_link(const String &name,ValueNode::Handle x) { return set_link(get_link_index_from_name(name),x);      }               
-               
-       ValueNode::LooseHandle get_link(int i)const;
-       ValueNode::LooseHandle get_link(const String &name)const { return get_link(get_link_index_from_name(name)); }
-
-protected:
-       //! Sets the type of the ValueNode
-       void set_type(ValueBase::Type t) { ValueNode::set_type(t); }
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const=0;
-
-       // Wrapper for new operator, used by clone()
-       virtual LinkableValueNode* create_new()const=0;
-       
-       virtual void get_times_vfunc(Node::time_set &set) const;
-}; // END of class LinkableValueNode
-
-/*!    \class ValueNodeList
-**     \brief A searchable value_node list container
-**     \warning Do not confuse with ValueNode_DynamicList!
-**     \todo writeme
-*/
-class ValueNodeList : public std::list<ValueNode::RHandle>
-{
-       int placeholder_count_;
-public:
-       ValueNodeList();
-
-       //! Finds the ValueNode in the list with the given \a name
-       /*!     \return If found, returns a handle to the ValueNode.
-       **              Otherwise, returns an empty handle.
-       */
-       ValueNode::Handle find(const String &name);
-
-       //! Finds the ValueNode in the list with the given \a name
-       /*!     \return If found, returns a handle to the ValueNode.
-       **              Otherwise, returns an empty handle.
-       */
-       ValueNode::ConstHandle find(const String &name)const;
-
-       //! Removes the \a value_node from the list
-       bool erase(ValueNode::Handle value_node);
-
-       //! \writeme
-       bool add(ValueNode::Handle value_node);
-
-       //! \writeme
-       bool count(const String &id)const;
-
-       //! Similar to find, but will create a placeholder value_node if it cannot be found.
-       ValueNode::Handle surefind(const String &name);
-
-       //! Removes any value_nodes with reference counts of 1.
-       void audit();
-       
-       //! Placeholder Count
-       int placeholder_count()const { return placeholder_count_; }
-};
-
-ValueNode::LooseHandle find_value_node(const GUID& guid);
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_animated.cpp b/synfig-core/trunk/src/sinfg/valuenode_animated.cpp
deleted file mode 100644 (file)
index 85ee428..0000000
+++ /dev/null
@@ -1,1174 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_animated.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_animated.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include <vector>
-#include <list>
-#include <stdexcept>
-
-#include <cmath>
-
-#include <ETL/bezier>
-#include <ETL/hermite>
-#include <ETL/spline>
-#include <ETL/handle>
-#include <ETL/misc>
-
-#include <algorithm>
-#include <typeinfo>
-
-#include "canvas.h"
-#include "general.h"
-#include "valuenode_animated.h"
-#include "valuenode_const.h"
-#include "exception.h"
-#include "gradient.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-// Fast binary search implementation
-/*
-template<typename I, typename T> inline I
-binary_find(I begin, I end, const T& value)
-{
-       I iter(begin+(end-begin)/2);
-       
-       while(end-begin>1 && !(*iter==value))
-       {
-               ((*iter<value)?begin:end) = iter;
-               
-               iter = begin+(end-begin)/2;
-       }
-       return iter;
-}
-*/
-
-/*
-template<typename T> String tangent_info(T a, T b, T v)
-{
-       return "...";
-}
-
-String tangent_info(Vector a, Vector b, Vector v)
-{
-       if(a==b)
-               return strprintf("(should be zero) T=[%f,%f], Pp=[%f,%f], Pn=[%f,%f]",v[0],v[1],a[0],a[1],b[0],b[1]);
-       else
-               return strprintf("(should NOT be zero) T=[%f,%f], Pp=[%f,%f], Pn=[%f,%f]",v[0],v[1],a[0],a[1],b[0],b[1]);
-}
-*/
-
-template <class T>
-struct subtractor : public std::binary_function<T, T, T>
-{
-       T operator()(const T &a,const T &b)const
-       {
-               return a-b;
-       }
-};
-
-template <>
-struct subtractor<Angle> : public std::binary_function<Angle, Angle, Angle>
-{
-       Angle operator()(const Angle &a,const Angle &b)const
-       {
-               return a.dist(b);
-       }
-};
-
-template <class T>
-struct magnitude : public std::unary_function<float, T>
-{
-       float operator()(const T &a)const
-       {
-               return abs(a);
-       }
-};
-
-template <>
-struct magnitude<Angle> : public std::unary_function<float, Angle>
-{
-       float operator()(const Angle &a)const
-       {
-               return abs(Angle::rad(a).get());
-       }
-};
-
-template <>
-struct magnitude<Vector> : public std::unary_function<float, Vector>
-{
-       float operator()(const Vector &a)const
-       {
-               return a.mag();
-       }
-};
-
-template <>
-struct magnitude<Color> : public std::unary_function<float, Color>
-{
-       float operator()(const Color &a)const
-       {
-               return abs(a.get_y());
-       }
-};
-
-
-
-
-
-template <class T>
-struct is_angle_type
-{
-       bool operator()()const
-       {
-               return false;
-       }
-};
-
-template <>
-struct is_angle_type<Angle>
-{
-       bool operator()()const
-       {
-               return true;
-       }
-};
-
-/* === G L O B A L S ======================================================= */
-
-/* === C L A S S E S ======================================================= */
-
-template<typename T>
-class _Hermite : public sinfg::ValueNode_Animated
-{
-public:
-       typedef T value_type;
-       affine_combo<value_type,Time> affine_combo_func;
-       subtractor<value_type>  subtract_func;
-       magnitude<value_type>   magnitude_func;
-       is_angle_type<value_type>       is_angle;
-private:
-       struct PathSegment
-       {
-               is_angle_type<value_type>       is_angle;
-               subtractor<value_type>  subtract_func;
-               
-               mutable hermite<Time,Time> first;
-               mutable hermite<value_type,Time> second;
-               WaypointList::iterator start;
-               WaypointList::iterator end;
-               
-               value_type resolve(const Time &t)const
-               {
-                       bool start_static(start->is_static());
-                       bool end_static(end->is_static());
-                       
-                       if(!start_static || !end_static)
-                       {
-                               //if(!start_static)
-                                       second.p1()=start->get_value(t).get(value_type());                                      
-                               if(start->get_after()==INTERPOLATION_CONSTANT || end->get_before()==INTERPOLATION_CONSTANT)
-                                       return second.p1();
-                               //if(!end_static)
-                                       second.p2()=end->get_value(t).get(value_type());
-
-                               // At the moment, the only type of non-constant interpolation
-                               // that we support is linear.
-                               second.t1()=
-                               second.t2()=subtract_func(second.p2(),second.p1());
-                               
-                               second.sync();
-                       }
-
-                       return second(first(t));
-               }
-       };
-       typedef vector <
-               PathSegment
-               /*
-               pair <
-                       hermite<Time,Time>,
-                       hermite<value_type,Time>
-               >
-               */
-       > curve_list_type;
-
-       curve_list_type curve_list;
-               
-       // Bounds of this curve
-       Time r,s;
-       
-public:
-       ValueNode* clone(const GUID& deriv_guid)const
-       {
-               { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
-               _Hermite<T>* ret(new _Hermite<T>());
-               ret->set_guid(get_guid()^deriv_guid);
-               for(WaypointList::const_iterator iter=waypoint_list().begin();iter!=waypoint_list().end();++iter)
-                       ret->add(iter->clone(deriv_guid));
-               return ret;
-       }
-
-       _Hermite()
-       {
-               set_type(ValueBase(value_type()).get_type());
-       }
-
-       virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)
-       {
-               // Make sure we are getting data of the correct type
-               //if(data.type!=type)
-               //      return waypoint_list_type::iterator();
-               
-               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
-               Waypoint waypoint(value,t);
-               waypoint.set_parent_value_node(this);
-               
-               waypoint_list_.push_back(waypoint);
-               WaypointList::iterator ret=waypoint_list_.end();
-               --ret;
-               
-               if(is_angle())
-               {
-                       ret->set_before(INTERPOLATION_LINEAR);
-                       ret->set_after(INTERPOLATION_LINEAR);
-               }
-               
-               changed();
-               
-               return ret;
-       }
-
-       virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)
-       {
-               // Make sure we are getting data of the correct type
-               //if(data.type!=type)
-               //      return waypoint_list_type::iterator();
-               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
-               
-               Waypoint waypoint(value_node,t);
-               waypoint.set_parent_value_node(this);
-               
-               waypoint_list_.push_back(waypoint);
-               WaypointList::iterator ret=waypoint_list_.end();
-               --ret;
-
-               if(is_angle())
-               {
-                       ret->set_before(INTERPOLATION_LINEAR);
-                       ret->set_after(INTERPOLATION_LINEAR);
-               }
-
-               changed();
-               
-               return ret;
-       }
-       
-       virtual void on_changed()
-       {
-               ValueNode_Animated::on_changed();
-               
-               if(waypoint_list_.size()<=1)
-                       return;
-               std::sort(waypoint_list_.begin(),waypoint_list_.end());
-               //waypoint_list_.sort();
-
-               r=waypoint_list_.front().get_time();
-               s=waypoint_list_.back().get_time();
-               
-               curve_list.clear();
-               
-               WaypointList::iterator prev,iter,next=waypoint_list_.begin();
-               int i=0;
-               
-               for(iter=next++;iter!=waypoint_list_.end() && next!=waypoint_list_.end();prev=iter,iter=next++,i++)
-               {
-                       typename curve_list_type::value_type curve;
-                       WaypointList::iterator after_next(next);
-                       ++after_next;
-
-                       curve.start=iter;
-                       curve.end=next;
-                       
-                       // Set up the positions
-                       curve.first.set_rs(iter->get_time(), next->get_time());
-                       curve.second.set_rs(iter->get_time(), next->get_time());
-                       
-                       Waypoint::Interpolation iter_get_after(iter->get_after());
-                       Waypoint::Interpolation next_get_after(next->get_after());
-                       Waypoint::Interpolation iter_get_before(iter->get_before());
-                       Waypoint::Interpolation next_get_before(next->get_before());
-                       
-                       if(is_angle())
-                       {
-                               if(iter_get_after==INTERPOLATION_TCB)
-                                       iter_get_after=INTERPOLATION_LINEAR;
-                               if(next_get_after==INTERPOLATION_TCB)
-                                       next_get_after=INTERPOLATION_LINEAR;
-                               if(iter_get_before==INTERPOLATION_TCB)
-                                       iter_get_before=INTERPOLATION_LINEAR;
-                               if(next_get_before==INTERPOLATION_TCB)
-                                       next_get_before=INTERPOLATION_LINEAR;
-                       }
-                       
-                       if(iter->is_static() && next->is_static())
-                       {
-                               curve.second.p1()=iter->get_value().get(T());
-                               curve.second.p2()=next->get_value().get(T());
-                               if(iter_get_after==INTERPOLATION_CONSTANT || next_get_before==INTERPOLATION_CONSTANT)
-                               {
-                                       // Sections must be constant on both sides.
-                                       // NOTE: this is commented out because of some
-                                       // user interface issues. Namely, if a section is
-                                       // constant and the user turns off the constant on
-                                       // one waypoint, this will end up turning it back on.
-                                       // Confusing.
-                                       //iter->get_after()=next->get_before()=INTERPOLATION_CONSTANT;
-                                       curve.second.p1()=
-                                       curve.second.p2()=iter->get_value().get(T());
-                                       curve.second.t1()=
-                                       curve.second.t2()=subtract_func(curve.second.p1(),curve.second.p2());
-                               }
-                               else
-                               {
-                                       if(iter_get_after==INTERPOLATION_TCB && iter!=waypoint_list_.begin() && !is_angle())
-                                       {
-                                               if(iter->get_before()!=INTERPOLATION_TCB && !curve_list.empty())
-                                               {
-                                                       curve.second.t1()=curve_list.back().second.t2();
-                                               }
-                                               else
-                                               {
-
-                                               const Real& t(iter->get_tension());             // Tension
-                                               const Real& c(iter->get_continuity());  // Continuity
-                                               const Real& b(iter->get_bias());                        // Bias
-                                               
-                                               // The folloing line works where the previous line fails.
-                                               value_type Pp; Pp=curve_list.back().second.p1();        // P_{i-1}
-                                               
-                                               const value_type& Pc(curve.second.p1());        // P_i
-                                               const value_type& Pn(curve.second.p2());        // P_{i+1}
-                                               
-                                               // TCB
-                                               value_type vect(static_cast<value_type>(subtract_func(Pc,Pp)*(((1.0-t)*(1.0+c)*(1.0+b))/2.0)+(Pn-Pc)*(((1.0-t)*(1.0-c)*(1.0-b))/2.0)));
-                                               
-                                               // Tension Only
-                                               //value_type vect=(value_type)((Pn-Pp)*(1.0-t));
-                                               
-                                               // Linear
-                                               //value_type vect=(value_type)(Pn-Pc);
-
-                                               // Debugging stuff
-                                               //sinfg::info("%d:t1: %s",i,tangent_info(Pp,Pn,vect).c_str());
-       
-                                               // Adjust for time
-                                               //vect=value_type(vect*(curve.second.get_dt()*2.0)/(curve.second.get_dt()+curve_list.back().second.get_dt()));
-                                               //vect=value_type(vect*(curve.second.get_dt())/(curve_list.back().second.get_dt()));
-       
-                                               curve.second.t1()=vect;
-                                               }
-                                       }
-                                       else if(
-                                               iter_get_after==INTERPOLATION_LINEAR || iter_get_after==INTERPOLATION_HALT ||
-                                               (iter_get_after==INTERPOLATION_TCB && iter==waypoint_list_.begin()))
-                                       {
-                                               curve.second.t1()=subtract_func(curve.second.p2(),curve.second.p1());
-                                       }
-
-                                       if(iter_get_before==INTERPOLATION_TCB && iter->get_after()!=INTERPOLATION_TCB && !curve_list.empty())
-                                       {
-                                               curve_list.back().second.t2()=curve.second.t1();
-                                               curve_list.back().second.sync();
-                                       }
-
-                                       
-                                       if(next_get_before==INTERPOLATION_TCB && after_next!=waypoint_list_.end()  && !is_angle())
-                                       {
-                                               const Real &t(next->get_tension());             // Tension
-                                               const Real &c(next->get_continuity());  // Continuity
-                                               const Real &b(next->get_bias());                        // Bias
-                                               const value_type &Pp(curve.second.p1());        // P_{i-1}
-                                               const value_type &Pc(curve.second.p2());        // P_i
-                                               value_type Pn; Pn=after_next->get_value().get(T());     // P_{i+1}
-                                               
-                                               // TCB
-                                               value_type vect(static_cast<value_type>(subtract_func(Pc,Pp)*(((1.0-t)*(1.0-c)*(1.0+b))/2.0)+(Pn-Pc)*(((1.0-t)*(1.0+c)*(1.0-b))/2.0)));
-
-                                               // Tension Only
-                                               //value_type vect((value_type)((Pn-Pp)*(1.0-t)));
-                                               
-                                               // Linear
-                                               //value_type vect=(value_type)(Pc-Pp);
-
-                                               // Debugging stuff
-                                               //sinfg::info("%d:t2: %s",i,tangent_info(Pp,Pn,vect).c_str());
-
-                                               // Adjust for time
-                                               //vect=value_type(vect*(curve.second.get_dt()*2.0)/(curve.second.get_dt()+(after_next->get_time()-next->get_time())));
-                                               //vect=value_type(vect*(curve.second.get_dt()/((after_next->get_time()-next->get_time()))));
-
-                                               curve.second.t2()=vect;
-                                       }
-                                       else if(
-                                               next_get_before==INTERPOLATION_LINEAR || next_get_before==INTERPOLATION_HALT ||
-                                               (next_get_before==INTERPOLATION_TCB && after_next==waypoint_list_.end()))
-                                       {
-                                               curve.second.t2()=subtract_func(curve.second.p2(),curve.second.p1());
-                                       }
-
-                                       // Adjust for time
-                                       const float timeadjust(0.5);
-                                       
-                                       if(!curve_list.empty())
-                                               curve.second.t1()*=(curve.second.get_dt()*(timeadjust+1))/(curve.second.get_dt()*timeadjust+curve_list.back().second.get_dt());
-                                       if(after_next!=waypoint_list_.end())
-                                               curve.second.t2()*=(curve.second.get_dt()*(timeadjust+1))/(curve.second.get_dt()*timeadjust+(after_next->get_time()-next->get_time()));
-
-                                       if(iter_get_after==INTERPOLATION_HALT)
-                                               curve.second.t1()*=0;
-               
-                                       if(next_get_before==INTERPOLATION_HALT)
-                                               curve.second.t2()*=0;                                   
-                               }
-                       }
-
-                       // Set up the time to the default stuff
-                       curve.first.set_rs(iter->get_time(), next->get_time());
-                       curve.first.p1()=iter->get_time();
-                       curve.first.p2()=next->get_time();
-                       curve.first.t1()=(curve.first.p2()-curve.first.p1())*(1.0f-iter->get_time_tension());
-                       curve.first.t2()=(curve.first.p2()-curve.first.p1())*(1.0f-next->get_time_tension());
-
-
-                       curve.first.sync();
-                       curve.second.sync();
-
-                       curve_list.push_back(curve);
-               }
-       }
-       
-       virtual ValueBase operator()(Time t)const
-       {
-               if(waypoint_list_.empty())
-                       return value_type();    //! \todo Perhaps we should throw something here?
-               if(waypoint_list_.size()==1)
-                       return waypoint_list_.front().get_value(t);
-               if(t<=r)
-                       return waypoint_list_.front().get_value(t);
-               if(t>=s)
-                       return waypoint_list_.back().get_value(t);
-                                               
-               typename curve_list_type::const_iterator iter;
-
-               // This next line will set iter to the
-               // correct iterator for the given time.
-               for(iter=curve_list.begin();iter<curve_list.end() && t>=iter->first.get_s();++iter)
-                       continue;
-               if(iter==curve_list.end())
-                       return waypoint_list_.back().get_value(t);
-               return iter->resolve(t);
-       }       
-};  
-
-
-template<typename T>
-class _Constant : public sinfg::ValueNode_Animated
-{
-public:
-       typedef T value_type;
-
-private:
-
-       // Bounds of this curve
-       Time r,s;
-
-public:
-       ValueNode* clone(const GUID& deriv_guid)const
-       {
-               { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
-               _Constant<T>* ret(new _Constant<T>());
-               ret->set_guid(get_guid()^deriv_guid);
-               for(WaypointList::const_iterator iter=waypoint_list().begin();iter!=waypoint_list().end();++iter)
-                       ret->add(iter->clone(deriv_guid));
-               return ret;
-       }
-
-       _Constant()
-       {
-               set_type(ValueBase(value_type()).get_type());
-       }
-
-       virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)
-       {
-               // Make sure we are getting data of the correct type
-               //if(data.type!=type)
-               //      return waypoint_list_type::iterator();
-               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
-               
-               Waypoint waypoint(value,t);
-               waypoint.set_parent_value_node(this);
-               
-               waypoint_list_.push_back(waypoint);
-               WaypointList::iterator ret=waypoint_list_.end();
-               --ret;
-               changed();
-
-               return ret;
-       }
-
-       virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)
-       {
-               // Make sure we are getting data of the correct type
-               //if(data.type!=type)
-               //      return waypoint_list_type::iterator();
-               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
-
-               Waypoint waypoint(value_node,t);
-               waypoint.set_parent_value_node(this);
-               
-               waypoint_list_.push_back(waypoint);
-               WaypointList::iterator ret=waypoint_list_.end();
-               --ret;
-               changed();
-
-               return ret;
-       }
-
-       virtual void on_changed()
-       {
-               ValueNode_Animated::on_changed();
-               
-               if(waypoint_list_.size()<=1)
-                       return;
-               std::sort(waypoint_list_.begin(),waypoint_list_.end());
-               //waypoint_list_.sort();
-               r=waypoint_list_.front().get_time();
-               s=waypoint_list_.back().get_time();
-
-       }
-
-       virtual ValueBase operator()(Time t)const
-       {
-               if(waypoint_list_.size()==1)
-                       return waypoint_list_.front().get_value(t);
-               if(waypoint_list_.empty())
-                       return value_type();
-               if(t<=r)
-                       return waypoint_list_.front().get_value(t);
-               if(t>=s)
-                       return waypoint_list_.back().get_value(t);
-
-               typename WaypointList::const_iterator iter;
-               typename WaypointList::const_iterator next;
-
-               // This next line will set iter to the
-               // correct iterator for the given time.
-               for(next=waypoint_list_.begin(),iter=next++;next!=waypoint_list_.end() && t>=next->get_time();iter=next++)
-                       continue;
-
-               return iter->get_value(t);
-       }
-};
-
-class _AnimBool : public sinfg::ValueNode_Animated
-{
-public:
-       typedef bool value_type;
-
-private:
-
-       // Bounds of this curve
-       Time r,s;
-
-public:
-       ValueNode* clone(const GUID& deriv_guid)const
-       {
-               { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
-               _AnimBool* ret(new _AnimBool());
-               ret->set_guid(get_guid()^deriv_guid);
-               for(WaypointList::const_iterator iter=waypoint_list().begin();iter!=waypoint_list().end();++iter)
-                       ret->add(iter->clone(deriv_guid));
-               return ret;
-       }
-
-       _AnimBool()
-       {
-               set_type(ValueBase(value_type()).get_type());
-       }
-
-       virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)
-       {
-               // Make sure we are getting data of the correct type
-               //if(data.type!=type)
-               //      return waypoint_list_type::iterator();
-               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
-
-               
-               Waypoint waypoint(value,t);
-               waypoint.set_parent_value_node(this);
-               
-               waypoint_list_.push_back(waypoint);
-               WaypointList::iterator ret=waypoint_list_.end();
-               --ret;
-               changed();
-
-               return ret;
-       }
-
-       virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)
-       {
-               // Make sure we are getting data of the correct type
-               //if(data.type!=type)
-               //      return waypoint_list_type::iterator();
-               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
-
-               Waypoint waypoint(value_node,t);
-               waypoint.set_parent_value_node(this);
-               
-               waypoint_list_.push_back(waypoint);
-               WaypointList::iterator ret=waypoint_list_.end();
-               --ret;
-               changed();
-
-               return ret;
-       }
-
-       virtual void on_changed()
-       {
-               ValueNode_Animated::on_changed();
-               
-               if(waypoint_list_.size()<=1)
-                       return;
-               std::sort(waypoint_list_.begin(),waypoint_list_.end());
-               //waypoint_list_.sort();
-               r=waypoint_list_.front().get_time();
-               s=waypoint_list_.back().get_time();
-
-       }
-
-       virtual ValueBase operator()(Time t)const
-       {
-               if(waypoint_list_.size()==1)
-                       return waypoint_list_.front().get_value(t);
-               if(waypoint_list_.empty())
-                       return false;
-               if(t<r)
-                       return waypoint_list_.front().get_value(t);
-               if(t>s)
-                       return waypoint_list_.back().get_value(t);
-
-               WaypointList::const_iterator iter;
-               WaypointList::const_iterator next;
-
-               // This next line will set iter to the
-               // correct iterator for the given time.
-               for(next=waypoint_list_.begin(),iter=next++;next!=waypoint_list_.end() && t>=next->get_time();iter=next++)
-                       if(iter->get_time()==t)
-                               return iter->get_value(t);
-
-               if(iter->get_time()==t)
-                       return iter->get_value(t);
-               
-               if(next!=waypoint_list_.end())
-                       return iter->get_value(t).get(bool()) || next->get_value(t).get(bool());
-               return iter->get_value(t);
-       }
-};
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_Animated::ValueNode_Animated()
-{
-       DCAST_HACK_ENABLE();
-}
-
-int
-ValueNode_Animated::find(const Time& begin,const Time& end,std::vector<Waypoint*>& selected)
-{
-       Time curr_time(begin);
-       int ret(0);
-       
-       // try to grab first waypoint
-       try
-       {
-               WaypointList::iterator iter;
-               iter=find(curr_time);
-               selected.push_back(&*iter);
-               ret++;
-       }
-       catch(...) { }
-       
-       try
-       {
-               WaypointList::iterator iter;
-               while(true)
-               {
-                       iter=find_next(curr_time);
-                       curr_time=iter->get_time();
-                       if(curr_time>=end)
-                               break;
-                       selected.push_back(&*iter);
-                       ret++;
-               }
-       }
-       catch(...) { }
-       
-       return ret;
-}
-
-/*
-void
-ValueNode_Animated::manipulate_time(const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end)
-{
-#define old_2_new(x)   (((x)-old_begin)/(old_end-old_begin)*(new_end-new_begin)+new_begin)
-       std::vector<Waypoint*> selected;
-       std::vector<Waypoint*>::iterator iter;
-
-       if(find(old_begin,old_end,selected))
-       {
-               // check to make sure this operation is OK
-               for(iter=selected.begin();iter!=selected.end();++iter)
-               {
-                       try
-                       {
-                               Time new_time(old_2_new((*iter)->get_time()));
-                               if(new_time>=old_begin && new_time<old_end)
-                                       continue;
-                               find(new_time);
-                               // If we found a waypoint already at that time, then
-                               // we need to abort
-                               throw Exception::BadTime(_("Waypoint Conflict"));
-                       }
-                       catch(Exception::NotFound) { }
-                       
-                       selected.back()->set_time(old_2_new(selected.back()->get_time()));
-                       selected.pop_back();
-               }
-       
-               
-               while(!selected.empty())
-               {
-                       selected.back()->set_time(old_2_new(selected.back()->get_time()));
-                       selected.pop_back();
-               }
-               
-               changed();
-       }
-#undef old_2_new
-}
-*/
-
-Waypoint
-ValueNode_Animated::new_waypoint_at_time(const Time& time)const
-{
-       Waypoint waypoint;
-       try
-       {
-               // Trivial case, we are sitting on a waypoint
-               waypoint=*find(time);
-               waypoint.make_unique();
-       }
-       catch(...)
-       {       
-               if(waypoint_list().empty())
-               {
-                       waypoint.set_value((*this)(time));
-               }
-               else
-               {
-                       WaypointList::const_iterator prev;
-                       WaypointList::const_iterator next;
-
-                       bool has_prev(false), has_next(false);
-                       
-                       try { prev=find_prev(time); has_prev=true; } catch(...) { }
-                       try { next=find_next(time); has_next=true; } catch(...) { }
-                       
-                       /*
-                       WaypointList::const_iterator closest;
-
-                       if(has_prev&&!has_next)
-                               closest=prev;
-                       else if(has_next&&!has_prev)
-                               closest=next;
-                       else if(time-prev->get_time()<next->get_time()-time)
-                               closest=prev;
-                       else
-                               closest=next;
-                               
-                       for(iter=waypoint_list().begin();iter!=waypoint_list().end();++iter)
-                       {
-                               const Real dist(abs(iter->get_time()-time));
-                               if(dist<abs(closest->get_time()-time))
-                                       closest=iter;
-                       }
-                       */
-                       
-                       if(has_prev && !prev->is_static())
-                               waypoint.set_value_node(prev->get_value_node());
-                       if(has_next && !next->is_static())
-                               waypoint.set_value_node(next->get_value_node());
-                       else
-                               waypoint.set_value((*this)(time));
-                       
-                       /*if(has_prev)
-                               waypoint.set_after(prev->get_before());
-                       if(has_next)
-                               waypoint.set_before(next->get_after());
-                       */
-               }
-       }
-       waypoint.set_time(time);
-       waypoint.set_parent_value_node(const_cast<ValueNode_Animated*>(this));
-//     sinfg::info("waypoint.get_after()=set to %d",waypoint.get_after());
-//     sinfg::info("waypoint.get_before()=set to %d",waypoint.get_before());
-       
-       return waypoint;
-}
-
-ValueNode_Animated::WaypointList::iterator
-ValueNode_Animated::find(const UniqueID &x)
-{
-       ValueNode_Animated::WaypointList::iterator iter;
-       iter=std::find(waypoint_list().begin(),waypoint_list().end(),x);
-       if(iter==waypoint_list().end() || iter->get_uid()!=x.get_uid())
-               throw Exception::NotFound(strprintf("ValueNode_Animated::find(): Can't find UniqueID %d",x.get_uid()));
-       return iter;
-}
-
-ValueNode_Animated::WaypointList::const_iterator
-ValueNode_Animated::find(const UniqueID &x)const
-{
-       return const_cast<ValueNode_Animated*>(this)->find(x);
-       /*
-       ValueNode_Animated::WaypointList::const_iterator iter;
-       iter=std::find(waypoint_list().begin(),waypoint_list().end(),x);
-       if(iter!=waypoint_list().end() && iter->get_uid()!=x.get_uid())
-               throw Exception::NotFound(strprintf("ValueNode_Animated::find()const: Can't find UniqueID %d",x.get_uid()));
-       return iter;
-       */
-}
-
-ValueNode_Animated::WaypointList::iterator
-ValueNode_Animated::find(const Time &x)
-{
-       WaypointList::iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
-
-       if(iter!=waypoint_list().end() && x.is_equal(iter->get_time()))
-               return iter;
-
-       throw Exception::NotFound(strprintf("ValueNode_Animated::find(): Can't find Waypoint at %s",x.get_string().c_str()));
-}
-
-ValueNode_Animated::WaypointList::const_iterator
-ValueNode_Animated::find(const Time &x)const
-{
-       return const_cast<ValueNode_Animated*>(this)->find(x);
-       /*
-       WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
-
-       if(iter!=waypoint_list().end() && x.is_equal(iter->get_time()))
-               return iter;
-
-       throw Exception::NotFound(strprintf("ValueNode_Animated::find(): Can't find Waypoint at %s",x.get_string().c_str()));
-       */
-}
-
-ValueNode_Animated::WaypointList::iterator
-ValueNode_Animated::find_next(const Time &x)
-{
-       WaypointList::iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
-
-       if(iter!=waypoint_list().end())
-       {
-               if(iter->get_time().is_more_than(x))
-                       return iter;
-               ++iter;
-               if(iter!=waypoint_list().end() && iter->get_time().is_more_than(x))
-                       return iter;
-       }
-       
-       throw Exception::NotFound(strprintf("ValueNode_Animated::find_next(): Can't find Waypoint after %s",x.get_string().c_str()));
-}
-
-ValueNode_Animated::WaypointList::const_iterator
-ValueNode_Animated::find_next(const Time &x)const
-{
-       return const_cast<ValueNode_Animated*>(this)->find_next(x);
-       /*
-       WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
-
-       if(iter!=waypoint_list().end())
-       {
-               if(iter->get_time()-Time::epsilon()>x)
-                       return iter;
-               ++iter;
-               if(iter!=waypoint_list().end() && iter->get_time()-Time::epsilon()>x)
-                       return iter;
-       }
-       
-       throw Exception::NotFound(strprintf("ValueNode_Animated::find_next(): Can't find Waypoint after %s",x.get_string().c_str()));
-*/
-}
-
-ValueNode_Animated::WaypointList::iterator
-ValueNode_Animated::find_prev(const Time &x)
-{
-       WaypointList::iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
-
-       if(iter!=waypoint_list().end())
-       {
-               if(iter->get_time().is_less_than(x))
-                       return iter;
-               if(iter!=waypoint_list().begin() && (--iter)->get_time().is_less_than(x))
-                       return iter;
-       }
-       
-       throw Exception::NotFound(strprintf("ValueNode_Animated::find_prev(): Can't find Waypoint after %s",x.get_string().c_str()));
-}
-
-ValueNode_Animated::WaypointList::const_iterator
-ValueNode_Animated::find_prev(const Time &x)const
-{
-       return const_cast<ValueNode_Animated*>(this)->find_prev(x);
-       /*
-       WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
-
-       if(iter!=waypoint_list().end())
-       {
-               if(iter->get_time()+Time::epsilon()<x)
-                       return iter;
-               if(iter!=waypoint_list().begin() && (--iter)->get_time()+Time::epsilon()<x)
-                       return iter;
-       }
-       throw Exception::NotFound(strprintf("ValueNode_Animated::find_prev(): Can't find Waypoint after %s",x.get_string().c_str()));
-       */
-}
-
-void
-ValueNode_Animated::erase(const UniqueID &x)
-{
-       waypoint_list().erase(find(x));
-}
-
-ValueNode_Animated::WaypointList::iterator
-ValueNode_Animated::add(const Waypoint &x)
-{
-       Waypoint waypoint(x);
-       waypoint.set_parent_value_node(this);
-       waypoint_list_.push_back(waypoint);
-       //assert(waypoint_list_.back().get_parent_value_node()==this);
-       WaypointList::iterator ret=waypoint_list_.end();
-       --ret;
-       changed();
-       return ret;
-}
-
-void
-ValueNode_Animated::set_type(ValueBase::Type t)
-{
-       ValueNode::set_type(t);
-}
-
-ValueNode_Animated::Handle
-sinfg::ValueNode_Animated::create(ValueBase::Type type)
-{
-       switch(type)
-       {
-               case ValueBase::TYPE_TIME:
-                       return ValueNode_Animated::Handle(new _Hermite<Time>);
-               case ValueBase::TYPE_REAL:
-                       return ValueNode_Animated::Handle(new _Hermite<Vector::value_type>);
-               case ValueBase::TYPE_INTEGER:
-                       return ValueNode_Animated::Handle(new _Hermite<int>);
-               case ValueBase::TYPE_ANGLE:
-                       return ValueNode_Animated::Handle(new _Hermite<Angle>);
-               case ValueBase::TYPE_VECTOR:
-                       return ValueNode_Animated::Handle(new _Hermite<Vector>);
-               case ValueBase::TYPE_COLOR:
-                       return ValueNode_Animated::Handle(new _Hermite<Color>);
-                       
-               case ValueBase::TYPE_STRING:
-                       return ValueNode_Animated::Handle(new _Constant<String>);
-               case ValueBase::TYPE_GRADIENT:
-                       return ValueNode_Animated::Handle(new _Constant<Gradient>);
-               case ValueBase::TYPE_BOOL:
-                       return ValueNode_Animated::Handle(new _AnimBool);
-               case ValueBase::TYPE_CANVAS:
-                       return ValueNode_Animated::Handle(new _Constant<Canvas::LooseHandle>);
-               default:
-                       throw
-                               Exception::BadType(strprintf(_("%s: You cannot use a %s in an animated ValueNode"),"sinfg::ValueNode_Animated::create()",
-                                       ValueBase::type_name(type).c_str())
-                               );
-                       break;
-       }
-       return ValueNode_Animated::Handle();
-}
-
-ValueNode_Animated::Handle
-ValueNode_Animated::create(const ValueBase& value, const Time& time)
-{
-       return create(ValueNode::Handle(ValueNode_Const::create(value)),time);
-}
-
-ValueNode_Animated::Handle
-ValueNode_Animated::create(ValueNode::Handle value_node, const Time& time)
-{
-       ValueNode_Animated::Handle ret(create(value_node->get_type()));
-       ret->new_waypoint(time,value_node);
-       return ret;
-}
-
-ValueNode_Animated::~ValueNode_Animated()
-{
-}
-
-String
-ValueNode_Animated::get_name()const
-{
-       return "animated";
-}
-
-String
-ValueNode_Animated::get_local_name()const
-{
-       return _("Animated");
-}
-
-void ValueNode_Animated::get_times_vfunc(Node::time_set &set) const
-{
-       //add all the way point times to the value node...
-       
-       WaypointList::const_iterator    i = waypoint_list().begin(),
-                                                                       end = waypoint_list().end();
-
-       for(; i != end; ++i)
-       {
-               TimePoint t;
-               t.set_time(i->get_time());
-               t.set_before(i->get_before());
-               t.set_after(i->get_after());
-               t.set_guid(i->get_guid());
-               set.insert(t);
-       }
-}
-struct timecmp
- {
-       Time t;
-       timecmp(const Time &c) :t(c) {}
-       bool operator()(const Waypoint &rhs) const
-       {
-               return t.is_equal(rhs.get_time());
-       }
- };
- ValueNode_Animated::findresult
- ValueNode_Animated::find_uid(const UniqueID &x)
- {
-       findresult      f;
-       f.second = false;
-       
-       //search for it... and set the bool part of the return value to true if we found it!
-       f.first = std::find(waypoint_list_.begin(), waypoint_list_.end(), x);
-       if(f.first != waypoint_list_.end())
-               f.second = true;
-               
-       return f;
- }
- ValueNode_Animated::const_findresult
- ValueNode_Animated::find_uid(const UniqueID &x)const
- {
-       const_findresult        f;
-       f.second = false;
-       
-       //search for it... and set the bool part of the return value to true if we found it!
-       f.first = std::find(waypoint_list_.begin(), waypoint_list_.end(), x);
-       if(f.first != waypoint_list_.end())
-               f.second = true;
-               
-       return f;
- }
- ValueNode_Animated::findresult        
- ValueNode_Animated::find_time(const Time &x)
- {
-       findresult      f;
-       f.second = false;
-       
-       //search for it... and set the bool part of the return value to true if we found it!
-       f.first = std::find_if(waypoint_list_.begin(), waypoint_list_.end(), timecmp(x));
-       if(f.first != waypoint_list_.end())
-               f.second = true;
-               
-       return f;
- }
-ValueNode_Animated::const_findresult
-ValueNode_Animated::find_time(const Time &x)const
-{
-       const_findresult        f;
-       f.second = false;
-       
-       //search for it... and set the bool part of the return value to true if we found it!
-       f.first = std::find_if(waypoint_list_.begin(), waypoint_list_.end(), timecmp(x));
-       if(f.first != waypoint_list_.end())
-               f.second = true;
-               
-       return f;
-}
-
-void
-ValueNode_Animated::insert_time(const Time& location, const Time& delta)
-{
-       if(!delta)
-               return;
-       try
-       {
-               WaypointList::iterator iter(find_next(location));
-               for(;iter!=waypoint_list().end();++iter)
-               {
-                       iter->set_time(iter->get_time()+delta);
-               }
-               changed();
-       }
-       catch(Exception::NotFound) { }
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_animated.h b/synfig-core/trunk/src/sinfg/valuenode_animated.h
deleted file mode 100644 (file)
index 97351bd..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_animated.h
-**     \brief Template Header
-**
-**     $Id: valuenode_animated.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_ANIMATED_H
-#define __SINFG_VALUENODE_ANIMATED_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <list>
-
-#include "valuenode.h"
-#include "uniqueid.h"
-#include "waypoint.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-struct ValueNode_Animated : public ValueNode
-{
-public:
-       typedef etl::handle<ValueNode_Animated> Handle;
-       typedef etl::handle<const ValueNode_Animated> ConstHandle;
-
-       typedef sinfg::Waypoint Waypoint;
-       typedef sinfg::WaypointList WaypointList;
-       
-       typedef std::pair<WaypointList::iterator,bool>  findresult;
-       typedef std::pair<WaypointList::const_iterator,bool>    const_findresult;
-
-protected:
-       WaypointList waypoint_list_;
-
-public:
-       WaypointList &waypoint_list() { return waypoint_list_; }
-
-       const WaypointList &waypoint_list()const { return waypoint_list_; }
-
-       virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)=0;
-
-       virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)=0;
-
-       /*! \note this does not add any waypoint to the ValueNode! */
-       Waypoint new_waypoint_at_time(const Time& t)const;
-       
-       WaypointList::iterator add(const Waypoint &x);
-
-       void erase(const UniqueID &x);
-       
-       //either use find result (return bool and iterator) or 
-       findresult                      find_uid(const UniqueID &x);
-       const_findresult        find_uid(const UniqueID &x)const;
-       findresult                      find_time(const Time &x);       
-       const_findresult        find_time(const Time &x)const;
-               
-       WaypointList::iterator find(const UniqueID &x);
-       WaypointList::const_iterator find(const UniqueID &x)const;
-       WaypointList::iterator find(const Time &x);     
-       WaypointList::const_iterator find(const Time &x)const;
-       
-       WaypointList::iterator find_next(const Time &x);
-       WaypointList::const_iterator find_next(const Time &x)const;
-       WaypointList::iterator find_prev(const Time &x);
-       WaypointList::const_iterator find_prev(const Time &x)const;
-
-       virtual ~ValueNode_Animated();
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-       static Handle create(ValueBase::Type type);
-
-       static Handle create(const ValueBase& value, const Time& time);
-
-       static Handle create(ValueNode::Handle value_node, const Time& time);
-
-       int find(const Time& begin,const Time& end,std::vector<Waypoint*>& list);
-
-       void insert_time(const Time& location, const Time& delta);
-       
-protected:
-       ValueNode_Animated();
-
-       void set_type(ValueBase::Type t);
-       virtual void get_times_vfunc(Node::time_set &set) const;
-public:
-       DCAST_HACK_ID(4);
-};
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_bline.cpp b/synfig-core/trunk/src/sinfg/valuenode_bline.cpp
deleted file mode 100644 (file)
index c8259fc..0000000
+++ /dev/null
@@ -1,799 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_bline.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_bline.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_bline.h"
-#include "valuenode_const.h"
-#include "valuenode_composite.h"
-#include "general.h"
-#include "exception.h"
-#include "blinepoint.h"
-#include <vector>
-#include <list>
-#include <algorithm>
-#include <ETL/hermite>
-#include <ETL/calculus>
-#include "segment.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-inline Vector
-linear_interpolation(const Vector& a, const Vector& b, float c)
-{ return (b-a)*c+a; }
-
-inline Vector
-radial_interpolation(const Vector& a, const Vector& b, float c)
-{
-       affine_combo<Real,float> mag_combo;
-       affine_combo<Angle,float> ang_combo;
-       
-       Real mag(mag_combo(a.mag(),b.mag(),c));
-       Angle ang(ang_combo(Angle::tan(a[1],a[0]),Angle::tan(b[1],b[0]),c));
-       
-       return Point( mag*Angle::cos(ang).get(),mag*Angle::sin(ang).get() );
-}
-
-
-
-ValueBase
-sinfg::convert_bline_to_segment_list(const ValueBase& bline)
-{
-       std::vector<Segment> ret;
-       
-//     std::vector<BLinePoint> list(bline.operator std::vector<BLinePoint>());
-       //std::vector<BLinePoint> list(bline);
-       std::vector<BLinePoint> list(bline.get_list().begin(),bline.get_list().end());
-       std::vector<BLinePoint>::const_iterator iter;
-
-       BLinePoint prev,first;
-       
-       //start with prev = first and iter on the second...
-       
-       if(list.empty()) return ValueBase(ret,bline.get_loop());
-       first = prev = list.front();
-       
-       for(iter=++list.begin();iter!=list.end();++iter)
-       {
-               ret.push_back(
-                       Segment(
-                               prev.get_vertex(),
-                               prev.get_tangent2(),
-                               iter->get_vertex(),
-                               iter->get_tangent1()
-                       )
-               );
-               prev=*iter;
-       }               
-       if(bline.get_loop())
-       {
-               ret.push_back(
-                       Segment(
-                               prev.get_vertex(),
-                               prev.get_tangent2(),
-                               first.get_vertex(),
-                               first.get_tangent1()
-                       )
-               );
-       }
-       return ValueBase(ret,bline.get_loop());
-}
-
-ValueBase
-sinfg::convert_bline_to_width_list(const ValueBase& bline)
-{
-       std::vector<Real> ret;
-//     std::vector<BLinePoint> list(bline.operator std::vector<BLinePoint>());
-       //std::vector<BLinePoint> list(bline);
-       std::vector<BLinePoint> list(bline.get_list().begin(),bline.get_list().end());
-       std::vector<BLinePoint>::const_iterator iter;
-       
-       if(bline.empty())
-               return ValueBase(ValueBase::TYPE_LIST);
-       
-       for(iter=list.begin();iter!=list.end();++iter)
-               ret.push_back(iter->get_width());
-
-       if(bline.get_loop())
-               ret.push_back(list.front().get_width());
-
-       return ValueBase(ret,bline.get_loop());
-}
-
-
-/* === M E T H O D S ======================================================= */
-
-
-ValueNode_BLine::ValueNode_BLine():
-       ValueNode_DynamicList(ValueBase::TYPE_BLINEPOINT)
-{
-}
-
-ValueNode_BLine::~ValueNode_BLine()
-{
-}
-
-ValueNode_BLine*
-ValueNode_BLine::create(const ValueBase &value)
-{
-       if(value.get_type()!=ValueBase::TYPE_LIST)
-               return 0;
-       
-       ValueNode_BLine* value_node(new ValueNode_BLine());
-
-       if(!value.empty())
-       {
-               switch(value.get_contained_type())
-               {
-               case ValueBase::TYPE_BLINEPOINT:
-               {
-//                     std::vector<BLinePoint> bline_points(value.operator std::vector<BLinePoint>());
-                       //std::vector<BLinePoint> bline_points(value);
-                       std::vector<BLinePoint> bline_points(value.get_list().begin(),value.get_list().end());
-                       std::vector<BLinePoint>::const_iterator iter;
-
-                       for(iter=bline_points.begin();iter!=bline_points.end();iter++)
-                       {       
-                               value_node->add(ValueNode::Handle(ValueNode_Composite::create(*iter)));
-                       }
-                       value_node->set_loop(value.get_loop());
-               }
-                       break;
-               case ValueBase::TYPE_SEGMENT:
-               {
-                       // Here, we want to convert a list of segments
-                       // into a list of BLinePoints. We make an assumption
-                       // that the segment list is continuous(sp), but not necessarily
-                       // smooth.
-                       
-                       value_node->set_loop(false);
-//                     std::vector<Segment> segments(value.operator std::vector<Segment>());
-//                     std::vector<Segment> segments(value);
-                       std::vector<Segment> segments(value.get_list().begin(),value.get_list().end());
-                       std::vector<Segment>::const_iterator iter,last(segments.end());
-                       --last;
-                       ValueNode_Const::Handle prev,first;
-                       
-                       for(iter=segments.begin();iter!=segments.end();iter++)
-                       {       
-#define PREV_POINT     prev->get_value().get(BLinePoint())
-#define FIRST_POINT    first->get_value().get(BLinePoint())
-#define CURR_POINT     curr->get_value().get(BLinePoint())
-                               if(iter==segments.begin())
-                               {
-                                       prev=ValueNode_Const::create(ValueBase::TYPE_BLINEPOINT);
-                                       {
-                                               BLinePoint prev_point(PREV_POINT);
-                                               prev_point.set_vertex(iter->p1);                                        
-                                               prev_point.set_tangent1(iter->t1);
-                                               prev_point.set_width(0.01);
-                                               prev_point.set_origin(0.5);
-                                               prev_point.set_split_tangent_flag(false);
-                                               prev->set_value(prev_point);
-                                       }
-                                       first=prev;
-                                       value_node->add(ValueNode::Handle(prev));
-                                       
-                               }
-                               if(iter==last && iter->p2.is_equal_to(FIRST_POINT.get_vertex()))
-                               {
-                                       value_node->set_loop(true);
-                                       if(!iter->t2.is_equal_to(FIRST_POINT.get_tangent1()))
-                                       {
-                                               BLinePoint first_point(FIRST_POINT);
-                                               first_point.set_tangent1(iter->t2);
-                                               first->set_value(first_point);
-                                       }
-                                       continue;
-                               }
-                                       
-                               ValueNode_Const::Handle curr;
-                               curr=ValueNode_Const::create(ValueBase::TYPE_BLINEPOINT);
-                               {
-                                       BLinePoint curr_point(CURR_POINT);
-                                       curr_point.set_vertex(iter->p2);                                        
-                                       curr_point.set_tangent1(iter->t2);
-                                       curr_point.set_width(0.01);
-                                       curr_point.set_origin(0.5);
-                                       curr_point.set_split_tangent_flag(false);
-                                       curr->set_value(curr_point);
-                               }
-                               if(!PREV_POINT.get_tangent1().is_equal_to(iter->t1))
-                               {
-                                       BLinePoint prev_point(PREV_POINT);
-                                       prev_point.set_split_tangent_flag(true);
-                                       prev_point.set_tangent2(iter->t1);
-                                       prev->set_value(prev_point);
-                               }
-                               value_node->add(ValueNode::Handle(curr));
-                               prev=curr;
-                       }
-                       
-               }
-                       break;
-               default:
-                       // We got a list of who-knows-what. We don't have any idea
-                       // what to do with it.
-                       return 0;
-                       break;
-               }
-       }
-       
-       
-       return value_node;
-}
-
-ValueNode_BLine::ListEntry
-ValueNode_BLine::create_list_entry(int index, Time time, Real origin)
-{
-       ValueNode_BLine::ListEntry ret;
-
-       
-       sinfg::BLinePoint prev,next;
-
-       int prev_i,next_i;
-
-       index=index%link_count();
-
-       assert(index>=0);
-       ret.index=index;
-       ret.set_parent_value_node(this);
-
-       if(!list[index].status_at_time(time))
-               next_i=find_next_valid_entry(index,time);
-       else
-               next_i=index;
-       prev_i=find_prev_valid_entry(index,time);
-       
-       sinfg::info("index=%d, next_i=%d, prev_i=%d",index,next_i,prev_i);
-       
-       next=(*list[next_i].value_node)(time);
-       prev=(*list[prev_i].value_node)(time);
-       
-       etl::hermite<Vector> curve(prev.get_vertex(),next.get_vertex(),prev.get_tangent2(),next.get_tangent1());
-       etl::derivative< etl::hermite<Vector> > deriv(curve);
-
-       sinfg::BLinePoint bline_point;
-       bline_point.set_vertex(curve(origin));
-       bline_point.set_width((next.get_width()-prev.get_width())*origin+prev.get_width());
-       bline_point.set_tangent1(deriv(origin)*min(1.0-origin,origin));
-       bline_point.set_tangent2(bline_point.get_tangent1());
-       bline_point.set_split_tangent_flag(false);
-       bline_point.set_origin(origin);
-       
-       ret.value_node=ValueNode_Composite::create(bline_point);
-       
-       return ret;
-}
-
-ValueBase
-ValueNode_BLine::operator()(Time t)const
-{
-       std::vector<BLinePoint> ret_list;
-       
-       std::vector<ListEntry>::const_iterator iter,first_iter;
-       bool first_flag(true);
-       bool rising;
-       int index(0);
-       float next_scale(1.0f);
-       
-       BLinePoint prev,first;
-       first.set_origin(100.0f);
-       
-       for(iter=list.begin();iter!=list.end();++iter,index++)
-       {
-               float amount(iter->amount_at_time(t,&rising));
-               
-               assert(amount>=0.0f);
-               assert(amount<=1.0f);
-               
-               if(amount==1.0f)
-               {
-                       if(first_flag)
-                       {
-                               first_iter=iter;
-                               first=prev=(*iter->value_node)(t).get(prev);
-                               first_flag=false;
-                               ret_list.push_back(first);
-                               continue;
-                       }
-                       
-                       BLinePoint curr;
-                       curr=(*iter->value_node)(t).get(prev);
-                       
-                       if(next_scale!=1.0f)
-                       {
-                               ret_list.back().set_split_tangent_flag(true);
-                               ret_list.back().set_tangent2(prev.get_tangent2()*next_scale);
-
-                               ret_list.push_back(curr);
-
-                               ret_list.back().set_split_tangent_flag(true);
-                               ret_list.back().set_tangent2(curr.get_tangent2());
-                               ret_list.back().set_tangent1(curr.get_tangent1()*next_scale);
-
-                               next_scale=1.0f;
-                       }
-                       else
-                       {
-                               ret_list.push_back(curr);
-
-                       }
-                       
-                       prev=curr;
-               }
-               else
-               if(amount>0.0f)
-               {
-                       std::vector<ListEntry>::const_iterator begin_iter,end_iter;
-                       
-                       // This is where the interesting stuff happens
-                       // We need to seek forward in the list to see what the next
-                       // active point is
-                       
-                       BLinePoint curr;
-                       BLinePoint begin;       // begin of dynamic group
-                       BLinePoint end;         // End of dynamic group
-                       Time blend_time;
-                       int dist_from_begin(0), dist_from_end(0);
-                       BLinePoint ret;
-                       
-                       Time begin_time;
-                       Time end_time;
-                       
-                       if(!rising)
-                       {
-                               try{ end_time=iter->find_prev(t)->get_time(); }
-                               catch(...) { end_time=Time::begin(); }
-                               try{ begin_time=iter->find_next(t)->get_time(); }
-                               catch(...) { begin_time=Time::end(); }
-                       }
-                       else
-                       {
-                               try{ begin_time=iter->find_prev(t)->get_time(); }
-                               catch(...) { begin_time=Time::begin(); }
-                               try{ end_time=iter->find_next(t)->get_time(); }
-                               catch(...) { end_time=Time::end(); }
-                       }
-                       blend_time=begin_time;
-                       curr=(*iter->value_node)(end_time).get(curr);                           
-
-//                     curr=(*iter->value_node)(t).get(curr);
-                       
-                       // Find "end" of dynamic group
-                       end_iter=iter;
-//                     for(++end_iter;begin_iter!=list.end();++end_iter)
-                       for(++end_iter;end_iter!=list.end();++end_iter)
-                               if(end_iter->amount_at_time(t)>amount)
-                               {
-                                       end=(*end_iter->value_node)(blend_time).get(prev);
-                                       break;
-                               }
-                       
-                       // If we did not find an end of the dynamic group...
-                       if(end_iter==list.end())
-                       {
-                               if(get_loop())
-                               {
-                                       end_iter=first_iter;
-                                       end=(*end_iter->value_node)(blend_time).get(prev);
-//                                     end=first;
-                               }
-                               else
-                               {
-                                       // Writeme!
-                                       end_iter=first_iter;
-                                       end=(*end_iter->value_node)(blend_time).get(prev);
-//                                     end=first;
-                               }
-                       }
-
-                       // Find "begin" of dynamic group
-                       begin_iter=iter;
-                       begin.set_origin(100.0f); // set the origin to 100 (which is crazy) so that we can check to see if it was found
-                       do
-                       {
-                               if(begin_iter==list.begin())
-                               {
-                                       if(get_loop())
-                                               begin_iter=list.end();
-                                       else
-                                               break;
-                               }
-                               
-                               --begin_iter;
-                               dist_from_begin++;
-                               
-                               if(begin_iter==iter)
-                                       break;
-
-                               if(begin_iter->amount_at_time(t)>amount)
-                               {
-                                       begin=(*begin_iter->value_node)(blend_time).get(prev);
-                                       break;
-                               }
-                       }while(begin_iter!=iter);
-                       
-                       // If we did not find a begin
-                       if(begin.get_origin()==100.0f)
-                       {
-                               if(get_loop())
-                               {
-                                       begin_iter=first_iter;
-                                       begin=(*begin_iter->value_node)(blend_time).get(prev);
-//                                     begin=first;
-                               }
-                               else
-                               {
-                                       // Writeme!
-                                       begin_iter=first_iter;
-                                       begin=(*begin_iter->value_node)(blend_time).get(prev);
-//                                     begin=first;
-                               }
-                       }
-                       
-                       etl::hermite<Vector> curve(begin.get_vertex(),end.get_vertex(),begin.get_tangent2(),end.get_tangent1());
-                       etl::derivative< etl::hermite<Vector> > deriv(curve);
-       
-                       ret.set_vertex(curve(curr.get_origin()));
-
-                       ret.set_width((end.get_width()-begin.get_width())*curr.get_origin()+begin.get_width());
-
-                       ret.set_tangent1(deriv(curr.get_origin()));
-                       ret.set_tangent2(deriv(curr.get_origin()));
-                       
-                       float prev_tangent_scalar(1.0f);
-                       float next_tangent_scalar(1.0f);
-                       
-                       //sinfg::info("index_%d:dist_from_begin=%d",index,dist_from_begin);
-                       //sinfg::info("index_%d:dist_from_end=%d",index,dist_from_end);
-                       
-                       // If we are the next to the begin
-                       if(begin_iter==--std::vector<ListEntry>::const_iterator(iter) || dist_from_begin==1)
-                       {
-                               prev_tangent_scalar=(1.0f-curr.get_origin())*amount+curr.get_origin();
-                       }
-                       else
-                       {
-                               float origin=curr.get_origin()-prev.get_origin();
-                               prev_tangent_scalar=(1.0f-origin)*amount+origin;                                
-                       }
-
-                       // If we are the next to the end
-                       if(end_iter==++std::vector<ListEntry>::const_iterator(iter) || dist_from_end==1)
-                       {
-                               float origin=1.0-curr.get_origin();
-                               next_tangent_scalar=(1.0f-origin)*amount+origin;
-                       }
-                       else
-                       if(list.end()!=++std::vector<ListEntry>::const_iterator(iter))
-                       {
-                               BLinePoint next;
-                               next=((*(++std::vector<ListEntry>::const_iterator(iter))->value_node)(t).get(prev));
-                               float origin=next.get_origin()-curr.get_origin();
-                               next_tangent_scalar=(1.0f-origin)*amount+origin;                                
-                       }
-                       next_scale=next_tangent_scalar;
-                       
-                       //ret.set_vertex((curr.get_vertex()-ret.get_vertex())*amount+ret.get_vertex());
-                       if(false)
-                       {
-                               // My first try
-                               Point ref_point_begin(
-                                       (
-                                               (*begin_iter->value_node)(begin_time).get(prev).get_vertex() +
-                                               (*end_iter->value_node)(begin_time).get(prev).get_vertex()
-                                       ) * 0.5
-                               );
-                               Point ref_point_end(
-                                       (
-                                               (*begin_iter->value_node)(end_time).get(prev).get_vertex() +
-                                               (*end_iter->value_node)(end_time).get(prev).get_vertex()
-                                       ) * 0.5
-                               );
-                               Point ref_point_now(
-                                       (
-                                               (*begin_iter->value_node)(t).get(prev).get_vertex() +
-                                               (*end_iter->value_node)(t).get(prev).get_vertex()
-                                       ) * 0.5
-                               );
-                               Point ref_point_linear((ref_point_end-ref_point_begin)*amount+ref_point_begin);
-
-                               ret.set_vertex(
-                                       (curr.get_vertex()-ret.get_vertex())*amount+ret.get_vertex() +
-                                       (ref_point_now-ref_point_linear)
-                               );
-                               ret.set_tangent1((curr.get_tangent1()-ret.get_tangent1())*amount+ret.get_tangent1());
-                               ret.set_split_tangent_flag(curr.get_split_tangent_flag());
-                               if(ret.get_split_tangent_flag())
-                                       ret.set_tangent2((curr.get_tangent2()-ret.get_tangent2())*amount+ret.get_tangent2());
-                       }
-                       else
-                       {
-                               // My second try
-                               Point begin_cord_sys[2], begin_cord_origin;
-                               Point end_cord_sys[2], end_cord_origin;
-                               Point curr_cord_sys[2], curr_cord_origin;
-                               
-                               {
-                                       const Point a((*end_iter->value_node)(begin_time).get(prev).get_vertex());
-                                       const Point b((*begin_iter->value_node)(begin_time).get(prev).get_vertex());
-                                       begin_cord_origin=(a+b)/2;
-                                       begin_cord_sys[0]=( b - a ).norm();
-                                       begin_cord_sys[1]=begin_cord_sys[0].perp();
-                               }
-                               {
-                                       const Point a((*end_iter->value_node)(end_time).get(prev).get_vertex());
-                                       const Point b((*begin_iter->value_node)(end_time).get(prev).get_vertex());
-                                       end_cord_origin=(a+b)/2;
-                                       end_cord_sys[0]=( b - a ).norm();
-                                       end_cord_sys[1]=end_cord_sys[0].perp();
-                               }
-                               {
-                                       const Point a((*end_iter->value_node)(t).get(prev).get_vertex());
-                                       const Point b((*begin_iter->value_node)(t).get(prev).get_vertex());
-                                       curr_cord_origin=(a+b)/2;
-                                       curr_cord_sys[0]=( b - a ).norm();
-                                       curr_cord_sys[1]=curr_cord_sys[0].perp();
-                               }
-                               
-                               /*
-                               end_cord_origin=(*end_iter->value_node)(end_time).get(prev).get_vertex();
-                               end_cord_sys[0]=(
-                                       (*begin_iter->value_node)(end_time).get(prev).get_vertex() -
-                                       end_cord_origin
-                               ).norm();
-                               end_cord_sys[1]=end_cord_sys[0].perp();
-                               
-                               curr_cord_origin=(*end_iter->value_node)(t).get(prev).get_vertex();
-                               curr_cord_sys[0]=(
-                                       (*begin_iter->value_node)(t).get(prev).get_vertex() -
-                                       curr_cord_origin
-                               ).norm();
-                               curr_cord_sys[1]=curr_cord_sys[0].perp();
-                               */
-                               
-                               // Convert start point
-                               Point a;
-                               Vector at1,at2;
-                               {
-                                       Point tmp(ret.get_vertex()-begin_cord_origin);
-                                       a[0]=tmp*begin_cord_sys[0];
-                                       a[1]=tmp*begin_cord_sys[1];
-#define COORD_SYS_RADIAL_TAN_INTERP 1
-                                       
-#ifdef COORD_SYS_RADIAL_TAN_INTERP
-                                       tmp=ret.get_tangent1()+ret.get_vertex()-begin_cord_origin;
-                                       at1[0]=tmp*begin_cord_sys[0];
-                                       at1[1]=tmp*begin_cord_sys[1];
-                                       
-                                       if(curr.get_split_tangent_flag())
-                                       {
-                                               tmp=ret.get_tangent2()+ret.get_vertex()-begin_cord_origin;
-                                               at2[0]=tmp*begin_cord_sys[0];
-                                               at2[1]=tmp*begin_cord_sys[1];
-                                       }
-#endif
-                               }
-                               
-                               // Convert finish point
-                               Point b;
-                               Vector bt1,bt2;
-                               {
-                                       Point tmp(curr.get_vertex()-end_cord_origin);
-                                       b[0]=tmp*end_cord_sys[0];
-                                       b[1]=tmp*end_cord_sys[1];
-                                       
-#ifdef COORD_SYS_RADIAL_TAN_INTERP
-                                       tmp=curr.get_tangent1()+curr.get_vertex()-end_cord_origin;
-                                       bt1[0]=tmp*end_cord_sys[0];
-                                       bt1[1]=tmp*end_cord_sys[1];
-
-                                       if(curr.get_split_tangent_flag())
-                                       {
-                                               tmp=curr.get_tangent2()+curr.get_vertex()-end_cord_origin;
-                                               bt2[0]=tmp*end_cord_sys[0];
-                                               bt2[1]=tmp*end_cord_sys[1];
-                                       }
-#endif
-                               }
-                                                               
-                               // Convert current point
-                               Point c;
-                               Vector ct1,ct2;
-                               {
-                                       // Transpose (invert)
-                                       swap(curr_cord_sys[0][1],curr_cord_sys[1][0]);
-
-                                       Point tmp((b-a)*amount+a);
-                                       c[0]=tmp*curr_cord_sys[0];
-                                       c[1]=tmp*curr_cord_sys[1];
-                                       c+=curr_cord_origin;
-
-#define INTERP_FUNCTION                radial_interpolation
-//#define INTERP_FUNCTION              linear_interpolation
-                                       
-#ifdef COORD_SYS_RADIAL_TAN_INTERP
-                                       tmp=INTERP_FUNCTION(at1,bt1,amount);
-                                       ct1[0]=tmp*curr_cord_sys[0];
-                                       ct1[1]=tmp*curr_cord_sys[1];
-                                       ct1+=curr_cord_origin;
-                                       ct1-=c;
-                                       
-                                       if(curr.get_split_tangent_flag())
-                                       {
-                                               tmp=INTERP_FUNCTION(at2,bt2,amount);
-                                               ct2[0]=tmp*curr_cord_sys[0];
-                                               ct2[1]=tmp*curr_cord_sys[1];
-                                               ct2+=curr_cord_origin;
-                                               ct2-=c;
-                                       }
-#endif
-                               }
-
-                               ret.set_vertex(c);
-#ifndef COORD_SYS_RADIAL_TAN_INTERP
-                               ret.set_tangent1(radial_interpolation(ret.get_tangent1(),curr.get_tangent1(),amount));
-                               ret.set_split_tangent_flag(curr.get_split_tangent_flag());
-                               if(ret.get_split_tangent_flag())
-                                       ret.set_tangent2(radial_interpolation(ret.get_tangent2(),curr.get_tangent2(),amount));
-#else                          
-                               ret.set_tangent1(ct1);
-                               ret.set_split_tangent_flag(curr.get_split_tangent_flag());
-                               if(ret.get_split_tangent_flag())
-                                       ret.set_tangent2(ct2);
-#endif
-                       }
-                       
-                       ret.set_origin(curr.get_origin());
-                       ret.set_width((curr.get_width()-ret.get_width())*amount+ret.get_width());
-                       
-
-                       // Handle the case where we are the first vertex
-                       if(first_flag)
-                       {
-                               ret.set_tangent1(ret.get_tangent1()*prev_tangent_scalar);
-                               first_iter=iter;
-                               first=prev=ret;
-                               first_flag=false;
-                               ret_list.push_back(ret);
-                               continue;
-                       }
-
-                       ret_list.back().set_split_tangent_flag(true);
-                       ret_list.back().set_tangent2(prev.get_tangent2()*prev_tangent_scalar);
-                       ret_list.push_back(ret);
-                       ret_list.back().set_split_tangent_flag(true);
-                       //ret_list.back().set_tangent2(ret.get_tangent1());
-                       ret_list.back().set_tangent1(ret.get_tangent1()*prev_tangent_scalar);
-
-                       prev=ret;
-               }
-       }
-       
-       if(next_scale!=1.0f)
-       {
-               ret_list.back().set_split_tangent_flag(true);
-               ret_list.back().set_tangent2(prev.get_tangent2()*next_scale);
-       }
-
-/*
-       if(get_loop() && !first_flag)
-       {
-               ret_list.push_back(
-                       Segment(
-                       prev.get_vertex(),
-                       prev.get_tangent2(),
-                       first.get_vertex(),
-                       first.get_tangent1()
-                       )
-               );
-       }
-*/
-       
-       if(list.empty())
-               sinfg::warning(string("ValueNode_BLine::operator()():")+_("No entries in list"));
-       else
-       if(ret_list.empty())
-               sinfg::warning(string("ValueNode_BLine::operator()():")+_("No entries in ret_list"));
-
-       return ValueBase(ret_list,get_loop());
-}
-
-String
-ValueNode_BLine::link_local_name(int i)const
-{
-       assert(i>=0 && (unsigned)i<list.size());
-       return etl::strprintf(_("Vertex %03d"),i+1);
-}      
-
-ValueNode*
-ValueNode_BLine::clone(const GUID& deriv_guid)const
-{
-       { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
-
-       ValueNode_BLine* ret=new ValueNode_BLine();
-       ret->set_guid(get_guid()^deriv_guid);
-       
-       std::vector<ListEntry>::const_iterator iter;
-
-       for(iter=list.begin();iter!=list.end();++iter)
-       {
-               if(iter->value_node->is_exported())
-                       ret->add(*iter);
-               else
-               {
-                       ListEntry list_entry(*iter);
-                       //list_entry.value_node=find_value_node(iter->value_node->get_guid()^deriv_guid).get();
-                       //if(!list_entry.value_node)
-                               list_entry.value_node=iter->value_node->clone(deriv_guid);
-                       ret->add(list_entry);
-                       //ret->list.back().value_node=iter->value_node.clone();
-               }
-       }
-       ret->set_loop(get_loop());
-       
-       return ret;
-}
-
-String
-ValueNode_BLine::get_name()const
-{
-       return "bline";
-}
-
-String
-ValueNode_BLine::get_local_name()const
-{
-       return _("BLine");
-}
-
-LinkableValueNode*
-ValueNode_BLine::create_new()const
-{
-       assert(0);
-       return 0;
-}
-
-bool
-ValueNode_BLine::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_LIST;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_bline.h b/synfig-core/trunk/src/sinfg/valuenode_bline.h
deleted file mode 100644 (file)
index b88ba86..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_bline.h
-**     \brief Template Header
-**
-**     $Id: valuenode_bline.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_BLINE_H
-#define __SINFG_VALUENODE_BLINE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <vector>
-#include <list>
-
-#include "valuenode.h"
-#include "time.h"
-#include "uniqueid.h"
-#include "blinepoint.h"
-#include "valuenode_dynamiclist.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-
-//! Converts a list of bline points into a list of segments
-ValueBase convert_bline_to_segment_list(const ValueBase &bline);
-
-//! Converts a list of bline points into a list of widths
-ValueBase convert_bline_to_width_list(const ValueBase &bline);
-       
-/*! \class ValueNode_BLine
-**     \brief \writeme
-*/
-class ValueNode_BLine : public ValueNode_DynamicList
-{
-public:
-
-       typedef etl::handle<ValueNode_BLine> Handle;
-       typedef etl::handle<const ValueNode_BLine> ConstHandle;
-       
-
-       ValueNode_BLine();
-
-public:
-       
-
-       
-       virtual ValueBase operator()(Time t)const;
-
-       virtual ~ValueNode_BLine();
-
-       virtual String link_local_name(int i)const;
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
-       
-       virtual ListEntry create_list_entry(int index, Time time=0, Real origin=0.5);
-
-protected:
-       
-       LinkableValueNode* create_new()const;
-
-public:
-       //using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_BLine* create(const ValueBase &x=ValueBase::TYPE_LIST);
-}; // END of class ValueNode_BLine
-
-typedef ValueNode_BLine::ListEntry::ActivepointList ActivepointList;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_composite.cpp b/synfig-core/trunk/src/sinfg/valuenode_composite.cpp
deleted file mode 100644 (file)
index 3e03ed6..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_composite.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_composite.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_composite.h"
-#include "valuenode_const.h"
-#include <stdexcept>
-#include "general.h"
-#include "valuenode_radialcomposite.h"
-#include "vector.h"
-#include "color.h"
-#include "segment.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::ValueNode_Composite::ValueNode_Composite(const ValueBase &value):
-       LinkableValueNode(value.get_type())
-{
-       switch(get_type())
-       {
-               case ValueBase::TYPE_VECTOR:
-                       set_link("x",ValueNode_Const::create(value.get(Vector())[0]));
-                       set_link("y",ValueNode_Const::create(value.get(Vector())[1]));
-                       break;
-               case ValueBase::TYPE_COLOR:
-                       set_link("r",ValueNode_Const::create(value.get(Color()).get_r()));
-                       set_link("g",ValueNode_Const::create(value.get(Color()).get_g()));
-                       set_link("b",ValueNode_Const::create(value.get(Color()).get_b()));
-                       set_link("a",ValueNode_Const::create(value.get(Color()).get_a()));
-                       break;
-               case ValueBase::TYPE_SEGMENT:
-                       set_link("p1",ValueNode_Const::create(value.get(Segment()).p1));
-                       set_link("t1",ValueNode_Const::create(value.get(Segment()).t1));
-                       set_link("p2",ValueNode_Const::create(value.get(Segment()).p2));
-                       set_link("t2",ValueNode_Const::create(value.get(Segment()).t2));
-                       break;
-               case ValueBase::TYPE_BLINEPOINT:
-               {
-                       BLinePoint bline_point(value);
-                       set_link(0,ValueNode_Const::create(bline_point.get_vertex()));
-                       set_link(1,ValueNode_Const::create(bline_point.get_width()));
-                       set_link(2,ValueNode_Const::create(bline_point.get_origin()));
-                       set_link(3,ValueNode_Const::create(bline_point.get_split_tangent_flag()));
-                       set_link(4,ValueNode_RadialComposite::create(bline_point.get_tangent1()));
-                       set_link(5,ValueNode_RadialComposite::create(bline_point.get_tangent2()));
-                       break;
-               }
-               default:
-                       assert(0);
-                       throw Exception::BadType(ValueBase::type_name(get_type()));                     
-       }
-}
-
-ValueNode_Composite::~ValueNode_Composite()
-{
-       unlink_all();
-}
-
-ValueNode_Composite*
-ValueNode_Composite::create(const ValueBase &value)
-{
-       return new ValueNode_Composite(value);
-}
-       
-LinkableValueNode*
-ValueNode_Composite::create_new()const
-{
-       return new ValueNode_Composite(ValueBase(get_type()));
-}
-
-ValueBase
-sinfg::ValueNode_Composite::operator()(Time t)const
-{
-       switch(get_type())
-       {
-               case ValueBase::TYPE_VECTOR:
-               {
-                       Vector vect;
-                       assert(components[0] && components[1]);
-                       vect[0]=(*components[0])(t).get(Vector::value_type());
-                       vect[1]=(*components[1])(t).get(Vector::value_type());
-                       return vect;
-               }
-               case ValueBase::TYPE_COLOR:
-               {
-                       Color color;
-                       assert(components[0] && components[1] && components[2] && components[3]);
-                       color.set_r((*components[0])(t).get(Vector::value_type()));
-                       color.set_g((*components[1])(t).get(Vector::value_type()));
-                       color.set_b((*components[2])(t).get(Vector::value_type()));
-                       color.set_a((*components[3])(t).get(Vector::value_type()));
-                       return color;
-               }
-               case ValueBase::TYPE_SEGMENT:
-               {
-                       Segment seg;
-                       assert(components[0] && components[1] && components[2] && components[3]);
-                       seg.p1=(*components[0])(t).get(Point());
-                       seg.t1=(*components[1])(t).get(Vector());
-                       seg.p2=(*components[2])(t).get(Point());
-                       seg.t2=(*components[3])(t).get(Vector());
-                       return seg;
-               }
-               case ValueBase::TYPE_BLINEPOINT:
-               {
-                       BLinePoint ret;
-                       assert(components[0] && components[1] && components[2] && components[3] && components[4] && components[5]);
-                       ret.set_vertex((*components[0])(t).get(Point()));
-                       ret.set_width((*components[1])(t).get(Real()));
-                       ret.set_origin((*components[2])(t).get(Real()));
-                       ret.set_split_tangent_flag((*components[3])(t).get(bool()));
-                       ret.set_tangent1((*components[4])(t).get(Vector()));
-                       if(ret.get_split_tangent_flag())
-                               ret.set_tangent2((*components[5])(t).get(Vector()));
-                       return ret;
-               }
-               default:
-                       sinfg::error(string("ValueNode_Composite::operator():")+_("Bad type for composite"));
-                       assert(components[0]);
-                       return (*components[0])(t);
-       }
-}
-
-int
-ValueNode_Composite::link_count()const
-{
-       switch(get_type())
-       {
-       case ValueBase::TYPE_VECTOR:
-               return 2;
-       case ValueBase::TYPE_COLOR:
-               return 4;
-       case ValueBase::TYPE_SEGMENT:
-               return 4;
-       case ValueBase::TYPE_BLINEPOINT:
-               return 6;
-       default:
-               sinfg::warning(string("ValueNode_Composite::component_count():")+_("Bad type for composite"));
-               return 1;
-       }
-}
-
-bool
-ValueNode_Composite::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i>=0);
-       assert(i<6);
-       
-       if(PlaceholderValueNode::Handle::cast_dynamic(x))
-       {
-               components[i]=x;
-               return true;
-       }
-
-       switch(get_type())
-       {
-               case ValueBase::TYPE_VECTOR:
-                       assert(i<2);
-                       if(x->get_type()==ValueBase(Real()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
-                       {
-                               components[i]=x;
-                               return true;
-                       }
-                       break;
-
-               case ValueBase::TYPE_COLOR:
-                       assert(i<4);
-                       if(x->get_type()==ValueBase(Real()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
-                       {
-                               components[i]=x;
-                               return true;
-                       }
-                       break;
-                       
-               case ValueBase::TYPE_SEGMENT:
-                       assert(i<4);
-                       if(x->get_type()==ValueBase(Point()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
-                       {
-                               components[i]=x;
-                               return true;
-                       }
-                       break;
-
-               case ValueBase::TYPE_BLINEPOINT:
-                       assert(i<6);
-                       if((i==0 || i==4 || i==5) && x->get_type()==ValueBase(Point()).get_type())
-                       {
-                               components[i]=x;
-                               return true;
-                       }
-                       if((i==1 || i==2) && x->get_type()==ValueBase(Real()).get_type())
-                       {
-                               components[i]=x;
-                               return true;
-                       }
-                       if(i==3 && x->get_type()==ValueBase(bool()).get_type())
-                       {
-                               components[i]=x;
-                               return true;
-                       }
-                       break;
-                       
-               default:
-                       break;
-       }
-       return false;   
-}
-
-ValueNode::LooseHandle
-ValueNode_Composite::get_link_vfunc(int i)const
-{
-       assert(i>=0 && i<6);
-       return components[i];
-}
-
-String
-ValueNode_Composite::link_local_name(int i)const
-{
-       assert(i>=0 && i<6);
-       switch(get_type())
-       {
-               case ValueBase::TYPE_VECTOR:
-                       return strprintf("%c-Axis",'X'+i);
-
-               case ValueBase::TYPE_COLOR:
-                       if(i==0)
-                               return _("Red");
-                       else if(i==1)
-                               return _("Green");
-                       else if(i==2)
-                               return _("Blue");
-                       else if(i==3)
-                               return _("Alpha");
-                       
-               case ValueBase::TYPE_SEGMENT:
-                       if(i==0)
-                               return _("Vertex 1");
-                       else if(i==1)
-                               return _("Tangent 1");
-                       else if(i==2)
-                               return _("Vertex 2");
-                       else if(i==3)
-                               return _("Tangent 2");
-
-               case ValueBase::TYPE_BLINEPOINT:
-                       if(i==0)
-                               return _("Vertex");
-                       else if(i==1)
-                               return _("Width");
-                       else if(i==2)
-                               return _("Origin");
-                       else if(i==3)
-                               return _("Split Tangents");
-                       else if(i==4)
-                               return _("Tangent 1");
-                       else if(i==5)
-                               return _("Tangent 2");
-
-               default:
-                       break;
-       }
-       return etl::strprintf(_("C%d"),i+1);    
-}      
-
-
-String
-ValueNode_Composite::link_name(int i)const
-{
-       assert(i>=0 && i<5);
-       return strprintf("c%d",i);
-}      
-
-int
-ValueNode_Composite::get_link_index_from_name(const String &name)const
-{
-       if(name.empty())
-               throw Exception::BadLinkName(name);
-
-       if(name[0]=='c')
-               return name[1]-'0';
-
-       switch(get_type())
-       {
-       case ValueBase::TYPE_COLOR:
-               if(name[0]=='r')
-                       return 0;
-               if(name[0]=='g')
-                       return 1;
-               if(name[0]=='b')
-                       return 2;
-               if(name[0]=='a')
-                       return 3;
-       case ValueBase::TYPE_SEGMENT:
-               if(name=="p1")
-                       return 0;
-               if(name=="t1")
-                       return 1;
-               if(name=="p2")
-                       return 2;
-               if(name=="t2")
-                       return 3;
-       case ValueBase::TYPE_VECTOR:
-               if(name[0]=='x')
-                       return 0;
-               if(name[0]=='y')
-                       return 1;
-               if(name[0]=='z')
-                       return 2;
-       case ValueBase::TYPE_BLINEPOINT:
-               if(name[0]=='p' || name=="v1" || name=="p1")
-                       return 0;
-               if(name=="w" || name=="width")
-                       return 1;
-               if(name=="o" || name=="origin")
-                       return 2;
-               if(name=="split")
-                       return 3;
-               if(name=="t1")
-                       return 4;
-               if(name=="t2")
-                       return 5;
-       default:                        
-               break;
-       }
-
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_Composite::get_name()const
-{
-       return "composite";
-}
-
-String
-ValueNode_Composite::get_local_name()const
-{
-       return _("Composite");
-}
-
-bool
-ValueNode_Composite::check_type(ValueBase::Type type)
-{
-       return
-               type==ValueBase::TYPE_SEGMENT ||
-               type==ValueBase::TYPE_VECTOR ||
-               type==ValueBase::TYPE_COLOR ||
-               type==ValueBase::TYPE_BLINEPOINT;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_composite.h b/synfig-core/trunk/src/sinfg/valuenode_composite.h
deleted file mode 100644 (file)
index 45fad3b..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_composite.h
-**     \brief Template Header
-**
-**     $Id: valuenode_composite.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_COMPOSITE_H
-#define __SINFG_VALUENODE_COMPOSITE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueNode_Composite : public LinkableValueNode
-{
-       ValueNode::RHandle components[6];
-       ValueNode_Composite(const ValueBase &value);
-       
-public:
-       typedef etl::handle<ValueNode_Composite> Handle;
-       typedef etl::handle<const ValueNode_Composite> ConstHandle;
-
-
-       ~ValueNode_Composite();
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-       virtual int link_count()const;
-       virtual String link_name(int i)const;
-       virtual String link_local_name(int i)const;
-       virtual ValueBase operator()(Time t)const;
-
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-       virtual int get_link_index_from_name(const String &name)const;
-       
-protected:
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-       
-       LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_Composite* create(const ValueBase &x);
-}; // END of class ValueNode_Composite
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_const.cpp b/synfig-core/trunk/src/sinfg/valuenode_const.cpp
deleted file mode 100644 (file)
index b412733..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_const.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_const.h"
-#include "general.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_Const::ValueNode_Const()
-{
-       DCAST_HACK_ENABLE();
-}
-
-
-ValueNode_Const::ValueNode_Const(const ValueBase &x):
-       ValueNode       (x.get_type()),
-       value           (x)
-{
-       DCAST_HACK_ENABLE();
-}
-
-
-ValueNode_Const*
-ValueNode_Const::create(const ValueBase &x)
-{
-       return new ValueNode_Const(x);
-}
-
-
-ValueNode*
-ValueNode_Const::clone(const GUID& deriv_guid)const
-{
-       { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
-       ValueNode* ret(new ValueNode_Const(value));
-       ret->set_guid(get_guid()^deriv_guid);
-       return ret;
-}
-
-
-ValueNode_Const::~ValueNode_Const()
-{
-}
-
-
-ValueBase
-ValueNode_Const::operator()(Time t)const
-{
-       return value;
-}
-
-
-const ValueBase &
-ValueNode_Const::get_value()const
-{
-       return value;
-}
-
-ValueBase &
-ValueNode_Const::get_value()
-{
-       return value;
-}
-
-void
-ValueNode_Const::set_value(const ValueBase &data)
-{
-       if(data!=value)
-       {
-               value=data;
-               changed();
-       }
-}
-
-
-String
-ValueNode_Const::get_name()const
-{
-       return "constant";
-}
-
-String
-ValueNode_Const::get_local_name()const
-{
-       return _("Constant");
-}
-
-void ValueNode_Const::get_times_vfunc(Node::time_set &set) const
-{
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_const.h b/synfig-core/trunk/src/sinfg/valuenode_const.h
deleted file mode 100644 (file)
index c2a3dca..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_const.h
-**     \brief Template Header
-**
-**     $Id: valuenode_const.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_CONST_H
-#define __SINFG_VALUENODE_CONST_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueNode_Const : public ValueNode
-{
-public:
-       typedef etl::handle<ValueNode_Const> Handle;
-       typedef etl::handle<const ValueNode_Const> ConstHandle;
-
-private:
-       ValueBase value;
-       
-       ValueNode_Const();
-       ValueNode_Const(const ValueBase &x);
-
-public:
-       
-       virtual ValueBase operator()(Time t)const;
-       virtual ~ValueNode_Const();
-
-       const ValueBase &get_value()const;
-       ValueBase &get_value();
-       void set_value(const ValueBase &data);
-       
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
-       
-public:
-       static ValueNode_Const* create(const ValueBase &x=ValueBase());
-
-protected:
-       virtual void get_times_vfunc(Node::time_set &set) const;
-};
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_dynamiclist.cpp b/synfig-core/trunk/src/sinfg/valuenode_dynamiclist.cpp
deleted file mode 100644 (file)
index 198b993..0000000
+++ /dev/null
@@ -1,881 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_dynamiclist.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_dynamiclist.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_dynamiclist.h"
-#include "valuenode_const.h"
-#include "valuenode_composite.h"
-#include "general.h"
-#include "exception.h"
-#include <vector>
-#include <list>
-#include <algorithm>
-#include "canvas.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_DynamicList::ListEntry::ListEntry():
-       index(0)
-{
-}
-
-ValueNode_DynamicList::ListEntry::ListEntry(const ValueNode::Handle &value_node):
-       value_node(value_node),
-       index(0)
-{
-}
-
-ValueNode_DynamicList::ListEntry::ListEntry(const ValueNode::Handle &value_node,Time begin, Time end):
-       value_node(value_node)
-{
-       add(begin,false);
-       add(end,false);
-       add((begin+end)*0.5,true);
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::iterator
-ValueNode_DynamicList::ListEntry::add(Time time, bool status, int priority)
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList::iterator iterator;
-       
-       //! \optimize
-       Activepoint ap(time,status,priority);
-       ap.set_parent_index(get_index());
-       ap.set_parent_value_node(get_parent_value_node());
-       timing_info.push_back(ap);
-       iterator iter(--iterator(timing_info.end()));
-       timing_info.sort();
-       
-       return iter;
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::iterator
-ValueNode_DynamicList::ListEntry::add(const Activepoint &x)
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList::iterator iterator;
-       
-       //! \optimize
-       Activepoint ap(x);
-       ap.set_parent_index(get_index());
-       ap.set_parent_value_node(get_parent_value_node());
-       timing_info.push_back(ap);
-       iterator iter(--iterator(timing_info.end()));
-       timing_info.sort();
-       
-       return iter;
-}
-
-void
-ValueNode_DynamicList::reindex()
-{
-       int i(0);
-       
-       std::vector<ListEntry>::iterator iter;
-
-       for(iter=list.begin();iter!=list.end();++iter)
-       {
-               assert(iter->value_node);
-               if(iter->index!=i || iter->get_parent_value_node().get()!=this)
-               {
-                       ActivepointList::iterator iter2;
-
-                       if(iter->timing_info.size()) // is this line really necessary?
-                       for(iter2=iter->timing_info.begin();iter2!=iter->timing_info.end();++iter2)
-                       {
-                               iter2->set_parent_index(i);
-                               iter2->set_parent_value_node(this);
-                       }
-                       iter->index=i;          
-                       iter->set_parent_value_node(this);
-               }
-       }
-}
-
-ValueNode_DynamicList::ListEntry
-ValueNode_DynamicList::create_list_entry(int index, Time time, Real origin)
-{
-       ValueNode_DynamicList::ListEntry ret;
-       
-       
-       sinfg::ValueBase prev,next;
-
-       index=index%link_count();
-
-       assert(index>=0);
-       
-       ret.index=index;
-       ret.set_parent_value_node(this);
-       
-       next=(*list[index].value_node)(time);
-       
-       if(index!=0)
-               prev=(*list[index-1].value_node)(time);
-       else
-       {
-               if(get_loop())
-                       prev=(*list[link_count()-1].value_node)(time);
-               else
-               {
-                       prev=next;
-               }
-       }
-       
-       
-       switch(get_contained_type())
-       {
-       case ValueBase::TYPE_VECTOR:
-       {
-               Vector a(prev.get(Vector())), b(next.get(Vector()));
-               ret.value_node=ValueNode_Const::create((b-a)*origin+a);
-               break;
-       }
-       case ValueBase::TYPE_REAL:
-       {
-               Real a(prev.get(Real())), b(next.get(Real()));
-               ret.value_node=ValueNode_Const::create((b-a)*origin+a);
-               break;
-       }
-       case ValueBase::TYPE_COLOR:
-       {
-               Color a(prev.get(Color())), b(next.get(Color()));
-               ret.value_node=ValueNode_Composite::create((b-a)*origin+a);
-               break;
-       }
-       case ValueBase::TYPE_ANGLE:
-       {
-               Angle a(prev.get(Angle())), b(next.get(Angle()));
-               ret.value_node=ValueNode_Const::create((b-a)*origin+a);
-               break;
-       }
-       case ValueBase::TYPE_TIME:
-       {
-               Time a(prev.get(Time())), b(next.get(Time()));
-               ret.value_node=ValueNode_Const::create((b-a)*origin+a);
-               break;
-       }
-       default:
-               ret.value_node=ValueNode_Const::create(get_contained_type());
-               break;
-       }
-
-       
-       return ret;
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::iterator
-ValueNode_DynamicList::ListEntry::find(const UniqueID& x)
-{
-       return std::find(timing_info.begin(),timing_info.end(),x);
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator
-ValueNode_DynamicList::ListEntry::find(const UniqueID& x)const
-{
-       return std::find(timing_info.begin(),timing_info.end(),x);
-}
-
-void
-ValueNode_DynamicList::ListEntry::erase(const UniqueID& x)
-{
-       timing_info.erase(find(x));
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::iterator
-ValueNode_DynamicList::ListEntry::find(const Time& x)
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-       
-       ActivepointList::iterator iter;
-
-       for(iter=timing_info.begin();iter!=timing_info.end();++iter)
-               if(iter->time==x)
-                       return iter;
-
-       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find():"+x.get_string());  
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator
-ValueNode_DynamicList::ListEntry::find(const Time& x)const
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-       
-       ActivepointList::const_iterator iter;
-
-       for(iter=timing_info.begin();iter!=timing_info.end();++iter)
-               if(iter->time==x)
-                       return iter;
-
-       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find()const:"+x.get_string());     
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::iterator
-ValueNode_DynamicList::ListEntry::find_next(const Time& x)
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-       
-       ActivepointList::iterator iter;
-
-       for(iter=timing_info.begin();iter!=timing_info.end();++iter)
-               if(iter->time>x)
-                       return iter;
-
-       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find_next():"+x.get_string());     
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator
-ValueNode_DynamicList::ListEntry::find_next(const Time& x)const
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-       
-       ActivepointList::const_iterator iter;
-
-       for(iter=timing_info.begin();iter!=timing_info.end();++iter)
-               if(iter->time>x)
-                       return iter;
-
-       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find_next()const:"+x.get_string());        
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::iterator
-ValueNode_DynamicList::ListEntry::find_prev(const Time& x)
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-       
-       ActivepointList::iterator iter;
-       iter=timing_info.end();
-       do
-       {
-               --iter;
-               if(iter->time<x)
-                       return iter;
-       }
-       while(iter!=timing_info.begin());
-
-       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find_prev():"+x.get_string());     
-}
-
-ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator
-ValueNode_DynamicList::ListEntry::find_prev(const Time& x)const
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-       
-       ActivepointList::const_iterator iter;
-       iter=timing_info.end();
-       do
-       {
-               --iter;
-               if(iter->time<x)
-                       return iter;
-       }
-       while(iter!=timing_info.begin());
-
-       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find_prev()const:"+x.get_string());        
-}
-
-int
-ValueNode_DynamicList::ListEntry::find(const Time& begin,const Time& end,std::vector<Activepoint*>& selected)
-{
-       Time curr_time(begin);
-       int ret(0);
-       
-       // try to grab first waypoint
-       try
-       {
-               ActivepointList::iterator iter;
-               iter=find(curr_time);
-               selected.push_back(&*iter);
-               ret++;
-       }
-       catch(...) { }
-       
-       try
-       {
-               ActivepointList::iterator iter;
-               while(true)
-               {
-                       iter=find_next(curr_time);
-                       curr_time=iter->get_time();
-                       if(curr_time>=end)
-                               break;
-                       selected.push_back(&*iter);
-                       ret++;
-               }
-       }
-       catch(...) { }
-       
-       return ret;
-}
-
-float
-ValueNode_DynamicList::ListEntry::amount_at_time(const Time &t,bool *rising)const
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-       
-       if(timing_info.empty())
-               return 1.0f;
-               
-       try
-       {
-               ActivepointList::const_iterator iter;
-               iter=find(t);
-               return iter->state?1.0f:0.0f;
-       }
-       catch(...) { }
-
-       ActivepointList::const_iterator prev_iter;
-       ActivepointList::const_iterator next_iter;
-
-       try     { prev_iter=find_prev(t); }
-       catch(...) { return find_next(t)->state?1.0f:0.0f; }
-       
-       try     { next_iter=find_next(t); }
-       catch(...) { return prev_iter->state?1.0f:0.0f; }
-       
-       if(next_iter->state==prev_iter->state)
-               return next_iter->state?1.0f:0.0f;
-       
-       if(rising)*rising=next_iter->state;
-
-       if(next_iter->state==true)
-               return float((t-prev_iter->time)/(next_iter->time-prev_iter->time));
-
-       return float((next_iter->time-t)/(next_iter->time-prev_iter->time));
-}
-
-Activepoint
-ValueNode_DynamicList::ListEntry::new_activepoint_at_time(const Time& time)const
-{
-       Activepoint activepoint;
-       
-       activepoint.set_state(status_at_time(time));
-       activepoint.set_priority(0);
-       
-       return activepoint;
-}
-
-bool
-ValueNode_DynamicList::ListEntry::status_at_time(const Time &t)const
-{
-       typedef sinfg::ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
-       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-       
-       ActivepointList::const_iterator entry_iter;
-       ActivepointList::const_iterator prev_iter;
-       bool state(true);
-
-       // New "symetric" state mechanism
-       if(!timing_info.empty())
-       {
-               if(timing_info.size()==1)
-                       state=timing_info.front().state;
-               else
-               {
-                       //! \optimize Perhaps we should use a binary search...?
-                       // This will give us the first activepoint that is after t.
-                       for(entry_iter=timing_info.begin();entry_iter!=timing_info.end();++entry_iter)
-                       {
-                               if(entry_iter->time==t)
-                               {
-                                       // If we hit the entry right on the nose, then we don't
-                                       // have to do anything more
-                                       return entry_iter->state;
-                               }
-                               if(entry_iter->time>t)
-                                       break;
-                               
-                       }
-                       prev_iter=entry_iter;
-                       prev_iter--;
-                       
-                       // ie:
-                       //
-                       //              |-------|---t---|-------|
-                       //         prev_iter^           ^entry_iter
-                       
-                       if(entry_iter==timing_info.end())
-                       {
-                               state=prev_iter->state;
-                       }
-                       else
-                       if(entry_iter==timing_info.begin())
-                       {
-                               state=entry_iter->state;
-                       }
-                       else
-                       if(entry_iter->priority==prev_iter->priority)
-                       {
-                               state=entry_iter->state || prev_iter->state;
-                       }
-                       else
-                       if(entry_iter->priority>prev_iter->priority)
-                       {
-                               state=entry_iter->state;
-                       }
-                       else
-                       {
-                               state=prev_iter->state;                         
-                       }                               
-               }
-       }
-       return state;
-}
-
-
-
-
-void
-ValueNode_DynamicList::add(const ValueNode::Handle &value_node, int index)
-{
-       ListEntry list_entry(value_node);
-       list_entry.timing_info.size();
-       
-       if(index<0 || index>=(int)list.size())
-       {
-               list.push_back(list_entry);
-       }
-       else
-       {
-               list.insert(list.begin()+index,list_entry);
-       }
-
-       add_child(value_node.get());
-       reindex();
-       //changed();
-
-       if(get_parent_canvas())
-               get_parent_canvas()->signal_value_node_child_added()(this,value_node);
-       else if(get_root_canvas() && get_parent_canvas())
-               get_root_canvas()->signal_value_node_child_added()(this,value_node);
-}
-
-void
-ValueNode_DynamicList::add(const ListEntry &list_entry, int index)
-{
-       if(index<0 || index>=(int)list.size())
-               list.push_back(list_entry);
-       else
-               list.insert(list.begin()+index,list_entry);
-       add_child(list_entry.value_node.get());
-
-       reindex();
-       //changed();
-
-       if(get_parent_canvas())
-               get_parent_canvas()->signal_value_node_child_added()(this,list_entry.value_node);
-       else if(get_root_canvas() && get_parent_canvas())
-               get_root_canvas()->signal_value_node_child_added()(this,list_entry.value_node);
-}
-
-void
-ValueNode_DynamicList::erase(const ValueNode::Handle &value_node_)
-{
-       ValueNode::Handle value_node(value_node_);
-       
-       assert(value_node);
-       if(!value_node)
-               throw String("ValueNode_DynamicList::erase(): Passed bad value node");
-       
-       std::vector<ListEntry>::iterator iter;
-       for(iter=list.begin();iter!=list.end();++iter)
-               if(iter->value_node==value_node)
-               {
-                       list.erase(iter);
-                       if(value_node)
-                       {
-                               remove_child(value_node.get());
-                               if(get_parent_canvas())
-                                       get_parent_canvas()->signal_value_node_child_removed()(this,value_node);
-                               else if(get_root_canvas() && get_parent_canvas())
-                                       get_root_canvas()->signal_value_node_child_removed()(this,value_node);
-                       }
-                       break;
-               }
-       reindex();
-}
-
-
-ValueNode_DynamicList::ValueNode_DynamicList(ValueBase::Type container_type):
-       LinkableValueNode(ValueBase::TYPE_LIST),
-       container_type  (container_type),
-       loop_(false)
-{
-       DCAST_HACK_ENABLE();
-}
-
-ValueNode_DynamicList::Handle
-ValueNode_DynamicList::create(ValueBase::Type id)
-{
-       return new ValueNode_DynamicList(id);
-}
-
-ValueNode_DynamicList::~ValueNode_DynamicList()
-{
-       unlink_all();
-}
-
-ValueNode_DynamicList*
-ValueNode_DynamicList::create_from(const ValueBase &value)
-{
-       //vector<ValueBase> value_list(value.operator vector<ValueBase>());
-       vector<ValueBase> value_list(value.get_list());
-
-       vector<ValueBase>::iterator iter;
-
-       if(value_list.empty())
-               return 0;
-       
-       ValueNode_DynamicList* value_node(new ValueNode_DynamicList(value_list.front().get_type()));
-       
-       for(iter=value_list.begin();iter!=value_list.end();++iter)
-       {
-               ValueNode::Handle item(ValueNode_Const::create(*iter));
-               value_node->add(ListEntry(item));
-               assert(value_node->list.back().value_node);
-       }
-       return value_node;
-}
-
-ValueBase
-ValueNode_DynamicList::operator()(Time t)const
-{
-       std::vector<ValueBase> ret_list;
-       std::vector<ListEntry>::const_iterator iter;
-
-       assert(container_type);
-
-       for(iter=list.begin();iter!=list.end();++iter)
-       {
-               bool state(iter->status_at_time(t));
-               
-               if(state)
-               {
-                       if(iter->value_node->get_type()==container_type)
-                               ret_list.push_back((*iter->value_node)(t));
-                       else
-                       {
-                               sinfg::warning(string("ValueNode_DynamicList::operator()():")+_("List type/item type mismatch, throwing away mismatch"));
-                       }
-               }
-       }
-       
-       if(list.empty())
-               sinfg::warning(string("ValueNode_DynamicList::operator()():")+_("No entries in list"));
-       else
-       if(ret_list.empty())
-               sinfg::warning(string("ValueNode_DynamicList::operator()():")+_("No entries in ret_list"));
-
-       return ret_list;
-}
-
-bool
-ValueNode_DynamicList::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i>=0);
-       if((unsigned)i>=list.size())
-               return false;
-       if(x->get_type()!=container_type)
-               return false;
-       list[i].value_node=x;
-       return true;
-}
-
-ValueNode::LooseHandle
-ValueNode_DynamicList::get_link_vfunc(int i)const
-{
-       assert(i>=0);
-       if((unsigned)i>=list.size())
-               return 0;
-       return list[i].value_node;
-}
-
-int
-ValueNode_DynamicList::link_count()const
-{
-       return list.size();
-}
-
-String
-ValueNode_DynamicList::link_local_name(int i)const
-{
-       assert(i>=0 && (unsigned)i<list.size());
-       return etl::strprintf(_("Item %03d"),i+1);
-}      
-
-ValueNode*
-ValueNode_DynamicList::clone(const GUID& deriv_guid)const
-{
-       { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
-
-       ValueNode_DynamicList* ret=new ValueNode_DynamicList(container_type);
-       ret->set_guid(get_guid()^deriv_guid);
-
-       std::vector<ListEntry>::const_iterator iter;
-
-       for(iter=list.begin();iter!=list.end();++iter)
-       {
-               if(iter->value_node->is_exported())
-                       ret->add(*iter);
-               else
-               {               
-                       ListEntry list_entry(*iter);
-                       //list_entry.value_node=find_value_node(iter->value_node->get_guid()^deriv_guid).get();
-                       //if(!list_entry.value_node)
-                               list_entry.value_node=iter->value_node->clone(deriv_guid);
-                       ret->add(list_entry);
-                       //ret->list.back().value_node=iter->value_node.clone();
-               }
-       }
-       ret->set_loop(get_loop());
-       return ret;
-}
-
-String
-ValueNode_DynamicList::link_name(int i)const
-{
-       return strprintf("item%04d",i);
-}
-
-int
-ValueNode_DynamicList::get_link_index_from_name(const String &name)const
-{
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_DynamicList::get_name()const
-{
-       return "dynamic_list";
-}
-
-String
-ValueNode_DynamicList::get_local_name()const
-{
-       return _("Dynamic List");
-}
-
-bool
-ValueNode_DynamicList::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_LIST;
-}
-
-ValueBase::Type
-ValueNode_DynamicList::get_contained_type()const
-{
-       return container_type;
-}
-
-LinkableValueNode*
-ValueNode_DynamicList::create_new()const
-{
-       assert(0);
-       return 0;
-}
-
-int
-ValueNode_DynamicList::find_next_valid_entry(int orig_item, Time t)const
-{
-       int curr_item;
-       
-       for(curr_item=orig_item+1;curr_item!=orig_item;curr_item++)
-       {
-               if(curr_item==(int)list.size())
-               {
-                       curr_item=0;
-                       continue;
-               }
-               if(list[curr_item].status_at_time(t))
-                       return curr_item;
-       }
-       return curr_item;
-}
-
-int
-ValueNode_DynamicList::find_prev_valid_entry(int orig_item, Time t)const
-{
-       int curr_item;
-       
-       for(curr_item=orig_item-1;curr_item!=orig_item;curr_item--)
-       {
-               if(curr_item==-1)
-               {
-                       curr_item=list.size();
-                       continue;
-               }
-               if(list[curr_item].status_at_time(t))
-                       return curr_item;
-       }
-       return curr_item;
-}
-
-const sinfg::Node::time_set    & ValueNode_DynamicList::ListEntry::get_times() const
-{
-       sinfg::ActivepointList::const_iterator  j = timing_info.begin(),
-                                                                                       end = timing_info.end();
-               
-       //must remerge with all the other values because we don't know if we've changed...
-       times = value_node->get_times();
-       
-       for(; j != end; ++j)
-       {
-               TimePoint t;
-               t.set_time(j->get_time());
-               t.set_guid(j->get_guid());
-
-               times.insert(t);
-       }
-       
-       return times;
-}
-
-void ValueNode_DynamicList::get_times_vfunc(Node::time_set &set) const
-{
-       //add in the active points
-       int size = list.size();
-       
-       //rebuild all the info...
-       for(int i = 0; i < size; ++i)
-       {
-               const Node::time_set & tset= list[i].get_times();
-               set.insert(tset.begin(),tset.end());
-       }
-}
-
-
-//new find functions that don't throw
-struct timecmp
-{
-       Time t;
-
-       timecmp(const Time &c) :t(c) {}
-
-       bool operator()(const Activepoint &rhs) const
-       {
-               return t.is_equal(rhs.get_time());
-       }
-};
-
-ValueNode_DynamicList::ListEntry::findresult ValueNode_DynamicList::ListEntry::find_uid(const UniqueID& x)
-{
-       findresult f;
-       f.second = false;
-       
-       f.first = std::find(timing_info.begin(),timing_info.end(),x);
-       
-       if(f.first != timing_info.end())
-       {
-               f.second = true;
-       }
-       
-       return f;
-}
-
-ValueNode_DynamicList::ListEntry::const_findresult ValueNode_DynamicList::ListEntry::find_uid(const UniqueID& x) const
-{
-       const_findresult f;
-       f.second = false;
-       
-       f.first = std::find(timing_info.begin(),timing_info.end(),x);
-       
-       if(f.first != timing_info.end())
-       {
-               f.second = true;
-       }
-       
-       return f;
-}
-
-ValueNode_DynamicList::ListEntry::findresult ValueNode_DynamicList::ListEntry::find_time(const Time& x)
-{
-       findresult f;
-       f.second = false;
-       
-       f.first = std::find_if(timing_info.begin(),timing_info.end(),timecmp(x));
-       
-       if(f.first != timing_info.end())
-       {
-               f.second = true;
-       }
-       
-       return f;
-}
-
-ValueNode_DynamicList::ListEntry::const_findresult ValueNode_DynamicList::ListEntry::find_time(const Time& x)const
-{
-       const_findresult f;
-       f.second = false;
-       
-       f.first = std::find_if(timing_info.begin(),timing_info.end(),timecmp(x));
-       
-       if(f.first != timing_info.end())
-       {
-               f.second = true;
-       }
-       
-       return f;
-}
-
-void
-ValueNode_DynamicList::insert_time(const Time& location, const Time& delta)
-{
-       if(!delta)
-               return;
-
-       std::vector<ListEntry>::iterator iter(list.begin());
-       for(;iter!=list.end();++iter)
-       {
-               try
-               {
-                       ListEntry& item(*iter);
-                       
-                       ActivepointList::iterator iter(item.find_next(location));
-                       for(;iter!=item.timing_info.end();++iter)
-                       {
-                               iter->set_time(iter->get_time()+delta);
-                       }
-               }
-               catch(Exception::NotFound) { }
-       }
-       changed();
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_dynamiclist.h b/synfig-core/trunk/src/sinfg/valuenode_dynamiclist.h
deleted file mode 100644 (file)
index 83c6a7b..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_dynamiclist.h
-**     \brief Template Header
-**
-**     $Id: valuenode_dynamiclist.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_DYNAMICLIST_H
-#define __SINFG_VALUENODE_DYNAMICLIST_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <vector>
-#include <list>
-
-#include "valuenode.h"
-#include "time.h"
-#include "uniqueid.h"
-#include "activepoint.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-class ValueNode_BLine;
-       
-/*! \class ValueNode_DynamicList
-**     \brief Animated List ValueNode
-**
-**     This ValueNode was originaly set up to have a list
-**     of ValueNodes and their associated "on" and "off" points.
-**     ie: Any time that was directly after an "on" point,
-**     the item would be "on", and any time that was directly 
-**     after an "off" point would be "off". This is pretty intuitive.
-**     However, it does have it's problems.
-**
-**     The problems arrise when we introduce the concept of a
-**     Keyframe. Keyframes can be manipulated via the Sinfg
-**     Application Library. They allow the user to quickly
-**     and "automagickly" rearange an animation by moving
-**     the associated keyframes. With they old way that the
-**     "on" and "off" points were handled, this task became
-**     overly complicated.
-**
-**     What is required is a "symetric" system of describing
-**     "on" and "off" points. Instead of the point representing
-**     the state of the item after that point in time, we have
-**     the point represent <i>only that frame</i>. The state
-**     of the item is calculated by looking at the points
-**     around it: If either (or both) points are "on", then the
-**     current state is "on". Otherwise, the point is "off"
-**
-**     This may be a bit confusing at first, but it is required
-**     if we want the keyframe mechanism to "just work".
-*/
-class ValueNode_DynamicList : public LinkableValueNode
-{
-public:
-       
-       /*! \class ListEntry
-       **      \brief Contains a potential list item, and associated timing information
-       **
-       **      This structure contains a RHandle to a ValueNode,
-       **      as well as the associated on/off timing information
-       **      which determines when this item is included in the list.
-       **
-       **      The timing information is stored in the member <tt>timing_info</tt>.
-       */
-       struct ListEntry : public UniqueID
-       {
-               friend class ValueNode_DynamicList;
-               friend class ValueNode_BLine;
-       public:
-               typedef sinfg::Activepoint Activepoint;
-               
-               typedef std::list<Activepoint> ActivepointList;
-       
-               typedef std::pair<ActivepointList::iterator,bool>               findresult;
-               typedef std::pair<ActivepointList::const_iterator,bool> const_findresult;
-
-               
-       private:
-               mutable Node::time_set  times;
-       public:
-               ValueNode::RHandle value_node;
-               
-               ActivepointList timing_info;
-               
-       private:
-               int index;
-               etl::loose_handle<ValueNode> parent_;
-               void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }        
-
-       public:
-
-               int get_index()const { return index; }
-               
-                               
-               bool status_at_time(const Time &x)const;
-
-               float amount_at_time(const Time &x, bool *rising=0)const;
-
-               ActivepointList::iterator add(Time time, bool status, int priority=0);
-               ActivepointList::iterator add(const Activepoint &x);
-       
-               findresult find_uid(const UniqueID& x);
-               const_findresult find_uid(const UniqueID& x)const;
-       
-               findresult find_time(const Time& x);
-               const_findresult find_time(const Time& x)const;
-               
-               ActivepointList::iterator find(const UniqueID& x);
-               ActivepointList::const_iterator find(const UniqueID& x)const;
-               ActivepointList::iterator find(const Time& x);
-               ActivepointList::const_iterator find(const Time& x)const;
-               ActivepointList::iterator find_prev(const Time& x);
-               ActivepointList::const_iterator find_prev(const Time& x)const;
-               ActivepointList::iterator find_next(const Time& x);
-               ActivepointList::const_iterator find_next(const Time& x)const;
-
-               Activepoint new_activepoint_at_time(const Time& x)const;
-
-               ActivepointList::iterator add(Time time)
-                       { return add(time, status_at_time(time)); }
-
-               void erase(const UniqueID& x);          
-               
-               int find(const Time& begin,const Time& end,std::vector<Activepoint*>& list);
-                       
-               const sinfg::Node::time_set     &get_times() const;
-
-               const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
-
-               ListEntry();
-               ListEntry(const ValueNode::Handle &value_node);
-               ListEntry(const ValueNode::Handle &value_node,Time begin, Time end);
-       }; // END of struct ValueNode_DynamicList::ListEntry
-       
-       typedef etl::handle<ValueNode_DynamicList> Handle;
-       typedef etl::handle<const ValueNode_DynamicList> ConstHandle;
-
-protected:
-       ValueNode_DynamicList(ValueBase::Type container_type=ValueBase::TYPE_NIL);
-
-       ValueBase::Type container_type;
-
-       bool loop_;
-
-
-public:
-       std::vector<ListEntry> list;
-
-public:
-       
-       void add(const ValueNode::Handle &value_node, int index=-1);
-       void add(const ListEntry &value_node, int index=-1);
-       void erase(const ValueNode::Handle &value_node);
-       void reindex();
-
-       int find_next_valid_entry(int x, Time t)const;
-       int find_prev_valid_entry(int x, Time t)const;
-       
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-
-       virtual int link_count()const;
-
-       virtual String link_name(int i)const;
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual ~ValueNode_DynamicList();
-
-       virtual String link_local_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-       bool get_loop()const { return loop_; }
-       void set_loop(bool x) { loop_=x; }
-
-       ValueBase::Type get_contained_type()const;
-
-
-       template <typename iterator> static Handle
-       create(iterator begin, iterator end)
-       {
-               Handle ret=create((*begin)->get_type());
-               for(;begin!=end;++begin)
-                       ret->add(ListEntry(*begin));
-               return ret;
-       }
-
-       void insert_time(const Time& location, const Time& delta);
-       //void manipulate_time(const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end);
-
-       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
-
-       virtual ListEntry create_list_entry(int index, Time time=0, Real origin=0.5);
-
-protected:
-       
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-       LinkableValueNode* create_new()const;
-
-       virtual void get_times_vfunc(Node::time_set &set) const;
-
-public:
-       /*! \note The construction parameter (\a id) is the type that the list
-       **      contains, rather than the type that it will yield
-       **      (which is ValueBase::TYPE_LIST)
-       */
-       static Handle create(ValueBase::Type id=ValueBase::TYPE_NIL);
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_DynamicList* create_from(const ValueBase &x=ValueBase::TYPE_GRADIENT);
-}; // END of class ValueNode_DynamicList
-
-typedef ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
-typedef ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_gradientrotate.cpp b/synfig-core/trunk/src/sinfg/valuenode_gradientrotate.cpp
deleted file mode 100644 (file)
index 8af3228..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_gradientrotate.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_gradientrotate.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "general.h"
-#include "valuenode_gradientrotate.h"
-#include "valuenode_const.h"
-#include <stdexcept>
-#include "gradient.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::ValueNode_GradientRotate::ValueNode_GradientRotate():
-       LinkableValueNode(sinfg::ValueBase::TYPE_GRADIENT)
-{
-       set_link("gradient",ValueNode_Const::create(Gradient()));
-       set_link("offset",ValueNode_Const::create(Real(0)));
-       DCAST_HACK_ENABLE();
-}
-
-LinkableValueNode*
-ValueNode_GradientRotate::create_new()const
-{
-       return new ValueNode_GradientRotate();
-}
-
-ValueNode_GradientRotate*
-ValueNode_GradientRotate::create(const ValueBase& x)
-{
-       ValueBase::Type id(x.get_type());
-       if(id!=ValueBase::TYPE_GRADIENT)
-       {
-               assert(0);
-               throw runtime_error("sinfg::ValueNode_GradientRotate:Bad type "+ValueBase::type_name(id));                      
-       }               
-
-       ValueNode_GradientRotate* value_node=new ValueNode_GradientRotate();
-       value_node->set_gradient(ValueNode_Const::create(x.get(Gradient())));
-
-       assert(value_node->get_type()==id);
-       
-       return value_node;
-}
-
-sinfg::ValueNode_GradientRotate::~ValueNode_GradientRotate()
-{
-       unlink_all();
-}
-
-bool
-sinfg::ValueNode_GradientRotate::set_gradient(ValueNode::Handle a)
-{
-       if(a->get_type()!=ValueBase::TYPE_GRADIENT&& !PlaceholderValueNode::Handle::cast_dynamic(a))
-               return false;
-
-       ref_gradient=a;
-
-       return true;
-}
-
-bool
-sinfg::ValueNode_GradientRotate::set_offset(ValueNode::Handle b)
-{
-       if(b->get_type()!=ValueBase::TYPE_REAL&& !PlaceholderValueNode::Handle::cast_dynamic(b))
-               return false;
-       ref_offset=b;
-       return true;
-}
-
-sinfg::ValueBase
-sinfg::ValueNode_GradientRotate::operator()(Time t)const
-{
-       Gradient gradient;
-       gradient=(*ref_gradient)(t).get(gradient);
-       Real offset((*ref_offset)(t).get(Real()));
-       Gradient::iterator iter;
-       for(iter=gradient.begin();iter!=gradient.end();++iter)
-               iter->pos+=offset;
-       
-       return gradient;
-}
-
-bool
-ValueNode_GradientRotate::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i>=0 && i<3);
-       switch(i)
-       {
-               case 0:
-                       if(set_gradient(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-               case 1:
-                       if(set_offset(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-       }
-
-       return false;
-}
-
-ValueNode::LooseHandle
-ValueNode_GradientRotate::get_link_vfunc(int i)const
-{
-       assert(i>=0 && i<3);
-       switch(i)
-       {
-               case 0:
-                       return ref_gradient;
-               case 1:
-                       return ref_offset;
-       }
-       return 0;
-}
-
-int
-ValueNode_GradientRotate::link_count()const
-{
-       return 2;
-}
-
-String
-ValueNode_GradientRotate::link_local_name(int i)const
-{
-       assert(i>=0 && i<2);
-       switch(i)
-       {
-               case 0:
-                       return _("Gradient");
-               case 1:
-                       return _("Offset");
-       }
-       return String();
-}      
-
-String
-ValueNode_GradientRotate::link_name(int i)const
-{
-       assert(i>=0 && i<2);
-       switch(i)
-       {
-               case 0:
-                       return "gradient";
-               case 1:
-                       return "offset";
-       }
-       return String();
-}      
-
-int
-ValueNode_GradientRotate::get_link_index_from_name(const String &name)const
-{
-       if(name=="gradient")
-               return 0;
-       if(name=="offset")
-               return 1;
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_GradientRotate::get_name()const
-{
-       return "gradient_rotate";
-}
-
-String
-ValueNode_GradientRotate::get_local_name()const
-{
-       return _("Gradient Rotate");
-}
-
-bool
-ValueNode_GradientRotate::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_GRADIENT;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_gradientrotate.h b/synfig-core/trunk/src/sinfg/valuenode_gradientrotate.h
deleted file mode 100644 (file)
index a101758..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_twotone.h
-**     \brief Template Header
-**
-**     $Id: valuenode_gradientrotate.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_GRADIENTROTATE_H
-#define __SINFG_VALUENODE_GRADIENTROTATE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-struct ValueNode_GradientRotate : public LinkableValueNode
-{
-       typedef etl::handle<ValueNode_GradientRotate> Handle;
-       typedef etl::handle<const ValueNode_GradientRotate> ConstHandle;
-       
-protected:
-
-       ValueNode_GradientRotate();
-
-private:
-
-       ValueNode::RHandle ref_gradient;
-       ValueNode::RHandle ref_offset;
-
-public:
-
-       virtual ~ValueNode_GradientRotate();
-
-//     static Handle create(ValueBase::Type id=ValueBase::TYPE_GRADIENT);
-
-       //! Sets the left-hand-side value_node
-       bool set_gradient(ValueNode::Handle a);
-
-       //! Gets the left-hand-side value_node
-       ValueNode::Handle get_gradient()const { return ref_gradient; }
-
-       //! Sets the right-hand-side value_node
-       bool set_offset(ValueNode::Handle b);
-
-       //! Gets the right-hand-side value_node
-       ValueNode::Handle get_offset()const { return ref_gradient; }
-
-
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-
-       virtual int link_count()const;
-
-       virtual String link_local_name(int i)const;
-       virtual String link_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-//     static bool check_type(const ValueBase::Type &type);
-protected:
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-
-       LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_GradientRotate* create(const ValueBase &x=ValueBase::TYPE_GRADIENT);
-}; // END of class ValueNode_GradientRotate
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_linear.cpp b/synfig-core/trunk/src/sinfg/valuenode_linear.cpp
deleted file mode 100644 (file)
index 625d729..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_linear.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_linear.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_linear.h"
-#include "valuenode_const.h"
-#include "general.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_Linear::ValueNode_Linear(const ValueBase::Type &x):
-       LinkableValueNode(x)
-{
-       switch(x)
-       {
-       case ValueBase::TYPE_REAL:
-               set_link("slope",ValueNode_Const::create(Real(1)));
-               set_link("offset",ValueNode_Const::create(Real(0)));
-               break;
-       case ValueBase::TYPE_TIME:
-               set_link("slope",ValueNode_Const::create(Time(1)));
-               set_link("offset",ValueNode_Const::create(Time(0)));
-               break;
-       case ValueBase::TYPE_VECTOR:
-               set_link("slope",ValueNode_Const::create(Vector(1.0,1.0)));
-               set_link("offset",ValueNode_Const::create(Vector(0.0,0.0)));
-               break;
-       case ValueBase::TYPE_ANGLE:
-               set_link("slope",ValueNode_Const::create(Angle::deg(90)));
-               set_link("offset",ValueNode_Const::create(Angle::deg(0)));
-               break;
-       default:
-               throw Exception::BadType(ValueBase::type_name(x));
-       }
-
-       DCAST_HACK_ENABLE();
-}
-
-ValueNode_Linear*
-ValueNode_Linear::create(const ValueBase &x)
-{
-       return new ValueNode_Linear(x.get_type());
-}
-
-ValueNode_Linear::~ValueNode_Linear()
-{
-       unlink_all();
-}
-
-ValueBase
-ValueNode_Linear::operator()(Time t)const
-{
-       switch(get_type())
-       {
-       case ValueBase::TYPE_TIME:
-               return (*m_)(t).get(Time())*t+(*b_)(t).get(Time());
-       case ValueBase::TYPE_REAL:
-               return (*m_)(t).get(Real())*t+(*b_)(t).get(Real());
-       case ValueBase::TYPE_VECTOR:
-               return (*m_)(t).get(Vector())*t+(*b_)(t).get(Vector());
-       case ValueBase::TYPE_ANGLE:
-               return (*m_)(t).get(Angle())*t+(*b_)(t).get(Angle());
-       default:
-               assert(0);
-               break;
-       }
-       return ValueBase();
-}
-
-
-String
-ValueNode_Linear::get_name()const
-{
-       return "linear";
-}
-
-String
-ValueNode_Linear::get_local_name()const
-{
-       return _("Linear");
-}
-               
-bool
-ValueNode_Linear::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_REAL
-               || type==ValueBase::TYPE_VECTOR
-               || type==ValueBase::TYPE_TIME
-               || type==ValueBase::TYPE_ANGLE;
-}
-
-bool
-ValueNode_Linear::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i==0 || i==1);
-       if(i==0)
-       {
-               m_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       }
-       if(i==1)
-       {
-               b_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       }
-       return false;
-}
-
-ValueNode::LooseHandle
-ValueNode_Linear::get_link_vfunc(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return m_;
-       if(i==1)
-               return b_;
-
-       return 0;
-}
-
-int
-ValueNode_Linear::link_count()const
-{
-       return 2;
-}
-
-String
-ValueNode_Linear::link_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return "slope";
-       if(i==1)
-               return "offset";
-       return String();
-}
-
-String
-ValueNode_Linear::link_local_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               switch(get_type())
-               {
-               case ValueBase::TYPE_REAL:
-               case ValueBase::TYPE_TIME:
-               case ValueBase::TYPE_ANGLE:
-                       return _("Rate");
-               default:
-                       return _("Slope");
-               }
-       if(i==1)
-               return _("Offset");
-       return String();
-}
-
-int
-ValueNode_Linear::get_link_index_from_name(const String &name)const
-{
-       if(name=="slope")
-               return 0;
-       if(name=="offset")
-               return 1;
-       
-       throw Exception::BadLinkName(name);
-}
-
-LinkableValueNode*
-ValueNode_Linear::create_new()const
-{
-       return new ValueNode_Linear(get_type());
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_linear.h b/synfig-core/trunk/src/sinfg/valuenode_linear.h
deleted file mode 100644 (file)
index c8e7513..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_linear.h
-**     \brief Template Header
-**
-**     $Id: valuenode_linear.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_INTERPOLATION_LINEAR_H
-#define __SINFG_VALUENODE_INTERPOLATION_LINEAR_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueNode_Linear : public LinkableValueNode
-{
-       ValueNode::RHandle m_;
-       ValueNode::RHandle b_;
-       
-       ValueNode_Linear(const ValueBase::Type &x);
-
-public:
-
-       typedef etl::handle<ValueNode_Linear> Handle;
-       typedef etl::handle<const ValueNode_Linear> ConstHandle;
-
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual ~ValueNode_Linear();
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-       virtual int link_count()const;
-       virtual String link_name(int i)const;
-
-       virtual String link_local_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-protected:
-       LinkableValueNode* create_new()const;
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_Linear* create(const ValueBase &x);
-}; // END of class ValueNode_Linear
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_radialcomposite.cpp b/synfig-core/trunk/src/sinfg/valuenode_radialcomposite.cpp
deleted file mode 100644 (file)
index 8b21fab..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_radialcomposite.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_radialcomposite.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_radialcomposite.h"
-#include "valuenode_const.h"
-#include <stdexcept>
-#include "general.h"
-#include "color.h"
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::ValueNode_RadialComposite::ValueNode_RadialComposite(const ValueBase &value):
-       LinkableValueNode(value.get_type())
-{
-       switch(get_type())
-       {
-               case ValueBase::TYPE_VECTOR:
-               {
-                       Vector vect(value.get(Vector()));
-                       set_link("r",ValueNode_Const::create(vect.mag()));
-                       set_link("t",ValueNode_Const::create(Angle(Angle::tan(vect[1],vect[0]))));
-               }
-                       break;
-               case ValueBase::TYPE_COLOR:
-                       set_link("y",ValueNode_Const::create(value.get(Color()).get_y()));
-                       set_link("s",ValueNode_Const::create(value.get(Color()).get_s()));
-                       set_link("h",ValueNode_Const::create(value.get(Color()).get_hue()));
-                       set_link("a",ValueNode_Const::create(value.get(Color()).get_a()));
-                       break;
-               default:
-                       assert(0);
-                       throw Exception::BadType(ValueBase::type_name(get_type()));                     
-       }
-}
-
-ValueNode_RadialComposite::~ValueNode_RadialComposite()
-{
-       unlink_all();
-}
-
-ValueNode_RadialComposite*
-ValueNode_RadialComposite::create(const ValueBase &value)
-{
-       return new ValueNode_RadialComposite(value);
-}
-       
-LinkableValueNode*
-ValueNode_RadialComposite::create_new()const
-{
-       return new ValueNode_RadialComposite(ValueBase(get_type()));
-}
-
-ValueBase
-sinfg::ValueNode_RadialComposite::operator()(Time t)const
-{
-       switch(get_type())
-       {
-               case ValueBase::TYPE_VECTOR:
-               {
-                       Real mag;
-                       Angle angle;
-                       assert(components[0] && components[1]);
-                       mag=(*components[0])(t).get(mag);
-                       angle=(*components[1])(t).get(angle);
-                       return Vector(Angle::cos(angle).get()*mag,Angle::sin(angle).get()*mag);
-               }
-               case ValueBase::TYPE_COLOR:
-               {
-                       assert(components[0] && components[1] && components[2] && components[3]);
-                       return Color::YUV(
-                               (*components[0])(t).get(Real()),
-                               (*components[1])(t).get(Real()),
-                               (*components[2])(t).get(Angle()),
-                               (*components[3])(t).get(Real())
-                       );
-               }
-               default:
-                       sinfg::error(string("ValueNode_RadialComposite::operator():")+_("Bad type for radialcomposite"));
-                       assert(components[0]);
-                       return (*components[0])(t);
-       }
-}
-
-int
-ValueNode_RadialComposite::link_count()const
-{
-       switch(get_type())
-       {
-       case ValueBase::TYPE_VECTOR:
-               return 2;
-       case ValueBase::TYPE_COLOR:
-               return 4;
-       default:
-               sinfg::warning(string("ValueNode_RadialComposite::component_count():")+_("Bad type for radialcomposite"));
-               return 1;
-       }
-}
-
-bool
-ValueNode_RadialComposite::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i>=0);
-       assert(i<6);
-       
-       if(PlaceholderValueNode::Handle::cast_dynamic(x))
-       {
-               components[i]=x;
-               return true;
-       }
-
-       switch(get_type())
-       {
-               case ValueBase::TYPE_VECTOR:
-                       assert(i<2);
-                       if(i==0 && x->get_type()!=ValueBase::TYPE_REAL)
-                               return false;
-                       if(i==1 && x->get_type()!=ValueBase::TYPE_ANGLE)
-                               return false;
-                       components[i]=x;
-                       return true;
-                       break;
-
-               case ValueBase::TYPE_COLOR:
-                       assert(i<4);
-                       if((i==0 || i==1 || i==3) && x->get_type()!=ValueBase::TYPE_REAL)
-                               return false;
-                       if((i==2) && x->get_type()!=ValueBase::TYPE_ANGLE)
-                               return false;
-                       components[i]=x;
-                       return true;
-                       break;
-                       
-                       
-               default:
-                       break;
-       }
-       return false;   
-}
-
-ValueNode::LooseHandle
-ValueNode_RadialComposite::get_link_vfunc(int i)const
-{
-       assert(i>=0 && i<6);
-       return components[i];
-}
-
-String
-ValueNode_RadialComposite::link_local_name(int i)const
-{
-       assert(i>=0 && i<6);
-       switch(get_type())
-       {
-               case ValueBase::TYPE_VECTOR:
-                       if(i==0)
-                               return _("Radius");
-                       else if(i==1)
-                               return _("Theta");
-                       break;
-
-               case ValueBase::TYPE_COLOR:
-                       if(i==0)
-                               return _("Luma");
-                       else if(i==1)
-                               return _("Saturation");
-                       else if(i==2)
-                               return _("Hue");
-                       else if(i==3)
-                               return _("Alpha");
-                       break;
-                       
-               default:
-                       break;
-       }
-       return etl::strprintf(_("C%d"),i+1);    
-}      
-
-
-String
-ValueNode_RadialComposite::link_name(int i)const
-{
-       assert(i>=0 && i<5);
-       return strprintf("c%d",i);
-}      
-
-int
-ValueNode_RadialComposite::get_link_index_from_name(const String &name)const
-{
-       if(name.empty())
-               throw Exception::BadLinkName(name);
-
-       if(name[0]=='c')
-               return name[1]-'0';
-
-       switch(get_type())
-       {
-       case ValueBase::TYPE_COLOR:
-               if(name[0]=='y')
-                       return 0;
-               if(name[0]=='s')
-                       return 1;
-               if(name[0]=='h')
-                       return 2;
-               if(name[0]=='a')
-                       return 3;
-       case ValueBase::TYPE_VECTOR:
-               if(name[0]=='r')
-                       return 0;
-               if(name[0]=='t')
-                       return 1;
-       default:                        
-               break;
-       }
-
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_RadialComposite::get_name()const
-{
-       return "radial_composite";
-}
-
-String
-ValueNode_RadialComposite::get_local_name()const
-{
-       return _("RadialComposite");
-}
-
-bool
-ValueNode_RadialComposite::check_type(ValueBase::Type type)
-{
-       return
-               type==ValueBase::TYPE_VECTOR ||
-               type==ValueBase::TYPE_COLOR;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_radialcomposite.h b/synfig-core/trunk/src/sinfg/valuenode_radialcomposite.h
deleted file mode 100644 (file)
index 5236f4e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_radialcomposite.h
-**     \brief Template Header
-**
-**     $Id: valuenode_radialcomposite.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_RADIALCOMPOSITE_H
-#define __SINFG_VALUENODE_RADIALCOMPOSITE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueNode_RadialComposite : public LinkableValueNode
-{
-       ValueNode::RHandle components[6];
-       ValueNode_RadialComposite(const ValueBase &value);
-       
-public:
-       typedef etl::handle<ValueNode_RadialComposite> Handle;
-       typedef etl::handle<const ValueNode_RadialComposite> ConstHandle;
-
-
-       virtual ~ValueNode_RadialComposite();
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-       virtual int link_count()const;
-       virtual String link_name(int i)const;
-       virtual String link_local_name(int i)const;
-       virtual ValueBase operator()(Time t)const;
-
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-       virtual int get_link_index_from_name(const String &name)const;
-       
-protected:
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-       
-       LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_RadialComposite* create(const ValueBase &x);
-}; // END of class ValueNode_RadialComposite
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_reference.cpp b/synfig-core/trunk/src/sinfg/valuenode_reference.cpp
deleted file mode 100644 (file)
index 8349509..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_reference.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_reference.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_reference.h"
-#include "valuenode_const.h"
-#include "general.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_Reference::ValueNode_Reference(const ValueBase::Type &x):
-       LinkableValueNode(x)
-{
-}
-
-ValueNode_Reference::ValueNode_Reference(const ValueNode::Handle &x):
-       LinkableValueNode(x->get_type())
-{
-       set_link("link",x);
-}
-
-ValueNode_Reference*
-ValueNode_Reference::create(const ValueBase &x)
-{
-       return new ValueNode_Reference(ValueNode_Const::create(x));
-}
-
-LinkableValueNode*
-ValueNode_Reference::create_new()const
-{
-       return new ValueNode_Reference(get_type());
-}
-
-ValueNode_Reference::~ValueNode_Reference()
-{
-       unlink_all();
-}
-
-bool
-ValueNode_Reference::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i==0);
-       if(x->get_type()!=get_type() && !PlaceholderValueNode::Handle::cast_dynamic(x))
-               return false;
-       link_=x;
-       signal_child_changed()(i);signal_value_changed()();
-       return true;
-}
-       
-ValueNode::LooseHandle
-ValueNode_Reference::get_link_vfunc(int i)const
-{
-       assert(i==0);
-       return link_;
-}
-
-int
-ValueNode_Reference::link_count()const
-{
-       return 1;
-}
-
-String
-ValueNode_Reference::link_local_name(int i)const
-{
-       assert(i==0);
-       return _("Link");
-}      
-
-String
-ValueNode_Reference::link_name(int i)const
-{
-       return "link";
-}
-
-int
-ValueNode_Reference::get_link_index_from_name(const String &name)const
-{
-       if(name=="link")
-               return 0;
-
-       throw Exception::BadLinkName(name);
-}
-
-ValueBase
-ValueNode_Reference::operator()(Time t)const
-{
-       return (*link_)(t);
-}
-
-
-String
-ValueNode_Reference::get_name()const
-{
-       return "reference";
-}
-
-String
-ValueNode_Reference::get_local_name()const
-{
-       return _("Reference");
-}
-
-bool
-ValueNode_Reference::check_type(ValueBase::Type type)
-{
-       if(type)
-               return true;
-       return false;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_reference.h b/synfig-core/trunk/src/sinfg/valuenode_reference.h
deleted file mode 100644 (file)
index 9ea1cee..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_reference.h
-**     \brief Template Header
-**
-**     $Id: valuenode_reference.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_REFERENCE_H
-#define __SINFG_VALUENODE_REFERENCE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueNode_Reference : public LinkableValueNode
-{
-       ValueNode::RHandle link_;
-public:
-       typedef etl::handle<ValueNode_Reference> Handle;
-       typedef etl::handle<const ValueNode_Reference> ConstHandle;
-
-       ValueNode_Reference(const ValueBase::Type &x);
-
-       ValueNode_Reference(const ValueNode::Handle &x);
-
-//     static Handle create(const ValueBase::Type &x);
-//     static Handle create(const ValueNode::Handle &x);
-
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-
-       virtual int link_count()const;
-
-       virtual String link_name(int i)const;
-
-       virtual String link_local_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual ~ValueNode_Reference();
-
-       virtual String get_name()const;
-
-       virtual String get_local_name()const;
-
-protected:
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-       
-       LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_Reference* create(const ValueBase &x);
-}; // END of class ValueNode_Reference
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_scale.cpp b/synfig-core/trunk/src/sinfg/valuenode_scale.cpp
deleted file mode 100644 (file)
index 2911b84..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_scale.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_scale.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "general.h"
-#include "valuenode_scale.h"
-#include "valuenode_const.h"
-#include <stdexcept>
-#include <cassert>
-#include "color.h"
-#include "vector.h"
-#include "time.h"
-#include "angle.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_Scale::ValueNode_Scale():LinkableValueNode(sinfg::ValueBase::TYPE_NIL)
-{
-       set_scalar(1.0);
-}
-
-ValueNode_Scale*
-ValueNode_Scale::create(const ValueBase& x)
-{
-       ValueNode_Scale* value_node;
-       switch(x.get_type())
-       {
-       case ValueBase::TYPE_VECTOR:
-       case ValueBase::TYPE_REAL:
-       case ValueBase::TYPE_TIME:
-       case ValueBase::TYPE_INTEGER:
-       case ValueBase::TYPE_ANGLE:
-       case ValueBase::TYPE_COLOR:
-               value_node=new ValueNode_Scale();
-               if(!value_node->set_value_node(ValueNode_Const::create(x)))
-                       return 0;
-               assert(value_node->get_value_node()->get_type()==x.get_type());
-               break;
-       default:
-               assert(0);
-               throw runtime_error("sinfg::ValueNode_Scale:Bad type "+ValueBase::type_name(x.get_type()));                     
-       }
-       assert(value_node);
-       assert(value_node->get_type()==x.get_type());
-       
-       return value_node;
-}
-
-LinkableValueNode*
-ValueNode_Scale::create_new()const
-{
-       return new ValueNode_Scale();
-}
-
-sinfg::ValueNode_Scale::~ValueNode_Scale()
-{
-       unlink_all();
-}
-
-void
-ValueNode_Scale::set_scalar(Real x)
-{
-       set_link("scalar",ValueNode::Handle(ValueNode_Const::create(x)));
-}
-
-bool
-ValueNode_Scale::set_scalar(const ValueNode::Handle &x)
-{
-       if(!x
-               || x->get_type()!=ValueBase::TYPE_REAL
-               && !PlaceholderValueNode::Handle::cast_dynamic(x)
-       )
-               return false;
-       scalar=x;
-       return true;
-}
-
-ValueNode::Handle
-ValueNode_Scale::get_scalar()const
-{
-       return scalar;
-}
-
-bool
-ValueNode_Scale::set_value_node(const ValueNode::Handle &x)
-{
-       if(!x
-               || ( get_type()==ValueBase::TYPE_NIL
-                       && !check_type(x->get_type()) )
-               || ( get_type()!=ValueBase::TYPE_NIL
-                       && x->get_type()!=get_type() ) &&
-               !PlaceholderValueNode::Handle::cast_dynamic(x)
-       )
-               return false;
-
-       assert(!(PlaceholderValueNode::Handle::cast_dynamic(x) && !get_type()));
-
-       value_node=x;
-
-       if(!get_type())
-               set_type(x->get_type());
-
-       return true;
-}
-
-ValueNode::Handle
-ValueNode_Scale::get_value_node()const
-{
-       return value_node;
-}
-
-
-sinfg::ValueBase
-sinfg::ValueNode_Scale::operator()(Time t)const
-{
-       if(!value_node || !scalar)
-               throw runtime_error(strprintf("ValueNode_Scale: %s",_("One or both of my parameters aren't set!")));
-       else
-       if(get_type()==ValueBase::TYPE_VECTOR)
-               return (*value_node)(t).get(Vector())*(*scalar)(t).get(Real());
-       else
-       if(get_type()==ValueBase::TYPE_REAL)
-               return (*value_node)(t).get(Real())*(*scalar)(t).get(Real());
-       else
-       if(get_type()==ValueBase::TYPE_TIME)
-               return (*value_node)(t).get(Time())*(*scalar)(t).get(Time());
-       else
-       if(get_type()==ValueBase::TYPE_INTEGER)
-               return (*value_node)(t).get(int())*(*scalar)(t).get(Real());
-       else
-       if(get_type()==ValueBase::TYPE_ANGLE)
-               return (*value_node)(t).get(Angle())*(*scalar)(t).get(Real());
-       else
-       if(get_type()==ValueBase::TYPE_COLOR)
-       {
-               Color ret((*value_node)(t).get(Color()));
-               Real s((*scalar)(t).get(Real()));
-               ret.set_r(ret.get_r()*s);
-               ret.set_g(ret.get_r()*s);
-               ret.set_b(ret.get_r()*s);
-               return ret;
-       }
-
-       assert(0);
-       return ValueBase();
-}
-
-
-bool
-ValueNode_Scale::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       if(!(i==0 || i==1))
-               return false;
-       
-       if(i==0 && !set_value_node(x))
-               return false;
-       else
-       if(i==1 && !set_scalar(x))
-               return false;
-       
-       signal_child_changed()(i);signal_value_changed()();
-
-       return true;
-}
-
-ValueNode::LooseHandle
-ValueNode_Scale::get_link_vfunc(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return value_node;
-       else if(i==1)
-               return scalar;
-       return 0;
-}
-
-int
-ValueNode_Scale::link_count()const
-{
-       return 2;
-}
-
-String
-ValueNode_Scale::link_local_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return _("Link");
-       else if(i==1)
-               return _("Scalar");
-       return String();
-}      
-
-String
-ValueNode_Scale::link_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return "link";
-       else if(i==1)
-               return "scalar";
-       return String();
-}
-
-int
-ValueNode_Scale::get_link_index_from_name(const String &name)const
-{
-       if(name=="link")
-               return 0;
-       if(name=="scalar")
-               return 1;
-       
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_Scale::get_name()const
-{
-       return "scale";
-}
-
-String
-ValueNode_Scale::get_local_name()const
-{
-       return _("Scale");
-}
-
-bool
-ValueNode_Scale::check_type(ValueBase::Type type)
-{
-       return
-               type==ValueBase::TYPE_VECTOR ||
-               type==ValueBase::TYPE_REAL ||
-               type==ValueBase::TYPE_INTEGER ||
-               type==ValueBase::TYPE_COLOR ||
-               type==ValueBase::TYPE_ANGLE;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_scale.h b/synfig-core/trunk/src/sinfg/valuenode_scale.h
deleted file mode 100644 (file)
index 8fe196d..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_scale.h
-**     \brief Template Header
-**
-**     $Id: valuenode_scale.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_SCALE_H
-#define __SINFG_VALUENODE_SCALE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-struct ValueNode_Scale : public LinkableValueNode
-{
-       typedef etl::handle<ValueNode_Scale> Handle;
-       typedef etl::handle<const ValueNode_Scale> ConstHandle;
-       
-private:
-       ValueNode::RHandle value_node;
-       ValueNode::RHandle scalar;
-
-       ValueNode_Scale();
-
-public:
-
-       //static Handle create(ValueBase::Type id=ValueBase::TYPE_NIL);
-
-       //static Handle create(ValueNode::Handle value_node, Real scalar);
-
-       virtual ~ValueNode_Scale();
-
-       //! \writeme
-       bool set_value_node(const ValueNode::Handle &a);
-
-       //! \writeme
-       ValueNode::Handle get_value_node()const;
-
-       void set_scalar(Real x);
-
-       bool set_scalar(const ValueNode::Handle &x);
-
-       ValueNode::Handle get_scalar()const;
-
-
-
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-
-       virtual int link_count()const;
-
-       virtual String link_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual String get_name()const;
-       
-       virtual String get_local_name()const;
-
-       virtual String link_local_name(int i)const;
-
-protected:
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-       
-       virtual LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_Scale* create(const ValueBase &x);
-}; // END of class ValueNode_Scale
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_segcalctangent.cpp b/synfig-core/trunk/src/sinfg/valuenode_segcalctangent.cpp
deleted file mode 100644 (file)
index ba7844f..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_segcalctangent.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_segcalctangent.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_segcalctangent.h"
-#include "valuenode_const.h"
-#include "valuenode_composite.h"
-#include "general.h"
-#include "exception.h"
-#include <ETL/hermite>
-#include <ETL/calculus>
-#include "segment.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_SegCalcTangent::ValueNode_SegCalcTangent(const ValueBase::Type &x):
-       LinkableValueNode(x)
-{
-       if(x!=ValueBase::TYPE_VECTOR)
-               throw Exception::BadType(ValueBase::type_name(x));
-       
-       segment_=ValueNode_Composite::create(ValueBase::TYPE_SEGMENT);
-       amount_=ValueNode_Const::create(Real(0.5));
-}
-
-ValueNode_SegCalcTangent*
-ValueNode_SegCalcTangent::create(const ValueBase &x)
-{
-       return new ValueNode_SegCalcTangent(x.get_type());
-}
-
-ValueNode_SegCalcTangent::~ValueNode_SegCalcTangent()
-{
-       unlink_all();
-}
-
-ValueBase
-ValueNode_SegCalcTangent::operator()(Time t)const
-{
-       Segment segment((*segment_)(t).get(Segment()));
-
-       etl::hermite<Vector> curve(segment.p1,segment.p2,segment.t1,segment.t2);
-       etl::derivative< etl::hermite<Vector> > deriv(curve);
-       
-#ifdef ETL_FIXED_DERIVATIVE
-       return deriv((*amount_)(t).get(Real()))*(0.5);
-#else
-       return deriv((*amount_)(t).get(Real()))*(-0.5);
-#endif
-       
-}
-
-
-String
-ValueNode_SegCalcTangent::get_name()const
-{
-       return "segcalctangent";
-}
-
-String
-ValueNode_SegCalcTangent::get_local_name()const
-{
-       return _("SegCalcTangent");
-}
-               
-bool
-ValueNode_SegCalcTangent::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_VECTOR;
-}
-
-bool
-ValueNode_SegCalcTangent::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i==0 || i==1);
-       if(i==0)
-       {
-               segment_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       }
-       if(i==1)
-       {
-               amount_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       }
-       return false;
-}
-
-ValueNode::LooseHandle
-ValueNode_SegCalcTangent::get_link_vfunc(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return segment_;
-       if(i==1)
-               return amount_;
-
-       return 0;
-}
-
-int
-ValueNode_SegCalcTangent::link_count()const
-{
-       return 2;
-}
-
-String
-ValueNode_SegCalcTangent::link_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return "segment";
-       if(i==1)
-               return "amount";
-       return String();
-}
-
-String
-ValueNode_SegCalcTangent::link_local_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return _("Segment");
-       if(i==1)
-               return _("Amount");
-       return String();
-}
-
-int
-ValueNode_SegCalcTangent::get_link_index_from_name(const String &name)const
-{
-       if(name=="segment")
-               return 0;
-       if(name=="amount")
-               return 1;
-       
-       throw Exception::BadLinkName(name);
-}
-
-LinkableValueNode*
-ValueNode_SegCalcTangent::create_new()const
-{
-       return new ValueNode_SegCalcTangent(ValueBase::TYPE_VECTOR);
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_segcalctangent.h b/synfig-core/trunk/src/sinfg/valuenode_segcalctangent.h
deleted file mode 100644 (file)
index 38ab1ff..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_segcalctangent.h
-**     \brief Template Header
-**
-**     $Id: valuenode_segcalctangent.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_SEGCALCTANGENT_H
-#define __SINFG_VALUENODE_SEGCALCTANGENT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueNode_SegCalcTangent : public LinkableValueNode
-{
-       ValueNode::RHandle segment_;
-       ValueNode::RHandle amount_;
-       
-       ValueNode_SegCalcTangent(const ValueBase::Type &x=ValueBase::TYPE_VECTOR);
-
-public:
-
-       typedef etl::handle<ValueNode_SegCalcTangent> Handle;
-       typedef etl::handle<const ValueNode_SegCalcTangent> ConstHandle;
-
-       //static Handle create(const ValueBase::Type &x=ValueBase::TYPE_VECTOR);
-
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual ~ValueNode_SegCalcTangent();
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-       virtual int link_count()const;
-       virtual String link_name(int i)const;
-
-       virtual String link_local_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-protected:
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-       LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_SegCalcTangent* create(const ValueBase &x=ValueBase::TYPE_VECTOR);
-}; // END of class ValueNode_SegCalcTangent
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_segcalcvertex.cpp b/synfig-core/trunk/src/sinfg/valuenode_segcalcvertex.cpp
deleted file mode 100644 (file)
index 8684f11..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_segcalcvertex.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_segcalcvertex.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_segcalcvertex.h"
-#include "valuenode_const.h"
-#include "valuenode_composite.h"
-#include "general.h"
-#include "exception.h"
-#include <ETL/hermite>
-#include "segment.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_SegCalcVertex::ValueNode_SegCalcVertex(const ValueBase::Type &x):
-       LinkableValueNode(x)
-{
-       if(x!=ValueBase::TYPE_VECTOR)
-               throw Exception::BadType(ValueBase::type_name(x));
-       
-       segment_=ValueNode_Composite::create(ValueBase::TYPE_SEGMENT);
-       amount_=ValueNode_Const::create(Real(0.5));
-       
-}
-
-ValueNode_SegCalcVertex*
-ValueNode_SegCalcVertex::create(const ValueBase &x)
-{
-       return new ValueNode_SegCalcVertex(x.get_type());
-}
-
-ValueNode_SegCalcVertex::~ValueNode_SegCalcVertex()
-{
-       unlink_all();
-}
-
-ValueBase
-ValueNode_SegCalcVertex::operator()(Time t)const
-{
-       Segment segment((*segment_)(t).get(Segment()));
-
-       etl::hermite<Vector> curve(segment.p1,segment.p2,segment.t1,segment.t2);
-       
-       return curve((*amount_)(t).get(Real()));
-}
-
-
-String
-ValueNode_SegCalcVertex::get_name()const
-{
-       return "segcalcvertex";
-}
-
-String
-ValueNode_SegCalcVertex::get_local_name()const
-{
-       return _("SegCalcVertex");
-}
-               
-bool
-ValueNode_SegCalcVertex::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_VECTOR;
-}
-
-bool
-ValueNode_SegCalcVertex::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i==0 || i==1);
-       if(i==0)
-       {
-               segment_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       }
-       if(i==1)
-       {
-               amount_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       }
-       return false;
-}
-
-ValueNode::LooseHandle
-ValueNode_SegCalcVertex::get_link_vfunc(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return segment_;
-       if(i==1)
-               return amount_;
-
-       return 0;
-}
-
-int
-ValueNode_SegCalcVertex::link_count()const
-{
-       return 2;
-}
-
-String
-ValueNode_SegCalcVertex::link_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return "segment";
-       if(i==1)
-               return "amount";
-       return String();
-}
-
-String
-ValueNode_SegCalcVertex::link_local_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return _("Segment");
-       if(i==1)
-               return _("Amount");
-       return String();
-}
-
-int
-ValueNode_SegCalcVertex::get_link_index_from_name(const String &name)const
-{
-       if(name=="segment")
-               return 0;
-       if(name=="amount")
-               return 1;
-       
-       throw Exception::BadLinkName(name);
-}
-
-LinkableValueNode*
-ValueNode_SegCalcVertex::create_new()const
-{
-       return new ValueNode_SegCalcVertex(ValueBase::TYPE_VECTOR);
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_segcalcvertex.h b/synfig-core/trunk/src/sinfg/valuenode_segcalcvertex.h
deleted file mode 100644 (file)
index 43a63e7..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_segcalcvertex.h
-**     \brief Template Header
-**
-**     $Id: valuenode_segcalcvertex.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_SEGCALCVERTEX_H
-#define __SINFG_VALUENODE_SEGCALCVERTEX_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueNode_SegCalcVertex : public LinkableValueNode
-{
-       ValueNode::RHandle segment_;
-       ValueNode::RHandle amount_;
-       
-       ValueNode_SegCalcVertex(const ValueBase::Type &x=ValueBase::TYPE_VECTOR);
-
-public:
-
-       typedef etl::handle<ValueNode_SegCalcVertex> Handle;
-       typedef etl::handle<const ValueNode_SegCalcVertex> ConstHandle;
-
-//     static Handle create(const ValueBase::Type &x=ValueBase::TYPE_VECTOR);
-
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual ~ValueNode_SegCalcVertex();
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-//     static bool check_type(const ValueBase::Type &type);
-
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-       virtual int link_count()const;
-       virtual String link_name(int i)const;
-
-       virtual String link_local_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-protected:
-       LinkableValueNode* create_new()const;
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_SegCalcVertex* create(const ValueBase &x=ValueBase::TYPE_VECTOR);
-}; // END of class ValueNode_SegCalcVertex
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_sine.cpp b/synfig-core/trunk/src/sinfg/valuenode_sine.cpp
deleted file mode 100644 (file)
index 538a1aa..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_sine.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_sine.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "valuenode_sine.h"
-#include "valuenode_const.h"
-#include "general.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_Sine::ValueNode_Sine(const ValueBase::Type &x):
-       LinkableValueNode(x)
-{
-       switch(x)
-       {
-       case ValueBase::TYPE_REAL:
-               set_link("angle",ValueNode_Const::create(Angle::zero()));
-               set_link("amp",ValueNode_Const::create(Real(1)));
-               break;
-       default:
-               throw Exception::BadType(ValueBase::type_name(x));
-       }
-
-       DCAST_HACK_ENABLE();
-}
-
-ValueNode_Sine*
-ValueNode_Sine::create(const ValueBase &x)
-{
-       return new ValueNode_Sine(x.get_type());
-}
-
-ValueNode_Sine::~ValueNode_Sine()
-{
-       unlink_all();
-}
-
-ValueBase
-ValueNode_Sine::operator()(Time t)const
-{
-       return
-               Angle::sin(
-                       (*angle_)(t).get(Angle())
-               ).get() * (*amp_)(t).get(Real())
-       ;
-}
-
-
-String
-ValueNode_Sine::get_name()const
-{
-       return "sine";
-}
-
-String
-ValueNode_Sine::get_local_name()const
-{
-       return _("Sine");
-}
-               
-bool
-ValueNode_Sine::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_REAL;
-}
-
-bool
-ValueNode_Sine::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i==0 || i==1);
-       if(i==0)
-       {
-               angle_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       }
-       if(i==1)
-       {
-               amp_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       }
-       return false;
-}
-
-ValueNode::LooseHandle
-ValueNode_Sine::get_link_vfunc(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return angle_;
-       if(i==1)
-               return amp_;
-
-       return 0;
-}
-
-int
-ValueNode_Sine::link_count()const
-{
-       return 2;
-}
-
-String
-ValueNode_Sine::link_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return "angle";
-       if(i==1)
-               return "amp";
-       return String();
-}
-
-String
-ValueNode_Sine::link_local_name(int i)const
-{
-       assert(i==0 || i==1);
-       if(i==0)
-               return _("Angle");
-       if(i==1)
-               return _("Amplitude");
-       return String();
-}
-
-int
-ValueNode_Sine::get_link_index_from_name(const String &name)const
-{
-       if(name=="angle")
-               return 0;
-       if(name=="amp")
-               return 1;
-       
-       throw Exception::BadLinkName(name);
-}
-
-LinkableValueNode*
-ValueNode_Sine::create_new()const
-{
-       return new ValueNode_Sine(get_type());
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_sine.h b/synfig-core/trunk/src/sinfg/valuenode_sine.h
deleted file mode 100644 (file)
index 9484c5e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_sine.h
-**     \brief Template Header
-**
-**     $Id: valuenode_sine.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_SINE_H
-#define __SINFG_VALUENODE_SINE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-class ValueNode_Sine : public LinkableValueNode
-{
-       ValueNode::RHandle angle_;
-       ValueNode::RHandle amp_;
-       
-       ValueNode_Sine(const ValueBase::Type &x);
-
-public:
-
-       typedef etl::handle<ValueNode_Sine> Handle;
-       typedef etl::handle<const ValueNode_Sine> ConstHandle;
-
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual ~ValueNode_Sine();
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-       virtual int link_count()const;
-       virtual String link_name(int i)const;
-
-       virtual String link_local_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-protected:
-       LinkableValueNode* create_new()const;
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_Sine* create(const ValueBase &x);
-}; // END of class ValueNode_Sine
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_stripes.cpp b/synfig-core/trunk/src/sinfg/valuenode_stripes.cpp
deleted file mode 100644 (file)
index 4849f30..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_subtract.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_stripes.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "general.h"
-#include "valuenode_stripes.h"
-#include "valuenode_const.h"
-#include <stdexcept>
-#include "color.h"
-#include "gradient.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::ValueNode_Stripes::ValueNode_Stripes():LinkableValueNode(sinfg::ValueBase::TYPE_GRADIENT)
-{
-       set_link("color1",ValueNode_Const::create(Color::alpha()));
-       set_link("color2",ValueNode_Const::create(Color::black()));
-       set_link("stripes",stripes_=ValueNode_Const::create(int(5)));
-       set_link("width",ValueNode_Const::create(0.5));
-}
-
-LinkableValueNode*
-ValueNode_Stripes::create_new()const
-{
-       return new ValueNode_Stripes();
-}
-
-ValueNode_Stripes*
-ValueNode_Stripes::create(const ValueBase& x)
-{
-       ValueBase::Type id(x.get_type());
-       
-       if(id!=ValueBase::TYPE_GRADIENT)
-       {
-               assert(0);
-               throw runtime_error("sinfg::ValueNode_Stripes:Bad type "+ValueBase::type_name(id));                     
-       }               
-
-       ValueNode_Stripes* value_node=new ValueNode_Stripes();
-
-       assert(value_node->get_type()==id);
-       
-       return value_node;
-}
-
-sinfg::ValueNode_Stripes::~ValueNode_Stripes()
-{
-       unlink_all();
-}
-
-bool
-sinfg::ValueNode_Stripes::set_color1(ValueNode::Handle a)
-{
-       if(a->get_type()!=ValueBase::TYPE_COLOR)
-               return false;
-
-       color1_=a;
-
-       return true;
-}
-
-bool
-sinfg::ValueNode_Stripes::set_color2(ValueNode::Handle a)
-{
-       if(a->get_type()!=ValueBase::TYPE_COLOR)
-               return false;
-
-       color2_=a;
-
-       return true;
-}
-
-bool
-sinfg::ValueNode_Stripes::set_width(ValueNode::Handle x)
-{
-       if(x->get_type()!=ValueBase::TYPE_REAL)
-               return false;
-
-       width_=x;
-
-       return true;
-}
-
-bool
-sinfg::ValueNode_Stripes::set_stripes(ValueNode::Handle b)
-{
-       if(b->get_type()!=ValueBase::TYPE_INTEGER)
-               return false;
-       stripes_=b;
-       return true;
-}
-
-sinfg::ValueBase
-sinfg::ValueNode_Stripes::operator()(Time t)const
-{
-       const int total((*stripes_)(t).get(int()));             
-       int i;
-       Gradient ret;
-
-       if(total<=0)
-               return ret;
-
-       const Color color1((*color1_)(t).get(Color()));
-       const Color color2((*color2_)(t).get(Color()));
-       const float width(max(0.0,min(1.0,(*width_)(t).get(Real()))));
-       
-       const float stripe_width_a(width/total);
-       const float stripe_width_b((1.0-width)/total);
-       
-       for(i=0;i<total;i++)
-       {
-               float pos(float(i)/total+stripe_width_b/2);
-               ret.push_back(Gradient::CPoint(pos,color1));
-               ret.push_back(Gradient::CPoint(pos,color2));
-               pos+=stripe_width_a;
-               ret.push_back(Gradient::CPoint(pos,color2));
-               ret.push_back(Gradient::CPoint(pos,color1));
-       }
-       return ret;
-}
-
-bool
-ValueNode_Stripes::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i>=0 && i<link_count());
-       switch(i)
-       {
-               case 0:
-                       if(set_color1(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-               case 1:
-                       if(set_color2(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-               case 2:
-                       if(set_stripes(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-               case 3:
-                       if(set_width(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-       }
-
-       return false;
-}
-
-ValueNode::LooseHandle
-ValueNode_Stripes::get_link_vfunc(int i)const
-{
-       assert(i>=0 && i<link_count());
-       switch(i)
-       {
-               case 0:
-                       return color1_;
-               case 1:
-                       return color2_;
-               case 2:
-                       return stripes_;
-               case 3:
-                       return width_;
-       }
-       return 0;
-}
-
-int
-ValueNode_Stripes::link_count()const
-{
-       return 4;
-}
-
-String
-ValueNode_Stripes::link_local_name(int i)const
-{
-       assert(i>=0 && i<link_count());
-       switch(i)
-       {
-               case 0:
-                       return _("Color 1");
-               case 1:
-                       return _("Color 2");
-               case 2:
-                       return _("Stripe Count");
-               case 3:
-                       return _("Width");
-       }
-       return String();
-}      
-
-String
-ValueNode_Stripes::link_name(int i)const
-{
-       assert(i>=0 && i<link_count());
-       switch(i)
-       {
-               case 0:
-                       return "color1";
-               case 1:
-                       return "color2";
-               case 2:
-                       return "stripes";
-               case 3:
-                       return "width";
-       }
-       return String();
-}      
-
-int
-ValueNode_Stripes::get_link_index_from_name(const String &name)const
-{
-       if(name=="color1")
-               return 0;
-       if(name=="color2")
-               return 1;
-       if(name=="stripes")
-               return 2;
-       if(name=="width")
-               return 3;
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_Stripes::get_name()const
-{
-       return "stripes";
-}
-
-String
-ValueNode_Stripes::get_local_name()const
-{
-       return _("Stripes");
-}
-
-bool
-ValueNode_Stripes::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_GRADIENT;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_stripes.h b/synfig-core/trunk/src/sinfg/valuenode_stripes.h
deleted file mode 100644 (file)
index 2039c8a..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_stripes.h
-**     \brief Template Header
-**
-**     $Id: valuenode_stripes.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_STRIPES_H
-#define __SINFG_VALUENODE_STRIPES_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-struct ValueNode_Stripes : public LinkableValueNode
-{
-       typedef etl::handle<ValueNode_Stripes> Handle;
-       typedef etl::handle<const ValueNode_Stripes> ConstHandle;
-       
-protected:
-
-       ValueNode_Stripes();
-
-private:
-
-       ValueNode::RHandle color1_;
-       ValueNode::RHandle color2_;
-       ValueNode::RHandle stripes_;
-       ValueNode::RHandle width_;
-
-public:
-
-       virtual ~ValueNode_Stripes();
-
-//     static Handle create(ValueBase::Type id=ValueBase::TYPE_GRADIENT);
-
-       bool set_color1(ValueNode::Handle a);
-       ValueNode::Handle get_color1()const { return color1_; }
-
-       bool set_color2(ValueNode::Handle a);
-       ValueNode::Handle get_color2()const { return color2_; }
-
-       bool set_stripes(ValueNode::Handle b);
-       ValueNode::Handle get_stripes()const { return stripes_; }
-
-       bool set_width(ValueNode::Handle x);
-
-
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-
-       virtual int link_count()const;
-
-       virtual String link_local_name(int i)const;
-       virtual String link_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-//     static bool check_type(const ValueBase::Type &type);
-
-       LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_Stripes* create(const ValueBase &x=ValueBase::TYPE_GRADIENT);
-}; // END of class ValueNode_Stripes
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_subtract.cpp b/synfig-core/trunk/src/sinfg/valuenode_subtract.cpp
deleted file mode 100644 (file)
index e4c55c3..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_subtract.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_subtract.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "general.h"
-#include "valuenode_subtract.h"
-#include "valuenode_const.h"
-#include <stdexcept>
-#include "color.h"
-#include "vector.h"
-#include "angle.h"
-#include "real.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::ValueNode_Subtract::ValueNode_Subtract():LinkableValueNode(sinfg::ValueBase::TYPE_NIL)
-{
-       set_scalar(1.0);
-}
-
-LinkableValueNode*
-ValueNode_Subtract::create_new()const
-{
-       return new ValueNode_Subtract();
-}
-
-ValueNode_Subtract*
-ValueNode_Subtract::create(const ValueBase& x)
-{
-       ValueBase::Type id(x.get_type());
-       
-       ValueNode_Subtract* value_node=new ValueNode_Subtract();
-       switch(id)
-       {
-       case ValueBase::TYPE_NIL:
-               return value_node;
-       case ValueBase::TYPE_VECTOR:
-       case ValueBase::TYPE_REAL:
-       case ValueBase::TYPE_INTEGER:
-       case ValueBase::TYPE_ANGLE:
-               value_node->set_link("rhs",ValueNode_Const::create(ValueBase(id)));
-               value_node->set_link("lhs",ValueNode_Const::create(ValueBase(id)));
-               assert(value_node->get_rhs()->get_type()==id);
-               assert(value_node->get_lhs()->get_type()==id);
-               break;
-       default:
-               assert(0);
-               throw runtime_error("sinfg::ValueNode_Subtract:Bad type "+ValueBase::type_name(id));                    
-       }
-       assert(value_node->get_type()==id);
-       
-       return value_node;
-}
-
-sinfg::ValueNode_Subtract::~ValueNode_Subtract()
-{
-       unlink_all();
-}
-
-void
-ValueNode_Subtract::set_scalar(Real x)
-{
-       set_link("scalar",ValueNode_Const::create(x));
-}
-
-bool
-sinfg::ValueNode_Subtract::set_scalar(ValueNode::Handle x)
-{
-       if(x->get_type()!=ValueBase::TYPE_REAL&& !PlaceholderValueNode::Handle::cast_dynamic(x))
-               return false;
-       scalar=x;
-       return true;
-}
-
-bool
-sinfg::ValueNode_Subtract::set_lhs(ValueNode::Handle a)
-{
-       ref_a=a;
-       
-       if(PlaceholderValueNode::Handle::cast_dynamic(a))
-               return true;
-       
-       if(!ref_a || !ref_b)
-               set_type(ValueBase::TYPE_NIL);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_VECTOR && ref_a->get_type()==ValueBase::TYPE_VECTOR)
-               set_type(ValueBase::TYPE_VECTOR);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_REAL && ref_a->get_type()==ValueBase::TYPE_REAL)
-               set_type(ValueBase::TYPE_REAL);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_INTEGER && ref_a->get_type()==ValueBase::TYPE_INTEGER)
-               set_type(ValueBase::TYPE_INTEGER);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_ANGLE && ref_a->get_type()==ValueBase::TYPE_ANGLE)
-               set_type(ValueBase::TYPE_ANGLE);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_COLOR && ref_a->get_type()==ValueBase::TYPE_COLOR)
-               set_type(ValueBase::TYPE_COLOR);
-       else
-       {
-               sinfg::warning(get_id()+":(set_a):"+strprintf(_("Types seem to be off for ValueNodes %s and %s"),ref_a->get_id().c_str(),ref_b->get_id().c_str()));
-               set_type(ValueBase::TYPE_NIL);
-       }
-
-       return true;
-}
-
-bool
-sinfg::ValueNode_Subtract::set_rhs(ValueNode::Handle b)
-{
-       ref_b=b;
-
-       if(PlaceholderValueNode::Handle::cast_dynamic(b))
-               return true;
-
-       if(!ref_a || !ref_b)
-               set_type(ValueBase::TYPE_NIL);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_VECTOR && ref_a->get_type()==ValueBase::TYPE_VECTOR)
-               set_type(ValueBase::TYPE_VECTOR);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_REAL && ref_a->get_type()==ValueBase::TYPE_REAL)
-               set_type(ValueBase::TYPE_REAL);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_INTEGER && ref_a->get_type()==ValueBase::TYPE_INTEGER)
-               set_type(ValueBase::TYPE_INTEGER);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_ANGLE && ref_a->get_type()==ValueBase::TYPE_ANGLE)
-               set_type(ValueBase::TYPE_ANGLE);
-       else
-       if(ref_a->get_type()==ValueBase::TYPE_COLOR && ref_a->get_type()==ValueBase::TYPE_COLOR)
-               set_type(ValueBase::TYPE_COLOR);
-       else
-       {
-               sinfg::warning(get_id()+":(set_b):"+strprintf(_("Types seem to be off for ValueNodes %s and %s"),ref_a->get_id().c_str(),ref_b->get_id().c_str()));
-               set_type(ValueBase::TYPE_NIL);
-       }
-
-       return true;
-}
-
-sinfg::ValueBase
-sinfg::ValueNode_Subtract::operator()(Time t)const
-{
-       if(!ref_a || !ref_b)
-               throw runtime_error(strprintf("ValueNode_Subtract: %s",_("One or both of my parameters aren't set!")));
-       else
-       if(get_type()==ValueBase::TYPE_VECTOR)
-               return ((*ref_a)(t).get(Vector())-(*ref_b)(t).get(Vector()))*(*scalar)(t).get(Real());
-       else
-       if(get_type()==ValueBase::TYPE_REAL)
-               return ((*ref_a)(t).get(Vector::value_type())-(*ref_b)(t).get(Vector::value_type()))*(*scalar)(t).get(Real());
-       else
-       if(get_type()==ValueBase::TYPE_INTEGER)
-               return ((*ref_a)(t).get(int())-(*ref_b)(t).get(int()))*(*scalar)(t).get(Real());
-       else
-       if(get_type()==ValueBase::TYPE_ANGLE)
-               return ((*ref_a)(t).get(Angle())-(*ref_b)(t).get(Angle()))*(*scalar)(t).get(Real());
-       else
-       if(get_type()==ValueBase::TYPE_COLOR)
-               return ((*ref_a)(t).get(Color())-(*ref_b)(t).get(Color()))*(*scalar)(t).get(Real());
-
-       sinfg::error(get_id()+':'+strprintf(_("Cannot subtract types of %s and %s"),ValueBase::type_name(ref_a->get_type()).c_str(),ValueBase::type_name(ref_b->get_type()).c_str()));
-       return ValueBase();
-}
-
-bool
-ValueNode_Subtract::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i>=0 && i<3);
-       switch(i)
-       {
-               case 0:
-                       if(set_lhs(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-               case 1:
-                       if(set_rhs(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-               case 2:
-                       scalar=x;
-                       signal_child_changed()(i);signal_value_changed()();
-                       return true;
-       }
-
-       return false;
-}
-
-ValueNode::LooseHandle
-ValueNode_Subtract::get_link_vfunc(int i)const
-{
-       assert(i>=0 && i<3);
-       switch(i)
-       {
-               case 0:
-                       return ref_a;
-               case 1:
-                       return ref_b;
-               case 2:
-                       return scalar;
-       }
-       return 0;
-}
-
-int
-ValueNode_Subtract::link_count()const
-{
-       return 3;
-}
-
-String
-ValueNode_Subtract::link_local_name(int i)const
-{
-       assert(i>=0 && i<3);
-       switch(i)
-       {
-               case 0:
-                       return _("LHS");
-               case 1:
-                       return _("RHS");
-               case 2:
-                       return _("Scalar");
-       }
-       return String();
-}      
-
-String
-ValueNode_Subtract::link_name(int i)const
-{
-       assert(i>=0 && i<3);
-       switch(i)
-       {
-               case 0:
-                       return "lhs";
-               case 1:
-                       return "rhs";
-               case 2:
-                       return "scalar";
-       }
-       return String();
-}      
-
-int
-ValueNode_Subtract::get_link_index_from_name(const String &name)const
-{
-       if(name=="lhs")
-               return 0;
-       if(name=="rhs")
-               return 1;
-       if(name=="scalar")
-               return 2;
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_Subtract::get_name()const
-{
-       return "subtract";
-}
-
-String
-ValueNode_Subtract::get_local_name()const
-{
-       return _("Subtract");
-}
-
-bool
-ValueNode_Subtract::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_VECTOR 
-               || type==ValueBase::TYPE_REAL
-               || type==ValueBase::TYPE_INTEGER
-               || type==ValueBase::TYPE_COLOR
-               || type==ValueBase::TYPE_ANGLE;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_subtract.h b/synfig-core/trunk/src/sinfg/valuenode_subtract.h
deleted file mode 100644 (file)
index 7e2eac1..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_subtract.h
-**     \brief Template Header
-**
-**     $Id: valuenode_subtract.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_SUBTRACT_H
-#define __SINFG_VALUENODE_SUBTRACT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-struct ValueNode_Subtract : public LinkableValueNode
-{
-       typedef etl::handle<ValueNode_Subtract> Handle;
-       typedef etl::handle<const ValueNode_Subtract> ConstHandle;
-       
-protected:
-
-       ValueNode_Subtract();
-
-private:
-
-       ValueNode::RHandle ref_a;
-       ValueNode::RHandle ref_b;
-       ValueNode::RHandle scalar;
-
-public:
-
-       virtual ~ValueNode_Subtract();
-
-//     static Handle create(ValueBase::Type id=ValueBase::TYPE_NIL);
-
-       //! Sets the left-hand-side value_node
-       bool set_lhs(ValueNode::Handle a);
-
-       //! Gets the left-hand-side value_node
-       ValueNode::Handle get_lhs()const { return ref_a; }
-
-       //! Sets the right-hand-side value_node
-       bool set_rhs(ValueNode::Handle b);
-
-       //! Gets the right-hand-side value_node
-       ValueNode::Handle get_rhs()const { return ref_b; }
-
-       //! Sets the scalar value_node
-       bool set_scalar(ValueNode::Handle x);
-
-       //! Gets the scalar value_node
-       ValueNode::Handle get_scalar()const { return scalar; }
-
-       void set_scalar(Real x);
-
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-
-       virtual int link_count()const;
-
-       virtual String link_local_name(int i)const;
-       virtual String link_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-//     static bool check_type(const ValueBase::Type &type);
-
-       LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_Subtract* create(const ValueBase &x=ValueBase());
-}; // END of class ValueNode_Subtract
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_timedswap.cpp b/synfig-core/trunk/src/sinfg/valuenode_timedswap.cpp
deleted file mode 100644 (file)
index 0f51539..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_timedswap.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_timedswap.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "general.h"
-#include "valuenode_timedswap.h"
-#include "valuenode_const.h"
-#include <stdexcept>
-#include "color.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-ValueNode_TimedSwap::ValueNode_TimedSwap(ValueBase::Type type):
-       LinkableValueNode(type)
-{
-       set_before(ValueNode_Const::create(type));
-       set_after(ValueNode_Const::create(type));
-       set_swap_time_real(1.0);
-       set_swap_length_real(1.0);
-
-       DCAST_HACK_ENABLE();
-}
-
-ValueNode_TimedSwap*
-ValueNode_TimedSwap::create(const ValueBase& x)
-{
-       return new ValueNode_TimedSwap(x.get_type());
-}
-
-
-LinkableValueNode*
-ValueNode_TimedSwap::create_new()const
-{
-       return new ValueNode_TimedSwap(get_type());
-}
-
-
-sinfg::ValueNode_TimedSwap::~ValueNode_TimedSwap()
-{
-       unlink_all();
-}
-
-
-
-bool
-ValueNode_TimedSwap::set_before(const ValueNode::Handle &x)
-{
-       if(!x || x->get_type()!=get_type()
-               && !PlaceholderValueNode::Handle::cast_dynamic(x))
-               return false;
-
-       before=x;
-
-       return true;
-}
-
-ValueNode::Handle
-ValueNode_TimedSwap::get_before()const
-{
-       return before;
-}
-
-
-bool
-ValueNode_TimedSwap::set_after(const ValueNode::Handle &x)
-{
-       if(!x || x->get_type()!=get_type()
-               && !PlaceholderValueNode::Handle::cast_dynamic(x))
-               return false;
-
-       after=x;
-
-       return true;
-}
-
-ValueNode::Handle
-ValueNode_TimedSwap::get_after()const
-{
-       return after;
-}
-
-
-void
-ValueNode_TimedSwap::set_swap_time_real(Time x)
-{
-       set_swap_time(ValueNode_Const::create(x));
-}
-
-bool
-ValueNode_TimedSwap::set_swap_time(const ValueNode::Handle &x)
-{
-       if(!x
-               || !ValueBase(ValueBase::TYPE_TIME).same_as(x->get_type())
-               && !PlaceholderValueNode::Handle::cast_dynamic(x)
-       )
-               return false;
-       swap_time=x;
-       return true;
-}
-
-ValueNode::Handle
-ValueNode_TimedSwap::get_swap_time()const
-{
-       return swap_time;
-}
-
-void
-ValueNode_TimedSwap::set_swap_length_real(Time x)
-{
-       set_swap_length(ValueNode_Const::create(x));
-}
-
-bool
-ValueNode_TimedSwap::set_swap_length(const ValueNode::Handle &x)
-{
-       if(!x || (
-               !ValueBase(ValueBase::TYPE_TIME).same_as(x->get_type())
-               && !PlaceholderValueNode::Handle::cast_dynamic(x)
-               )
-       )
-               return false;
-       swap_length=x;
-       return true;
-}
-
-ValueNode::Handle
-ValueNode_TimedSwap::get_swap_length()const
-{
-       return swap_length;
-}
-
-
-
-sinfg::ValueBase
-sinfg::ValueNode_TimedSwap::operator()(Time t)const
-{
-       Time swptime=(*swap_time)(t).get(Time());
-       Time swplength=(*swap_length)(t).get(Time());
-
-       if(t>swptime)
-               return (*after)(t);
-       
-       if(t<=swptime && t>swptime-swplength)
-       {
-               Real amount=(swptime-t)/swplength;
-               // if amount==0.0, then we are after
-               // if amount==1.0, then we are before
-               
-               switch(get_type())
-               {
-               case ValueBase::TYPE_REAL:
-                       {
-                               Real a=(*after)(t).get(Real());
-                               Real b=(*before)(t).get(Real());
-                               return (b-a)*amount+a;
-                       }
-               case ValueBase::TYPE_VECTOR:
-                       {
-                               Vector a=(*after)(t).get(Vector());
-                               Vector b=(*before)(t).get(Vector());
-                               return (b-a)*amount+a;
-                       }
-               case ValueBase::TYPE_ANGLE:
-                       {
-                               Angle a=(*after)(t).get(Angle());
-                               Angle b=(*before)(t).get(Angle());
-                               return (b-a)*amount+a;
-                       }
-               case ValueBase::TYPE_COLOR:
-                       {
-                               Color a=(*after)(t).get(Color());
-                               Color b=(*before)(t).get(Color());
-                               // note: Shouldn't this use a straight blend?
-                               return (b-a)*amount+a;
-                       }
-               case ValueBase::TYPE_INTEGER:
-                       {
-                               float a=(float)(*after)(t).get(int());
-                               float b=(float)(*before)(t).get(int());
-                               return static_cast<int>((b-a)*amount+a+0.5f);
-                       }
-               default:
-                       break;
-               }
-       }
-
-
-       /*! \todo this should interpolate from
-       **      before to after over the period defined
-       **      by swap_length */
-
-       return (*before)(t);
-}
-
-
-bool
-ValueNode_TimedSwap::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i>=0 && i<4);
-       switch(i)
-       {
-       case 0:
-               return set_before(x);
-       case 1:
-               return set_after(x);
-       case 2:
-               return set_swap_time(x);
-       case 3:
-               return set_swap_length(x);
-       }
-       return 0;
-}
-
-ValueNode::LooseHandle
-ValueNode_TimedSwap::get_link_vfunc(int i)const
-{
-       assert(i>=0 && i<4);
-       switch(i)
-       {
-       case 0:
-               return get_before();
-       case 1:
-               return get_after();
-       case 2:
-               return get_swap_time();
-       case 3:
-               return get_swap_length();
-       }
-       return 0;
-}
-
-int
-ValueNode_TimedSwap::link_count()const
-{
-       return 4;
-}
-
-String
-ValueNode_TimedSwap::link_local_name(int i)const
-{
-       assert(i>=0 && i<4);
-       switch(i)
-       {
-       case 0:
-               return _("Before");
-       case 1:
-               return _("After");
-       case 2:
-               return _("Swap Time");
-       case 3:
-               return _("Swap Duration");
-       }
-       return 0;
-}      
-
-String
-ValueNode_TimedSwap::link_name(int i)const
-{
-       assert(i>=0 && i<4);
-       switch(i)
-       {
-       case 0:
-               return "before";
-       case 1:
-               return "after";
-       case 2:
-               return "time";
-       case 3:
-               return "length";
-       }
-       return 0;
-}      
-
-int
-ValueNode_TimedSwap::get_link_index_from_name(const String &name)const
-{
-       if(name=="before")
-               return 0;
-       if(name=="after")
-               return 1;
-       if(name=="time")
-               return 2;
-       if(name=="length")
-               return 3;
-
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_TimedSwap::get_name()const
-{
-       return "timed_swap";
-}
-
-String
-ValueNode_TimedSwap::get_local_name()const
-{
-       return _("Timed Swap");
-}
-
-bool
-ValueNode_TimedSwap::check_type(ValueBase::Type type)
-{
-       if(!type)
-               return false;
-       return true;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_timedswap.h b/synfig-core/trunk/src/sinfg/valuenode_timedswap.h
deleted file mode 100644 (file)
index fff875f..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_timedswap.h
-**     \brief Template Header
-**
-**     $Id: valuenode_timedswap.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_TIMEDSWAP_H
-#define __SINFG_VALUENODE_TIMEDSWAP_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-struct ValueNode_TimedSwap : public LinkableValueNode
-{
-       typedef etl::handle<ValueNode_TimedSwap> Handle;
-       typedef etl::handle<const ValueNode_TimedSwap> ConstHandle;
-       
-private:
-
-       ValueNode::RHandle before;
-       ValueNode::RHandle after;
-       ValueNode::RHandle swap_time;
-       ValueNode::RHandle swap_length;
-
-       ValueNode_TimedSwap(ValueBase::Type id);
-
-public:
-
-//     static Handle create(ValueBase::Type id);
-
-       virtual ~ValueNode_TimedSwap();
-
-       bool set_before(const ValueNode::Handle &a);
-       ValueNode::Handle get_before()const;
-       bool set_after(const ValueNode::Handle &a);
-       ValueNode::Handle get_after()const;
-
-       void set_swap_time_real(Time x);
-       bool set_swap_time(const ValueNode::Handle &x);
-       ValueNode::Handle get_swap_time()const;
-
-       void set_swap_length_real(Time x);
-       bool set_swap_length(const ValueNode::Handle &x);
-       ValueNode::Handle get_swap_length()const;
-
-
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-       virtual int link_count()const;
-       virtual String link_local_name(int i)const;
-       virtual String link_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual String get_name()const; 
-       virtual String get_local_name()const;
-//     static bool check_type(const ValueBase::Type &type);
-
-protected:
-       
-       virtual LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_TimedSwap* create(const ValueBase &x);
-}; // END of class ValueNode_TimedSwap
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/valuenode_twotone.cpp b/synfig-core/trunk/src/sinfg/valuenode_twotone.cpp
deleted file mode 100644 (file)
index b03ec01..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_subtract.cpp
-**     \brief Template File
-**
-**     $Id: valuenode_twotone.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "general.h"
-#include "valuenode_twotone.h"
-#include "valuenode_const.h"
-#include <stdexcept>
-#include "color.h"
-#include "gradient.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfg::ValueNode_TwoTone::ValueNode_TwoTone():LinkableValueNode(sinfg::ValueBase::TYPE_GRADIENT)
-{
-       set_link("color1",ValueNode_Const::create(Color::black()));
-       set_link("color2",ValueNode_Const::create(Color::white()));
-       DCAST_HACK_ENABLE();
-}
-
-LinkableValueNode*
-ValueNode_TwoTone::create_new()const
-{
-       return new ValueNode_TwoTone();
-}
-
-ValueNode_TwoTone*
-ValueNode_TwoTone::create(const ValueBase& x)
-{
-       ValueBase::Type id(x.get_type());
-       if(id!=ValueBase::TYPE_GRADIENT)
-       {
-               assert(0);
-               throw runtime_error("sinfg::ValueNode_TwoTone:Bad type "+ValueBase::type_name(id));                     
-       }               
-
-       ValueNode_TwoTone* value_node=new ValueNode_TwoTone();
-
-       assert(value_node->get_type()==id);
-       
-       return value_node;
-}
-
-sinfg::ValueNode_TwoTone::~ValueNode_TwoTone()
-{
-       unlink_all();
-}
-
-bool
-sinfg::ValueNode_TwoTone::set_lhs(ValueNode::Handle a)
-{
-       if(a->get_type()!=ValueBase::TYPE_COLOR)
-               return false;
-
-       ref_a=a;
-
-       return true;
-}
-
-bool
-sinfg::ValueNode_TwoTone::set_rhs(ValueNode::Handle b)
-{
-       if(b->get_type()!=ValueBase::TYPE_COLOR)
-               return false;
-       ref_b=b;
-       return true;
-}
-
-sinfg::ValueBase
-sinfg::ValueNode_TwoTone::operator()(Time t)const
-{
-       return Gradient((*ref_a)(t).get(Color()),(*ref_b)(t).get(Color()));
-}
-
-bool
-ValueNode_TwoTone::set_link_vfunc(int i,ValueNode::Handle x)
-{
-       assert(i>=0 && i<3);
-       switch(i)
-       {
-               case 0:
-                       if(set_lhs(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-               case 1:
-                       if(set_rhs(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
-                       else { return false; }
-       }
-
-       return false;
-}
-
-ValueNode::LooseHandle
-ValueNode_TwoTone::get_link_vfunc(int i)const
-{
-       assert(i>=0 && i<3);
-       switch(i)
-       {
-               case 0:
-                       return ref_a;
-               case 1:
-                       return ref_b;
-       }
-       return 0;
-}
-
-int
-ValueNode_TwoTone::link_count()const
-{
-       return 2;
-}
-
-String
-ValueNode_TwoTone::link_local_name(int i)const
-{
-       assert(i>=0 && i<2);
-       switch(i)
-       {
-               case 0:
-                       return _("Color1");
-               case 1:
-                       return _("Color2");
-       }
-       return String();
-}      
-
-String
-ValueNode_TwoTone::link_name(int i)const
-{
-       assert(i>=0 && i<2);
-       switch(i)
-       {
-               case 0:
-                       return "color1";
-               case 1:
-                       return "color2";
-       }
-       return String();
-}      
-
-int
-ValueNode_TwoTone::get_link_index_from_name(const String &name)const
-{
-       if(name=="color1")
-               return 0;
-       if(name=="color2")
-               return 1;
-       throw Exception::BadLinkName(name);
-}
-
-String
-ValueNode_TwoTone::get_name()const
-{
-       return "twotone";
-}
-
-String
-ValueNode_TwoTone::get_local_name()const
-{
-       return _("Two-Tone");
-}
-
-bool
-ValueNode_TwoTone::check_type(ValueBase::Type type)
-{
-       return type==ValueBase::TYPE_GRADIENT;
-}
diff --git a/synfig-core/trunk/src/sinfg/valuenode_twotone.h b/synfig-core/trunk/src/sinfg/valuenode_twotone.h
deleted file mode 100644 (file)
index 5d28a83..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenode_twotone.h
-**     \brief Template Header
-**
-**     $Id: valuenode_twotone.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VALUENODE_TWOTONE_H
-#define __SINFG_VALUENODE_TWOTONE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "valuenode.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-struct ValueNode_TwoTone : public LinkableValueNode
-{
-       typedef etl::handle<ValueNode_TwoTone> Handle;
-       typedef etl::handle<const ValueNode_TwoTone> ConstHandle;
-       
-protected:
-
-       ValueNode_TwoTone();
-
-private:
-
-       ValueNode::RHandle ref_a;
-       ValueNode::RHandle ref_b;
-
-public:
-
-       virtual ~ValueNode_TwoTone();
-
-//     static Handle create(ValueBase::Type id=ValueBase::TYPE_GRADIENT);
-
-       //! Sets the left-hand-side value_node
-       bool set_lhs(ValueNode::Handle a);
-
-       //! Gets the left-hand-side value_node
-       ValueNode::Handle get_lhs()const { return ref_a; }
-
-       //! Sets the right-hand-side value_node
-       bool set_rhs(ValueNode::Handle b);
-
-       //! Gets the right-hand-side value_node
-       ValueNode::Handle get_rhs()const { return ref_b; }
-
-
-       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
-
-       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
-
-       virtual int link_count()const;
-
-       virtual String link_local_name(int i)const;
-       virtual String link_name(int i)const;
-       virtual int get_link_index_from_name(const String &name)const;
-
-       virtual ValueBase operator()(Time t)const;
-
-       virtual String get_name()const;
-       virtual String get_local_name()const;
-
-//     static bool check_type(const ValueBase::Type &type);
-
-       LinkableValueNode* create_new()const;
-
-public:
-       using sinfg::LinkableValueNode::get_link_vfunc;
-
-       using sinfg::LinkableValueNode::set_link_vfunc;
-       static bool check_type(ValueBase::Type type);
-       static ValueNode_TwoTone* create(const ValueBase &x=ValueBase::TYPE_GRADIENT);
-}; // END of class ValueNode_TwoTone
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/vector.h b/synfig-core/trunk/src/sinfg/vector.h
deleted file mode 100644 (file)
index a279db8..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file vector.h
-**     \brief Various discreet type definitions
-**
-**     $Id: vector.h,v 1.2 2005/01/23 04:03:21 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VECTOR_H
-#define __SINFG_VECTOR_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "real.h"
-#include <cmath>
-
-/* === M A C R O S ========================================================= */
-
-#ifndef isnan
-
-#ifdef WIN32
-#include <float.h>
-#ifndef isnan
-extern "C" { int _isnan(double x); }
-#define isnan _isnan
-#endif
-#endif
-
-#ifdef __APPLE__
-#define isnan __isnanf
-#endif
-
-#endif
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-/*!    \class Vector
-**     \todo writeme
-*/
-class Vector
-{
-public:
-       typedef Real value_type;
-
-private:
-       value_type _x, _y;
-
-public:
-       Vector() { };
-       Vector(const value_type &x, const value_type &y):_x(x),_y(y) { };
-
-       bool is_valid()const { return !(isnan(_x) || isnan(_y)); }
-       
-       value_type &
-       operator[](const int& i)
-       { return (&_x)[i] ; }
-
-       const value_type &
-       operator[](const int& i) const
-       { return (&_x)[i] ; }
-       
-       const Vector &
-       operator+=(const Vector &rhs)
-       {
-               _x+=rhs._x;
-               _y+=rhs._y;
-               return *this;
-       }
-       
-       const Vector &
-       operator-=(const Vector &rhs)
-       {
-               _x-=rhs._x;
-               _y-=rhs._y;
-               return *this;
-       }
-       
-       const Vector &
-       operator*=(const value_type &rhs)
-       {
-               _x*=rhs;
-               _y*=rhs;
-               return *this;
-       }
-       
-       const Vector &
-       operator/=(const value_type &rhs)
-       {
-               value_type tmp=1.0/rhs;
-               _x*=tmp;
-               _y*=tmp;
-               return *this;
-       }
-               
-       Vector
-       operator+(const Vector &rhs)const
-               { return Vector(*this)+=rhs; }
-
-       Vector
-       operator-(const Vector &rhs)const
-               { return Vector(*this)-=rhs; }
-
-       Vector
-       operator*(const value_type &rhs)const
-               { return Vector(*this)*=rhs; }
-
-       Vector
-       operator/(const value_type &rhs)const
-               { return Vector(*this)/=rhs; }
-
-       Vector
-       operator-()const
-               { return Vector(-_x,-_y); }
-
-       value_type
-       operator*(const Vector &rhs)const
-               { return _x*rhs._x+_y*rhs._y; }
-
-       bool
-       operator==(const Vector &rhs)const
-               { return _x==rhs._x && _y==rhs._y; }
-       
-       bool
-       operator!=(const Vector &rhs)const
-               { return _y!=rhs._y || _x!=rhs._x; }
-       
-       //! Returns the squared magnitude of the vector
-       value_type mag_squared()const
-               { return _x*_x+_y*_y; }
-       
-       //! Returns the magnitude of the vector
-       value_type mag()const
-               { return sqrt(mag_squared()); }
-
-       //! Returns the reciprocal of the magnitude of the vector
-       value_type inv_mag()const
-               { return 1.0/sqrt(mag_squared()); }
-
-       //! Returns a normalized version of the vector
-       Vector norm()const
-               { return (*this)*inv_mag(); }
-
-       //! Returns a perpendicular version of the vector
-       Vector perp()const
-               { return Vector(_y,-_x); }
-               
-       bool is_equal_to(const Vector& rhs)const
-       {
-               static const value_type epsilon(0.0000000000001);
-//             return (_x>rhs._x)?_x-rhs._x<=epsilon:rhs._x-_x<=epsilon && (_y>rhs._y)?_y-rhs._y<=epsilon:rhs._y-_y<=epsilon;
-               return (*this-rhs).mag_squared()<=epsilon;
-       }
-       
-       static const Vector zero() { return Vector(0,0); }
-};
-
-/*!    \typedef Point
-**     \todo writeme
-*/
-typedef Vector Point;
-
-
-
-}; // END of namespace sinfg
-
-namespace std {
-
-inline sinfg::Vector::value_type
-abs(const sinfg::Vector &rhs)
-       { return rhs.mag(); }
-
-}; // END of namespace std
-
-#include <ETL/bezier>
-
-_ETL_BEGIN_NAMESPACE
-
-template <>
-class bezier_base<sinfg::Vector,float> : public std::unary_function<float,sinfg::Vector>
-{
-public:
-       typedef sinfg::Vector value_type;
-       typedef float time_type;
-private:
-
-       bezier_base<sinfg::Vector::value_type,time_type> bezier_x,bezier_y;
-
-       value_type a,b,c,d;
-
-protected:
-       affine_combo<value_type,time_type> affine_func; 
-
-public:
-       bezier_base() { }
-       bezier_base(
-               const value_type &a, const value_type &b, const value_type &c, const value_type &d,
-               const time_type &r=0.0, const time_type &s=1.0):
-               a(a),b(b),c(c),d(d) { set_rs(r,s); sync(); }
-               
-       void sync()
-       {
-               bezier_x[0]=a[0],bezier_y[0]=a[1];
-               bezier_x[1]=b[0],bezier_y[1]=b[1];
-               bezier_x[2]=c[0],bezier_y[2]=c[1];
-               bezier_x[3]=d[0],bezier_y[3]=d[1];
-               bezier_x.sync();
-               bezier_y.sync();
-       }
-
-       value_type
-       operator()(time_type t)const
-       {
-               return sinfg::Vector(bezier_x(t),bezier_y(t));
-       }
-       
-       void evaluate(time_type t, value_type &f, value_type &df) const
-       {
-               t=(t-get_r())/get_dt();
-               
-               const value_type p1 = affine_func(
-                                                       affine_func(a,b,t),
-                                                       affine_func(b,c,t)
-                                                       ,t);
-               const value_type p2 = affine_func(
-                                                       affine_func(b,c,t),
-                                                       affine_func(c,d,t)
-                                               ,t);
-               
-               f = affine_func(p1,p2,t);
-               df = (p2-p1)*3;
-       }
-
-       void set_rs(time_type new_r, time_type new_s) { bezier_x.set_rs(new_r,new_s); bezier_y.set_rs(new_r,new_s); }
-       void set_r(time_type new_r) { bezier_x.set_r(new_r); bezier_y.set_r(new_r); }
-       void set_s(time_type new_s) { bezier_x.set_s(new_s); bezier_y.set_s(new_s); }
-       const time_type &get_r()const { return bezier_x.get_r(); }
-       const time_type &get_s()const { return bezier_x.get_s(); }
-       time_type get_dt()const { return bezier_x.get_dt(); }
-
-       value_type &
-       operator[](int i)
-       { return (&a)[i]; }
-
-       const value_type &
-       operator[](int i) const
-       { return (&a)[i]; }
-
-       //! Bezier curve intersection function
-       time_type intersect(const bezier_base<value_type,time_type> &x, time_type near=0.0)const
-       {
-               return 0;
-       }
-};
-
-_ETL_END_NAMESPACE
-
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/version.h b/synfig-core/trunk/src/sinfg/version.h
deleted file mode 100644 (file)
index 841a0d6..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file version.h
-**     \brief Template Header
-**
-**     $Id: version.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_VERSION_H
-#define __SINFG_VERSION_H
-
-/* === H E A D E R S ======================================================= */
-
-/* === M A C R O S ========================================================= */
-
-/*! \def SINFG_VERSION
-**     \brief Sinfg API Version
-**
-**     The macro SINFG_VERSION can be set to ensure
-**     compile-time compatibility with future versions
-**     of Sinfg. The first two digits are the major
-**     version, the second two digits are the minor
-**     version, and the last two digits are the
-**     revision release.
-*/
-#ifndef SINFG_VERSION
-#define SINFG_VERSION (006000)
-#endif
-
-/*!    Increment this value whenever
-**     the library changes in a way
-**     that breaks library compatibility
-*/
-#define SINFG_LIBRARY_VERSION  47
-
-/*! \writeme */
-#define SINFG_CHECK_VERSION()  sinfg::check_version_(SINFG_LIBRARY_VERSION,sizeof(sinfg::Vector),sizeof(sinfg::Color),sizeof(sinfg::Canvas),sizeof(sinfg::Layer))
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg {
-
-//! Version checker \internal
-/*! Checks to make sure that the library
-**     version matches with what the program
-**     was compiled against.
-**     \see SINFG_CHECK_VERSION()
-*/
-extern bool check_version_(int v,int vec_size, int color_size,int canvas_size,int layer_size);
-
-extern const char *get_version();
-
-extern const char *get_build_date();
-
-extern const char *get_build_time();
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/sinfg/waypoint.cpp b/synfig-core/trunk/src/sinfg/waypoint.cpp
deleted file mode 100644 (file)
index 2fa82a2..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypoint.cpp
-**     \brief Template File
-**
-**     $Id: waypoint.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include "waypoint.h"
-#include "valuenode_const.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Waypoint::Waypoint(ValueBase value, Time time):
-       priority_(0),
-       before(INTERPOLATION_TCB),
-       after(INTERPOLATION_TCB),
-       value_node(ValueNode_Const::create(value)),
-       time(time),
-       tension(0.0),
-       continuity(0.0),
-       bias(0),
-       time_tension(0.0f)
-{
-       if(value.get_type()==ValueBase::TYPE_ANGLE)
-               after=before=INTERPOLATION_LINEAR;
-}
-
-Waypoint::Waypoint(ValueNode::Handle value_node, Time time):
-       priority_(0),
-       before(INTERPOLATION_TCB),
-       after(INTERPOLATION_TCB),
-       value_node(value_node),
-       time(time),
-       tension(0.0),
-       continuity(0),
-       bias(0),
-       time_tension(0.0f)
-{
-       if(value_node->get_type()==ValueBase::TYPE_ANGLE)
-               after=before=INTERPOLATION_LINEAR;
-}
-
-Waypoint::Waypoint():
-       priority_(0),
-       before(INTERPOLATION_TCB),
-       after(INTERPOLATION_TCB),
-       tension(0),
-       continuity(0),
-       bias(0),
-       time_tension(0.0f)
-{
-}
-
-void
-Waypoint::set_value(const ValueBase &x)
-{
-       if(!value_node && x.get_type()==ValueBase::TYPE_ANGLE)
-               after=before=INTERPOLATION_LINEAR;
-
-       value_node=ValueNode_Const::create(x);
-}
-
-void
-Waypoint::set_value_node(const ValueNode::Handle &x)
-{
-       if(!value_node && x->get_type()==ValueBase::TYPE_ANGLE)
-               after=before=INTERPOLATION_LINEAR;
-
-       value_node=x;
-}
-
-bool
-Waypoint::is_static()const
-{
-       return static_cast<bool>(ValueNode_Const::Handle::cast_dynamic(value_node)) && value_node && !value_node->is_exported();
-}
-
-void
-Waypoint::set_time(const Time &x)
-{
-       time=x;
-}
-
-void
-Waypoint::apply_model(const Model &x)
-{
-       if(x.priority_flag) set_priority(x.get_priority());
-       if(x.before_flag) set_before(x.get_before());
-       if(x.after_flag) set_after(x.get_after());
-       if(x.tension_flag) set_tension(x.get_tension());
-       if(x.continuity_flag) set_continuity(x.get_continuity());
-       if(x.bias_flag) set_bias(x.get_bias());
-       if(x.temporal_tension_flag) set_temporal_tension(x.get_temporal_tension());
-}
-
-Waypoint
-Waypoint::clone(const GUID& deriv_guid)const
-{
-       Waypoint ret(*this);
-       ret.make_unique();
-       if(!ret.value_node->is_exported())
-               ret.value_node=value_node->clone(deriv_guid);
-       ret.parent_=0;
-       return ret;
-}
-
-ValueBase
-Waypoint::get_value()const { return (*value_node)(0); }
-
-ValueBase
-Waypoint::get_value(const Time &t)const { return (*value_node)(t); }
-
-sinfg::GUID
-Waypoint::get_guid()const
-{
-       return GUID::hasher(get_uid());
-}
diff --git a/synfig-core/trunk/src/sinfg/waypoint.h b/synfig-core/trunk/src/sinfg/waypoint.h
deleted file mode 100644 (file)
index 6315134..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypoint.h
-**     \brief Template Header
-**
-**     $Id: waypoint.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SINFG_WAYPOINT_H
-#define __SINFG_WAYPOINT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "time.h"
-#include "real.h"
-#include "value.h"
-//#include "valuenode.h"
-#include "uniqueid.h"
-#include <vector>
-#include "guid.h"
-#include "interpolation.h"
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace sinfg { 
-
-class ValueNode;
-class GUID;
-               
-       
-/*!    \class Waypoint
-**     \brief \writeme
-*/
-class Waypoint : public UniqueID
-{
-       /*
- --    ** -- T Y P E S -----------------------------------------------------------
-       */
-
-public:
-
-       typedef sinfg::Interpolation Interpolation;
-
-       class Model
-       {
-               friend class Waypoint;
-                       
-               int priority;
-               Interpolation before;
-               Interpolation after;
-               Real tension;
-               Real continuity;
-               Real bias;
-               Real temporal_tension;
-               
-               bool priority_flag,before_flag,after_flag,tension_flag,continuity_flag,bias_flag,temporal_tension_flag;
-       
-       public:
-               Model():
-                       priority_flag(false),
-                       before_flag(false),
-                       after_flag(false),
-                       tension_flag(false),
-                       continuity_flag(false),
-                       bias_flag(false),
-                       temporal_tension_flag(false) { }
-       
-               Interpolation get_before()const { return before; }
-               void set_before(Interpolation x) { before=x; before_flag=true;}
-       
-               Interpolation get_after()const { return after; }
-               void set_after(Interpolation x) { after=x; after_flag=true;}
-       
-               const Real &get_tension()const { return tension; }
-               void set_tension(const Real &x) { tension=x; tension_flag=true;}
-               
-               const Real &get_continuity()const { return continuity; }
-               void set_continuity(const Real &x) { continuity=x; continuity_flag=true;}
-       
-               const Real &get_bias()const { return bias; }
-               void set_bias(const Real &x) { bias=x; bias_flag=true;}
-
-               const Real &get_temporal_tension()const { return temporal_tension; }
-               void set_temporal_tension(const Real &x) { temporal_tension=x; temporal_tension_flag=true;}
-               
-               int get_priority()const { return priority; }
-               void set_priority(int x) { priority=x; priority_flag=true;}     
-
-               #define FLAG_MACRO(x) bool get_##x##_flag()const { return x##_flag; } void set_##x##_flag(bool y) { x##_flag=y; }
-               FLAG_MACRO(priority)
-               FLAG_MACRO(before)
-               FLAG_MACRO(after)
-               FLAG_MACRO(tension)
-               FLAG_MACRO(continuity)
-               FLAG_MACRO(bias)
-               FLAG_MACRO(temporal_tension)
-               #undef FLAG_MACRO
-               
-               void reset()
-               {
-                       priority_flag=false;
-                       before_flag=false;
-                       after_flag=false;
-                       tension_flag=false;
-                       continuity_flag=false;
-                       bias_flag=false;
-                       temporal_tension_flag=false;
-               }
-               
-               bool is_trivial()const
-               {
-                       return !(
-                               priority_flag||
-                               before_flag||
-                               after_flag||
-                               tension_flag||
-                               continuity_flag||
-                               bias_flag||
-                               temporal_tension_flag
-                       );
-               }
-       };
-       
-       /*
- --    ** -- D A T A -------------------------------------------------------------
-       */
-       
-private:
-       
-       int priority_;
-       etl::loose_handle<ValueNode> parent_;
-
-       Interpolation before, after;
-       
-       etl::rhandle<ValueNode> value_node;
-
-       Time time;
-               
-       // The following are for the INTERPOLATION_TCB type
-       Real tension;
-       Real continuity;
-       Real bias;
-
-       // The following are for the INTERPOLATION_MANUAL type
-       ValueBase cpoint_before,cpoint_after;
-       
-
-       float time_tension;
-       
-       /*
- --    ** -- C O N S T R U C T O R S ---------------------------------------------
-       */
-
-public:
-
-       Waypoint(ValueBase value, Time time);
-       Waypoint(etl::handle<ValueNode> value_node, Time time);
-       
-       Waypoint();
-
-       /*
- --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
-       */
-
-public:
-
-       void apply_model(const Model &x);
-
-       Interpolation get_before()const { return before; }
-       void set_before(Interpolation x) { before=x; }
-
-       Interpolation get_after()const { return after; }
-       void set_after(Interpolation x) { after=x; }
-
-       ValueBase get_value()const;
-       ValueBase get_value(const Time &t)const;
-       void set_value(const ValueBase &x);
-       
-       const etl::rhandle<ValueNode> &get_value_node()const { return value_node; }
-       void set_value_node(const etl::handle<ValueNode> &x);
-       
-       const Real &get_tension()const { return tension; }
-       void set_tension(const Real &x) { tension=x; }
-
-       const Real &get_continuity()const { return continuity; }
-       void set_continuity(const Real &x) { continuity=x; }
-
-       const Real &get_bias()const { return bias; }
-       void set_bias(const Real &x) { bias=x; }
-
-       const Time &get_time()const { return time; }
-       void set_time(const Time &x);
-
-       int get_priority()const { return priority_; }
-       void set_priority(int x) { priority_=x; }
-
-       const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
-       void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }
-       
-       bool is_static()const;
-
-       float get_time_tension()const { return time_tension; }
-       void set_time_tension(const float& x) { time_tension=x; }
-       float get_temporal_tension()const { return time_tension; }
-       void set_temporal_tension(const float& x) { time_tension=x; }
-       
-       bool operator<(const Waypoint &rhs)const
-       { return time<rhs.time; }
-       
-       bool operator<(const Time &rhs)const
-       { return time.is_less_than(rhs); }
-       bool operator>(const Time &rhs)const
-       { return time.is_more_than(rhs); }
-       
-       bool operator==(const Time &rhs)const
-       { return time.is_equal(rhs); }
-       bool operator!=(const Time &rhs)const
-       { return !time.is_equal(rhs); }
-       
-       bool operator==(const UniqueID &rhs)const
-       { return get_uid()==rhs.get_uid(); }
-       bool operator!=(const UniqueID &rhs)const
-       { return get_uid()!=rhs.get_uid(); }
-
-       Waypoint clone(const GUID& deriv_guid=GUID())const;
-
-       GUID get_guid()const;
-}; // END of class Waypoint
-
-typedef std::vector< Waypoint > WaypointList;
-
-}; // END of namespace sinfg
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-core/trunk/src/synfig/.cvsignore b/synfig-core/trunk/src/synfig/.cvsignore
new file mode 100644 (file)
index 0000000..74a6660
--- /dev/null
@@ -0,0 +1,2 @@
+*.lo
+.deps .libs Makefile Makefile.in *.la
diff --git a/synfig-core/trunk/src/synfig/Makefile.am b/synfig-core/trunk/src/synfig/Makefile.am
new file mode 100644 (file)
index 0000000..f8f712f
--- /dev/null
@@ -0,0 +1,33 @@
+# $Header: /opt/voria/cvs/sinfg/src/sinfg/Makefile.am,v 1.3 2005/01/21 19:29:10 darco Exp $
+
+# SUBDIRS=proto
+
+MAINTAINERCLEANFILES=Makefile.in
+INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/libltdl
+
+LAYERHEADERS=layer_motionblur.h layer_pastecanvas.h layer_solidcolor.h layer_polygon.h layer_composite.h layer_bitmap.h layer_mime.h layer_shape.h
+LAYERSOURCES=layer_motionblur.cpp layer_pastecanvas.cpp layer_solidcolor.cpp layer_polygon.cpp layer_composite.cpp layer_bitmap.cpp layer_mime.cpp layer_shape.cpp
+
+TARGETHEADERS=target_scanline.h target_tile.h target_multi.h target_null.h target_null_tile.h
+TARGETSOURCES=target_scanline.cpp target_tile.cpp target_multi.cpp target_null.cpp target_null_tile.cpp
+
+IMPORTERHEADERS=listimporter.cpp
+IMPORTERSOURCES=listimporter.h
+
+VALUENODEHEADERS=valuenode_sine.h valuenode_radialcomposite.h valuenode_bline.h valuenode_segcalcvertex.h valuenode_segcalctangent.h valuenode_twotone.h valuenode_stripes.h valuenode_subtract.h valuenode_const.h valuenode_reference.h valuenode_linear.h valuenode_composite.h valuenode_dynamiclist.h valuenode_animated.h valuenode_scale.h valuenode_timedswap.h valuenode_gradientrotate.h
+VALUENODESOURCES=valuenode_sine.cpp valuenode_radialcomposite.cpp valuenode_bline.cpp valuenode_segcalcvertex.cpp valuenode_segcalctangent.cpp valuenode_twotone.cpp valuenode_stripes.cpp valuenode_subtract.cpp valuenode_const.cpp valuenode_reference.cpp valuenode_linear.cpp valuenode_composite.cpp valuenode_dynamiclist.cpp valuenode_animated.cpp valuenode_scale.cpp valuenode_timedswap.cpp valuenode_gradientrotate.cpp
+
+VALUEHEADERS=blinepoint.h gradient.h value.h
+VALUESOURCES=blinepoint.cpp gradient.cpp value.cpp
+
+SINFGHEADERS=surfacenew.h mutex.h timepointcollect.h interpolation.h guidset.h guid.h rect.h node.h smartfile.h distance.h palette.h main.h waypoint.h activepoint.h gamma.h uniqueid.h canvasbase.h context.h real.h paramdesc.h string_decl.h angle.h keyframe.h sinfg.h renddesc.h general.h importer.h surface.h module.h layer.h vector.h color.h canvas.h render.h target.h loadcanvas.h savecanvas.h valuenode.h version.h segment.h types.h exception.h string.h time.h blur.h transform.h curve_helper.h polynomial_root.h curveset.h
+SINFGSOURCES=mutex.cpp timepointcollect.cpp rect.cpp node.cpp guid.cpp loadcanvas.cpp distance.cpp palette.cpp paramdesc.cpp waypoint.cpp activepoint.cpp gamma.cpp uniqueid.cpp context.cpp renddesc.cpp time.cpp exception.cpp keyframe.cpp main.cpp surface.cpp module.cpp importer.cpp layer.cpp color.cpp canvas.cpp render.cpp target.cpp savecanvas.cpp valuenode.cpp blur.cpp curve_helper.cpp polynomial_root.cpp transform.cpp curveset.cpp
+
+lib_LTLIBRARIES = libsinfg.la
+libsinfg_la_SOURCES = $(VALUEHEADERS) $(VALUESOURCES) $(LAYERSOURCES) $(LAYERHEADERS) $(TARGETHEADERS) $(TARGETSOURCES) $(VALUENODEHEADERS) $(VALUENODESOURCES) $(SINFGHEADERS) $(SINFGSOURCES) $(IMPORTERHEADERS) $(IMPORTERSOURCES)
+libsinfg_la_LIBADD = @LIBLTDL@ @SINFG_LIBS@ @LIBADD_DL@
+libsinfg_la_CXXFLAGS = @SINFG_CFLAGS@ -DLIBDIR="\"@libdir@\"" -DSYSCONFDIR="\"@sysconfdir@\""
+libsinfg_la_LDFLAGS = -export-dynamic -no-undefined -version-info 0:0:0
+
+include_sinfgdir=@sinfgincludedir@/sinfg
+include_sinfg_HEADERS = $(SINFGHEADERS) $(LAYERHEADERS) $(TARGETHEADERS) $(VALUENODEHEADERS) $(IMPORTERHEADERS) $(VALUEHEADERS)
diff --git a/synfig-core/trunk/src/synfig/activepoint.cpp b/synfig-core/trunk/src/synfig/activepoint.cpp
new file mode 100644 (file)
index 0000000..75ddb4c
--- /dev/null
@@ -0,0 +1,54 @@
+/* === S I N F G =========================================================== */
+/*!    \file activepoint.cpp
+**     \brief Template File
+**
+**     $Id: activepoint.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "activepoint.h"
+#include "guid.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::GUID
+Activepoint::get_guid()const
+{
+       return GUID::hasher(get_uid());
+}
diff --git a/synfig-core/trunk/src/synfig/activepoint.h b/synfig-core/trunk/src/synfig/activepoint.h
new file mode 100644 (file)
index 0000000..37e6397
--- /dev/null
@@ -0,0 +1,87 @@
+/* === S I N F G =========================================================== */
+/*!    \file activepoint.h
+**     \brief Template Header
+**
+**     $Id: activepoint.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_ACTIVEPOINT_H
+#define __SINFG_ACTIVEPOINT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "time.h"
+#include "uniqueid.h"
+#include <ETL/handle>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+class GUID;
+class ValueNode;
+       
+struct Activepoint : public UniqueID
+{
+private:
+       etl::loose_handle<ValueNode> parent_;
+       int index;
+       
+public:
+       //! Time of the activepoint
+       Time time;
+       
+       //! Priority
+       int priority;
+
+       //! Does this activepoint turn the entry on, or off?
+       bool state;
+               
+       bool operator<(const Activepoint& rhs) { return time<rhs.time; }
+       bool operator<(const Time& rhs) { return time<rhs; }
+       
+       Activepoint(const Time &time, const bool &state, int p=0): time(time), priority(p),state(state) { }
+       Activepoint() { }
+       
+       const Time& get_time()const { return time; }
+       void set_time(const Time& x) { time=x; }
+
+       bool get_state()const { return state; }
+       void set_state(bool x) { state=x; }
+
+       int get_priority()const { return priority; }
+       void set_priority(int x) { priority=x; }
+
+       const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
+       void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }        
+       
+       int get_parent_index()const { return index; }
+       void set_parent_index(int x) { index=x; }
+       
+       GUID get_guid()const;
+}; // END of struct ValueNode_BLine::Activepoint
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/angle.h b/synfig-core/trunk/src/synfig/angle.h
new file mode 100644 (file)
index 0000000..9cb64bb
--- /dev/null
@@ -0,0 +1,48 @@
+/* === S I N F G =========================================================== */
+/*!    \file angle.h
+**     \brief Template Header
+**
+**     $Id: angle.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_ANGLE_H
+#define __SINFG_ANGLE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/angle>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \typedef Angle
+**     \todo writeme
+*/
+typedef etl::angle Angle;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/blinepoint.cpp b/synfig-core/trunk/src/synfig/blinepoint.cpp
new file mode 100644 (file)
index 0000000..71cd2e2
--- /dev/null
@@ -0,0 +1,62 @@
+/* === S I N F G =========================================================== */
+/*!    \file blinepoint.cpp
+**     \brief Template File
+**
+**     $Id: blinepoint.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "blinepoint.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+void
+sinfg::BLinePoint::reverse()
+{
+       if(split_tangent_)
+       {
+               std::swap(tangent_[0],tangent_[1]);
+               tangent_[0]=-tangent_[0];
+               tangent_[1]=-tangent_[1];
+       }
+       else
+       {
+               tangent_[0]=-tangent_[0];
+               tangent_[1]=-tangent_[1];
+       }
+}
diff --git a/synfig-core/trunk/src/synfig/blinepoint.h b/synfig-core/trunk/src/synfig/blinepoint.h
new file mode 100644 (file)
index 0000000..a5302b3
--- /dev/null
@@ -0,0 +1,91 @@
+/* === S I N F G =========================================================== */
+/*!    \file blinepoint.h
+**     \brief Template Header
+**
+**     $Id: blinepoint.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_BLINEPOINT_H
+#define __SINFG_BLINEPOINT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "vector.h"
+#include "uniqueid.h"
+#include <algorithm>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class BLinePoint : public UniqueID
+{
+private:
+       Point   vertex_;
+       Vector  tangent_[2];
+       float   width_;
+       float   origin_;
+       bool    split_tangent_;
+
+public:
+
+       BLinePoint():
+               vertex_(Point(0,0)),
+               width_(0.01),
+               origin_(0.0),
+               split_tangent_(false)
+       { }
+
+       const Point& get_vertex()const { return vertex_; }
+       void set_vertex(const Point& x) { vertex_=x; }
+
+
+       const Vector& get_tangent1()const { return tangent_[0]; }
+       const Vector& get_tangent2()const { return split_tangent_?tangent_[1]:tangent_[0]; }
+       void set_tangent(const Vector& x) { tangent_[0]=tangent_[1]=x; }
+       void set_tangent1(const Vector& x) { tangent_[0]=x; }
+       void set_tangent2(const Vector& x) { tangent_[1]=x; }
+
+
+       const float& get_width()const { return width_; }
+       void set_width(float x) { width_=x; }
+
+       // We store the origin offset by 0.5 so that
+       // can have the origin set to the default by zeroing
+       // out the structure.
+       float get_origin()const { return origin_+0.5f; }
+       void set_origin(float x) { origin_=x-0.5f; }
+
+
+       const bool& get_split_tangent_flag()const { return split_tangent_; }
+       void set_split_tangent_flag(bool x=true) { split_tangent_=x; }
+
+       void reverse();
+       
+}; // END of class BLinePoint
+       
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/blur.cpp b/synfig-core/trunk/src/synfig/blur.cpp
new file mode 100644 (file)
index 0000000..3d22fc8
--- /dev/null
@@ -0,0 +1,1203 @@
+/* === S I N F G =========================================================== */
+/*!    \file blur.cpp
+**     \brief Blur Implementation File
+**
+**     $Id: blur.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include <sinfg/general.h>
+#include <sinfg/surface.h>
+
+#include "blur.h"
+
+#include <stdexcept>
+#include <ETL/stringf>
+
+#include <ETL/pen>
+#include <ETL/gaussian>
+#include <ETL/boxblur>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+Point Blur::operator ()(const Point &pos) const
+{      
+       Point blurpos(pos);
+       
+       switch(type)
+       {
+       case CROSS:
+               if(rand()%2)
+               {
+                       if(size[0])
+                               blurpos[0]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[0];
+               }
+               else
+               {
+                       if(size[1])
+                               blurpos[1]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[1];
+               }
+               break;
+
+       case DISC:
+               {
+                       Angle theta=Angle::rotations((float)rand()/(float)RAND_MAX);
+                       Vector::value_type mag=(float)rand()/(float)RAND_MAX;
+                       Vector vect((float)Angle::cos(theta).get()*mag,(float)Angle::sin(theta).get()*mag);
+
+                       blurpos[0]+=vect[0]*size[0];
+                       blurpos[1]+=vect[1]*size[1];
+               }
+               break;
+
+       case FASTGAUSSIAN:
+       case GAUSSIAN:
+               // Not quite a true gaussian blur,
+               // but the results are close enough for me.
+               if(size[0])
+               {
+                       blurpos[0]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[0]*3/4;
+                       blurpos[0]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[0]*3/4;
+               }
+               if(size[1])
+               {
+                       blurpos[1]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[1]*3/4;
+                       blurpos[1]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[1]*3/4;
+               }
+               break;
+
+       case BOX:
+       default:
+               if(size[0])
+                       blurpos[0]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[0];
+               if(size[1])
+                       blurpos[1]+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) * size[1];
+               break;
+       }
+       
+       return blurpos;
+}
+
+Point Blur::operator ()(sinfg::Real x, sinfg::Real y) const
+{
+       return (*this)(Point(x,y));
+}
+
+//blur functions to make my life easier
+
+template <typename T>
+static inline T zero()
+{
+       return (T)0;
+}
+
+template <>
+static inline Color zero<Color>()
+{
+       return Color::alpha();
+}
+
+template <typename T,typename AT,class VP>
+static void GuassianBlur_2x2(etl::surface<T,AT,VP> &surface)
+{
+       int x,y;
+       T Tmp1,Tmp2,SR0;
+
+       T *SC0=new T[surface.get_w()];
+
+       memcpy(SC0,surface[0],surface.get_w()*sizeof(T));
+
+       for(y=0;y<surface.get_h();y++)
+       {
+               SR0=surface[y][0];
+               for(x=0;x<surface.get_w();x++)
+               {
+                       Tmp1=surface[y][x];
+                       Tmp2=SR0+Tmp1;
+                       SR0=Tmp1;
+                       surface[y][x]=(SC0[x]+Tmp2)/4;
+                       SC0[x]=Tmp2;                    
+               }
+       }
+       delete [] SC0;
+}
+
+template <typename T,typename AT,class VP>
+static void GuassianBlur_3x3(etl::surface<T,AT,VP> &surface)
+{
+       int x,y,u,v,w,h;
+       T Tmp1,Tmp2,SR0,SR1;
+
+       w=surface.get_w();
+       h=surface.get_h();
+
+       T *SC0=new T[w+1];
+       T *SC1=new T[w+1];
+
+       // Setup the row bufers
+       for(x=0;x<w;x++)SC0[x]=surface[0][x]*4;
+//     memcpy(SC1,surface[0],w*sizeof(T));
+
+       for(y=0;y<=h;y++)
+       {
+               if(y>=h)
+                       v=h-1;
+               else
+                       v=y;
+
+               SR0=SR1=surface[y][0];
+               for(x=0;x<=w;x++)
+               {
+                       if(x>=w)
+                               u=w-1;
+                       else
+                               u=x;
+
+                       // Row Machine
+                       Tmp1=surface[v][u];
+                       Tmp2=SR0+Tmp1;
+                       SR0=Tmp1;
+                       Tmp1=SR1+Tmp2;
+                       SR1=Tmp2;
+                       
+                       // Column Machine
+                       Tmp2=SC0[x]+Tmp1;
+                       SC0[x]=Tmp1;
+                       if(y&&x)
+                               surface[y-1][x-1]=(SC1[x]+Tmp2)/16;
+                       SC1[x]=Tmp2;
+               }               
+       }
+
+       delete [] SC0;
+       delete [] SC1;
+}
+
+template <typename T,typename AT,class VP>
+inline static void GaussianBlur_5x5_(etl::surface<T,AT,VP> &surface,T *SC0,T *SC1,T *SC2,T *SC3)
+{
+       int x,y,u,v,w,h;
+       T Tmp1,Tmp2,SR0,SR1,SR2,SR3;
+
+       w=surface.get_w();
+       h=surface.get_h();
+
+       // Setup the row bufers
+       for(x=0;x<w;x++)SC0[x+2]=surface[0][x]*24;
+//     memset(SC0,0,(w+2)*sizeof(T));
+       memset(SC1,0,(w+2)*sizeof(T));
+       memset(SC2,0,(w+2)*sizeof(T));
+       memset(SC3,0,(w+2)*sizeof(T));
+
+       for(y=0;y<h+2;y++)
+       {
+               if(y>=h)
+                       v=h-1;
+               else
+                       v=y;
+
+               SR0=SR1=SR2=SR3=0;
+               SR0=surface[v][0]*1.5;
+               for(x=0;x<w+2;x++)
+               {
+                       if(x>=w)
+                               u=w-1;
+                       else
+                               u=x;
+
+                       // Row Machine
+                       Tmp1=surface[v][u];
+                       Tmp2=SR0+Tmp1;
+                       SR0=Tmp1;
+                       Tmp1=SR1+Tmp2;
+                       SR1=Tmp2;
+                       Tmp2=SR2+Tmp1;
+                       SR2=Tmp1;
+                       Tmp1=SR3+Tmp2;
+                       SR3=Tmp2;
+
+                       // Column Machine
+                       Tmp2=SC0[x]+Tmp1;
+                       SC0[x]=Tmp1;
+                       Tmp1=SC1[x]+Tmp2;
+                       SC1[x]=Tmp2;
+                       Tmp2=SC2[x]+Tmp1;
+                       SC2[x]=Tmp1;
+                       if(y>1&&x>1)
+                               surface[y-2][x-2]=(SC3[x]+Tmp2)/256;
+                       SC3[x]=Tmp2;
+               }
+       }
+
+}
+
+template <typename T,typename AT,class VP>
+inline static void GaussianBlur_5x5(etl::surface<T,AT,VP> &surface)
+{
+       int w=surface.get_w();
+
+       T *SC0=new T[w+2];
+       T *SC1=new T[w+2];
+       T *SC2=new T[w+2];
+       T *SC3=new T[w+2];
+
+       GaussianBlur_5x5_(surface,SC0,SC1,SC2,SC3);
+
+       delete [] SC0;
+       delete [] SC1;
+       delete [] SC2;
+       delete [] SC3;
+}
+
+template <typename T,typename AT,class VP>
+static void GuassianBlur_nxn(etl::surface<T,AT,VP> &surface,int n)
+{
+       int x,y,u,v,w,h;
+       int half_n=n/2,i;
+       T inv_divisor=pow(2.0,(n-1));
+       T Tmp1,Tmp2;
+       inv_divisor=1.0/(inv_divisor*inv_divisor);
+
+       w=surface.get_w();
+       h=surface.get_h();
+
+    T SR[n-1];
+       T *SC[n-1];
+       
+       for(i=0;i<n-1;i++)
+       {
+               SC[i]=new T[w+half_n];
+               if(!SC[i])
+               {
+                       throw(runtime_error(strprintf(__FILE__":%d:Malloc failure",__LINE__)));
+                       return;
+               }
+               memset(SC[i],0,(w+half_n)*sizeof(T));
+       }
+
+       // Setup the first row
+//     for(x=0;x<w;x++)SC[0][x+half_n]=surface[0][x]*550.0;//*pow(2.0,(n-1))*(2.0/n);
+
+       for(y=0;y<h+half_n;y++)
+       {
+               if(y>=h)
+                       v=h-1;
+               else
+                       v=y;
+
+               memset(SR,0,(n-1)*sizeof(T));
+
+//             SR[0]=surface[v][0]*(2.0-1.9/n);
+
+               for(x=0;x<w+half_n;x++)
+               {
+                       if(x>=w)
+                               u=w-1;
+                       else
+                               u=x;
+
+                       Tmp1=surface[v][u];
+                       // Row Machine
+                       for(i=0;i<half_n;i++)
+                       {
+                               Tmp2=SR[i*2]+Tmp1;
+                               SR[i*2]=Tmp1;
+                               Tmp1=SR[i*2+1]+Tmp2;
+                               SR[i*2+1]=Tmp2;
+                       }
+
+                       // Column Machine
+                       for(i=0;i<half_n-1;i++)
+                       {
+                               Tmp2=SC[i*2][x]+Tmp1;
+                               SC[i*2][x]=Tmp1;
+                               Tmp1=SC[i*2+1][x]+Tmp2;
+                               SC[i*2+1][x]=Tmp2;
+                       }
+                       Tmp2=SC[n-3][x]+Tmp1;
+                       SC[n-3][x]=Tmp1;
+                       if(y>=half_n&&x>=half_n)
+                               surface[y-half_n][x-half_n]=(SC[n-2][x]+Tmp2)*inv_divisor;
+                       SC[n-2][x]=Tmp2;
+               }
+       }
+
+       for(i=0;i<n-1;i++)
+               delete [] SC[i];
+}
+
+template <typename T,typename AT,class VP>
+static void GuassianBlur_2x1(etl::surface<T,AT,VP> &surface)
+{
+       int x,y;
+       AT Tmp1,Tmp2,SR0;
+
+       for(y=0;y<surface.get_h();y++)
+       {
+               SR0=surface[y][0];
+               for(x=0;x<surface.get_w();x++)
+               {
+                       Tmp1=surface[y][x];
+                       Tmp2=SR0+Tmp1;
+                       SR0=Tmp1;
+                       surface[y][x]=(Tmp2)/2;
+               }
+       }
+}
+
+template <typename T,typename AT,class VP>
+static void GuassianBlur_3x1(etl::surface<T,AT,VP> &surface)
+{
+       int x,y;
+       AT Tmp1,Tmp2,SR0,SR1;
+
+       for(y=0;y<surface.get_h();y++)
+       {
+               SR0=SR1=surface[y][0];
+               for(x=0;x<surface.get_w();x++)
+               {
+                       // Row Machine
+                       Tmp1=surface[y][x];
+                       Tmp2=SR0+Tmp1;
+                       SR0=Tmp1;
+                       Tmp1=SR1+Tmp2;
+                       SR1=Tmp2;
+
+                       if(x)
+                               surface[y][x-1]=(Tmp1)/4;
+               }
+       }
+}
+
+template <typename T,typename AT,class VP>
+static void GuassianBlur_1x2(etl::surface<T,AT,VP> &surface)
+{
+       int x,y;
+       AT Tmp1,Tmp2,SR0;
+
+       for(x=0;x<surface.get_w();x++)
+       {
+               SR0 = zero<T>();
+               for(y=0;y<surface.get_h();y++)
+               {
+                       Tmp1=surface[y][x];
+                       Tmp2=SR0+Tmp1;
+                       SR0=Tmp1;
+                       surface[y][x]=(Tmp2)/2;
+               }
+       }
+}
+
+template <typename T,typename AT,class VP>
+static void GuassianBlur_1x3(etl::surface<T,AT,VP> &surface)
+{
+       int x,y;
+       AT Tmp1,Tmp2,SR0,SR1;
+
+       for(x=0;x<surface.get_w();x++)
+       {
+               SR0=SR1=surface[0][x];
+               for(y=0;y<surface.get_h();y++)
+               {
+                       // Row Machine
+                       Tmp1=surface[y][x];
+                       Tmp2=SR0+Tmp1;
+                       SR0=Tmp1;
+                       Tmp1=SR1+Tmp2;
+                       SR1=Tmp2;
+
+                       if(y)
+                               surface[y-1][x]=(Tmp1)/4;
+               }
+       }
+}
+
+//THE GOOD ONE!!!!!!!!!
+bool Blur::operator ()(const Surface &surface, 
+                                               const Vector &resolution, 
+                                               Surface &out) const
+{
+       int w = surface.get_w(),
+               h = surface.get_h();
+       
+       if(w == 0 || h == 0 || resolution[0] == 0 || resolution[1] == 0) return false;
+       
+       const Real      pw = resolution[0]/w,
+                               ph = resolution[1]/h;
+       
+       int     halfsizex = (int) (abs(size[0]*.5/pw) + 1),
+               halfsizey = (int) (abs(size[1]*.5/ph) + 1);     
+       
+       int x,y;
+       
+       SuperCallback blurcall(cb,0,5000,5000);
+       
+       Surface worksurface(w,h);
+       
+       //sinfg::info("Blur: check surface = %s", surface_valid(surface)?"true":"false");
+       
+       // Premultiply the alpha
+       for(y=0;y<h;y++)
+       {
+               for(x=0;x<w;x++)
+               {
+                       Color a = surface[y][x];
+                       a.set_r(a.get_r()*a.get_a());
+                       a.set_g(a.get_g()*a.get_a());
+                       a.set_b(a.get_b()*a.get_a());
+                       worksurface[y][x] = a;
+               }
+       }
+       
+       switch(type)
+       {
+       case Blur::DISC:        // D I S C ----------------------------------------------------------
+               {                       
+                       int bw = halfsizex;
+                       int bh = halfsizey;
+                       
+                       if(size[0] && size[1] && w*h>2)
+                       {
+                               int x2,y2;
+                               Surface tmp_surface(worksurface);
+                               
+                               for(y=0;y<h;y++)
+                               {
+                                       for(x=0;x<w;x++)
+                                       {
+                                               //accumulate all the pixels in an ellipse of w,h about the current pixel
+                                               Color color=Color::alpha();
+                                               int total=0;
+                                               
+                                               for(y2=-bh;y2<=bh;y2++)
+                                               {
+                                                       for(x2=-bw;x2<=bw;x2++)
+                                                       {
+                                                               //get the floating point distance away from the origin pixel in relative coords
+                                                               float tmp_x=(float)x2/bw;
+                                                               float tmp_y=(float)y2/bh;
+                                                               tmp_x*=tmp_x;
+                                                               tmp_y*=tmp_y;
+                                                               
+                                                               //ignore if it's outside of the disc
+                                                               if( tmp_x+tmp_y>1.0)
+                                                                       continue;
+                                                               
+                                                               //cap the pixel indices to inside the surface
+                                                               int u= x+x2,
+                                                                       v= y+y2;
+                                                               
+                                                               if( u < 0 )                                     u = 0;
+                                                               if( u >= w ) u = w-1;
+                                                                       
+                                                               if( v < 0 )                             v = 0;
+                                                               if( v >= h ) v = h-1;
+                                                                       
+                                                               //accumulate the color, and # of pixels added in
+                                                               color += tmp_surface[v][u];
+                                                               total++;
+                                                       }
+                                               }
+                                               
+                                               //blend the color with the original color
+                                               //if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+                                                       worksurface[y][x]=color/total;
+                                               //else
+                                               //      worksurface[y][x]=Color::blend(color/total,tmp_surface[y][x],get_amount(),get_blend_method());
+                                       }
+                                       if(!blurcall.amount_complete(y,h))
+                                       {
+                                               //if(cb)cb->error(strprintf(__FILE__"%d: Accelerated Renderer Failure",__LINE__));
+                                               return false;
+                                       }
+                               }
+                               break;
+                       }
+                       
+                       //if we don't qualify for disc blur just use box blur
+               }
+
+       case Blur::BOX: // B O X -------------------------------------------------------
+               {
+                       //horizontal part
+                       //sinfg::info("Blur: Starting Box blur (surface valid %d)", (int)surface_valid(worksurface));
+                       
+                       Surface temp_surface;
+                       temp_surface.set_wh(w,h);
+                       
+                       if(size[0])
+                       {
+                               int length = halfsizex;
+                               length=std::max(1,length);
+                               
+                               //sinfg::info("Blur: hbox blur work -> temp %d", length);
+                               etl::hbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface.begin());
+                       }
+                       else temp_surface = worksurface;
+                       //sinfg::info("Blur: hbox finished");
+                       
+                       //vertical part
+                       //Surface temp_surface2;
+                       //temp_surface2.set_wh(w,h);
+                                               
+                       if(size[1])
+                       {
+                               int length = halfsizey;
+                               length = std::max(1,length);
+                               
+                               //sinfg::info("Blur: vbox blur temp -> work %d",length);
+                               etl::vbox_blur(temp_surface.begin(),temp_surface.end(),length,worksurface.begin());
+                       }
+                       else worksurface = temp_surface;
+                       //sinfg::info("Blur: vbox finished");
+                       
+                       //blend with the original surface
+                       /*int x,y;
+                       for(y=0;y<h;y++)
+                       {
+                               for(x=0;x<w;x++)
+                               {
+                                       worksurface[y][x]=temp_surface2[y][x];//Color::blend(temp_surface2[y][x],worksurface[y][x],get_amount(),get_blend_method());
+                               }
+                       }*/
+               }
+               break;
+
+       case Blur::FASTGAUSSIAN:        // F A S T G A U S S I A N ----------------------------------------------
+               {               
+                       //fast gaussian is treated as a 3x3 type of thing, except expanded to work with the length
+                       
+                       /*      1       2       1
+                               2       4       2
+                               1       2       1
+                       */
+                       
+                       Surface temp_surface;
+                       temp_surface.set_wh(w,h);
+                       
+                       //Surface temp_surface2;
+                       //temp_surface2.set_wh(w,h);
+                       
+                       //horizontal part
+                       if(size[0])
+                       {
+                               int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1);
+                               length=std::max(1,length);
+                               
+                               //two box blurs produces: 1 2 1
+                               etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
+                               etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
+                       }
+                       //else temp_surface2=worksurface;
+                       
+                       //vertical part
+                       if(size[1])
+                       {
+                               int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1);
+                               length=std::max(1,length);
+                               
+                               //two box blurs produces: 1 2 1 on the horizontal 1 2 1
+                               etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
+                               etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
+                       }
+                       //else temp_surface2=temp_surface2;
+       
+                       /*int x,y;
+                       for(y=0;y<h;y++)
+                       {
+                               for(x=0;x<w;x++)
+                               {
+                                       worksurface[y][x]=temp_surface2[y][x];//Color::blend(temp_surface2[y][x],worksurface[y][x],get_amount(),get_blend_method());
+                               }
+                       }*/
+               }
+               break;
+
+       case Blur::CROSS: // C R O S S  -------------------------------------------------------
+               {
+                       //horizontal part
+                       Surface temp_surface;
+                       temp_surface.set_wh(worksurface.get_w(),worksurface.get_h());
+                       
+                       if(size[0])
+                       {
+                               int length = halfsizex;
+                               length = std::max(1,length);
+                               
+                               etl::hbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface.begin());
+                       }
+                       else temp_surface = worksurface;
+                               
+                       //vertical part
+                       Surface temp_surface2;
+                       temp_surface2.set_wh(worksurface.get_w(),worksurface.get_h());
+                       
+                       if(size[1])
+                       {
+                               int length = halfsizey;
+                               length = std::max(1,length);
+                               
+                               etl::vbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface2.begin());
+                       }
+                       else temp_surface2 = worksurface;
+       
+                       //blend the two together
+                       int x,y;
+
+                       for(y=0;y<h;y++)
+                       {
+                               for(x=0;x<w;x++)
+                               {
+                                       worksurface[y][x] = (temp_surface[y][x]+temp_surface2[y][x])/2;//Color::blend((temp_surface[y][x]+temp_surface2[y][x])/2,worksurface[y][x],get_amount(),get_blend_method());
+                               }
+                       }
+
+                       break;
+               }
+
+       case Blur::GAUSSIAN:    // G A U S S I A N ----------------------------------------------
+               {
+                       #ifndef GAUSSIAN_ADJUSTMENT
+                       #define GAUSSIAN_ADJUSTMENT             (0.05)
+                       #endif
+
+                       Real    pw = (Real)w/(resolution[0]);
+                       Real    ph = (Real)h/(resolution[1]);
+                       
+                       Surface temp_surface;
+                       Surface *gauss_surface;
+                       
+                       //sinfg::warning("Didn't crash yet b1");
+                       
+                       //if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+                               gauss_surface = &worksurface;
+                       /*else
+                       {
+                               temp_surface = worksurface;
+                               gauss_surface = &temp_surface;
+                       }*/
+
+            /* Squaring the pw and ph values
+                          is necessary to insure consistant
+                          results when rendered to different
+                          resolutions.
+                          Unfortunately, this automaticly
+                          squares our rendertime.
+                          There has got to be a faster way...
+                       */
+                       pw=pw*pw;
+                       ph=ph*ph;
+
+                       int bw = (int)(abs(pw)*size[0]*GAUSSIAN_ADJUSTMENT+0.5);
+                       int bh = (int)(abs(ph)*size[1]*GAUSSIAN_ADJUSTMENT+0.5);
+                       int max=bw+bh;
+
+                       Color *SC0=new class Color[w+2];
+                       Color *SC1=new class Color[w+2];
+                       Color *SC2=new class Color[w+2];
+                       Color *SC3=new class Color[w+2];
+                       memset(SC0,0,(w+2)*sizeof(Color));
+                       memset(SC0,0,(w+2)*sizeof(Color));
+                       memset(SC0,0,(w+2)*sizeof(Color));
+                       memset(SC0,0,(w+2)*sizeof(Color));
+
+                       //sinfg::warning("Didn't crash yet b2");
+                       //int i = 0;
+                       
+                       while(bw&&bh)
+                       {
+                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
+
+                               if(bw>=4 && bh>=4)
+                               {
+                                       etl::gaussian_blur_5x5_(gauss_surface->begin(),gauss_surface->get_w(),gauss_surface->get_h(),SC0,SC1,SC2,SC3);
+                                       bw-=4,bh-=4;
+                               }
+                               else
+                               if(bw>=2 && bh>=2)
+                               {
+                                       etl::gaussian_blur_3x3(gauss_surface->begin(),gauss_surface->end());
+                                       bw-=2,bh-=2;
+                               }
+                               else
+                               if(bw>=1 && bh>=1)
+                               {
+                                       GuassianBlur_2x2(*gauss_surface);
+                                       bw--,bh--;
+                               }
+                               
+                               //sinfg::warning("Didn't crash yet bi - %d",i++);
+                       }
+                       while(bw)
+                       {
+                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
+                               if(bw>=2)
+                               {
+                                       GuassianBlur_3x1(*gauss_surface);
+                                       bw-=2;
+                               }
+                               else
+                               if(bw>=1)
+                               {
+                                       GuassianBlur_2x1(*gauss_surface);
+                                       bw--;
+                               }
+                               //sinfg::warning("Didn't crash yet bi - %d",i++);
+                       }
+                       while(bh)
+                       {
+                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
+                               if(bh>=2)
+                               {
+                                       GuassianBlur_1x3(*gauss_surface);
+                                       bh-=2;
+                               }
+                               else
+                               if(bh>=1)
+                               {
+                                       GuassianBlur_1x2(*gauss_surface);
+                                       bh--;
+                               }
+                               //sinfg::warning("Didn't crash yet bi - %d",i++);
+                       }
+
+                       delete [] SC0;
+                       delete [] SC1;
+                       delete [] SC2;
+                       delete [] SC3;
+
+                       /*if(get_amount()!=1.0 || get_blend_method()!=Color::BLEND_STRAIGHT)
+                       {
+                               int x,y;
+                               for(y=0;y<renddesc.get_h();y++)
+                                       for(x=0;x<renddesc.get_w();x++)
+                                               worksurface[y][x]=Color::blend(temp_surface[y][x],worksurface[y][x],get_amount(),get_blend_method());
+                       }*/
+                       //sinfg::warning("Didn't crash yet b end",i++);
+               }
+               break;
+
+               default:
+               break;
+       }
+
+       // Scale up the alpha
+       
+       //be sure the surface is of the correct size
+       //surface->set_wh(renddesc.get_w(),renddesc.get_h());
+       out.set_wh(w,h);
+       
+       //divide out the alpha
+       for(y=0;y<h;y++)
+       {
+               for(x=0;x<w;x++)
+               {
+                       Color a = worksurface[y][x];
+                       if(a.get_a())
+                       {
+                               a.set_r(a.get_r()/a.get_a());
+                               a.set_g(a.get_g()/a.get_a());
+                               a.set_b(a.get_b()/a.get_a());
+                               out[y][x]=a;
+                       }
+                       else out[y][x]=Color::alpha();
+               }
+       }
+       
+       //we are FRIGGGIN done....
+       blurcall.amount_complete(100,100);
+       
+       return true;
+}
+
+bool Blur::operator ()(const surface<float> &surface, 
+                                               const Vector &resolution, 
+                                               surface<float> &out) const
+{
+       int w = surface.get_w(),
+               h = surface.get_h();
+       
+       if(w == 0 || h == 0 || resolution[0] == 0 || resolution[1] == 0) return false;
+       
+       const Real      pw = resolution[0]/w,
+                               ph = resolution[1]/h;
+       
+       int     halfsizex = (int) (abs(size[0]*.5/pw) + 1),
+               halfsizey = (int) (abs(size[1]*.5/ph) + 1);     
+       int x,y;
+       
+       SuperCallback blurcall(cb,0,5000,5000);
+       
+       etl::surface<float> worksurface(surface);
+       
+       //don't need to premultiply because we are dealing with ONLY alpha
+               
+       switch(type)
+       {
+       case Blur::DISC:        // D I S C ----------------------------------------------------------
+               {                       
+                       int bw = halfsizex;
+                       int bh = halfsizey;
+                       
+                       if(size[0] && size[1] && w*h>2)
+                       {
+                               int x2,y2;
+                               etl::surface<float> tmp_surface(worksurface);
+                               
+                               for(y=0;y<h;y++)
+                               {
+                                       for(x=0;x<w;x++)
+                                       {
+                                               //accumulate all the pixels in an ellipse of w,h about the current pixel
+                                               float a = 0;
+                                               int total=0;
+                                               
+                                               for(y2=-bh;y2<=bh;y2++)
+                                               {
+                                                       for(x2=-bw;x2<=bw;x2++)
+                                                       {
+                                                               //get the floating point distance away from the origin pixel in relative coords
+                                                               float tmp_x=(float)x2/bw;
+                                                               float tmp_y=(float)y2/bh;
+                                                               tmp_x*=tmp_x;
+                                                               tmp_y*=tmp_y;
+                                                               
+                                                               //ignore if it's outside of the disc
+                                                               if( tmp_x+tmp_y>1.0)
+                                                                       continue;
+                                                               
+                                                               //cap the pixel indices to inside the surface
+                                                               int u= x+x2,
+                                                                       v= y+y2;
+                                                               
+                                                               if( u < 0 )                                     u = 0;
+                                                               if( u >= w ) u = w-1;
+                                                                       
+                                                               if( v < 0 )                             v = 0;
+                                                               if( v >= h ) v = h-1;
+                                                                       
+                                                               //accumulate the color, and # of pixels added in
+                                                               a += tmp_surface[v][u];
+                                                               total++;
+                                                       }
+                                               }
+                                               
+                                               //blend the color with the original color
+                                               //if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+                                                       worksurface[y][x]=a/total;
+                                               //else
+                                               //      worksurface[y][x]=Color::blend(color/total,tmp_surface[y][x],get_amount(),get_blend_method());
+                                       }
+                                       if(!blurcall.amount_complete(y,h))
+                                       {
+                                               //if(cb)cb->error(strprintf(__FILE__"%d: Accelerated Renderer Failure",__LINE__));
+                                               return false;
+                                       }
+                               }
+                               break;
+                       }
+                       
+                       //if we don't qualify for disc blur just use box blur
+               }
+
+       case Blur::BOX: // B O X -------------------------------------------------------
+               {
+                       //horizontal part
+                       etl::surface<float> temp_surface;
+                       temp_surface.set_wh(w,h);
+                       
+                       if(size[0])
+                       {
+                               int length = halfsizex;
+                               length=std::max(1,length);
+                               
+                               etl::hbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface.begin());
+                       }
+                       else temp_surface = worksurface;
+                       
+                       //vertical part
+                       //etl::surface<float> temp_surface2;
+                       //temp_surface2.set_wh(w,h);
+                       
+                       if(size[1])
+                       {
+                               int length = halfsizey;
+                               length = std::max(1,length);
+                               etl::vbox_blur(temp_surface.begin(),temp_surface.end(),length,worksurface.begin());
+                       }
+                       else worksurface = temp_surface;
+                       
+                       //blend with the original surface
+                       /*int x,y;
+                       for(y=0;y<h;y++)
+                       {
+                               for(x=0;x<w;x++)
+                               {
+                                       worksurface[y][x]=temp_surface2[y][x];//Color::blend(temp_surface2[y][x],worksurface[y][x],get_amount(),get_blend_method());
+                               }
+                       }*/
+               }
+               break;
+
+       case Blur::FASTGAUSSIAN:        // F A S T G A U S S I A N ----------------------------------------------
+               {               
+                       //fast gaussian is treated as a 3x3 type of thing, except expanded to work with the length
+                       
+                       /*      1       2       1
+                               2       4       2
+                               1       2       1
+                       */
+                       
+                       etl::surface<float> temp_surface;
+                       temp_surface.set_wh(w,h);
+                       
+                       //etl::surface<float> temp_surface2;
+                       //temp_surface2.set_wh(w,h);
+                       
+                       //horizontal part
+                       if(size[0])
+                       {
+                               int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1);
+                               length=std::max(1,length);
+                               
+                               //two box blurs produces: 1 2 1
+                               etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
+                               etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
+                       }
+                       //else temp_surface2=worksurface;
+                       
+                       //vertical part
+                       if(size[1])
+                       {
+                               int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1);
+                               length=std::max(1,length);
+                               
+                               //two box blurs produces: 1 2 1 on the horizontal 1 2 1
+                               etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
+                               etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
+                       }
+                       //else temp_surface2=temp_surface2;
+       
+                       /*int x,y;
+                       for(y=0;y<h;y++)
+                       {
+                               for(x=0;x<w;x++)
+                               {
+                                       worksurface[y][x]=temp_surface2[y][x];//Color::blend(temp_surface2[y][x],worksurface[y][x],get_amount(),get_blend_method());
+                               }
+                       }*/
+               }
+               break;
+
+       case Blur::CROSS: // C R O S S  -------------------------------------------------------
+               {
+                       //horizontal part
+                       etl::surface<float> temp_surface;
+                       temp_surface.set_wh(worksurface.get_w(),worksurface.get_h());
+                       
+                       if(size[0])
+                       {
+                               int length = halfsizex;
+                               length = std::max(1,length);
+                               
+                               etl::hbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface.begin());
+                       }
+                       else temp_surface = worksurface;
+                               
+                       //vertical part
+                       etl::surface<float> temp_surface2;
+                       temp_surface2.set_wh(worksurface.get_w(),worksurface.get_h());
+                       
+                       if(size[1])
+                       {
+                               int length = halfsizey;
+                               length = std::max(1,length);
+                               
+                               etl::vbox_blur(worksurface.begin(),worksurface.end(),length,temp_surface2.begin());
+                       }
+                       else temp_surface2 = worksurface;
+       
+                       //blend the two together
+                       int x,y;
+
+                       for(y=0;y<h;y++)
+                       {
+                               for(x=0;x<w;x++)
+                               {
+                                       worksurface[y][x] = (temp_surface[y][x]+temp_surface2[y][x])/2;//Color::blend((temp_surface[y][x]+temp_surface2[y][x])/2,worksurface[y][x],get_amount(),get_blend_method());
+                               }
+                       }
+
+                       break;
+               }
+
+       case Blur::GAUSSIAN:    // G A U S S I A N ----------------------------------------------
+               {
+                       #ifndef GAUSSIAN_ADJUSTMENT
+                       #define GAUSSIAN_ADJUSTMENT             (0.05)
+                       #endif
+
+                       Real    pw = (Real)w/(resolution[0]);
+                       Real    ph = (Real)h/(resolution[1]);
+                       
+                       //etl::surface<float> temp_surface;
+                       etl::surface<float> *gauss_surface;
+                       
+                       //if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+                               gauss_surface = &worksurface;
+                       /*else
+                       {
+                               temp_surface = worksurface;
+                               gauss_surface = &temp_surface;
+                       }*/
+
+            /* Squaring the pw and ph values
+                          is necessary to insure consistant
+                          results when rendered to different
+                          resolutions.
+                          Unfortunately, this automaticly
+                          squares our rendertime.
+                          There has got to be a faster way...
+                       */
+                       pw=pw*pw;
+                       ph=ph*ph;
+
+                       int bw = (int)(abs(pw)*size[0]*GAUSSIAN_ADJUSTMENT+0.5);
+                       int bh = (int)(abs(ph)*size[1]*GAUSSIAN_ADJUSTMENT+0.5);
+                       int max=bw+bh;
+
+                       float *SC0=new float[w+2];
+                       float *SC1=new float[w+2];
+                       float *SC2=new float[w+2];
+                       float *SC3=new float[w+2];
+                       
+                       memset(SC0,0,(w+2)*sizeof(float));
+                       memset(SC0,0,(w+2)*sizeof(float));
+                       memset(SC0,0,(w+2)*sizeof(float));
+                       memset(SC0,0,(w+2)*sizeof(float));
+
+                       //int i = 0;
+                       
+                       while(bw&&bh)
+                       {                               
+                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
+
+                               if(bw>=4 && bh>=4)
+                               {
+                                       etl::gaussian_blur_5x5_(gauss_surface->begin(),gauss_surface->get_w(),gauss_surface->get_h(),SC0,SC1,SC2,SC3);
+                                       bw-=4,bh-=4;
+                               }
+                               else
+                               if(bw>=2 && bh>=2)
+                               {
+                                       etl::gaussian_blur_3x3(gauss_surface->begin(),gauss_surface->end());
+                                       bw-=2,bh-=2;
+                               }
+                               else
+                               if(bw>=1 && bh>=1)
+                               {
+                                       GuassianBlur_2x2(*gauss_surface);
+                                       bw--,bh--;
+                               }
+                       }
+                       
+                       while(bw)
+                       {
+                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
+                               if(bw>=2)
+                               {
+                                       GuassianBlur_3x1(*gauss_surface);
+                                       bw-=2;
+                               }
+                               else
+                               if(bw>=1)
+                               {
+                                       GuassianBlur_2x1(*gauss_surface);
+                                       bw--;
+                               }
+                       }
+                       
+                       while(bh)
+                       {
+                               if(!blurcall.amount_complete(max-(bw+bh),max))return false;
+                               if(bh>=2)
+                               {
+                                       GuassianBlur_1x3(*gauss_surface);
+                                       bh-=2;
+                               }
+                               else
+                               if(bh>=1)
+                               {
+                                       GuassianBlur_1x2(*gauss_surface);
+                                       bh--;
+                               }
+                       }
+
+                       delete [] SC0;
+                       delete [] SC1;
+                       delete [] SC2;
+                       delete [] SC3;
+
+                       /*if(get_amount()!=1.0 || get_blend_method()!=Color::BLEND_STRAIGHT)
+                       {
+                               int x,y;
+                               for(y=0;y<renddesc.get_h();y++)
+                                       for(x=0;x<renddesc.get_w();x++)
+                                               worksurface[y][x]=Color::blend(temp_surface[y][x],worksurface[y][x],get_amount(),get_blend_method());
+                       }*/
+               }
+               break;
+
+               default:
+               break;
+       }
+       
+       //be sure the surface is of the correct size
+       //surface->set_wh(renddesc.get_w(),renddesc.get_h());
+       out.set_wh(w,h);
+       
+       //divide out the alpha - don't need to cause we rock
+       out = worksurface;
+       
+       //we are FRIGGGIN done....
+       blurcall.amount_complete(100,100);
+       
+       return true;
+}
+
+/* === E N T R Y P O I N T ================================================= */
diff --git a/synfig-core/trunk/src/synfig/blur.h b/synfig-core/trunk/src/synfig/blur.h
new file mode 100644 (file)
index 0000000..e8c9dbd
--- /dev/null
@@ -0,0 +1,87 @@
+/* === S I N F G =========================================================== */
+/*!    \file blur.h
+**     \brief Blur Helper Header file
+**
+**     $Id: blur.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_BLUR_HELPER_H
+#define __SINFG_BLUR_HELPER_H
+
+/* === H E A D E R S ======================================================= */
+#include <sinfg/surface.h>
+#include <sinfg/color.h>
+#include <sinfg/vector.h>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+class sinfg::ProgressCallback;
+       
+class Blur
+{
+public:
+       enum Type
+       {
+               BOX                             =0,
+               FASTGAUSSIAN    =1,
+               CROSS                   =2,
+               GAUSSIAN                =3,
+               DISC                    =4,
+               
+               FORCE_DWORD = 0x8fffffff
+       };
+
+private:
+       sinfg::Point    size;
+       int                             type;
+
+       sinfg::ProgressCallback *cb;
+
+public:
+       sinfg::Point & set_size(const sinfg::Point &v) { return (size = v); }
+       const sinfg::Point & get_size() const { return size; }
+       sinfg::Point & get_size() { return size; }
+       
+       int & set_type(const int &t) { return (type = t); }
+       const int & get_type() const { return type; }
+       int & get_type() { return type; }
+       
+       Blur() {}
+       Blur(const sinfg::Point &s, int t, sinfg::ProgressCallback *callb=0):size(s), type(t), cb(callb) {}
+       Blur(sinfg::Real sx, sinfg::Real sy, int t, sinfg::ProgressCallback *callb = 0): size(sx,sy), type(t), cb(callb) {}
+       
+       //Parametric Blur
+       sinfg::Point operator ()(const sinfg::Point &p) const;
+       sinfg::Point operator ()(sinfg::Real x, sinfg::Real y) const;
+       
+       //Surface based blur
+       //      input surface can be the same as output surface,
+       //      though both have to be the same size
+       bool operator ()(const sinfg::Surface &surface, const sinfg::Vector &resolution, sinfg::Surface &out) const;
+               
+       bool operator ()(const etl::surface<float> &surface, const sinfg::Vector &resolution, etl::surface<float> &out) const;
+       //bool operator ()(const etl::surface<unsigned char> &surface, const sinfg::Vector &resolution, etl::surface<unsigned char> &out) const;
+};
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/canvas.cpp b/synfig-core/trunk/src/synfig/canvas.cpp
new file mode 100644 (file)
index 0000000..3d3e87a
--- /dev/null
@@ -0,0 +1,1200 @@
+/* === S I N F G =========================================================== */
+/*!    \file canvas.cpp
+**     \brief Canvas Class Member Definitions
+**
+**     $Id: canvas.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "layer.h"
+#include "canvas.h"
+#include <cassert>
+#include "exception.h"
+#include "time.h"
+#include "context.h"
+#include "layer_pastecanvas.h"
+#include <sigc++/bind.h>
+
+#endif
+
+using namespace sinfg;
+using namespace etl;
+using namespace std;
+
+namespace sinfg { extern Canvas::Handle open_canvas(const String &filename); };
+
+/* === M A C R O S ========================================================= */
+
+struct _CanvasCounter
+{
+       static int counter;
+       ~_CanvasCounter()
+       {
+               if(counter)
+                       sinfg::error("%d canvases not yet deleted!",counter);
+       }
+} _canvas_counter;
+
+int _CanvasCounter::counter(0);
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Canvas::Canvas(const string &id):
+       id_                     (id),
+       cur_time_       (0),
+       is_inline_      (false),
+       is_dirty_       (true),
+       op_flag_        (false)
+{
+       _CanvasCounter::counter++;
+       clear();
+}
+
+void
+Canvas::on_changed()
+{
+       is_dirty_=true;
+       Node::on_changed();
+}
+
+Canvas::~Canvas()
+{
+       //if(is_inline() && parent_) assert(0);
+       _CanvasCounter::counter--;
+       //DEBUGPOINT();
+       clear();
+       begin_delete();
+}
+
+Canvas::iterator
+Canvas::end()
+{
+       return CanvasBase::end()-1;
+}
+
+Canvas::const_iterator
+Canvas::end()const
+{
+       return CanvasBase::end()-1;
+}
+
+Canvas::reverse_iterator
+Canvas::rbegin()
+{
+       return CanvasBase::rbegin()+1;
+}
+
+Canvas::const_reverse_iterator
+Canvas::rbegin()const
+{
+       return CanvasBase::rbegin()+1;
+}
+
+int
+Canvas::size()const
+{
+       return CanvasBase::size()-1;
+}
+
+void
+Canvas::clear()
+{
+       while(!empty())
+       {
+               Layer::Handle layer(front());
+               //if(layer->count()>2)sinfg::info("before layer->count()=%d",layer->count());
+                               
+               erase(begin());
+               //if(layer->count()>1)sinfg::info("after layer->count()=%d",layer->count());
+       }
+       //CanvasBase::clear();
+
+       // We need to keep a blank handle at the
+       // end of the image list, and acts at
+       // the bottom. Without it, the layers
+       // would just continue going when polled
+       // for a color.
+       CanvasBase::push_back(Layer::Handle());
+       
+       changed();
+}
+
+bool
+Canvas::empty()const
+{
+       return CanvasBase::size()<=1;
+}
+
+Layer::Handle &
+Canvas::back()
+{
+       return *(CanvasBase::end()-1);
+}
+
+const Layer::Handle &
+Canvas::back()const
+{
+       return *(CanvasBase::end()-1);
+}
+
+Context
+Canvas::get_context()const
+{
+       return begin();
+}
+
+const ValueNodeList &
+Canvas::value_node_list()const
+{
+       if(is_inline() && parent_)
+               return parent_->value_node_list();
+       return value_node_list_;
+}
+
+KeyframeList &
+Canvas::keyframe_list()
+{
+       if(is_inline() && parent_)
+               return parent_->keyframe_list();
+       return keyframe_list_;
+}
+
+const KeyframeList &
+Canvas::keyframe_list()const
+{
+       if(is_inline() && parent_)
+               return parent_->keyframe_list();
+       return keyframe_list_;
+}
+
+etl::handle<Layer>
+Canvas::find_layer(const Point &pos)
+{
+       return get_context().hit_check(pos);
+}
+
+static bool
+valid_id(const String &x)
+{
+       static const char bad_chars[]=" :#@$^&()*";
+       unsigned int i;
+       
+       if(!x.empty() && x[0]>='0' && x[0]<='9')
+               return false;
+       
+       for(i=0;i<sizeof(bad_chars);i++)
+               if(x.find_first_of(bad_chars[i])!=string::npos)
+                       return false;
+
+       return true;
+}
+
+void
+Canvas::set_id(const String &x)
+{
+       if(is_inline() && parent_)
+               throw runtime_error("Inline Canvas cannot have an ID");
+       
+       if(!valid_id(x))
+               throw runtime_error("Invalid ID");
+       id_=x;
+       signal_id_changed_();
+}
+
+void
+Canvas::set_name(const String &x)
+{
+       name_=x;
+       signal_meta_data_changed()("name");
+       signal_meta_data_changed("name")();
+}
+
+void
+Canvas::set_author(const String &x)
+{
+       author_=x;
+       signal_meta_data_changed()("author");
+       signal_meta_data_changed("author")();
+}
+
+void
+Canvas::set_description(const String &x)
+{
+       description_=x;
+       signal_meta_data_changed()("description");
+       signal_meta_data_changed("description")();
+}
+
+void
+Canvas::set_time(Time t)const
+{      
+       if(is_dirty_ || !get_time().is_equal(t))
+       {       
+#if 0
+               if(is_root())
+               {
+                       sinfg::info("is_dirty_=%d",is_dirty_);
+                       sinfg::info("get_time()=%f",(float)get_time());
+                       sinfg::info("t=%f",(float)t);
+               }
+#endif
+
+               // ...questionable
+               const_cast<Canvas&>(*this).cur_time_=t;
+               
+               is_dirty_=false;
+               get_context().set_time(t);
+       }
+       is_dirty_=false;
+}
+
+Canvas::LooseHandle
+Canvas::get_root()const
+{
+       return parent_?parent_->get_root().get():const_cast<sinfg::Canvas *>(this);
+}
+
+int
+Canvas::get_depth(etl::handle<Layer> layer)const
+{
+       const_iterator iter;
+       int i(0);
+       for(iter=begin();iter!=end();++iter,i++)
+       {
+               if(layer==*iter)
+                       return i;
+       }
+       return -1;
+}
+
+String
+Canvas::get_relative_id(etl::loose_handle<const Canvas> x)const
+{
+       if(x->get_root()==this)
+               return ":";
+       if(is_inline() && parent_)
+               return parent_->_get_relative_id(x);
+       return _get_relative_id(x);
+}
+
+String
+Canvas::_get_relative_id(etl::loose_handle<const Canvas> x)const
+{
+       if(is_inline() && parent_)
+               return parent_->_get_relative_id(x);
+
+       if(x.get()==this)
+               return String();
+       
+       if(parent()==x.get())
+               return get_id();
+       
+       String id;
+       
+       const Canvas* canvas=this;
+       
+       for(;!canvas->is_root();canvas=canvas->parent().get())
+               id=':'+canvas->get_id()+id;
+       
+       if(x && get_root()!=x->get_root())
+       {
+               //String file_name=get_file_name();
+               //String file_path=x->get_file_path();
+               
+               String file_name;
+               if(is_absolute_path(get_file_name()))
+                       file_name=etl::relative_path(x->get_file_path(),get_file_name());
+               else
+                       file_name=get_file_name();
+               
+               // If the path of X is inside of file_name,
+               // then remove it.
+               //if(file_name.size()>file_path.size())
+               //      if(file_path==String(file_name,0,file_path.size()))
+               //              file_name.erase(0,file_path.size()+1);
+                       
+               id=file_name+'#'+id;
+       }
+
+       return id;
+}
+
+
+ValueNode::Handle
+Canvas::find_value_node(const String &id)
+{
+       return
+               ValueNode::Handle::cast_const(
+                       const_cast<const Canvas*>(this)->find_value_node(id)
+               );
+}
+
+ValueNode::ConstHandle
+Canvas::find_value_node(const String &id)const
+{
+       if(is_inline() && parent_)
+               return parent_->find_value_node(id);
+               
+       if(id.empty())
+               throw Exception::IDNotFound("Empty ID");
+
+       // If we do not have any resolution, then we assume that the
+       // request is for this immediate canvas
+       if(id.find_first_of(':')==string::npos && id.find_first_of('#')==string::npos)
+               return value_node_list_.find(id);
+
+       String canvas_id(id,0,id.rfind(':'));
+       String value_node_id(id,id.rfind(':')+1);
+       if(canvas_id.empty())
+               canvas_id=':';
+       //sinfg::warning("constfind:value_node_id: "+value_node_id);
+       //sinfg::warning("constfind:canvas_id: "+canvas_id);
+
+       return find_canvas(canvas_id)->value_node_list_.find(value_node_id);
+}
+
+ValueNode::Handle
+Canvas::surefind_value_node(const String &id)
+{
+       if(is_inline() && parent_)
+               return parent_->surefind_value_node(id);
+
+       if(id.empty())
+               throw Exception::IDNotFound("Empty ID");
+
+       // If we do not have any resolution, then we assume that the
+       // request is for this immediate canvas
+       if(id.find_first_of(':')==string::npos && id.find_first_of('#')==string::npos)
+               return value_node_list_.surefind(id);
+
+       String canvas_id(id,0,id.rfind(':'));
+       String value_node_id(id,id.rfind(':')+1);
+       if(canvas_id.empty())
+               canvas_id=':';
+               
+       return surefind_canvas(canvas_id)->value_node_list_.surefind(value_node_id);
+}
+
+void
+Canvas::add_value_node(ValueNode::Handle x, const String &id)
+{
+       if(is_inline() && parent_)
+               return parent_->add_value_node(x,id);
+//             throw runtime_error("You cannot add a ValueNode to an inline Canvas");
+
+       //DEBUGPOINT();
+       if(x->is_exported())
+               throw runtime_error("ValueNode is already exported");
+
+       if(id.empty())
+               throw Exception::BadLinkName("Empty ID");
+
+       if(id.find_first_of(':',0)!=string::npos)
+               throw Exception::BadLinkName("Bad character");
+       
+       try
+       {
+               //DEBUGPOINT();
+               if(PlaceholderValueNode::Handle::cast_dynamic(value_node_list_.find(id)))
+                       throw Exception::IDNotFound("add_value_node()");
+               
+               //DEBUGPOINT();
+               throw Exception::IDAlreadyExists(id);
+       }
+       catch(Exception::IDNotFound)
+       {
+               //DEBUGPOINT();
+               x->set_id(id);
+       
+               x->set_parent_canvas(this);
+       
+               if(!value_node_list_.add(x))
+               {
+                       sinfg::error("Unable to add ValueNode");
+                       throw std::runtime_error("Unable to add ValueNode");
+               }
+               //DEBUGPOINT();
+               
+               return;
+       }
+}
+
+/*
+void
+Canvas::rename_value_node(ValueNode::Handle x, const String &id)
+{
+       if(id.empty())
+               throw Exception::BadLinkName("Empty ID");
+
+       if(id.find_first_of(": ",0)!=string::npos)
+               throw Exception::BadLinkName("Bad character");
+
+       try
+       {
+               if(PlaceholderValueNode::Handle::cast_dynamic(value_node_list_.find(id)))
+                       throw Exception::IDNotFound("rename_value_node");
+               throw Exception::IDAlreadyExists(id);
+       }
+       catch(Exception::IDNotFound)
+       {
+               x->set_id(id);  
+
+               return;
+       }
+}
+*/
+
+void
+Canvas::remove_value_node(ValueNode::Handle x)
+{
+       if(is_inline() && parent_)
+               return parent_->remove_value_node(x);
+//             throw Exception::IDNotFound("Canvas::remove_value_node() was called from an inline canvas");
+               
+       if(!x)
+               throw Exception::IDNotFound("Canvas::remove_value_node() was passed empty handle");
+       
+       if(!value_node_list_.erase(x))
+               throw Exception::IDNotFound("Canvas::remove_value_node(): ValueNode was not found inside of this canvas");
+
+       //x->set_parent_canvas(0);
+       
+       x->set_id("");
+}
+
+
+etl::handle<Canvas>
+Canvas::surefind_canvas(const String &id)
+{
+       if(is_inline() && parent_)
+               return parent_->surefind_canvas(id);
+       
+       if(id.empty())
+               return this;
+       
+       // If the ID contains a "#" character, then a filename is
+       // expected on the left side. 
+       if(id.find_first_of('#')!=string::npos)
+       {
+               // If '#' is the first character, remove it
+               // and attempt to parse the ID again.
+               if(id[0]=='#')
+                       return surefind_canvas(String(id,1));
+               
+               //! \todo This needs alot more optimization
+               String file_name(id,0,id.find_first_of('#'));
+               String external_id(id,id.find_first_of('#')+1);
+               
+               Canvas::Handle external_canvas;
+               
+               // If the composition is already open, then use it.
+               if(externals_.count(file_name))
+                       external_canvas=externals_[file_name];
+               else
+               {
+                       if(is_absolute_path(file_name))
+                               external_canvas=open_canvas(file_name);
+                       else
+                               external_canvas=open_canvas(get_file_path()+'/'+file_name);
+
+                       if(!external_canvas)
+                               throw Exception::FileNotFound(file_name);
+                       externals_[file_name]=external_canvas;
+               }
+               
+               return Handle::cast_const(external_canvas.constant()->find_canvas(external_id));
+       }
+       
+       // If we do not have any resolution, then we assume that the
+       // request is for this immediate canvas
+       if(id.find_first_of(':')==string::npos)
+       {
+               Children::iterator iter;
+       
+               // Search for the image in the image list,
+               // and return it if it is found
+               for(iter=children().begin();iter!=children().end();iter++)
+                       if(id==(*iter)->get_id())
+                               return *iter;
+                       
+               // Create a new canvas and return it
+               //sinfg::warning("Implicitly creating canvas named "+id);
+               return new_child_canvas(id);
+       }
+       
+       // If the first character is the seperator, then 
+       // this references the root canvas.
+       if(id[0]==':')
+               return get_root()->surefind_canvas(string(id,1));
+
+       // Now we know that the requested Canvas is in a child
+       // of this canvas. We have to find that canvas and 
+       // call "find_canvas" on it, and return the result.
+       
+       String canvas_name=string(id,0,id.find_first_of(':'));
+       
+       Canvas::Handle child_canvas=surefind_canvas(canvas_name);
+
+       return child_canvas->surefind_canvas(string(id,id.find_first_of(':')+1));
+}
+
+Canvas::Handle
+Canvas::find_canvas(const String &id)
+{
+       return
+               Canvas::Handle::cast_const(
+                       const_cast<const Canvas*>(this)->find_canvas(id)
+               );
+}
+
+Canvas::ConstHandle
+Canvas::find_canvas(const String &id)const
+{
+       if(is_inline() && parent_)return parent_->find_canvas(id);
+
+       if(id.empty())
+               return this;
+
+       // If the ID contains a "#" character, then a filename is
+       // expected on the left side. 
+       if(id.find_first_of('#')!=string::npos)
+       {
+               // If '#' is the first character, remove it
+               // and attempt to parse the ID again.
+               if(id[0]=='#')
+                       return find_canvas(String(id,1));
+               
+               //! \todo This needs alot more optimization
+               String file_name(id,0,id.find_first_of('#'));
+               String external_id(id,id.find_first_of('#')+1);
+               
+               Canvas::Handle external_canvas;
+               
+               // If the composition is already open, then use it.
+               if(externals_.count(file_name))
+                       external_canvas=externals_[file_name];
+               else
+               {
+                       if(is_absolute_path(file_name))
+                               external_canvas=open_canvas(file_name);
+                       else
+                               external_canvas=open_canvas(get_file_path()+'/'+file_name);
+
+                       if(!external_canvas)
+                               throw Exception::FileNotFound(file_name);
+                       externals_[file_name]=external_canvas;
+               }
+               
+               return Handle::cast_const(external_canvas.constant()->find_canvas(external_id));
+       }
+       
+       // If we do not have any resolution, then we assume that the
+       // request is for this immediate canvas
+       if(id.find_first_of(':')==string::npos)
+       {
+               Children::const_iterator iter;
+       
+               // Search for the image in the image list,
+               // and return it if it is found
+               for(iter=children().begin();iter!=children().end();iter++)
+                       if(id==(*iter)->get_id())
+                               return *iter;
+                       
+               throw Exception::IDNotFound("Child Canvas in Parent Canvas: (child)"+id);
+       }
+       
+       // If the first character is the seperator, then 
+       // this references the root canvas.
+       if(id.find_first_of(':')==0)
+               return get_root()->find_canvas(string(id,1));
+
+       // Now we know that the requested Canvas is in a child
+       // of this canvas. We have to find that canvas and 
+       // call "find_canvas" on it, and return the result.
+       
+       String canvas_name=string(id,0,id.find_first_of(':'));
+       
+       Canvas::ConstHandle child_canvas=find_canvas(canvas_name);
+
+       return child_canvas->find_canvas(string(id,id.find_first_of(':')+1));
+}
+
+
+Canvas::Handle
+Canvas::create()
+{
+       return new Canvas("Untitled");
+}
+
+void
+Canvas::push_back(etl::handle<Layer> x)
+{
+//     DEBUGPOINT();
+//     int i(x->count());
+       insert(end(),x);
+       //if(x->count()!=i+1)sinfg::info("push_back before %d, after %d",i,x->count());
+}
+
+void
+Canvas::push_front(etl::handle<Layer> x)
+{
+//     DEBUGPOINT();
+//     int i(x->count());
+       insert(begin(),x);
+       //if(x->count()!=i+1)sinfg::error("push_front before %d, after %d",i,x->count());
+}
+
+void
+Canvas::insert(iterator iter,etl::handle<Layer> x)
+{
+//     int i(x->count());
+       CanvasBase::insert(iter,x);
+
+       /*if(x->count()!=i+1)
+       {
+               sinfg::error(__FILE__":%d: Canvas::insert(): ***FAILURE*** before %d, after %d",__LINE__,i,x->count());
+               return;
+               //throw runtime_error("Canvas Insertion Failed");
+       }*/
+
+       x->set_canvas(this);
+
+
+       add_child(x.get());
+
+       
+       LooseHandle correct_canvas(this);
+       //while(correct_canvas->is_inline())correct_canvas=correct_canvas->parent();
+       Layer::LooseHandle loose_layer(x);
+       
+       x->signal_added_to_group().connect(
+               sigc::bind(
+                       sigc::mem_fun(
+                               *correct_canvas,
+                               &Canvas::add_group_pair
+                       ),
+                       loose_layer
+               )
+       );
+       x->signal_removed_from_group().connect(
+               sigc::bind(
+                       sigc::mem_fun(
+                               *correct_canvas,
+                               &Canvas::remove_group_pair
+                       ),
+                       loose_layer
+               )
+       );
+
+
+       if(!x->get_group().empty())
+               add_group_pair(x->get_group(),x);
+
+
+       changed();
+}
+
+void
+Canvas::push_back_simple(etl::handle<Layer> x)
+{
+       CanvasBase::insert(end(),x);
+       changed();
+}
+
+void
+Canvas::erase(Canvas::iterator iter)
+{
+       if(!(*iter)->get_group().empty())
+               remove_group_pair((*iter)->get_group(),(*iter));
+       
+       // HACK: We really shouldn't be wiping
+       // out these signals entirely. We should
+       // only be removing the specific connections
+       // that we made. At the moment, I'm too
+       // lazy to add the code to keep track
+       // of those connections, and no one else
+       // is using these signals, so I'll just
+       // leave these next two lines like they
+       // are for now - darco 07-30-2004
+       (*iter)->signal_added_to_group().clear();
+       (*iter)->signal_removed_from_group().clear();
+
+       if(!op_flag_)remove_child(iter->get());
+               
+       CanvasBase::erase(iter);
+       if(!op_flag_)changed();
+}
+
+Canvas::Handle
+Canvas::clone(const GUID& deriv_guid)const
+{
+       sinfg::String name;
+       if(is_inline())
+               name="inline";
+       else
+       {
+               name=get_id()+"_CLONE";
+               
+               throw runtime_error("Cloning of non-inline canvases is not yet suported");
+       }
+       
+       Handle canvas(new Canvas(name));
+       
+       if(is_inline())
+       {
+               canvas->is_inline_=true;
+               canvas->parent_=0;
+               //canvas->set_inline(parent());
+       }
+
+       canvas->set_guid(get_guid()^deriv_guid);
+
+       const_iterator iter;
+       for(iter=begin();iter!=end();++iter)
+       {
+               Layer::Handle layer((*iter)->clone(deriv_guid));
+               if(layer)
+               {
+                       assert(layer.count()==1);
+                       int presize(size());
+                       canvas->push_back(layer);
+                       if(!(layer.count()>1))
+                       {
+                               sinfg::error("Canvas::clone(): Cloned layer insertion failure!");
+                               sinfg::error("Canvas::clone(): \tlayer.count()=%d",layer.count());
+                               sinfg::error("Canvas::clone(): \tlayer->get_name()=%s",layer->get_name().c_str());
+                               sinfg::error("Canvas::clone(): \tbefore size()=%d",presize);
+                               sinfg::error("Canvas::clone(): \tafter size()=%d",size());
+                       }
+                       assert(layer.count()>1);
+               }
+               else
+               {
+                       sinfg::error("Unable to clone layer");
+               }
+       }
+
+       canvas->signal_group_pair_removed().clear();
+       canvas->signal_group_pair_added().clear();
+
+       return canvas;
+}
+
+void
+Canvas::set_inline(LooseHandle parent)
+{
+       if(is_inline_ && parent_)
+       {
+               
+       }
+       
+       id_="inline";
+       is_inline_=true;
+       parent_=parent;
+
+       // Have the parent inherit all of the group stuff
+
+       std::map<String,std::set<etl::handle<Layer> > >::const_iterator iter;
+
+       for(iter=group_db_.begin();iter!=group_db_.end();++iter)
+       {
+               parent->group_db_[iter->first].insert(iter->second.begin(),iter->second.end());
+       }
+       
+       rend_desc()=parent->rend_desc();
+}
+
+Canvas::Handle
+Canvas::create_inline(Handle parent)
+{
+       assert(parent);
+       //if(parent->is_inline())
+       //      return create_inline(parent->parent());
+       
+       Handle canvas(new Canvas("inline"));
+       canvas->set_inline(parent);
+       return canvas;
+}
+
+Canvas::Handle
+Canvas::new_child_canvas()
+{
+       if(is_inline() && parent_)
+               return parent_->new_child_canvas();
+//             runtime_error("You cannot create a child Canvas in an inline Canvas");
+
+       // Create a new canvas
+       children().push_back(create());
+       Canvas::Handle canvas(children().back());
+
+       canvas->parent_=this;
+
+       canvas->rend_desc()=rend_desc();
+
+       return canvas;
+}
+
+Canvas::Handle
+Canvas::new_child_canvas(const String &id)
+{
+       if(is_inline() && parent_)
+               return parent_->new_child_canvas(id);
+//             runtime_error("You cannot create a child Canvas in an inline Canvas");
+
+       // Create a new canvas
+       children().push_back(create());
+       Canvas::Handle canvas(children().back());
+       
+       canvas->set_id(id);
+       canvas->parent_=this;
+       canvas->rend_desc()=rend_desc();
+
+       return canvas;
+}
+
+Canvas::Handle
+Canvas::add_child_canvas(Canvas::Handle child_canvas, const sinfg::String& id)
+{
+       if(is_inline() && parent_)
+               return parent_->add_child_canvas(child_canvas,id);
+
+       if(child_canvas->parent() && !child_canvas->is_inline())
+               throw std::runtime_error("Cannot add child canvas because it belongs to someone else!");
+       
+       if(!valid_id(id))
+               throw runtime_error("Invalid ID");
+       
+       try
+       {
+               find_canvas(id);
+               throw Exception::IDAlreadyExists(id);
+       }
+       catch(Exception::IDNotFound)
+       {
+               if(child_canvas->is_inline())
+                       child_canvas->is_inline_=false;
+               child_canvas->id_=id;
+               children().push_back(child_canvas);
+               child_canvas->parent_=this;
+       }
+       
+       return child_canvas;
+}
+
+void
+Canvas::remove_child_canvas(Canvas::Handle child_canvas)
+{
+       if(is_inline() && parent_)
+               return parent_->remove_child_canvas(child_canvas);
+       
+       if(child_canvas->parent_!=this)
+               throw runtime_error("Given child does not belong to me");
+       
+       if(find(children().begin(),children().end(),child_canvas)==children().end())
+               throw Exception::IDNotFound(child_canvas->get_id());
+       
+       children().remove(child_canvas);
+
+       child_canvas->parent_=0;
+}
+
+void
+Canvas::set_file_name(const String &file_name)
+{
+       if(parent())
+               parent()->set_file_name(file_name);
+       else
+       {
+               file_name_=file_name;
+               signal_file_name_changed_();
+       }
+}
+
+sigc::signal<void>&
+Canvas::signal_file_name_changed()
+{
+       if(parent())
+               return signal_file_name_changed();
+       else
+               return signal_file_name_changed_;
+}
+
+String
+Canvas::get_file_name()const
+{
+       if(parent())
+               return parent()->get_file_name();
+       return file_name_;
+}
+
+String
+Canvas::get_file_path()const
+{
+       if(parent())
+               return parent()->get_file_path();
+       return dirname(file_name_);
+}
+
+       
+String
+Canvas::get_meta_data(const String& key)const
+{
+       if(!meta_data_.count(key))
+               return String();
+       return meta_data_.find(key)->second;
+}
+
+void
+Canvas::set_meta_data(const String& key, const String& data)
+{
+       if(meta_data_[key]!=data)
+       {
+               meta_data_[key]=data;
+               signal_meta_data_changed()(key);
+               signal_meta_data_changed(key)();
+       }
+}
+
+void
+Canvas::erase_meta_data(const String& key)
+{
+       if(meta_data_.count(key))
+       {
+               meta_data_.erase(key);
+               signal_meta_data_changed()(key);
+               signal_meta_data_changed(key)();
+       }
+}
+
+std::list<String>
+Canvas::get_meta_data_keys()const
+{
+       std::list<String> ret;
+
+       std::map<String,String>::const_iterator iter;
+
+       for(iter=meta_data_.begin();!(iter==meta_data_.end());++iter)
+               ret.push_back(iter->first);
+       
+       return ret;
+}
+
+void
+sinfg::optimize_layers(Context context, Canvas::Handle op_canvas)
+{
+       Context iter;
+
+       std::vector< std::pair<float,Layer::Handle> > sort_list;
+       int i;
+       
+       // Go ahead and start romping through the canvas to paste
+       for(iter=context,i=0;*iter;iter++,i++)
+       {
+               Layer::Handle layer=*iter;
+               float z_depth(layer->get_z_depth()*1.0001+i);
+               
+               // If the layer isn't active, don't worry about it
+               if(!layer->active())
+                       continue;
+
+               // Any layer with an amount of zero is implicitly disabled.
+               ValueBase value(layer->get_param("amount"));
+               if(value.get_type()==ValueBase::TYPE_REAL && value.get(Real())==0)
+                       continue;
+
+               Layer_PasteCanvas* paste_canvas(static_cast<Layer_PasteCanvas*>(layer.get()));
+               if(layer->get_name()=="PasteCanvas" && paste_canvas->get_time_offset()==0)
+               {
+                       Canvas::Handle sub_canvas(Canvas::create_inline(op_canvas));
+                       optimize_layers(paste_canvas->get_sub_canvas()->get_context(),sub_canvas);
+//#define SINFG_OPTIMIZE_PASTE_CANVAS 1
+
+#ifdef SINFG_OPTIMIZE_PASTE_CANVAS                     
+                       Canvas::iterator sub_iter;
+                       // Determine if we can just remove the paste canvas
+                       // altogether                   
+                       if(paste_canvas->get_blend_method()==Color::BLEND_COMPOSITE && paste_canvas->get_amount()==1.0f && paste_canvas->get_zoom()==0 && paste_canvas->get_time_offset()==0 && paste_canvas->get_origin()==Point(0,0))
+                       try{
+                               for(sub_iter=sub_canvas->begin();sub_iter!=sub_canvas->end();++sub_iter)
+                               {
+                                       Layer* layer=sub_iter->get();
+                                       
+                                       // any layers that deform end up breaking things
+                                       // so do things the old way if we run into anything like this
+                                       if(!dynamic_cast<Layer_NoDeform*>(layer))
+                                               throw int();
+
+                                       ValueBase value(layer->get_param("blend_method"));
+                                       if(value.get_type()!=ValueBase::TYPE_INTEGER || value.get(int())!=(int)Color::BLEND_COMPOSITE)
+                                               throw int();
+                               }
+                               
+                               // It has turned out that we don't need a paste canvas
+                               // layer, so just go ahead and add all the layers onto
+                               // the current stack and be done with it
+                               while(sub_canvas->size())
+                               {
+                                       sort_list.push_back(std::pair<float,Layer::Handle>(z_depth,sub_canvas->front()));
+                                       //op_canvas->push_back_simple(sub_canvas->front());
+                                       sub_canvas->pop_front();
+                               }
+                               continue;
+                       }catch(int) { }
+#endif
+                       Layer::Handle new_layer(Layer::create("PasteCanvas"));
+                       dynamic_cast<Layer_PasteCanvas*>(new_layer.get())->set_do_not_muck_with_time(true);
+                       Layer::ParamList param_list(paste_canvas->get_param_list());
+                       //param_list.erase("canvas");
+                       new_layer->set_param_list(param_list);
+                       dynamic_cast<Layer_PasteCanvas*>(new_layer.get())->set_sub_canvas(sub_canvas);
+                       dynamic_cast<Layer_PasteCanvas*>(new_layer.get())->set_do_not_muck_with_time(false);
+                       layer=new_layer;
+               }
+                                                               
+               sort_list.push_back(std::pair<float,Layer::Handle>(z_depth,layer));
+               //op_canvas->push_back_simple(layer);   
+       }
+       
+       //sort_list.sort();
+       stable_sort(sort_list.begin(),sort_list.end());
+       std::vector< std::pair<float,Layer::Handle> >::iterator iter2;
+       for(iter2=sort_list.begin();iter2!=sort_list.end();++iter2)
+               op_canvas->push_back_simple(iter2->second);
+       op_canvas->op_flag_=true;
+}
+
+void
+Canvas::get_times_vfunc(Node::time_set &set) const
+{
+       const_iterator  i = begin(),
+                               iend = end();
+       
+       for(; i != iend; ++i)
+       {
+               const Node::time_set &tset = (*i)->get_times();
+               set.insert(tset.begin(),tset.end());
+       }
+}
+
+std::set<etl::handle<Layer> >
+Canvas::get_layers_in_group(const String&group)
+{
+       if(is_inline() && parent_)
+               return parent_->get_layers_in_group(group);
+
+       if(group_db_.count(group)==0)
+               return std::set<etl::handle<Layer> >();
+       return group_db_.find(group)->second;
+}
+
+std::set<String>
+Canvas::get_groups()const
+{
+       if(is_inline() && parent_)
+               return parent_->get_groups();
+
+       std::set<String> ret;
+       std::map<String,std::set<etl::handle<Layer> > >::const_iterator iter;
+       for(iter=group_db_.begin();iter!=group_db_.end();++iter)
+               ret.insert(iter->first);
+       return ret;
+}
+
+int
+Canvas::get_group_count()const
+{
+       if(is_inline() && parent_)
+               return parent_->get_group_count();
+
+       return group_db_.size();
+}
+       
+void
+Canvas::add_group_pair(String group, etl::handle<Layer> layer)
+{
+       group_db_[group].insert(layer);
+       if(group_db_[group].size()==1)
+               signal_group_added()(group);
+       else
+               signal_group_changed()(group);
+       
+       signal_group_pair_added()(group,layer);
+
+       if(is_inline()  && parent_)
+               return parent_->add_group_pair(group,layer);
+}
+
+void
+Canvas::remove_group_pair(String group, etl::handle<Layer> layer)
+{
+       group_db_[group].erase(layer);
+
+       signal_group_pair_removed()(group,layer);
+
+       if(group_db_[group].empty())
+       {
+               group_db_.erase(group);
+               signal_group_removed()(group);
+       }
+       else
+               signal_group_changed()(group);
+
+       if(is_inline() && parent_)
+               return parent_->remove_group_pair(group,layer);
+}
+
+void
+Canvas::rename_group(const String&old_name,const String&new_name)
+{
+       if(is_inline() && parent_)
+               return parent_->rename_group(old_name,new_name);
+       
+       {
+               std::map<String,std::set<etl::handle<Layer> > >::iterator iter;
+               iter=group_db_.find(old_name);
+               if(iter!=group_db_.end())
+               for(++iter;iter!=group_db_.end() && iter->first.find(old_name)==0;iter=group_db_.find(old_name),++iter)
+               {
+                       String name(iter->first,old_name.size(),String::npos);
+                       name=new_name+name;
+                       rename_group(iter->first,name);
+               }
+       }
+       
+       std::set<etl::handle<Layer> > layers(get_layers_in_group(old_name));
+       std::set<etl::handle<Layer> >::iterator iter;
+       
+       for(iter=layers.begin();iter!=layers.end();++iter)
+       {
+               (*iter)->remove_from_group(old_name);
+               (*iter)->add_to_group(new_name);
+       }
+}
diff --git a/synfig-core/trunk/src/synfig/canvas.h b/synfig-core/trunk/src/synfig/canvas.h
new file mode 100644 (file)
index 0000000..8bd540e
--- /dev/null
@@ -0,0 +1,484 @@
+/* === S I N F G =========================================================== */
+/*!    \file canvas.h
+**     \brief Canvas Class Implementation
+**
+**     $Id: canvas.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_CANVAS_H
+#define __SINFG_CANVAS_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <map>
+#include <list>
+#include <ETL/handle>
+#include <sigc++/signal.h>
+
+#include "vector.h"
+#include "string.h"
+#include "canvasbase.h"
+#include "valuenode.h"
+#include "keyframe.h"
+#include "renddesc.h"
+#include "node.h"
+#include "guid.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Context;
+class GUID;
+       
+/*!    \class Canvas
+**     \todo writeme
+*/
+class Canvas : public CanvasBase, public Node
+{
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public:
+       typedef etl::handle<Canvas> Handle;
+       typedef etl::loose_handle<Canvas> LooseHandle;
+       typedef etl::handle<const Canvas> ConstHandle;
+
+       typedef std::list<Handle> Children;
+
+       friend void sinfg::optimize_layers(Context, Canvas::Handle);
+
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+private:
+
+       //! Contains the ID string for the Canvas
+       /*!     \see get_id(), set_id() */
+       String id_;
+
+       //! Contains the name of the Canvas
+       /*!     \see set_name(), get_name() */
+       String name_;
+
+       //! Contains a description of the Canvas
+       /*!     \see set_description(), get_description() */
+       String description_;
+
+       //! Contains the author's name
+       /*!     \see set_author(), get_author() */
+       String author_;
+
+       //! Contains the author's email address
+       /*!     \todo This private parameter has no binding, so it's unusable at the moment */
+       String email_;
+
+       //! File name of Canvas
+       /*! \see get_file_name(), set_file_name() */
+       String file_name_;
+
+       //! Metadata map for Canvas.
+       /*! \see get_meta_data(), set_meta_data(), erase_meta_data() */
+       std::map<String, String> meta_data_;
+
+       //! Contains a list of ValueNodes that are in this Canvas
+       /*!     \see value_node_list(), find_value_node() */
+       ValueNodeList value_node_list_;
+
+       //! \writeme
+       KeyframeList keyframe_list_;
+
+       //! A handle to the parent canvas of this canvas.
+       /*!     If canvas is a root canvas, then this handle is empty
+       **      \see parent()
+       */
+       LooseHandle parent_;
+
+       //! List containing any child Canvases
+       /*!     \see children() */
+       Children children_;             
+       
+       //! Render Description for Canvas
+       /*!     \see rend_desc() */
+    RendDesc desc_;
+
+       //! Contains the value of the last call to set_time()
+       Time cur_time_;
+
+       //! \writeme
+       mutable std::map<String,Handle> externals_;
+       
+       //! This flag is set if this canvas is "inline"
+       bool is_inline_;
+
+       mutable bool is_dirty_;
+       
+       bool op_flag_;
+       
+       //! Layer Group database
+       std::map<String,std::set<etl::handle<Layer> > > group_db_;      
+
+       /*
+ -- ** -- S I G N A L S -------------------------------------------------------
+       */
+
+private:
+
+       //!     Group Added
+       sigc::signal<void,String> signal_group_added_;  
+
+       //!     Group Removed
+       sigc::signal<void,String> signal_group_removed_;        
+       
+       //! Group Changed
+       sigc::signal<void,String> signal_group_changed_;        
+
+       sigc::signal<void,String,etl::handle<sinfg::Layer> > signal_group_pair_added_;
+       sigc::signal<void,String,etl::handle<sinfg::Layer> > signal_group_pair_removed_;
+
+       //!     Layers Reordered
+       sigc::signal<void,int*> signal_layers_reordered_;       
+       
+       //!     RendDesc Changed
+       sigc::signal<void> signal_rend_desc_changed_;   
+       
+       //!     ID Changed
+       sigc::signal<void> signal_id_changed_;  
+
+       //!     Dirty
+       //sigc::signal<void> signal_dirty_;     
+
+       //!     FileName Changed
+       sigc::signal<void> signal_file_name_changed_;   
+
+       //!     Metadata Changed
+       sigc::signal<void, String> signal_meta_data_changed_;   
+
+       //! Key-Specific meta data changed signals
+       std::map<String, sigc::signal<void> > signal_map_meta_data_changed_;
+
+
+       //!     ValueBasenode Changed
+       sigc::signal<void, etl::handle<ValueNode> > signal_value_node_changed_; 
+
+       sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> > signal_value_node_child_added_;     
+
+       sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> > signal_value_node_child_removed_;   
+
+       /*
+ -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
+       */
+
+public:
+
+       sigc::signal<void,String,etl::handle<sinfg::Layer> >& signal_group_pair_added() { return signal_group_pair_added_; }
+       sigc::signal<void,String,etl::handle<sinfg::Layer> >& signal_group_pair_removed() { return signal_group_pair_removed_; }
+
+       //!     Group Added
+       sigc::signal<void,String>& signal_group_added() { return signal_group_added_; }
+
+       //!     Group Removed
+       sigc::signal<void,String>& signal_group_removed() { return signal_group_removed_; }
+       
+       //! Group Changed
+       sigc::signal<void,String>& signal_group_changed() { return signal_group_changed_; }
+
+       //!     Layers Reordered
+       sigc::signal<void,int*>& signal_layers_reordered() { return signal_layers_reordered_; }
+       
+       //!     RendDesc Changed
+       sigc::signal<void>& signal_rend_desc_changed() { return signal_rend_desc_changed_; }
+       
+       //!     ID Changed
+       sigc::signal<void>& signal_id_changed() { return signal_id_changed_; }
+
+       //!     File name Changed
+       sigc::signal<void>& signal_file_name_changed();
+       
+       //!     Metadata Changed
+       sigc::signal<void, String>& signal_meta_data_changed() { return signal_meta_data_changed_; }
+
+       //!     Metadata Changed
+       sigc::signal<void>& signal_meta_data_changed(const String& key) { return signal_map_meta_data_changed_[key]; }
+       
+
+       sigc::signal<void, etl::handle<ValueNode> >& signal_value_node_changed() { return signal_value_node_changed_; } 
+
+       //!     Dirty
+       sigc::signal<void>& signal_dirty() { return signal_changed();   }
+
+       //! \writeme
+       sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> >& signal_value_node_child_added() { return signal_value_node_child_added_; }
+
+       //! \writeme
+       sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> >& signal_value_node_child_removed() { return signal_value_node_child_removed_; }
+
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+protected:
+
+       Canvas(const String &name);
+
+public:
+
+       ~Canvas();
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //! Returns the set of layers in group
+       std::set<etl::handle<Layer> > get_layers_in_group(const String&group);
+       
+       //! Gets all the groups
+       std::set<String> get_groups()const;
+       
+       //! Gets the number of groups in this canvas
+       int get_group_count()const;
+
+       //! Renames the given group
+       void rename_group(const String&old_name,const String&new_name);
+
+       //! \writeme
+       bool is_inline()const { return is_inline_; }
+
+       //! Returns a handle to the RendDesc for this Canvas
+       RendDesc &rend_desc() { return desc_; }
+
+       //! Returns a handle to the RendDesc for this Canvas
+       const RendDesc &rend_desc()const { return desc_; }
+
+       //! Gets the name of the canvas
+       const String & get_name()const { return name_; }
+
+       //! Sets the name of the canvas
+       void set_name(const String &x);
+
+       //! Gets the author of the canvas
+       const String & get_author()const { return author_; }
+
+       //! Sets the author of the canvas
+       void set_author(const String &x);
+
+       //! Gets the description of the canvas
+       const String & get_description()const { return description_; }
+
+       //! Sets the name of the canvas
+       void set_description(const String &x);
+
+       //! Gets the ID of the canvas
+       const String & get_id()const { return id_; }
+
+       //! Sets the ID of the canvas
+       void set_id(const String &x);
+       
+       //!     Returns the data string for the given meta data key
+       String get_meta_data(const String& key)const;
+
+       //!     Returns a list of meta data keys
+       std::list<String> get_meta_data_keys()const;
+
+       //! Sets a meta data key to a specific string
+       void set_meta_data(const String& key, const String& data);
+
+       //! Removes a meta data key
+       void erase_meta_data(const String& key);
+
+       //! \writeme
+       String get_relative_id(etl::loose_handle<const Canvas> x)const;
+
+       //! \internal \writeme
+       String _get_relative_id(etl::loose_handle<const Canvas> x)const;
+
+       //! Returns \c true if the Canvas is a root Canvas. \c false otherwise
+       bool is_root()const { return !parent_; }
+
+       //! Returns a handle to the parent Canvas.
+       /*! The returned handle will be empty if this is a root canvas */
+       LooseHandle parent()const { return parent_; }
+
+       LooseHandle get_root()const;
+       
+       //! Returns a list of all child canvases in this canvas
+       std::list<Handle> &children() { return children_; }
+
+       //! Returns a list of all child canvases in this canvas
+       const std::list<Handle> &children()const { return children_; }
+
+       //! Gets the color at the specified point
+       //Color get_color(const Point &pos)const;
+
+       //! Sets the time for all the layers in the canvas
+       void set_time(Time t)const;
+
+       //! \writeme
+       Time get_time()const { return cur_time_; }
+
+       //! Returns the number of layers in the canvas
+       int size()const;
+
+       //! Removes all the layers from the canvas
+       void clear();
+
+       //! Returns true if the canvas has no layers
+       bool empty()const;
+
+       //! Returns a reference to the ValueNodeList for this Canvas
+       // ValueNodeList &value_node_list() { return value_node_list_; }
+
+       //! Returns a reference to the ValueNodeList for this Canvas
+       const ValueNodeList &value_node_list()const;
+
+       //! Returns a reference to the KeyframeList for this Canvas
+       KeyframeList &keyframe_list();
+
+       //! Returns a reference to the KeyframeList for this Canvas
+       const KeyframeList &keyframe_list()const;
+
+       //! Finds the ValueNode in the Canvas with the given \a id
+       /*!     \return If found, returns a handle to the ValueNode.
+       **              Otherwise, returns an empty handle.
+       */
+       ValueNode::Handle find_value_node(const String &id);
+
+       //! \internal \writeme
+       ValueNode::Handle surefind_value_node(const String &id);
+
+       //! Finds the ValueNode in the Canvas with the given \a id
+       /*!     \return If found, returns a handle to the ValueNode.
+       **              Otherwise, returns an empty handle.
+       */
+       ValueNode::ConstHandle find_value_node(const String &id)const;
+
+       //! \writeme
+       void add_value_node(ValueNode::Handle x, const String &id);
+
+       //! \writeme
+       //void rename_value_node(ValueNode::Handle x, const String &id);
+
+       //! \writeme
+       void remove_value_node(ValueNode::Handle x);
+
+       //! \writeme
+       void remove_value_node(const String &id) { remove_value_node(find_value_node(id)); }
+
+       //! Finds a child Canvas in the Canvas with the given \a name
+       /*!     \return If found, returns a handle to the child Canvas.
+       **              If not found, it creates a new Canvas and returns it
+       **              If an error occurs, it returns an empty handle
+       */
+       Handle surefind_canvas(const String &id);
+
+       //! Finds a child Canvas in the Canvas with the given \a id
+       /*!     \return If found, returns a handle to the child Canvas.
+       **              Otherwise, returns an empty handle.
+       */
+       Handle find_canvas(const String &id);
+
+       //! Finds a child Canvas in the Canvas with the given \a id
+       /*!     \return If found, returns a handle to the child Canvas.
+       **              Otherwise, returns an empty handle.
+       */
+       ConstHandle find_canvas(const String &id)const;
+
+       //! Sets the file path for the Canvas
+       //void set_file_path(const String &);
+
+       //! Returns the file path from the file name
+       String get_file_path()const;
+
+       //! Sets the filename (with path)
+       void set_file_name(const String &);
+
+       //! Gets the filename (with path)
+       String get_file_name()const;
+       
+       //! Creates a new child canvas, and returns its handle
+       Handle new_child_canvas();
+
+       //! Creates a new child canvas with an ID of \aid, and returns its handle
+       Handle new_child_canvas(const String &id);
+
+       //! Adds the given canvas as a child
+       Handle add_child_canvas(Handle child_canvas, const String &id);
+
+       void remove_child_canvas(Handle child_canvas);
+
+       etl::handle<Layer> find_layer(const Point &pos);
+
+       int get_depth(etl::handle<Layer>)const;
+
+       Context get_context()const;
+
+       iterator end();
+
+       const_iterator end()const;
+
+       reverse_iterator rbegin();
+
+       const_reverse_iterator rbegin()const;
+
+       etl::handle<Layer> &back();
+       
+       void push_back(etl::handle<Layer> x);
+
+       void push_front(etl::handle<Layer> x);
+
+       void push_back_simple(etl::handle<Layer> x);
+
+       void insert(iterator iter,etl::handle<Layer> x);
+       void erase(iterator iter);
+       
+       const etl::handle<Layer> &back()const;
+
+       void set_inline(LooseHandle parent);
+
+       static Handle create();
+
+       static Handle create_inline(Handle parent);
+       
+       Handle clone(const GUID& deriv_guid=GUID())const;
+
+private:
+       void add_group_pair(String group, etl::handle<Layer> layer);
+       void remove_group_pair(String group, etl::handle<Layer> layer);
+
+protected:
+       virtual void on_changed();
+       virtual void get_times_vfunc(Node::time_set &set) const;
+}; // END of class Canvas
+
+void optimize_layers(Context context, Canvas::Handle op_canvas);
+
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/canvasbase.h b/synfig-core/trunk/src/synfig/canvasbase.h
new file mode 100644 (file)
index 0000000..3fc5225
--- /dev/null
@@ -0,0 +1,46 @@
+/* === S I N F G =========================================================== */
+/*!    \file canvasbase.h
+**     \brief Template Header
+**
+**     $Id: canvasbase.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_CANVASBASE_H
+#define __SINFG_CANVASBASE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <deque>
+#include <ETL/handle>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+namespace sinfg {
+
+class Layer;
+       
+typedef std::deque< etl::handle< Layer > > CanvasBase;
+       
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/color.cpp b/synfig-core/trunk/src/synfig/color.cpp
new file mode 100644 (file)
index 0000000..584bdd5
--- /dev/null
@@ -0,0 +1,521 @@
+/* === S I N F G =========================================================== */
+/*!    \file color.h
+**     \brief Color Class
+**
+**     $Id: color.cpp,v 1.2 2005/01/23 04:03:21 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include <ETL/angle>
+#include "color.h"
+#include <cstdio>
+
+#endif
+
+using namespace sinfg;
+using namespace etl;
+using namespace std;
+
+/* === M A C R O S ========================================================= */
+
+#define COLOR_EPSILON  (0.000001f)
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+
+
+#if 0
+Color&
+Color::rotate_uv(const Angle& theta)const
+{
+/*/
+       Color ret(*this);
+       ret.set_hue(ret.get_hue()+theta);
+       return ret;
+/*/
+       const float
+               a(angle::sin(theta).get()),
+               b(angle::cos(theta).get());
+       const float
+               u(get_u()),
+               v(get_v());
+       
+       return set_uv(b*u-a*v,a*u+b*v);
+       //return YUV(get_y(),b*u-a*v,a*u+b*v,get_a());
+//*/
+}
+#endif
+
+Color
+Color::clamped_negative()const
+{
+       Color ret=*this;
+               
+       if(ret.a_==0)
+               return alpha();
+
+       if(ret.a_<0)
+               ret=-ret;
+
+       if(ret.r_<0)
+       {
+               ret.g_-=ret.r_;
+               ret.b_-=ret.r_;
+               ret.r_=0.0f;
+       }
+       if(ret.g_<0)
+       {
+               ret.r_-=ret.g_;
+               ret.b_-=ret.g_;
+               ret.g_=0.0f;
+       }
+       if(ret.b_<0)
+       {
+               ret.r_-=ret.b_;
+               ret.g_-=ret.b_;
+               ret.b_=0.0f;
+       }
+
+       if(ret.r_>1) ret.r_=1;
+       if(ret.g_>1) ret.g_=1;
+       if(ret.b_>1) ret.b_=1;
+       if(ret.a_>1) ret.a_=1;
+
+       if(isnan(ret.get_r())) ret.r_=0.5;
+       if(isnan(ret.get_g())) ret.g_=0.5;
+       if(isnan(ret.get_b())) ret.b_=0.5;
+       if(isnan(ret.get_a())) ret.a_=1;
+
+/*
+       if(ret.r_>1) { ret.g_/=ret.r_; ret.b_/=ret.r_; ret.r_=1; }
+       if(ret.g_>1) { ret.r_/=ret.g_; ret.b_/=ret.g_; ret.g_=1; }
+       if(ret.b_>1) { ret.g_/=ret.b_; ret.r_/=ret.b_; ret.b_=1; }
+       if(ret.a_>1) ret.a_=1;
+*/
+
+       return ret;
+}
+
+Color
+Color::clamped()const
+{
+       Color ret(*this);
+       if(ret.get_r()<0)
+               ret.set_r(0);
+       if(ret.get_g()<0)
+               ret.set_g(0);
+       if(ret.get_b()<0)
+               ret.set_b(0);
+       if(ret.get_a()<0)
+               ret.set_a(0);
+
+       if(ret.r_>1) ret.r_=1;
+       if(ret.g_>1) ret.g_=1;
+       if(ret.b_>1) ret.b_=1;
+       if(ret.a_>1) ret.a_=1;
+
+       if(isnan(ret.get_r())) ret.r_=0.5;
+       if(isnan(ret.get_g())) ret.g_=0.5;
+       if(isnan(ret.get_b())) ret.b_=0.5;
+       if(isnan(ret.get_a())) ret.a_=1;
+
+       return(ret);
+}
+
+typedef Color (*blendfunc)(Color &,Color &,float);
+
+static Color
+blendfunc_COMPOSITE(Color &src,Color &dest,float amount)
+{
+       //c_dest'=c_src+(1.0-a_src)*c_dest
+       //a_dest'=a_src+(1.0-a_src)*a_dest
+
+       float a_src=src.get_a()*amount;
+       float a_dest=dest.get_a();
+
+       // if a_arc==0.0
+       //if(fabsf(a_src)<COLOR_EPSILON) return dest;
+       
+       // Scale the source and destination by their alpha values
+       src*=a_src;
+       dest*=a_dest;
+       
+       dest=src + dest*(1.0f-a_src);
+       
+       a_dest=a_src + a_dest*(1.0f-a_src);
+
+       // if a_dest!=0.0
+       if(fabsf(a_dest)>COLOR_EPSILON)
+       {
+               dest/=a_dest;
+               dest.set_a(a_dest);
+       }
+       else
+       {
+               dest=Color::alpha();
+       }
+       assert(dest.is_valid());
+       return dest;
+}
+
+static Color
+blendfunc_STRAIGHT(Color &src,Color &bg,float amount)
+{
+       //a_out'=(a_src-a_bg)*amount+a_bg
+       //c_out'=(((c_src*a_src)-(c_bg*a_bg))*amount+(c_bg*a_bg))/a_out'
+
+       // ie: if(amount==1.0)
+       //if(fabsf(amount-1.0f)<COLOR_EPSILON)return src;
+
+       Color out;
+       
+       float a_out((src.get_a()-bg.get_a())*amount+bg.get_a());
+       
+       // if a_out!=0.0
+       if(fabsf(a_out)>COLOR_EPSILON)
+//     if(a_out>COLOR_EPSILON || a_out<-COLOR_EPSILON)
+       {
+               out=((src*src.get_a()-bg*bg.get_a())*amount+bg*bg.get_a())/a_out;
+               out.set_a(a_out);
+       }
+       else
+               out=Color::alpha();
+
+       assert(out.is_valid());
+       return out;
+}
+
+static Color
+blendfunc_ONTO(Color &a,Color &b,float amount)
+{
+       float alpha(b.get_a());
+       return blendfunc_COMPOSITE(a,b.set_a(1.0f),amount).set_a(alpha);
+}
+
+static Color
+blendfunc_STRAIGHT_ONTO(Color &a,Color &b,float amount)
+{
+       a.set_a(a.get_a()*b.get_a());
+       return blendfunc_STRAIGHT(a,b,amount);
+}
+
+static Color
+blendfunc_BRIGHTEN(Color &a,Color &b,float amount)
+{
+       const float alpha(a.get_a()*amount);
+       
+       if(b.get_r()<a.get_r()*alpha)
+               b.set_r(a.get_r()*alpha);
+
+       if(b.get_g()<a.get_g()*alpha)
+               b.set_g(a.get_g()*alpha);
+
+       if(b.get_b()<a.get_b()*alpha)
+               b.set_b(a.get_b()*alpha);
+       
+       return b;
+}
+
+static Color
+blendfunc_DARKEN(Color &a,Color &b,float amount)
+{
+       const float alpha(a.get_a()*amount);
+       
+       if(b.get_r()>(a.get_r()-1.0f)*alpha+1.0f)
+               b.set_r((a.get_r()-1.0f)*alpha+1.0f);
+
+       if(b.get_g()>(a.get_g()-1.0f)*alpha+1.0f)
+               b.set_g((a.get_g()-1.0f)*alpha+1.0f);
+
+       if(b.get_b()>(a.get_b()-1.0f)*alpha+1.0f)
+               b.set_b((a.get_b()-1.0f)*alpha+1.0f);
+
+       
+       return b;
+}
+
+static Color
+blendfunc_ADD(Color &a,Color &b,float amount)
+{
+       const float alpha(a.get_a()*amount);
+
+       b.set_r(b.get_r()+a.get_r()*alpha);
+       b.set_g(b.get_g()+a.get_g()*alpha);
+       b.set_b(b.get_b()+a.get_b()*alpha);
+
+       return b;
+}
+
+static Color
+blendfunc_SUBTRACT(Color &a,Color &b,float amount)
+{
+       const float alpha(a.get_a()*amount);
+
+       b.set_r(b.get_r()-a.get_r()*alpha);
+       b.set_g(b.get_g()-a.get_g()*alpha);
+       b.set_b(b.get_b()-a.get_b()*alpha);
+
+       return b;
+}
+
+static Color
+blendfunc_DIFFERENCE(Color &a,Color &b,float amount)
+{
+       const float alpha(a.get_a()*amount);
+
+       b.set_r(abs(b.get_r()-a.get_r()*alpha));
+       b.set_g(abs(b.get_g()-a.get_g()*alpha));
+       b.set_b(abs(b.get_b()-a.get_b()*alpha));
+
+       return b;
+}
+
+static Color
+blendfunc_MULTIPLY(Color &a,Color &b,float amount)
+{
+       if(amount<0) a=~a, amount=-amount;
+
+       amount*=a.get_a();
+       b.set_r(((b.get_r()*a.get_r())-b.get_r())*(amount)+b.get_r());
+       b.set_g(((b.get_g()*a.get_g())-b.get_g())*(amount)+b.get_g());
+       b.set_b(((b.get_b()*a.get_b())-b.get_b())*(amount)+b.get_b());
+       return b;
+}
+
+static Color
+blendfunc_DIVIDE(Color &a,Color &b,float amount)
+{
+       amount*=a.get_a();
+
+       // We add COLOR_EPSILON in order to avoid a divide-by-zero condition.
+       // This causes DIVIDE to bias toward positive values, but the effect is
+       // really neglegable. There is a reason why we use COLOR_EPSILON--we
+       // want the change to be imperceptable.
+       
+       b.set_r(((b.get_r()/(a.get_r()+COLOR_EPSILON))-b.get_r())*(amount)+b.get_r());
+       b.set_g(((b.get_g()/(a.get_g()+COLOR_EPSILON))-b.get_g())*(amount)+b.get_g());
+       b.set_b(((b.get_b()/(a.get_b()+COLOR_EPSILON))-b.get_b())*(amount)+b.get_b());
+
+       return b;
+}
+
+static Color
+blendfunc_COLOR(Color &a,Color &b,float amount)
+{
+       Color temp(b);
+       temp.set_uv(a.get_u(),a.get_v());
+       return (temp-b)*amount*a.get_a()+b;                     
+}
+
+static Color
+blendfunc_HUE(Color &a,Color &b,float amount)
+{
+       Color temp(b);
+       temp.set_hue(a.get_hue());
+       return (temp-b)*amount*a.get_a()+b;
+}
+
+static Color
+blendfunc_SATURATION(Color &a,Color &b,float amount)
+{
+       Color temp(b);
+       temp.set_s(a.get_s());
+       return (temp-b)*amount*a.get_a()+b;
+}
+
+static Color
+blendfunc_LUMINANCE(Color &a,Color &b,float amount)
+{
+       Color temp(b);
+       temp.set_y(a.get_y());
+       return (temp-b)*amount*a.get_a()+b;
+}
+
+static Color
+blendfunc_BEHIND(Color &a,Color &b,float amount)
+{
+       if(a.get_a()==0)a.set_a(COLOR_EPSILON);         //!< \hack
+       a.set_a(a.get_a()*amount);
+       return blendfunc_COMPOSITE(b,a,1.0);
+}
+
+static Color
+blendfunc_ALPHA_BRIGHTEN(Color &a,Color &b,float amount)
+{
+       if(a.get_a()<b.get_a()*amount)
+               return a.set_a(a.get_a()*amount);
+       return b;
+}
+
+static Color
+blendfunc_ALPHA_DARKEN(Color &a,Color &b,float amount)
+{
+       if(a.get_a()*amount>b.get_a())
+               return a.set_a(a.get_a()*amount);
+       return b;
+}
+
+static Color
+blendfunc_SCREEN(Color &a,Color &b,float amount)
+{
+       if(amount<0) a=~a, amount=-amount;
+
+       a.set_r(1.0-(1.0f-a.get_r())*(1.0f-b.get_r()));
+       a.set_g(1.0-(1.0f-a.get_g())*(1.0f-b.get_g()));
+       a.set_b(1.0-(1.0f-a.get_b())*(1.0f-b.get_b()));
+       
+       return blendfunc_ONTO(a,b,amount);
+}
+
+static Color
+blendfunc_OVERLAY(Color &a,Color &b,float amount)
+{      
+       if(amount<0) a=~a, amount=-amount;
+
+       Color rm;
+       rm.set_r(b.get_r()*a.get_r());
+       rm.set_g(b.get_g()*a.get_g());
+       rm.set_b(b.get_b()*a.get_b());
+
+       Color rs;
+       rs.set_r(1.0-(1.0f-a.get_r())*(1.0f-b.get_r()));
+       rs.set_g(1.0-(1.0f-a.get_g())*(1.0f-b.get_g()));
+       rs.set_b(1.0-(1.0f-a.get_b())*(1.0f-b.get_b()));
+
+       Color& ret(a);
+       
+       ret.set_r(a.get_r()*rs.get_r() + (1.0-a.get_r())*rm.get_r());
+       ret.set_g(a.get_g()*rs.get_g() + (1.0-a.get_g())*rm.get_g());
+       ret.set_b(a.get_b()*rs.get_b() + (1.0-a.get_b())*rm.get_b());
+
+       return blendfunc_ONTO(ret,b,amount);
+}
+
+static Color
+blendfunc_HARD_LIGHT(Color &a,Color &b,float amount)
+{
+       if(amount<0) a=~a, amount=-amount;
+
+       if(a.get_r()>0.5f)      a.set_r(1.0-(1.0f-(a.get_r()*2.0f-1.0f))*(1.0f-b.get_r()));
+       else                            a.set_r(b.get_r()*(a.get_r()*2.0f));
+       if(a.get_g()>0.5f)      a.set_g(1.0-(1.0f-(a.get_g()*2.0f-1.0f))*(1.0f-b.get_g()));
+       else                            a.set_g(b.get_g()*(a.get_g()*2.0f));
+       if(a.get_b()>0.5f)      a.set_b(1.0-(1.0f-(a.get_b()*2.0f-1.0f))*(1.0f-b.get_b()));
+       else                            a.set_b(b.get_b()*(a.get_b()*2.0f));
+
+       return blendfunc_ONTO(a,b,amount);
+}
+
+static Color
+blendfunc_ALPHA_OVER(Color &a,Color &b,float amount)
+{
+       Color rm(b);
+
+       //multiply the inverse alpha channel with the one below us
+       rm.set_a((1-a.get_a())*b.get_a());
+
+       return blendfunc_STRAIGHT(rm,b,amount);
+}
+
+
+Color
+Color::blend(Color a, Color b,float amount, Color::BlendMethod type)
+{
+#if 0
+       if(isnan(a.get_r()) || isnan(a.get_g()) || isnan(a.get_b()))
+       {
+#ifdef _DEBUG
+               a=magenta().set_a(a.get_a());
+#else
+               a=black().set_a(a.get_a());
+#endif
+       }
+
+       if(isnan(b.get_r()) || isnan(b.get_g()) || isnan(b.get_b()))
+       {
+#ifdef _DEBUG
+               b=magenta().set_a(b.get_a());
+#else
+               b=black().set_a(b.get_a());
+#endif
+       }
+#endif
+       
+/*
+       if(!a.is_valid()&&b.is_valid())
+               return b;
+
+       if(a.is_valid()&&!b.is_valid())
+               return a;
+
+       if(!a.is_valid()||!b.is_valid())
+       {
+#ifdef _DEBUG
+               return magenta();
+#else
+               return black();
+#endif
+       }
+*/
+       
+       // No matter what blend method is being used,
+       // if the amount is equal to zero, then only B
+       // will shine through
+       if(fabsf(amount)<=COLOR_EPSILON)return b;
+       
+       assert(type<BLEND_END);
+       
+       const static blendfunc vtable[BLEND_END]=
+       {
+               blendfunc_COMPOSITE, 
+               blendfunc_STRAIGHT,
+               blendfunc_BRIGHTEN,
+               blendfunc_DARKEN,
+               blendfunc_ADD,
+               blendfunc_SUBTRACT,
+               blendfunc_MULTIPLY,
+               blendfunc_DIVIDE,
+               blendfunc_COLOR,
+               blendfunc_HUE,
+               blendfunc_SATURATION,
+               blendfunc_LUMINANCE,
+               blendfunc_BEHIND,
+               blendfunc_ONTO,
+               blendfunc_ALPHA_BRIGHTEN,
+               blendfunc_ALPHA_DARKEN,
+               blendfunc_SCREEN,
+               blendfunc_HARD_LIGHT,
+               blendfunc_DIFFERENCE,
+               blendfunc_ALPHA_OVER,
+               blendfunc_OVERLAY,
+               blendfunc_STRAIGHT_ONTO,
+       };
+       
+       return vtable[type](a,b,amount);
+}
diff --git a/synfig-core/trunk/src/synfig/color.h b/synfig-core/trunk/src/synfig/color.h
new file mode 100644 (file)
index 0000000..849acd7
--- /dev/null
@@ -0,0 +1,861 @@
+/* === S I N F G =========================================================== */
+/*!    \file color.h
+**     \brief Color Class Implementation
+**
+**     $Id: color.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_COLOR_H
+#define __SINFG_COLOR_H
+
+/* === H E A D E R S ======================================================= */
+
+#ifndef SINFG_NO_ANGLE
+# include "angle.h"
+#endif
+
+//#include <cmath>
+#include <math.h>
+#include <cassert>
+#include "gamma.h"
+#include <string.h>
+
+#ifdef USE_HALF_TYPE
+#include <OpenEXR/half.h>
+#endif
+
+/* === M A C R O S ========================================================= */
+
+#ifndef isnan
+
+#ifdef WIN32
+#include <float.h>
+#ifndef isnan
+extern "C" { int _isnan(double x); }
+#define isnan _isnan
+#endif
+#endif
+
+#ifdef __APPLE__
+#define isnan __isnanf
+#endif
+
+#endif
+
+namespace sinfg {
+
+#ifdef USE_HALF_TYPE
+typedef half ColorReal;
+#else
+typedef float ColorReal;
+#endif
+
+static const float EncodeYUV[3][3]=
+{
+       { 0.299f, 0.587f, 0.114f },
+       { -0.168736f, -0.331264f, 0.5f },
+       { 0.5f, -0.418688f, -0.081312f }
+};
+
+static const float DecodeYUV[3][3]=
+{
+       { 1.0f, 0.0f, 1.402f },
+       { 1.0f, -0.344136f, -0.714136f },
+       { 1.0f, 1.772f, 0.0f }
+};
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+#ifdef USE_HALF_TYPE
+class ColorAccumulator;
+#endif
+
+
+
+
+/*!    \class Color
+**     \todo Writeme
+**     Future optimizations: lookup table for sqrt()?
+*/
+class Color
+{
+public:
+       typedef ColorReal value_type;
+
+private:
+       value_type a_, r_, g_, b_;
+
+public:
+
+       Color &
+       operator+=(const Color &rhs)
+       {
+               r_+=rhs.r_;
+               g_+=rhs.g_;
+               b_+=rhs.b_;
+               a_+=rhs.a_;
+               return *this;
+       }
+
+       Color &
+       operator-=(const Color &rhs)
+       {
+               r_-=rhs.r_;
+               g_-=rhs.g_;
+               b_-=rhs.b_;
+               a_-=rhs.a_;
+               return *this;
+       }
+
+       Color &
+       operator*=(const float &rhs)
+       {
+               r_*=rhs;
+               g_*=rhs;
+               b_*=rhs;
+               a_*=rhs;
+               return *this;
+       }
+
+       Color &
+       operator/=(const float &rhs)
+       {
+               const float temp(value_type(1)/rhs);
+               r_*=temp;
+               g_*=temp;
+               b_*=temp;
+               a_*=temp;
+               return *this;
+       }
+
+       Color
+       operator+(const Color &rhs)const
+       { return Color(*this)+=rhs; }
+
+       Color
+       operator-(const Color &rhs)const
+       { return Color(*this)-=rhs; }
+
+       Color
+       operator*(const float &rhs)const
+       { return Color(*this)*=rhs; }
+
+       Color
+       operator/(const float &rhs)const
+       { return Color(*this)/=rhs; }
+
+       bool
+       operator==(const Color &rhs)const
+       { return r_==rhs.r_ && g_==rhs.g_ && b_==rhs.b_ && a_==rhs.a_; }
+
+       bool
+       operator!=(const Color &rhs)const
+       { return r_!=rhs.r_ || g_!=rhs.g_ || b_!=rhs.b_ || a_!=rhs.a_; }
+
+       Color
+       operator-()const
+       { return Color(-r_,-g_,-b_,-a_); }
+
+       //! Effectively 1.0-color
+       Color
+       operator~()const
+       { return Color(1.0f-r_,1.0f-g_,1.0f-b_,a_); }
+
+       bool is_valid()const
+       { return !isnan(r_) && !isnan(g_) && !isnan(b_) && !isnan(a_); }
+       
+       Color premult_alpha() const
+       {
+               return Color (r_*a_, g_*a_, b_*a_, a_);
+       }
+       
+       Color demult_alpha() const
+       {
+               if(a_)
+               {
+                       const value_type inva = 1/a_;
+                       return Color (r_*inva, g_*inva, b_*inva, a_);
+               }else return alpha();
+       }
+
+public:
+       Color() /*:r_(0), g_(0), b_(0), a_(0)*/ { }
+       Color(const value_type &f) :a_(f),r_(f), g_(f), b_(f) { }
+       Color(int f) :a_(f),r_(f), g_(f), b_(f) { }
+
+       /*!     \param R Red
+       **      \param G Green
+       **      \param B Blue
+       **      \param A Opacity(alpha) */
+       Color(const value_type& R, const value_type& G, const value_type& B, const value_type& A=1):
+               a_(A),
+               r_(R),
+               g_(G),
+               b_(B) { }
+
+       /*!     \param C Source for color components
+       **      \param A Opacity(alpha) */
+       Color(const Color& c, const value_type& A):
+               a_(c.a_),
+               r_(c.r_),
+               g_(c.g_),
+               b_(c.b_) { }
+
+       
+       //!     Copy constructor
+       Color(const Color& c):
+               a_(c.a_),
+               r_(c.r_),
+               g_(c.g_),
+               b_(c.b_) { }
+       
+#ifdef USE_HALF_TYPE
+       friend class ColorAccumulator;
+       //!     Convert constructor
+       Color(const ColorAccumulator& c);
+#endif
+
+       //!     Copy constructor
+       //Color(const Color &c) { memcpy((void*)this, (const void*)&c, sizeof(Color)); }
+
+       /*const Color &operator=(const value_type &i)
+       {
+               r_ = g_ = b_ = a_ = i;
+               return *this;
+       }*/
+       //Color& operator=(const Color &c) { memcpy((void*)this, (const void*)&c, sizeof(Color)); return *this; }
+       
+       //! Returns the RED component
+       const value_type& get_r()const { return r_; }
+
+       //! Returns the GREEN component
+       const value_type& get_g()const { return g_; }
+
+       //! Returns the BLUE component
+       const value_type& get_b()const { return b_; }
+
+       //! Returns the amount of opacity (alpha)
+       const value_type& get_a()const { return a_; }
+       
+       //! Synonym for get_a(). \see get_a()
+       const value_type& get_alpha()const { return get_a(); }
+
+       //! Sets the RED component to \a x
+       Color& set_r(const value_type& x) { r_ = x; return *this; }
+
+       //! Sets the GREEN component to \a x
+       Color& set_g(const value_type& x) { g_ = x; return *this; }
+
+       //! Sets the BLUE component to \a x
+       Color& set_b(const value_type& x) { b_ = x; return *this; }
+
+       //! Sets the opacity (alpha) to \a x
+       Color& set_a(const value_type& x) { a_ = x; return *this; }
+       
+       //! Synonym for set_a(). \see set_a()
+       Color& set_alpha(const value_type& x) { return set_a(x); }
+
+       //! Returns color's luminance
+       float
+       get_y() const
+       {
+               return
+                       (float)get_r()*EncodeYUV[0][0]+
+                       (float)get_g()*EncodeYUV[0][1]+
+                       (float)get_b()*EncodeYUV[0][2];
+       }
+
+       
+       //! Returns U component of chromanance
+       float
+       get_u() const
+       {
+               return
+                       (float)get_r()*EncodeYUV[1][0]+
+                       (float)get_g()*EncodeYUV[1][1]+
+                       (float)get_b()*EncodeYUV[1][2];
+       }
+
+
+       //! Returns V component of chromanance
+       float
+       get_v() const
+       {
+               return
+                       (float)get_r()*EncodeYUV[2][0]+
+                       (float)get_g()*EncodeYUV[2][1]+
+                       (float)get_b()*EncodeYUV[2][2];
+       }
+
+       //! Returns the color's saturation
+       /*!     This is is the magnitude of the U and V components.
+       **      \see set_s() */
+       float
+       get_s() const
+       {
+               const float u(get_u()), v(get_v());
+               return sqrt(u*u+v*v);
+       }
+
+       //! Sets the luminance (\a y) and chromanance (\a u and \a v)
+       Color&
+       set_yuv(const float &y, const float &u, const float &v)
+       {
+               set_r(y*DecodeYUV[0][0]+u*DecodeYUV[0][1]+v*DecodeYUV[0][2]);
+               set_g(y*DecodeYUV[1][0]+u*DecodeYUV[1][1]+v*DecodeYUV[1][2]);
+               set_b(y*DecodeYUV[2][0]+u*DecodeYUV[2][1]+v*DecodeYUV[2][2]);
+               return *this;
+       }
+
+       //! Sets color luminance
+       Color& set_y(const float &y) { return set_yuv(y,get_u(),get_v()); }
+       
+       //! Set U component of chromanance
+       Color& set_u(const float &u) { return set_yuv(get_y(),u,get_v()); }
+       
+       //! Set V component of chromanance
+       Color& set_v(const float &v) { return set_yuv(get_y(),get_u(),v); }
+       
+       //! Set the U and V components of chromanance
+       Color& set_uv(const float& u, const float& v) { return set_yuv(get_y(),u,v); }
+               
+       //! Sets the color's saturation
+       /*!     \see get_s() */
+       Color&
+       set_s(const float &x)
+       {
+               float u(get_u()), v(get_v());
+               const float s(sqrt(u*u+v*v));
+               if(s)   
+               {
+                       u=(u/s)*x;
+                       v=(v/s)*x;
+                       return set_uv(u,v);
+               }
+               return *this;
+       }
+
+       //! YUV Color constructor
+       static Color YUV(const float& y, const float& u, const float& v, const value_type& a=1)
+               { return Color().set_yuv(y,u,v).set_a(a); }
+
+#ifndef SINFG_NO_ANGLE
+       //! Returns the hue of the chromanance
+       /*!     This is the angle of the U and V components.
+       **      \see set_hue() */
+       Angle
+       get_hue() const
+               { return Angle::tan(get_u(),get_v()); }
+
+       //! Synonym for get_hue(). \see get_hue()
+       Angle get_uv_angle() const { return get_hue(); }
+       
+       //! Sets the color's hue
+       /*!     \see get_hue() */
+       Color&
+       set_hue(const Angle& theta)
+       {
+               const float s(get_s());
+               const float
+                       u(s*(float)Angle::sin(theta).get()),
+                       v(s*(float)Angle::cos(theta).get());
+               return set_uv(u,v);
+       }
+
+       //! Synonym for set_hue(). \see set_hue()
+       Color& set_uv_angle(const Angle& theta) { return set_hue(theta); }
+       
+       //! Rotates the chromanance vector by amount specified by \a theta
+       Color& rotate_uv(const Angle& theta)
+       {
+               const float     a(Angle::sin(theta).get()),     b(Angle::cos(theta).get());
+               const float     u(get_u()),     v(get_v());
+               
+               return set_uv(b*u-a*v,a*u+b*v);
+       }
+               
+       //! Sets the luminance (\a y) and chromanance (\a s and \a theta).
+       /*!     \param y Luminance
+       **      \param s Saturation
+       **      \param theta Hue */
+       Color& set_yuv(const float& y, const float& s, const Angle& theta)
+       {
+               return
+                       set_yuv(
+                               y,
+                               s*(float)Angle::sin(theta).get(),
+                               s*(float)Angle::cos(theta).get()
+                       );
+       }
+
+       //! YUV color constructor where the chroma is in the saturation/hue form.
+       /*!     \param y Luminance
+       **      \param s Saturation
+       **      \param theta Hue
+       **      \param a Opacity (alpha) */
+       static Color YUV(const float& y, const float& s, const Angle& theta, const value_type& a=1)
+               { return Color().set_yuv(y,s,theta).set_a(a); }
+
+#endif
+
+       //! Clamps a color so that its values are in range. Ignores attempting to visualize negative colors.
+       Color clamped()const;
+       
+       //! Clamps a color so that its values are in range.
+       Color clamped_negative()const;
+
+       /* Preset Colors */
+
+       //! Preset Color Constructors
+       //@{
+#ifdef HAS_VIMAGE
+       static inline Color alpha() { return Color(0,0,0,0.0000001f); }
+#else
+       static inline Color alpha() { return Color(0,0,0,0); }
+#endif
+       static inline Color black() { return Color(0,0,0); }
+       static inline Color white() { return Color(1,1,1); }
+       static inline Color gray() { return Color(0.5f,0.5f,0.5f); }
+       static inline Color magenta() { return Color(1,0,1); }
+       static inline Color red() { return Color(1,0,0); }
+       static inline Color green() { return Color(0,1,0); }
+       static inline Color blue() { return Color(0,0,1); }
+       static inline Color cyan() { return Color(0,1,1); }
+       static inline Color yellow() { return Color(1,1,0); }
+       //@}
+       
+       //! \writeme
+       enum BlendMethod
+       {
+               BLEND_COMPOSITE=0,      //!< Color A is composited onto B (Taking into about A's alpha)
+               BLEND_STRAIGHT=1,       //!< Straight linear interpolation from A->B (Alpha ignored)
+               BLEND_BRIGHTEN=2,       //!< If composite is brighter than B, use composite. B otherwise.
+               BLEND_DARKEN=3,         //!< If composite is brighter than B, use composite. B otherwise.
+               BLEND_ADD=4,            //!< Simple A+B.
+               BLEND_SUBTRACT=5,       //!< Simple A-B.
+               BLEND_MULTIPLY=6,       //!< Simple A*B.
+               BLEND_DIVIDE=7,         //!< Simple B/A
+               BLEND_COLOR=8,          //!< Preserves the U and V channels of color A
+               BLEND_HUE=9,            //!< Preserves the angle of the UV vector of color A
+               BLEND_SATURATION=10,//!< Preserves the magnitude of the UV Vector of color A
+               BLEND_LUMINANCE=11,     //!< Preserves the Y channel of color A
+               BLEND_BEHIND=12,        //!< Similar to BLEND_COMPOSITE, except that B is composited onto A.
+               BLEND_ONTO=13,          //!< Similar to BLEND_COMPOSITE, except that B's alpha is maintained
+               BLEND_SCREEN=16,                //!< \writeme
+               BLEND_OVERLAY=20,               //!< \writeme
+               BLEND_DIFFERENCE=18,            //!< \writeme
+               BLEND_HARD_LIGHT=17,            //!< \writeme
+               
+               //! Deprecated
+               BLEND_ALPHA_BRIGHTEN=14,        //!< If A is less opaque than B, use A
+               BLEND_ALPHA_DARKEN=15,          //!< If A is more opaque than B, use B
+               BLEND_ALPHA_OVER=19,//!< multiply alphas and then straight blends that using the amount
+               BLEND_STRAIGHT_ONTO=21,//!< \writeme
+               
+               BLEND_END=22                    //!< \internal
+       };
+
+       /* Other */
+       static Color blend(Color a, Color b,float amount,BlendMethod type=BLEND_COMPOSITE);
+       
+       static bool is_onto(BlendMethod x)
+       {
+               return x==BLEND_BRIGHTEN
+                       || x==BLEND_DARKEN
+                       || x==BLEND_ADD
+                       || x==BLEND_SUBTRACT
+                       || x==BLEND_MULTIPLY
+                       || x==BLEND_DIVIDE
+                       || x==BLEND_COLOR
+                       || x==BLEND_HUE
+                       || x==BLEND_SATURATION
+                       || x==BLEND_LUMINANCE
+                       || x==BLEND_ONTO
+                       || x==BLEND_STRAIGHT_ONTO
+                       || x==BLEND_SCREEN
+                       || x==BLEND_OVERLAY
+                       || x==BLEND_DIFFERENCE
+                       || x==BLEND_HARD_LIGHT
+               ;
+       }
+/*protected:
+
+       value_type& operator[](const int i)
+       {
+               assert(i>=0);
+               assert(i<(signed)(sizeof(Color)/sizeof(value_type)));
+               return (&r_)[i];
+       }
+
+       const value_type& operator[](const int i)const
+       {
+               assert(i>=0);
+               assert(i<(signed)(sizeof(Color)/sizeof(value_type)));
+               return (&r_)[i];
+       }
+*/
+}; // END of class Color
+
+#ifndef USE_HALF_TYPE
+typedef Color ColorAccumulator;
+#else
+class ColorAccumulator
+{
+       friend class Color;
+public:
+       typedef float value_type;
+
+private:
+       value_type a_, r_, g_, b_;
+
+public:
+
+       ColorAccumulator &
+       operator+=(const ColorAccumulator &rhs)
+       {
+               r_+=rhs.r_;
+               g_+=rhs.g_;
+               b_+=rhs.b_;
+               a_+=rhs.a_;
+               return *this;
+       }
+
+       ColorAccumulator &
+       operator-=(const ColorAccumulator &rhs)
+       {
+               r_-=rhs.r_;
+               g_-=rhs.g_;
+               b_-=rhs.b_;
+               a_-=rhs.a_;
+               return *this;
+       }
+
+       ColorAccumulator &
+       operator*=(const float &rhs)
+       {
+               r_*=rhs;
+               g_*=rhs;
+               b_*=rhs;
+               a_*=rhs;
+               return *this;
+       }
+
+       ColorAccumulator &
+       operator/=(const float &rhs)
+       {
+               const float temp(value_type(1)/rhs);
+               r_*=temp;
+               g_*=temp;
+               b_*=temp;
+               a_*=temp;
+               return *this;
+       }
+
+       ColorAccumulator
+       operator+(const ColorAccumulator &rhs)const
+       { return Color(*this)+=rhs; }
+
+       ColorAccumulator
+       operator-(const ColorAccumulator &rhs)const
+       { return Color(*this)-=rhs; }
+
+       ColorAccumulator
+       operator*(const float &rhs)const
+       { return Color(*this)*=rhs; }
+
+       ColorAccumulator
+       operator/(const float &rhs)const
+       { return Color(*this)/=rhs; }
+
+       bool
+       operator==(const ColorAccumulator &rhs)const
+       { return r_==rhs.r_ && g_==rhs.g_ && b_==rhs.b_ && a_!=rhs.a_; }
+
+       bool
+       operator!=(const ColorAccumulator &rhs)const
+       { return r_!=rhs.r_ || g_!=rhs.g_ || b_!=rhs.b_ || a_!=rhs.a_; }
+
+       Color
+       operator-()const
+       { return ColorAccumulator(-r_,-g_,-b_,-a_); }
+
+       bool is_valid()const
+       { return !isnan(r_) && !isnan(g_) && !isnan(b_) && !isnan(a_); }
+
+public:
+       ColorAccumulator() { }
+
+       /*!     \param R Red
+       **      \param G Green
+       **      \param B Blue
+       **      \param A Opacity(alpha) */
+       ColorAccumulator(const value_type& R, const value_type& G, const value_type& B, const value_type& A=1):
+               a_(A),
+               r_(R),
+               g_(G),
+               b_(B) { }
+
+       //!     Copy constructor
+       ColorAccumulator(const ColorAccumulator& c):
+               a_(c.a_),
+               r_(c.r_),
+               g_(c.g_),
+               b_(c.b_) { }
+
+       //!     Converter
+       ColorAccumulator(const Color& c):
+               a_(c.a_),
+               r_(c.r_),
+               g_(c.g_),
+               b_(c.b_) { }
+
+       //! Returns the RED component
+       const value_type& get_r()const { return r_; }
+
+       //! Returns the GREEN component
+       const value_type& get_g()const { return g_; }
+
+       //! Returns the BLUE component
+       const value_type& get_b()const { return b_; }
+
+       //! Returns the amount of opacity (alpha)
+       const value_type& get_a()const { return a_; }
+       
+       //! Synonym for get_a(). \see get_a()
+       const value_type& get_alpha()const { return get_a(); }
+
+       //! Sets the RED component to \a x
+       ColorAccumulator& set_r(const value_type& x) { r_ = x; return *this; }
+
+       //! Sets the GREEN component to \a x
+       ColorAccumulator& set_g(const value_type& x) { g_ = x; return *this; }
+
+       //! Sets the BLUE component to \a x
+       ColorAccumulator& set_b(const value_type& x) { b_ = x; return *this; }
+
+       //! Sets the opacity (alpha) to \a x
+       ColorAccumulator& set_a(const value_type& x) { a_ = x; return *this; }
+       
+       //! Synonym for set_a(). \see set_a()
+       ColorAccumulator& set_alpha(const value_type& x) { return set_a(x); }
+};
+
+inline
+Color::Color(const ColorAccumulator& c):
+       a_(c.a_),
+       r_(c.r_),
+       g_(c.g_),
+       b_(c.b_) { }
+
+#endif
+
+
+
+
+
+enum PixelFormat
+{
+/* Bit Descriptions (ON/OFF)
+** ----+-------------
+** 0   Color Channels (Gray/RGB)
+** 1   Alpha Channel (WITH/WITHOUT)
+** 2   ZDepth  (WITH/WITHOUT)
+** 3   Endian (BGR/RGB)
+** 4   Alpha Location (Start/End)
+** 5   ZDepth Location (Start/End)
+** 6   Alpha/ZDepth Arangement (ZA,AZ)
+** 7   Alpha Range (Inverted,Normal)
+** 8   Z Range (Inverted,Normal)
+*/
+       PF_RGB=0,
+       PF_GRAY=(1<<0),                 //!< If set, use one grayscale channel. If clear, use three channels for RGB
+       PF_A=(1<<1),                    //!< If set, include alpha channel
+       PF_Z=(1<<2),                    //!< If set, include ZDepth channel
+       PF_BGR=(1<<3),                  //!< If set, reverse the order of the RGB channels
+       PF_A_START=(1<<4),              //!< If set, alpha channel is before the color data. If clear, it is after.
+       PF_Z_START=(1<<5),              //!< If set, ZDepth channel is before the color data. If clear, it is after.
+       PF_ZA=(1<<6),                   //!< If set, the ZDepth channel will be infront of the alpha channel. If clear, they are reversed.
+
+       PF_A_INV=(1<<7),                //!< If set, the alpha channel is stored as 1.0-a
+       PF_Z_INV=(1<<8),                //!< If set, the ZDepth channel is stored as 1.0-z
+       PF_RAW_COLOR=(1<<9)+(1<<1)      //!< If set, the data represents a raw Color datastructure, and all other bits are ignored.
+};
+
+inline PixelFormat operator|(PixelFormat lhs, PixelFormat rhs)
+       { return static_cast<PixelFormat>((int)lhs|(int)rhs); }
+       
+inline PixelFormat operator&(PixelFormat lhs, PixelFormat rhs)
+       { return static_cast<PixelFormat>((int)lhs&(int)rhs); }
+#define FLAGS(x,y)             (((x)&(y))==(y))
+
+//! Returns the number of channels that the given PixelFormat calls for
+inline int
+channels(PixelFormat x)
+{
+       int chan=0;
+       if(FLAGS(x,PF_GRAY))
+               ++chan;
+       else
+               chan+=3;
+       if(FLAGS(x,PF_A))
+               ++chan;
+       if(FLAGS(x,PF_Z))
+               ++chan;
+       if(FLAGS(x,PF_RAW_COLOR))
+               chan=sizeof(Color);
+               
+       return chan;
+}
+
+inline unsigned char *
+Color2PixelFormat(const Color &color, const PixelFormat &pf, unsigned char *out, const Gamma &gamma)
+{
+       if(FLAGS(pf,PF_RAW_COLOR))
+       {
+               Color *outcol=reinterpret_cast<Color *>(out);
+               *outcol=color;
+               out+=sizeof(color);
+               return out;
+       }
+
+       int alpha=(int)((FLAGS(pf,PF_A_INV)?(-(float)color.get_a()+1):(float)color.get_a())*255);
+       if(alpha<0)alpha=0;
+       if(alpha>255)alpha=255;
+               
+       if(FLAGS(pf,PF_ZA|PF_A_START|PF_Z_START))
+       {
+               if(FLAGS(pf,PF_Z_START))
+                       *out++/*=(unsigned char)(color.GetZ()*255.0f)*/;
+               if(FLAGS(pf,PF_A_START))
+                       *out++=static_cast<unsigned char>(alpha);
+       }
+       else
+       {
+               if(FLAGS(pf,PF_A_START))
+                       *out++=static_cast<unsigned char>(alpha);
+               if(FLAGS(pf,PF_Z_START))
+                       *out++/*=(unsigned char)(color.GetZ()*255.0f)*/;
+               
+       }
+
+       if(FLAGS(pf,PF_GRAY))
+               *out++=static_cast<unsigned char>(gamma.g_F32_to_U8(color.get_y()));
+       else
+       {
+               if(FLAGS(pf,PF_BGR))
+               {
+                       *out++=static_cast<unsigned char>(gamma.r_F32_to_U8(color.get_b()));
+                       *out++=static_cast<unsigned char>(gamma.g_F32_to_U8(color.get_g()));
+                       *out++=static_cast<unsigned char>(gamma.b_F32_to_U8(color.get_r()));
+               }
+               else
+               {
+                       *out++=static_cast<unsigned char>(gamma.r_F32_to_U8(color.get_r()));
+                       *out++=static_cast<unsigned char>(gamma.g_F32_to_U8(color.get_g()));
+                       *out++=static_cast<unsigned char>(gamma.b_F32_to_U8(color.get_b()));
+               }
+       }
+       
+       if(FLAGS(pf,PF_ZA))
+       {
+               if(!FLAGS(pf,PF_Z_START) && FLAGS(pf,PF_Z))
+                       out++;//*out++=(unsigned char)(color.GetZ()*255.0f);
+               if(!FLAGS(pf,PF_A_START) && FLAGS(pf,PF_A))
+                       *out++=static_cast<unsigned char>(alpha);
+       }
+       else
+       {
+               if(!FLAGS(pf,PF_Z_START) && FLAGS(pf,PF_Z))
+                       out++;//*out++=(unsigned char)(color.GetZ()*255.0f);
+               if(!FLAGS(pf,PF_A_START) && FLAGS(pf,PF_A))
+                       *out++=static_cast<unsigned char>(alpha);
+       }
+       return out;
+}
+
+inline void
+convert_color_format(unsigned char *dest, const Color *src, int w, PixelFormat pf,const Gamma &gamma)
+{
+       assert(w>=0);
+       while(w--)
+               dest=Color2PixelFormat((*(src++)).clamped(),pf,dest,gamma);
+}
+
+inline const unsigned char *
+PixelFormat2Color(Color &color, const PixelFormat &pf,const unsigned char *out)
+{
+       if(FLAGS(pf,PF_ZA|PF_A_START|PF_Z_START))
+       {
+               if(FLAGS(pf,PF_Z_START))
+                       out++;//color.SetZ((Color::value_type)*out++/255.0f);
+               if(FLAGS(pf,PF_A_START))
+                       color.set_a((float)*out++/255);
+       }
+       else
+       {
+               if(FLAGS(pf,PF_A_START))
+                       color.set_a((float)*out++/255);
+               if(FLAGS(pf,PF_Z_START))
+                       out++;//color.SetZ((Color::value_type)*out++/255.0f);
+       }
+
+       if(FLAGS(pf,PF_GRAY))
+               color.set_yuv((float)*out++/255,0,0);
+       else
+       {
+               if(FLAGS(pf,PF_BGR))
+               {
+                       color.set_b((float)*out++/255);
+                       color.set_g((float)*out++/255);
+                       color.set_r((float)*out++/255);
+               }
+               else
+               {
+                       color.set_r((float)*out++/255);
+                       color.set_g((float)*out++/255);
+                       color.set_b((float)*out++/255);
+               }
+       }
+       
+       if(FLAGS(pf,PF_ZA))
+       {
+               if(!FLAGS(pf,PF_Z_START) && FLAGS(pf,PF_Z))
+                       out++;//color.SetZ((Color::value_type)*out++/255.0f);
+               if(!FLAGS(pf,PF_A_START) && FLAGS(pf,PF_A))
+                       color.set_a((float)*out++/255);
+       }
+       else
+       {
+               if(!FLAGS(pf,PF_A_START) && FLAGS(pf,PF_A))
+                       color.set_a((float)*out++/255);
+               if(!FLAGS(pf,PF_Z_START) && FLAGS(pf,PF_Z))
+                       out++;//color.SetZ((Color::value_type)*out++/255.0f);
+       }
+       return out;
+}
+
+
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/context.cpp b/synfig-core/trunk/src/synfig/context.cpp
new file mode 100644 (file)
index 0000000..617238d
--- /dev/null
@@ -0,0 +1,368 @@
+/* === S I N F G =========================================================== */
+/*!    \file template.cpp
+**     \brief Template File
+**
+**     $Id: context.cpp,v 1.4 2005/01/24 05:00:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "context.h"
+#include "layer.h"
+#include "string.h"
+#include "vector.h"
+#include "color.h"
+#include "surface.h"
+#include "renddesc.h"
+#include "valuenode.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+//#define SINFG_PROFILE_LAYERS
+//#define SINFG_DEBUG_LAYERS
+
+/* === G L O B A L S ======================================================= */
+
+#ifdef SINFG_PROFILE_LAYERS
+#include <ETL/clock>
+static int depth(0);
+static std::map<String,float> time_table;
+static std::map<String,int> run_table;
+static etl::clock profile_timer;
+static String curr_layer;
+static void
+_print_profile_report()
+{
+       sinfg::info(">>>> Profile Report: (Times are in msecs)");
+       std::map<String,float>::iterator iter;
+       float total_time(0);
+       for(iter=time_table.begin();iter!=time_table.end();++iter)
+       {
+               String layer(iter->first);
+               float time(iter->second);
+               int runs(run_table[layer]);
+               total_time+=time;
+               sinfg::info(" Layer \"%s\",\tExecs: %03d, Avg Time: %05.1f, Total Time: %05.1f",layer.c_str(),runs,time/runs*1000,time*1000);
+       }
+       sinfg::info("Total Time: %f seconds", total_time);
+       sinfg::info("<<<< End of Profile Report");
+}
+
+#endif
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Color
+Context::get_color(const Point &pos)const
+{
+       Context context(*this);
+               
+       while(!context->empty())
+       {       
+               // If this layer is active, then go
+               // ahead and break out of the loop
+               if((*context)->active())
+                       break;
+               
+               // Otherwise, we want to keep searching
+               // till we find either an active layer,
+               // or the end of the layer list
+               ++context;
+       }
+
+       // If this layer isn't defined, return alpha
+       if((context)->empty()) return Color::alpha();
+
+       RWLock::ReaderLock lock((*context)->get_rw_lock());
+
+       return (*context)->get_color(context+1, pos);
+}
+
+Rect
+Context::get_full_bounding_rect()const
+{
+       Context context(*this);
+               
+       while(!context->empty())
+       {       
+               // If this layer is active, then go
+               // ahead and break out of the loop
+               if((*context)->active())
+                       break;
+               
+               // Otherwise, we want to keep searching
+               // till we find either an active layer,
+               // or the end of the layer list
+               ++context;
+       }
+
+       if(context->empty())
+               return Rect::zero();
+
+       return (*context)->get_full_bounding_rect(*this+1);
+}
+
+
+/* Profiling will go like this:
+       Profile start = +, stop = -
+
+       +
+       -
+
+       time diff is recorded
+
+       to get the independent times we need to break at the one inside and record etc...
+       so it looks more like this:
+
+       +
+         -
+         +
+               -
+               +
+                       ...
+               -
+               +
+         -
+         +
+       -
+       
+       at each minus we must record all the info for that which we are worried about...
+       each layer can do work before or after the other work is done... so both values must be recorded...
+*/
+
+bool
+Context::accelerated_render(Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb) const
+{
+       #ifdef SINFG_PROFILE_LAYERS
+       String layer_name(curr_layer);
+       
+       //sum the pre-work done by layer above us... (curr_layer is layer above us...)
+       if(depth>0)
+       {
+               time_table[curr_layer]+=profile_timer();
+               //if(run_table.count(curr_layer))run_table[curr_layer]++;
+               //      else run_table[curr_layer]=1;
+       }
+       #endif
+
+       const Rect bbox(renddesc.get_rect());
+       
+       Context context(*this);
+       for(;!(context)->empty();++context)
+       {
+               // If we are not active
+               // then move on to next layer
+               if(!(*context)->active())
+                       continue;
+               
+               const Rect layer_bounds((*context)->get_bounding_rect());
+               
+               // If the box area is less than zero
+               // then move on to next layer
+               if(layer_bounds.area()<=0.0000000000001)
+                       continue;
+               
+               // If the boxes do not intersect
+               // then move on to next layer
+               if(!(layer_bounds && bbox))
+                       continue;
+               
+               // Break out of the loop--we have found a good layer
+               break;
+       }
+
+       // If this layer isn't defined, return alpha
+       if((context)->empty())
+       {
+#ifdef SINFG_DEBUG_LAYERS
+               sinfg::info("Context::accelerated_render(): Hit end of list");
+#endif
+               surface->set_wh(renddesc.get_w(),renddesc.get_h());
+               surface->clear();
+               #ifdef SINFG_PROFILE_LAYERS
+               profile_timer.reset();  
+               #endif
+               return true;
+       }
+
+#ifdef SINFG_DEBUG_LAYERS
+       sinfg::info("Context::accelerated_render(): Descending into %s",(*context)->get_name().c_str());
+#endif
+
+       try {
+               RWLock::ReaderLock lock((*context)->get_rw_lock());
+               
+       #ifdef SINFG_PROFILE_LAYERS
+       
+       //go down one layer :P
+       depth++;
+       curr_layer=(*context)->get_name();      //make sure the layer inside is referring to the correct layer outside
+       profile_timer.reset();                                                                          // +
+       bool ret((*context)->accelerated_render(context+1,surface,quality,renddesc, cb));
+       
+       //post work for the previous layer
+       time_table[curr_layer]+=profile_timer();                                                        //-
+       if(run_table.count(curr_layer))run_table[curr_layer]++;
+               else run_table[curr_layer]=1;
+
+       depth--;
+       curr_layer = layer_name; //we are now onto this layer (make sure the post gets recorded correctly...
+               
+       //print out the table it we're done...
+       if(depth==0) _print_profile_report(),time_table.clear(),run_table.clear();
+       profile_timer.reset();                                                                                          //+
+       return ret;
+       #else
+       return (*context)->accelerated_render(context+1,surface,quality,renddesc, cb);
+       #endif
+
+       }
+       catch(std::bad_alloc)
+       {
+               sinfg::error("Context::accelerated_render(): Layer \"%s\" threw a bad_alloc exception!",(*context)->get_name().c_str());
+#ifdef _DEBUG
+               return false;
+#else
+               ++context;
+               return context.accelerated_render(surface, quality, renddesc, cb);
+#endif
+       }
+       catch(...)
+       {
+               sinfg::error("Context::accelerated_render(): Layer \"%s\" threw an exception, rethrowing...",(*context)->get_name().c_str());
+               throw;          
+       }
+}
+
+void
+Context::set_time(Time time)const
+{
+       Context context(*this);
+       while(!(context)->empty())
+       {       
+               // If this layer is active, then go
+               // ahead and break out of the loop
+               if((*context)->active() && !(*context)->dirty_time_.is_equal(time))
+                       break;
+               
+               // Otherwise, we want to keep searching
+               // till we find either an active layer,
+               // or the end of the layer list
+               ++context;
+       }
+
+       // If this layer isn't defined, just return
+       if((context)->empty()) return;
+
+       // Set up a wrter lock
+       RWLock::WriterLock lock((*context)->get_rw_lock());
+
+       //sinfg::info("%s: dirty_time=%f",(*context)->get_name().c_str(),(float)(*context)->dirty_time_);
+       //sinfg::info("%s: time=%f",(*context)->get_name().c_str(),(float)time);
+
+       {
+               Layer::ParamList params;
+               Layer::DynamicParamList::const_iterator iter;
+               
+               for(iter=(*context)->dynamic_param_list().begin();iter!=(*context)->dynamic_param_list().end();iter++)
+                       params[iter->first]=(*iter->second)(time);
+               
+               (*context)->set_param_list(params);
+
+               (*context)->set_time(context+1,time);
+               (*context)->dirty_time_=time;
+
+       }
+}
+
+void
+Context::set_time(Time time,const Vector &pos)const
+{
+       set_time(time);
+/*
+       Context context(*this);
+       while(!(context)->empty())
+       {       
+               // If this layer is active, then go
+               // ahead and break out of the loop
+               if((*context)->active())
+                       break;
+               
+               // Otherwise, we want to keep searching
+               // till we find either an active layer,
+               // or the end of the layer list
+               ++context;
+       }
+
+       // If this layer isn't defined, just return
+       if((context)->empty()) return;
+
+       else
+       {
+               Layer::ParamList params;
+               Layer::DynamicParamList::const_iterator iter;
+               
+               for(iter=(*context)->dynamic_param_list().begin();iter!=(*context)->dynamic_param_list().end();iter++)
+                       params[iter->first]=(*iter->second)(time);
+               
+               (*context)->set_param_list(params);
+
+               (*context)->set_time(context+1,time,pos);
+       }
+*/
+}
+
+etl::handle<Layer>
+Context::hit_check(const Point &pos)const
+{
+       Context context(*this);
+       
+       while(!context->empty())
+       {       
+               // If this layer is active, then go
+               // ahead and break out of the loop
+               if((*context)->active())
+                       break;
+               
+               // Otherwise, we want to keep searching
+               // till we find either an active layer,
+               // or the end of the layer list
+               ++context;
+       }
+
+       // If this layer isn't defined, return an empty handle
+       if((context)->empty()) return 0;
+
+       return (*context)->hit_check(context+1, pos);
+}
diff --git a/synfig-core/trunk/src/synfig/context.h b/synfig-core/trunk/src/synfig/context.h
new file mode 100644 (file)
index 0000000..a3a6c3f
--- /dev/null
@@ -0,0 +1,86 @@
+/* === S I N F G =========================================================== */
+/*!    \file context.h
+**     \brief Template Header
+**
+**     $Id: context.h,v 1.2 2005/01/24 03:08:17 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_CONTEXT_H
+#define __SINFG_CONTEXT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "canvasbase.h"
+#include "rect.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Vector;
+typedef Vector Point;
+class Color;
+class Surface;
+class RendDesc;
+class ProgressCallback;
+class Layer;
+class Time;
+class Rect;
+       
+/*!    \class Context
+**     \todo writeme
+**     \see Layer, Canvas */
+class Context : public CanvasBase::const_iterator
+{
+public:
+       Context() { }
+
+       Context(const CanvasBase::const_iterator &x):CanvasBase::const_iterator(x) { }
+
+       Context operator=(const CanvasBase::const_iterator &x)
+       { return CanvasBase::const_iterator::operator=(x); }
+       
+       /*!     \todo write me */
+       Color get_color(const Point &pos)const;
+
+       /*!     \todo write me */
+       bool accelerated_render(Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb) const;
+
+       /*!     \todo write me */
+       void set_time(Time time)const;
+
+       /*!     \writeme */
+       void set_time(Time time,const Vector &pos)const;
+
+       Rect get_full_bounding_rect()const;
+
+       /*! \writeme */
+       virtual etl::handle<Layer> hit_check(const Point &point)const;
+
+}; // END of class Context
+       
+}; // END of namespace sinfg
+       
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/curve_helper.cpp b/synfig-core/trunk/src/synfig/curve_helper.cpp
new file mode 100644 (file)
index 0000000..62023f8
--- /dev/null
@@ -0,0 +1,703 @@
+/* === S I N F G =========================================================== */
+/*!    \file curve_helper.cpp
+**     \brief Curve Helper File
+**
+**     $Id: curve_helper.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "curve_helper.h"
+
+#include <algorithm>
+#include <vector>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+#define ERR    1e-11
+const Real ERROR = 1e-11;
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+/* === E N T R Y P O I N T ================================================= */
+
+Real sinfg::find_closest(const etl::bezier<Point> &curve, const Point &point, 
+                               float step, Real *dout, float *tout)
+{
+#if 0
+       float time(curve.find_closest(point,4));
+       Real dist((curve(time)-point).mag());
+       if(dout) *dout=dist;
+       if(tout) *tout=time;
+       return time;
+#else  
+       Real d,closest = 1.0e50;
+       float t,time,closestt = -1;     
+       Vector p0,p1,end;
+       
+       if(dout && *dout > 0)
+               closest = *dout;
+
+       p0 = curve[0];
+       end = curve[3];
+
+       for(t = step; t < 1; t+=step, p0=p1)
+       {
+               p1 = curve(t);
+               d = line_point_distsq(p0,p1,point,time);
+               
+               if(d<closest)
+               {
+                       closest=d;
+                       closestt = t-step + time*step;//t+(time-1)*step; //time between [t-step,t]
+               }
+       }
+       
+       d = line_point_distsq(p0,end,point,time);
+       if(d<closest)
+       {
+               closest = d;
+               closestt= t-step + time*(1-t+step); //time between [t-step,1.0]
+       }
+
+       //set the time value if we found a closer point
+       if(closestt >=0)
+       {
+               if(tout) *tout = closestt;
+       }
+               
+       return closest;
+#endif
+}
+
+// Line and BezHull Definitions
+void BezHull::Bound(const etl::bezier<Point> &b)
+{
+       #if 1
+       
+       //with a starting vertex, find the only vertex that has all other vertices on it's right        
+       int i,j;
+       int first,cur,last;
+       
+       float d,ds;
+       
+       Vector n,vi;
+       Vector::value_type      deqn;
+       
+       //get left most vertex
+       d = b[0][0];
+       first = 0;
+       for(i = 1; i < 4; ++i)
+       {
+               if(b[i][0] < d)
+               {
+                       d = b[i][0];
+                       first = i;                      
+               }
+       }
+       cur = last = first;
+       size = 0;
+       
+       //find the farthest point with all points on right
+       ds = 0;
+       do //should reassign cur so it won't break on first step
+       {               
+               for(i = 0; i < 4; ++i)
+               {
+                       if(i == cur || i == last) continue;
+                       
+                       //rotate vector to right to make normal
+                       vi = -(b[i] - b[cur]).perp();
+                       d = vi.mag_squared();
+                       
+                       //we want only the farthest (solves the case with many points on a line)
+                       if(d > ds)
+                       {
+                               ds = d;
+                               deqn = n*b[cur];
+                               for(j = 0; j < 4; ++j)
+                               {
+                                       d = n*b[i] - deqn;
+                                       if(d < 0) break; //we're on left, nope!
+                               }
+                               
+                               //everyone is on right... yay! :)
+                               if(d >= 0)
+                               {
+                                       //advance point and add last one into hull
+                                       p[size++] = p[last];
+                                       last = cur;
+                                       cur = i;                                        
+                               }
+                       }
+               }
+       }while(cur != first);
+       
+       #else
+
+       //will work but does not keep winding order
+       
+       //convex hull alg.
+       //build set of line segs which have no points on other side...
+       //start with initial normal segments
+       
+       //start with single triangle
+       p[0] = b[0];
+       p[1] = b[1];
+       p[2] = b[2];
+       p[3] = b[3];
+       
+       //initial reject (if point is inside triangle don't care)
+       {
+               Vector v1,v2,vp;
+               
+               v1 = p[1]-p[0];
+               v2 = p[2]-p[0];
+               
+               vp = p[3]-p[0];
+
+               float   s = (vp*v1) / (v1*v1),
+                               t = (vp*v2) / (v2*v2);
+               
+               //if we're inside the triangle we don't this sissy point
+               if( s >= 0 && s <= 1 && t >= 0 && t <= 1 )
+               {
+                       size = 3;
+                       return;
+               }                       
+       }
+       
+       //expand triangle based on info...
+       bool line;
+       int index,i,j;
+       float ds,d;
+       
+       //distance from point to vertices
+       line = false;
+       index = 0;
+       ds = (p[0]-b[3]).mag_squared();
+       for(i = 1; i < 3; ++i)
+       {
+               d = (p[3]-p[i]).mag_squared();
+               if(d < ds)
+               {
+                       index = i;
+                       ds = d;                 
+               }
+       }
+       
+       //distance to line
+       float t;
+       j = 2;
+       for(i = 0; i < 3; j = i++)
+       {
+               d = line_point_distsq(p[j],p[i],b[4],t);
+               if(d < ds)
+               {
+                       index = j;
+                       ds = d;
+                       line = true;
+               }
+       }
+       
+       //We don't need no stinkin extra vertex, just replace
+       if(!line)
+       {
+               p[index] = p[3];
+               size = 3;
+       }else
+       {
+               //must expand volume to work with point...
+               //      after the index then
+               
+               /* Pattern:
+                       0 - push 1,2 -> 2,3
+                       1 - push 2 -> 3
+                       2 - none
+               */
+               for(i = 3; i > index+1; --i)
+               {
+                       p[i] = p[i-1];
+               }
+               
+               p[index] = b[3]; //recopy b3
+               size = 4;
+       }
+       
+       #endif
+}
+
+//Line Intersection
+int 
+sinfg::intersect(const Point &p1, const Vector &v1, float &t1, 
+                                       const Point &p2, const Vector &v2, float &t2)
+{
+       /* Parametric intersection:
+               l1 = p1 + tv1, l2 = p2 + sv2
+       
+               0 = p1+tv1-(p2+sv2)
+               group parameters: sv2 - tv1 = p1-p2
+       
+               ^ = transpose
+               invert matrix (on condition det != 0):
+               A[t s]^ = [p1-p2]^
+               
+               A = [-v1 v2]
+       
+               det = v1y.v2x - v1x.v2y
+       
+               if non 0 then A^-1 = invdet * | v2y -v2x |
+                                                                         | v1y -v1x |
+               
+               [t s]^ = A^-1 [p1-p2]^
+       */      
+       
+       Vector::value_type det = v1[1]*v2[0] - v1[0]*v2[1];
+       
+       //is determinant valid?
+       if(det > ERR || det < -ERR)
+       {
+               Vector p_p = p1-p2;
+                               
+               det = 1/det;
+               
+               t1 = det*(v2[1]*p_p[0] - v2[0]*p_p[1]);
+               t2 = det*(v1[1]*p_p[0] - v1[0]*p_p[1]);
+               
+               return 1;
+       }
+       
+       return 0;
+}
+
+//Returns the true or false intersection of a rectangle and a line
+int intersect(const Rect &r, const Point &p, const Vector &v)
+{
+       float t[4] = {0};
+       
+       /*get horizontal intersections and then vertical intersections 
+               and intersect them 
+       
+               Vertical planes - n = (1,0)
+               Horizontal planes - n = (0,1)
+
+               so if we are solving for ray with implicit line 
+       */
+       
+       //solve horizontal      
+       if(v[0] > ERR || v[0] < -ERR)
+       {
+               //solve for t0, t1
+               t[0] = (r.minx - p[0])/v[0];
+               t[1] = (r.maxx - p[0])/v[0];
+       }else
+       {
+               return (int)(p[1] >= r.miny && p[1] <= r.maxy);
+       }
+       
+       //solve vertical
+       if(v[1] > ERR || v[1] < -ERR)
+       {
+               //solve for t0, t1
+               t[2] = (r.miny - p[1])/v[1];
+               t[3] = (r.maxy - p[1])/v[1];
+       }else
+       {
+               return (int)(p[0] >= r.minx && p[0] <= r.maxx);
+       }
+
+       return (int)(t[0] <= t[3] && t[1] >= t[2]);
+}
+
+int sinfg::intersect(const Rect &r, const Point &p)
+{
+       return (p[1] < r.maxy && p[1] > r.miny) && p[0] > r.minx;
+}
+
+//returns 0 or 1 for true or false number of intersections of a ray with a bezier convex hull
+int intersect(const BezHull &bh, const Point &p, const Vector &v)
+{
+       float mint = 0, maxt = 1e20;
+
+       //polygon cliping
+       Vector n;
+       Vector::value_type      nv;
+       
+       Point last = bh.p[3];
+       for(int i = 0; i < bh.size; ++i)
+       {
+               n = (bh.p[i] - last).perp(); //rotate 90 deg.
+               
+               /*
+                       since rotated left
+                       if n.v  < 0 - going in
+                                       > 0 - going out
+                                       = 0 - parallel
+               */
+               nv = n*v;
+
+               //going OUT
+               if(nv > ERR)
+               {
+                       maxt = min(maxt,(float)((n*(p-last))/nv));
+               }else 
+               if( nv < -ERR) //going IN
+               {
+                       mint = max(mint,(float)((n*(p-last))/nv));
+               }else
+               {
+                       if( n*(p-last) > 0 ) //outside entirely
+                       {
+                               return 0;
+                       }
+               }
+               
+               last = bh.p[i];
+       }
+       
+       return 0;
+}
+
+int Clip(const Rect &r, const Point &p1, const Point &p2, Point *op1, Point *op2)
+{
+       float t1=0,t2=1;
+       Vector v=p2-p1;
+       
+       /*get horizontal intersections and then vertical intersections 
+               and intersect them 
+       
+               Vertical planes - n = (1,0)
+               Horizontal planes - n = (0,1)
+
+               so if we are solving for ray with implicit line 
+       */
+       
+       //solve horizontal
+       if(v[0] > ERR || v[0] < -ERR)
+       {
+               //solve for t0, t1
+               float   tt1 = (r.minx - p1[0])/v[0],
+                               tt2 = (r.maxx - p1[0])/v[0];
+               
+               //line in positive direction (normal comparisons
+               if(tt1 < tt2)
+               {
+                       t1 = max(t1,tt1);
+                       t2 = min(t2,tt2);
+               }else
+               {
+                       t1 = max(t1,tt2);
+                       t2 = min(t2,tt1);
+               }
+       }else
+       {
+               if(p1[1] < r.miny || p1[1] > r.maxy)
+                       return 0;
+       }
+       
+       //solve vertical
+       if(v[1] > ERR || v[1] < -ERR)
+       {
+               //solve for t0, t1
+               float   tt1 = (r.miny - p1[1])/v[1],
+                               tt2 = (r.maxy - p1[1])/v[1];
+               
+               //line in positive direction (normal comparisons
+               if(tt1 < tt2)
+               {
+                       t1 = max(t1,tt1);
+                       t2 = min(t2,tt2);
+               }else
+               {
+                       t1 = max(t1,tt2);
+                       t2 = min(t2,tt1);
+               }
+       }else
+       {
+               if(p1[0] < r.minx || p1[0] > r.maxx)
+                       return 0;
+       }
+
+       if(op1) *op1 = p1 + v*t1;
+       if(op2) *op2 = p1 + v*t2;
+               
+       return 1;
+}
+
+static void clean_bez(const bezier<Point> &b, bezier<Point> &out)
+{
+       bezier<Point> temp;
+
+       temp = b;       
+       temp.set_r(0);
+       temp.set_s(1);
+       
+       if(b.get_r() != 0)
+               temp.subdivide(0,&temp,b.get_r());
+       
+       if(b.get_s() != 1)
+               temp.subdivide(&temp,0,b.get_s());
+       
+       out = temp;
+}
+
+// CIntersect Definitions
+
+CIntersect::CIntersect()
+       : max_depth(10) //depth of 10 means timevalue parameters will have an approx. error bound of 2^-10
+{
+} 
+
+struct CIntersect::SCurve
+{
+       bezier<Point>   b;              //the current subdivided curve
+       float rt,st;
+       //float                         mid,    //the midpoint time value on this section of the subdivided curve
+       //                              scale;  //the current delta in time values this curve would be on original curve
+       
+       float   mag;                    //approximate sum of magnitudes of each edge of control polygon
+       Rect    aabb;                   //Axis Aligned Bounding Box for quick (albeit less accurate) collision
+
+       SCurve() {}
+
+       SCurve(const bezier<Point> &c,float rin, float sin)
+       :b(c),rt(rin),st(sin),mag(1) 
+       {
+               Bound(aabb,b);
+       }
+       
+       void Split(SCurve &l, SCurve &r) const
+       {
+               b.subdivide(&l.b,&r.b);
+               
+               l.rt = rt;
+               r.st = st;
+               l.st = r.rt = (rt+st)/2;
+
+               Bound(l.aabb,l.b);
+               Bound(r.aabb,r.b);
+       }
+};
+
+//Curve to the left of point test
+static int recurse_intersect(const CIntersect::SCurve &b, const Point &p1, int depthleft = 10)
+{
+       //reject when the line does not intersect the bounding box
+       if(!intersect(b.aabb,p1)) return 0;
+
+       //accept curves (and perform super detailed check for intersections)
+       //if the values are below tolerance
+       
+       //NOTE FOR BETTERING OF ALGORITHM: SHOULD ALSO/IN-PLACE-OF CHECK MAGNITUDE OF EDGES (or approximate)
+       if(depthleft <= 0)
+       {
+               //NOTE FOR IMPROVEMENT: Polish roots based on original curve
+               //                                              (may be too expensive to be effective)
+               int turn = 0;
+
+               for(int i = 0; i < 3; ++i)
+               {
+                       //intersect line segmentsssss
+                       
+                       //solve for the y_value
+                       Vector v = b.b[i+1] - b.b[i];
+
+                       if(v[1] > ERROR && v[1] < ERROR)
+                       {
+                               Real xi = (p1[1] - b.b[i][1])/v[1];
+       
+                               //and add in the turn (up or down) if it's valid                                
+                               if(xi < p1[0]) turn += (v[1] > 0) ? 1 : -1;
+                       }
+               }
+               
+               return turn;
+       }
+       
+       //subdivide the curve and continue
+       CIntersect::SCurve l1,r1;
+       b.Split(l1,r1); //subdivide left
+       
+       //test each subdivision against the point
+       return recurse_intersect(l1,p1) + recurse_intersect(r1,p1);
+}
+
+int intersect(const bezier<Point> &b, const Point &p)
+{
+       CIntersect::SCurve      sb;
+       clean_bez(b,sb.b);
+
+       sb.rt = 0; sb.st = 1;
+       sb.mag = 1; Bound(sb.aabb,sb.b);
+       
+       return recurse_intersect(sb,p); 
+}
+
+//Curve curve intersection
+void CIntersect::recurse_intersect(const SCurve &left, const SCurve &right, int depth)
+{      
+       //reject curves that do not overlap with bouding boxes
+       if(!intersect(left.aabb,right.aabb)) return;
+
+       //accept curves (and perform super detailed check for intersections)
+       //if the values are below tolerance
+       
+       //NOTE FOR BETTERING OF ALGORITHM: SHOULD ALSO/IN-PLACE-OF CHECK MAGNITUDE OF EDGES (or approximate)
+       if(depth >= max_depth)
+       {
+               //NOTE FOR IMPROVEMENT: Polish roots based on original curve with the Jacobian
+               //                                              (may be too expensive to be effective)
+               
+               //perform root approximation
+               //collide line segments
+               
+               float t,s;
+
+               for(int i = 0; i < 3; ++i)
+               {
+                       for(int j = 0; j < 3; ++j)
+                       {
+                               //intersect line segmentsssss
+                               if(intersect_line_segments(left.b[i],left.b[i+1],t,right.b[j],right.b[j+1],s))
+                               {
+                                       //We got one Jimmy
+                                       times.push_back(intersect_set::value_type(t,s));
+                               }                                       
+                       }
+               }                       
+               
+               return;
+       }
+       
+       //NOTE FOR IMPROVEMENT: only subdivide one curve and choose the one that has 
+       //                                              the highest approximated length
+       //fast approximation to curve length may be hard (accurate would 
+       // involve 3 square roots), could sum the squares which would be 
+       // quick but inaccurate
+       
+       SCurve l1,r1,l2,r2;     
+       left.Split(l1,r1);      //subdivide left
+       right.Split(l2,r2); //subdivide right
+       
+       //Test each cantidate against eachother
+       recurse_intersect(l1,l2);
+       recurse_intersect(l1,r2);
+       recurse_intersect(r1,l2);
+       recurse_intersect(r1,r2);
+}
+
+
+
+bool CIntersect::operator()(const bezier<Point> &c1, const bezier<Point> &c2)
+{
+       times.clear();
+       
+       //need to subdivide and check recursive bounding regions against eachother
+       //so track a list of dirty curves and compare compare compare
+       
+       
+       //temporary curves for subdivision
+       CIntersect                      intersector;
+       CIntersect::SCurve      left,right;
+       
+       //Make sure the parameters are normalized (so we don't compare unwanted parts of the curves, 
+       //      and don't miss any for that matter)
+       
+       //left curve
+       //Compile information about curve
+       clean_bez(c1,left.b);
+       left.rt = 0; left.st = 1;
+       Bound(left.aabb, left.b);
+       
+       //right curve
+       //Compile information about right curve
+       clean_bez(c2,right.b);
+       right.rt = 0; right.st = 1;
+       Bound(right.aabb, right.b);
+       
+       //Perform Curve intersection
+       intersector.recurse_intersect(left,right);
+       
+       //Get information about roots (yay! :P)
+       return times.size() != 0;
+}
+
+//point inside curve - return +/- hit up or down edge
+int intersect_scurve(const CIntersect::SCurve &b, const Point &p)
+{
+       //initial reject/approve etc.
+       
+       /*      
+                       *-----------*---------
+                       |                       |
+                       |                       |
+                       |                       |
+                       |         1             |    2
+                       |                       |       
+                       |                       |
+                       |                       |
+                       |                       |
+                       *-----------*--------
+               1,2 are only regions not rejected
+       */
+       if(p[0] < b.aabb.minx || p[1] < b.aabb.miny || p[1] > b.aabb.maxy)
+               return 0;
+       
+       //approve only if to the right of rect around 2 end points
+       {
+               Rect    r;
+               r.set_point(b.b[0][0],b.b[0][1]);
+               r.expand(b.b[3][0],b.b[3][1]);
+               
+               if(p[0] >= r.maxx && p[1] <= r.maxy && p[1] >= r.miny)
+               {
+                       float df = b.b[3][1] - b.b[0][1];
+                       
+                       return df >= 0 ? 1 : -1;
+               }
+       }
+       
+       //subdivide and check again!
+       CIntersect::SCurve      l,r;
+       b.Split(l,r);
+       return  intersect_scurve(l,p) + intersect_scurve(r,p);
+}
+
+int sinfg::intersect(const bezier<Point> &b, const Point &p)
+{
+       CIntersect::SCurve      c(b,0,1);
+       
+       return intersect_scurve(c,p);
+}
diff --git a/synfig-core/trunk/src/synfig/curve_helper.h b/synfig-core/trunk/src/synfig/curve_helper.h
new file mode 100644 (file)
index 0000000..3c4bd68
--- /dev/null
@@ -0,0 +1,171 @@
+/* === S I N F G =========================================================== */
+/*!    \file curve_helper.h
+**     \brief Curve Helper Header
+**
+**     $Id: curve_helper.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_CURVE_HELPER_H
+#define __SINFG_CURVE_HELPER_H
+
+/* === H E A D E R S ======================================================= */
+#include <ETL/bezier>
+
+#include "rect.h"
+#include "real.h"
+#include "vector.h"
+
+#include <vector>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+//line helper functions
+inline Real line_point_distsq(const Point &p1, const Point &p2, 
+                                                                               const Point &p, float &t)
+{
+       Vector v,vt;
+       
+       v = p2 - p1;
+       vt = p - p1;
+       
+       t = v.mag_squared() > 1e-12 ? (vt*v)/v.mag_squared() : 0; //get the projected time value for the current line
+       
+       //get distance to line segment with the time value clamped 0-1                  
+       if(t >= 1)      //use p+v
+       {
+               vt += v; //makes it pp - (p+v)  
+               t = 1;
+       }else if(t > 0) //use vt-proj
+       {
+               vt -= v * t; // vt - proj_v(vt) //must normalize the projection vector to work
+       }else
+       {
+               t = 0;
+       }
+       
+       //else use p
+       return vt.mag_squared();
+}
+
+
+//----- RAY CLASS AND FUNCTIONS --------------
+struct Ray
+{
+       Point   p;
+       Vector  v;
+       
+       Ray() {}
+       Ray(const Point &pin, const Vector &vin):p(pin), v(vin) {}
+};
+
+/* This algorithm calculates the INTERSECTION of 2 line segments 
+       (not the closest point or anything like that, just intersection)
+       //parameter values returned are [0,1]
+*/
+int intersect(const Point &p1, const Vector &v1, float &t1, 
+                               const Point &p2, const Vector &v2, float &t2);
+
+inline bool intersect_line_segments(const Point &a, const Point &b, float &tout,
+                                                                               const Point &c, const Point &d, float &sout)
+{
+       Vector v1(b-a), v2(d-c);
+               
+       //ok so treat both lines as parametric (so we can find the time values simultaneously)
+       float t,s;
+
+       if( intersect(a,v1,t, b,v2,s) && t >= 0 && t <= 1 && s >= 0 && s <= 1 )
+       {
+               tout = t;
+               sout = s;
+               return true;
+       }
+       
+       return false;   
+}
+
+//Find the closest point on the curve to a point (and return it's distance, and time value)
+Real find_closest(const etl::bezier<Point> &curve, const Point &point, float step, Real *closest, float *t);
+
+//----------- Rectangle helper functions ---------------
+
+template < typename T >
+inline void Bound(etl::rect<T> &r, const etl::bezier<Point> &b)
+{
+       r.set_point(b[0][0],b[0][1]);
+       r.expand(b[1][0],b[1][1]);
+       r.expand(b[2][0],b[2][1]);
+       r.expand(b[3][0],b[3][1]);
+}
+
+/*template < typename T >
+inline bool intersect(const etl::rect<T> &r1, const etl::rect<T> &r2)
+{
+       return (r1.minx < r2.maxx) &
+                       (r2.minx < r1.maxx) &
+                       (r1.miny < r2.maxy) &
+                       (r2.miny < r1.maxy);                    
+}*/
+
+//----- Convex Hull of a Bezier Curve --------------
+struct BezHull
+{
+       Point   p[4];   
+       int             size;
+       
+       void Bound(const etl::bezier<Point> &b);
+};
+
+//Line Intersection
+int intersect(const Rect &r1, const Point &p, const Vector &v);
+int intersect(const Rect &r1, const Point &p); //inside or to the right
+int intersect(const BezHull &bh, const Point &p, const Vector &v);
+//int intersect(const etl::bezier<Point> &b, const Point &p, const Vector &v);
+int intersect(const etl::bezier<Point> &b, const Point &p); //for use in containment tests for regions
+
+//Curve intersection object
+class CIntersect
+{
+public:
+       struct SCurve;
+private:
+       void recurse_intersect(const SCurve &left, const SCurve &right, int depth = 0);
+       
+public:
+       //size should be equal
+       typedef std::vector< std::pair<float,float > >  intersect_set;
+       intersect_set   times;
+
+       int             max_depth;
+
+       CIntersect();
+
+       bool operator()(const etl::bezier<Point> &b1, const etl::bezier<Point> &b2);
+};
+
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/curveset.cpp b/synfig-core/trunk/src/synfig/curveset.cpp
new file mode 100644 (file)
index 0000000..1ff5455
--- /dev/null
@@ -0,0 +1,482 @@
+/* === S I N F G =========================================================== */
+/*!    \file curveset.cpp
+**     \brief Curve Set Implementation File
+**
+**     $Id: curveset.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "curve_helper.h"
+#include "curveset.h"
+#include "blinepoint.h"
+#include <ETL/bezier>
+#include <vector>
+#include <list>
+#include <set>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+const Real ERROR = 1e-10;
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+/* === E N T R Y P O I N T ================================================= */
+template < typename T >
+inline bool Zero(const T &a, const T &tol = (T)ERROR)
+{
+       return a < tol && a > -tol;
+}
+
+CurvePoint::CurvePoint(const Point &pin, const Vector &left, const Vector &right)
+:p(pin),l(left),r(right)
+{
+}
+
+CurvePoint::CurvePoint(const BLinePoint &bpoint)
+{
+       p = bpoint.get_vertex();
+       
+       l = p + bpoint.get_tangent1()*(1/3.0f);
+       r = p + bpoint.get_tangent2()*(1/3.0f);
+}
+
+struct ipoint
+{
+       int     curveindex;
+       int             vertindex;
+       float   tvalue;
+       
+       ipoint  *next;
+       ipoint  *prev;
+       ipoint  *neighbor;
+       
+       int     go_in;  //going in = 1, coming out = -1
+       
+       ipoint()
+       {
+               next = this;
+               prev = this;
+               neighbor = 0;
+       }
+       
+       bool operator<(const ipoint &rhs) const
+       {
+               if(curveindex == rhs.curveindex)
+               {
+                       if(vertindex == rhs.vertindex)
+                       {
+                               return tvalue < rhs.tvalue;
+                       }else return vertindex < rhs.vertindex;
+               }else return curveindex < rhs.curveindex;
+       }
+       
+       bool operator >(const ipoint &rhs) const
+       {
+               return rhs < *this;
+       }
+       
+       void insert_after(ipoint *i)
+       {
+               //from: next - next.prev
+               //to: next* - i - next.prev*
+               
+               ipoint  *bef = this,
+                               *aft = next;
+               
+               //assuming the input point is not connected to anything, we don't have to do anything with it...
+               bef->next = i;
+               i->prev = bef;
+               aft->prev = i;
+               i->next = aft;          
+       }
+       
+       void insert_before(ipoint *i)
+       {
+               //from: prev.next - prev
+               //to: prev.next* - i - prev*
+               
+               ipoint  *bef = prev,
+                               *aft = this;
+               
+               //assuming the input point is not connected to anything, we don't have to do anything with it...
+               bef->next = i;
+               i->prev = bef;
+               aft->prev = i;
+               i->next = aft;                          
+       }
+       
+       void insert_sorted(ipoint *i)
+       {
+               ipoint *search = this;
+               
+               if(*i < *this)
+               {
+                       //we go forward
+                       search = this;
+                       do
+                       {
+                               search = search->next;
+                       }while(*i < *search && search != this); //ending conditions...
+                       
+                       //now we insert previously...
+                       search->insert_before(i);
+               }else if(*i > *this)
+               {
+                       //we go backwards...
+                       search = this;
+                       do
+                       {
+                               search = search->prev;
+                       }while(*i > *search && search != this); //ending conditions...
+                       
+                       //now we insert previously...
+                       search->insert_after(i);
+               }
+       }
+};
+
+enum SetOp
+{
+       INTERSECT       = 0,
+       UNION,
+       SUBTRACT,
+       INVSUBTRACT,
+       NUM_SETOPERATIONS
+};
+
+class PolygonClipper
+{
+public:
+       typedef vector<ipoint *>        CurveInts; //in no particular order
+
+       vector<CurveInts>       c1ints;
+       vector<CurveInts>       c2ints;
+       
+       //get the intersections
+       void GetIntersections(const CurveSet &lhs, const CurveSet &rhs)
+       {               
+               CIntersect      isect;
+               bezier<Point>   b1,b2;
+               
+               int i1,j1,ci1,s1;
+               int i2,j2,ci2,s2;
+               
+               //clear out so everyone's happy
+               c1ints.clear();
+               c2ints.clear();
+               
+               c1ints.resize(lhs.set.size());
+               c2ints.resize(rhs.set.size());
+               
+               //loop through everyone and be happy...
+               
+               //intersect each curve with each other curve, and we're good
+               for(ci1=0;ci1 < (int)lhs.set.size(); ++ci1)
+               {
+                       const CurveSet::region &cur1 = lhs.set[ci1];
+                       s1 = cur1.size();
+                       for(j1 = s1-1, i1=0; i1 < s1; j1 = i1++)
+                       {
+                               b1[0] = cur1[j1].p;
+                               b1[3] = cur1[i1].p;
+                               b1[1] = b1[0] + cur1[j1].r/3;
+                               b1[2] = b1[3] - cur1[i1].l/3;
+                               
+                               for(ci2=0;ci2 < (int)rhs.set.size(); ++ci2)
+                               {
+                                       const CurveSet::region &cur2 = rhs.set[ci2];
+                                       s2 = cur2.size();
+                                       for(j2 = s2-1, i2=0; i2 < s2; j2 = i2++)
+                                       {
+                                               b2[0] = cur2[j2].p;
+                                               b2[3] = cur2[i2].p;
+                                               b2[1] = b2[0] + cur2[j2].r/3;
+                                               b2[2] = b2[3] - cur2[i2].l/3;
+                                               
+                                               isect(b1,b2);
+
+                                               for(int index=0; index < (int)isect.times.size(); ++index)
+                                               {
+                                                       //prepare basic intersection information
+                                                       ipoint *ip1 = new ipoint, *ip2 = new ipoint;
+                                                       
+                                                       //set parameters
+                                                       ip1->curveindex = ci1; ip1->vertindex = j1; ip1->tvalue = isect.times[index].first;
+                                                       ip2->curveindex = ci2; ip2->vertindex = j2; ip2->tvalue = isect.times[index].second;
+                                                       
+                                                       //set neighbors
+                                                       ip1->neighbor = ip2;
+                                                       ip2->neighbor = ip1;
+                                                       
+                                                       //first one just goes on end of list
+                                                       c1ints[ci1].back()->insert_sorted(ip1);
+                                                       c1ints[ci1].push_back(ip1);     
+                                                       
+                                                       //second one must go in order
+                                                       c2ints[ci2].back()->insert_sorted(ip2);
+                                                       c2ints[ci2].push_back(ip2);
+                                                       
+                                                       //we're all good...
+                                               }
+                                       }                               
+                               }                                               
+                       }                               
+               }
+               
+               //Now figure out the containment properties of each int point
+               Point p;                
+               int inside = 0;
+               for(int i = 0; i < (int)c1ints.size(); ++i)
+               {
+                       if(c1ints[i].size() == 0) continue;
+                               
+                       //must test insideness for the edges
+                       ipoint *start, *iter;
+                       start = iter = c1ints[i].front();
+                       
+                       //i == iter->curveindex == the index of the current curve we're looking at
+                       
+                       //set the initial insideness on the other curve...
+                       p = lhs.set[i][iter->vertindex].p;
+                       inside = rhs.intersect(p)%2; //if it's inside by the even odd rule
+                       
+                       do
+                       {
+                               iter->go_in = inside? -1 : 1; //leaving if inside, or coming in if not
+                               inside = !inside;
+                               iter = iter->next;
+                       }while(iter != start); //I hope this isn't an infinite loop!
+               }
+               
+               //and curve 2
+               for(int i = 0; i < (int)c2ints.size(); ++i)
+               {
+                       if(c2ints[i].size() == 0) continue;
+                               
+                       //must test insideness for the edges
+                       ipoint *start, *iter;
+                       start = iter = c1ints[i].front();
+                       
+                       //set the initial insideness on the other curve...
+                       p = rhs.set[i][iter->vertindex].p;
+                       inside = lhs.intersect(p)%2; //if it's inside by the even odd rule
+                       
+                       do
+                       {
+                               iter->go_in = inside? -1 : 1; //leaving if inside, or coming in if not
+                               inside = !inside;
+                               iter = iter->next;
+                       }while(iter != start); //I hope this isn't an infinite loop!
+               }
+       }
+       
+       bool ConstructSet(CurveSet &c, const CurveSet &lhs, const CurveSet &rhs, int type)
+       {
+               bool in1,in2;
+               
+               switch(type)
+               {
+                       case INTERSECT: //1&2
+                       {
+                               in1 = true; in2 = true;
+                               break;
+                       }
+                       
+                       case UNION: //1|2
+                       {
+                               in1 = false; in2 = false;
+                               break;
+                       }
+                       
+                       case SUBTRACT: //1-2
+                       {
+                               in1 = true; in2 = false;
+                               break;                          
+                       }
+                       
+                       case INVSUBTRACT: //2-1
+                       {
+                               in1 = false; in2 = true;
+                               break;
+                       }
+                       
+                       default:
+                       {
+                               return false;
+                       }                               
+               }
+               
+               //traverse path based on inside flags
+               
+               //fill all the paths of native stuff
+               set<ipoint *>   ipset;
+               for(int ci=0; ci<(int)c1ints.size(); ++ci)
+               {
+                       for(int i=0; i < (int)c1ints[ci].size(); ++i)
+                       {
+                               ipset.insert(c1ints[ci][i]);
+                       }                               
+               }
+               
+               //
+               while(ipset.size() > 0)
+               {
+                       //start from one point (always on curveset 1) and traverse until we find it again
+                       ipoint *start, *iter;
+                       start = iter = *ipset.begin();
+                       
+                       //All the info to swap when we transition curves...
+                       const CurveSet *cur, *other;
+                       bool curin, otherin;
+                       bool delcur = true;
+                       
+                       set<ipoint *>::iterator deliter;
+                       
+                       int ci,i1,i2,size;
+                       float t1,t2;
+                       
+                       CurveSet::region        current;
+                       CurvePoint      cp;
+                       
+                       cur = &lhs; other = &rhs;
+                       curin = in1; otherin = in2;
+                       delcur = true;                                          
+                       
+                       do
+                       {
+                               //remove the current iter from the set
+                               if(delcur)
+                               {
+                                       deliter = ipset.find(iter);
+                                       if(deliter != ipset.end()) ipset.erase(deliter);
+                               }
+                               
+                               //go to next and accumulate information
+                               ci = iter->curveindex;
+                               i1 = iter->vertindex;
+                               t1 = iter->tvalue;                              
+                               iter = iter->next; //move to next and get its info
+                               
+                               i2 = iter->vertindex;
+                               t2 = iter->tvalue;
+                               
+                               size = cur->set[ci].size();
+                       
+                               //record all the stuff between us...                                                                                            
+                               //start on an intersection - get the curve point...
+                                                               
+                               
+                               //transition curves...
+                               iter = iter->neighbor;
+                               swap(cur,other);
+                               swap(curin,otherin);
+                               delcur = !delcur;
+                       }while(iter != start); //I hope THIS isn't an infinite loop                             
+               }
+                               
+               return true;
+       }
+};
+
+void CurveSet::SetClamp(int &i, int &si)
+{
+       if(si > 0 && si < (int)set.size())
+       {
+               if(i >= (int)set[si].size())
+               {
+                       i -= set[si].size();
+                       si++;
+               }else if (i < 0)
+               {
+                       i += set[si].size();
+                       si--;
+               }       
+       }
+}
+
+void CurveSet::CleanUp(int curve)
+{
+}
+
+/*     Detect intersections that are crazy happy good
+
+       Performance annoyances:
+       1) Recursing down to find an intersection at the end points that doesn't actually exist
+               (can be helped a bit by not including the edges of bouding rectaingles)
+       2) Intersecting curves is slow... oh well
+
+       Algorithm:
+       1) Inside out scheme, track when edges go into and come out of various objects etc.
+       
+       + doesn't require initial conditions
+       - only works with odd-even rule 
+*/
+
+CurveSet CurveSet::operator &(const CurveSet &rhs) const
+{
+       return *this;
+}
+
+CurveSet CurveSet::operator |(const CurveSet &rhs) const
+{
+       return *this;
+}
+
+CurveSet CurveSet::operator -(const CurveSet &rhs) const
+{
+       return *this;
+}
+
+int CurveSet::intersect(const Point &p) const
+{
+       int inter = 0, ci,i,j,s;
+       bezier<Point>   b;
+       
+       for(ci=0; ci < (int)set.size(); ++ci)
+       {
+               const vector<CurvePoint> &curve = set[ci];
+               s = curve.size();
+               for(j=s-1,i=0; i < s; j = i++)
+               {
+                       b[0] = curve[j].p; b[3] = curve[i].p;
+                       b[1] = b[0] + curve[j].r/3; b[2] = b[3] - curve[i].l/3;
+                       
+                       inter += sinfg::intersect(b,p);
+               }
+       }
+       
+       return inter;
+}
diff --git a/synfig-core/trunk/src/synfig/curveset.h b/synfig-core/trunk/src/synfig/curveset.h
new file mode 100644 (file)
index 0000000..963fd93
--- /dev/null
@@ -0,0 +1,91 @@
+/* === S I N F G =========================================================== */
+/*!    \file curveset.h
+**     \brief Curve Set Header
+**
+**     $Id: curveset.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_CURVESET_H
+#define __SINFG_CURVESET_H
+
+/* === H E A D E R S ======================================================= */
+#include "blinepoint.h"
+#include <vector>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+namespace sinfg
+{
+
+class BLinePoint;
+       
+struct CurvePoint
+{
+       Point   p;
+       Point   l,r;
+       
+       CurvePoint () {}
+       CurvePoint(const Point &pin, const Vector &left, const Vector &right);
+       
+       CurvePoint(const BLinePoint &bpoint);
+};
+       
+class CurveSet 
+{
+       bool            invert; //winding order...
+       
+       void CleanUp(int curve = 0);
+public:
+       
+       typedef std::vector<CurvePoint> region;
+       typedef std::vector<region>             set_type;
+       
+       set_type        set; //specifies a region object (assumes looping)
+
+       void SetClamp(int &i, int &si);
+
+       //actual stuff
+       CurveSet()
+       {
+       }
+       
+       //anything supporting iterator type operations
+       template < typename Iterator >
+       CurveSet(Iterator begin, Iterator end, bool invert = false)
+       {
+               set.push_back(std::vector<CurvePoint>(begin,end));
+               CleanUp(invert);
+       }
+       
+       CurveSet operator &(const CurveSet &rhs) const; //intersect
+       CurveSet operator |(const CurveSet &rhs) const; //union
+       CurveSet operator -(const CurveSet &rhs) const; //subtract
+       
+       
+       //Point containment
+       int intersect(const Point &p) const;
+};
+
+}
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/distance.cpp b/synfig-core/trunk/src/synfig/distance.cpp
new file mode 100644 (file)
index 0000000..c1a7e65
--- /dev/null
@@ -0,0 +1,251 @@
+/* === S I N F G =========================================================== */
+/*!    \file distance.cpp
+**     \brief Template File
+**
+**     $Id: distance.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "distance.h"
+#include "renddesc.h"
+#include "general.h"
+#include <ctype.h>
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+#define POINTS_PER_INCH        (72.0)
+
+/* === G L O B A L S ======================================================= */
+
+#define METERS_PER_UNIT  (rend_desc.get_physical_w()/abs(rend_desc.get_tl()[0]-rend_desc.get_br()[0]))
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Distance::Distance(const sinfg::String& str)
+{
+       (*this)=str;
+/*     int i(0);
+       float val;
+       int ret(strscanf(str,"%f%n",&val,&i));
+       sinfg::info("Distance::Distance(): ret=%d, val=%f",ret,val);
+       
+       if(ret<=0)
+       {
+               // Error
+               sinfg::error("Distance::Distance(): Bad value \"%s\"",str.c_str());
+               value_=0;
+       }
+       else
+               value_=val;
+       
+       sinfg::info("Distance::Distance(): system=\"%s\"",String(str.begin()+i,str.end()).c_str());
+       system_=ident_system(String(str.begin()+i,str.end()));
+*/
+}
+
+Distance&
+Distance::operator=(const sinfg::String& str)
+{
+       int i(0);
+       float val;
+       int ret(strscanf(str,"%f%n",&val,&i));
+       sinfg::info("Distance::Distance(): ret=%d, val=%f",ret,val);
+       
+       if(ret<=0)
+       {
+               // Error
+               sinfg::error("Distance::Distance(): Bad value \"%s\"",str.c_str());
+               return *this;
+       }
+       else
+               value_=val;
+
+       sinfg::String sys(str.begin()+i,str.end());
+
+       if(sys.size())
+               system_=ident_system(sys);
+       return *this;
+}
+
+sinfg::String
+Distance::get_string(int digits)const
+{
+       digits=min(9,max(0,digits));
+       String fmt(strprintf("%%.%01df%%s",digits));
+       return strprintf(fmt.c_str(),value_,system_name(system_).c_str());
+}
+
+void
+Distance::convert(Distance::System target, const RendDesc& rend_desc)
+{
+       value_=get(target,rend_desc);
+       system_=target;
+}
+
+Real
+Distance::get(Distance::System target, const RendDesc& rend_desc)const
+{
+       if(target==SYSTEM_UNITS)
+               return units(rend_desc);
+       if(target==SYSTEM_PIXELS)
+               return units(rend_desc)*METERS_PER_UNIT*rend_desc.get_x_res();
+       
+       return meters_to_system(meters(rend_desc),target);      
+}
+       
+Real
+Distance::meters()const
+{
+       switch(system_)
+       {
+               case SYSTEM_INCHES: return value_/39.3700787402;
+               case SYSTEM_POINTS: return value_/POINTS_PER_INCH/39.3700787402;
+               case SYSTEM_METERS: return value_;
+               case SYSTEM_CENTIMETERS: return value_/100.0;
+               case SYSTEM_MILLIMETERS: return value_/1000.0;
+               default: throw BadSystem();
+       }
+}
+
+Real
+Distance::meters(const RendDesc& rend_desc)const
+{
+       if(system_>SYSTEM_PIXELS)
+               return meters();
+       if(system_==SYSTEM_UNITS)
+               return value_*METERS_PER_UNIT;
+       if(system_==SYSTEM_PIXELS)
+               return value_/rend_desc.get_x_res();
+
+       throw BadSystem();
+}
+
+Real
+Distance::units(const RendDesc& rend_desc)const
+{
+       if(system_==SYSTEM_UNITS)
+               return value_;
+
+       Real ret;
+
+       if(system_>SYSTEM_PIXELS)
+               ret=meters();
+       else
+               ret=value_/rend_desc.get_x_res();
+
+       return ret/METERS_PER_UNIT;
+}
+
+
+Real // (static)
+Distance::meters_to_system(Real x,System target_system)
+{
+       switch(target_system)
+       {
+               case SYSTEM_INCHES: return x*39.3700787402;
+               case SYSTEM_POINTS: return x*39.3700787402*POINTS_PER_INCH;
+               case SYSTEM_METERS: return x;
+               case SYSTEM_CENTIMETERS: return x*100.0;
+               case SYSTEM_MILLIMETERS: return x*1000.0;
+               default: throw BadSystem();
+       }
+}
+
+Distance::System // (static)
+Distance::ident_system(const sinfg::String& x)
+{
+       sinfg::String str;
+
+       // Make it all upper case, and remove white space
+       for(unsigned int i=0;i<x.size();i++)if(x[i]!=' ' && x[i]!='\t')str+=toupper(x[i]);
+
+       // If it is plural, make it singular
+       if(str[str.size()-1]=='S')
+               str=sinfg::String(str.begin(),str.end()-1);
+       
+       if(str.empty() || str=="U" || str=="UNIT")
+               return SYSTEM_UNITS;
+       if(str=="PX" || str=="PIXEL")
+               return SYSTEM_PIXELS;
+       if(str=="PT" || str=="POINT")
+               return SYSTEM_POINTS;
+       if(str=="IN" || str=="\"" || str=="INCHE" || str=="INCH")
+               return SYSTEM_INCHES;
+       if(str=="M" || str=="METER")
+               return SYSTEM_METERS;
+       if(str=="CM" || str=="CENTIMETER")
+               return SYSTEM_CENTIMETERS;
+       if(str=="MM" || str=="MILLIMETER")
+               return SYSTEM_MILLIMETERS;
+       
+       sinfg::warning("Distance::ident_system(): Unknown distance system \"%s\"",x.c_str());
+       
+       return SYSTEM_UNITS;
+}
+
+sinfg::String  // (static)
+Distance::system_name(Distance::System system)
+{
+       switch(system)
+       {
+               case SYSTEM_UNITS:              return "u";
+               case SYSTEM_PIXELS:             return "px";
+               case SYSTEM_POINTS:             return "pt";
+               case SYSTEM_INCHES:             return "in";
+               case SYSTEM_METERS:             return "m";
+               case SYSTEM_MILLIMETERS:        return "mm";
+               case SYSTEM_CENTIMETERS:        return "cm";
+       
+               default:                                throw BadSystem();
+       }
+       return sinfg::String();
+}
+
+sinfg::String  // (static)
+Distance::system_local_name(Distance::System system)
+{
+       switch(system)
+       {
+               case SYSTEM_UNITS:              return _("Units");
+               case SYSTEM_PIXELS:             return _("Pixels");
+               case SYSTEM_POINTS:             return _("Points");
+               case SYSTEM_INCHES:             return _("Inches");
+               case SYSTEM_METERS:             return _("Meters");
+               case SYSTEM_MILLIMETERS:return _("Millimeters");
+               case SYSTEM_CENTIMETERS:return _("Centimeters");
+       
+               default:                                throw BadSystem();
+       }
+       return sinfg::String();
+}
diff --git a/synfig-core/trunk/src/synfig/distance.h b/synfig-core/trunk/src/synfig/distance.h
new file mode 100644 (file)
index 0000000..44d88bc
--- /dev/null
@@ -0,0 +1,127 @@
+/* === S I N F G =========================================================== */
+/*!    \file distance.h
+**     \brief Template Header
+**
+**     $Id: distance.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_DISTANCE_H
+#define __SINFG_DISTANCE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "real.h"
+#include "string.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class RendDesc;
+
+class Distance
+{
+public:
+       typedef Real value_type;
+       
+       enum System
+       {
+               SYSTEM_UNITS,           //!<
+               SYSTEM_PIXELS,          //!<
+               
+               SYSTEM_POINTS,          //!<
+               SYSTEM_INCHES,          //!<
+               SYSTEM_METERS,          //!<
+               SYSTEM_MILLIMETERS,     //!<
+               SYSTEM_CENTIMETERS,     //!<
+
+               SYSTEM_END                      //!< \internal
+       };
+
+       class BadSystem { };
+
+private:       
+       value_type value_;
+               
+       System system_;
+
+       
+public:
+
+       Distance(){ }
+       Distance(const value_type& value, System system):value_(value),system_(system) { }
+       explicit Distance(const sinfg::String& string);
+       
+       operator Real()const { return value_; }
+
+       Distance& operator=(const Real& rhs) { value_=rhs; return *this; }
+
+       Distance& operator=(const sinfg::String& rhs);
+
+       sinfg::String get_string(int digits=4)const;
+       
+       const System& get_system()const { return system_; }
+
+       const Real& get()const { return value_; }
+
+       Real get(System system, const RendDesc& rend_desc)const;
+       
+       void convert(System system, const RendDesc& rend_desc);
+       
+       Real meters()const;
+       Real meters(const RendDesc& rend_desc)const;
+       Real units(const RendDesc& rend_desc)const;
+       
+       static Real meters_to_system(Real x, System target_system);
+       static System ident_system(const sinfg::String& str);
+       static sinfg::String system_name(System system);
+       static sinfg::String system_local_name(System system);
+
+       const Distance& operator+=(const Distance &rhs) { value_+=meters_to_system(rhs.meters(),system_); return *this; }
+       const Distance& operator-=(const Distance &rhs) { value_-=meters_to_system(rhs.meters(),system_); return *this; }
+
+       const Distance& operator+=(const float &rhs) { value_+=rhs; return *this; }
+       const Distance& operator-=(const float &rhs) { value_-=rhs; return *this; }
+       const Distance& operator*=(const float &rhs) { value_*=rhs; return *this; }
+       const Distance& operator/=(const float &rhs) { value_/=rhs; return *this; }
+       
+/*
+       template<typename U> const Time& operator+=(const U &rhs) { value_+=rhs; return *this; }
+       template<typename U> const Time& operator-=(const U &rhs) { value_-=rhs; return *this; }
+       template<typename U> const Time& operator*=(const U &rhs) { value_*=rhs; return *this; }
+       template<typename U> const Time& operator/=(const U &rhs) { value_/=rhs; return *this; }
+
+       template<typename U> Time operator+(const U &rhs)const { return value_+rhs; }
+       template<typename U> Time operator-(const U &rhs)const { return value_-rhs; }
+       template<typename U> Time operator*(const U &rhs)const { return value_*rhs; }
+       template<typename U> Time operator/(const U &rhs)const { return value_/rhs; }
+       
+       Time operator-()const { return -value_; }
+*/
+}; // END of class Distance
+       
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/exception.cpp b/synfig-core/trunk/src/synfig/exception.cpp
new file mode 100644 (file)
index 0000000..e7b8e3a
--- /dev/null
@@ -0,0 +1,104 @@
+/* === S I N F G =========================================================== */
+/*!    \file template.cpp
+**     \brief Template File
+**
+**     $Id: exception.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "exception.h"
+#include "general.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Exception::BadLinkName::BadLinkName(const String &what):
+       std::runtime_error(what)
+//     std::runtime_error(_("Bad Link Name")+what.empty()?"":(String(": ")+what))
+{
+       sinfg::error("EXCEPTION: bad link name: "+what);
+}
+
+Exception::BadType::BadType(const String &what):
+       std::runtime_error(what)
+//     std::runtime_error(_("Bad Type")+what.empty()?"":(String(": ")+what))
+{
+       sinfg::error("EXCEPTION: bad type: "+what);
+}
+
+Exception::BadFrameRate::BadFrameRate(const String &what):
+       std::runtime_error(what)
+//     std::runtime_error(_("Bad Link Name")+what.empty()?"":(String(": ")+what))
+{
+       sinfg::error("EXCEPTION: bad frame rate: "+what);
+}
+
+Exception::BadTime::BadTime(const String &what):
+       std::runtime_error(what)
+//     std::runtime_error(_("Bad Link Name")+what.empty()?"":(String(": ")+what))
+{
+       sinfg::error("EXCEPTION: bad time: "+what);
+}
+
+Exception::NotFound::NotFound(const String &what):
+       std::runtime_error(what)
+//     std::runtime_error(_("Not Found")+what.empty()?"":(String(": ")+what))
+{
+//     sinfg::error("EXCEPTION: not found: "+what);
+}
+
+Exception::IDNotFound::IDNotFound(const String &what):
+       NotFound(what)
+//     std::runtime_error(_("Not Found")+what.empty()?"":(String(": ")+what))
+{
+//     sinfg::error("EXCEPTION: not found: "+what);
+}
+
+Exception::FileNotFound::FileNotFound(const String &what):
+       NotFound(what)
+//     std::runtime_error(_("Not Found")+what.empty()?"":(String(": ")+what))
+{
+       sinfg::error("EXCEPTION: file not found: "+what);
+}
+
+Exception::IDAlreadyExists::IDAlreadyExists(const String &what):
+       std::runtime_error(what)
+//     std::runtime_error(_("ID Already Exists")+what.empty()?"":(String(": ")+what))
+{
+       sinfg::error("EXCEPTION: id already exists: "+what);
+}
diff --git a/synfig-core/trunk/src/synfig/exception.h b/synfig-core/trunk/src/synfig/exception.h
new file mode 100644 (file)
index 0000000..32ed769
--- /dev/null
@@ -0,0 +1,96 @@
+/* === S I N F G =========================================================== */
+/*!    \file exception.h
+**     \brief Exceptions
+**
+**     $Id: exception.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_EXCEPTION_H
+#define __SINFG_EXCEPTION_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <stdexcept>
+#include "string_decl.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+namespace Exception {
+
+class BadLinkName : public std::runtime_error
+{
+public:
+       BadLinkName(const String &what);
+}; // END of class BadLinkName
+
+class BadType : public std::runtime_error
+{
+public:
+       BadType(const String &what);
+}; // END of class BadType
+
+class IDAlreadyExists : public std::runtime_error
+{
+public:
+       IDAlreadyExists(const String &what);
+};
+
+class NotFound : public std::runtime_error
+{
+public:
+       NotFound(const String &what);
+};
+
+class IDNotFound : public NotFound
+{
+public:
+       IDNotFound(const String &what);
+};
+
+class FileNotFound : public NotFound
+{
+public:
+       FileNotFound(const String &what);
+};
+
+class BadTime : public std::runtime_error
+{
+public:
+       BadTime(const String &what);
+};
+
+class BadFrameRate : public std::runtime_error
+{
+public:
+       BadFrameRate(const String &what);
+};
+
+}; // END of namespace Exception
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/gamma.cpp b/synfig-core/trunk/src/synfig/gamma.cpp
new file mode 100644 (file)
index 0000000..1a5e31a
--- /dev/null
@@ -0,0 +1,192 @@
+/* === S I N F G =========================================================== */
+/*!    \file gamma.cpp
+**     \brief Template File
+**
+**     $Id: gamma.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "gamma.h"
+#include <cmath>
+#include <algorithm>
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+//using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+void
+Gamma::set_gamma(float x)
+{
+       gamma_r=gamma_g=gamma_b=x;
+       int i;
+       red_blue_level=1.0f;
+       for(i=0;i<65536;i++)
+       {
+               float f(float(i)/65536.0f);
+               f=pow(f,gamma_r);
+               table_r_U16_to_U8[i]=table_g_U16_to_U8[i]=table_b_U16_to_U8[i]=(unsigned char)(f*(255.0f-(black_level*255))+0.5f + black_level*255.0f);
+       }
+
+       for(i=0;i<256;i++)
+               table_r_U8_to_F32[i]=table_g_U8_to_F32[i]=table_b_U8_to_F32[i]=pow((float(i)/255.0f)*(1.0f-black_level)+black_level,gamma_r);
+}
+
+
+void
+Gamma::refresh_gamma_r()
+{
+       int i;
+//     const float scalar(min(red_blue_level,1.0f));
+       const float scalar(1.0f);
+       for(i=0;i<65536;i++)
+       {
+               float f(float(i)/65536.0f);
+               f=pow(f,gamma_r)*scalar;
+               table_r_U16_to_U8[i]=(unsigned char)(f*(255.0f-(black_level*255))+0.5f + black_level*255.0f);
+       }
+
+       for(i=0;i<256;i++)
+               table_r_U8_to_F32[i]=pow((float(i)/255.0f)*(1.0f-black_level)+black_level,gamma_r)*scalar;
+}
+
+void
+Gamma::refresh_gamma_g()
+{
+       int i;
+//     const float scalar(sqrt(min(red_blue_level,2.0f-red_blue_level)));
+       const float scalar(1.0f);
+       for(i=0;i<65536;i++)
+       {
+               float f(float(i)/65536.0f);
+               f=pow(f,gamma_g)*scalar;
+               table_g_U16_to_U8[i]=(unsigned char)(f*(255.0f-(black_level*255))+0.5f + black_level*255.0f);
+       }
+       for(i=0;i<256;i++)
+               table_g_U8_to_F32[i]=pow((float(i)/255.0f)*(1.0f-black_level)+black_level,gamma_g)*scalar;
+}
+
+void
+Gamma::refresh_gamma_b()
+{
+       int i;
+//     const float scalar(min(2.0f-red_blue_level,1.0f));
+       const float scalar(1.0f);
+       for(i=0;i<65536;i++)
+       {
+               float f(float(i)/65536.0f);
+               f=pow(f,gamma_b)*scalar;
+               table_b_U16_to_U8[i]=(unsigned char)(f*(255.0f-(black_level*255))+0.5f + black_level*255.0f);
+       }
+       for(i=0;i<256;i++)
+               table_b_U8_to_F32[i]=pow((float(i)/255.0f)*(1.0f-black_level)+black_level,gamma_b)*scalar;
+}
+
+void
+Gamma::set_gamma_r(float x)
+{
+       // If the gamma hasn't changed, then don't recompute the tables
+       if(x==gamma_r) return;
+
+       gamma_r=x;
+       refresh_gamma_r();
+}
+
+void
+Gamma::set_gamma_g(float x)
+{
+       // If the gamma hasn't changed, then don't recompute the tables
+       if(x==gamma_g) return;
+
+       gamma_g=x;
+       refresh_gamma_g();
+}
+
+void
+Gamma::set_gamma_b(float x)
+{
+       // If the gamma hasn't changed, then don't recompute the tables
+       if(x==gamma_b) return;
+
+       gamma_b=x;
+       refresh_gamma_b();
+}
+
+void
+Gamma::set_black_level(float x)
+{
+       // If the black_level hasn't changed, then don't recompute the tables
+       if(x==black_level) return;
+
+       black_level=x;
+       
+       // Rebuild tables
+       refresh_gamma_r();
+       refresh_gamma_g();
+       refresh_gamma_b();
+}
+
+void
+Gamma::set_red_blue_level(float x)
+{
+       // If the black_level hasn't changed, then don't recompute the tables
+       if(x==red_blue_level) return;
+
+       red_blue_level=x;
+       
+       // Rebuild tables
+       refresh_gamma_r();
+       refresh_gamma_g();
+       refresh_gamma_b();
+}
+
+void
+Gamma::set_all(float r, float g, float b, float black, float red_blue)
+{
+       // If nothing has changed, then don't recompute the tables
+       if(gamma_r==r && gamma_g==g && gamma_b==b && black_level==black && red_blue_level==red_blue)
+               return;
+       
+       gamma_r=r;
+       gamma_g=g;
+       gamma_b=b;
+       black_level=black;
+       red_blue_level=red_blue;
+
+       // Rebuild tables
+       refresh_gamma_r();
+       refresh_gamma_g();
+       refresh_gamma_b();
+}
diff --git a/synfig-core/trunk/src/synfig/gamma.h b/synfig-core/trunk/src/synfig/gamma.h
new file mode 100644 (file)
index 0000000..b90894b
--- /dev/null
@@ -0,0 +1,107 @@
+/* === S I N F G =========================================================== */
+/*!    \file gamma.h
+**     \brief Template Header
+**
+**     $Id: gamma.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_GAMMA_H
+#define __SINFG_GAMMA_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <cmath>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Gamma
+**     \brief This class performs color correction on Color classes.
+**     \stub
+*/
+class Gamma
+{
+       float gamma_r;
+       float gamma_g;
+       float gamma_b;
+       float black_level;
+       float red_blue_level;
+       
+       unsigned char table_r_U16_to_U8[65536];
+       unsigned char table_g_U16_to_U8[65536];
+       unsigned char table_b_U16_to_U8[65536];
+
+       float table_r_U8_to_F32[256];
+       float table_g_U8_to_F32[256];
+       float table_b_U8_to_F32[256];
+       
+public:
+       Gamma(float x=1):black_level(0) { set_gamma(x); }
+
+       void set_gamma(float x);
+       void set_gamma_r(float x);
+       void set_gamma_g(float x);
+       void set_gamma_b(float x);
+       void set_black_level(float x);
+
+       void set_red_blue_level(float x);
+       void set_all(float r, float g, float b, float black, float red_blue=1.0f);
+
+       float get_gamma()const { return (gamma_r+gamma_g+gamma_b)*0.33333333; }
+       float get_gamma_r()const { return gamma_r; }
+       float get_gamma_g()const { return gamma_g; }
+       float get_gamma_b()const { return gamma_b; }
+       float get_black_level()const { return black_level; }
+       float get_red_blue_level()const { return red_blue_level; }
+       
+       void refresh_gamma_r();
+       void refresh_gamma_g();
+       void refresh_gamma_b();
+       
+       const unsigned char &r_U16_to_U8(int i)const { return table_r_U16_to_U8[i]; }
+       const unsigned char &g_U16_to_U8(int i)const { return table_g_U16_to_U8[i]; }
+       const unsigned char &b_U16_to_U8(int i)const { return table_b_U16_to_U8[i]; }
+
+       const unsigned char &r_F32_to_U8(float x)const { return table_r_U16_to_U8[(int)(x*65535.0f)]; }
+       const unsigned char &g_F32_to_U8(float x)const { return table_g_U16_to_U8[(int)(x*65535.0f)]; }
+       const unsigned char &b_F32_to_U8(float x)const { return table_b_U16_to_U8[(int)(x*65535.0f)]; }
+
+       unsigned short r_F32_to_U16(float x)const { return (unsigned short)table_r_U16_to_U8[(int)(x*65535.0f)]<<8; }
+       unsigned short g_F32_to_U16(float x)const { return (unsigned short)table_g_U16_to_U8[(int)(x*65535.0f)]<<8; }
+       unsigned short b_F32_to_U16(float x)const { return (unsigned short)table_b_U16_to_U8[(int)(x*65535.0f)]<<8; }
+
+       const float& r_U8_to_F32(int i)const { return table_r_U8_to_F32[i]; }
+       const float& g_U8_to_F32(int i)const { return table_g_U8_to_F32[i]; }
+       const float& b_U8_to_F32(int i)const { return table_b_U8_to_F32[i]; }
+
+       float r_F32_to_F32(float x)const { return static_cast<float>(pow(x,gamma_r)*(1.0f-black_level)+black_level); }
+       float g_F32_to_F32(float x)const { return static_cast<float>(pow(x,gamma_g)*(1.0f-black_level)+black_level); }
+       float b_F32_to_F32(float x)const { return static_cast<float>(pow(x,gamma_b)*(1.0f-black_level)+black_level); }
+}; // END of class Gamma
+       
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/general.h b/synfig-core/trunk/src/synfig/general.h
new file mode 100644 (file)
index 0000000..2af68c5
--- /dev/null
@@ -0,0 +1,148 @@
+/* === S I N F G =========================================================== */
+/*!    \file general.h
+**     \brief General macros, classes, and prodecure declarations
+**
+**     $Id: general.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_GENERAL_H
+#define __SINFG_GENERAL_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/stringf>
+#include "string.h"
+#include "version.h"
+
+/* === M A C R O S ========================================================= */
+
+// Quick hack to keep stuff working until gettext support is added
+#ifndef _
+#define _(x)           (x)
+#define N_(x)          (x)
+//#define gettext(x)   (x)
+#endif
+
+#define SINFG_COPYRIGHT "Copyright (c) 2001-2004 Voria Software, LLC"
+
+
+#ifdef _DEBUG
+#ifdef __FUNC__
+#define DEBUGPOINT()   sinfg::warning(etl::strprintf(__FILE__":"__FUNC__":%d DEBUGPOINT",__LINE__))
+#define DEBUGINFO(x)   sinfg::warning(etl::strprintf(__FILE__":"__FUNC__":%d:DEBUGINFO:",__LINE__)+x)
+#else
+#define DEBUGPOINT()   sinfg::warning(etl::strprintf(__FILE__":%d DEBUGPOINT",__LINE__))
+#define DEBUGINFO(x)   sinfg::warning(etl::strprintf(__FILE__":%d:DEBUGINFO:",__LINE__)+x)
+#endif
+
+#else
+#define DEBUGPOINT()
+#define DEBUGINFO(x)
+#endif
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class ProgressCallback
+**     \todo writeme
+*/
+class ProgressCallback
+{
+public:
+
+       virtual ~ProgressCallback() { }
+       virtual bool task(const String &task) { return true; }
+       virtual bool error(const String &task) { return true; }
+       virtual bool warning(const String &task) { return true; }
+       virtual bool amount_complete(int current, int total) { return true; }
+       
+       virtual bool valid() const { return true; }
+};
+
+typedef ProgressCallback ProgressManager;
+
+/*!    \class SuperCallback
+**     \todo writeme
+*/
+class SuperCallback : public ProgressCallback
+{
+       ProgressCallback *cb;
+       int start,end,tot;
+       int w;
+public:
+
+       SuperCallback() { cb=NULL; }
+       SuperCallback(ProgressCallback *cb,int start, int end, int total):cb(cb),start(start),end(end),tot(total)
+       {
+               //make sure we don't "inherit" if our subcallback is invalid
+               if(!cb || !cb->valid())
+                       cb = NULL;
+               w=end-start;
+       }
+       virtual bool task(const String &task) { if(cb)return cb->task(task); return true; }
+       virtual bool error(const String &task) { if(cb)return cb->error(task); return true; }
+       virtual bool warning(const String &task) { if(cb)return cb->warning(task); return true; }
+       virtual bool amount_complete(int cur, int total) { if(cb)return cb->amount_complete(start+cur*w/total,tot); return true; }
+       
+       virtual bool valid() const { return cb != 0; }
+};
+
+/*! \class SoftwareExpired
+**     \brief This class is thrown when the software timeout has been reached.
+*/
+class SoftwareExpired
+{
+}; // END of class SoftwareExpired
+
+
+#ifdef DEATH_TIME
+inline void CHECK_EXPIRE_TIME() { if(time(0)>DEATH_TIME) throw SoftwareExpired(); }
+#else
+#define CHECK_EXPIRE_TIME() while(0){ }
+#endif
+
+/*
+extern bool add_to_module_search_path(const std:string &path);
+extern bool add_to_config_search_path(const std:string &path);
+*/
+
+//! Shutdown the sinfg environment
+extern void shutdown();
+
+//! Reports an error
+/*! Call this when an error occurs, describing what happened */
+extern void error(const char *format,...);
+extern void error(const String &str);
+
+//! Reports a warning
+/*! Call this when something questionable occurs, describing what happened */
+extern void warning(const char *format,...);
+extern void warning(const String &str);
+
+//! Reports some information
+/*! Call this to report various information. Please be sparse... */
+extern void info(const char *format,...);
+extern void info(const String &str);
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/gradient.cpp b/synfig-core/trunk/src/synfig/gradient.cpp
new file mode 100644 (file)
index 0000000..8132809
--- /dev/null
@@ -0,0 +1,431 @@
+/* === S I N F G =========================================================== */
+/*!    \file gradient.cpp
+**     \brief Color Gradient Class Member Definitions
+**
+**     $Id: gradient.cpp,v 1.2 2005/01/21 19:29:10 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "gradient.h"
+#include "general.h"
+#include <stdexcept>
+#include "exception.h"
+
+#include <ETL/misc>
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::Gradient::Gradient(const Color &c1, const Color &c2)
+{
+       push_back(CPoint(0.0,c1));
+       push_back(CPoint(1.0,c2));
+}
+
+sinfg::Gradient::Gradient(const Color &c1, const Color &c2, const Color &c3)
+{
+       push_back(CPoint(0.0,c1));
+       push_back(CPoint(0.5,c2));
+       push_back(CPoint(1.0,c3));
+}
+
+// This sort algorithm MUST be stable
+// ie: it must not change the order of items with the same value.
+// I am using a bubble sort.
+// This algorithm will sort a nearly-sorted list at ~O(N), and
+// it will sort an inverse sorted list at ~O(N*N).
+void
+sinfg::Gradient::sort()
+{      
+       stable_sort(begin(),end());
+       /*
+       iterator iter;
+       iterator iter2,next;
+       
+       for(iter=begin();iter!=end();iter++)
+       {
+               for(next=iter, iter2=next--;iter2!=begin();iter2=next--)
+               {
+                       if(*iter<*next)
+                       {
+                               //insert(next,*iter);
+                               //erase(iter);
+                               iter_swap(next,iter);
+                               
+                               continue;
+                       }
+                       else
+                               break;
+               }
+       }
+       */
+}
+
+static sinfg::ColorAccumulator
+supersample_helper(const sinfg::Gradient::CPoint &color1, const sinfg::Gradient::CPoint &color2, float begin, float end, float &weight)
+{
+       if(color1.pos==color2.pos || color1.pos>=end || color2.pos<=begin)
+       {
+               weight=0;
+               return Color::alpha();
+       }               
+       if(color1.pos>=begin && color2.pos<end)
+       {
+               weight=color2.pos-color1.pos;
+               ColorAccumulator ret=Color::blend(color2.color,color1.color, 0.5, Color::BLEND_STRAIGHT);
+               ret.set_r(ret.get_r()*ret.get_a());
+               ret.set_g(ret.get_g()*ret.get_a());
+               ret.set_b(ret.get_b()*ret.get_a());
+               return ret*weight;
+       }
+       if(color1.pos>=begin && color2.pos>=end)
+       {
+               weight=end-color1.pos;
+               float pos((end+color1.pos)*0.5);
+               float amount((pos-color1.pos)/(color2.pos-color1.pos));
+               //if(abs(amount)>1)amount=(amount>0)?1:-1;
+               ColorAccumulator ret(Color::blend(color2.color,color1.color, amount, Color::BLEND_STRAIGHT));
+               ret.set_r(ret.get_r()*ret.get_a());
+               ret.set_g(ret.get_g()*ret.get_a());
+               ret.set_b(ret.get_b()*ret.get_a());
+               return ret*weight;
+       }
+       if(color1.pos<begin && color2.pos<end)
+       {
+               weight=color2.pos-begin;
+               float pos((begin+color2.pos)*0.5);
+               float amount((pos-color1.pos)/(color2.pos-color1.pos));
+               //if(abs(amount)>1)amount=(amount>0)?1:-1;
+               ColorAccumulator ret(Color::blend(color2.color,color1.color, amount, Color::BLEND_STRAIGHT));
+               ret.set_r(ret.get_r()*ret.get_a());
+               ret.set_g(ret.get_g()*ret.get_a());
+               ret.set_b(ret.get_b()*ret.get_a());
+               return ret*weight;
+       }
+       sinfg::error("color1.pos=%f",color1.pos);
+       sinfg::error("color2.pos=%f",color2.pos);
+       sinfg::error("begin=%f",begin);
+       sinfg::error("end=%f",end);
+
+       weight=0;
+       return Color::alpha();
+       
+//     assert(0);
+}
+       
+Color
+sinfg::Gradient::operator()(const Real &x,float supersample)const
+{
+       if(empty())
+               return Color(0,0,0,0);
+       if(supersample<0)
+               supersample=-supersample;
+       if(supersample>2.0)
+               supersample=2.0f;
+       
+       float begin_sample(x-supersample*0.5);
+       float end_sample(x+supersample*0.5);
+
+       if(size()==1 || end_sample<=front().pos || isnan(x))
+               return front().color;
+       
+       if(begin_sample>=back().pos)
+               return back().color;
+
+       /*
+       if(end_sample>=back().pos)
+               end_sample=back().pos;
+
+       if(begin_sample<=front().pos)
+               begin_sample=front().pos;
+       */
+       
+       const_iterator iter,next;
+
+       /*
+       //optimizize...
+       Real    left = x-supersample/2, right = x+supersample/2;
+       
+       if(left < front().pos) left = front().pos;
+       if(right > back().pos) right = back().pos;
+       
+       //find using binary search...
+       const_iterator iterl,iterr;
+       
+       //the binary search should give us the values BEFORE the point we're looking for...
+       iterl = binary_find(begin(),end(),left);
+       iterr = binary_find(iterl,end(),right);
+       
+       //now integrate over the range of left to right...
+       
+       if(iterl == iterr)
+       {
+               iterr++; //let's look at the next one shall we :)
+               
+               //interpolate neighboring colors
+               const Real one = iterr->pos - iterl->pos;
+               const Real lambda = (x - iterl->pos)/one;
+               
+               //(1-l)iterl + (l)iterr
+               return iterl->color.premult_alpha()*(1-lambda) + iterr->color.premult_alpha()*lambda;
+               
+               //return Color::blend(iterr->color,iterl->color,lambda,Color::BLEND_STRAIGHT);
+       }else
+       {
+               //itegration madness
+               const_iterator i = iterl, ie = iterr+1;
+               Real wlast = left;
+               
+               ColorAccumulator clast,cwork;
+               {
+                       const Real lambda = (x - iterl->pos)/(iterr->pos - iterl->pos);
+                       
+                       //premultiply because that's the form in which we can combine things...
+                       clast = iterl->color.premult_alpha()*(1-lambda) + iterr->color.premult_alpha()*lambda;
+                       //Color::blend((i+1)->color,i->color,(left - i->pos)/((i+1)->pos - i->pos),Color::BLEND_STRAIGHT);
+               }
+               
+               ColorAccumulator        accum = 0;
+               
+               //loop through all the trapezoids and integrate them as we go...
+               //      area of trap = (yi + yi1)*(xi1 - xi)
+               //      yi = clast, xi = wlast, yi1 = i->color, xi1 = i->pos            
+               
+               for(;i<=iterr; wlast=i->pos,clast=i->color.premult_alpha(),++i)
+               {
+                       const Real diff = i->pos - wlast;
+                       if(diff > 0) //only accumulate if there will be area to add
+                       {
+                               cwork = i->color.premult_alpha();
+                               accum += (cwork + clast)*diff;
+                       }
+               }
+               
+               {
+                       const_iterator ibef = i-1;                      
+                       const Real diff = right - ibef->pos;
+                       
+                       if(diff > 0)
+                       {
+                               const Real lambda = diff/(i->pos - ibef->pos);
+                               cwork = ibef->color.premult_alpha()*(1-lambda) + i->color.premult_alpha()*lambda;
+                               
+                               accum += (cwork + clast)*diff; //can probably optimize this more... but it's not too bad
+                       }
+               }
+               
+               accum /= supersample; //should be the total area it was sampled over...
+               return accum.demult_alpha();
+       }*/
+       
+       next=begin(),iter=next++;
+       
+       //add for optimization
+       next = binary_find(begin(),end(),(Real)begin_sample);
+       iter = next++;  
+       
+       //! As a future optimization, this could be performed faster
+       //! using a binary search.
+       for(;iter<end();iter=next++)
+       {
+               if(next==end() || x>=iter->pos &&  x<next->pos && iter->pos!=next->pos)
+               {
+                       // If the supersample region falls square in between
+                       // two CPoints, then we don't have to do anything special.
+                       if(next!=end() && (!supersample || (iter->pos<=begin_sample && next->pos>=end_sample)))
+                       {
+                               const Real dist(next->pos-iter->pos);
+                               const Real pos(x-iter->pos);
+                               const Real amount(pos/dist);
+                               return Color::blend(next->color,iter->color, amount, Color::BLEND_STRAIGHT);
+                       }
+                       // In this case our supersample region extends over one or more
+                       // CPoints. So, we need to calculate our coverage amount.
+                       ColorAccumulator pool(Color::alpha());
+                       float divisor(0.0),weight(0);
+                       
+                       const_iterator iter2,next2;
+                       iter2=iter;
+                       if(iter==begin() && iter->pos>x)
+                       {
+                               weight=x-iter->pos;
+                               //weight*=iter->color.get_a();
+                               pool+=ColorAccumulator(iter->color)*(float)iter->color.get_a()*weight;
+                               divisor+=weight;
+                       }
+                       else
+                       {
+                               while(iter2->pos>=begin_sample)
+                               {
+                                       if(iter2==begin())
+                                       {
+                                               weight=iter2->pos-(begin_sample);
+                                               //weight*=iter2->color.get_a();
+                                               pool+=ColorAccumulator(iter2->color)*(float)iter2->color.get_a()*weight;
+                                               divisor+=weight;
+                                               break;
+                                       }
+                                       next2=iter2--;
+                                       pool+=supersample_helper(*iter2, *next2, begin_sample, end_sample, weight);
+                                       divisor+=weight;
+                               }
+                       }
+                       
+                       next2=iter;
+                       iter2=next2++;
+                       while(iter2->pos<=end_sample)
+                       {
+                               if(next2==end())
+                               {
+                                       weight=(end_sample)-iter2->pos;
+                                       pool+=ColorAccumulator(iter2->color)*(float)iter2->color.get_a()*weight;
+                                       divisor+=weight;
+                                       break;
+                               }
+                               pool+=supersample_helper(*iter2, *next2, begin_sample, end_sample, weight);
+                               divisor+=weight;
+                               iter2=next2++;
+                       }
+                       
+                       if(divisor && pool.get_a() && pool.is_valid())
+                       {
+/*
+                               pool.set_r(pool.get_r()/pool.get_a());
+                               pool.set_g(pool.get_g()/pool.get_a());
+                               pool.set_b(pool.get_b()/pool.get_a());
+                               pool.set_a(pool.get_a()/divisor);
+*/
+                               pool/=divisor;
+                               pool.set_r(pool.get_r()/pool.get_a());
+                               pool.set_g(pool.get_g()/pool.get_a());
+                               pool.set_b(pool.get_b()/pool.get_a());
+                               if(pool.is_valid())
+                                       return pool;
+                               else
+                                       return Color::alpha();
+                       }
+                       else
+                               return Color::alpha();
+               }
+       }
+
+       // We should never get to this point.
+
+       sinfg::error("sinfg::Gradient::operator()(): Logic Error (x=%f)",x);
+       assert(0);
+       throw std::logic_error(strprintf("sinfg::Gradient::operator()(): Logic Error (x=%f)",x));
+}
+
+sinfg::Gradient::iterator
+sinfg::Gradient::proximity(const Real &x)
+{
+       iterator iter;
+       float dist(100000000);
+       float prev_pos(-0230);
+       // This algorithm requires a sorted list.
+       for(iter=begin();iter<end();iter++)
+       {
+               float new_dist;
+               
+               if(prev_pos==iter->pos)
+                       new_dist=(abs(x-iter->pos-0.00001));
+               else
+                       new_dist=(abs(x-iter->pos));
+               
+               if(new_dist>dist)
+               {
+                       iter--;
+                       return iter;
+               }
+               dist=new_dist;
+               prev_pos=iter->pos;
+       }
+       iter--;
+       return iter;
+}
+
+sinfg::Gradient::const_iterator
+sinfg::Gradient::proximity(const Real &x)const
+{
+       return const_cast<Gradient*>(this)->proximity(x);
+       /*
+       const_iterator iter;
+       float dist(100000000);
+       
+       // This algorithm requires a sorted list.
+       for(iter=begin();iter<end();iter++)
+       {
+               const float new_dist(abs(x-iter->pos));
+               if(new_dist>dist)
+               {
+                       iter--;
+                       return iter;
+               }
+               dist=new_dist;
+       }
+       iter--;
+       return iter;
+       */
+}
+
+sinfg::Gradient::iterator
+sinfg::Gradient::find(const UniqueID &id)
+{
+       iterator iter;
+       
+       for(iter=begin();iter<end();iter++)
+       {
+               if(id==*iter)
+                       return iter;
+       }
+       
+       throw Exception::NotFound("sinfg::Gradient::find(): Unable to find UniqueID in gradient");
+}
+       
+sinfg::Gradient::const_iterator
+sinfg::Gradient::find(const UniqueID &id)const
+{
+       const_iterator iter;
+       
+       for(iter=begin();iter<end();iter++)
+       {
+               if(id==*iter)
+                       return iter;
+       }
+       
+       throw Exception::NotFound("sinfg::Gradient::find()const: Unable to find UniqueID in gradient");
+}
diff --git a/synfig-core/trunk/src/synfig/gradient.h b/synfig-core/trunk/src/synfig/gradient.h
new file mode 100644 (file)
index 0000000..6bfe0a1
--- /dev/null
@@ -0,0 +1,102 @@
+/* === S I N F G =========================================================== */
+/*!    \file gradient.h
+**     \brief Color Gradient Class
+**
+**     $Id: gradient.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_GRADIENT_H
+#define __SINFG_GRADIENT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "real.h"
+#include "color.h"
+#include <vector>
+#include <utility>
+#include "uniqueid.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*! \struct GradientCPoint
+**     \brief \todo
+*/
+struct GradientCPoint : public UniqueID
+{
+       Real pos;
+       Color color;
+       
+       bool operator<(const GradientCPoint &rhs)const { return pos<rhs.pos; }
+       bool operator<(const Real &rhs)const { return pos<rhs; }
+       
+       GradientCPoint() { }
+       GradientCPoint(const Real &pos, const Color &color):pos(pos),color(color) { }
+}; // END of class GradientCPoint
+
+       
+/*! \class Gradient
+**     \brief Color Gradient Class
+*/
+class Gradient : public std::vector<GradientCPoint>
+{
+public:
+       typedef GradientCPoint CPoint;
+private:
+       
+public:
+       Gradient() { }
+       
+       //! Two-Tone Color Gradient Convience Constructor
+       Gradient(const Color &c1, const Color &c2);
+
+       //! Three-Tone Color Gradient Convience Constructor
+       Gradient(const Color &c1, const Color &c2, const Color &c3);
+
+       //! Alias for sort (Implemented for consistancy)
+       void sync() { sort(); }
+
+       //! You should call this function after changing stuff.
+       void sort();
+       
+       Color operator()(const Real &x, float supersample=0)const;
+
+       //! Returns the iterator of the CPoint closest to \a x
+       iterator proximity(const Real &x);
+
+       //! Returns the const_iterator of the CPoint closest to \a x
+       const_iterator proximity(const Real &x)const;
+
+       //! Returns the iterator of the CPoint with UniqueID \a id
+       iterator find(const UniqueID &id);
+       
+       //! Returns the const_iterator of the CPoint with UniqueID \a id
+       const_iterator find(const UniqueID &id)const;
+}; // END of class Gradient
+       
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/guid.cpp b/synfig-core/trunk/src/synfig/guid.cpp
new file mode 100644 (file)
index 0000000..0c94eb5
--- /dev/null
@@ -0,0 +1,244 @@
+/* === S I N F G =========================================================== */
+/*!    \file guid.cpp
+**     \brief Template File
+**
+**     $Id: guid.cpp,v 1.4 2005/01/13 06:48:39 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define HASH_MAP_H <ext/hash_map>
+#define SUBTRACT_RNG_H <ext/functional>
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "guid.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <ETL/stringf>
+#include <functional>
+
+#ifdef _DEBUG
+#include "general.h"
+#endif
+
+#ifdef HASH_MAP_H
+#include HASH_MAP_H
+using namespace __gnu_cxx;
+#endif
+
+#ifdef SUBTRACT_RNG_H
+#include SUBTRACT_RNG_H
+using namespace __gnu_cxx;
+#endif
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+#define MANUAL_GUID_CALC
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+// A fast 32-bit linear congruential random number generator
+class quick_rng
+{
+       unsigned long next;
+public:
+       quick_rng(unsigned long seed=0):next(seed) { }
+
+       void set_seed(unsigned long x)
+       {
+               next=x;
+       }
+       
+       unsigned long i32()
+       {
+               static const unsigned long a(1664525);
+               static const unsigned long c(1013904223);
+               
+               return next=next*a+c;
+       }
+
+       unsigned long i16()
+       {
+               return i32()>>16;
+       }
+
+       float f()
+       {
+               static const float m(int(65535));
+               
+               return float(i16())/m;
+       }
+       
+       unsigned long operator()(const unsigned long& m)
+       {
+               if(m==65536)
+                       return i16();
+               else
+               if(m<=65536)
+                       return i16()%m;
+               else
+                       return i32()%m;
+       }
+};
+
+#define GUID_RNG quick_rng
+//#define GUID_RNG subtractive_rng
+
+
+
+#ifdef MANUAL_GUID_CALC
+#include <time.h>
+static GUID_RNG _a, _b;
+static void _set_up_rand_long_long(uint64_t &x);
+static void _get_rand_long_long(uint64_t &x);
+static void (*get_rand_long_long)(uint64_t&)=_set_up_rand_long_long;
+static void _set_up_rand_long_long(uint64_t &x)
+{
+#ifdef _DEBUG
+       sinfg::info("Starting up GUID system...");
+#endif
+       _a=GUID_RNG(time(0)+clock());
+       _b=GUID_RNG(clock());
+       get_rand_long_long=_get_rand_long_long;
+       _get_rand_long_long(x);
+}
+
+static void _get_rand_long_long(uint64_t &x)
+{
+       //subtractive_rng _c(clock());
+       unsigned short* data(reinterpret_cast<unsigned short *>(&x));
+       data[0]=_a(65536);      
+       data[1]=_a(65536);      
+       data[2]=_a(65536);      
+       data[3]=_a(65536);      
+}
+
+#else
+// Use OS-Dependent method
+
+#ifdef _WIN32
+// Win32
+static void get_rand_long_long(uint64_t &x)
+{
+       _GUID* guid(reinterpret_cast<_GUID*>(&x));
+       CoCreateGuid(guid);     
+}
+
+#else
+// Unix
+static int rand_fd;
+static void _set_up_rand_long_long(uint64_t &x);
+static void _get_rand_long_long(uint64_t &x);
+static void (*get_rand_long_long)(uint64_t&)=_set_up_rand_long_long;
+static void _set_up_rand_long_long(uint64_t &x)
+{
+#ifdef _DEBUG
+       sinfg::info("Starting up GUID system...");
+#endif
+       rand_fd=open("/dev/urandom",O_RDONLY);
+       get_rand_long_long=_get_rand_long_long;
+       _get_rand_long_long(x);
+}
+
+static void _get_rand_long_long(uint64_t &x){  read(rand_fd,&x,sizeof(x));}
+
+#endif
+#endif
+
+
+
+void
+sinfg::GUID::make_unique()
+{
+       get_rand_long_long(data.u_64.a);
+       get_rand_long_long(data.u_64.b);
+}
+
+sinfg::GUID
+sinfg::GUID::hasher(const String& str)
+{      
+#ifdef HASH_MAP_H
+       hash<const char*> string_hash_;
+       const unsigned int seed(
+               string_hash_(
+                       str.c_str()
+               )
+       );
+#else
+       const unsigned int seed(0x3B642879);
+       for(int i=0;i<str.size();i++)
+       {
+               seed^=(seed*str[i])*i
+               seed=(seed>>(32-(i%24)))^(seed<<(i%24))
+       }
+#endif
+       
+       GUID_RNG random(seed);
+       GUID ret(0);
+       ret.data.u_32.a=random(~(unsigned int)0);
+       ret.data.u_32.b=random(~(unsigned int)0);
+       ret.data.u_32.c=random(~(unsigned int)0);
+       ret.data.u_32.d=random(~(unsigned int)0);
+       return ret;
+}
+
+sinfg::GUID
+sinfg::GUID::hasher(int i)
+{
+       GUID ret(0);
+       GUID_RNG random(i);
+       ret.data.u_32.a=random(~(unsigned int)0);
+       ret.data.u_32.b=random(~(unsigned int)0);
+       ret.data.u_32.c=random(~(unsigned int)0);
+       ret.data.u_32.d=random(~(unsigned int)0);
+       return ret;
+}
+
+String
+sinfg::GUID::get_string()const
+{
+       return strprintf("%08X%08X%08X%08X",data.u_32.a,data.u_32.b,data.u_32.c,data.u_32.d);
+}
+
+sinfg::GUID::GUID(const String &str)
+{
+       strscanf(str,"%08X%08X%08X%08X",&data.u_32.a,&data.u_32.b,&data.u_32.c,&data.u_32.d);
+}
diff --git a/synfig-core/trunk/src/synfig/guid.h b/synfig-core/trunk/src/synfig/guid.h
new file mode 100644 (file)
index 0000000..791f29f
--- /dev/null
@@ -0,0 +1,140 @@
+/* === S I N F G =========================================================== */
+/*!    \file guid.h
+**     \brief Template Header
+**
+**     $Id: guid.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_GUID_H
+#define __SINFG_GUID_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "string.h"
+#include <stdint.h>
+#include <cassert>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+class GUID
+{
+       union {
+               struct {
+                       unsigned int a;
+                       unsigned int b;
+                       unsigned int c;
+                       unsigned int d;
+               } u_32;
+               struct {
+                       uint64_t a;
+                       uint64_t b;
+               } u_64;
+                       
+       } data;
+       
+public:
+       GUID()
+               { make_unique(); }      
+       GUID(const GUID& x):data(x.data)
+               { }
+       GUID(const int i){assert(!i); data.u_64.a=0;data.u_64.b=0;}
+
+       GUID(const String& str);
+       
+       static GUID zero() { return GUID(0); }
+       static GUID hasher(const String& str);
+       static GUID hasher(int i);
+
+       operator bool()const { return data.u_32.a||data.u_32.b||data.u_32.c||data.u_32.d; }
+       
+       uint64_t get_hi()const { return data.u_64.a; }
+       uint64_t get_lo()const { return data.u_64.b; }
+
+       uint64_t get_hi_hi()const { return data.u_32.a; }
+       uint64_t get_hi_lo()const { return data.u_32.b; }
+       uint64_t get_lo_hi()const { return data.u_32.c; }
+       uint64_t get_lo_lo()const { return data.u_32.d; }
+       
+       void make_unique();
+       String get_string()const;
+       
+       bool operator==(const GUID& rhs)const
+               { return data.u_64.a==rhs.data.u_64.a && data.u_64.b==rhs.data.u_64.b; }
+       bool operator!=(const GUID& rhs)const
+               { return data.u_64.a!=rhs.data.u_64.a || data.u_64.b!=rhs.data.u_64.b; }
+       bool operator<(const GUID& rhs)const
+               { return (data.u_64.a==rhs.data.u_64.a)?(data.u_64.b<rhs.data.u_64.b):(data.u_64.a<rhs.data.u_64.a); }
+       bool operator>(const GUID& rhs)const
+               { return (data.u_64.a==rhs.data.u_64.a)?(data.u_64.b>rhs.data.u_64.b):(data.u_64.a>rhs.data.u_64.a); }
+       bool operator<=(const GUID& rhs)const
+               { return operator<(rhs) || operator==(rhs); }
+       bool operator>=(const GUID& rhs)const
+               { return operator>(rhs) || operator==(rhs); }
+
+       //! Operator '^' (xor)
+       /*! If A ^ B == C, then C ^ B == A and B ^ A == C.
+       **      Also keep in mind that A ^ A == 0 and A ^ B ^ B = A. */
+       GUID& operator^=(const GUID& rhs)
+       {
+               data.u_32.a^=rhs.data.u_32.a;
+               data.u_32.b^=rhs.data.u_32.b;
+               data.u_32.c^=rhs.data.u_32.c;
+               data.u_32.d^=rhs.data.u_32.d;
+               return *this;
+       }
+       GUID operator^(const GUID& rhs)const { return GUID(*this)^=rhs; }
+       
+       //! Operator '%' (alt-xor)
+       /*! A % B != B % A. */
+       GUID& operator%=(const GUID& rhs)
+       {
+               data.u_32.a^=rhs.data.u_32.b;
+               data.u_32.b^=rhs.data.u_32.c;
+               data.u_32.c^=rhs.data.u_32.d;
+               data.u_32.d^=rhs.data.u_32.a;
+               return *this;
+       }
+       GUID operator%(const GUID& rhs)const { return GUID(*this)%=rhs; }
+
+};
+
+class GUIDHash
+{
+public:
+       size_t operator()(const GUID& guid)const
+       {
+               return
+                       guid.get_hi_hi()+
+                       guid.get_hi_lo()+
+                       guid.get_lo_hi()+
+                       guid.get_lo_lo();
+       }
+};
+
+};
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/guidset.h b/synfig-core/trunk/src/synfig/guidset.h
new file mode 100644 (file)
index 0000000..7ca424c
--- /dev/null
@@ -0,0 +1,60 @@
+/* === S I N F G =========================================================== */
+/*!    \file guidset.h
+**     \brief Template Header
+**
+**     $Id: guidset.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_GUIDSET_H
+#define __SINFG_GUIDSET_H
+
+#define HASH_SET_H <ext/hash_set>
+
+/* === H E A D E R S ======================================================= */
+
+#include "guid.h"
+
+#ifdef HASH_SET_H
+#include HASH_SET_H
+#else
+#include <set>
+#endif
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+class GUIDSet : public
+#ifdef HASH_SET_H
+std::set<sinfg::GUID>
+#else
+std::hash_set<sinfg::GUID,sinfg::GUIDHash>
+#endif
+{
+}; // END of class GUIDSet
+       
+};
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/importer.cpp b/synfig-core/trunk/src/synfig/importer.cpp
new file mode 100644 (file)
index 0000000..6fb66cb
--- /dev/null
@@ -0,0 +1,143 @@
+/* === S I N F G =========================================================== */
+/*!    \file importer.cpp
+**     \brief writeme
+**
+**     $Id: importer.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "canvas.h"
+#include "importer.h"
+#include "surface.h"
+#include <algorithm>
+#include "string.h"
+#include <map>
+#include <ctype.h>
+#include <functional>
+
+#endif
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+using namespace etl;
+using namespace std;
+using namespace sinfg;
+
+Importer::Book* sinfg::Importer::book_;
+
+map<String,Importer::LooseHandle> *__open_importers;
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+bool
+Importer::subsys_init()
+{
+       book_=new Book();
+       __open_importers=new map<String,Importer::LooseHandle>();
+       return true;
+}
+
+bool
+Importer::subsys_stop()
+{
+       delete book_;
+       delete __open_importers;
+       return true;
+}
+
+Importer::Book&
+Importer::book()
+{
+       return *book_;
+}
+
+Importer::Handle
+Importer::open(const String &filename)
+{
+       if(filename.empty())
+       {
+               sinfg::error(_("Importer::open(): Cannot open empty filename"));
+               return 0;
+       }
+       
+       // If we already have an importer open under that filename,
+       // then use it instead.
+       if(__open_importers->count(filename))
+       {
+               //sinfg::info("Found importer already open, using it...");
+               return (*__open_importers)[filename];
+       }
+       
+       if(find(filename.begin(),filename.end(),'.')==filename.end())
+       {
+               sinfg::error(_("Importer::open(): Couldn't find extension"));
+               return 0;
+       }
+               
+       String ext=string(filename.begin()+filename.find_last_of('.')+1,filename.end());
+       std::transform(ext.begin(),ext.end(),ext.begin(),&::tolower);
+       
+       
+       if(!Importer::book().count(ext))
+       {
+               sinfg::error(_("Importer::open(): Unknown file type -- ")+ext);
+               return 0;
+       }
+       
+       try {
+               Importer::Handle importer;
+               importer=Importer::book()[ext](filename.c_str());
+               (*__open_importers)[filename]=importer;
+               return importer;
+       }
+       catch (String str)
+       {
+               sinfg::error(str);
+       }
+       return 0;
+}
+
+Importer::Importer():
+       gamma_(2.2)
+{
+}
+
+
+Importer::~Importer()
+{
+       // Remove ourselves from the open importer list
+       map<String,Importer::LooseHandle>::iterator iter;
+       for(iter=__open_importers->begin();iter!=__open_importers->end();++iter)
+               if(iter->second==this)
+               {
+                       __open_importers->erase(iter);
+               }
+}
diff --git a/synfig-core/trunk/src/synfig/importer.h b/synfig-core/trunk/src/synfig/importer.h
new file mode 100644 (file)
index 0000000..40a5717
--- /dev/null
@@ -0,0 +1,122 @@
+/* === S I N F G =========================================================== */
+/*!    \file importer.h
+**     \brief writeme
+**
+**     $Id: importer.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_IMPORTER_H
+#define __SINFG_IMPORTER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <map>
+//#include <cmath>
+#include <ETL/handle>
+#include "string.h"
+//#include "surface.h"
+//#include "general.h"
+//#include "vector.h"
+#include "time.h"
+#include "gamma.h"
+
+/* === M A C R O S ========================================================= */
+
+//! \writeme
+#define SINFG_IMPORTER_MODULE_EXT public: static const char name__[], version__[], ext__[],cvs_id__[]; static Importer *create(const char *filename);
+
+//! Sets the name of the importer
+#define SINFG_IMPORTER_SET_NAME(class,x) const char class::name__[]=x
+
+//! \writeme
+#define SINFG_IMPORTER_SET_EXT(class,x) const char class::ext__[]=x
+
+//! Sets the version of the importer
+#define SINFG_IMPORTER_SET_VERSION(class,x) const char class::version__[]=x
+
+//! Sets the CVS ID of the importer
+#define SINFG_IMPORTER_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
+
+//! \writeme
+#define SINFG_IMPORTER_INIT(class) sinfg::Importer* class::create(const char *filename) { return new class(filename); }
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Surface;
+class ProgressCallback;
+
+/*!    \class Importer
+**     \brief Used for importing bitmaps of various formats, including animations
+**     \todo Write more detailed description
+*/
+class Importer : public etl::shared_object
+{
+public:
+       typedef Importer* (*Factory)(const char *filename);
+       typedef std::map<String,Factory> Book;
+       static Book* book_;
+       
+       static Book& book();
+       
+       static bool subsys_init();
+       static bool subsys_stop();
+
+       typedef etl::handle<Importer> Handle;
+       typedef etl::loose_handle<Importer> LooseHandle;
+       typedef etl::handle<const Importer> ConstHandle;
+
+private:
+       Gamma gamma_;
+
+protected:
+       Importer();
+
+public:
+
+       Gamma& gamma() { return gamma_; }
+       const Gamma& gamma()const { return gamma_; }
+       
+       virtual ~Importer();
+
+       //! Gets a frame and puts it into \a surface
+       /*!     \param  surface Reference to surface to put frame into
+       **      \param  time    For animated importers, determines which frame to get.
+       **              For static importers, this parameter is unused.
+       **      \param  callback Pointer to callback class for progress, errors, etc.
+       **      \return \c true on success, \c false on error
+       **      \see ProgressCallback, Surface
+       */
+       virtual bool get_frame(Surface &surface,Time time, ProgressCallback *callback=NULL)=0;
+
+       //! Returns \c true if the importer pays attention to the \a time parameter of get_frame()
+       virtual bool is_animated() { return false; }
+
+       //! Attempts to open \a filename, and returns a handle to the associated Importer
+       static Handle open(const String &filename);
+};
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/interpolation.h b/synfig-core/trunk/src/synfig/interpolation.h
new file mode 100644 (file)
index 0000000..43db1ea
--- /dev/null
@@ -0,0 +1,52 @@
+/* === S I N F G =========================================================== */
+/*!    \file interpolation.h
+**     \brief Template Header
+**
+**     $Id: interpolation.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_INTERPOLATION_H
+#define __SINFG_INTERPOLATION_H
+
+/* === H E A D E R S ======================================================= */
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg { 
+
+enum Interpolation
+{
+       INTERPOLATION_TCB,
+       INTERPOLATION_CONSTANT,
+       INTERPOLATION_LINEAR,
+       INTERPOLATION_HALT,
+       INTERPOLATION_MANUAL,
+       INTERPOLATION_UNDEFINED,
+       INTERPOLATION_NIL
+}; // END enum Interpolation
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/keyframe.cpp b/synfig-core/trunk/src/synfig/keyframe.cpp
new file mode 100644 (file)
index 0000000..b776a3e
--- /dev/null
@@ -0,0 +1,236 @@
+/* === S I N F G =========================================================== */
+/*!    \file keyframe.cpp
+**     \brief Template File
+**
+**     $Id: keyframe.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include <algorithm>
+
+#include <ETL/stringf>
+
+#include "keyframe.h"
+#include "exception.h"
+#include "general.h"
+#include <ETL/misc>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Keyframe::Keyframe():
+       time_(0)
+{
+}
+
+Keyframe::Keyframe(const Time &time):
+       time_(time)
+{
+}
+
+Keyframe::~Keyframe()
+{
+}
+
+void
+KeyframeList::dump()const
+{
+       const_iterator iter;
+       int i;
+       sinfg::info(">>>>>>>>BEGIN KEYFRAME DUMP");
+       for(iter=begin(),i=0;iter!=end();++iter,i++)
+       {
+               sinfg::info("#%d, time: %s, desc: %s",i,iter->get_time().get_string().c_str(),iter->get_description().c_str());
+       }
+       sinfg::info("<<<<<<<<END KEYFRAME DUMP");
+}
+
+void
+KeyframeList::sync()
+{
+       //DEBUGPOINT();
+       //sinfg::info("PRE-SORT:");
+       //dump();       
+       sort(begin(),end());
+       //sinfg::info("POST-SORT:");
+       //dump();
+       //DEBUGPOINT();
+}
+
+KeyframeList::iterator
+KeyframeList::find(const UniqueID &x)
+{
+       KeyframeList::iterator iter;
+       iter=std::find(begin(),end(),x);
+       if(iter==end())
+               throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find UniqueID %d",x.get_uid()));
+       return iter;
+}
+
+KeyframeList::const_iterator
+KeyframeList::find(const UniqueID &x)const
+{
+       KeyframeList::const_iterator iter;
+       iter=std::find(begin(),end(),x);
+       if(iter==end())
+               throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find UniqueID %d",x.get_uid()));
+       return iter;
+}
+
+KeyframeList::iterator
+KeyframeList::add(const Keyframe &x)
+{
+       push_back(x);
+       iterator ret(end());
+       ret--;
+       assert(x==*ret);
+       sync();
+       return ret;
+}
+
+void
+KeyframeList::erase(const UniqueID &x)
+{
+       std::vector<Keyframe>::erase(find(x));
+}
+
+KeyframeList::iterator
+KeyframeList::find(const Time &x)
+{
+       KeyframeList::iterator iter;
+       iter=binary_find(begin(),end(),x);
+       if(iter!=end() && iter->get_time().is_equal(x))
+               return iter;
+/*     iter++;
+       if(iter!=end() && iter->get_time().is_equal(x))
+               return iter;
+*/
+       throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find Keyframe %s",x.get_string().c_str()));
+}
+
+KeyframeList::iterator
+KeyframeList::find_next(const Time &x)
+{
+       KeyframeList::iterator iter(binary_find(begin(),end(),x));
+
+       if(iter!=end())
+       {
+               if(iter->get_time().is_more_than(x))
+                       return iter;
+               ++iter;
+               if(iter!=end())
+               {
+                       if(iter->get_time().is_more_than(x))
+                               return iter;
+/*                     ++iter;
+                       if(iter!=end() && iter->get_time().is_more_than(x))
+                               return iter;
+*/
+               }
+       }
+       
+       throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find next Keyframe %s",x.get_string().c_str()));
+}
+
+
+KeyframeList::iterator
+KeyframeList::find_prev(const Time &x)
+{
+       KeyframeList::iterator iter(binary_find(begin(),end(),x));
+
+       if(iter!=end())
+       {
+               if(iter->get_time()+Time::epsilon()<x)
+                       return iter;
+               if(iter!=begin() && (--iter)->get_time()+Time::epsilon()<x)
+                       return iter;
+       }
+       throw Exception::NotFound(strprintf("KeyframeList::find(): Can't find prev Keyframe %s",x.get_string().c_str()));
+
+}
+
+
+
+KeyframeList::const_iterator
+KeyframeList::find(const Time &x)const
+{
+       return const_cast<KeyframeList*>(this)->find(x);
+}
+
+
+KeyframeList::const_iterator
+KeyframeList::find_next(const Time &x)const
+{
+       return const_cast<KeyframeList*>(this)->find_next(x);
+
+}
+
+
+KeyframeList::const_iterator
+KeyframeList::find_prev(const Time &x)const
+{
+       return const_cast<KeyframeList*>(this)->find_prev(x);
+
+}
+
+void
+KeyframeList::find_prev_next(const Time& time, Time &prev, Time &next)const
+{
+       try { prev=find_prev(time)->get_time(); }
+       catch(...) { prev=Time::begin(); }
+       try { next=find_next(time)->get_time(); }
+       catch(...) { next=Time::end(); }
+}
+
+void
+KeyframeList::insert_time(const Time& location, const Time& delta)
+{
+//     sinfg::info("KeyframeList::insert_time(): loc=%s, delta=%s",location.get_string().c_str(),delta.get_string().c_str());
+       if(!delta)
+               return;
+       try
+       {
+               iterator iter(find_next(location));
+               for(;iter!=end();++iter)
+               {
+                       iter->set_time(iter->get_time()+delta);
+               }
+               sync();
+       }
+       catch(Exception::NotFound) { }
+}
diff --git a/synfig-core/trunk/src/synfig/keyframe.h b/synfig-core/trunk/src/synfig/keyframe.h
new file mode 100644 (file)
index 0000000..0639898
--- /dev/null
@@ -0,0 +1,127 @@
+/* === S I N F G =========================================================== */
+/*!    \file keyframe.h
+**     \brief Template Header
+**
+**     $Id: keyframe.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_KEYFRAME_H
+#define __SINFG_KEYFRAME_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/handle>
+#include <vector>
+#include "string.h"
+#include "time.h"
+#include "uniqueid.h"
+#include "guid.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+//! \writeme
+class Keyframe :  public UniqueID
+{
+public:
+
+       Time time_;
+       String desc_;
+       GUID guid_;
+       
+public:
+
+       Keyframe();
+
+       Keyframe(const Time &time);
+
+       ~Keyframe();
+
+       void set_time(Time x) { time_=x; }
+       
+       Time get_time()const { return time_; }
+
+       void set_description(String x) { desc_=x; }
+       
+       String get_description()const { return desc_; }
+
+       const GUID& get_guid()const { return guid_; }
+       void set_guid(const GUID& x) { guid_=x; }
+
+       using UniqueID::operator<;
+       using UniqueID::operator==;
+       using UniqueID::operator!=;
+       using UniqueID::operator=;
+       
+       bool operator<(const Keyframe &rhs)const { return time_<rhs.time_; }
+       bool operator<(const Time &rhs)const { return time_<rhs; }
+
+//     bool operator==(const Keyframe &rhs)const { return id_==rhs.id_; }
+       bool operator==(const Time &rhs)const { return time_==rhs; }
+
+//     bool operator!=(const Keyframe &rhs)const { return id_!=rhs.id_; }
+       bool operator!=(const Time &rhs)const { return time_!=rhs; }
+}; // END of class Keyframe
+
+class KeyframeList : public std::vector<Keyframe>
+{
+
+public:
+
+       iterator add(const Keyframe &x);
+
+       void erase(const UniqueID &x);
+
+       iterator find(const UniqueID &x);
+
+       const_iterator find(const UniqueID &x)const;
+
+       //! Finds the keyframe at an exact point in time
+       iterator find(const Time &x);
+
+       //! Finds the keyframe after that point in time
+       iterator find_next(const Time &x);
+
+       //! Finds the keyframe before that point in time
+       iterator find_prev(const Time &x);
+
+       const_iterator find(const Time &x)const;
+       const_iterator find_next(const Time &x)const;
+       const_iterator find_prev(const Time &x)const;
+       
+       void find_prev_next(const Time& time, Time &prev, Time &next)const;
+
+       void insert_time(const Time& location, const Time& delta);
+
+       void dump()const;
+       void sync();    
+};
+
+//typedef std::list<Keyframe> KeyframeList;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer.cpp b/synfig-core/trunk/src/synfig/layer.cpp
new file mode 100644 (file)
index 0000000..24597cf
--- /dev/null
@@ -0,0 +1,564 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer.cpp
+**     \brief Layer class implementation
+**
+**     $Id: layer.cpp,v 1.2 2005/01/24 03:08:17 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "canvas.h"
+#include "layer.h"
+#include "render.h"
+#include "value.h"
+#include "layer_bitmap.h"
+#include "layer_mime.h"
+#include "context.h"
+#include "paramdesc.h"
+
+#include "layer_solidcolor.h"
+#include "layer_polygon.h"
+#include "layer_pastecanvas.h"
+#include "layer_motionblur.h"
+
+#include "valuenode_const.h"
+
+#include "transform.h"
+#include "rect.h"
+#include "guid.h"
+
+#include <sigc++/adaptors/bind.h>
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace etl;
+using namespace std;
+using namespace sinfg;
+
+/* === G L O B A L S ======================================================= */
+
+static Layer::Book* _layer_book;
+
+struct _LayerCounter
+{
+       static int counter;
+       ~_LayerCounter()
+       {
+               if(counter)
+                       sinfg::error("%d layers not yet deleted!",counter);
+       }
+} _layer_counter;
+
+int _LayerCounter::counter(0);
+
+/* === P R O C E D U R E S ================================================= */
+
+Layer::Book&
+Layer::book()
+{
+       return *_layer_book;
+}
+
+void
+Layer::register_in_book(const BookEntry &entry)
+{
+       book()[entry.name]=entry;
+}
+
+bool
+Layer::subsys_init()
+{
+       _layer_book=new Book();
+
+#define INCLUDE_LAYER(class)   sinfg::Layer::book()[sinfg::String(class::name__)]=BookEntry(class::create,class::name__,class::local_name__,class::category__,class::cvs_id__,class::version__)
+#define LAYER_ALIAS(class,alias)       sinfg::Layer::book()[sinfg::String(alias)]=sinfg::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);
+
+#undef INCLUDE_LAYER
+
+       return true;
+}
+
+bool
+Layer::subsys_stop()
+{
+       delete _layer_book;
+       return true;
+}
+
+/* === M E T H O D S ======================================================= */
+
+Layer::Layer():
+       active_(true),
+       z_depth_(0.0f),
+       dirty_time_(Time::end())
+{
+       _LayerCounter::counter++;
+}
+
+Layer::LooseHandle
+sinfg::Layer::create(const String &name)
+{
+       if(!book().count(name))
+       {
+               return Layer::LooseHandle(new Layer_Mime(name));
+       }
+       
+       Layer* layer(book()[name].factory());
+       return Layer::LooseHandle(layer);
+}
+
+sinfg::Layer::~Layer()
+{
+       _LayerCounter::counter--;
+       while(!dynamic_param_list_.empty())
+       {
+               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
+sinfg::Layer::set_canvas(etl::loose_handle<sinfg::Canvas> x)
+{
+       if(canvas_!=x)
+       {
+               parent_death_connect_.disconnect();
+               canvas_=x;
+               if(x)
+               {
+                       parent_death_connect_=x->signal_deleted().connect(
+                               sigc::bind(
+                                       sigc::mem_fun(
+                                               *this,
+                                               &Layer::set_canvas
+                                       ),
+                                       etl::loose_handle<sinfg::Canvas>(0)
+                               )
+                       );
+               }
+               on_canvas_set();
+       }
+}
+
+void
+sinfg::Layer::on_canvas_set()
+{
+}
+
+etl::loose_handle<sinfg::Canvas>
+sinfg::Layer::get_canvas()const
+{
+       return canvas_;
+}
+
+int
+Layer::get_depth()const
+{
+       if(!get_canvas())
+               return -1;
+       return get_canvas()->get_depth(const_cast<sinfg::Layer*>(this));
+}
+
+void
+Layer::set_active(bool x)
+{
+       if(active_!=x)
+       {
+               active_=x;
+
+               Node::on_changed();
+               signal_status_changed_();
+       }
+}
+
+void
+Layer::set_description(const String& x)
+{
+       if(description_!=x)
+       {
+               description_=x;
+               signal_description_changed_();          
+       }
+}
+
+bool
+Layer::connect_dynamic_param(const String& param, etl::loose_handle<ValueNode> value_node)
+{
+       ValueNode::Handle previous(dynamic_param_list_[param]);
+
+       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;
+}
+
+bool
+Layer::disconnect_dynamic_param(const String& param)
+{
+       ValueNode::Handle previous(dynamic_param_list_[param]);
+
+       if(previous)
+       {
+               dynamic_param_list_.erase(param);
+               remove_child(previous.get());
+               changed();
+       }
+       return true;
+}
+
+void
+Layer::on_changed()
+{
+       dirty_time_=Time::end();
+       if(active())
+               Node::on_changed();
+}
+
+bool
+Layer::set_param(const String &param, const ValueBase &value)
+{
+       if(param=="z_depth" && value.same_as(z_depth_))
+       {
+               z_depth_=value.get(z_depth_);
+               return true;
+       }
+       return false;
+}
+
+etl::handle<Transform>
+Layer::get_transform()const
+{
+       return 0;
+}
+
+float
+Layer::get_z_depth(const sinfg::Time& t)const
+{
+       if(!dynamic_param_list().count("z_depth"))
+               return z_depth_;
+       return (*dynamic_param_list().find("z_depth")->second)(t).get(Real());
+}
+
+Layer*
+Layer::simple_clone()const
+{
+       if(!book().count(get_name())) return 0;
+       Layer *ret = create(get_name()).get();
+       ret->set_canvas(get_canvas());
+       ret->set_description(get_description());
+       ret->set_param_list(get_param_list());
+       return ret;
+}
+
+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
+       ParamList param_list(get_param_list());
+       for(ParamList::const_iterator iter(param_list.begin()); iter != param_list.end(); ++iter)
+       {
+               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())
+                       {
+                               // This parameter is an inlinecanvas! we need to clone it
+                               // before we set it as aparameter.
+                               Canvas::Handle new_canvas(canvas->clone(deriv_guid));
+                               ValueBase value(new_canvas);
+                               ret->set_param(iter->first, value);
+                               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)
+       {
+               // Make sure we clone inlinecanvases
+               if(iter->second->get_type()==ValueBase::TYPE_CANVAS)
+               {
+                       Canvas::Handle canvas((*iter->second)(0).get(Canvas::Handle()));
+                       if(canvas->is_inline())
+                       {
+                               Canvas::Handle new_canvas(canvas->clone(deriv_guid));
+                               ValueBase value(new_canvas);
+                               ret->connect_dynamic_param(iter->first,ValueNode_Const::create(value));
+                               continue;
+                       }
+               }
+               
+               if(iter->second->is_exported())
+                       ret->connect_dynamic_param(iter->first,iter->second);
+               else
+                       ret->connect_dynamic_param(iter->first,iter->second->clone(deriv_guid));
+       }
+
+       //ret->set_canvas(0);
+       
+       return ret;
+}
+
+Rect
+Layer::get_full_bounding_rect(Context context)const
+{
+       if(active())
+               return context.get_full_bounding_rect()|get_bounding_rect();
+       return context.get_full_bounding_rect();
+}
+
+Rect
+Layer::get_bounding_rect()const
+{
+       return Rect::full_plane();
+}
+
+bool
+Layer::set_param_list(const ParamList &list)
+{
+       bool ret=true;
+       if(!list.size())
+               return false;
+       ParamList::const_iterator iter(list.begin());
+       for(;iter!=list.end();++iter)
+       {
+               if(!set_param(iter->first, iter->second))ret=false;
+       }
+       return ret;
+}
+
+Layer::ParamList
+Layer::get_param_list()const
+{
+       ParamList ret;
+
+       Vocab vocab(get_param_vocab());
+
+       Vocab::const_iterator iter=vocab.begin();
+       for(;iter!=vocab.end();++iter)
+       {
+               ret[iter->get_name()]=get_param(iter->get_name());
+       }
+       return ret;
+}
+
+ValueBase
+Layer::get_param(const String & param)const
+{
+       if(param=="z_depth")
+               return get_z_depth();
+
+       return ValueBase();
+}
+
+String
+Layer::get_version()const
+{
+       return get_param("version__").get(String());
+}
+
+bool
+Layer::set_version(const String &ver)
+{
+       return false;
+}
+
+void
+Layer::reset_version()
+{
+}
+
+
+void
+Layer::set_time(Context context, Time time)const
+{
+       context.set_time(time);
+       dirty_time_=time;
+}
+
+void
+Layer::set_time(Context context, Time time, const Point &pos)const
+{
+       context.set_time(time,pos);
+       dirty_time_=time;
+}
+
+Color
+Layer::get_color(Context context, const Point &pos)const
+{
+       return context.get_color(pos);
+}
+
+sinfg::Layer::Handle
+Layer::hit_check(sinfg::Context context, const sinfg::Point &pos)const
+{
+       return context.hit_check(pos);
+}
+
+/*     The default accelerated renderer
+**     is anything but accelerated...
+*/
+bool
+Layer::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)  const
+{
+       handle<Target> target=surface_target(surface);
+       if(!target)
+       {
+               if(cb)cb->error(_("Unable to create surface target"));
+               return false;
+       }
+       RendDesc desc=renddesc;
+       target->set_rend_desc(&desc);
+
+       // When we render, we want to
+       // make sure that we are rendered too...
+       // Since the context iterator is for
+       // the layer after us, we need to back up.
+       // This could be considered a hack, as
+       // it is a possibility that we are indeed
+       // not the previous layer.
+       --context;
+
+       return render(context,target,desc,cb);
+       //return render_threaded(context,target,desc,cb,2);
+}
+
+String
+Layer::get_name()const
+{
+       return get_param("name__").get(String());
+}
+
+String
+Layer::get_local_name()const
+{
+       return get_param("local_name__").get(String());
+}
+
+
+Layer::Vocab
+Layer::get_param_vocab()const
+{
+       Layer::Vocab ret;
+
+       ret.push_back(ParamDesc(z_depth_,"z_depth")
+               .set_local_name(_("Z Depth"))
+               .set_animation_only(true)
+       );
+
+       return ret;
+}
+
+void
+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();            
+               set.insert(tset.begin(),tset.end());
+       }
+}
+
+
+void
+Layer::add_to_group(const String&x)
+{
+       if(x==group_)
+               return;
+       if(!group_.empty())
+               remove_from_all_groups();
+       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()
+{
+       if(group_.empty())
+               return;
+       signal_removed_from_group()(group_);
+       group_.clear();
+}
+       
+String
+Layer::get_group()const
+{
+       return group_;
+}
diff --git a/synfig-core/trunk/src/synfig/layer.h b/synfig-core/trunk/src/synfig/layer.h
new file mode 100644 (file)
index 0000000..923e8f3
--- /dev/null
@@ -0,0 +1,453 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer.h
+**     \brief Layer Class Header
+**
+**     $Id: layer.h,v 1.2 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_H
+#define __SINFG_LAYER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "string_decl.h"
+#include <map>
+#include <ETL/handle>
+#include "real.h"
+#include "string.h"
+#include <sigc++/signal.h>
+#include <sigc++/connection.h>
+#include "node.h"
+#include "time.h"
+#include "guid.h"
+
+/* === M A C R O S ========================================================= */
+
+//! \writeme
+#define SINFG_LAYER_MODULE_EXT public: static const char name__[], version__[], cvs_id__[], local_name__[], category__[]; static Layer *create();
+
+//! Sets the name of the layer
+#define SINFG_LAYER_SET_NAME(class,x) const char class::name__[]=x
+
+//! Sets the local name of the layer
+#define SINFG_LAYER_SET_LOCAL_NAME(class,x) const char class::local_name__[]=x;
+
+//! Sets the categpru of the layer
+#define SINFG_LAYER_SET_CATEGORY(class,x) const char class::category__[]=x
+
+//! Sets the version string for the layer
+#define SINFG_LAYER_SET_VERSION(class,x) const char class::version__[]=x
+
+//! Sets the CVS ID string for the layer
+#define SINFG_LAYER_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
+
+//! \writeme
+#define SINFG_LAYER_INIT(class) sinfg::Layer* class::create() { return new class(); }
+
+//! \writeme
+#define IMPORT_PLUS(x,y) if(param==#x && value.same_as(x)) { value.put(&x);{y;}return true;}
+
+//! \writeme
+#define IMPORT_AS(x,y) if(param==y && value.same_as(x)) { value.put(&x); return true;}
+
+//! \writeme
+#define IMPORT(x) IMPORT_AS(x,#x)
+
+//! \writeme
+#define EXPORT_AS(x,y) if(param==y) { return ValueBase(x); }
+
+//! \writeme
+#define EXPORT(x)                                      EXPORT_AS(x,#x)
+
+//! \writeme
+#define EXPORT_NAME()  if(param=="Name" || param=="name" || param=="name__") { return name__; } if(param=="local_name__") { return local_name__; }
+
+//! \writeme
+#define EXPORT_VERSION()       if(param=="Version" || param=="version" || param=="version__") { return version__; }
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Canvas;
+class Vector;
+typedef Vector Point;
+class Canvas;
+class ParamDesc;
+class ParamVocab;
+class ValueNode;
+class ValueBase;
+class Time;
+class Surface;
+class RendDesc;
+class ProgressCallback;
+class Context;
+class Color;
+class Transform;
+class Rect;
+class GUID;
+
+
+/*!    \class Layer
+**     \todo writeme
+**     \see Canvas
+*/
+class Layer : public Node
+{
+       friend class ValueNode;
+       friend class Context;
+               
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public:
+
+       //! Type that represents a pointer to a layer's constructor
+       typedef Layer* (*Factory)();
+
+       struct BookEntry
+       {
+               Factory factory;
+               String name;
+               String local_name;
+               String category;
+               String cvs_id;
+               String version;
+               BookEntry() { }
+               BookEntry(Factory factory, const String& name,const String& local_name,const String& category,const String& cvs_id,const String& version):
+                       factory(factory),name(name),local_name(local_name),category(category),cvs_id(cvs_id),version(version) { }
+       };
+
+       typedef std::map<String,BookEntry> Book;
+
+       static void register_in_book(const BookEntry &);
+
+       static Book& book();
+       
+       static bool subsys_init();
+
+       static bool subsys_stop();
+
+       typedef std::map<String,ValueBase> ParamList;
+
+       typedef etl::handle<Layer> Handle;
+
+       typedef etl::loose_handle<Layer> LooseHandle;
+
+       typedef etl::handle<const Layer> ConstHandle;
+
+       typedef std::map<String,etl::rhandle<ValueNode> > DynamicParamList;
+
+       //! A list type which describes all the parameters that a layer has.
+       /*! \see get_param_vocab() */
+       typedef ParamVocab Vocab;
+
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+private:
+
+       /*! \c true if the layer is visible, \c is it is to be skipped
+       **      \see set_active(), enable(), disable, active()
+       */
+       bool active_;
+
+       //! Handle to the canvas to which this layer belongs
+       etl::loose_handle<Canvas> canvas_;
+
+       DynamicParamList dynamic_param_list_;
+
+       //! A description of what this layer does
+       String description_;
+
+       //! \writeme
+       float z_depth_;
+       
+       //! \writeme
+       mutable Time dirty_time_;
+       
+       //! Contains the name of the group that this layer belongs to
+       String group_;
+       
+       //! \writeme
+       sigc::connection parent_death_connect_;
+       
+       /*
+ -- ** -- S I G N A L S -------------------------------------------------------
+       */
+
+private:
+
+       //!     Status Changed
+       sigc::signal<void> signal_status_changed_;      
+       
+       //!     Parameter changed
+       sigc::signal<void,String> signal_param_changed_;        
+
+       //!     Description Changed
+       sigc::signal<void> signal_description_changed_; 
+
+       //!     Moved
+       sigc::signal<void, int, etl::handle<Canvas> > signal_moved_;    
+
+       sigc::signal<void, String> signal_added_to_group_;      
+
+       sigc::signal<void, String> signal_removed_from_group_;  
+
+       /*
+ -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
+       */
+
+public:
+
+       //!     Status Changed
+       sigc::signal<void>& signal_status_changed() { return signal_status_changed_; }  
+       
+       //!     Parameter changed
+       sigc::signal<void,String>& signal_param_changed() { return signal_param_changed_; }
+
+       //!     Description Changed
+       sigc::signal<void>& signal_description_changed() { return signal_description_changed_;} 
+
+       //!     Moved
+       sigc::signal<void, int, etl::handle<Canvas> >& signal_moved() { return signal_moved_; }
+
+       sigc::signal<void, String>& signal_added_to_group() { return signal_added_to_group_; }  
+
+       sigc::signal<void, String>& signal_removed_from_group() { return signal_removed_from_group_; }  
+
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+protected:
+
+       Layer();
+
+public:
+       virtual ~Layer();
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       virtual void on_canvas_set();
+
+       //! Adds this layer to the given layer group
+       void add_to_group(const String&);
+       
+       //! Removes this layer from the given layer group
+       void remove_from_group(const String&);
+       
+       //! Removes this layer from all layer groups
+       void remove_from_all_groups();
+       
+       //! Gets the name of the group that this layer belongs to
+       String get_group()const;
+
+       //! \todo writeme
+       //DynamicParamList &dynamic_param_list() { return dynamic_param_list_; }
+
+       //! \todo writeme
+       const DynamicParamList &dynamic_param_list()const { return dynamic_param_list_; }
+
+       bool connect_dynamic_param(const String& param, etl::loose_handle<ValueNode>);
+       bool disconnect_dynamic_param(const String& param);
+               
+       //! Enables the layer for rendering (Making it \em active)
+       void enable() { set_active(true); }
+
+       //! Disables the layer for rendering. (Making it \em inactive)
+       /*! When a layer is disabled, it will be skipped when the
+       **      canvas is rendered. */
+       void disable() { set_active(false); }
+
+       //! Sets the 'active' flag for the Layer to the state described by \a x
+       /*! When a layer is disabled, it will be skipped when the
+       **      canvas is rendered. */
+       void set_active(bool x);
+
+       //! Returns that status of the 'active' flag
+       bool active()const { return active_; }
+
+       //! Returns the position of the layer in the canvas.
+       /*! Returns negative on error */
+       int get_depth()const;
+
+       //! \writeme
+       float get_z_depth()const { return z_depth_; }
+
+       //! \writeme
+       float get_z_depth(const sinfg::Time& t)const;
+
+       //! \writeme
+       void set_z_depth(float x) { z_depth_=x; }
+       
+       //! Sets the Canvas that this Layer is a part of
+       void set_canvas(etl::loose_handle<Canvas> canvas);
+       
+       //! Returns a handle to the Canvas to which this Layer belongs
+       etl::loose_handle<Canvas> get_canvas()const;
+       
+       //! \writeme
+       const String& get_description()const { return description_; }
+
+       //! \writeme
+       void set_description(const String& x);
+       
+       /*
+ --    ** -- V I R T U A L   F U N C T I O N S -----------------------------------
+       */
+
+public:
+       virtual Rect get_bounding_rect()const;
+
+       virtual Rect get_full_bounding_rect(Context context)const;
+
+       //! Returns a string containing the name of the Layer
+       virtual String get_name()const; 
+
+       //! Returns a string containing the localized name of the Layer
+       virtual String get_local_name()const;
+
+       //! Gets the paramater vocabulary
+       virtual Vocab get_param_vocab()const;
+
+       //! Gets the version string for this layer
+       virtual String get_version()const;
+
+       //! \writeme
+       virtual etl::handle<Transform> get_transform()const;
+
+       //! Sets the virtual version to use for backwards-compatibility
+       /*!
+       **      \see reset_version() */
+       virtual bool set_version(const String &ver);
+
+       //! Resets the virtual version
+       /*!
+       **      \see set_version() */
+       virtual void reset_version();
+
+       //!     Sets the parameter described by \a param to \a value.
+       /*!     \param param The name of the parameter to set
+       **      \param value What the parameter is to be set to.
+       **      \return \c true on success, \c false upon rejection or failure.
+       **              If it returns \c false, then the Layer is assumed to remain unchanged.
+       **      \sa get_param()
+       **      \todo \a param should be of the type <tt>const String \&param</tt>
+       */
+       virtual bool set_param(const String &param, const ValueBase &value);
+
+       //!     Sets a list of parameters
+       virtual bool set_param_list(const ParamList &);
+
+       //! Get the value of the specified parameter.
+       /*!     \return The requested parameter value, or (upon failure) a NIL ValueBase.
+       **      \sa set_param()
+       **      \todo \a param should be of the type <tt>const String \&</tt>
+       */
+       virtual ValueBase get_param(const String &param)const;
+
+       //! Get a list of all of the parameters and their values
+       virtual ParamList get_param_list()const;
+
+       //! Sets the \a time for the selected Layer and those under it
+       /*!     \param context          Context iterator refering to next Layer.
+       **      \param time                     writeme
+       **      \see Handle::set_time()
+       */
+       virtual void set_time(Context context, Time time)const;
+
+       //! Sets the \a time for the selected Layer and those under it for a specific \a point
+       /*!     \param context          Context iterator refering to next Layer.
+       **      \param time                     writeme
+       **      \param point            writeme
+       **      \see Handle::set_time()
+       **      \todo \a point should be of the type <tt>const Point \&</tt> */
+       virtual void set_time(Context context, Time time, const Point &point)const;
+
+       //! Gets the color of the Canvas at \a point
+       /*!     \param context          Context iterator refering to next Layer.
+       **      \param point            Point which indicates where the desired Color should come from
+       **      \todo \a point should be of the type <tt>const Point \&</tt>
+       **      \see Handle::get_color()
+       */
+       virtual Color get_color(Context context, const Point &point)const;
+
+       //! Renders the Canvas to the given Surface in an accelerated manner
+       /*!     \param context          Context iterator refering to next Layer.
+       **      \param surface          Pointer to Surface to render to.
+       **      \param quality          The requested quality-level to render at.
+       **      \param rend_desc        The associated RendDesc.
+       **      \param callback         Pointer to callback object. May be NULL if there is no callback.
+       **      \return \c true on success, \c false on failure
+       **      \see Handle::accelerated_render()
+       */
+       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &rend_desc, ProgressCallback *callback)const;
+
+       //! Checks to see if a part of the layer is directly under \a point
+       /*!     \param context          Context iterator refering to next Layer.
+       **      \param point            The point to check
+       **      \return         The handle of the layer under \a point. If there is not
+       **                              a layer under \a point, then returns an empty handle. */
+       virtual Handle hit_check(Context context, const Point &point)const;
+
+       //! Duplicates the Layer
+       virtual Handle clone(const GUID& deriv_guid=GUID())const;
+
+       //! Duplicates the Layer without duplicating the value nodes
+       virtual Layer *simple_clone()const;
+
+protected:
+
+       //! This is called whenever a parameter is changed
+       virtual void on_changed();
+
+       //! Called to figure out the animation time information
+       virtual void get_times_vfunc(Node::time_set &set) const;
+
+       /*
+ --    ** -- S T A T I C  F U N C T I O N S --------------------------------------
+       */
+
+public:
+
+       //! Creates a Layer of type \a type
+       /*!     If the Layer type is unknown, then a Mime layer is created in its place.
+       **      \param type     A string describing the name of the layer to construct.
+       **      \return Always returns a handle to a new Layer.
+       **      \see Mime
+       */
+       static Layer::LooseHandle create(const String &type);
+
+}; // END of class Layer
+
+}; // END of namespace sinfg
+
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer_bitmap.cpp b/synfig-core/trunk/src/synfig/layer_bitmap.cpp
new file mode 100644 (file)
index 0000000..c7eb0c2
--- /dev/null
@@ -0,0 +1,488 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_bitmap.cpp
+**     \brief Template Header
+**
+**     $Id: layer_bitmap.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "layer_bitmap.h"
+#include "layer.h"
+#include "time.h"
+#include "string.h"
+#include "vector.h"
+
+#include "context.h"
+#include "time.h"
+#include "color.h"
+#include "surface.h"
+#include "renddesc.h"
+#include "target.h"
+
+#include "general.h"
+#include "paramdesc.h"
+#include <ETL/misc>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace sinfg;
+using namespace std;
+using namespace etl;
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::Layer_Bitmap::Layer_Bitmap():
+    Layer_Composite    (1.0,Color::BLEND_COMPOSITE),
+       tl                              (-0.5,0.5),
+       br                              (0.5,-0.5),
+       c                               (1),
+       surface                 (128,128),
+       gamma_adjust    (1.0)
+{
+}
+       
+bool
+sinfg::Layer_Bitmap::set_param(const String & param, ValueBase value)
+{
+       IMPORT(tl);
+       IMPORT(br);
+       IMPORT(c);
+       if(param=="gamma_adjust"&& value.get_type()==ValueBase::TYPE_REAL)
+       {
+               gamma_adjust=1.0/value.get(Real());
+               //gamma_adjust.set_gamma(1.0/value.get(Real()));
+               return true;
+       }
+       
+       return Layer_Composite::set_param(param,value);
+}
+
+ValueBase
+sinfg::Layer_Bitmap::get_param(const String & param)const
+{
+       EXPORT(tl);
+       EXPORT(br);
+       EXPORT(c);
+       if(param=="gamma_adjust")
+               return 1.0/gamma_adjust;
+
+       if(param=="_width")
+       {
+               return surface.get_w();
+       }
+       if(param=="_height")
+       {
+               return surface.get_h();
+       }
+       
+       return Layer_Composite::get_param(param);
+}
+
+Layer::Vocab
+Layer_Bitmap::get_param_vocab()const
+{
+       Layer::Vocab ret(Layer_Composite::get_param_vocab());
+       
+       ret.push_back(ParamDesc("tl")
+               .set_local_name(_("Top-Left"))
+               .set_description(_("Upper left-hand Corner of image"))
+       );
+
+       ret.push_back(ParamDesc("br")
+               .set_local_name(_("Bottom-Right"))
+               .set_description(_("Lower right-hand Corner of image"))
+       );
+
+       ret.push_back(ParamDesc("c")
+               .set_local_name(_("Interpolation"))
+               .set_description(_("What type of interpolation to use"))
+               .set_hint("enum")
+               .add_enum_value(0,"nearest",_("Nearest Neighbor"))
+               .add_enum_value(1,"linear",_("Linear"))
+               .add_enum_value(2,"cosine",_("Cosine"))
+               .add_enum_value(3,"cubic",_("Cubic"))
+       );
+
+       ret.push_back(ParamDesc("gamma_adjust")
+               .set_local_name(_("Gamma Adjustment"))
+       );
+
+       return ret;
+}
+
+sinfg::Layer::Handle
+Layer_Bitmap::hit_check(sinfg::Context context, const sinfg::Point &pos)const
+{
+       Point surface_pos;
+       surface_pos=pos-tl;
+       
+       surface_pos[0]/=br[0]-tl[0];
+       if(surface_pos[0]<=1.0 && surface_pos[0]>=0.0)
+       {
+               surface_pos[1]/=br[1]-tl[1];
+               if(surface_pos[1]<=1.0 && surface_pos[1]>=0.0)
+               {
+                       return const_cast<Layer_Bitmap*>(this);
+               }
+       }
+       
+       return context.hit_check(pos);
+}
+
+inline
+const Color&
+sinfg::Layer_Bitmap::filter(const Color& c)const
+{
+       if(gamma_adjust==1.0)
+               return c;
+       static Color x;
+       x=c;
+       
+       x.set_r(powf((float)x.get_r(),gamma_adjust));
+       x.set_g(powf((float)x.get_g(),gamma_adjust));
+       x.set_b(powf((float)x.get_b(),gamma_adjust));
+       return x;
+}
+
+Color
+sinfg::Layer_Bitmap::get_color(Context context, const Point &pos)const
+{
+       Point surface_pos;
+
+       if(!get_amount())
+               return context.get_color(pos);
+       
+       surface_pos=pos-tl;
+       
+       surface_pos[0]/=br[0]-tl[0];
+       if(surface_pos[0]<=1.0 && surface_pos[0]>=0.0)
+       {
+               surface_pos[1]/=br[1]-tl[1];
+               if(surface_pos[1]<=1.0 && surface_pos[1]>=0.0)
+               {
+                       surface_pos[0]*=surface.get_w();
+                       surface_pos[1]*=surface.get_h();
+                               
+                       Color ret(Color::alpha());
+
+                       switch(c)
+                       {
+                       case 6: // Undefined
+                       case 5: // Undefined
+                       case 4: // Undefined
+                       case 3: // Cubic
+                               ret=surface.cubic_sample(surface_pos[0],surface_pos[1]);
+                               break;
+
+                       case 2: // Cosine
+                               ret=surface.cosine_sample(surface_pos[0],surface_pos[1]);
+                               break;
+                       case 1: // Linear
+                               ret=surface.linear_sample(surface_pos[0],surface_pos[1]);
+                               break;
+                       case 0: // Nearest Neighbor
+                       default:
+                               {
+                                       int x(min(surface.get_w()-1,max(0,round_to_int(surface_pos[0]))));
+                                       int y(min(surface.get_h()-1,max(0,round_to_int(surface_pos[1]))));
+                                       ret= surface[y][x];
+                               }
+                       break;
+                       }
+                       
+                       ret=filter(ret);
+                       
+                       if(get_amount()==1 && get_blend_method()==Color::BLEND_STRAIGHT)
+                               return ret;
+                       else
+                               return Color::blend(ret,context.get_color(pos),get_amount(),get_blend_method());
+               }
+       }
+       
+       return context.get_color(pos);
+}
+
+bool
+Layer_Bitmap::accelerated_render(Context context,Surface *out_surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)  const
+{
+       int interp=c;
+       if(quality>=10)
+               interp=0;
+       else if(quality>=5 && interp>1)
+               interp=1;
+
+       // We can only handle NN and Linear at the moment
+       //if(interp>1)
+       //      return Layer_Composite::accelerated_render(context,out_surface,quality,renddesc,cb);
+       
+       //if we don't actually have a valid surface just skip us
+       if(!surface.is_valid())
+       {
+               // Render what is behind us
+               return context.accelerated_render(out_surface,quality,renddesc,cb);
+       }
+                       
+       SuperCallback subcb(cb,1,10000,10001+renddesc.get_h());
+
+       if(     get_amount()==1 &&
+               get_blend_method()==Color::BLEND_STRAIGHT &&
+               renddesc.get_tl()==tl &&
+               renddesc.get_br()==br)
+       {
+               // Check for the trivial case
+               if(surface.get_w()==renddesc.get_w() && surface.get_h()==renddesc.get_h() && gamma_adjust==1.0f)
+               {
+                       if(cb && !cb->amount_complete(0,100)) return false;
+                       *out_surface=surface;
+                       if(cb && !cb->amount_complete(100,100)) return false;
+                       return true;
+               }
+               out_surface->set_wh(renddesc.get_w(),renddesc.get_h());
+       }
+       else
+       {
+               // Render what is behind us
+               if(!context.accelerated_render(out_surface,quality,renddesc,&subcb))
+                       return false;
+       }
+       
+       if(cb && !cb->amount_complete(10000,10001+renddesc.get_h())) return false;
+
+       Point   obr     = renddesc.get_br(),
+                       otl = renddesc.get_tl();
+       
+       //Vector::value_type pw=renddesc.get_w()/(renddesc.get_br()[0]-renddesc.get_tl()[0]);
+       //Vector::value_type ph=renddesc.get_h()/(renddesc.get_br()[1]-renddesc.get_tl()[1]);
+       
+       //A = representation of input (just tl,br)      //just a scaling right now
+       //B = representation of output (just tl,br)     //just a scaling right now
+       //sa = scaling for input (0,1) -> (0,w/h)
+       //sb = scaling for output (0,1) -> (0,w/h)
+       
+       float   inwf = br[0] - tl[0];
+       float   inhf = br[1] - tl[1];
+       
+       float   outwf = obr[0] - otl[0];
+       float   outhf = obr[1] - otl[1];
+       
+       int             inw = surface.get_w();
+       int             inh = surface.get_h();
+               
+       int             outw = renddesc.get_w();
+       int             outh = renddesc.get_h();
+               
+       //need to get the input coords in output space, so we can clip
+       
+       //get the desired corners of the bitmap (in increasing order) in integers
+       //floating point corners
+       float x1f = (tl[0] - otl[0])*outw/outwf;
+       float x2f = (br[0] - otl[0])*outw/outwf;
+       float y1f = (tl[1] - otl[1])*outh/outhf;
+       float y2f = (br[1] - otl[1])*outh/outhf;
+       
+       if(x1f > x2f) swap(x1f,x2f);
+       if(y1f > y2f) swap(y1f,y2f);
+       
+       int x_start = max(0,(int)floor(x1f));   //probably floor
+       int x_end       = min(outw,(int)ceil(x2f));     //probably ceil
+       int y_start = max(0,(int)floor(y1f));   //probably floor
+       int y_end       = min(outh,(int)ceil(y2f));     //probably ceil
+       
+       //need to get the x,y,dx,dy values from output space to input, so we can do fast interpolation
+       
+       //get the starting position in input space... for interpolating
+       
+       // in int -> out float:
+       // Sb(B^-1)A(Sa^-1) x
+       float inx_start = (((x_start/*+0.5f*/)*outwf/outw + otl[0]) - tl[0])*inw/inwf; //may want to bias this (center of pixel)???
+       float iny_start = (((y_start/*+0.5f*/)*outhf/outh + otl[1]) - tl[1])*inh/inhf; //may want to bias this (center of pixel)???
+       
+       //calculate the delta values in input space for one pixel movement in output space
+       //same matrix but with a vector instead of a point...
+       float indx = outwf*(inw)/((outw)*inwf);         //translations died
+       float indy = outhf*(inh)/((outh)*inhf);         //translations died
+       
+       //perhaps use a DDA algorithm... if faster... 
+       //   will still want pixel fractions to be floating point since colors are
+
+       //sinfg::info("xstart:%d ystart:%d xend:%d yend:%d",x_start,y_start,x_end,y_end);
+       
+       //start drawing at the start of the bitmap (either origin or corner of input...)
+       //and get other info
+       Surface::alpha_pen pen(out_surface->get_pen(x_start,y_start));
+       pen.set_alpha(get_amount());
+       pen.set_blend_method(get_blend_method());
+       
+       //check if we should use the downscale filtering
+       if(quality <= 7)
+       {
+               //the stride of the value should be inverted because we want to downsample 
+               //when the stride is small, not big
+               //int multw = (int)ceil(indx);
+               //int multh = (int)ceil(indy);
+               
+               if(indx > 1.7 || indy > 1.7)
+               {
+                       /*sinfg::info("Decided to downsample? ratios - (%f,%f) -> (%d,%d)", 
+                                               indx, indy, multw, multh);      */              
+                       
+                       //use sample rect here...
+                       
+                       float iny, inx;
+                       int x,y;
+                       
+                       //Point sample - truncate
+                       iny = iny_start;//+0.5f;
+                       for(y = y_start; y < y_end; ++y, pen.inc_y(), iny += indy)
+                       {
+                               inx = inx_start;//+0.5f;
+                               for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
+                               {
+                                       Color rc = surface.sample_rect_clip(inx,iny,inx+indx,iny+indy);
+                                       pen.put_value(filter(rc));
+                               }
+                               pen.dec_x(x_end-x_start);
+                       }
+                       
+                       //Color c = (*out_surface)[0][0];
+                       //sinfg::info("ValueBase of first pixel = (%f,%f,%f,%f)",c.get_r(),c.get_g(),c.get_b(),c.get_a());
+                       
+                       return true;
+               }
+       }
+       
+       //perform normal interpolation
+       if(interp==0)
+       {       
+               //sinfg::info("Decided to do nearest neighbor");
+               float iny, inx;
+               int x,y;
+               
+               //Point sample - truncate
+               iny = iny_start;//+0.5f;
+               for(y = y_start; y < y_end; y++, pen.inc_y(), iny += indy)
+               {
+                       inx = inx_start;//+0.5f;
+                       int yclamp = min(inh-1, max(0, round_to_int(iny)));
+                       for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
+                       {
+                               int xclamp = min(inw-1, max(0, round_to_int(inx)));
+                               Color c = filter(surface[yclamp][xclamp]);
+                               pen.put_value(c); //must get rid of the clip
+                       }
+                       pen.dec_x(x_end-x_start);
+               }
+       }
+       else
+       if(interp==1)
+       {
+               //bilinear filtering
+               
+               //float         xmf,xpf,ymf,ypf;
+               //int           xm,xp,ym,yp;
+               float   inx,iny;
+               int             x,y;
+               
+               //can probably buffer for x values...
+               
+               //loop and based on inx,iny sample input image
+               iny = iny_start;
+               for(y = y_start; y < y_end; y++, pen.inc_y(), iny += indy)
+               {
+                       inx = inx_start;
+                       for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
+                       {
+                               pen.put_value(filter(surface.linear_sample(inx,iny)));
+                       }
+                       pen.dec_x(x_end-x_start);
+                       
+               }
+       }       
+       else
+       if(interp==2)
+       {
+               //cosine filtering
+               
+               //float         xmf,xpf,ymf,ypf;
+               //int           xm,xp,ym,yp;
+               float   inx,iny;
+               int             x,y;
+               
+               //can probably buffer for x values...
+               
+               //loop and based on inx,iny sample input image
+               iny = iny_start;
+               for(y = y_start; y < y_end; y++, pen.inc_y(), iny += indy)
+               {
+                       inx = inx_start;
+                       for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
+                       {
+                               pen.put_value(filter(surface.cosine_sample(inx,iny)));
+                       }
+                       pen.dec_x(x_end-x_start);
+                       
+               }
+       }       
+       else
+       {
+               //cubic filtering
+               
+               //float         xmf,xpf,ymf,ypf;
+               //int           xm,xp,ym,yp;
+               float   inx,iny;
+               int             x,y;
+               
+               //can probably buffer for x values...
+               
+               //loop and based on inx,iny sample input image
+               iny = iny_start;
+               for(y = y_start; y < y_end; y++, pen.inc_y(), iny += indy)
+               {
+                       inx = inx_start;
+                       for(x = x_start; x < x_end; x++, pen.inc_x(), inx += indx)
+                       {
+                               pen.put_value(filter(surface.cubic_sample(inx,iny)));
+                       }
+                       pen.dec_x(x_end-x_start);
+                       
+               }
+       }       
+
+       return true;
+}
+
+Rect
+Layer_Bitmap::get_bounding_rect()const
+{
+       return Rect(tl,br);
+}
diff --git a/synfig-core/trunk/src/synfig/layer_bitmap.h b/synfig-core/trunk/src/synfig/layer_bitmap.h
new file mode 100644 (file)
index 0000000..cb34471
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_bitmap.h
+**     \brief Template Header
+**
+**     $Id: layer_bitmap.h,v 1.2 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_BITMAP_H
+#define __SINFG_LAYER_BITMAP_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "layer_composite.h"
+#include "surface.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Layer_Bitmap
+**     \todo writeme
+*/
+class Layer_Bitmap : public Layer_Composite, public Layer_NoDeform
+{
+       const Color& filter(const Color& c)const;
+public:
+       typedef etl::handle<Layer_Bitmap> Handle;       
+
+       Point tl;
+       Point br;
+       int c;
+       mutable Surface surface;
+       
+       Real gamma_adjust;
+       
+       Layer_Bitmap();
+       
+       virtual bool set_param(const String & param, ValueBase value);
+
+       virtual ValueBase get_param(const String & param)const;
+
+       virtual Color get_color(Context context, const Point &pos)const;
+       
+       virtual Vocab get_param_vocab()const;
+
+       virtual Rect get_bounding_rect()const;
+
+       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &rend_desc, ProgressCallback *callback)const;
+
+       virtual sinfg::Layer::Handle hit_check(sinfg::Context context, const sinfg::Point &point)const;
+}; // END of class Layer_Bitmap
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer_composite.cpp b/synfig-core/trunk/src/synfig/layer_composite.cpp
new file mode 100644 (file)
index 0000000..038d68f
--- /dev/null
@@ -0,0 +1,170 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_composite.cpp
+**     \brief Template File
+**
+**     $Id: layer_composite.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "layer_composite.h"
+#include "context.h"
+#include "time.h"
+#include "color.h"
+#include "surface.h"
+#include "renddesc.h"
+#include "target.h"
+
+#include "layer_bitmap.h"
+
+#include "general.h"
+#include "render.h"
+#include "paramdesc.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+bool
+Layer_Composite::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc_, ProgressCallback *cb)  const
+{
+       RendDesc renddesc(renddesc_);
+       
+       if(!amount_)
+               return context.accelerated_render(surface,quality,renddesc,cb);
+
+       CanvasBase image;
+
+       SuperCallback stageone(cb,0,50000,100000);
+       SuperCallback stagetwo(cb,50000,100000,100000);
+
+       Layer_Bitmap::Handle surfacelayer(new class Layer_Bitmap());
+
+       Context iter;
+       
+       for(iter=context;*iter;iter++)
+               image.push_back(*iter);
+
+       image.push_front(surfacelayer.get());
+
+       // We want to go ahead and schedule any other
+       // layers...
+//     while(dynamic_cast<Layer_Composite*>(context->get()))
+//     while(context->get() &&
+//             &context->get()->AcceleratedRender==
+//             &Layer_Composite::AcceleratedRender)
+//             image.push_back(*(context++));
+
+       image.push_back(0);     // Alpha black
+
+       // Render the backdrop
+       if(!context.accelerated_render(&surfacelayer->surface,quality,renddesc,&stageone))
+               return false;
+
+       if(quality<=4)surfacelayer->c=3;else
+       if(quality<=5)surfacelayer->c=2;
+       else if(quality<=6)surfacelayer->c=1;
+       else surfacelayer->c=0;
+       surfacelayer->tl=renddesc.get_tl();
+       surfacelayer->br=renddesc.get_br();
+       surfacelayer->set_blend_method(Color::BLEND_STRAIGHT);
+
+       image.push_front(const_cast<sinfg::Layer_Composite*>(this));
+
+       // Set up a surface target
+       Target::Handle target(surface_target(surface));
+       
+       if(!target)
+       {
+               if(cb)cb->error(_("Unable to create surface target"));
+               return false;
+       }
+       
+       RendDesc desc(renddesc);
+       
+       target->set_rend_desc(&desc);
+
+       // Render the scene
+       return render(Context(image.begin()),target,desc,&stagetwo);
+       //return render_threaded(Context(image.begin()),target,desc,&stagetwo,2);
+}
+
+Rect
+Layer_Composite::get_full_bounding_rect(Context context)const
+{
+       if(is_disabled() || Color::is_onto(get_blend_method()))
+               return context.get_full_bounding_rect();
+
+       return context.get_full_bounding_rect()|get_bounding_rect();
+}
+
+Layer::Vocab
+Layer_Composite::get_param_vocab()const
+{
+       Layer::Vocab ret(Layer::get_param_vocab());
+
+       ret.push_back(ParamDesc(amount_,"amount")
+               .set_local_name(_("Amount"))
+       );
+       ret.push_back(ParamDesc(blend_method_,"blend_method")
+               .set_local_name(_("Blend Method"))
+       );
+
+       return ret;
+}
+
+bool
+Layer_Composite::set_param(const String & param, const ValueBase &value)
+{
+       if(param=="amount" && value.same_as(amount_))
+               amount_=value.get(amount_);
+       else
+       if(param=="blend_method" && value.same_as(int()))
+               blend_method_=static_cast<Color::BlendMethod>(value.get(int()));
+       else
+               return Layer::set_param(param,value);
+       return true;
+}
+
+ValueBase
+Layer_Composite::get_param(const String & param)const
+{
+       if(param=="amount")
+               return get_amount();
+       if(param=="blend_method")
+               return static_cast<int>(get_blend_method());
+       return Layer::get_param(param);
+}
diff --git a/synfig-core/trunk/src/synfig/layer_composite.h b/synfig-core/trunk/src/synfig/layer_composite.h
new file mode 100644 (file)
index 0000000..c9bc3a0
--- /dev/null
@@ -0,0 +1,93 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_composite.h
+**     \brief Composite Layer Class Implementation
+**
+**     $Id: layer_composite.h,v 1.2 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_COMPOSITE_H
+#define __SINFG_LAYER_COMPOSITE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "layer.h"
+#include "color.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Layer_NoDeform {};
+
+
+/*!    \class Layer_Composite
+**     \brief Base class for layers that put stuff ontop of lower layers
+*/
+class Layer_Composite : public Layer
+{
+private:
+
+       float amount_;
+
+       Color::BlendMethod blend_method_;
+
+protected:
+
+       Layer_Composite(
+               float   amount=1.0,
+               Color::BlendMethod      blend_method=Color::BLEND_COMPOSITE
+       ):
+               amount_                         (amount),
+               blend_method_           (blend_method)
+       { }
+
+public:
+
+       float get_amount()const { return amount_; }
+
+       Layer_Composite& set_amount(float x) { amount_=x; return *this; }
+
+       Color::BlendMethod get_blend_method()const { return blend_method_; }
+
+       Layer_Composite& set_blend_method(Color::BlendMethod x) { blend_method_=x; return *this; }
+
+       bool is_solid_color()const { return amount_==1.0f && blend_method_==Color::BLEND_STRAIGHT; }
+       
+       bool is_disabled()const { return amount_==0.0f; }
+       
+       virtual Vocab get_param_vocab()const;
+
+       virtual bool set_param(const String &param, const ValueBase &value);
+
+       virtual ValueBase get_param(const String &param)const;
+
+       virtual Rect get_full_bounding_rect(Context context)const;
+
+       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
+}; // END of class Layer_Composite
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer_mime.cpp b/synfig-core/trunk/src/synfig/layer_mime.cpp
new file mode 100644 (file)
index 0000000..5168f5f
--- /dev/null
@@ -0,0 +1,147 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_mime.cpp
+**     \brief Template File
+**
+**     $Id: layer_mime.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "layer_mime.h"
+
+#include "layer.h"
+#include "time.h"
+#include "string.h"
+#include "vector.h"
+
+#include "context.h"
+#include "time.h"
+#include "color.h"
+#include "surface.h"
+#include "renddesc.h"
+#include "target.h"
+
+#include "general.h"
+#include "paramdesc.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Layer_Mime::Layer_Mime(String x):name(x)
+{
+       // Throw a bogus default version onto the parameter list.
+       param_list["Version"]="9";
+}
+
+String
+Layer_Mime::get_version()const
+{
+       return get_param("Version").get(String());
+}
+
+bool
+Layer_Mime::set_version(const String &ver)
+{
+       return set_param("Version",ver);
+}
+
+String
+Layer_Mime::get_local_name()const
+{
+       return _("[MIME]")+get_name();
+}
+
+bool
+Layer_Mime::set_param(const String &param, const ValueBase &value)
+{
+       // Don't try to set the name
+       if(param=="name" || param=="Name" || param=="name__")
+               return false;
+
+       // Otherwise, remember this parameter's value
+       param_list[param]=value;
+       return true;
+}
+
+ValueBase
+Layer_Mime::get_param(const String &param)const
+{
+       // If they are requesting the name of
+       // the layer, just return it
+       if(param=="name" || param=="Name" || param=="name__")
+               return ValueBase(name);
+
+       // Otherwise, return the stored parameter value
+       map<string,ValueBase>::const_iterator iter=param_list.find(param);
+       if(iter!=param_list.end())
+               return iter->second;
+       return ValueBase();
+}
+
+Color
+Layer_Mime::get_color(Context context, const Point &pos)const
+{
+       // A Layer_Mime layer should do nothing at all.
+       return context.get_color(pos);
+}
+
+bool
+Layer_Mime::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
+{
+       // A Layer_Mime layer should do nothing at all.
+       return context.accelerated_render(surface,quality,renddesc,cb);
+}
+
+Layer::Vocab
+Layer_Mime::get_param_vocab()const
+{
+       Layer::Vocab ret;
+       map<string,ValueBase>::const_iterator iter;
+
+       // Construct the vocabulary from the stored
+       // parameters
+       for(iter=param_list.begin();iter!=param_list.end();iter++)
+       {
+               // Make sure that we don't add the version
+               // into the vocabulary
+               if(iter->first!="Version")
+                       ret.push_back(ParamDesc(iter->first));
+       }
+       
+       // ... and return it
+       return ret;
+}
diff --git a/synfig-core/trunk/src/synfig/layer_mime.h b/synfig-core/trunk/src/synfig/layer_mime.h
new file mode 100644 (file)
index 0000000..3754061
--- /dev/null
@@ -0,0 +1,74 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_mime.h
+**     \brief Template Header
+**
+**     $Id: layer_mime.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_MIME_H
+#define __SINFG_LAYER_MIME_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "layer.h"
+#include "string.h"
+#include <map>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Layer_Mime
+**     The mime layer is a layer that is used when an unknown
+**     layer type is requested. This allows people without
+**     all of the correct layers installed to still work with
+**     that composition.
+*/
+class Layer_Mime : public Layer
+{
+       std::map<String,ValueBase> param_list;
+       String name;
+public:
+       Layer_Mime(String name);
+
+       virtual String get_version()const;
+
+       virtual bool set_version(const String &ver);
+
+       virtual bool set_param(const String &param, const ValueBase &value);
+
+       virtual ValueBase get_param(const String &param)const;
+
+       virtual Color get_color(Context context, const Point &pos)const;
+       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
+
+       virtual Vocab get_param_vocab()const;
+       virtual String get_local_name()const;
+
+};
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer_motionblur.cpp b/synfig-core/trunk/src/synfig/layer_motionblur.cpp
new file mode 100644 (file)
index 0000000..38287bb
--- /dev/null
@@ -0,0 +1,195 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_motionblur.h
+**     \brief Template Header
+**
+**     $Id: layer_motionblur.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "string.h"
+#include "layer_motionblur.h"
+#include "time.h"
+#include "context.h"
+#include "paramdesc.h"
+#include "renddesc.h"
+#include "surface.h"
+#include "value.h"
+#include "valuenode.h"
+#include "canvas.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace sinfg;
+using namespace etl;
+using namespace std;
+
+/* === G L O B A L S ======================================================= */
+
+SINFG_LAYER_INIT(Layer_MotionBlur);
+SINFG_LAYER_SET_NAME(Layer_MotionBlur,"MotionBlur");
+SINFG_LAYER_SET_LOCAL_NAME(Layer_MotionBlur,_("Motion Blur"));
+SINFG_LAYER_SET_CATEGORY(Layer_MotionBlur,_("Blurs"));
+SINFG_LAYER_SET_VERSION(Layer_MotionBlur,"0.1");
+SINFG_LAYER_SET_CVS_ID(Layer_MotionBlur,"$Id: layer_motionblur.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $");
+
+/* === M E M B E R S ======================================================= */
+
+Layer_MotionBlur::Layer_MotionBlur():
+       Layer_Composite (1.0,Color::BLEND_STRAIGHT),
+       aperture                (0)
+{
+}
+       
+bool
+Layer_MotionBlur::set_param(const String &param, const ValueBase &value)
+{
+
+       IMPORT(aperture);               
+       return Layer_Composite::set_param(param,value);
+}
+
+ValueBase
+Layer_MotionBlur::get_param(const String &param)const
+{
+       EXPORT(aperture);
+       
+       EXPORT_NAME();
+       EXPORT_VERSION();
+               
+       return Layer_Composite::get_param(param);
+}
+
+void
+Layer_MotionBlur::set_time(Context context, Time time)const
+{
+       context.set_time(time);
+       time_cur=time;
+}
+
+void
+Layer_MotionBlur::set_time(Context context, Time time, const Point &pos)const
+{
+       context.set_time(time,pos);
+       time_cur=time;
+}
+
+Color
+Layer_MotionBlur::get_color(Context context, const Point &pos)const
+{
+/*     if(aperture)
+       {
+               Time time(time_cur);
+               time+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) *aperture -aperture*0.5;
+               context.set_time(time, pos);
+       }       
+*/
+       return context.get_color(pos);
+}
+
+Layer::Vocab
+Layer_MotionBlur::get_param_vocab()const
+{
+       Layer::Vocab ret;
+       //ret=Layer_Composite::get_param_vocab();
+       
+       ret.push_back(ParamDesc("aperture")
+               .set_local_name(_("Aperature"))
+               .set_description(_("Shutter Time"))
+       );
+       
+       return ret;
+}
+
+bool
+Layer_MotionBlur::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
+{
+       if(aperture && quality<10)
+       {
+               //int x, y;
+               SuperCallback subimagecb;
+               int samples=1;
+               switch(quality)
+               {
+                       case 1: // Production Quality
+                               samples=32;
+                               break;
+                       case 2: // Excellent Quality
+                               samples=24;
+                               break;
+                       case 3: // Good Quality
+                               samples=16;
+                               break;
+                       case 4: // Moderate Quality
+                               samples=12;
+                               break;
+                       case 5: // Draft Quality
+                               samples=7;
+                               break;
+                       case 6:
+                               samples=6;
+                               break;
+                       case 7:
+                               samples=5;
+                               break;
+                       case 8:
+                               samples=3;
+                               break;
+                       case 9:
+                               samples=3;
+                               break;
+                       case 10: // Rough Quality
+            default:                   
+                               samples=1;
+                               break;
+                               
+               }
+       
+               Surface tmp;
+               int i;
+
+               surface->set_wh(renddesc.get_w(),renddesc.get_h());
+               surface->clear();
+               
+               for(i=0;i<samples;i++)
+               {
+                       subimagecb=SuperCallback(cb,i*(5000/samples),(i+1)*(5000/samples),5000);
+                       context.set_time(time_cur+(aperture/samples)*i-aperture*0.5);
+                       if(!context.accelerated_render(&tmp,quality,renddesc,&subimagecb))
+                               return false;
+                       for(int y=0;y<renddesc.get_h();y++)
+                               for(int x=0;x<renddesc.get_w();x++)
+                                       (*surface)[y][x]+=tmp[y][x].premult_alpha();
+               }
+               for(int y=0;y<renddesc.get_h();y++)
+                       for(int x=0;x<renddesc.get_w();x++)
+                               (*surface)[y][x]=((*surface)[y][x]/(float)samples).demult_alpha();
+       }
+       else
+               return context.accelerated_render(surface,quality,renddesc,cb);
+       
+       return true;
+}
diff --git a/synfig-core/trunk/src/synfig/layer_motionblur.h b/synfig-core/trunk/src/synfig/layer_motionblur.h
new file mode 100644 (file)
index 0000000..5799a7c
--- /dev/null
@@ -0,0 +1,70 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_motionblur.h
+**     \brief Template Header
+**
+**     $Id: layer_motionblur.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_MOTIONBLUR_H__
+#define __SINFG_LAYER_MOTIONBLUR_H__
+
+/* === H E A D E R S ======================================================= */
+
+#include "layer_composite.h"
+#include "time.h"
+
+/* === S T R U C T S & C L A S S E S ======================================= */
+
+namespace sinfg {
+       
+class Layer_MotionBlur : public sinfg::Layer_Composite
+{
+       SINFG_LAYER_MODULE_EXT
+
+private:
+
+       Time aperture;
+
+       mutable Time time_cur;
+
+public:
+
+       Layer_MotionBlur();
+       
+       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
+       
+       virtual ValueBase get_param(const String & param)const;
+
+       virtual Color get_color(Context context, const Point &pos)const;
+
+       virtual void set_time(Context context, Time time)const;
+
+       virtual void set_time(Context context, Time time, const Point &pos)const;
+       
+       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
+
+       virtual Vocab get_param_vocab()const;
+
+}; // END of class Layer_MotionBlur
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp b/synfig-core/trunk/src/synfig/layer_pastecanvas.cpp
new file mode 100644 (file)
index 0000000..e3a71f0
--- /dev/null
@@ -0,0 +1,419 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_pastecanvas.h
+**     \brief Template Header
+**
+**     $Id: layer_pastecanvas.cpp,v 1.3 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "layer_pastecanvas.h"
+#include "string.h"
+#include "time.h"
+#include "context.h"
+#include "paramdesc.h"
+#include "renddesc.h"
+#include "surface.h"
+#include "value.h"
+#include "valuenode.h"
+#include "canvas.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace etl;
+using namespace std;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+#define MAX_DEPTH 10
+
+//#ifdef __APPLE__
+//#define SINFG_NO_CLIP
+//#endif
+
+/* === C L A S S E S ======================================================= */
+
+class depth_counter    // Makes our recursive depth counter exception-safe
+{
+       int *depth;
+public:
+       depth_counter(int &x):depth(&x) { (*depth)++; }
+       ~depth_counter() { (*depth)--; }
+};
+
+/* === G L O B A L S ======================================================= */
+
+SINFG_LAYER_INIT(Layer_PasteCanvas);
+SINFG_LAYER_SET_NAME(Layer_PasteCanvas,"PasteCanvas");
+SINFG_LAYER_SET_LOCAL_NAME(Layer_PasteCanvas,_("Paste Canvas"));
+SINFG_LAYER_SET_CATEGORY(Layer_PasteCanvas,_("Default"));
+SINFG_LAYER_SET_VERSION(Layer_PasteCanvas,"0.1");
+SINFG_LAYER_SET_CVS_ID(Layer_PasteCanvas,"$Id: layer_pastecanvas.cpp,v 1.3 2005/01/24 03:08:18 darco Exp $");
+
+/* === M E T H O D S ======================================================= */
+
+Layer_PasteCanvas::Layer_PasteCanvas():
+       origin(0,0),
+       zoom(0),
+       time_offset(0)
+{
+       children_lock=false;
+       do_not_muck_with_time_=false;
+       curr_time=Time::begin();
+}
+
+Layer_PasteCanvas::~Layer_PasteCanvas()
+{
+/*     if(canvas)
+               canvas->parent_set.erase(this);
+*/
+
+       //if(canvas)DEBUGINFO(strprintf("%d",canvas->count()));
+       
+       set_sub_canvas(0);
+
+       //if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
+       //      canvas->unref();
+}
+
+String
+Layer_PasteCanvas::get_local_name()const
+{
+       if(!canvas)     return _("Pasted Canvas");
+       if(canvas->is_inline()) return _("Inline Canvas");
+       if(canvas->get_root()==get_canvas()->get_root()) return '[' + canvas->get_id() + ']';
+               
+       return '[' + canvas->get_file_name() + ']';
+}
+
+Layer::Vocab
+Layer_PasteCanvas::get_param_vocab()const
+{
+       Layer::Vocab ret(Layer_Composite::get_param_vocab());
+       
+       ret.push_back(ParamDesc("origin")
+               .set_local_name(_("Origin"))
+               .set_description(_("Point where you want the origin to be"))
+       );
+       ret.push_back(ParamDesc("canvas")
+               .set_local_name(_("Canvas"))
+               .set_description(_("Canvas to paste"))
+       );
+       ret.push_back(ParamDesc("zoom")
+               .set_local_name(_("Zoom"))
+               .set_description(_("Size of canvas"))
+       );
+
+       ret.push_back(ParamDesc("time_offset")
+               .set_local_name(_("Time Offset"))
+       );
+
+       ret.push_back(ParamDesc("children_lock")
+               .set_local_name(_("Children Lock"))
+       );
+       
+       return ret;
+}
+
+bool
+Layer_PasteCanvas::set_param(const String & param, const ValueBase &value)
+{
+       IMPORT(origin);
+       
+       if(param=="canvas" && value.same_as(Canvas::Handle()))
+       {
+               set_sub_canvas(value.get(Canvas::Handle()));
+               return true;
+       }
+
+//     IMPORT(canvas);
+       IMPORT(children_lock);
+       IMPORT(zoom);
+       IMPORT(time_offset);
+       
+       return Layer_Composite::set_param(param,value);
+}
+
+void
+Layer_PasteCanvas::set_sub_canvas(etl::handle<sinfg::Canvas> x)
+{
+       if(canvas && !do_not_muck_with_time_)
+               remove_child(canvas.get());
+       
+       if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
+               canvas->unref();
+       
+       child_changed_connection.disconnect();
+       
+       canvas=x;
+       
+       /*if(canvas)
+               child_changed_connection=canvas->signal_changed().connect(
+                       sigc::mem_fun(
+                               *this,
+                               &Layer_PasteCanvas::changed
+                       )
+               );
+       */
+       if(canvas)
+               bounds=(canvas->get_context().get_full_bounding_rect()-canvas->rend_desc().get_focus())*exp(zoom)+origin+canvas->rend_desc().get_focus();
+       
+       if(canvas && !do_not_muck_with_time_)
+               add_child(canvas.get());
+
+       if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
+               canvas->ref();
+       
+       if(canvas)
+               on_canvas_set();
+}
+
+// This is called whenever the parent canvas gets set/changed
+void
+Layer_PasteCanvas::on_canvas_set()
+{
+       //sinfg::info("before count()=%d",count());
+       if(get_canvas() && canvas && canvas->is_inline() && canvas->parent()!=get_canvas())
+       {
+               //sinfg::info("during count()=%d",count());
+               canvas->set_inline(get_canvas());
+       }
+       //sinfg::info("after count()=%d",count());
+}
+
+ValueBase
+Layer_PasteCanvas::get_param(const String& param)const
+{
+       EXPORT(origin);
+       EXPORT(canvas);
+       EXPORT(zoom);
+       EXPORT(time_offset);
+       EXPORT(children_lock);
+       
+       EXPORT_NAME();
+       EXPORT_VERSION();
+
+       return Layer_Composite::get_param(param);
+}
+
+void
+Layer_PasteCanvas::set_time(Context context, Time time)const
+{
+       if(depth==MAX_DEPTH)return;depth_counter counter(depth);
+       curr_time=time;
+       
+       context.set_time(time);
+       if(canvas)
+       {
+               canvas->set_time(time);
+               
+               bounds=(canvas->get_context().get_full_bounding_rect()-canvas->rend_desc().get_focus())*exp(zoom)+origin+canvas->rend_desc().get_focus();
+       }
+       else
+               bounds=Rect::zero();
+}
+
+sinfg::Layer::Handle
+Layer_PasteCanvas::hit_check(sinfg::Context context, const sinfg::Point &pos)const
+{
+       if(depth==MAX_DEPTH)return 0;depth_counter counter(depth);
+
+       Point target_pos=(pos-canvas->rend_desc().get_focus()-origin)/exp(zoom)+canvas->rend_desc().get_focus();
+
+       if(canvas && get_amount() && canvas->get_context().get_color(target_pos).get_a()>=0.25)
+       {
+               if(!children_lock)
+               {
+                       return canvas->get_context().hit_check(target_pos);
+               }
+               return const_cast<Layer_PasteCanvas*>(this);
+       }
+       else
+               return context.hit_check(pos);
+}
+
+Color
+Layer_PasteCanvas::get_color(Context context, const Point &pos)const
+{
+       if(!canvas || !get_amount())
+               return context.get_color(pos);
+
+       if(depth==MAX_DEPTH)return Color::alpha();depth_counter counter(depth);
+
+       Point target_pos=(pos-canvas->rend_desc().get_focus()-origin)/exp(zoom)+canvas->rend_desc().get_focus();
+       
+       return Color::blend(canvas->get_context().get_color(target_pos),context.get_color(pos),get_amount(),get_blend_method());
+}
+
+
+bool
+Layer_PasteCanvas::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
+{
+       if(cb && !cb->amount_complete(0,10000)) return false;
+
+       if(depth==MAX_DEPTH)
+       {
+               DEBUGPOINT();
+               // if we are at the extent of our depth,
+               // then we should just return whatever is under us.
+               return context.accelerated_render(surface,quality,renddesc,cb);
+       }
+       depth_counter counter(depth);
+               
+       if(!canvas || !get_amount())
+               return context.accelerated_render(surface,quality,renddesc,cb);
+       
+       if(!do_not_muck_with_time_ &&   curr_time!=Time::begin() && canvas->get_time()!=curr_time+time_offset)
+       {
+               canvas->set_time(curr_time+time_offset);
+       }
+       
+       SuperCallback stageone(cb,0,4500,10000);
+       SuperCallback stagetwo(cb,4500,9000,10000);
+       SuperCallback stagethree(cb,9000,9999,10000);
+
+       RendDesc desc(renddesc);
+       Vector::value_type zoomfactor=1.0/exp(zoom);
+       desc.clear_flags();
+       desc.set_tl((desc.get_tl()-canvas->rend_desc().get_focus()-origin)*zoomfactor+canvas->rend_desc().get_focus());
+       desc.set_br((desc.get_br()-canvas->rend_desc().get_focus()-origin)*zoomfactor+canvas->rend_desc().get_focus());
+       desc.set_flags(RendDesc::PX_ASPECT);
+
+       if(is_solid_color() || context->empty())
+       {
+               surface->set_wh(renddesc.get_w(),renddesc.get_h());
+               surface->clear();
+       }
+       else if(!context.accelerated_render(surface,quality,renddesc,&stageone))
+               return false;
+       Color::BlendMethod blend_method(get_blend_method());
+       
+       const Rect full_bounding_rect(canvas->get_context().get_full_bounding_rect());
+
+       if(context->empty())
+       {
+               if(Color::is_onto(blend_method))
+                       return true;
+                       
+               if(blend_method==Color::BLEND_COMPOSITE)
+                       blend_method=Color::BLEND_STRAIGHT;
+       }
+       else
+       if(!etl::intersect(context.get_full_bounding_rect(),full_bounding_rect))
+       {
+               if(Color::is_onto(blend_method))
+                       return true;
+                       
+               if(blend_method==Color::BLEND_COMPOSITE)
+                       blend_method=Color::BLEND_STRAIGHT;
+       }
+       
+#ifndef SINFG_NO_CLIP
+       {
+               //sinfg::info("PasteCanv Clip");
+               Rect area(desc.get_rect()&full_bounding_rect);
+                               
+               Point min(area.get_min());
+               Point max(area.get_max());
+
+               if(desc.get_tl()[0]>desc.get_br()[0])
+                       swap(min[0],max[0]);
+               if(desc.get_tl()[1]>desc.get_br()[1])
+                       swap(min[1],max[1]);
+
+               const int 
+                       x(floor_to_int((min[0]-desc.get_tl()[0])/desc.get_pw())),
+                       y(floor_to_int((min[1]-desc.get_tl()[1])/desc.get_ph())),
+                       w(ceil_to_int((max[0]-desc.get_tl()[0])/desc.get_pw())-x),
+                       h(ceil_to_int((max[1]-desc.get_tl()[1])/desc.get_ph())-y);
+                               
+               desc.set_subwindow(x,y,w,h);
+       
+               Surface pastesurface;
+               
+               if(area.area()<=0.000001 || desc.get_w()==0 || desc.get_h()==0)
+               {
+                       if(cb && !cb->amount_complete(10000,10000)) return false;
+
+                       return true;
+               }
+
+               if(!canvas->get_context().accelerated_render(&pastesurface,quality,desc,&stagetwo))
+                       return false;
+               
+               Surface::alpha_pen apen(surface->get_pen(x,y));
+       
+               apen.set_alpha(get_amount());
+               apen.set_blend_method(blend_method);
+       
+               pastesurface.blit_to(apen);
+       }
+#else
+       {
+               Surface pastesurface;
+       
+               if(!canvas->get_context().accelerated_render(&pastesurface,quality,desc,&stagetwo))
+                       return false;
+       
+               Surface::alpha_pen apen(surface->begin());
+       
+               apen.set_alpha(get_amount());
+               apen.set_blend_method(blend_method);
+       
+               pastesurface.blit_to(apen);
+       }
+#endif
+       
+       if(cb && !cb->amount_complete(10000,10000)) return false;
+
+       return true;
+}
+
+Rect
+Layer_PasteCanvas::get_bounding_rect()const
+{
+       return bounds;
+}
+
+void Layer_PasteCanvas::get_times_vfunc(Node::time_set &set) const
+{
+       Node::time_set tset;
+       if(canvas) tset = canvas->get_times();
+
+       Node::time_set::iterator        i = tset.begin(),
+                                                                       end = tset.end();       
+       
+       //Make sure we offset the time...
+       //TODO: SOMETHING STILL HAS TO BE DONE WITH THE OTHER DIRECTION 
+       //              (recursing down the tree needs to take this into account too...)
+       for(; i != end; ++i)
+       {
+               set.insert(*i + time_offset);
+       }
+               
+       Layer::get_times_vfunc(set);
+}
diff --git a/synfig-core/trunk/src/synfig/layer_pastecanvas.h b/synfig-core/trunk/src/synfig/layer_pastecanvas.h
new file mode 100644 (file)
index 0000000..652bf7a
--- /dev/null
@@ -0,0 +1,118 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_pastecanvas.h
+**     \brief Template Header
+**
+**     $Id: layer_pastecanvas.h,v 1.2 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_PASTEIMAGE_H
+#define __SINFG_LAYER_PASTEIMAGE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "layer_composite.h"
+#include "color.h"
+#include "vector.h"
+#include "real.h"
+#include "time.h"
+#include "canvasbase.h"
+#include "canvas.h"
+#include "rect.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+class Layer_PasteCanvas : public Layer_Composite, public Layer_NoDeform
+{
+       SINFG_LAYER_MODULE_EXT
+private:
+
+       Vector origin;
+
+       etl::loose_handle<sinfg::Canvas> canvas;
+
+       //! Recursion depth counter
+       mutable int depth;
+
+       Real zoom;
+
+       Time time_offset;
+
+       mutable Time curr_time;
+
+       bool optimize_layers(sinfg::Context context,sinfg::CanvasBase&)const;
+
+       bool do_not_muck_with_time_;
+       
+       bool children_lock;
+
+       mutable Rect bounds;
+
+       sigc::connection child_changed_connection;
+public:
+
+       virtual void on_canvas_set();
+
+       void set_do_not_muck_with_time(bool x=true) { do_not_muck_with_time_=true; }
+
+       etl::handle<sinfg::Canvas> get_sub_canvas()const { return canvas; }
+       void set_sub_canvas(etl::handle<sinfg::Canvas> x);
+       
+       Real get_zoom()const { return zoom; }
+
+       Time get_time_offset()const { return time_offset; }
+
+       Point get_origin()const { return origin; }
+
+       Layer_PasteCanvas();
+       virtual ~Layer_PasteCanvas();
+
+       virtual String get_local_name()const;
+       
+       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
+
+       virtual ValueBase get_param(const String & param)const;
+
+       virtual Color get_color(Context context, const Point &pos)const;
+
+       virtual void set_time(Context context, Time time)const;
+
+       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
+
+       virtual Vocab get_param_vocab()const;
+
+       virtual sinfg::Rect get_bounding_rect()const;
+
+       virtual sinfg::Layer::Handle hit_check(sinfg::Context context, const sinfg::Point &point)const;
+       
+protected:
+       virtual void get_times_vfunc(Node::time_set &set) const;        
+
+}; // END of class Layer_PasteCanvas
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer_polygon.cpp b/synfig-core/trunk/src/synfig/layer_polygon.cpp
new file mode 100644 (file)
index 0000000..7cd2e2c
--- /dev/null
@@ -0,0 +1,175 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_polygon.cpp
+**     \brief Template Header
+**
+**     $Id: layer_polygon.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "layer_polygon.h"
+#include "string.h"
+#include "time.h"
+#include "context.h"
+#include "paramdesc.h"
+#include "renddesc.h"
+#include "surface.h"
+#include "value.h"
+#include "valuenode.h"
+//#include "ETL/bezier"
+#include <vector>
+
+#include <deque>
+using std::deque;
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace sinfg;
+using namespace std;
+using namespace etl;
+
+/* === G L O B A L S ======================================================= */
+
+SINFG_LAYER_INIT(Layer_Polygon);
+SINFG_LAYER_SET_NAME(Layer_Polygon,"polygon");
+SINFG_LAYER_SET_LOCAL_NAME(Layer_Polygon,_("Polygon"));
+SINFG_LAYER_SET_CATEGORY(Layer_Polygon,_("Geometry"));
+SINFG_LAYER_SET_VERSION(Layer_Polygon,"0.1");
+SINFG_LAYER_SET_CVS_ID(Layer_Polygon,"$Id: layer_polygon.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $");
+
+/* === C L A S S E S ======================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Layer_Polygon::Layer_Polygon():
+       Layer_Shape             (1.0,Color::BLEND_COMPOSITE),
+       vector_list             (0)
+{
+       vector_list.push_back(Point(0,0.5));
+       vector_list.push_back(Point(-0.333333,0));
+       vector_list.push_back(Point(0.333333,0));
+       sync();
+}
+
+Layer_Polygon::~Layer_Polygon()
+{
+}
+
+void
+Layer_Polygon::sync()
+{
+/*
+       int i,pointcount=vector_list.size();
+
+       if(pointcount<3)
+               return;
+
+       //Layer_Shape::clear();
+       //clear();
+
+       // Build edge table
+       move_to(vector_list[0][0],vector_list[0][1]);
+       
+       for(i = 1;i < pointcount; i++)
+       {
+               if(isnan(vector_list[i][0]) || isnan(vector_list[i][1]))
+                       break;
+               line_to(vector_list[i][0],vector_list[i][1]);
+       }
+       close();
+       //endpath();
+*/
+}
+
+void
+Layer_Polygon::add_polygon(const vector<Point> &point_list)
+{
+       int i,pointcount=point_list.size();
+
+       if(pointcount<3)
+               return;
+
+       //Layer_Shape::clear();
+       //clear();
+
+       // Build edge table
+       move_to(point_list[0][0],point_list[0][1]);
+       
+       for(i = 1;i < pointcount; i++)
+       {
+               if(isnan(point_list[i][0]) || isnan(point_list[i][1]))
+                       break;
+               line_to(point_list[i][0],point_list[i][1]);
+       }
+       close();
+       //endpath();
+}
+
+void
+Layer_Polygon::clear()
+{
+       Layer_Shape::clear();
+       vector_list.clear();
+}
+       
+bool
+Layer_Polygon::set_param(const String & param, const ValueBase &value)
+{
+       if(     param=="vector_list" && value.same_as(vector_list))
+       {
+               vector_list=value;
+               Layer_Shape::clear();
+               add_polygon(value);
+               sync();
+               return true;
+       }
+       
+       return Layer_Shape::set_param(param,value);
+}
+
+ValueBase
+Layer_Polygon::get_param(const String &param)const
+{
+       EXPORT(vector_list);
+
+       EXPORT_NAME();
+       EXPORT_VERSION();
+               
+       return Layer_Shape::get_param(param);   
+}
+
+Layer::Vocab
+Layer_Polygon::get_param_vocab()const
+{
+       Layer::Vocab ret(Layer_Shape::get_param_vocab());
+       
+       ret.push_back(ParamDesc("vector_list")
+               .set_local_name(_("Vector List"))
+               .set_origin("offset")
+       );
+       
+       return ret;
+}
diff --git a/synfig-core/trunk/src/synfig/layer_polygon.h b/synfig-core/trunk/src/synfig/layer_polygon.h
new file mode 100644 (file)
index 0000000..0f2bce3
--- /dev/null
@@ -0,0 +1,95 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_polygon.h
+**     \brief Template Header
+**
+**     $Id: layer_polygon.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_POLYGON_H
+#define __SINFG_LAYER_POLYGON_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "layer_shape.h"
+#include "color.h"
+#include "vector.h"
+#include <list>
+#include <vector>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+/*!    \class Layer_Polygon
+**     \beief writeme
+**     \todo This layer needs to support multiple polygons */
+class Layer_Polygon : public Layer_Shape
+{
+       SINFG_LAYER_MODULE_EXT
+       
+private:
+               
+       //exported data
+       std::vector< Point >    vector_list;
+
+protected:
+
+       Layer_Polygon();
+
+public:
+
+       ~Layer_Polygon();
+
+       //! Adds a polygon to the layer
+       /*!     The edge data is automaticly added to the
+       **      EdgeTable, so there is no need to call sync()
+       **      after adding a polygon using this function.
+       **      \param point_list A list containing the
+       **              points that define the polygon's parameter.
+       */
+       void add_polygon(const std::vector<Point> &point_list);
+
+       //! Clears out any polygon data
+       /*!     Also clears out the EdgeTable, so there is no
+       **      need to call sync() after using this function.
+       */
+       void clear();
+
+       //! Updates EdgeTable so it will reflect the parameter data
+       void sync();
+       
+       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
+
+       virtual ValueBase get_param(const String & param)const;
+       
+       virtual Vocab get_param_vocab()const;
+
+private:
+       class           PolySpan;
+       bool render_polyspan(Surface *surface,PolySpan &polyspan)const;
+}; // END of Layer_Polygon
+
+}; // END of namespace sinfg
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer_shape.cpp b/synfig-core/trunk/src/synfig/layer_shape.cpp
new file mode 100644 (file)
index 0000000..6c60616
--- /dev/null
@@ -0,0 +1,3073 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_shape.cpp
+**     \brief Template Header
+**
+**     $Id: layer_shape.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "layer_shape.h"
+#include "string.h"
+#include "time.h"
+#include "context.h"
+#include "paramdesc.h"
+#include "renddesc.h"
+#include "surface.h"
+#include "value.h"
+#include "valuenode.h"
+#include "float.h"
+#include "blur.h"
+
+#include "curve_helper.h"
+
+#include <vector>
+
+#include <deque>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace sinfg;
+using namespace std;
+using namespace etl;
+
+/* === G L O B A L S ======================================================= */
+
+SINFG_LAYER_INIT(Layer_Shape);
+SINFG_LAYER_SET_NAME(Layer_Shape,"shape");
+SINFG_LAYER_SET_LOCAL_NAME(Layer_Shape,_("Shape"));
+SINFG_LAYER_SET_CATEGORY(Layer_Shape,_("Internal"));
+SINFG_LAYER_SET_VERSION(Layer_Shape,"0.1");
+SINFG_LAYER_SET_CVS_ID(Layer_Shape,"$Id: layer_shape.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $");
+
+#define EPSILON        1e-12
+
+template < class T >
+inline bool IsZero(const T &n)
+{
+       return (n < EPSILON) && (n > -EPSILON);
+}
+
+/* === C L A S S E S ======================================================= */
+
+//Assumes 64 byte aligned structures if at all
+struct Primitive
+{
+       int             operation;
+       int             number;
+       
+       //Point data[0];
+       
+       enum Operations
+       {
+               NONE = -1,
+               MOVE_TO = 0,            //(x,y)+                                after first point treated as line_to
+               CLOSE,                          //                                              NOT RUNLENGTH enabled
+               LINE_TO,                        //(x,y)+                                continuous func
+               CONIC_TO,                       //(x1,y1,x,y)+                  "   "
+               CONIC_TO_SMOOTH,        //(x,y)+                                "   "
+               CUBIC_TO,                       //(x1,y1,x2,y2,x,y)+    "   "
+               CUBIC_TO_SMOOTH,        //(x2,y2,x,y)+                  "   "
+               END
+       };
+};
+
+//******** CURVE FUNCTIONS *****************
+const int      MAX_SUBDIVISION_SIZE = 64;
+const int      MIN_SUBDIVISION_DRAW_LEVELS = 4;
+
+static void Subd_Conic_Stack(Point *arc)
+{
+       /*
+       
+       b0
+       *               0+1 a
+       b1 b    *               1+2*1+2 a
+       *               1+2     b       *
+       b2              *               
+       *               
+                       
+       0.1.2 ->        0.1 2 3.4
+       
+       */
+       
+       Real a,b;
+       
+       
+       arc[4][0] = arc[2][0];
+       b = arc[1][0];          
+       
+       a = arc[1][0] = (arc[0][0] + b)/2;
+       b = arc[3][0] = (arc[4][0] + b)/2;      
+       arc[2][0] = (a + b)/2;
+       
+       
+       arc[4][1] = arc[2][1];
+       b = arc[1][1];
+       
+       a = arc[1][1] = (arc[0][1] + b)/2;
+       b = arc[3][1] = (arc[4][1] + b)/2;
+       arc[2][1] = (a + b)/2;
+       
+       /* //USING SIMD
+       
+       arc[4] = arc[2];
+       
+       arc[3] = (arc[2] + arc[1])/2;
+       arc[1] = (arc[0] + arc[1])/2;
+
+       arc[2] = (arc[1] + arc[3])/2;
+       
+       */
+       
+}
+
+static void Subd_Cubic_Stack(Point *arc)
+{
+       Real a,b,c;
+       
+       /*
+       
+       b0
+       *               0+1 a
+       b1 b    *               1+2*1+2 a
+       *               1+2     b       *                       0+3*1+3*2+3
+       b2 c    *               1+2*2+2 b       *
+       *               2+3     c       *
+       b3              *
+       *               
+       
+       0.1 2.3 ->      0.1 2 3 4 5.6
+       
+       */
+       
+       arc[6][0] = arc[3][0];
+       
+       b = arc[1][0];
+       c = arc[2][0];
+       
+       a = arc[1][0] = (arc[0][0] + b)/2;
+       b = (b + c)/2;
+       c = arc[5][0] = (arc[6][0] + c)/2;
+       
+       a = arc[2][0] = (a + b)/2;
+       b = arc[4][0] = (b + c)/2;
+       
+       arc[3][0] = (a + b)/2;
+       
+       
+       arc[6][1] = arc[3][1];
+       
+       b = arc[1][1];
+       c = arc[2][1];
+       
+       a = arc[1][1] = (arc[0][1] + b)/2;
+       b = (b + c)/2;
+       c = arc[5][1] = (arc[6][1] + c)/2;
+       
+       a = arc[2][1] = (a + b)/2;
+       b = arc[4][1] = (b + c)/2;
+       
+       arc[3][1] = (a + b)/2;
+       
+       /* //USING SIMD
+       temp
+       
+       arc[6] = arc[3];
+       
+       //backwards to avoid overwriting
+       arc[5] = (arc[2] + arc[3])/2;
+       temp = (arc[1] + arc[2])/2;
+       arc[1] = (arc[0] + arc[1])/2;
+       
+       arc[4] = (temp + arc[5])/2;
+       arc[2] = (arc[1] + temp)/2;
+       
+       arc[3] = (arc[2] + arc[4])/2;
+       
+       */
+}
+
+//************** PARAMETRIC RENDERER SUPPORT STRUCTURES ****************
+
+// super segment
+struct MonoSegment
+{
+       Rect    aabb;
+       int             ydir;
+       vector<Point>   pointlist;
+       
+       MonoSegment(int dir = 0, Real x0 = 0, Real x1 = 0, Real y0 = 0, Real y1 = 0)
+       { 
+               aabb.minx = x0;
+               aabb.maxx = x1;
+               aabb.miny = y0;
+               aabb.maxy = y1;
+
+               ydir = dir;
+       }
+       
+       int intersect(Real x,Real y) const
+       {
+               if((y < aabb.miny) | (y > aabb.maxy) | (x < aabb.minx)) return 0;
+               if(x > aabb.maxx) return ydir;
+       
+               //int i = 0;
+               //int size = pointlist.size();
+               //vector<Point>::const_iterator end = pointlist.end();
+               vector<Point>::const_iterator p = pointlist.begin();
+               
+               //assumes that the rect culled away anything that would be beyond the edges
+               if(ydir > 0)
+               {
+                       while(y > (*++p)[1]);
+               }
+               else
+               {
+                       while(y < (*++p)[1]);
+               }
+               
+               //for the loop to break there must have been a slope (straight line would do nothing)
+               //vector<Point>::const_iterator p1 = p-1;
+               Real dy = p[-1][1] - p[0][1];
+               Real dx = p[-1][0] - p[0][0];
+               
+               assert(dy != 0);
+               
+               Real xi = p[0][0] + (y - p[0][1]) * dx / dy;
+               return (x > xi)*ydir;
+       }
+};
+
+struct CurveArray
+{
+       Rect    aabb;   //not necessarily as effective - can only reject values
+       vector<Point>   pointlist;      //run length - p0, p1, p2, p3 = p10, p11, p12, p13 = p20 ...
+       vector<char>    degrees;
+       
+       CurveArray(Real x0 = 0, Real x1 = 0, Real y0 = 0, Real y1 = 0)
+       { 
+               aabb.set(x0,y0,x1,y1);
+       }
+       
+       void reset(Real x0 = 0, Real x1 = 0, Real y0 = 0, Real y1 = 0)
+       {
+               aabb.set(x0,y0,x1,y1);
+               pointlist.clear();
+               degrees.clear();
+       }
+       
+       int size () const
+       {
+               return degrees.size();
+       }
+       
+       void Start(Point m)
+       {               
+               reset(m[0],m[0],m[1],m[1]);
+               pointlist.push_back(m);         
+       }
+       
+       void AddCubic(Point p1, Point p2, Point dest)
+       {
+               aabb.expand(p1[0],p1[1]);
+               aabb.expand(p2[0],p2[1]);
+               aabb.expand(dest[0],dest[1]);
+               
+               pointlist.push_back(p1);
+               pointlist.push_back(p2);
+               pointlist.push_back(dest);
+               
+               degrees.push_back(3);
+       }
+       
+       void AddConic(Point p1, Point dest)
+       {
+               aabb.expand(p1[0],p1[1]);
+               aabb.expand(dest[0],dest[1]);
+               
+               pointlist.push_back(p1);
+               pointlist.push_back(dest);
+               
+               degrees.push_back(2);
+       }
+       
+       static int intersect_conic(Real x, Real y, Point *p, int level = 0)
+       {
+               Real ymin,ymax,xmin,xmax;
+               int intersects = 0;
+               
+               //sort the overall curve ys - degenerate detection
+               ymin = min(p[0][1],p[2][1]);
+               ymax = max(p[0][1],p[2][1]);
+               
+               xmin = min(min(p[0][0],p[1][0]),p[2][0]);
+               xmax = max(max(p[0][0],p[1][0]),p[2][0]);
+               
+               //to the left, to the right and out of range y, or completely out of range y
+               if( x < xmin ) return 0;
+               if( x > xmax  & (y > ymax | y < ymin) ) return 0;
+               if( (y > ymax & y > p[1][1]) | (y < ymin & y < p[1][1]) ) return 0;
+                       
+               //degenerate line max
+               if(ymin == ymax == p[1][1])
+                       return 0;
+               
+               //degenerate accept - to the right and crossing the base line
+               if(x > xmax)
+               {
+                       return (y <= ymax & y >= ymin);
+               }
+
+               //solve for curve = y
+               
+               //real roots: 
+               //0 roots       - 0 intersection
+               //1 root        - get x, and figure out x
+               //2 roots (non-double root)     - get 2 xs, and count xs to the left
+               
+               //for conic we can assume 1 intersection for monotonic curve
+               Real    a = p[2][1] -   2*p[1][1] +     p[0][1],
+                               b =                     2*p[1][1] -     2*p[0][1],
+                               c =                                                     p[0][1]         -       y;
+               
+               Real t1 = -1, t2 = -1;
+               
+               if(a == 0)
+               {
+                       //linear - easier :)
+                       if(b == 0) return 0; //may not need this check
+                               
+                       t1 = - c / b; //bt + c = 0 solved
+               }else
+               {
+                       //2 degree polynomial
+                       Real b2_4ac = b*b - 4*a*c;
+                       
+                       //if there are double/no roots - no intersections (in real #s that is)
+                       if(b2_4ac <= 0)
+                       {
+                               return 0;
+                       }
+                       
+                       b2_4ac = sqrt(b2_4ac);
+                       
+                       t1 = (-b - b2_4ac) / 2*a,
+                       t2 = (-b + b2_4ac) / 2*a;
+               }
+               
+               //calculate number of intersections             
+               if(t1 >= 0 & t1 <= 1)
+               {
+                       const Real t = t1;
+                       const Real invt = 1 - t;
+                       
+                       //find x val and it counts if it's to the left of the point
+                       const Real xi = invt*invt*p[0][0] + 2*t*invt*p[1][0] + t*t*p[2][0];
+                       const Real dy_t = 2*a*t + b;
+                       
+                       if(dy_t)
+                       {
+                               intersects += (x >= xi) * ( dy_t > 0 ? 1 : -1);
+                       }
+               }
+
+               if(t2 >= 0 & t2 <= 1)
+               {
+                       const Real t = t2;
+                       const Real invt = 1 - t;
+                       
+                       //find x val and it counts if it's to the left of the point
+                       const Real xi = invt*invt*p[0][0] + 2*t*invt*p[1][0] + t*t*p[2][0];
+                       const Real dy_t = 2*a*t + b;
+                       
+                       if(dy_t)
+                       {
+                               intersects += (x >= xi) * ( dy_t > 0 ? 1 : -1);
+                       }
+               }
+               
+               return intersects;
+       }
+       
+       static int      quadratic_eqn(Real a, Real b, Real c, Real *t0, Real *t1)
+       {
+               const Real b2_4ac = b*b - 4*a*c;
+               
+               //degenerate reject (can't take sqrt)
+               if(b2_4ac < 0)
+               {
+                       return 0;
+               }
+               
+               const Real sqrtb2_4ac = sqrt(b2_4ac);           
+               const Real signb = b < 0 ? -1 : 1;
+               const Real q = - 0.5 * (b + signb * sqrtb2_4ac);
+               
+               *t0 = q/a;
+               *t1 = c/q;
+               
+               return sqrtb2_4ac == 0 ? 1 : 2;
+       }
+       
+       //Newton-Raphson root polishing (we don't care about bounds, assumes very near the desired root)
+       static Real polish_cubicroot(Real a, Real b, Real c, Real d, Real t, Real *dpdt)
+       {
+               const Real cn[4] = {a,b,c,d};
+               Real p,dp,newt,oldpmag=FLT_MAX;
+               
+               //eval cubic eqn and it's derivative
+               for(;;)
+               {
+                       p = cn[0]*t + cn[1];
+                       dp = cn[0];
+                       
+                       for(int i = 2; i < 4; i++)
+                       {
+                               dp = p + dp*t;
+                               p = cn[i] + p*t;
+                       }
+                       
+                       if(dp == 0)
+                       {
+                               sinfg::warning("polish_cubicroot: Derivative should not vanish!!!");
+                               return t;
+                       }
+
+                       newt = t - p/dp;
+
+                       if(newt == t || fabs(p) >= oldpmag)
+                       {
+                               *dpdt = dp;
+                               return t;
+                       }
+                       
+                       t = newt;                               
+                       oldpmag = fabs(p);
+               }
+       }
+       
+       static int intersect_cubic(Real x, Real y, Point *p, int level = 0)
+       {
+               const Real INVALIDROOT = -FLT_MAX;
+               Real ymin,ymax,xmin,xmax;
+               Real ymin2,ymax2,ymintot,ymaxtot;
+               int intersects = 0;
+               
+               //sort the overall curve ys and xs - degenerate detection
+               
+               //open span for the two end points
+               ymin = min(p[0][1],p[3][1]);
+               ymax = max(p[0][1],p[3][1]);
+               
+               //other points etc.
+               ymin2 = min(p[1][1],p[2][1]);
+               ymax2 = max(p[1][1],p[2][1]);
+               
+               ymintot = min(ymin,ymin2);
+               ymaxtot = max(ymax,ymax2);
+                               
+               //the entire curve control polygon is in this x range
+               xmin = min(min(p[0][0],p[1][0]),min(p[2][0],p[3][0]));
+               xmax = max(max(p[0][0],p[1][0]),max(p[2][0],p[3][0]));
+                               
+               //outside all y boundaries (no intersect)
+               if( (y > ymaxtot) || (y < ymintot) ) return 0;
+               
+               //left of curve (no intersect)
+               if(x < xmin) return 0;
+               
+               //right of curve (and outside base range)
+               if( x > xmax )
+               {
+                       if( (y > ymax) | (y < ymin) ) return 0;
+                               
+                       //degenerate accept - to the right and inside the [ymin,ymax] range (already rejected if out of range)
+                       const Real n = p[3][1] - p[0][1];
+                       
+                       //extract the sign from the value (we need valid data)
+                       return n < 0 ? -1 : 1;
+               }
+                       
+               //degenerate horizontal line max -- doesn't happen enough to check for
+               if( ymintot == ymaxtot ) return 0;
+               
+               //calculate roots:
+               // can have 0,1,2, or 3 real roots
+               // if any of them are double then reject the two...
+               
+               // y-coefficients for f_y(t) - y = 0
+               Real    a = p[3][1]     - 3*p[2][1]     + 3*p[1][1]     -   p[0][1],
+                               b =                       3*p[2][1]     - 6*p[1][1]     + 3*p[0][1],
+                               c =                                                       3*p[1][1]     - 3*p[0][1],
+                               d =                                                                             p[0][1] - y;
+               
+               Real    ax = p[3][0]    - 3*p[2][0]     + 3*p[1][0]     -   p[0][0],
+                               bx =                      3*p[2][0]     - 6*p[1][0]     + 3*p[0][0],
+                               cx =                                              3*p[1][0]     - 3*p[0][0],
+                               dx =                                                                            p[0][0];
+               
+               Real t1 = INVALIDROOT, t2 = INVALIDROOT, t3 = INVALIDROOT, t, dydt;
+               
+               if(a == 0)
+               {
+                       //only 2nd degree
+                       if(b == 0)
+                       {
+                               //linear
+                               if(c == 0) return 0;
+                                       
+                               t1 = - d / c; //equation devolved into: ct + d = 0 - solve...
+                       }else
+                       {
+                               //0 roots = 0 intersections, 1 root = 2 intersections at the same place (0 effective)
+                               if(quadratic_eqn(a,b,c,&t1,&t2) != 2) return 0;
+                       }                       
+               }else
+               {
+                       //cubic - sigh....
+                       
+                       //algorithm courtesy of Numerical Recipes in C (algorithm copied from pg. 184/185)
+                       Real an = b / a,
+                                bn = c / a,
+                                cn = d / a;
+                       
+                       //if cn is 0 (or really really close), then we can simplify this...
+                       if(IsZero(cn))
+                       {
+                               t3 = 0;
+
+                               //0 roots = 0 intersections, 1 root = 2 intersections at the same place (0 effective)
+                               if(quadratic_eqn(a,b,c,&t1,&t2) != 2)
+                               {
+                                       t1 = t2 = INVALIDROOT;
+                               }
+                       }
+                       else
+                       {                       
+                               //otherwise run the normal cubic root equation
+                               Real Q = (an*an - 3.0*bn) / 9.0;
+                               Real R = ((2.0*an*an - 9.0*bn)*an + 27.0*cn)/54.0;
+                               
+                               if(R*R < Q*Q*Q)
+                               {
+                                       Real theta = acos(R / sqrt(Q*Q*Q));
+                                       
+                                       t1 = -2.0*sqrt(Q)*cos(theta/3) - an/3.0;
+                                       t2 = -2.0*sqrt(Q)*cos((theta+2*PI)/3.0) - an/3.0;
+                                       t3 = -2.0*sqrt(Q)*cos((theta-2*PI)/3.0) - an/3.0;
+                                       
+                                       //don't need to reorder,l just need to eliminate double/triple roots
+                                       //if(t3 == t2 & t1 == t2) t2 = t3 = INVALIDROOT;
+                                       if(t3 == t2) t2 = t3 = INVALIDROOT;
+                                       if(t1 == t2) t1 = t2 = INVALIDROOT;
+                                       if(t1 == t3) t1 = t3 = INVALIDROOT;
+                               }else
+                               {
+                                       Real signR = R < 0 ? -1 : 1;
+                                       Real A = - signR * pow(signR*R + sqrt(R*R - Q*Q*Q),1/3.0);
+                                       
+                                       Real B;
+                                       if(A == 0) B = 0;
+                                       else B = Q / A;
+       
+                                       //single real root in this case
+                                       t1 = (A + B) - an/3.0;
+                               }
+                       }
+               }
+               
+               //if(t1 != INVALIDROOT)
+               {
+                       t = t1;//polish_cubicroot(a,b,c,d,t1,&dydt);
+                       if(t >= 0 & t < 1)
+                       {
+                               //const Real invt = 1 - t;
+                               
+                               //find x val and it counts if it's to the left of the point
+                               const Real xi = ((ax*t + bx)*t + cx)*t + dx;
+                               dydt = (3*a*t + 2*b)*t + c;
+                               
+                               if(dydt)
+                               {
+                                       intersects += (x >= xi) * ( dydt > 0 ? 1 : -1);
+                               }
+                       }
+               }
+
+               //if(t2 != INVALIDROOT)
+               {
+                       t = t2;//polish_cubicroot(a,b,c,d,t2,&dydt);
+                       if(t >= 0 & t < 1)
+                       {
+                               //const Real invt = 1 - t;
+                               
+                               //find x val and it counts if it's to the left of the point
+                               const Real xi = ((ax*t + bx)*t + cx)*t + dx;
+                               dydt = (3*a*t + 2*b)*t + c;
+                               
+                               if(dydt)
+                               {
+                                       intersects += (x >= xi) * ( dydt > 0 ? 1 : -1);
+                               }
+                       }
+               }
+
+               //if(t3 != INVALIDROOT)
+               {
+                       t = t3;//polish_cubicroot(a,b,c,d,t3,&dydt);
+                       if(t >= 0 & t < 1)
+                       {
+                               //const Real invt = 1 - t;
+                               
+                               //find x val and it counts if it's to the left of the point
+                               const Real xi = ((ax*t + bx)*t + cx)*t + dx;
+                               dydt = (3*a*t + 2*b)*t + c;
+                               
+                               if(dydt)
+                               {
+                                       intersects += (x >= xi) * ( dydt > 0 ? 1 : -1);
+                               }
+                       }
+               }
+               
+               return intersects;
+       }
+       
+       int intersect(Real x,Real y, Point *table) const
+       {               
+               if((y < aabb.miny) | (y > aabb.maxy) | (x < aabb.minx)) return 0;
+                       
+               int i, curdeg, intersects = 0;
+               const int numcurves = degrees.size();
+               
+               vector<Point>::const_iterator   p = pointlist.begin();
+                                       
+               for(i=0; i < numcurves; i++)
+               {
+                       curdeg = degrees[i];
+                       
+                       switch(curdeg)
+                       {
+                               case 2:
+                               {
+                                       table[0] = *p++;
+                                       table[1] = *p++;
+                                       table[2] = *p;  //we want to include the last point for the next curve
+                                       
+                                       intersects += intersect_conic(x,y,table);
+                                       
+                                       break;
+                               }
+                               
+                               case 3:
+                               {
+                                       table[0] = *p++;
+                                       table[1] = *p++;
+                                       table[2] = *p++;
+                                       table[3] = *p;  //we want to include the last point for the next curve
+                                       
+                                       intersects += intersect_cubic(x,y,table);
+                                       
+                                       break;
+                               }
+                               
+                               default:
+                               {
+                                       warning("Invalid degree (%d) inserted into the list (index: %d)\n", curdeg, i);
+                                       return 0;
+                               }
+                       }                               
+               }
+               
+               return intersects;
+       }
+};
+
+struct Layer_Shape::Intersector
+{      
+       Rect    aabb;
+       bool    initaabb;
+       
+       int     flags;
+       
+       enum IntersectorFlags
+       {
+               NotClosed = 0x8000
+       };
+       
+       enum PrimitiveType
+       {
+               TYPE_NONE = 0,
+               TYPE_LINE,
+               TYPE_CURVE
+       };
+       
+       Real    cur_x,cur_y;
+       Real    close_x,close_y;
+       
+       vector<MonoSegment>                             segs;   //monotonically increasing 
+       vector<CurveArray>                              curves; //big array of consecutive curves
+       
+       int                                                             prim;
+       Vector                                                  tangent;
+       
+       Intersector()
+       {
+               clear();
+       }
+       
+       bool notclosed()
+       {
+               return (flags & NotClosed) | (cur_x != close_x) | (cur_y != close_y);
+       }
+       
+       void move_to(Real x, Real y)
+       {
+               close();
+               
+               close_x = cur_x = x;
+               close_y = cur_y = y;
+               
+               tangent[0] = tangent[1] = 0;
+               
+               if(initaabb) 
+               {
+                       aabb.set_point(x,y);
+                       initaabb = false;
+               }else aabb.expand(x,y);
+               
+               prim = TYPE_NONE;
+       }
+       
+       void line_to(Real x, Real y)
+       {
+               int dir = (y > cur_y)*1 + (-1)*(y < cur_y);
+               
+               //check for context (if not line start a new segment)
+               //if we're not in line mode (cover's 0 set case), or if directions are different (not valid for 0 direction)
+               if(prim != TYPE_LINE || (dir && segs.back().ydir != dir))
+               {
+                       MonoSegment             seg(dir,x,x,y,y);
+                       
+                       seg.aabb.expand(cur_x,cur_y);
+                       seg.pointlist.push_back(Point(cur_x,cur_y));
+                       seg.pointlist.push_back(Point(x,y));
+                       segs.push_back(seg);
+               }
+               //add to the last segment, because it works
+               else
+               {                       
+                       segs.back().pointlist.push_back(Point(x,y));
+                       segs.back().aabb.expand(x,y);
+               }
+
+
+                                               
+               cur_x = x;
+               cur_y = y;
+               aabb.expand(x,y); //expand the entire things bounding box
+               
+               tangent[0] = x - cur_x;
+               tangent[1] = x - cur_y;
+               
+               flags |= NotClosed;
+               prim = TYPE_LINE;
+       }
+       
+       void conic_to_smooth(Real x, Real y)
+       {
+               const Real x1 = tangent[0]/2.0 + cur_x;
+               const Real y1 = tangent[1]/2.0 + cur_y;
+               
+               conic_to(x1,y1,x,y);
+       }
+       
+       void conic_to(Real x1, Real y1, Real x, Real y)
+       {
+               //if we're not already a curve start one
+               if(prim != TYPE_CURVE)
+               {
+                       CurveArray      c;
+
+                       c.Start(Point(cur_x,cur_y));
+                       c.AddConic(Point(x1,y1),Point(x,y));
+                       
+                       curves.push_back(c);
+               }else
+               {
+                       curves.back().AddConic(Point(x1,y1),Point(x,y));
+               }
+               
+               cur_x = x;
+               cur_y = y;
+               
+               aabb.expand(x1,y1);
+               aabb.expand(x,y);
+               
+               tangent[0] = 2*(x - x1);
+               tangent[1] = 2*(y - y1);
+               
+               flags |= NotClosed;
+               prim = TYPE_CURVE;
+       }
+       
+       void curve_to_smooth(Real x2, Real y2, Real x, Real y)
+       {
+               Real x1 = tangent[0]/3.0 + cur_x;
+               Real y1 = tangent[1]/3.0 + cur_y;
+               
+               curve_to(x1,y1,x2,y2,x,y);              
+       }
+       
+       void curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y)
+       {
+               //if we're not already a curve start one
+               if(prim != TYPE_CURVE)
+               {
+                       CurveArray      c;
+
+                       c.Start(Point(cur_x,cur_y));
+                       c.AddCubic(Point(x1,y1),Point(x2,y2),Point(x,y));
+                       
+                       curves.push_back(c);
+               }else
+               {
+                       curves.back().AddCubic(Point(x1,y1),Point(x2,y2),Point(x,y));
+               }
+               
+               cur_x = x;
+               cur_y = y;
+               
+               //expand bounding box around ALL of it
+               aabb.expand(x1,y1);
+               aabb.expand(x2,y2);
+               aabb.expand(x,y);
+               
+               tangent[0] = 3*(x - x2);
+               tangent[1] = 3*(y - y2);
+               
+               flags |= NotClosed;
+               prim = TYPE_CURVE;
+       }
+       
+       void close()
+       {
+               if(flags & NotClosed)
+               {
+                       if(cur_x != close_x || cur_y != close_y)
+                       {
+                               line_to(close_x,close_y);
+                       }
+                       
+                       flags &= ~NotClosed;
+               }
+       }
+       
+       //assumes the line to count the intersections with is (-1,0)
+       int     intersect (Real x, Real y) const
+       {
+               int inter = 0;
+               unsigned int i;
+               vector<MonoSegment>::const_iterator s = segs.begin();
+               vector<CurveArray>::const_iterator c = curves.begin();          
+               
+               Point   memory[3*MAX_SUBDIVISION_SIZE + 1];
+               
+               for(i = 0; i < segs.size(); i++,s++)
+               {
+                       inter += s->intersect(x,y);
+               }
+               
+               for(i=0; i < curves.size(); i++,c++)
+                       inter += c->intersect(x,y,memory);
+               
+               return inter;
+       }
+       
+       //intersect an arbitrary line
+       //int   intersect (Real x, Real y, Real vx, Real vy) {return 0;}
+       
+       void clear()
+       { 
+               segs.clear();
+               curves.clear();
+               
+               flags = 0;
+               cur_x = cur_y = close_x = close_y = 0;
+               prim = TYPE_NONE;
+               tangent[0] = tangent[1] = 0;
+               initaabb = true;
+       }
+};
+
+//*********** SCANLINE RENDERER SUPPORT STRUCTURES ***************
+struct PenMark
+{
+       int y,x;
+       Real cover,area;
+       
+       PenMark(){}     
+       PenMark(int xin, int yin, Real c, Real a)
+               :y(yin),x(xin),cover(c),area(a) {}
+       
+       void set(int xin, int yin, Real c, Real a)      { y = yin; x = xin; cover = c; area = a;        }
+       
+       void setcoord(int xin, int yin)                         { y = yin; x = xin;     }
+       
+       void setcover(Real c, Real a)                           { cover = c; area = a; }
+       void addcover(Real c, Real a)                           { cover += c; area += a; }
+       
+       bool operator < (const PenMark &rhs) const
+       {
+               return y == rhs.y ? x < rhs.x : y < rhs.y;
+       }
+};
+
+typedef rect<int> ContextRect;
+
+class Layer_Shape::PolySpan
+{
+public:
+       typedef deque<PenMark>  cover_array;
+
+       Point                   arc[3*MAX_SUBDIVISION_SIZE + 1];
+
+       cover_array             covers;
+       PenMark                 current;
+
+       int                             open_index;
+
+       //ending position of last primitive
+       Real                    cur_x;
+       Real                    cur_y;
+
+       //starting position of current primitive list
+       Real                    close_x;
+       Real                    close_y;
+       
+       //flags for the current segment
+       int                             flags;
+
+       //the window that will be drawn (used for clipping)
+       ContextRect             window;
+
+       //for assignment to flags value
+       enum PolySpanFlags
+       {
+               NotSorted = 0x8000,
+               NotClosed =     0x4000
+       };
+       
+       //default constructor - 0 everything
+       PolySpan() :current(0,0,0,0),flags(NotSorted)
+       {
+               cur_x = cur_y = close_x = close_y = 0;
+               open_index = 0;
+       }
+       
+       bool notclosed() const
+       {
+               return (flags & NotClosed) | (cur_x != close_x) | (cur_y != close_y);
+       }
+       
+       //0 out all the variables involved in processing 
+       void clear()
+       {
+               covers.clear();
+               cur_x = cur_y = close_x = close_y = 0;
+               open_index = 0;         
+               current.set(0,0,0,0);
+               flags = NotSorted;
+       }
+
+       //add the current cell, but only if there is information to add 
+       void addcurrent()
+       {
+               if(current.cover || current.area)
+               {
+                       covers.push_back(current);
+               }
+       }
+       
+       //move to the next cell (cover values 0 initially), keeping the current if necessary
+       void move_pen(int x, int y)
+       {
+               if(y != current.y | x != current.x)
+               {
+                       addcurrent();
+                       current.set(x,y,0,0);
+               }
+       }
+       
+       //close the primitives with a line (or rendering will not work as expected)
+       void close()
+       {
+               if(flags & NotClosed)
+               {
+                       if(cur_x != close_x || cur_y != close_y)
+                       {
+                               line_to(close_x,close_y);
+                               addcurrent();
+                               current.setcover(0,0);
+                       }
+                       flags &= ~NotClosed;
+               }
+       }
+       
+       // Not recommended - destroys any separation of spans currently held
+       void merge_all()
+       {
+               sort(covers.begin(),covers.end());
+               open_index = 0;
+       }
+       
+       //will sort the marks if they are not sorted
+       void sort_marks()
+       {
+               if(flags & NotSorted)
+               {
+                       //only sort the open index                      
+                       addcurrent();
+                       current.setcover(0,0);
+                       
+                       sort(covers.begin() + open_index,covers.end());
+                       flags &= ~NotSorted;
+               }
+       }
+       
+       //encapsulate the current sublist of marks (used for drawing)
+       void encapsulate_current()
+       {
+               //sort the current list then reposition the open list section
+               sort_marks();
+               open_index = covers.size();
+       }
+       
+       //move to start a new primitive list (enclose the last primitive if need be)
+       void move_to(Real x, Real y)
+       {
+               close();
+               if(isnan(x))x=0;
+               if(isnan(y))y=0;
+               move_pen((int)floor(x),(int)floor(y));
+               close_y = cur_y = y;
+               close_x = cur_x = x;
+       }
+
+       //primitive_to functions
+       void line_to(Real x, Real y);
+       void conic_to(Real x1, Real y1, Real x, Real y);
+       void cubic_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y);
+       
+       void draw_scanline(int y, Real x1, Real y1, Real x2, Real y2);
+       void draw_line(Real x1, Real y1, Real x2, Real y2);
+       
+       Real ExtractAlpha(Real area)
+       {
+               //non-zero winding style
+               if(area < 0) area = -area;
+               if(area > 1) area = 1;
+                       
+               //even-odd winding style
+               /*if(area < 0) area = -area;
+               
+               while(area > 2) area -= 2;
+               if(area > 1) area = 1-area; //want pyramid like thing
+               */
+               //broken? - yep broken
+                               
+               return area;
+       }
+};
+
+/* === M E T H O D S ======================================================= */
+
+Layer_Shape::Layer_Shape(const Real &a, const Color::BlendMethod m):
+       Layer_Composite (a,m),
+       edge_table              (new Intersector),
+       color                   (Color::black()),
+       offset                  (0,0),
+       invert                  (false),
+       antialias               (true),
+       blurtype                (Blur::FASTGAUSSIAN),
+       feather                 (0),
+       bytestream              (0),
+       lastbyteop              (Primitive::NONE),
+       lastoppos               (-1)
+{
+}
+
+Layer_Shape::~Layer_Shape()
+{
+       delete edge_table;
+}
+
+void
+Layer_Shape::clear()
+{
+       edge_table->clear();
+       bytestream.clear();
+}
+       
+bool
+Layer_Shape::set_param(const String & param, const ValueBase &value)
+{
+       IMPORT(color);
+       IMPORT(offset);
+       IMPORT(invert);
+       IMPORT(antialias);
+       IMPORT(feather);
+       IMPORT(blurtype);
+       
+       return Layer_Composite::set_param(param,value);
+}
+
+ValueBase
+Layer_Shape::get_param(const String &param)const
+{
+       EXPORT(color);
+       EXPORT(offset);
+       EXPORT(invert);
+       EXPORT(antialias);
+       EXPORT(feather);
+       EXPORT(blurtype);
+       
+       EXPORT_NAME();
+       EXPORT_VERSION();
+               
+       return Layer_Composite::get_param(param);
+}
+
+Layer::Vocab
+Layer_Shape::get_param_vocab()const
+{
+       Layer::Vocab ret(Layer_Composite::get_param_vocab());
+       
+       ret.push_back(ParamDesc("color")
+               .set_local_name(_("Color"))
+               .set_description(_("Layer_Shape Color"))
+       );
+       ret.push_back(ParamDesc("offset")
+               .set_local_name(_("Position"))
+       );
+       ret.push_back(ParamDesc("invert")
+               .set_local_name(_("Invert"))
+       );
+       ret.push_back(ParamDesc("antialias")
+               .set_local_name(_("Antialiasing"))
+       );      
+       ret.push_back(ParamDesc("feather")
+               .set_local_name(_("Feather"))
+               .set_is_distance()
+       );
+       ret.push_back(ParamDesc("blurtype")
+               .set_local_name(_("Type of Feather"))
+               .set_description(_("Type of feathering to use"))
+               .set_hint("enum")
+               .add_enum_value(Blur::BOX,"box",_("Box Blur"))
+               .add_enum_value(Blur::FASTGAUSSIAN,"fastgaussian",_("Fast Gaussian Blur"))
+               .add_enum_value(Blur::CROSS,"cross",_("Cross-Hatch Blur"))
+               .add_enum_value(Blur::GAUSSIAN,"gaussian",_("Gaussian Blur"))
+               .add_enum_value(Blur::DISC,"disc",_("Disc Blur"))
+       );
+       
+       return ret;
+}
+
+sinfg::Layer::Handle
+Layer_Shape::hit_check(sinfg::Context context, const sinfg::Point &p)const
+{
+       Point pos(p-offset);
+               
+       int intercepts = edge_table->intersect(pos[0],pos[1]);
+
+       // If we have an odd number of intercepts, we are inside.
+       // If we have an even number of intercepts, we are outside.
+       bool intersect = ((!!intercepts) ^ invert);
+
+       if(get_amount() == 0 || get_blend_method() == Color::BLEND_ALPHA_OVER)
+       {
+               intersect = false;
+       }
+
+       if(intersect)
+       {
+               sinfg::Layer::Handle tmp;
+               if(get_blend_method()==Color::BLEND_BEHIND && (tmp=context.hit_check(p)))
+                       return tmp;
+               if(Color::is_onto(get_blend_method()))
+               {
+                       //if there's something in the lower layer then we're set...
+                       if(!context.hit_check(p).empty())
+                               return const_cast<Layer_Shape*>(this);
+               }else if(get_blend_method() == Color::BLEND_ALPHA_OVER)
+               {
+                       sinfg::info("layer_shape::hit_check - we've got alphaover");
+                       //if there's something in the lower layer then we're set...
+                       if(color.get_a() < 0.1 && get_amount() > .9)
+                       {
+                               sinfg::info("layer_shape::hit_check - can see through us... so nothing");
+                               return Handle();
+                       }else return context.hit_check(p);
+               }else
+                       return const_cast<Layer_Shape*>(this);
+       }
+
+       return context.hit_check(p);
+}
+
+Color
+Layer_Shape::get_color(Context context, const Point &p)const
+{
+       Point pp = p;
+       
+       if(feather)
+               pp = Blur(feather,feather,blurtype)(p);
+       
+       Point pos(pp-offset);
+               
+       int intercepts = edge_table->intersect(pos[0],pos[1]);
+
+       // If we have an odd number of intercepts, we are inside.
+       // If we have an even number of intercepts, we are outside.
+       bool intersect = ((!!intercepts) ^ invert);
+       
+       if(!intersect)
+               return context.get_color(pp);
+
+       //Ok, we're inside... bummmm ba bum buM...
+       if(get_blend_method() == Color::BLEND_STRAIGHT && get_amount() == 1)
+               return color;
+       else
+               return Color::blend(color,context.get_color(p),get_amount(),get_blend_method());
+}
+
+//************** SCANLINE RENDERING *********************
+void Layer_Shape::PolySpan::line_to(Real x, Real y)    
+{      
+       Real n[4];
+       bool afterx = false;
+       
+       const Real xin(x), yin(y);
+       
+       Real dx = x - cur_x;
+       Real dy = y - cur_y;
+       
+       //CLIP IT!!!!
+       try {
+       //outside y - ignore entirely
+       if(      (cur_y >= window.maxy & y >= window.maxy)
+               |(cur_y <  window.miny & y <  window.miny) )
+       {
+               cur_x = x;
+               cur_y = y;      
+       }
+       else //not degenerate - more complicated
+       {
+               if(dy > 0) //be sure it's not tooooo small
+               {                               
+                       // cur_y ... window.miny ... window.maxy ... y
+                       
+                       //initial degenerate - initial clip
+                       if(cur_y < window.miny)
+                       {
+                               //new clipped start point (must also move pen)
+                               n[2] = cur_x + (window.miny - cur_y) * dx / dy;
+                               
+                               cur_x = n[2];
+                               cur_y = window.miny;
+                               move_pen((int)floor(cur_x),window.miny);
+                       }
+                       
+                       //generate data for the ending clipped info                     
+                       if(y > window.maxy)
+                       {
+                               //intial line to intersection (and degenerate)
+                               n[2] = x + (window.maxy - y) * dx / dy;
+       
+                               //intersect coords
+                               x = n[2];
+                               y = window.maxy;
+                       }
+               }
+               else
+               {
+                       //initial degenerate - initial clip
+                       if(cur_y > window.maxy)
+                       {                               
+                               //new clipped start point (must also move pen)
+                               n[2] = cur_x + (window.maxy - cur_y) * dx / dy;
+                               
+                               cur_x = n[2];
+                               cur_y = window.maxy;
+                               move_pen((int)floor(cur_x),window.maxy);
+                       }
+                       
+                       //generate data for the ending clipped info                     
+                       if(y < window.miny)
+                       {
+                               //intial line to intersection (and degenerate)
+                               n[2] = x + (window.miny - y) * dx / dy;
+       
+                               //intersect coords
+                               x = n[2];
+                               y = window.miny;
+                       }
+               }
+               
+               //all degenerate - but require bounded clipped values
+               if(   (cur_x >= window.maxx && x >= window.maxx)
+                       ||(cur_x <  window.minx && x <  window.minx) )
+               {
+                       //clip both vertices - but only needed in the x direction
+                       cur_x = max(cur_x,      (Real)window.minx);
+                       cur_x = min(cur_x,      (Real)window.maxx);
+                       
+                       //clip the dest values - y is already clipped                           
+                       x = max(x,(Real)window.minx);
+                       x = min(x,(Real)window.maxx);
+                       
+                       //must start at new point...
+                       move_pen((int)floor(cur_x),(int)floor(cur_y));
+                       
+                       draw_line(cur_x,cur_y,x,y);
+                       
+                       cur_x = xin;
+                       cur_y = yin;
+               }                               
+               else
+               {
+                       //clip x
+                       if(dx > 0)
+                       {
+                               //initial degenerate - initial clip
+                               if(cur_x < window.minx)
+                               {
+                                       //need to draw an initial segment from clippedx,cur_y to clippedx,intersecty
+                                       n[2] = cur_y + (window.minx - cur_x) * dy / dx;
+                                       
+                                       move_pen(window.minx,(int)floor(cur_y));
+                                       draw_line(window.minx,cur_y,window.minx,n[2]);
+                                       
+                                       cur_x = window.minx;
+                                       cur_y = n[2];
+                               }
+                               
+                               //generate data for the ending clipped info                     
+                               if(x > window.maxx)
+                               {
+                                       //intial line to intersection (and degenerate)
+                                       n[2] = y + (window.maxx - x) * dy / dx;
+                                       
+                                       n[0] = window.maxx;
+                                       n[1] = y;
+               
+                                       //intersect coords
+                                       x = window.maxx;
+                                       y = n[2];
+                                       afterx = true;
+                               }
+                       }else
+                       {
+                               //initial degenerate - initial clip
+                               if(cur_x > window.maxx)
+                               {
+                                       //need to draw an initial segment from clippedx,cur_y to clippedx,intersecty
+                                       n[2] = cur_y + (window.maxx - cur_x) * dy / dx;
+                                       
+                                       move_pen(window.maxx,(int)floor(cur_y));
+                                       draw_line(window.maxx,cur_y,window.maxx,n[2]);
+                                       
+                                       cur_x = window.maxx;
+                                       cur_y = n[2];
+                               }
+                               
+                               //generate data for the ending clipped info                     
+                               if(x < window.minx)
+                               {
+                                       //intial line to intersection (and degenerate)
+                                       n[2] = y + (window.minx - x) * dy / dx;
+                                       
+                                       n[0] = window.minx;
+                                       n[1] = y;
+               
+                                       //intersect coords
+                                       x = window.minx;
+                                       y = n[2];
+                                       afterx = true;
+                               }
+                       }
+                       
+                       move_pen((int)floor(cur_x),(int)floor(cur_y));
+                       //draw the relevant line (clipped)
+                       draw_line(cur_x,cur_y,x,y);
+                       
+                       if(afterx)
+                       {
+                               draw_line(x,y,n[0],n[1]);
+                       }
+                               
+                       cur_x = xin;
+                       cur_y = yin;
+               }
+       }
+       } catch(...) { sinfg::error("line_to: cur_x=%f, cur_y=%f, x=%f, y=%f", cur_x, cur_y, x, y); throw; }
+
+       flags |= NotClosed|NotSorted;
+}
+
+static inline bool clip_conic(const Point *const p, const ContextRect &r)
+{
+       const Real minx = min(min(p[0][0],p[1][0]),p[2][0]);
+       const Real miny = min(min(p[0][1],p[1][1]),p[2][1]);
+       const Real maxx = max(max(p[0][0],p[1][0]),p[2][0]);
+       const Real maxy = max(max(p[0][1],p[1][1]),p[2][1]);
+
+       return  (minx > r.maxx) |
+                       (maxx < r.minx) |
+                       (miny > r.maxy) |
+                       (maxy < r.miny);
+}
+
+static inline bool clip_cubic(const Point *const p, const ContextRect &r)
+{
+       /*const Real minx = min(min(p[0][0],p[1][0]),min(p[2][0],p[3][0]));
+       const Real miny = min(min(p[0][1],p[1][1]),min(p[2][1],p[3][1]));
+       const Real maxx = max(max(p[0][0],p[1][0]),max(p[2][0],p[3][1]));
+       const Real maxy = max(max(p[0][1],p[1][1]),max(p[2][1],p[3][1]));
+
+       return  (minx > r.maxx) ||
+                       (maxx < r.minx) ||
+                       (miny > r.maxy) ||
+                       (maxy < r.miny);*/
+       
+       return  ((p[0][0] > r.maxx) & (p[1][0] > r.maxx) & (p[2][0] > r.maxx) & (p[3][0] > r.maxx)) |
+                       ((p[0][0] < r.minx) & (p[1][0] < r.minx) & (p[2][0] < r.minx) & (p[3][0] < r.minx)) |
+                       ((p[0][1] > r.maxy) & (p[1][1] > r.maxy) & (p[2][1] > r.maxy) & (p[3][1] > r.maxy)) |
+                       ((p[0][1] < r.miny) & (p[1][1] < r.miny) & (p[2][1] < r.miny) & (p[3][1] < r.miny));
+}
+
+static inline Real max_edges_cubic(const Point *const p)
+{
+       const Real x1 = p[1][0] - p[0][0];
+       const Real y1 = p[1][1] - p[0][1];
+       
+       const Real x2 = p[2][0] - p[1][0];
+       const Real y2 = p[2][1] - p[1][1];
+       
+       const Real x3 = p[3][0] - p[2][0];
+       const Real y3 = p[3][1] - p[2][1];
+       
+       const Real d1 = x1*x1 + y1*y1;
+       const Real d2 = x2*x2 + y2*y2;
+       const Real d3 = x3*x3 + y3*y3;
+       
+       return max(max(d1,d2),d3);
+}
+
+static inline Real max_edges_conic(const Point *const p)
+{
+       const Real x1 = p[1][0] - p[0][0];
+       const Real y1 = p[1][1] - p[0][1];
+       
+       const Real x2 = p[2][0] - p[1][0];
+       const Real y2 = p[2][1] - p[1][1];
+       
+       const Real d1 = x1*x1 + y1*y1;
+       const Real d2 = x2*x2 + y2*y2;
+       
+       return max(d1,d2);
+}
+
+void Layer_Shape::PolySpan::conic_to(Real x1, Real y1, Real x, Real y)
+{
+       Point *current = arc;
+       int             level = 0;
+       int     num = 0;
+       bool    onsecond = false;
+       
+       arc[0] = Point(x,y);
+       arc[1] = Point(x1,y1);
+       arc[2] = Point(cur_x,cur_y);
+       
+       //just draw the line if it's outside
+       if(clip_conic(arc,window))
+       {
+               line_to(x,y);
+               return;
+       }
+       
+       //Ok so it's not super degenerate, subdivide and draw (run through minimum subdivision levels first)
+       while(current >= arc)
+       {
+               if(num >= MAX_SUBDIVISION_SIZE)
+               {
+                       warning("Curve subdivision somehow ran out of space while tesselating!");
+                       
+                       //do something...
+                       assert(0);
+                       return;
+               }else
+               //if the curve is clipping then draw degenerate
+               if(clip_conic(current,window))
+               {
+                       line_to(current[0][0],current[0][1]); //backwards so front is destination
+                       current -= 2;
+                       if(onsecond) level--;
+                       onsecond = true;
+                       num--;
+                       continue;
+               }else
+               //if we are not at the level minimum
+               if(level < MIN_SUBDIVISION_DRAW_LEVELS)
+               {
+                       Subd_Conic_Stack(current);
+                       current += 2;           //cursor on second curve
+                       level ++;
+                       num ++;
+                       onsecond = false;
+                       continue;
+               }else
+               //split it again, if it's too big
+               if(max_edges_conic(current) > 0.25) //distance of .5 (cover no more than half the pixel)
+               {
+                       Subd_Conic_Stack(current);
+                       current += 2;           //cursor on second curve
+                       level ++;
+                       num ++;
+                       onsecond = false;
+               }
+               else    //NOT TOO BIG? RENDER!!!
+               {
+                       //cur_x,cur_y = current[2], so we need to go 1,0
+                       line_to(current[1][0],current[1][1]);
+                       line_to(current[0][0],current[0][1]);
+                       
+                       current -= 2;
+                       if(onsecond) level--;
+                       num--;
+                       onsecond = true;
+               }
+       }
+}
+
+void Layer_Shape::PolySpan::cubic_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y)
+{
+       Point *current = arc;
+       int             num = 0;
+       int             level = 0;
+       bool    onsecond = false;
+       
+       arc[0] = Point(x,y);
+       arc[1] = Point(x2,y2);
+       arc[2] = Point(x1,y1);
+       arc[3] = Point(cur_x,cur_y);
+       
+       //just draw the line if it's outside
+       if(clip_cubic(arc,window))
+       {
+               line_to(x,y);
+               return;
+       }
+       
+       //Ok so it's not super degenerate, subdivide and draw (run through minimum subdivision levels first)
+       while(current >= arc) //once current goes below arc, there are no more curves left
+       {
+               if(num >= MAX_SUBDIVISION_SIZE)
+               {
+                       warning("Curve subdivision somehow ran out of space while tesselating!");
+                       
+                       //do something...
+                       assert(0);
+                       return;
+               }else
+               
+               //if we are not at the level minimum 
+               if(level < MIN_SUBDIVISION_DRAW_LEVELS)
+               {
+                       Subd_Cubic_Stack(current);
+                       current += 3;           //cursor on second curve
+                       level ++;
+                       num ++;
+                       onsecond = false;
+                       continue;
+               }else
+               //if the curve is clipping then draw degenerate
+               if(clip_cubic(current,window))
+               {
+                       line_to(current[0][0],current[0][1]); //backwards so front is destination
+                       current -= 3;
+                       if(onsecond) level--;
+                       onsecond = true;
+                       num --;
+                       continue;
+               }               
+               else
+               //split it again, if it's too big
+               if(max_edges_cubic(current) > 0.25) //could use max_edges<3>
+               {
+                       Subd_Cubic_Stack(current);
+                       current += 3;           //cursor on second curve
+                       level ++;
+                       num ++;
+                       onsecond = false;
+               }
+               else //NOT TOO BIG? RENDER!!!
+               {
+                       //cur_x,cur_y = current[3], so we need to go 2,1,0
+                       line_to(current[2][0],current[2][1]);
+                       line_to(current[1][0],current[1][1]);
+                       line_to(current[0][0],current[0][1]);
+                       
+                       current -= 3;
+                       if(onsecond) level--;
+                       num --;
+                       onsecond = true;
+               }
+       }       
+}
+
+//******************** LINE ALGORITHMS ****************************
+// THESE CALCULATE THE AREA AND THE COVER FOR THE MARKS, TO THEN SCAN CONVERT 
+// - BROKEN UP INTO SCANLINES (draw_line - y intersections), 
+//   THEN THE COVER AND AREA PER TOUCHED PIXEL IS CALCULATED (draw_scanline - x intersections)
+void Layer_Shape::PolySpan::draw_scanline(int y, Real x1, Real fy1, Real x2, Real fy2)
+{
+       int     ix1 = (int)floor(x1);
+       int     ix2 = (int)floor(x2);
+       Real fx1 = x1 - ix1;
+       Real fx2 = x2 - ix2;
+       
+       Real dx,dy,dydx,mult;
+       
+       dx = x2 - x1;
+       dy = fy2 - fy1;
+       
+       //case horizontal line
+       if(fy1 == fy2)
+       {
+               move_pen(ix2,y); //pen needs to be at the last coord
+               return;
+       }
+       
+       //case all in same pixel
+       if(ix1 == ix2)  //impossible for degenerate case (covered by the previous cases)
+       {
+               current.addcover(dy,(fx1 + fx2)*dy/2); //horizontal trapazoid area
+               return;
+       }
+
+       if(dx > 0)
+       {
+               // ---->        fx1...1  0...1  ...  0...1  0...fx2
+               dydx = dy / dx;
+               
+               //set initial values
+               //Iterate through the covered pixels
+               mult = (1 - fx1)*dydx;  //next y intersection diff value (at 1)
+               
+               //first pixel
+               current.addcover(mult,(1 + fx1)*mult/2);        // fx1,fy1,1,fy@1 - starting trapazoidal area
+                       
+               //move to the next pixel
+               fy1 += mult;
+               ix1++;
+               
+               move_pen(ix1,y);
+               
+               //set up for whole ones
+               while(ix1 != ix2)
+               {
+                       //trapezoid(0,y1,1,y1+dydx);
+                       current.addcover(dydx,dydx/2);  //accumulated area 1/2 the cover                        
+                       
+                       //move to next pixel (+1)
+                       ix1++;
+                       fy1 += dydx;
+                       move_pen(ix1,y);
+               }
+               
+               //last pixel
+               //final y-pos - last intersect pos
+               mult = fx2 * dydx;
+               current.addcover(mult,(0+fx2)*mult/2);
+       }else
+       {
+               // fx2...1  0...1  ...  0...1  0...fx1   <----
+               //mult = (0 - fx1) * dy / dx;
+               //neg sign sucked into dydx
+               dydx = -dy / dx;
+               
+               //set initial values
+               //Iterate through the covered pixels
+               mult = fx1*dydx;        //next y intersection diff value
+               
+               //first pixel
+               current.addcover(mult,fx1*mult/2);      // fx1,fy1,0,fy@0 - starting trapazoidal area
+               
+               //move to next pixel
+               fy1 += mult;
+               ix1--;
+               
+               move_pen(ix1,y);
+               
+               //set up for whole ones
+               while(ix1 != ix2)
+               {
+                       //trapezoid(0,y1,1,y1+dydx);
+                       current.addcover(dydx,dydx/2);  //accumulated area 1/2 the cover                        
+                       
+                       //move to next pixel (-1)
+                       fy1 += dydx;
+                       ix1--;
+                       move_pen(ix1,y);
+               }
+               
+               //last pixel
+               mult = fy2 - fy1; //final y-pos - last intersect pos
+               
+               current.addcover(mult,(fx2+1)*mult/2);
+       }
+}
+
+void Layer_Shape::PolySpan::draw_line(Real x1, Real y1, Real x2, Real y2)
+{
+       int iy1 = (int)floor(y1);
+       int iy2 = (int)floor(y2);
+       Real fy1 = y1 - iy1;
+       Real fy2 = y2 - iy2;
+
+       assert(!isnan(fy1));
+       assert(!isnan(fy2));
+       
+       Real dx,dy,dxdy,mult,x_from,x_to;
+       
+       const Real SLOPE_EPSILON = 1e-10;
+       
+       //case all one scanline
+       if(iy1 == iy2)
+       {
+               draw_scanline(iy1,x1,y1,x2,y2);
+               return;
+       }
+       
+       //difference values
+       dy = y2 - y1;
+       dx = x2 - x1;   
+       
+       //case vertical line
+       if(dx < SLOPE_EPSILON && dx > -SLOPE_EPSILON)
+       {
+               //calc area and cover on vertical line          
+               if(dy > 0)
+               {
+                       // ---->        fx1...1  0...1  ...  0...1  0...fx2
+                       Real sub;
+                                               
+                       int      ix1 = (int)floor(x1);
+                       Real fx1 = x1 - ix1;
+                       
+                       //current pixel
+                       sub = 1 - fy1;
+                       
+                       current.addcover(sub,fx1*sub);
+               
+                       //next pixel
+                       iy1++;
+
+                       //move pen to next pixel
+                       move_pen(ix1,iy1);
+                                               
+                       while(iy1 != iy2)
+                       {                                       
+                               //accumulate cover
+                               current.addcover(1,fx1);
+                               
+                               //next pixel
+                               iy1++;
+                               move_pen(ix1,iy1);
+                       }
+                       
+                       //last pixel
+                       current.addcover(fy2,fy2*fx1);
+               }else
+               {
+                       Real sub;
+                                               
+                       int      ix1 = (int)floor(x1);
+                       Real fx1 = x1 - ix1;
+                       
+                       //current pixel
+                       sub = 0 - fy1;
+                       
+                       current.addcover(sub,fx1*sub);
+               
+                       //next pixel
+                       iy1--;
+                       
+                       move_pen(ix1,iy1);
+                       
+                       while(iy1 != iy2)
+                       {
+                               //accumulate in current pixel
+                               current.addcover(-1,-fx1);
+                               
+                               //move to next
+                               iy1--;
+                               move_pen(ix1,iy1);
+                       }
+                       
+                       current.addcover(fy2-1,(fy2-1)*fx1);
+               }
+               return;
+       }
+
+       //case normal line - guaranteed dx != 0 && dy != 0
+       
+       //calculate the initial intersection with "next" scanline
+       if(dy > 0)
+       {
+               dxdy = dx / dy;
+               
+               mult = (1 - fy1) * dxdy;
+               
+               //x interset scanline           
+               x_from = x1 + mult;
+               draw_scanline(iy1,x1,fy1,x_from,1);
+       
+               //move to next line
+               iy1++;
+               
+               move_pen((int)floor(x_from),iy1);
+               
+               while(iy1 != iy2)
+               {
+                       //keep up on the x axis, and render the current scanline
+                       x_to = x_from + dxdy;
+                       draw_scanline(iy1,x_from,0,x_to,1);
+                       x_from = x_to;
+                       
+                       //move to next pixel
+                       iy1++;
+                       move_pen((int)floor(x_from),iy1);
+               }
+               
+               //draw the last one, fractional
+               draw_scanline(iy2,x_from,0,x2,fy2);
+               
+       }else
+       {
+               dxdy = -dx / dy;
+               
+               mult = fy1 * dxdy;
+               
+               //x interset scanline
+               x_from = x1 + mult;
+               draw_scanline(iy1,x1,fy1,x_from,0);
+               
+               //each line after
+               iy1--;
+               
+               move_pen((int)floor(x_from),iy1);
+               
+               while(iy1 != iy2)
+               {
+                       x_to = x_from + dxdy;
+                       draw_scanline(iy1,x_from,1,x_to,0);
+                       x_from = x_to;
+                       
+                       iy1--;
+                       move_pen((int)floor(x_from),iy1);
+               }
+               //draw the last one, fractional
+               draw_scanline(iy2,x_from,1,x2,fy2);
+       }
+}
+
+//****** LAYER PEN OPERATIONS (move_to, line_to, etc.) ******
+void Layer_Shape::move_to(Real x, Real y)
+{
+       //const int sizeblock = sizeof(Primitive)+sizeof(Point);
+       Primitive       op;
+       Point           p(x,y);
+       
+       op.operation = Primitive::MOVE_TO;
+       op.number = 1;  //one point for now
+       
+       if(lastbyteop == Primitive::MOVE_TO)
+       {
+               char *ptr = &bytestream[lastoppos];
+               memcpy(ptr,&op,sizeof(op));
+               memcpy(ptr+sizeof(op),&p,sizeof(p));
+       }
+       else //make a new op
+       {
+               lastbyteop = Primitive::MOVE_TO;
+               lastoppos = bytestream.size();
+               
+               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
+       }
+       
+       edge_table->move_to(x,y);
+}
+
+void Layer_Shape::close()
+{
+       Primitive op;
+       
+       op.operation = Primitive::CLOSE;
+       op.number = 0;
+       
+       if(lastbyteop == Primitive::CLOSE)
+       {
+       }else
+       {
+               lastbyteop = Primitive::CLOSE;
+               lastoppos = bytestream.size();
+               
+               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1)); //insert header
+       }
+       
+       edge_table->close();
+       //should not affect the bounding box since it would just be returning to old point...
+}
+
+void Layer_Shape::endpath()
+{
+       Primitive op;
+       
+       op.operation = Primitive::END;
+       op.number = 0;
+       
+       if(lastbyteop == Primitive::END | lastbyteop == Primitive::NONE)
+       {
+       }else
+       {
+               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));
+       }
+       //should not affect the bounding box since it would just be returning to old point... if at all
+}
+
+void Layer_Shape::line_to(Real x, Real y)
+{
+       assert(!isnan(x));
+       assert(!isnan(y));
+       
+       //const int sizeblock = sizeof(Primitive)+sizeof(Point);
+       Primitive       op;
+       Point           p(x,y);
+       
+       op.operation = Primitive::LINE_TO;
+       op.number = 1;  //one point for now
+       
+       if(lastbyteop == Primitive::MOVE_TO | lastbyteop == Primitive::LINE_TO)
+       {
+               //only need to insert the point
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
+               
+               Primitive * prim = (Primitive *)&bytestream[lastoppos];
+               prim->number++; //increment number of points in the list
+       }else
+       {
+               lastbyteop = Primitive::LINE_TO;
+               lastoppos = bytestream.size();
+               
+               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
+       }
+       
+       edge_table->line_to(x,y);
+}
+
+void Layer_Shape::conic_to(Real x1, Real y1, Real x, Real y)
+{
+       //const int sizeblock = sizeof(Primitive)+sizeof(Point)*2;
+       Primitive       op;
+       Point           p(x,y);
+       Point           p1(x1,y1);
+       
+       op.operation = Primitive::CONIC_TO;
+       op.number = 2;  //2 points for now
+       
+       if(lastbyteop == Primitive::CONIC_TO)
+       {
+               //only need to insert the new points
+               bytestream.insert(bytestream.end(),(char*)&p1,(char*)(&p1+1));
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
+               
+               Primitive * prim = (Primitive *)&bytestream[lastoppos];
+               prim->number += 2; //increment number of points in the list
+       }else
+       {
+               lastbyteop = Primitive::CONIC_TO;
+               lastoppos = bytestream.size();
+               
+               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
+               bytestream.insert(bytestream.end(),(char*)&p1,(char*)(&p1+1));  //insert the bytes for data
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
+       }
+       
+       edge_table->conic_to(x1,y1,x,y);
+}
+
+void Layer_Shape::conic_to_smooth(Real x, Real y)                              //x1,y1 derived from current tangent
+{
+       //const int sizeblock = sizeof(Primitive)+sizeof(Point);
+       Primitive       op;
+       Point           p(x,y);
+       
+       op.operation = Primitive::CONIC_TO_SMOOTH;
+       op.number = 1;  //2 points for now
+       
+       if(lastbyteop == Primitive::CONIC_TO_SMOOTH)
+       {
+               //only need to insert the new point
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
+               
+               Primitive * prim = (Primitive *)&bytestream[lastoppos];
+               prim->number += 1; //increment number of points in the list
+       }else
+       {
+               lastbyteop = Primitive::CONIC_TO_SMOOTH;
+               lastoppos = bytestream.size();
+               
+               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
+       }
+       
+       edge_table->conic_to_smooth(x,y);
+}
+
+void Layer_Shape::curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y)
+{
+       //const int sizeblock = sizeof(Primitive)+sizeof(Point)*3;
+       Primitive       op;
+       Point           p(x,y);
+       Point           p1(x1,y1);
+       Point           p2(x2,y2);
+       
+       op.operation = Primitive::CUBIC_TO;
+       op.number = 3;  //3 points for now
+       
+       if(lastbyteop == Primitive::CUBIC_TO)
+       {
+               //only need to insert the new points
+               bytestream.insert(bytestream.end(),(char*)&p1,(char*)(&p1+1));
+               bytestream.insert(bytestream.end(),(char*)&p2,(char*)(&p2+1));
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
+               
+               Primitive * prim = (Primitive *)&bytestream[lastoppos];
+               prim->number += 3; //increment number of points in the list
+       }else
+       {
+               lastbyteop = Primitive::CUBIC_TO;
+               lastoppos = bytestream.size();
+               
+               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
+               bytestream.insert(bytestream.end(),(char*)&p1,(char*)(&p1+1));  //insert the bytes for data
+               bytestream.insert(bytestream.end(),(char*)&p2,(char*)(&p2+1));  //insert the bytes for data
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
+       }
+       
+       edge_table->curve_to(x1,y1,x2,y2,x,y);
+}
+
+void Layer_Shape::curve_to_smooth(Real x2, Real y2, Real x, Real y)            //x1,y1 derived from current tangent
+{
+       //const int sizeblock = sizeof(Primitive)+sizeof(Point)*3;
+       Primitive       op;
+       Point           p(x,y);
+       Point           p2(x2,y2);
+       
+       op.operation = Primitive::CUBIC_TO_SMOOTH;
+       op.number = 2;  //3 points for now
+       
+       if(lastbyteop == Primitive::CUBIC_TO_SMOOTH)
+       {
+               //only need to insert the new points
+               bytestream.insert(bytestream.end(),(char*)&p2,(char*)(&p2+1));
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));
+               
+               Primitive * prim = (Primitive *)&bytestream[lastoppos];
+               prim->number += 2; //increment number of points in the list
+       }else
+       {
+               lastbyteop = Primitive::CUBIC_TO_SMOOTH;
+               lastoppos = bytestream.size();
+               
+               bytestream.insert(bytestream.end(),(char*)&op,(char*)(&op+1));  //insert the bytes for the header
+               bytestream.insert(bytestream.end(),(char*)&p2,(char*)(&p2+1));  //insert the bytes for data
+               bytestream.insert(bytestream.end(),(char*)&p,(char*)(&p+1));    //insert the bytes for data
+       }
+}
+
+// ACCELERATED RENDER FUNCTION - TRANSLATE BYTE CODE INTO FUNCTION CALLS
+
+bool Layer_Shape::render_polyspan(Surface *surface, PolySpan &polyspan, 
+                                                               Color::BlendMethod got_blend_method, Color::value_type got_amount) const
+{
+       Surface::alpha_pen p(surface->begin(),got_amount,_BlendFunc(got_blend_method));
+       PolySpan::cover_array::iterator cur_mark = polyspan.covers.begin();
+       PolySpan::cover_array::iterator end_mark = polyspan.covers.end();
+
+       Real cover,area,alpha;
+       
+       int     y,x;
+       
+       p.set_value(color);
+       cover = 0;
+       
+       if(cur_mark == end_mark)
+       {
+               //no marks at all
+               if(invert)
+               {
+                       p.move_to(polyspan.window.minx,polyspan.window.miny);
+                       p.put_block(polyspan.window.maxy - polyspan.window.miny,polyspan.window.maxx - polyspan.window.minx);
+               }
+               return true;
+       }
+       
+       //fill initial rect / line
+       if(invert)
+       {
+               //fill all the area above the first vertex
+               p.move_to(polyspan.window.minx,polyspan.window.miny);
+               y = polyspan.window.miny;
+               int l = polyspan.window.maxx - polyspan.window.minx;
+       
+               p.put_block(cur_mark->y - polyspan.window.miny,l);
+               
+               //fill the area to the left of the first vertex on that line
+               l = cur_mark->x - polyspan.window.minx;
+               p.move_to(polyspan.window.minx,cur_mark->y);
+               if(l) p.put_hline(l);
+       }
+       
+       for(;;)
+       {
+               y = cur_mark->y;
+               x = cur_mark->x;
+               
+               p.move_to(x,y);
+               
+               area = cur_mark->area;
+               cover += cur_mark->cover;
+                       
+               //accumulate for the current pixel
+               while(++cur_mark != polyspan.covers.end())
+               {
+                       if(y != cur_mark->y | x != cur_mark->x)
+                               break;
+                       
+                       area += cur_mark->area;
+                       cover += cur_mark->cover;
+               }
+               
+               //draw pixel - based on covered area
+               if(area)        //if we're ok, draw the current pixel
+               {
+                       alpha = polyspan.ExtractAlpha(cover - area);
+                       if(invert) alpha = 1 - alpha;
+                       
+                       if(!antialias)
+                       {
+                               if(alpha >= .5) p.put_value();
+                       }
+                       else if(alpha) p.put_value_alpha(alpha);
+                       
+                       p.inc_x();
+                       x++;
+               }
+               
+               //if we're done, don't use iterator and exit
+               if(cur_mark == end_mark) break;
+                       
+               //if there is no more live pixels on this line, goto next
+               if(y != cur_mark->y)
+               {
+                       if(invert)
+                       {
+                               //fill the area at the end of the line
+                               p.put_hline(polyspan.window.maxx - x);                          
+                               
+                               //fill area at the beginning of the next line
+                               p.move_to(polyspan.window.minx,cur_mark->y);
+                               p.put_hline(cur_mark->x - polyspan.window.minx);
+                       }
+                       
+                       cover = 0;                      
+                       
+                       continue;
+               }
+               
+               //draw span to next pixel - based on total amount of pixel cover
+               if(x < cur_mark->x)
+               {                               
+                       alpha = polyspan.ExtractAlpha(cover);
+                       if(invert) alpha = 1 - alpha;
+
+                       if(!antialias)
+                       {
+                               if(alpha >= .5) p.put_hline(cur_mark->x - x);
+                       }
+                       else if(alpha) p.put_hline(cur_mark->x - x,alpha);
+               }
+       }
+       
+       //fill the after stuff
+       if(invert)
+       {
+               //fill the area at the end of the line
+               p.put_hline(polyspan.window.maxx - x);                          
+               
+               //fill area at the beginning of the next line
+               p.move_to(polyspan.window.minx,y+1);
+               p.put_block(polyspan.window.maxy - y - 1,polyspan.window.maxx - polyspan.window.minx);
+       }
+       
+       return true;
+}
+
+bool Layer_Shape::render_polyspan(etl::surface<float> *surface, PolySpan &polyspan) const
+{
+       etl::surface<float>::pen p(surface->begin());
+       PolySpan::cover_array::iterator cur_mark = polyspan.covers.begin();
+       PolySpan::cover_array::iterator end_mark = polyspan.covers.end();
+
+       Real cover,area,alpha;
+       
+       int     y,x;
+       
+       cover = 0;      
+               
+       //the pen always writes 1 (unless told to do otherwise)
+       p.set_value(1);
+       
+       if(cur_mark == end_mark)
+       {
+               //no marks at all
+               if(invert)
+               {
+                       p.move_to(polyspan.window.minx,polyspan.window.miny);
+                       p.put_block(polyspan.window.maxy - polyspan.window.miny,polyspan.window.maxx - polyspan.window.minx);
+               }
+               return true;
+       }
+       
+       //fill initial rect / line
+       if(invert)
+       {
+               //fill all the area above the first vertex
+               p.move_to(polyspan.window.minx,polyspan.window.miny);
+               y = polyspan.window.miny;
+               int l = polyspan.window.maxx - polyspan.window.minx;
+       
+               p.put_block(cur_mark->y - polyspan.window.miny,l);
+               
+               //fill the area to the left of the first vertex on that line
+               l = cur_mark->x - polyspan.window.minx;
+               p.move_to(polyspan.window.minx,cur_mark->y);
+               if(l) p.put_hline(l);
+               
+               for(;;)
+               {
+                       y = cur_mark->y;
+                       x = cur_mark->x;
+                       
+                       p.move_to(x,y);
+                       
+                       area = cur_mark->area;
+                       cover += cur_mark->cover;
+                               
+                       //accumulate for the current pixel
+                       while(++cur_mark != polyspan.covers.end())
+                       {
+                               if(y != cur_mark->y | x != cur_mark->x)
+                                       break;
+                               
+                               area += cur_mark->area;
+                               cover += cur_mark->cover;
+                       }
+                       
+                       //draw pixel - based on covered area
+                       if(area)        //if we're ok, draw the current pixel
+                       {
+                               alpha = 1 - polyspan.ExtractAlpha(cover - area);                                
+                               if(!antialias)
+                               {
+                                       if(alpha >= .5) p.put_value();
+                               }
+                               else if(alpha) p.put_value(alpha);
+                               
+                               p.inc_x();
+                               x++;
+                       }
+                       
+                       //if we're done, don't use iterator and exit
+                       if(cur_mark == end_mark) break;
+                               
+                       //if there is no more live pixels on this line, goto next
+                       if(y != cur_mark->y)
+                       {
+                               //fill the area at the end of the line
+                               p.put_hline(polyspan.window.maxx - x);
+                               
+                               //fill area at the beginning of the next line
+                               p.move_to(polyspan.window.minx,cur_mark->y);
+                               p.put_hline(cur_mark->x - polyspan.window.minx);
+                       
+                               cover = 0;                      
+                               
+                               continue;
+                       }
+                       
+                       //draw span to next pixel - based on total amount of pixel cover
+                       if(x < cur_mark->x)
+                       {                               
+                               alpha = 1 - polyspan.ExtractAlpha(cover);
+                               if(!antialias)
+                               {
+                                       if(alpha >= .5) p.put_hline(cur_mark->x - x);
+                               }
+                               else if(alpha) p.put_hline(cur_mark->x - x,alpha);
+                       }
+               }
+               
+               //fill the area at the end of the line
+               p.put_hline(polyspan.window.maxx - x);                          
+               
+               //fill area at the beginning of the next line
+               p.move_to(polyspan.window.minx,y+1);
+               p.put_block(polyspan.window.maxy - y - 1,polyspan.window.maxx - polyspan.window.minx);
+       }else
+       {
+               for(;;)
+               {
+                       y = cur_mark->y;
+                       x = cur_mark->x;
+                       
+                       p.move_to(x,y);
+                       
+                       area = cur_mark->area;
+                       cover += cur_mark->cover;
+                               
+                       //accumulate for the current pixel
+                       while(++cur_mark != polyspan.covers.end())
+                       {
+                               if(y != cur_mark->y | x != cur_mark->x)
+                                       break;
+                               
+                               area += cur_mark->area;
+                               cover += cur_mark->cover;
+                       }
+                       
+                       //draw pixel - based on covered area
+                       if(area)        //if we're ok, draw the current pixel
+                       {
+                               alpha = polyspan.ExtractAlpha(cover - area);
+                               if(!antialias)
+                               {
+                                       if(alpha >= .5) p.put_value();
+                               }
+                               else if(alpha) p.put_value(alpha);
+                               
+                               p.inc_x();
+                               x++;
+                       }
+                       
+                       //if we're done, don't use iterator and exit
+                       if(cur_mark == end_mark) break;
+                               
+                       //if there is no more live pixels on this line, goto next
+                       if(y != cur_mark->y)
+                       {                               
+                               cover = 0;                      
+                               
+                               continue;
+                       }
+                       
+                       //draw span to next pixel - based on total amount of pixel cover
+                       if(x < cur_mark->x)
+                       {                               
+                               alpha = polyspan.ExtractAlpha(cover);
+                               if(!antialias)
+                               {
+                                       if(alpha >= .5) p.put_hline(cur_mark->x - x);
+                               }
+                               else if(alpha) p.put_hline(cur_mark->x - x,alpha);
+                       }
+               }
+       }
+       
+       return true;
+}
+
+bool
+Layer_Shape::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
+{
+       const unsigned int w = renddesc.get_w();
+       const unsigned int h = renddesc.get_h();
+       
+       const Real pw = abs(renddesc.get_pw());
+       const Real ph = abs(renddesc.get_ph());
+       
+       //const Real OFFSET_EPSILON = 1e-8;
+       SuperCallback stageone(cb,1,10000,15001+renddesc.get_h());
+       SuperCallback stagetwo(cb,10000,10001+renddesc.get_h(),15001+renddesc.get_h());
+       SuperCallback stagethree(cb,10001+renddesc.get_h(),15001+renddesc.get_h(),15001+renddesc.get_h());
+       
+       // Render what is behind us
+       
+       //clip if it satisfies the invert solid thing
+       if(is_solid_color() && invert)
+       {               
+               Rect aabb = edge_table->aabb;
+               Point tl = renddesc.get_tl() - offset;
+               
+               Real    pw = renddesc.get_pw(),
+                               ph = renddesc.get_ph();
+
+               Rect    nrect;
+               
+               Real    pixelfeatherx = abs(feather/pw),
+                               pixelfeathery = abs(feather/ph);
+               
+               nrect.set_point((aabb.minx - tl[0])/pw,(aabb.miny - tl[1])/ph);
+               nrect.expand((aabb.maxx - tl[0])/pw,(aabb.maxy - tl[1])/ph);
+                               
+               RendDesc        optdesc(renddesc);
+               
+               //make sure to expand so we gain subpixels rather than lose them
+               nrect.minx = floor(nrect.minx-pixelfeatherx); nrect.miny = floor(nrect.miny-pixelfeathery);
+               nrect.maxx = ceil(nrect.maxx+pixelfeatherx); nrect.maxy = ceil(nrect.maxy+pixelfeathery);
+               
+               //make sure the subwindow is clipped with our tile window (minimize useless drawing)
+               set_intersect(nrect,nrect,Rect(0,0,renddesc.get_w(),renddesc.get_h()));
+               
+               //must resize the surface first
+               surface->set_wh(renddesc.get_w(),renddesc.get_h());
+               surface->clear();
+               
+               //only render anything if it's visible from our current tile
+               if(nrect.valid())
+               {
+                       //set the subwindow to the viewable pixels and render it to the subsurface
+                       optdesc.set_subwindow((int)nrect.minx, (int)nrect.miny,
+                               (int)(nrect.maxx - nrect.minx), (int)(nrect.maxy - nrect.miny));
+                       
+                       Surface optimizedbacksurf;
+                       if(!context.accelerated_render(&optimizedbacksurf,quality,optdesc,&stageone))
+                               return false;
+                       
+                       //blit that onto the original surface so we can pretend that nothing ever happened
+                       Surface::pen p = surface->get_pen((int)nrect.minx,(int)nrect.miny); 
+                       optimizedbacksurf.blit_to(p);
+               }
+       }else
+       {
+               if(!context.accelerated_render(surface,quality,renddesc,&stageone))
+                       return false;
+       }
+       
+       if(cb && !cb->amount_complete(10000,10001+renddesc.get_h())) return false;
+               
+       if(feather)
+       {
+               //we have to blur rather than be crappy
+               
+               //so make a separate surface
+               RendDesc        workdesc(renddesc);
+               
+               etl::surface<float>     shapesurface;
+
+               //the expanded size = 1/2 the size in each direction rounded up
+               int     halfsizex = (int) (abs(feather*.5/pw) + 3),
+                       halfsizey = (int) (abs(feather*.5/ph) + 3);
+                       
+               //expand by 1/2 size in each direction on either side
+               switch(blurtype)
+               {
+                       case Blur::DISC:
+                       case Blur::BOX:
+                       case Blur::CROSS:
+                       {
+                               workdesc.set_subwindow(-max(1,halfsizex),-max(1,halfsizey),w+2*max(1,halfsizex),h+2*max(1,halfsizey));
+                               break;
+                       }
+                       case Blur::FASTGAUSSIAN:
+                       {
+                               if(quality < 4)
+                               {
+                                       halfsizex*=2;
+                                       halfsizey*=2;
+                               }
+                               workdesc.set_subwindow(-max(1,halfsizex),-max(1,halfsizey),w+2*max(1,halfsizex),h+2*max(1,halfsizey));
+                               break;                          
+                       }
+                       case Blur::GAUSSIAN:
+                       {                               
+                       #define GAUSSIAN_ADJUSTMENT             (0.05)
+                               Real    pw = (Real)workdesc.get_w()/(workdesc.get_br()[0]-workdesc.get_tl()[0]);
+                               Real    ph = (Real)workdesc.get_h()/(workdesc.get_br()[1]-workdesc.get_tl()[1]);
+                               
+                               pw=pw*pw;
+                               ph=ph*ph;
+       
+                               halfsizex = (int)(abs(pw)*feather*GAUSSIAN_ADJUSTMENT+0.5);
+                               halfsizey = (int)(abs(ph)*feather*GAUSSIAN_ADJUSTMENT+0.5);
+       
+                               halfsizex = (halfsizex + 1)/2;
+                               halfsizey = (halfsizey + 1)/2;
+                               workdesc.set_subwindow( -halfsizex, -halfsizey, w+2*halfsizex, h+2*halfsizey );
+                                                       
+                               break;
+                       }
+               }
+               
+               shapesurface.set_wh(workdesc.get_w(),workdesc.get_h());
+               shapesurface.clear();
+               
+               //render the shape
+               if(!render_shape(&shapesurface,quality,workdesc,&stagetwo))return false;
+               
+               //blur the image
+               Blur(feather,feather,blurtype,&stagethree)(shapesurface,workdesc.get_br()-workdesc.get_tl(),shapesurface);
+               
+               //blend with stuff below it...          
+               unsigned int u = halfsizex, v = halfsizey, x = 0, y = 0;
+               for(y = 0; y < h; y++,v++)
+               {
+                       u = halfsizex;
+                       for(x = 0; x < w; x++,u++)
+                       {
+                               float a = shapesurface[v][u];
+                               if(a)
+                               {
+                                       //a = floor(a*255+0.5f)/255;
+                                       (*surface)[y][x]=Color::blend(color,(*surface)[y][x],a*get_amount(),get_blend_method());
+                               }
+                               //else (*surface)[y][x] = worksurface[v][u];
+                       }
+               }
+               
+               //we are done
+               if(cb && !cb->amount_complete(100,100))
+               {
+                       sinfg::warning("Layer_Shape: could not set amount complete");
+                       return false;
+               }
+               
+               return true;
+       }else
+       {
+               //might take out to reduce code size
+               return render_shape(surface,true,quality,renddesc,&stagetwo);
+       }
+
+}
+
+bool
+Layer_Shape::render_shape(Surface *surface,bool useblend,int quality,
+                                                       const RendDesc &renddesc, ProgressCallback *cb)const
+{
+       int tmp(0);
+       
+       SuperCallback   progress(cb,0,renddesc.get_h(),renddesc.get_h());
+               
+       // If our amount is set to zero, no need to render anything
+       if(!get_amount())
+               return true;
+       
+       //test new polygon renderer
+       // Build edge table
+       // Width and Height of a pixel
+       const int       w = renddesc.get_w();
+       const int       h = renddesc.get_h();
+       const Real      pw = renddesc.get_w()/(renddesc.get_br()[0]-renddesc.get_tl()[0]);
+       const Real      ph = renddesc.get_h()/(renddesc.get_br()[1]-renddesc.get_tl()[1]);
+       
+       const Point     tl = renddesc.get_tl();
+       
+       Vector tangent (0,0);
+               
+       PolySpan        span;
+       
+       //optimization for tesselating only inside tiles
+       span.window.minx = 0;
+       span.window.miny = 0;
+       span.window.maxx = w;
+       span.window.maxy = h;
+
+       //pointers for processing the bytestream
+       const char *current     = &bytestream[0];
+       const char *end                 = &bytestream[bytestream.size()];       
+       
+       int     operation       = Primitive::NONE;
+       int number              = 0;
+       int curnum;
+       
+       Primitive       *curprim;
+       Point           *data;
+       
+       Real x,y,x1,y1,x2,y2;
+
+
+       while(current < end)
+       {
+               tmp++;
+
+               try {
+               
+               //get the op code safely
+               curprim = (Primitive *)current;
+               
+               //advance past indices
+               current += sizeof(Primitive);
+               if(current > end)
+               {
+                       warning("Layer_Shape::accelerated_render - Error in the byte stream, not enough space for next declaration");
+                       return false;                   
+               }
+               
+               //get the relevant data
+               operation       = curprim->operation;
+               number          = curprim->number;
+               
+               if(operation == Primitive::END)
+                       break;
+               
+               if(operation == Primitive::CLOSE)
+               {
+                       if(span.notclosed())
+                       {
+                               tangent[0] = span.close_x - span.cur_x;
+                               tangent[1] = span.close_y - span.cur_y;
+                               span.close();                                           
+                       }
+                       continue;
+               }
+               
+               data = (Point*)current;
+               current += sizeof(Point)*number;
+               
+               //check data positioning
+               if(current > end)
+               {
+                       warning("Layer_Shape::accelerated_render - Error in the byte stream, in sufficient data space for declared number of points");
+                       return false;
+               }
+
+               } catch(...) { sinfg::error("Layer_Shape::render_shape()1: Caught an exception after %d loops, rethrowing...", tmp); throw; }
+
+               //transfer all the data - RLE optimized
+               for(curnum=0; curnum < number;)
+               {                       
+                       switch(operation)
+                       {
+                               case Primitive::MOVE_TO:
+                               {
+                                       x = data[curnum][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       if(curnum == 0)
+                                       {
+                                               span.move_to(x,y);
+                                               
+                                               tangent[0] = 0;
+                                               tangent[1] = 0;
+                                       }
+                                       else
+                                       {
+                                               tangent[0] = x - span.cur_x;
+                                               tangent[1] = y - span.cur_y;
+                                               
+                                               span.line_to(x,y);
+                                       }
+                                       
+                                       curnum++; //only advance one point
+                                       
+                                       break;
+                               }
+                               
+                               case Primitive::LINE_TO:
+                               {
+                                       x = data[curnum][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       tangent[0] = x - span.cur_x;
+                                       tangent[1] = y - span.cur_y;
+                                       
+                                       span.line_to(x,y);
+                                       curnum++;
+                                       break;
+                               }
+                               
+                               case Primitive::CONIC_TO:
+                               {
+                                       x = data[curnum+1][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum+1][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       x1 = data[curnum][0];
+                                       x1 = (x1 - tl[0] + offset[0])*pw;
+                                       y1 = data[curnum][1];
+                                       y1 = (y1 - tl[1] + offset[1])*ph;
+                                       
+                                       tangent[0] = 2*(x - x1);
+                                       tangent[1] = 2*(y - y1);
+                                       
+                                       span.conic_to(x1,y1,x,y);
+                                       curnum += 2;
+                                       break;
+                               }
+                               
+                               case Primitive::CONIC_TO_SMOOTH:
+                               {
+                                       x = data[curnum][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       x1 = span.cur_x + tangent[0]/2;
+                                       y1 = span.cur_y + tangent[1]/2;
+
+                                       tangent[0] = 2*(x - x1);
+                                       tangent[1] = 2*(y - y1);
+                                       
+                                       span.conic_to(x1,y1,x,y);
+                                       curnum ++;
+                                       
+                                       break;
+                               }
+                               
+                               case Primitive::CUBIC_TO:
+                               {
+                                       x = data[curnum+2][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum+2][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       x2 = data[curnum+1][0];
+                                       x2 = (x2 - tl[0] + offset[0])*pw;
+                                       y2 = data[curnum+1][1];
+                                       y2 = (y2 - tl[1] + offset[1])*ph;
+                                       
+                                       x1 = data[curnum][0];
+                                       x1 = (x1 - tl[0] + offset[0])*pw;
+                                       y1 = data[curnum][1];
+                                       y1 = (y1 - tl[1] + offset[1])*ph;
+                                       
+                                       tangent[0] = 2*(x - x2);
+                                       tangent[1] = 2*(y - y2);
+                                       
+                                       span.cubic_to(x1,y1,x2,y2,x,y);
+                                       curnum += 3;
+                                       
+                                       break;
+                               }
+                               
+                               case Primitive::CUBIC_TO_SMOOTH:
+                               {
+                                       x = data[curnum+1][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum+1][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       x2 = data[curnum][0];
+                                       x2 = (x2 - tl[0] + offset[0])*pw;
+                                       y2 = data[curnum][1];
+                                       y2 = (y2 - tl[1] + offset[1])*ph;
+                                       
+                                       x1 = span.cur_x + tangent[0]/3.0;                                       
+                                       y1 = span.cur_y + tangent[1]/3.0;
+                                       
+                                       tangent[0] = 2*(x - x2);
+                                       tangent[1] = 2*(y - y2);
+                                       
+                                       span.cubic_to(x1,y1,x2,y2,x,y);
+                                       curnum += 2;
+                                       
+                                       break;
+                               }
+                       }
+               }
+       }
+       
+       //sort the bastards so we can render everything
+       span.sort_marks();
+       
+       return render_polyspan(surface, span, 
+                       useblend?get_blend_method():Color::BLEND_STRAIGHT, 
+                       useblend?get_amount():1.0);
+}
+
+bool
+Layer_Shape::render_shape(surface<float> *surface,int quality,
+                                                       const RendDesc &renddesc, ProgressCallback *cb)const
+{
+       // If our amount is set to zero, no need to render anything
+       if(!get_amount())
+               return true;
+       
+       //test new polygon renderer
+       // Build edge table
+       // Width and Height of a pixel
+       const int       w = renddesc.get_w();
+       const int       h = renddesc.get_h();
+       const Real      pw = renddesc.get_w()/(renddesc.get_br()[0]-renddesc.get_tl()[0]);
+       const Real      ph = renddesc.get_h()/(renddesc.get_br()[1]-renddesc.get_tl()[1]);
+       
+       const Point     tl = renddesc.get_tl();
+       
+       Vector tangent (0,0);
+               
+       PolySpan        span;
+       
+       //optimization for tesselating only inside tiles
+       span.window.minx = 0;
+       span.window.miny = 0;
+       span.window.maxx = w;
+       span.window.maxy = h;
+
+       //pointers for processing the bytestream
+       const char *current     = &bytestream[0];
+       const char *end                 = &bytestream[bytestream.size()];       
+       
+       int     operation       = Primitive::NONE;
+       int number              = 0;
+       int curnum;
+       
+       Primitive       *curprim;
+       Point           *data;
+       
+       Real x,y,x1,y1,x2,y2;
+       
+       while(current < end)
+       {
+               //get the op code safely
+               curprim = (Primitive *)current;
+               
+               //advance past indices
+               current += sizeof(Primitive);
+               if(current > end)
+               {
+                       warning("Layer_Shape::accelerated_render - Error in the byte stream, not enough space for next declaration");
+                       return false;                   
+               }
+               
+               //get the relevant data
+               operation       = curprim->operation;
+               number          = curprim->number;
+               
+               if(operation == Primitive::END)
+                       break;
+               
+               if(operation == Primitive::CLOSE)
+               {
+                       if(span.notclosed())
+                       {
+                               tangent[0] = span.close_x - span.cur_x;
+                               tangent[1] = span.close_y - span.cur_y;
+                               span.close();                                           
+                       }
+                       continue;
+               }
+               
+               data = (Point*)current;
+               current += sizeof(Point)*number;
+               
+               //check data positioning
+               if(current > end)
+               {
+                       warning("Layer_Shape::accelerated_render - Error in the byte stream, in sufficient data space for declared number of points");
+                       return false;
+               }
+
+               //transfer all the data
+               for(curnum=0; curnum < number;)
+               {                       
+                       switch(operation)
+                       {
+                               case Primitive::MOVE_TO:
+                               {
+                                       x = data[curnum][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       if(curnum == 0)
+                                       {
+                                               span.move_to(x,y);
+                                               
+                                               tangent[0] = 0;
+                                               tangent[1] = 0;
+                                       }
+                                       else
+                                       {
+                                               tangent[0] = x - span.cur_x;
+                                               tangent[1] = y - span.cur_y;
+                                               
+                                               span.line_to(x,y);
+                                       }
+                                       
+                                       curnum++; //only advance one point
+                                       
+                                       break;
+                               }
+                               
+                               case Primitive::LINE_TO:
+                               {
+                                       x = data[curnum][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       tangent[0] = x - span.cur_x;
+                                       tangent[1] = y - span.cur_y;
+                                       
+                                       span.line_to(x,y);
+                                       curnum++;
+                                       break;
+                               }
+                               
+                               case Primitive::CONIC_TO:
+                               {
+                                       x = data[curnum+1][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum+1][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       x1 = data[curnum][0];
+                                       x1 = (x1 - tl[0] + offset[0])*pw;
+                                       y1 = data[curnum][1];
+                                       y1 = (y1 - tl[1] + offset[1])*ph;
+                                       
+                                       tangent[0] = 2*(x - x1);
+                                       tangent[1] = 2*(y - y1);
+                                       
+                                       span.conic_to(x1,y1,x,y);
+                                       curnum += 2;
+                                       break;
+                               }
+                               
+                               case Primitive::CONIC_TO_SMOOTH:
+                               {
+                                       x = data[curnum][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       x1 = span.cur_x + tangent[0]/2;
+                                       y1 = span.cur_y + tangent[1]/2;
+
+                                       tangent[0] = 2*(x - x1);
+                                       tangent[1] = 2*(y - y1);
+                                       
+                                       span.conic_to(x1,y1,x,y);
+                                       curnum ++;
+                                       
+                                       break;
+                               }
+                               
+                               case Primitive::CUBIC_TO:
+                               {
+                                       x = data[curnum+2][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum+2][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       x2 = data[curnum+1][0];
+                                       x2 = (x2 - tl[0] + offset[0])*pw;
+                                       y2 = data[curnum+1][1];
+                                       y2 = (y2 - tl[1] + offset[1])*ph;
+                                       
+                                       x1 = data[curnum][0];
+                                       x1 = (x1 - tl[0] + offset[0])*pw;
+                                       y1 = data[curnum][1];
+                                       y1 = (y1 - tl[1] + offset[1])*ph;
+                                       
+                                       tangent[0] = 2*(x - x2);
+                                       tangent[1] = 2*(y - y2);
+                                       
+                                       span.cubic_to(x1,y1,x2,y2,x,y);
+                                       curnum += 3;
+                                       
+                                       break;
+                               }
+                               
+                               case Primitive::CUBIC_TO_SMOOTH:
+                               {
+                                       x = data[curnum+1][0];
+                                       x = (x - tl[0] + offset[0])*pw;
+                                       y = data[curnum+1][1];
+                                       y = (y - tl[1] + offset[1])*ph;
+                                       
+                                       x2 = data[curnum][0];
+                                       x2 = (x2 - tl[0] + offset[0])*pw;
+                                       y2 = data[curnum][1];
+                                       y2 = (y2 - tl[1] + offset[1])*ph;
+                                       
+                                       x1 = span.cur_x + tangent[0]/3.0;                                       
+                                       y1 = span.cur_y + tangent[1]/3.0;
+                                       
+                                       tangent[0] = 2*(x - x2);
+                                       tangent[1] = 2*(y - y2);
+                                       
+                                       span.cubic_to(x1,y1,x2,y2,x,y);
+                                       curnum += 2;
+                                       
+                                       break;
+                               }
+                       }
+               }
+       }
+       
+       //sort the bastards so we can render everything
+       span.sort_marks();
+       
+       return render_polyspan(surface, span);
+}
+
+Rect
+Layer_Shape::get_bounding_rect()const
+{
+       if(invert)
+               return Rect::full_plane();
+
+       Rect bounds(edge_table->aabb+offset);
+       bounds.expand(max((bounds.get_min()-bounds.get_max()).mag()*0.01,feather));
+       
+       
+       return bounds;
+}
diff --git a/synfig-core/trunk/src/synfig/layer_shape.h b/synfig-core/trunk/src/synfig/layer_shape.h
new file mode 100644 (file)
index 0000000..f88a894
--- /dev/null
@@ -0,0 +1,117 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_shape.h
+**     \brief Template Header
+**
+**     $Id: layer_shape.h,v 1.2 2005/01/24 03:08:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_SHAPE_H
+#define __SINFG_LAYER_SHAPE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "layer_composite.h"
+#include "color.h"
+#include "vector.h"
+#include "blur.h"
+
+#include <vector>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+/*!    \class Layer_Shape
+**     \beief writeme                  */
+class Layer_Shape : public Layer_Composite, public Layer_NoDeform
+{
+       SINFG_LAYER_MODULE_EXT
+       
+private:
+       
+       //internal cacheing
+       struct Intersector;
+       Intersector     *edge_table;
+       
+       //exported data
+       Color                                   color;
+       
+       Point   offset;
+       bool    invert;
+       bool    antialias;
+       
+       int             blurtype;
+       Real    feather;
+       
+       std::vector< char >     bytestream;
+       
+       //for use in creating the bytestream
+       int                                             lastbyteop;
+       int                                             lastoppos;
+
+protected:
+
+       Layer_Shape(const Real &a = 1.0, const Color::BlendMethod m = Color::BLEND_COMPOSITE);
+
+public:
+
+       ~Layer_Shape();
+
+       //! Clears out any data
+       /*!     Also clears out the Intersector
+       */
+       void clear();
+       //void sync();
+
+       void move_to(Real x, Real y);
+       void line_to(Real x, Real y);
+       void conic_to(Real x1, Real y1, Real x, Real y);
+       void conic_to_smooth(Real x, Real y);                           //x1,y1 derived from current tangent
+       void curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y);
+       void curve_to_smooth(Real x2, Real y2, Real x, Real y); //x1,y1 derived from current tangent
+       void close();
+       void endpath();
+
+       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
+       virtual ValueBase get_param(const String & param)const;
+       
+       virtual Vocab get_param_vocab()const;
+
+       virtual Color get_color(Context context, const Point &pos)const;
+       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
+       virtual sinfg::Layer::Handle hit_check(sinfg::Context context, const sinfg::Point &point)const;
+       virtual Rect get_bounding_rect()const;
+
+private:
+       class           PolySpan;
+       bool render_polyspan(Surface *surface,PolySpan &polyspan,
+                                               Color::BlendMethod method,Color::value_type amount)const;
+       bool render_polyspan(etl::surface<float> *surface,PolySpan &polyspan)const;
+       virtual bool render_shape(Surface *surface,bool useblend,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
+       virtual bool render_shape(etl::surface<float> *surface,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
+}; // END of Layer_Shape
+
+}; // END of namespace sinfg
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/layer_solidcolor.cpp b/synfig-core/trunk/src/synfig/layer_solidcolor.cpp
new file mode 100644 (file)
index 0000000..ca895c9
--- /dev/null
@@ -0,0 +1,165 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_solidcolor.cpp
+**     \brief Template Header
+**
+**     $Id: layer_solidcolor.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "layer_solidcolor.h"
+#include "string.h"
+#include "time.h"
+#include "context.h"
+#include "paramdesc.h"
+#include "renddesc.h"
+#include "surface.h"
+#include "value.h"
+#include "valuenode.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace etl;
+using namespace std;
+using namespace sinfg;
+
+/* === G L O B A L S ======================================================= */
+
+SINFG_LAYER_INIT(Layer_SolidColor);
+SINFG_LAYER_SET_NAME(Layer_SolidColor,"SolidColor");
+SINFG_LAYER_SET_LOCAL_NAME(Layer_SolidColor,_("Solid Color"));
+SINFG_LAYER_SET_CATEGORY(Layer_SolidColor,_("Geometry"));
+SINFG_LAYER_SET_VERSION(Layer_SolidColor,"0.1");
+SINFG_LAYER_SET_CVS_ID(Layer_SolidColor,"$Id: layer_solidcolor.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $");
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+/* === E N T R Y P O I N T ================================================= */
+
+Layer_SolidColor::Layer_SolidColor():
+       Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+       color(Color::black())
+{
+}
+       
+bool
+Layer_SolidColor::set_param(const String & param, const ValueBase &value)
+{
+       IMPORT(color);
+       
+       return Layer_Composite::set_param(param,value);
+}
+
+ValueBase
+Layer_SolidColor::get_param(const String &param)const
+{
+       EXPORT(color);
+
+       EXPORT_NAME();
+       EXPORT_VERSION();
+               
+       return Layer_Composite::get_param(param);       
+}
+
+Layer::Vocab
+Layer_SolidColor::get_param_vocab()const
+{
+       Layer::Vocab ret(Layer_Composite::get_param_vocab());
+       
+       ret.push_back(ParamDesc("color")
+               .set_local_name(_("Color"))
+       );
+       
+       return ret;
+}
+
+sinfg::Layer::Handle
+Layer_SolidColor::hit_check(sinfg::Context context, const sinfg::Point &point)const
+{
+       if(get_blend_method()==Color::BLEND_STRAIGHT && get_amount()>=0.5)
+               return const_cast<Layer_SolidColor*>(this);
+       else
+       if(get_blend_method()==Color::BLEND_COMPOSITE && get_amount()*color.get_a()>=0.5)
+               return const_cast<Layer_SolidColor*>(this);
+       
+       Layer::Handle layer(context.hit_check(point));
+       
+       return layer?layer:const_cast<Layer_SolidColor*>(this);
+}
+
+Color
+Layer_SolidColor::get_color(Context context, const Point &pos)const
+{
+       if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+               return color;
+       else
+               return Color::blend(color,context.get_color(pos),get_amount(),get_blend_method());
+}
+       
+bool
+Layer_SolidColor::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
+{
+       if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT)
+       {
+               // Mark our progress as starting
+               if(cb && !cb->amount_complete(0,1000))
+                       return false;
+               
+               surface->set_wh(renddesc.get_w(),renddesc.get_h());
+               surface->fill(color);
+
+               // Mark our progress as finished
+               if(cb && !cb->amount_complete(1000,1000))
+                       return false;
+
+               return true;
+       }
+
+       SuperCallback supercb(cb,0,9500,10000);
+
+       if(!context.accelerated_render(surface,quality,renddesc,&supercb))
+               return false;
+
+       int x,y;
+
+       Surface::alpha_pen apen(surface->begin());
+
+       apen.set_value(color);
+       apen.set_alpha(get_amount());
+       apen.set_blend_method(get_blend_method());
+
+       for(y=0;y<renddesc.get_h();y++,apen.inc_y(),apen.dec_x(x))
+               for(x=0;x<renddesc.get_w();x++,apen.inc_x())
+                       apen.put_value();
+
+       // Mark our progress as finished
+       if(cb && !cb->amount_complete(10000,10000))
+               return false;
+
+       return true;
+}
diff --git a/synfig-core/trunk/src/synfig/layer_solidcolor.h b/synfig-core/trunk/src/synfig/layer_solidcolor.h
new file mode 100644 (file)
index 0000000..07f8106
--- /dev/null
@@ -0,0 +1,70 @@
+/* === S I N F G =========================================================== */
+/*!    \file layer_solidcolor.h
+**     \brief Template Header
+**
+**     $Id: layer_solidcolor.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_SOLIDCOLOR_H
+#define __SINFG_LAYER_SOLIDCOLOR_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "layer_composite.h"
+#include "color.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Layer_SolidColor : public Layer_Composite, public Layer_NoDeform
+{
+       SINFG_LAYER_MODULE_EXT
+       
+private:
+
+       Color color;
+
+public:
+       
+       Layer_SolidColor();
+       
+       virtual bool set_param(const String & param, const sinfg::ValueBase &value);
+
+       virtual ValueBase get_param(const String & param)const;
+
+       virtual Color get_color(Context context, const Point &pos)const;
+       
+       virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
+       
+       virtual Vocab get_param_vocab()const;
+
+       virtual sinfg::Layer::Handle hit_check(sinfg::Context context, const sinfg::Point &point)const;
+
+}; // END of class Layer_SolidColor
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/listimporter.cpp b/synfig-core/trunk/src/synfig/listimporter.cpp
new file mode 100644 (file)
index 0000000..b138d66
--- /dev/null
@@ -0,0 +1,167 @@
+/* === S I N F G =========================================================== */
+/*!    \file listimporter.cpp
+**     \brief Template File
+**
+**     $Id: listimporter.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "listimporter.h"
+#include "general.h"
+#include <fstream>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+#define LIST_IMPORTER_CACHE_SIZE       20
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ListImporter::ListImporter(const String &filename)
+{
+       fps=15;
+
+       ifstream stream(filename.c_str());
+
+       if(!stream)
+       {
+               sinfg::error("Unable to open "+filename);
+               return;
+       }
+       String line;
+       String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPERATOR;
+       while(!stream.eof())
+       {
+               getline(stream,line);
+               if(line.empty())
+                       continue;
+               // If we have a framerate, then use it
+               if(line.find(String("FPS "))==0)
+               {
+                       fps=atof(String(line.begin()+4,line.end()).c_str());
+                       //sinfg::warning("FPS=%f",fps);
+                       if(!fps)
+                               fps=15;
+                       continue;
+               }
+               filename_list.push_back(prefix+line);
+       }
+}
+
+Importer*
+ListImporter::create(const char *filename)
+{
+       return new ListImporter(filename);
+}
+
+ListImporter::~ListImporter()
+{
+}
+
+bool
+ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
+{
+//                     DEBUGPOINT();
+       int frame=static_cast<int>(time*fps);
+//                     DEBUGPOINT();
+       
+       if(!filename_list.size())
+       {
+               if(cb)cb->error(_("No images in list"));
+               else sinfg::error(_("No images in list"));
+               return false;
+       }
+       
+//                     DEBUGPOINT();
+       if(frame<0)frame=0;
+       if(frame>=(signed)filename_list.size())frame=filename_list.size()-1;
+       
+//                     DEBUGPOINT();
+       // See if that frame is cached
+       std::list<std::pair<int,Surface> >::iterator iter;
+       for(iter=frame_cache.begin();iter!=frame_cache.end();++iter)
+       {
+               if(iter->first==frame)
+               {
+//                     DEBUGPOINT();
+                       surface.mirror(iter->second);
+                       return static_cast<bool>(surface);
+               }
+       }
+               
+       Importer::Handle importer(Importer::open(filename_list[frame]));
+       
+//     DEBUGPOINT();
+
+       if(!importer)
+       {
+               if(cb)cb->error(_("Unable to open ")+filename_list[frame]);
+               else sinfg::error(_("Unable to open ")+filename_list[frame]);
+               return false;
+       }
+       
+//     DEBUGPOINT();
+
+       if(!importer->get_frame(surface,0,cb))
+       {
+               if(cb)cb->error(_("Unable to get frame from ")+filename_list[frame]);
+               else sinfg::error(_("Unable to get frame from ")+filename_list[frame]);
+               return false;
+       }
+               
+//     DEBUGPOINT();
+
+       if(frame_cache.size()>=LIST_IMPORTER_CACHE_SIZE)
+               frame_cache.pop_front();
+
+//     DEBUGPOINT();
+
+       frame_cache.push_back(std::pair<int,Surface>(frame,surface));   
+
+//     DEBUGPOINT();
+
+       surface.mirror(frame_cache.back().second);
+
+//     DEBUGPOINT();
+
+       return static_cast<bool>(surface);
+}
+
+bool
+ListImporter::is_animated()
+{
+       return true;
+}
diff --git a/synfig-core/trunk/src/synfig/listimporter.h b/synfig-core/trunk/src/synfig/listimporter.h
new file mode 100644 (file)
index 0000000..3af78e1
--- /dev/null
@@ -0,0 +1,71 @@
+/* === S I N F G =========================================================== */
+/*!    \file listimporter.h
+**     \brief Template Header
+**
+**     $Id: listimporter.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LISTIMPORTER_H
+#define __SINFG_LISTIMPORTER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "importer.h"
+#include "surface.h"
+#include <ETL/smart_ptr>
+#include <vector>
+//#include <deque>
+#include <list>
+#include <utility>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class ListImporter
+**     \todo Write more detailed description
+*/
+class ListImporter : public Importer
+{
+       float fps;
+       std::vector<String> filename_list;
+       std::list<std::pair<int,Surface> > frame_cache;
+protected:
+       ListImporter(const String &filename);
+
+public:
+
+       virtual ~ListImporter();
+
+       virtual bool get_frame(Surface &surface,Time time, ProgressCallback *callback=NULL);
+
+       virtual bool is_animated();
+
+       static Importer* create(const char *filename);
+};
+       
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/loadcanvas.cpp b/synfig-core/trunk/src/synfig/loadcanvas.cpp
new file mode 100644 (file)
index 0000000..8f1fd68
--- /dev/null
@@ -0,0 +1,2364 @@
+/* === S I N F G =========================================================== */
+/*!    \file loadcanvas.cpp
+**     \brief writeme
+**
+**     $Id: loadcanvas.cpp,v 1.3 2005/01/04 23:40:44 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
+#include <ETL/stringf>
+#include <libxml++/libxml++.h>
+#include <vector>
+#include <stdexcept>
+#include <iostream>
+
+#include "loadcanvas.h"
+#include "valuenode.h"
+#include "valuenode_subtract.h"
+#include "valuenode_animated.h"
+#include "valuenode_composite.h"
+#include "valuenode_const.h"
+#include "valuenode_linear.h"
+#include "valuenode_dynamiclist.h"
+#include "valuenode_reference.h"
+#include "valuenode_scale.h"
+#include "valuenode_timedswap.h"
+#include "valuenode_twotone.h"
+#include "valuenode_stripes.h"
+#include "valuenode_segcalctangent.h"
+#include "valuenode_segcalcvertex.h"
+#include "valuenode_bline.h"
+
+#include "layer.h"
+#include "string.h"
+
+#include "exception.h"
+
+#include "gradient.h"
+
+#include <map>
+#include <sigc++/bind.h>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace sinfg;
+using namespace etl;
+
+/*
+class test_class {
+static int bleh;
+public:
+       test_class() { assert(!bleh); bleh++; sinfg::info("test_class: initi: %d",bleh); }
+       ~test_class() { assert(bleh); sinfg::info("test_class: uninit: %d",bleh); bleh--; }
+};
+int test_class::bleh(0);
+
+test_class test_class_instance;
+*/     
+
+/* === M A C R O S ========================================================= */
+
+inline bool is_whitespace(char x) { return ((x)=='\n' || (x)=='\t' || (x)==' '); }
+
+/* === P R O C E D U R E S ================================================= */
+
+static std::map<String, Canvas::LooseHandle>* open_canvas_map_(0);
+
+std::map<sinfg::String, etl::loose_handle<Canvas> >& sinfg::get_open_canvas_map()
+{
+       if(!open_canvas_map_)
+               open_canvas_map_=new std::map<String, Canvas::LooseHandle>;
+       return *open_canvas_map_;
+}
+
+static void _remove_from_open_canvas_map(Canvas *x) { get_open_canvas_map().erase(etl::absolute_path(x->get_file_name())); }
+
+static void _canvas_file_name_changed(Canvas *x)
+{
+       std::map<sinfg::String, etl::loose_handle<Canvas> >::iterator iter;
+       
+       for(iter=get_open_canvas_map().begin();iter!=get_open_canvas_map().end();++iter)
+               if(iter->second==x)
+                       break;
+       assert(iter!=get_open_canvas_map().end());
+       if(iter==get_open_canvas_map().end())
+               return;
+       get_open_canvas_map().erase(iter->first);
+       get_open_canvas_map()[etl::absolute_path(x->get_file_name())]=x;
+       
+}
+
+Canvas::Handle
+sinfg::open_canvas(const String &filename)
+{
+       CanvasParser parser;
+
+       parser.set_allow_errors(true);
+
+       Canvas::Handle canvas=parser.parse_from_file(filename);
+
+       if(parser.error_count())
+               return Canvas::Handle();
+       
+       return canvas;
+}
+
+Canvas::Handle
+sinfg::open_canvas_as(const String &filename,const String &as)
+{
+       CanvasParser parser;
+
+       parser.set_allow_errors(true);
+
+       Canvas::Handle canvas=parser.parse_from_file_as(filename,as);
+
+       if(parser.error_count())
+               return Canvas::Handle();
+       
+       return canvas;
+}
+
+Canvas::Handle
+sinfg::string_to_canvas(const String &data)
+{
+       CanvasParser parser;
+
+       parser.set_allow_errors(true);
+
+       Canvas::Handle canvas=parser.parse_from_string(data);
+
+       if(parser.error_count())
+               return Canvas::Handle();
+
+       return canvas;
+}
+
+/* === M E T H O D S ======================================================= */
+
+void
+CanvasParser::error_unexpected_element(xmlpp::Node *element,const String &got, const String &expected)
+{
+       error(element,strprintf(_("Unexpected element <%s>, Expected <%s>"),got.c_str(),expected.c_str()));
+}
+
+void
+CanvasParser::error_unexpected_element(xmlpp::Node *element,const String &got)
+{
+       error(element,strprintf(_("Unexpected element <%s>"),got.c_str()));
+}
+
+void
+CanvasParser::warning(xmlpp::Node *element, const String &text)
+{
+       string str=strprintf("%s:<%s>:%d: warning: ",filename.c_str(),element->get_name().c_str(),element->get_line())+text;
+       //sinfg::warning(str);
+       cerr<<str<<endl;
+       total_warnings_++;
+       if(total_warnings_>=max_warnings_)
+               fatal_error(element, _("Too many warnings"));
+}
+
+void
+CanvasParser::error(xmlpp::Node *element, const String &text)
+{
+       string str=strprintf("%s:<%s>:%d: error: ",filename.c_str(),element->get_name().c_str(),element->get_line())+text;
+       total_errors_++;
+       if(!allow_errors_)
+               throw runtime_error(str);
+       cerr<<str<<endl;
+       //      sinfg::error(str);
+}
+
+void
+CanvasParser::fatal_error(xmlpp::Node *element, const String &text)
+{
+       string str=strprintf("%s:<%s>:%d:",filename.c_str(),element->get_name().c_str(),element->get_line())+text;
+       throw runtime_error(str);
+}
+
+
+
+Keyframe
+CanvasParser::parse_keyframe(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="keyframe");
+
+       if(!element->get_attribute("time"))
+       {
+               error(element,strprintf(_("<%s> is missing \"%s\" attribute"),"real","time"));
+               return Keyframe();
+       }
+       
+       Keyframe ret(Time(element->get_attribute("time")->get_value(),canvas->rend_desc().get_frame_rate()));
+
+
+       if(element->get_children().empty())
+               return ret;
+       
+       if(element->get_child_text()->get_content().empty())
+               return ret;
+       
+       ret.set_description(element->get_child_text()->get_content());
+
+       return ret;     
+}
+
+
+Real
+CanvasParser::parse_real(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="real");
+
+       if(!element->get_children().empty())
+               warning(element, strprintf(_("<%s> should not contain anything"),"real"));
+
+       if(!element->get_attribute("value"))
+       {
+               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"real"));
+               return false;
+       }
+
+       string val=element->get_attribute("value")->get_value();
+
+       return atof(val.c_str());
+}
+
+Time
+CanvasParser::parse_time(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="time");
+
+       if(!element->get_children().empty())
+               warning(element, strprintf(_("<%s> should not contain anything"),"time"));
+
+       if(!element->get_attribute("value"))
+       {
+               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"time"));
+               return false;
+       }
+
+       string val=element->get_attribute("value")->get_value();
+
+       return Time(val,canvas->rend_desc().get_frame_rate());
+}
+
+int
+CanvasParser::parse_integer(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="integer");
+
+       if(!element->get_children().empty())
+               warning(element, strprintf(_("<%s> should not contain anything"),"integer"));
+
+       if(!element->get_attribute("value"))
+       {
+               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"integer"));
+               return false;
+       }
+
+       string val=element->get_attribute("value")->get_value();
+
+       return atoi(val.c_str());
+}
+
+Vector
+CanvasParser::parse_vector(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="vector");
+
+       if(element->get_children().empty())
+       {
+               error(element, "Undefined value in <vector>");
+               return Vector();
+       }
+
+       Vector vect;
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child=dynamic_cast<xmlpp::Element*>((xmlpp::Node*)*iter);
+               if(!child)
+                       continue;
+               else
+               if(child->get_name()=="x")
+               {
+                       if(child->get_children().empty())
+                       {
+                               error(element, "Undefined value in <x>");
+                               return Vector();
+                       }
+                       xmlpp::TextNode *text=dynamic_cast<xmlpp::TextNode*>(child->get_children().front());
+                       if(!text)
+                       {
+                               error(element,"I need a number, not an element!");
+                               return Vector();                                
+                       }
+                       vect[0]=atof(text->get_content().c_str());
+               }
+               else
+               if(child->get_name()=="y")
+               {
+                       if(child->get_children().empty())
+                       {
+                               error(element, "Undefined value in <y>");
+                               return Vector();
+                       }
+                       xmlpp::TextNode *text=dynamic_cast<xmlpp::TextNode*>(child->get_children().front());
+                       if(!text)
+                       {
+                               error(element,"I need a number, not an element!");
+                               return Vector();                                
+                       }
+                       vect[1]=atof(text->get_content().c_str());
+               }
+               else
+                       error_unexpected_element(child,child->get_name());
+       }
+       return vect;
+}
+
+Color
+CanvasParser::parse_color(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="color");
+
+       if(element->get_children().empty())
+       {
+               error(element, "Undefined value in <color>");
+               return Color();
+       }
+
+       Color color;
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               if(child->get_name()=="r")
+               {
+                       if(child->get_children().empty())
+                       {
+                               error(element, "Undefined value in <r>");
+                               return Color();
+                       }
+                       color.set_r(atof(child->get_child_text()->get_content().c_str()));
+               }
+               else
+               if(child->get_name()=="g")
+               {
+                       if(child->get_children().empty())
+                       {
+                               error(element, "Undefined value in <g>");
+                               return Color();
+                       }
+                       color.set_g(atof(child->get_child_text()->get_content().c_str()));
+               }
+               else
+               if(child->get_name()=="b")
+               {
+                       if(child->get_children().empty())
+                       {
+                               error(element, "Undefined value in <b>");
+                               return Color();
+                       }
+                       color.set_b(atof(child->get_child_text()->get_content().c_str()));
+               }
+               else
+               if(child->get_name()=="a")
+               {
+                       if(child->get_children().empty())
+                       {
+                               error(element, "Undefined value in <a>");
+                               return Color();
+                       }
+                       color.set_a(atof(child->get_child_text()->get_content().c_str()));
+               }
+               else
+                       error_unexpected_element(child,child->get_name());
+       }
+
+       return color;
+}
+
+sinfg::String
+CanvasParser::parse_string(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="string");
+
+       if(element->get_children().empty())
+       {
+               warning(element, "Undefined value in <string>");
+               return sinfg::String();
+       }
+       
+       if(element->get_child_text()->get_content().empty())
+       {
+               warning(element, "Content element of <string> appears to be empty");
+               return sinfg::String();
+       }
+       
+       return element->get_child_text()->get_content();
+}
+
+bool
+CanvasParser::parse_bool(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="bool");
+
+       if(!element->get_children().empty())
+               warning(element, strprintf(_("<%s> should not contain anything"),"bool"));
+
+       if(!element->get_attribute("value"))
+       {
+               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"bool"));
+               return false;
+       }
+
+       string val=element->get_attribute("value")->get_value();
+
+       if(val=="true" || val=="1")
+               return true;
+       if(val=="false" || val=="0")
+               return false;
+
+       error(element,strprintf(_("Bad value \"%s\" in <%s>"),val.c_str(),"bool"));
+       
+       return false;
+}
+
+Gradient
+CanvasParser::parse_gradient(xmlpp::Element *node,Canvas::Handle canvas)
+{
+       assert(node->get_name()=="gradient");
+       Gradient ret;
+       
+       xmlpp::Element::NodeList list = node->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               {
+                       Gradient::CPoint cpoint;
+                       cpoint.color=parse_color(child,canvas);
+
+                       if(!child->get_attribute("pos"))
+                       {
+                               error(child,strprintf(_("<%s> is missing \"pos\" attribute"),"gradient"));
+                               return Gradient();
+                       }
+
+                       cpoint.pos=atof(child->get_attribute("pos")->get_value().c_str());
+                       
+                       ret.push_back(cpoint);
+               }
+       }
+       ret.sort();
+       return ret;
+}
+
+ValueBase
+CanvasParser::parse_list(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       vector<ValueBase> value_list;
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               {
+                       value_list.push_back(parse_value(child,canvas));
+                       if(!value_list.back().is_valid())
+                       {
+                               value_list.pop_back();
+                               error(child,"Bad ValueBase");
+                               continue;
+                       }
+               }
+       }
+       return value_list;
+}
+
+Segment
+CanvasParser::parse_segment(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="segment");
+
+       if(element->get_children().empty())
+       {
+               error(element, "Undefined value in <segment>");
+               return Segment();
+       }
+
+       Segment seg;
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               if(child->get_name()=="p1")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <p1>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="vector")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
+                               continue;
+                       }
+
+                       seg.p1=parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+               }
+               else
+               if(child->get_name()=="t1")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <t1>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="vector")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
+                               continue;
+                       }
+
+                       seg.t1=parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+               }
+               else
+               if(child->get_name()=="p2")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <p2>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="vector")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
+                               continue;
+                       }
+
+                       seg.p2=parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+               }
+               else
+               if(child->get_name()=="t2")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <t2>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="vector")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
+                               continue;
+                       }
+
+                       seg.t2=parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+               }
+               else
+                       error_unexpected_element(child,child->get_name());
+       }
+       return seg;
+}
+
+BLinePoint
+CanvasParser::parse_bline_point(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="bline_point");
+       if(element->get_children().empty())
+       {
+               error(element, "Undefined value in <bline_point>");
+               return BLinePoint();
+       }
+
+       BLinePoint ret;
+       ret.set_split_tangent_flag(false);
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               // Vertex
+               if(child->get_name()[0]=='v' || child->get_name()=="p1")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <vertex>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="vector")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
+                               continue;
+                       }
+
+                       ret.set_vertex(parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas));
+               }
+               else
+               // Tangent 1 
+               if(child->get_name()=="t1" || child->get_name()=="tangent")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <t1>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="vector")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
+                               continue;
+                       }
+
+                       ret.set_tangent1(parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas));
+               }
+               else
+               // Tangent 2 
+               if(child->get_name()=="t2")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <t2>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="vector")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"vector");
+                               continue;
+                       }
+
+                       ret.set_tangent2(parse_vector(dynamic_cast<xmlpp::Element*>(*iter),canvas));
+                       ret.set_split_tangent_flag(true);
+               }
+               else
+               // width
+               if(child->get_name()=="width")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <width>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="real")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"real");
+                               continue;
+                       }
+
+                       ret.set_width(parse_real(dynamic_cast<xmlpp::Element*>(*iter),canvas));
+               }
+               else
+               // origin
+               if(child->get_name()=="origin")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(element, "Undefined value in <origin>");
+                               continue;
+                       }
+
+                       if((*iter)->get_name()!="real")
+                       {
+                               error_unexpected_element((*iter),(*iter)->get_name(),"real");
+                               continue;
+                       }
+
+                       ret.set_origin(parse_real(dynamic_cast<xmlpp::Element*>(*iter),canvas));
+               }
+               else
+                       error_unexpected_element(child,child->get_name());
+       }
+       return ret;
+}
+
+Angle
+CanvasParser::parse_angle(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="angle");
+
+       if(!element->get_children().empty())
+               warning(element, strprintf(_("<%s> should not contain anything"),"angle"));
+
+       if(!element->get_attribute("value"))
+       {
+               error(element,strprintf(_("<%s> is missing \"value\" attribute"),"angle"));
+               return Angle();
+       }
+
+       string val=element->get_attribute("value")->get_value();
+
+       return Angle::deg(atof(val.c_str()));
+}
+
+ValueBase
+CanvasParser::parse_value(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       if(element->get_name()=="real")
+               return parse_real(element,canvas);
+       else
+       if(element->get_name()=="time")
+               return parse_time(element,canvas);
+       else
+       if(element->get_name()=="integer")
+               return parse_integer(element,canvas);
+       else
+       if(element->get_name()=="string")
+               return parse_string(element,canvas);
+       else
+       if(element->get_name()=="vector")
+       {
+               return parse_vector(element,canvas);
+       }
+       else
+       if(element->get_name()=="color")
+               return parse_color(element,canvas);
+       else
+       if(element->get_name()=="segment")
+               return parse_segment(element,canvas);
+       else
+       if(element->get_name()=="list")
+               return parse_list(element,canvas);
+       else
+       if(element->get_name()=="gradient")
+               return parse_gradient(element,canvas);
+       else
+       if(element->get_name()=="bool")
+               return parse_bool(element,canvas);
+       else
+       //if(element->get_name()=="canvas")
+       //      return parse_canvas(element,canvas,true);       // inline canvas
+       //else
+       if(element->get_name()=="angle" || element->get_name()=="degrees" || element->get_name()=="radians" || element->get_name()=="rotations")
+               return parse_angle(element,canvas);
+       else
+       if(element->get_name()=="bline_point")
+               return parse_bline_point(element,canvas);
+       else
+       if(element->get_name()=="canvas")
+               return ValueBase(parse_canvas(element,canvas,true));
+       else
+       {
+               DEBUGPOINT();
+               error_unexpected_element(element,element->get_name());
+       }
+
+       return ValueBase();
+}
+
+
+
+
+ValueNode_Animated::Handle
+CanvasParser::parse_animated(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="hermite" || element->get_name()=="animated");
+
+       if(!element->get_attribute("type"))
+       {
+               error(element,"Missing attribute \"type\" in <animated>");
+               return ValueNode_Animated::Handle();
+       }
+
+       ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value());
+
+       if(!type)
+       {
+               error(element,"Bad type in <animated>");
+               return ValueNode_Animated::Handle();
+       }
+       
+       ValueNode_Animated::Handle value_node=ValueNode_Animated::create(type);
+
+       if(!value_node)
+       {
+               error(element,strprintf(_("Unable to create <animated> with type \"%s\""),ValueBase::type_name(type).c_str()));
+               return ValueNode_Animated::Handle();
+       }
+
+       value_node->set_root_canvas(canvas->get_root());
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               if(child->get_name()=="waypoint")
+               {
+                       if(!child->get_attribute("time"))
+                       {
+                               error(child,_("<waypoint> is missing attribute \"time\""));
+                               continue;
+                       }
+
+                       Time time(child->get_attribute("time")->get_value(),canvas->rend_desc().get_frame_rate());
+
+                       
+                       ValueNode::Handle waypoint_value_node;
+                       
+                       if(child->get_attribute("use"))
+                       {
+                               waypoint_value_node=canvas->surefind_value_node(child->get_attribute("use")->get_value());
+                       }
+                       else
+                       {
+                               if(child->get_children().empty())
+                               {
+                                       error(child, strprintf(_("<%s> is missing its data"),"waypoint"));
+                                       continue;
+                               }
+       
+                               xmlpp::Element::NodeList list = child->get_children();
+                               xmlpp::Element::NodeList::iterator iter;
+       
+                               // Search for the first non-text XML element
+                               for(iter = list.begin(); iter != list.end(); ++iter)
+                                       if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+       
+                               if(iter==list.end())
+                               {
+                                       error(child, strprintf(_("<%s> is missing its data"),"waypoint"));
+                                       continue;
+                               }
+                               
+                               waypoint_value_node=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+                               
+                               /*
+                               ValueBase data=parse_value(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+       
+                               if(!data.is_valid())
+                               {
+                                       error(child,_("Bad data for <waypoint>"));
+                                       continue;
+                               }
+                               */
+                               if(!waypoint_value_node)
+                               {
+                                       error(child,_("Bad data for <waypoint>"));
+                                       continue;
+                               }
+                               
+                               /*! HACK -- This is a temporary fix to help repair some
+                               **      weirdness that is currently going on (10-21-2004).
+                               **      This short circuits the linking of waypoints,
+                               **      a feature which is so obscure that we can get
+                               **      away with something like this pretty easily.
+                               */
+                               waypoint_value_node=waypoint_value_node->clone();
+                               
+                               // Warn if there is trash after the param value
+                               for(iter++; iter != list.end(); ++iter)
+                                       if(dynamic_cast<xmlpp::Element*>(*iter))
+                                               warning((*iter),strprintf(_("Unexpected element <%s> after <waypoint> data, ignoring..."),(*iter)->get_name().c_str()));
+                       }
+
+
+                       try {
+                               ValueNode_Animated::WaypointList::iterator waypoint=value_node->new_waypoint(time,waypoint_value_node);
+
+                       if(child->get_attribute("tension"))
+                       {
+                               sinfg::String str(child->get_attribute("tension")->get_value());
+                               waypoint->set_tension(atof(str.c_str()));
+                       }
+                       if(child->get_attribute("temporal-tension"))
+                       {
+                               sinfg::String str(child->get_attribute("temporal-tension")->get_value());
+                               waypoint->set_time_tension(atof(str.c_str()));
+                       }
+                       if(child->get_attribute("continuity"))
+                       {
+                               sinfg::String str(child->get_attribute("continuity")->get_value());
+                               waypoint->set_continuity(atof(str.c_str()));
+                       }
+                       if(child->get_attribute("bias"))
+                       {
+                               sinfg::String str(child->get_attribute("bias")->get_value());
+                               waypoint->set_bias(atof(str.c_str()));
+                       }
+
+                       if(child->get_attribute("before"))
+                       {
+                               string val=child->get_attribute("before")->get_value();
+                               if(val=="halt")
+                                       waypoint->set_before(INTERPOLATION_HALT);
+                               else if(val=="constant")
+                                       waypoint->set_before(INTERPOLATION_CONSTANT);
+                               else if(val=="linear")
+                                       waypoint->set_before(INTERPOLATION_LINEAR);
+                               else if(val=="manual")
+                                       waypoint->set_before(INTERPOLATION_MANUAL);
+                               else if(val=="auto")
+                                       waypoint->set_before(INTERPOLATION_TCB);
+                               else
+                                       error(child,strprintf(_("\"%s\" not a valid value for attribute \"%s\" in <%s>"),val.c_str(),"before","waypoint"));
+                       }
+                       
+                       if(child->get_attribute("after"))
+                       {
+                               string val=child->get_attribute("after")->get_value();
+                               if(val=="halt")
+                                       waypoint->set_after(INTERPOLATION_HALT);
+                               else if(val=="constant")
+                                       waypoint->set_after(INTERPOLATION_CONSTANT);
+                               else if(val=="linear")
+                                       waypoint->set_after(INTERPOLATION_LINEAR);
+                               else if(val=="manual")
+                                       waypoint->set_after(INTERPOLATION_MANUAL);
+                               else if(val=="auto")
+                                       waypoint->set_after(INTERPOLATION_TCB);
+                               else
+                                       error(child,strprintf(_("\"%s\" not a valid value for attribute \"%s\" in <%s>"),val.c_str(),"before","waypoint"));
+                       }
+                       }
+                       catch(Exception::BadTime x)
+                       {
+                               warning(child,x.what());
+                       }
+                       continue;
+
+               }
+               else
+                       error_unexpected_element(child,child->get_name());
+       }
+       value_node->changed();
+       return value_node;
+}
+
+// This function is a phase-out hack for the timed swap value node
+etl::handle<ValueNode_Animated>
+CanvasParser::parse_timedswap(xmlpp::Element *node,Canvas::Handle canvas)
+{
+       ValueNode_TimedSwap::Handle timed_swap(parse_linkable_value_node(node,canvas));
+       
+       assert(timed_swap);
+
+       ValueNode_Animated::Handle animated(ValueNode_Animated::create(timed_swap->get_type()));
+
+       animated->set_root_canvas(canvas->get_root());
+       
+       assert(animated);
+       
+       Time swap_time, swap_length;
+       (*timed_swap->get_swap_time())(0).put(&swap_time);
+       (*timed_swap->get_swap_length())(0).put(&swap_length);
+       
+       animated->new_waypoint(swap_time-swap_length,timed_swap->get_before());
+       animated->new_waypoint(swap_time,timed_swap->get_after());
+       
+       return animated;
+}
+
+
+handle<ValueNode_Subtract>
+CanvasParser::parse_subtract(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="subtract");
+
+       handle<ValueNode_Subtract> value_node;
+       handle<ValueNode> lhs,rhs,scalar;
+
+       if(element->get_attribute("type"))
+       {
+               ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value());
+
+               if(!type)
+               {
+                       error(element,"Bad type in <subtract>");
+                       return ValueNode_Subtract::Handle();
+               }
+               value_node=ValueNode_Subtract::create(type);
+       }
+       else
+               value_node=ValueNode_Subtract::create();
+
+       if(!value_node)
+       {
+               error(element,strprintf(_("Unable to create <subtract>")));
+               return handle<ValueNode_Subtract>();
+       }
+
+       //if(element->get_attribute("scalar"))
+       //{
+       //      value_node->set_scalar(atof(element->get_attribute("scalar")->get_value().c_str()));
+       //}
+
+       try
+       {
+               if(element->get_attribute("scalar"))
+               {
+                       // This is for compatibility with older versions of the file format
+                       String value(element->get_attribute("scalar")->get_value());
+                       if((value[0]<='9' && value[0]>='0')      || value[0]=='-')
+                       {
+                               warning(element, _("Use of a real value where the ID should be is deprecated"));
+                               value_node->set_scalar(atof(value.c_str()));
+                       }
+                       else
+                               value_node->set_scalar(canvas->surefind_value_node(value));
+                       scalar=value_node->get_scalar();
+               }
+
+               if(element->get_attribute("lhs"))
+               {
+                       lhs=canvas->surefind_value_node(element->get_attribute("lhs")->get_value());
+                       value_node->set_lhs(lhs);                       
+               }
+       
+               if(element->get_attribute("rhs"))
+               {
+                       rhs=canvas->surefind_value_node(element->get_attribute("rhs")->get_value());
+                       value_node->set_rhs(rhs);
+               }
+       }
+       catch (Exception::IDNotFound)
+       {
+               error(element,"attribute in <subtract> references unknown ID");
+       }
+       catch (Exception::FileNotFound)
+       {
+               error(element,"Unable to open external file referenced in ID");
+       }
+       
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               if(child->get_name()=="lhs")
+               {
+                       if(lhs)
+                       {
+                               error(child,"LHS component of <subtract> already defined!");
+                               continue;
+                       }
+
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(child,_("<lhs> is missing its contents"));
+                               continue;
+                       }
+
+                       lhs=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+
+                       if(lhs)
+                               value_node->set_lhs(lhs);
+                       else
+                       {
+                               error((*iter),"Parse of LHS ValueNode failed");
+                       }
+
+                       // \todo do a search for more elements and warn if they are found
+               }
+               else
+               if(child->get_name()=="rhs")
+               {
+                       if(rhs)
+                       {
+                               error(child,"RHS component of <subtract> already defined!");
+                               continue;
+                       }
+
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(child,_("<rhs> is missing its contents"));
+                               continue;
+                       }
+
+                       rhs=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+
+                       if(rhs)
+                               value_node->set_rhs(rhs);
+                       else
+                       {
+                               error((*iter),"Parse of RHS ValueNode failed");
+                       }
+
+                       // \todo do a search for more elements and warn if they are found
+               }
+               else
+               if(child->get_name()=="scalar")
+               {
+                       if(scalar)
+                       {
+                               error(child,"scalar component of <subtract> already defined!");
+                               continue;
+                       }
+
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(child,_("<scalar> is missing its contents"));
+                               continue;
+                       }
+
+                       scalar=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+
+                       if(scalar)
+                               value_node->set_scalar(scalar);
+                       else
+                       {
+                               error((*iter),"Parse of scalar ValueNode failed");
+                       }
+
+                       // \todo do a search for more elements and warn if they are found
+               }
+               else
+                       error_unexpected_element(child,child->get_name());
+       }
+
+       if(!value_node->get_rhs() || !value_node->get_lhs() || !value_node->get_scalar())
+               error(element,"<subtract> is missing LHS, RHS, or SCALAR");
+
+       if(value_node->get_rhs() == value_node->get_lhs())
+               warning(element,"LHS is equal to RHS in <subtract>, so this value_node will always be zero!");
+
+       return value_node;
+}
+
+etl::handle<LinkableValueNode>
+CanvasParser::parse_linkable_value_node(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       handle<LinkableValueNode> value_node;
+       ValueBase::Type type;
+       
+       // Determine the type
+       if(element->get_attribute("type"))
+       {
+               type=ValueBase::ident_type(element->get_attribute("type")->get_value());
+
+               if(!type)
+               {
+                       error(element,"Bad type in ValueNode");
+                       return 0;
+               }
+       }
+       else
+       {
+               error(element,"Missing type in ValueNode");
+               return 0;
+       }
+
+       value_node=LinkableValueNode::create(element->get_name(),type);
+               
+       if(!value_node)
+       {
+               error(element,"Unknown ValueNode type "+element->get_name());
+               return 0;
+       }               
+
+       if(value_node->get_type()!=type)
+       {
+               error(element,"ValueNode did not accept type");
+               return 0;
+       }               
+
+       value_node->set_root_canvas(canvas->get_root());
+
+       int i;
+       for(i=0;i<value_node->link_count();i++)
+       {
+               if(element->get_attribute(value_node->link_name(i)))
+               try {
+                       String id(element->get_attribute(value_node->link_name(i))->get_value());
+                       
+                       if(!value_node->set_link(i,
+                                       canvas->surefind_value_node(
+                                               id
+                                       )
+                               )
+                       ) error(element,strprintf(_("Unable to set link \"%s\" to ValueNode \"%s\" (link #%d in \"%s\")"),value_node->link_name(i).c_str(),id.c_str(),i,value_node->get_name().c_str()));                       
+               }
+               catch(Exception::IDNotFound)
+               {
+                       error(element,"Unable to resolve "+element->get_attribute(value_node->link_name(i))->get_value());
+               }
+               catch(Exception::FileNotFound)
+               {
+                       error(element,"Unable to open file referenced in "+element->get_attribute(value_node->link_name(i))->get_value());
+               }
+               catch(...)
+               {
+                       error(element,strprintf(_("Unknown Exception thrown when referencing ValueNode \"%s\""),
+                               element->get_attribute(value_node->link_name(i))->get_value().c_str()));
+                       throw;
+               }
+       }               
+       
+
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               try
+               {
+                       if(!child)
+                               continue;
+                       int index=value_node->get_link_index_from_name(child->get_name());
+
+                       xmlpp::Element::NodeList list = child->get_children();
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                       if(iter==list.end())
+                       {
+                               error(child,_("element is missing its contents"));
+                               continue;
+                       }
+
+                       ValueNode::Handle link=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+
+                       if(!link)
+                       {
+                               error((*iter),"Parse of ValueNode failed");
+                       }
+                       else
+                       if(!value_node->set_link(index,link))
+                       {
+                               //error(dynamic_cast<xmlpp::Element*>(*iter),strprintf("Unable to connect value node ('%s' of type '%s') to link %d",link->get_name().c_str(),ValueBase::type_name(link->get_type()).c_str(),index));
+                               error(element,strprintf("Unable to connect value node ('%s' of type '%s') to link %d",link->get_name().c_str(),ValueBase::type_name(link->get_type()).c_str(),index));
+                       }
+
+                       // \todo do a search for more elements and warn if they are found
+                       
+               }
+               catch(Exception::BadLinkName)
+               {
+                       error_unexpected_element(child,child->get_name());
+               }
+               catch(...)
+               {
+                       error(child,strprintf(_("Unknown Exception thrown when working on element \"%s\""),child->get_name().c_str()));
+                       throw;
+               }
+       }
+
+       return value_node;
+}
+
+handle<ValueNode_Composite>
+CanvasParser::parse_composite(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="composite");
+
+       if(!element->get_attribute("type"))
+       {
+               error(element,"Missing attribute \"type\" in <composite>");
+               return handle<ValueNode_Composite>();
+       }
+
+       ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value());
+
+       if(!type)
+       {
+               error(element,"Bad type in <composite>");
+               return handle<ValueNode_Composite>();
+       }
+
+       handle<ValueNode_Composite> value_node=ValueNode_Composite::create(type);
+       handle<ValueNode> c[6];
+
+       if(!value_node)
+       {
+               error(element,strprintf(_("Unable to create <composite>")));
+               return handle<ValueNode_Composite>();
+       }
+
+       int i;
+
+       for(i=0;i<value_node->link_count();i++)
+       {
+               string name=strprintf("c%d",i+1);
+               if(c[i])
+               {
+                       error(element,name+" was already defined in <composite>");
+                       continue;
+               }
+               if(element->get_attribute(name))
+               {
+                       c[i]=canvas->surefind_value_node(element->get_attribute(name)->get_value());
+                       if(c[i])
+                       {
+                               if(!value_node->set_link(i,c[i]))
+                               {
+                                       error(element,'"'+name+"\" attribute in <composite> has bad type");
+                               }
+                       }
+                       else
+                               error(element,'"'+name+"\" attribute in <composite> references unknown ID");
+               }
+       }
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               for(i=0;i<value_node->link_count();i++)
+               {
+                       string name=strprintf("c%d",i+1);
+                       if(child->get_name()==name)
+                       {
+                               if(c[i])
+                               {
+                                       error(child,name+" was already defined in <composite>");
+                                       break;
+                               }
+
+                               xmlpp::Element::NodeList list = child->get_children();
+                               xmlpp::Element::NodeList::iterator iter;
+
+                               // Search for the first non-text XML element
+                               for(iter = list.begin(); iter != list.end(); ++iter)
+                                       if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                               if(iter==list.end())
+                               {
+                                       error(child,strprintf(_("<%s> is missing its contents"),name.c_str()));
+                                       break;
+                               }
+
+                               c[i]=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+
+                               if(!c[i])
+                               {
+                                       error((*iter),"Parse of "+name+" ValueNode failed");
+                                       break;
+                               }
+
+                               if(!value_node->set_link(i,c[i]))
+                               {
+                                       error(child,strprintf(_("<%s> has a bad value"),name.c_str()));
+                                       break;
+                               }                                       
+
+                               // \todo do a search for more elements and warn if they are found
+                               break;
+                       }
+               }
+               // somewhat of a hack, but it works
+               if(i==value_node->link_count()) error_unexpected_element(child,child->get_name());
+       }
+
+       switch(value_node->link_count())
+       {
+       case 1:
+               if(!value_node->get_link(0))
+               {
+                       error(element,"<composite> is missing parameters");
+                       return handle<ValueNode_Composite>();
+               }
+               break;
+       case 2:
+               if(!value_node->get_link(0) ||!value_node->get_link(1))
+               {
+                       error(element,"<composite> is missing parameters");
+                       return handle<ValueNode_Composite>();
+               }
+               break;
+       case 3:
+               if(!value_node->get_link(0) ||!value_node->get_link(1) ||!value_node->get_link(2))
+               {
+                       error(element,"<composite> is missing parameters");
+                       return handle<ValueNode_Composite>();
+               }
+               break;
+       case 4:
+               if(!value_node->get_link(0) ||!value_node->get_link(1) ||!value_node->get_link(2) ||!value_node->get_link(3))
+               {
+                       error(element,"<composite> is missing parameters");
+                       return handle<ValueNode_Composite>();
+               }
+               break;
+    }
+       return value_node;
+}
+
+// This will also parse a bline
+handle<ValueNode_DynamicList>
+CanvasParser::parse_dynamic_list(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="dynamic_list" || element->get_name()=="bline");
+       
+       const float fps(canvas?canvas->rend_desc().get_frame_rate():0);
+
+       if(!element->get_attribute("type"))
+       {
+               error(element,"Missing attribute \"type\" in <dynamic_list>");
+               return handle<ValueNode_DynamicList>();
+       }
+
+       ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value());
+
+       if(!type)
+       {
+               error(element,"Bad type in <dynamic_list>");
+               return handle<ValueNode_DynamicList>();
+       }
+
+       handle<ValueNode_DynamicList> value_node;
+       handle<ValueNode_BLine> bline_value_node;
+
+       if(element->get_name()=="bline")
+       {
+               value_node=bline_value_node=ValueNode_BLine::create();
+               if(element->get_attribute("loop"))
+               {
+                       String loop=element->get_attribute("loop")->get_value();
+                       if(loop=="true" || loop=="1" || loop=="TRUE" || loop=="True")
+                               bline_value_node->set_loop(true);
+                       else
+                               bline_value_node->set_loop(false);
+               }
+               
+       }               
+       else
+               value_node=ValueNode_DynamicList::create(type);
+
+       if(!value_node)
+       {
+               error(element,strprintf(_("Unable to create <dynamic_list>")));
+               return handle<ValueNode_DynamicList>();
+       }
+
+       value_node->set_root_canvas(canvas->get_root());
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               if(child->get_name()=="entry")
+               {
+                       ValueNode_DynamicList::ListEntry list_entry;
+                       
+                       // Parse begin/end waypoints
+                       {
+                               typedef sinfg::ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
+                               typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+
+                               String begin_sequence;
+                               String end_sequence;
+                               
+                               ActivepointList &timing_info(list_entry.timing_info);
+                               
+                               if(child->get_attribute("begin"))
+                                       begin_sequence=child->get_attribute("begin")->get_value();
+
+                               if(child->get_attribute("on"))
+                                       begin_sequence=child->get_attribute("on")->get_value();
+
+                               if(child->get_attribute("end"))
+                                       end_sequence=child->get_attribute("end")->get_value();
+
+                               if(child->get_attribute("off"))
+                                       end_sequence=child->get_attribute("off")->get_value();
+                               
+                               // clear out any auto-start
+                               if(!begin_sequence.empty())
+                                       timing_info.clear();
+                               
+                               //! \optimize
+                               while(!begin_sequence.empty())
+                               {
+                                       String::iterator iter(find(begin_sequence.begin(),begin_sequence.end(),','));
+                                       String timecode(begin_sequence.begin(), iter);                                          
+                                       int priority=0;
+                                       
+                                       // If there is a priority, then grab it and remove
+                                       // it from the timecode
+                                       if(timecode[0]=='p')
+                                       {
+                                               //priority=timecode[1]-'0';
+                                               //timecode=String(timecode.begin()+3,timecode.end());
+                                               int space=timecode.find_first_of(' ');
+                                               priority=atoi(String(timecode,1,space-1).c_str());
+                                               timecode=String(timecode.begin()+space+1,timecode.end());
+                                               //sinfg::info("priority: %d      timecode: %s",priority,timecode.c_str());
+                                       }
+                                       
+                                       timing_info.push_back(
+                                               Activepoint(
+                                                       Time(
+                                                               timecode,
+                                                               fps
+                                                       ),
+                                                       true,   // Mark as a "on" activepoint
+                                                       priority
+                                               )
+                                       );
+                                       
+                                       if(iter==begin_sequence.end())
+                                               begin_sequence.clear();
+                                       else
+                                               begin_sequence=String(iter+1,begin_sequence.end());
+                               }
+
+                               //! \optimize
+                               while(!end_sequence.empty())
+                               {
+                                       String::iterator iter(find(end_sequence.begin(),end_sequence.end(),','));
+                                       String timecode(end_sequence.begin(),   iter);                                          
+                                       int priority=0;
+                                       
+                                       // If there is a priority, then grab it and remove
+                                       // it from the timecode
+                                       if(timecode[0]=='p')
+                                       {
+                                               //priority=timecode[1]-'0';
+                                               //timecode=String(timecode.begin()+3,timecode.end());
+                                               int space=timecode.find_first_of(' ');
+                                               priority=atoi(String(timecode,1,space-1).c_str());
+                                               timecode=String(timecode.begin()+space+1,timecode.end());
+                                               //sinfg::info("priority: %d      timecode: %s",priority,timecode.c_str());
+                                       }
+                               
+                                       timing_info.push_back(
+                                               Activepoint(
+                                                       Time(
+                                                               timecode,
+                                                               fps
+                                                       ),
+                                                       false,  // Mark as a "off" activepoint
+                                                       priority
+                                               )
+                                       );
+                                       if(iter==end_sequence.end())
+                                               end_sequence.clear();
+                                       else
+                                               end_sequence=String(iter+1,end_sequence.end());
+                               }
+                               
+                               timing_info.sort();
+                       }
+
+                       if(child->get_attribute("use"))
+                       {
+                               string id=child->get_attribute("use")->get_value();
+                               try
+                               {
+                                       list_entry.value_node=canvas->surefind_value_node(id);
+                               }
+                               catch(Exception::IDNotFound)
+                               {
+                                       error(child,"\"use\" attribute in <entry> references unknown ID -- "+id);
+                                       continue;
+                               }
+                       }
+                       else
+                       {
+                               xmlpp::Element::NodeList list = child->get_children();
+                               xmlpp::Element::NodeList::iterator iter;
+
+                               // Search for the first non-text XML element
+                               for(iter = list.begin(); iter != list.end(); ++iter)
+                                       if(dynamic_cast<xmlpp::Element*>(*iter)) break;
+
+                               if(iter==list.end())
+                               {
+                                       error(child,strprintf(_("<entry> is missing its contents or missing \"use\" element")));
+                                       continue;
+                               }
+
+                               list_entry.value_node=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+
+                               if(!list_entry.value_node)
+                                       error((*iter),"Parse of ValueNode failed");
+
+                               // \todo do a search for more elements and warn if they are found
+
+                       }
+
+                       value_node->add(list_entry);
+                       value_node->set_link(value_node->link_count()-1,list_entry.value_node);
+               }
+               else
+                       error_unexpected_element(child,child->get_name());
+       }
+       return value_node;
+}
+
+handle<ValueNode>
+CanvasParser::parse_value_node(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       handle<ValueNode> value_node;
+       assert(element);
+       
+       GUID guid;
+       
+       if(element->get_attribute("guid"))
+       {
+               guid=GUID(element->get_attribute("guid")->get_value())^canvas->get_root()->get_guid();
+               value_node=guid_cast<ValueNode>(guid);
+               if(value_node)
+                       return value_node;
+       }
+       
+       // If ValueBase::ident_type() recognises the name, then we know it's a ValueBase
+       if(element->get_name()!="canvas" && ValueBase::ident_type(element->get_name()))
+       {       
+               ValueBase data=parse_value(element,canvas);
+
+               if(!data.is_valid())
+               {
+                       error(element,strprintf(_("Bad data in <%s>"),element->get_name().c_str()));
+                       return value_node;
+               }
+
+               // We want to convert this ValueBase into a
+               // ValueNode_Const. That way, we can treat the
+               // ID like any other Datanode. Think of this
+               // as a shorthand for creating constant ValueNodes.
+
+               value_node=ValueNode_Const::create(data);
+       }
+       else
+       if(element->get_name()=="hermite" || element->get_name()=="animated")
+               value_node=parse_animated(element,canvas);
+       else
+       if(element->get_name()=="subtract")
+               value_node=parse_subtract(element,canvas);
+       else
+       if(element->get_name()=="composite")
+               value_node=parse_composite(element,canvas);
+       else
+       if(element->get_name()=="dynamic_list")
+               value_node=parse_dynamic_list(element,canvas);
+       else
+       if(element->get_name()=="bline") // This is not a typo. The dynamic list parser will parse a bline.
+               value_node=parse_dynamic_list(element,canvas);
+       else
+       if(element->get_name()=="timed_swap")
+               value_node=parse_timedswap(element,canvas);
+       else
+       if(LinkableValueNode::book().count(element->get_name()))        
+               value_node=parse_linkable_value_node(element,canvas);
+       else
+       if(element->get_name()=="canvas")
+               value_node=ValueNode_Const::create(parse_canvas(element,canvas,true));
+       else
+       {
+               error_unexpected_element(element,element->get_name());
+               error(element, "Expected a ValueNode");
+       }
+
+       
+       value_node->set_root_canvas(canvas->get_root());
+       
+       
+       // If we were successful, and our element has
+       // an ID attribute, go ahead and add it to the
+       // value_node list
+       if(value_node && element->get_attribute("id"))
+       {
+               string id=element->get_attribute("id")->get_value();
+
+               //value_node->set_id(id);
+
+               // If there is already a value_node in the list
+               // with the same ID, then that is an error
+               try { canvas->add_value_node(value_node,id); }
+               catch(Exception::BadLinkName)
+               {
+                       warning(element,strprintf(_("Bad ID \"%s\""),id.c_str()));
+                       return value_node;                      
+               }
+               catch(Exception::IDAlreadyExists)
+               {
+                       error(element,strprintf(_("Duplicate ID \"%s\""),id.c_str()));
+                       return value_node;
+               }
+               catch(...)
+               {
+                       error(element,strprintf(_("Unknown Exception thrown when adding ValueNode \"%s\""),id.c_str()));
+                       throw;
+               }
+       }
+       value_node->set_guid(guid);
+       return value_node;
+}
+
+void
+CanvasParser::parse_canvas_defs(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       assert(element->get_name()=="defs");
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               if(child->get_name()=="canvas")
+                       parse_canvas(child, canvas);
+               else
+                       parse_value_node(child,canvas);
+       }
+}
+
+Layer::Handle
+CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas)
+{
+       
+       assert(element->get_name()=="layer");
+       Layer::Handle layer;
+
+       if(!element->get_attribute("type"))
+       {
+               error(element,_("Missing \"type\" attribute to \"layer\" element"));
+               return Layer::Handle();
+       }
+
+       layer=Layer::create(element->get_attribute("type")->get_value());
+       layer->set_canvas(canvas);
+
+       if(element->get_attribute("group"))
+       {
+               layer->add_to_group(
+                       element->get_attribute("group")->get_value()
+               );
+       }
+
+       // Handle the version attribute
+       if(element->get_attribute("version"))
+       {
+               String version(element->get_attribute("version")->get_value());
+               if(version>layer->get_version())
+                       warning(element,_("Installed layer version is larger than layer version in file"));
+               if(version!=layer->get_version())
+                       layer->set_version(version);
+       }
+
+       // Handle the description
+       if(element->get_attribute("desc"))
+               layer->set_description(element->get_attribute("desc")->get_value());
+       
+       if(element->get_attribute("active"))
+               layer->set_active(element->get_attribute("active")->get_value()=="false"?false:true);
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(!child)
+                       continue;
+               else
+               if(child->get_name()=="name")
+                       warning(child,_("<name> entry for <layer> is not yet supported. Ignoring..."));
+               else
+               if(child->get_name()=="desc")
+                       warning(child,_("<desc> entry for <layer> is not yet supported. Ignoring..."));
+               else
+               if(child->get_name()=="param")
+               {
+                       xmlpp::Element::NodeList list = child->get_children();
+
+                       if(!child->get_attribute("name"))
+                       {
+                               error(child,_("Missing \"name\" attribute for <param>."));
+                               continue;
+                       }
+
+                       String param_name=child->get_attribute("name")->get_value();
+
+                       if(child->get_attribute("use"))
+                       {
+                               // If the "use" attribute is used, then the
+                               // element should be empty. Warn the user if
+                               // we find otherwise.
+                               if(!list.empty())
+                                       warning(child,_("Found \"use\" attribute for <param>, but it wasn't empty. Ignoring contents..."));
+
+                               String str=     child->get_attribute("use")->get_value();
+
+                               if(layer->get_param(param_name).get_type()==ValueBase::TYPE_CANVAS)
+                               {
+                                       if(!layer->set_param(param_name,canvas->surefind_canvas(str)))
+                                               error((*iter),_("Layer rejected canvas link"));
+                               }
+                               else
+                               try
+                               {
+                                       handle<ValueNode> value_node=canvas->surefind_value_node(str);
+
+                                       // Assign the value_node to the dynamic parameter list
+                                       layer->connect_dynamic_param(param_name,value_node);
+                       }
+                               catch(Exception::IDNotFound)
+                               {
+                                       error(child,strprintf(_("Unknown ID (%s) referenced in <param>"),str.c_str()));
+                               }
+
+                               continue;
+                       }
+
+                       xmlpp::Element::NodeList::iterator iter;
+
+                       // Search for the first non-text XML element
+                       for(iter = list.begin(); iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter))
+                                       break;
+                               //if(!(!dynamic_cast<xmlpp::Element*>(*iter) && (*iter)->get_name()=="text"||(*iter)->get_name()=="comment"   )) break;
+
+                       if(iter==list.end())
+                       {
+                               error(child,_("<param> is either missing its contents, or missing a \"use\" attribute."));
+                               continue;
+                       }
+
+                       // If we recognise the element name as a
+                       // ValueBase, then treat is at one
+                       if(/*(*iter)->get_name()!="canvas" && */ValueBase::ident_type((*iter)->get_name()) && !dynamic_cast<xmlpp::Element*>(*iter)->get_attribute("guid"))
+                       {
+                               ValueBase data=parse_value(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+
+                               if(!data.is_valid())
+                               {
+                                       error((*iter),_("Bad data for <param>"));
+                                       continue;
+                               }
+
+                               // Set the layer's parameter, and make sure that
+                               // the layer liked it
+                               if(!layer->set_param(param_name,data))
+                               {
+                                       warning((*iter),_("Layer rejected value for <param>"));
+                                       continue;
+                               }
+                       }
+                       else    // ... otherwise, we assume that it is a ValueNode
+                       {
+                               handle<ValueNode> value_node=parse_value_node(dynamic_cast<xmlpp::Element*>(*iter),canvas);
+
+                               if(!value_node)
+                               {
+                                       error((*iter),_("Bad data for <param>"));
+                                       continue;
+                               }
+
+                               // Assign the value_node to the dynamic parameter list
+                               layer->connect_dynamic_param(param_name,value_node);
+                       }
+
+                       // Warn if there is trash after the param value
+                       for(iter++; iter != list.end(); ++iter)
+                               if(dynamic_cast<xmlpp::Element*>(*iter))
+                                       warning((*iter),strprintf(_("Unexpected element <%s> after <param> data, ignoring..."),(*iter)->get_name().c_str()));
+                       continue;                               
+               }
+               else
+                       error_unexpected_element(child,child->get_name());
+       }
+
+       layer->reset_version();
+       return layer;
+}
+
+Canvas::Handle
+CanvasParser::parse_canvas(xmlpp::Element *element,Canvas::Handle parent,bool inline_, String filename)
+{
+       
+       if(element->get_name()!="canvas")
+       {
+               error_unexpected_element(element,element->get_name(),"canvas");
+               return Canvas::Handle();
+       }
+       Canvas::Handle canvas;
+
+       
+       
+       if(parent && (element->get_attribute("id") || inline_))
+       {
+               if(inline_)
+               {
+                       canvas=Canvas::create_inline(parent);
+               }
+               else
+               {
+                       try
+                       {
+                               canvas=parent->find_canvas(element->get_attribute("id")->get_value());
+                       }
+                       catch(...)
+                       {
+                               canvas=parent->new_child_canvas(element->get_attribute("id")->get_value());
+                       }
+               }
+               canvas->rend_desc().clear_flags();
+       }
+       else
+       {
+               canvas=Canvas::create();
+               if(filename=="/dev/stdin")
+                       canvas->set_file_name("./stdin.sif");
+               else
+                       canvas->set_file_name(filename);
+               canvas->rend_desc().clear_flags();
+       }
+
+       if(element->get_attribute("guid"))
+       {
+               GUID guid(element->get_attribute("guid")->get_value());
+               if(guid_cast<Canvas>(guid))
+                       return guid_cast<Canvas>(guid);
+               else
+                       canvas->set_guid(guid);
+       }
+
+       if(element->get_attribute("width"))
+               canvas->rend_desc().set_w(atoi(element->get_attribute("width")->get_value().c_str()));
+
+       if(element->get_attribute("height"))
+               canvas->rend_desc().set_h(atoi(element->get_attribute("height")->get_value().c_str()));
+
+       if(element->get_attribute("xres"))
+               canvas->rend_desc().set_x_res(atof(element->get_attribute("xres")->get_value().c_str()));
+
+       if(element->get_attribute("yres"))
+               canvas->rend_desc().set_y_res(atof(element->get_attribute("yres")->get_value().c_str()));
+
+       
+       if(element->get_attribute("fps"))
+               canvas->rend_desc().set_frame_rate(atof(element->get_attribute("fps")->get_value().c_str()));
+
+       if(element->get_attribute("start-time"))
+               canvas->rend_desc().set_time_start(Time(element->get_attribute("start-time")->get_value(),canvas->rend_desc().get_frame_rate()));
+
+       if(element->get_attribute("begin-time"))
+               canvas->rend_desc().set_time_start(Time(element->get_attribute("begin-time")->get_value(),canvas->rend_desc().get_frame_rate()));
+
+       if(element->get_attribute("end-time"))
+               canvas->rend_desc().set_time_end(Time(element->get_attribute("end-time")->get_value(),canvas->rend_desc().get_frame_rate()));
+
+       if(element->get_attribute("antialias"))
+               canvas->rend_desc().set_antialias(atoi(element->get_attribute("antialias")->get_value().c_str()));
+
+       if(element->get_attribute("view-box"))
+       {
+               string values=element->get_attribute("view-box")->get_value();
+               Vector
+                       tl,
+                       br;
+               tl[0]=atof(string(values.data(),values.find(' ')).c_str());
+               values=string(values.begin()+values.find(' ')+1,values.end());
+               tl[1]=atof(string(values.data(),values.find(' ')).c_str());
+               values=string(values.begin()+values.find(' ')+1,values.end());
+               br[0]=atof(string(values.data(),values.find(' ')).c_str());
+               values=string(values.begin()+values.find(' ')+1,values.end());
+               br[1]=atof(values.c_str());
+
+               canvas->rend_desc().set_tl(tl);
+               canvas->rend_desc().set_br(br);
+       }
+
+       if(element->get_attribute("bgcolor"))
+       {
+               string values=element->get_attribute("bgcolor")->get_value();
+               Color bg;
+               
+               bg.set_r(atof(string(values.data(),values.find(' ')).c_str()));
+               values=string(values.begin()+values.find(' ')+1,values.end());
+               
+               bg.set_g(atof(string(values.data(),values.find(' ')).c_str()));
+               values=string(values.begin()+values.find(' ')+1,values.end());
+               
+               bg.set_b(atof(string(values.data(),values.find(' ')).c_str()));
+               values=string(values.begin()+values.find(' ')+1,values.end());
+               
+               bg.set_a(atof(values.c_str()));
+
+               canvas->rend_desc().set_bg_color(bg);
+       }
+
+       if(element->get_attribute("focus"))
+       {
+               string values=element->get_attribute("focus")->get_value();
+               Vector focus;
+
+               focus[0]=atof(string(values.data(),values.find(' ')).c_str());
+               values=string(values.begin()+values.find(' ')+1,values.end());
+               focus[1]=atof(values.c_str());
+
+               canvas->rend_desc().set_focus(focus);
+       }
+
+       canvas->rend_desc().set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
+
+       xmlpp::Element::NodeList list = element->get_children();
+       for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+       {
+               xmlpp::Element *child(dynamic_cast<xmlpp::Element*>(*iter));
+               if(child)
+               {
+                       if(child->get_name()=="defs")
+                       {
+                               if(canvas->is_inline())
+                                       error(child,_("Inline canvas cannot have a <defs> section"));
+                               parse_canvas_defs(child, canvas);
+                       }
+                       else
+                       if(child->get_name()=="keyframe")
+                       {
+                               if(canvas->is_inline())
+                               {
+                                       warning(child,_("Inline canvas cannot have keyframes"));
+                                       continue;
+                               }
+
+                               canvas->keyframe_list().add(parse_keyframe(child,canvas));
+                               canvas->keyframe_list().sync();
+                       }
+                       else
+                       if(child->get_name()=="meta")
+                       {
+                               if(canvas->is_inline())
+                               {
+                                       warning(child,_("Inline canvases cannot have metadata"));
+                                       continue;
+                               }
+                               
+                               String name,content;
+                               
+                               if(!child->get_attribute("name"))
+                               {
+                                       warning(child,_("<meta> must have a name"));
+                                       continue;
+                               }
+
+                               if(!child->get_attribute("content"))
+                               {
+                                       warning(child,_("<meta> must have content"));
+                                       continue;
+                               }
+                                       
+                               canvas->set_meta_data(child->get_attribute("name")->get_value(),child->get_attribute("content")->get_value());
+                       }
+                       else if(child->get_name()=="name")
+                       {
+                               xmlpp::Element::NodeList list = child->get_children();
+       
+                               // If we don't have any name, warn
+                               if(list.empty())
+                                       warning(child,_("blank \"name\" entitity"));
+       
+                               string tmp;
+                               for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+                                       if(dynamic_cast<xmlpp::TextNode*>(*iter))tmp+=dynamic_cast<xmlpp::TextNode*>(*iter)->get_content();
+                               canvas->set_name(tmp);
+                       }
+                       else
+                       if(child->get_name()=="desc")
+                       {
+                               
+                               xmlpp::Element::NodeList list = child->get_children();
+       
+                               // If we don't have any description, warn
+                               if(list.empty())
+                                       warning(child,_("blank \"desc\" entitity"));
+       
+                               string tmp;
+                               for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+                                       if(dynamic_cast<xmlpp::TextNode*>(*iter))tmp+=dynamic_cast<xmlpp::TextNode*>(*iter)->get_content();
+                               canvas->set_description(tmp);
+                       }
+                       else
+                       if(child->get_name()=="author")
+                       {
+                               
+                               xmlpp::Element::NodeList list = child->get_children();
+       
+                               // If we don't have any description, warn
+                               if(list.empty())
+                                       warning(child,_("blank \"author\" entitity"));
+       
+                               string tmp;
+                               for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter)
+                                       if(dynamic_cast<xmlpp::TextNode*>(*iter))tmp+=dynamic_cast<xmlpp::TextNode*>(*iter)->get_content();
+                               canvas->set_author(tmp);
+                       }
+                       else
+                       if(child->get_name()=="layer")
+                       {
+                               //if(canvas->is_inline())
+                               //      canvas->push_front(parse_layer(child,canvas->parent()));
+                               //else
+                                       canvas->push_front(parse_layer(child,canvas));
+                       }
+                       else
+                               error_unexpected_element(child,child->get_name());
+               }
+//             else
+//             if((child->get_name()=="text"||child->get_name()=="comment") && child->has_child_text())
+//                     continue;
+       }
+
+       if(canvas->value_node_list().placeholder_count())
+       {
+               error(element,strprintf(_("Canvas %s has undefined ValueNodes"),canvas->get_id().c_str()));     
+       }
+
+       return canvas;
+}
+
+Canvas::Handle
+CanvasParser::parse_from_file(const String &file)
+{
+       return parse_from_file_as(file,file);
+}
+
+Canvas::Handle
+CanvasParser::parse_from_file_as(const String &file,const String &as)
+{
+       CHECK_EXPIRE_TIME();
+       try
+       {
+               if(get_open_canvas_map().count(etl::absolute_path(as)))
+                       return get_open_canvas_map()[etl::absolute_path(as)];
+
+               filename=as;
+               total_warnings_=0;
+               xmlpp::DomParser parser(file);
+               if(parser)
+               {
+                       Canvas::Handle canvas(parse_canvas(parser.get_document()->get_root_node(),0,false,as));
+                       get_open_canvas_map()[etl::absolute_path(as)]=canvas;
+                       canvas->signal_deleted().connect(sigc::bind(sigc::ptr_fun(_remove_from_open_canvas_map),canvas.get()));
+                       canvas->signal_file_name_changed().connect(sigc::bind(sigc::ptr_fun(_canvas_file_name_changed),canvas.get()));
+
+
+
+                       const ValueNodeList& value_node_list(canvas->value_node_list());
+                       
+                       again:
+                       ValueNodeList::const_iterator iter;
+                       for(iter=value_node_list.begin();iter!=value_node_list.end();++iter)
+                       {
+                               ValueNode::Handle value_node(*iter);
+                               if(value_node->is_exported() && value_node->get_id().find("Unnamed")==0)
+                               {
+                                       canvas->remove_value_node(value_node);
+                                       goto again;
+                               }
+                       }
+
+                       return canvas;
+               }
+       }
+       catch(Exception::BadLinkName) { sinfg::error("BadLinkName Thrown"); }
+       catch(Exception::BadType) { sinfg::error("BadType Thrown"); }
+       catch(Exception::FileNotFound) { sinfg::error("FileNotFound Thrown"); }
+       catch(Exception::IDNotFound) { sinfg::error("IDNotFound Thrown"); }
+       catch(Exception::IDAlreadyExists) { sinfg::error("IDAlreadyExists Thrown"); }
+       catch(const std::exception& ex)
+       {
+               sinfg::error("Standard Exception: "+String(ex.what()));
+               return Canvas::Handle();
+       }
+       catch(const String& str)
+       {
+               cerr<<str<<endl;
+               //      sinfg::error(str);
+               return Canvas::Handle();
+       }
+       return Canvas::Handle();
+}
+
+Canvas::Handle
+CanvasParser::parse_from_string(const String &data)
+{
+       CHECK_EXPIRE_TIME();
+
+       try
+       {
+               filename=_("<INTERNAL>");
+               total_warnings_=0;
+               xmlpp::DomParser parser;
+               parser.parse_memory(data);
+               xmlpp::Element *root=parser.get_document()->get_root_node();
+               if(parser)
+               {
+                       Canvas::Handle canvas(parse_canvas(root));
+                       canvas->signal_deleted().connect(sigc::bind(sigc::ptr_fun(_remove_from_open_canvas_map),canvas.get()));
+                       canvas->signal_file_name_changed().connect(sigc::bind(sigc::ptr_fun(_canvas_file_name_changed),canvas.get()));
+
+                       const ValueNodeList& value_node_list(canvas->value_node_list());
+                       again:
+                       ValueNodeList::const_iterator iter;
+                       for(iter=value_node_list.begin();iter!=value_node_list.end();++iter)
+                       {
+                               ValueNode::Handle value_node(*iter);
+                               if(value_node->is_exported() && value_node->get_id().find("Unnamed")==0)
+                               {
+                                       canvas->remove_value_node(value_node);
+                                       goto again;
+                               }
+                       }
+                       
+                       return canvas;
+               }
+       }
+       catch(Exception::BadLinkName) { sinfg::error("BadLinkName Thrown"); }
+       catch(Exception::BadType) { sinfg::error("BadType Thrown"); }
+       catch(Exception::FileNotFound) { sinfg::error("FileNotFound Thrown"); }
+       catch(Exception::IDNotFound) { sinfg::error("IDNotFound Thrown"); }
+       catch(Exception::IDAlreadyExists) { sinfg::error("IDAlreadyExists Thrown"); }
+       catch(const std::exception& ex)
+       {
+               sinfg::error("Standard Exception: "+String(ex.what()));
+               return Canvas::Handle();
+       }
+       catch(const String& str)
+       {
+               cerr<<str<<endl;
+               //      sinfg::error(str);
+               return Canvas::Handle();
+       }
+       return Canvas::Handle();
+}
diff --git a/synfig-core/trunk/src/synfig/loadcanvas.h b/synfig-core/trunk/src/synfig/loadcanvas.h
new file mode 100644 (file)
index 0000000..f27ace1
--- /dev/null
@@ -0,0 +1,188 @@
+/* === S I N F G =========================================================== */
+/*!    \file loadcanvas.h
+**     \brief writeme
+**
+**     $Id: loadcanvas.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LOADCANVAS_H
+#define __SINFG_LOADCANVAS_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "string.h"
+#include "canvas.h"
+#include "valuenode.h"
+#include "vector.h"
+#include "value.h"
+#include "valuenode_subtract.h"
+#include "valuenode_animated.h"
+#include "valuenode_composite.h"
+#include "valuenode_const.h"
+#include "valuenode_linear.h"
+#include "valuenode_dynamiclist.h"
+#include "valuenode_reference.h"
+#include "valuenode_timedswap.h"
+#include "keyframe.h"
+#include "guid.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace xmlpp { class Node; class Element; };
+
+namespace sinfg {
+
+/*!    \class CanvasParser
+**     \todo writeme
+*/
+class CanvasParser
+{
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+private:
+
+       int max_warnings_;
+
+    int total_warnings_;
+
+    int total_errors_;
+
+       bool allow_errors_;
+
+       String filename;
+
+       String path;
+
+       GUID guid_;
+
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+public:
+
+       CanvasParser():
+               max_warnings_   (1000),
+               total_warnings_ (0),
+               total_errors_   (0),
+               allow_errors_   (false)
+       { }
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //! \todo writeme
+       CanvasParser &set_allow_errors(bool x) { allow_errors_=x; return *this; }
+
+       //! Sets the maximum number of warnings before a fatal error is thrown
+       CanvasParser &set_max_warnings(int i) { max_warnings_=i; return *this; }
+
+       //! Returns the maximum number of warnings before a fatal_error is thrown
+       int get_max_warnings() { return max_warnings_; }
+
+       //! Returns the number of errors in the last parse
+       int error_count()const { return total_errors_; }
+
+       //! Returns the number of warnings in the last parse
+       int warning_count()const { return total_warnings_; }
+
+       void set_path(const sinfg::String& x) { path=x; }
+
+       const sinfg::String& get_path()const { return path; }
+       
+       //! \todo writeme
+       Canvas::Handle parse_from_file(const String &filename);
+
+       Canvas::Handle parse_from_file_as(const String &filename,const String &as);
+
+       //! \todo writeme
+       Canvas::Handle parse_from_string(const String &data);
+
+private:
+
+       // Error/Warning handling functions
+
+       void error(xmlpp::Node *node,const String &text);
+       void fatal_error(xmlpp::Node *node,const String &text);
+       void warning(xmlpp::Node *node,const String &text);
+       void error_unexpected_element(xmlpp::Node *node,const String &got, const String &expected);
+       void error_unexpected_element(xmlpp::Node *node,const String &got);
+
+       // Parsing Functions
+
+       Canvas::Handle parse_canvas(xmlpp::Element *node,Canvas::Handle parent=0,bool inline_=false, String path=".");
+       void parse_canvas_defs(xmlpp::Element *node,Canvas::Handle canvas);
+       etl::handle<Layer> parse_layer(xmlpp::Element *node,Canvas::Handle canvas);
+       ValueBase parse_value(xmlpp::Element *node,Canvas::Handle canvas);
+       etl::handle<ValueNode> parse_value_node(xmlpp::Element *node,Canvas::Handle canvas);
+
+       // ValueBase Parsing Functions
+
+       Real parse_real(xmlpp::Element *node,Canvas::Handle canvas);
+       Time parse_time(xmlpp::Element *node,Canvas::Handle canvas);
+       int parse_integer(xmlpp::Element *node,Canvas::Handle canvas);
+       Vector parse_vector(xmlpp::Element *node,Canvas::Handle canvas);
+       Color parse_color(xmlpp::Element *node,Canvas::Handle canvas);
+       Angle parse_angle(xmlpp::Element *node,Canvas::Handle canvas);
+       String parse_string(xmlpp::Element *node,Canvas::Handle canvas);
+       bool parse_bool(xmlpp::Element *node,Canvas::Handle canvas);
+       Segment parse_segment(xmlpp::Element *node,Canvas::Handle canvas);
+       ValueBase parse_list(xmlpp::Element *node,Canvas::Handle canvas);
+       Gradient parse_gradient(xmlpp::Element *node,Canvas::Handle canvas);
+       BLinePoint parse_bline_point(xmlpp::Element *node,Canvas::Handle canvas);
+
+       Keyframe parse_keyframe(xmlpp::Element *node,Canvas::Handle canvas);
+
+       // ValueNode Parsing Functions
+
+       etl::handle<ValueNode_Animated> parse_animated(xmlpp::Element *node,Canvas::Handle canvas);
+       etl::handle<ValueNode_Subtract> parse_subtract(xmlpp::Element *node,Canvas::Handle canvas);
+       etl::handle<ValueNode_Animated> parse_timedswap(xmlpp::Element *node,Canvas::Handle canvas);
+       etl::handle<LinkableValueNode> parse_linkable_value_node(xmlpp::Element *node,Canvas::Handle canvas);
+       etl::handle<ValueNode_Composite> parse_composite(xmlpp::Element *node,Canvas::Handle canvas);
+       etl::handle<ValueNode_DynamicList> parse_dynamic_list(xmlpp::Element *node,Canvas::Handle canvas);
+
+}; // END of CanvasParser
+
+/* === E X T E R N S ======================================================= */
+
+//!    Loads a canvas from \a filename
+/*!    \return The Canvas's handle on success, an empty handle on failure */
+extern Canvas::Handle open_canvas(const String &filename);
+extern Canvas::Handle open_canvas_as(const String &filename,const String &as);
+
+//! Retrieves a Canvas from a string in XML format
+extern Canvas::Handle string_to_canvas(const String &data);
+
+std::map<sinfg::String, etl::loose_handle<Canvas> >& get_open_canvas_map();
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/main.cpp b/synfig-core/trunk/src/synfig/main.cpp
new file mode 100644 (file)
index 0000000..b253c3b
--- /dev/null
@@ -0,0 +1,437 @@
+/* === S I N F G =========================================================== */
+/*!    \file main.cpp
+**     \brief \writeme
+**
+**     $Id: main.cpp,v 1.3 2005/01/10 07:40:26 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+//#define SINFG_NO_ANGLE
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include <iostream>
+#include "version.h"
+#include "general.h"
+#include "module.h"
+#include <cstdlib>
+#include <ltdl.h>
+#include <stdexcept>
+#include "target.h"
+#include <ETL/stringf>
+#include "listimporter.h"
+#include "color.h"
+#include "vector.h"
+#include <fstream>
+#include "layer.h"
+#include "valuenode.h"
+
+#include "main.h"
+#include "loadcanvas.h"
+
+#include "guid.h"
+
+#include "mutex.h"
+
+#ifdef DEATH_TIME
+#include <time.h>
+#endif
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+#define MODULE_LIST_FILENAME   "sinfg_modules.cfg"
+
+/* === S T A T I C S ======================================================= */
+
+static etl::reference_counter sinfg_ref_count_(0);
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+
+
+
+
+
+
+
+const char *
+sinfg::get_version()
+{
+#ifdef VERSION
+       return VERSION;
+#else
+       return "Unknown";
+#endif
+}
+
+const char *
+sinfg::get_build_date()
+{
+       return __DATE__;
+}
+
+const char *
+sinfg::get_build_time()
+{
+       return __TIME__;
+}
+
+extern const char *get_build_time();
+
+bool
+sinfg::check_version_(int version,int vec_size, int color_size,int canvas_size,int layer_size)
+{
+       bool ret=true;
+
+       CHECK_EXPIRE_TIME();
+       
+       if(version!=SINFG_LIBRARY_VERSION)
+       {
+               sinfg::error(_("API Version mismatch (LIB:%d, PROG:%d)"),SINFG_LIBRARY_VERSION,version);
+               ret=false;
+       }
+       if(vec_size!=sizeof(Vector))
+       {
+               sinfg::error(_("Size of Vector mismatch (app:%d, lib:%d)"),vec_size,sizeof(Vector));
+               ret=false;
+       }
+       if(color_size!=sizeof(Color))
+       {
+               sinfg::error(_("Size of Color mismatch (app:%d, lib:%d)"),color_size,sizeof(Color));
+               ret=false;
+       }
+       if(canvas_size!=sizeof(Canvas))
+       {
+               sinfg::error(_("Size of Canvas mismatch (app:%d, lib:%d)"),canvas_size,sizeof(Canvas));
+               ret=false;
+       }
+       if(layer_size!=sizeof(Layer))
+       {
+               sinfg::error(_("Size of Layer mismatch (app:%d, lib:%d)"),layer_size,sizeof(Layer));
+               ret=false;
+       }
+       
+       return ret;
+}
+
+static void broken_pipe_signal (int sig)  {
+       sinfg::warning("Broken Pipe...");
+}
+
+bool retrieve_modules_to_load(String filename,std::list<String> &modules_to_load)
+{
+       if(filename=="standard")
+       {
+               return false;
+/*
+               if(find(modules_to_load.begin(),modules_to_load.end(),"trgt_bmp")==modules_to_load.end())
+                       modules_to_load.push_back("trgt_bmp");
+               if(find(modules_to_load.begin(),modules_to_load.end(),"trgt_gif")==modules_to_load.end())
+                       modules_to_load.push_back("trgt_gif");
+               if(find(modules_to_load.begin(),modules_to_load.end(),"trgt_dv")==modules_to_load.end())
+                       modules_to_load.push_back("trgt_dv");
+               if(find(modules_to_load.begin(),modules_to_load.end(),"mod_ffmpeg")==modules_to_load.end())
+                       modules_to_load.push_back("mod_ffmpeg");
+               if(find(modules_to_load.begin(),modules_to_load.end(),"mod_imagemagick")==modules_to_load.end())
+                       modules_to_load.push_back("mod_imagemagick");
+               if(find(modules_to_load.begin(),modules_to_load.end(),"lyr_std")==modules_to_load.end())
+                       modules_to_load.push_back("lyr_std");
+               if(find(modules_to_load.begin(),modules_to_load.end(),"lyr_freetype")==modules_to_load.end())
+                       modules_to_load.push_back("lyr_freetype");
+#ifdef HAVE_LIBPNG
+               if(find(modules_to_load.begin(),modules_to_load.end(),"trgt_png")==modules_to_load.end())
+                       modules_to_load.push_back("trgt_png");
+#endif
+#ifdef HAVE_OPENEXR
+               if(find(modules_to_load.begin(),modules_to_load.end(),"mod_openexr")==modules_to_load.end())
+                       modules_to_load.push_back("mod_openexr");
+#endif
+*/
+       }
+       else
+       {
+               std::ifstream file(filename.c_str());
+               if(!file)
+               {
+               //      warning("Cannot open "+filename);
+                       return false;
+               }
+               while(file)
+               {
+                       String modulename;
+                       getline(file,modulename);
+                       if(!modulename.empty() && find(modules_to_load.begin(),modules_to_load.end(),modulename)==modules_to_load.end())
+                               modules_to_load.push_back(modulename);                  
+               }
+       }
+
+       
+       
+       return true;
+}
+
+
+
+
+
+sinfg::Main::Main(const sinfg::String& basepath,ProgressCallback *cb):
+       ref_count_(sinfg_ref_count_)
+{
+       if(ref_count_.count())
+               return;
+
+       sinfg_ref_count_.reset();
+       ref_count_=sinfg_ref_count_;
+       
+       // Add initialization after this point
+
+
+       CHECK_EXPIRE_TIME();
+
+       String prefix=basepath+"/..";
+       int i;
+#ifdef _DEBUG
+       std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+       
+#if defined(HAVE_SIGNAL_H) && defined(SIGPIPE)
+       signal(SIGPIPE, broken_pipe_signal);
+#endif
+       
+       //_config_search_path=new vector"string.h"();
+       
+       // Init the subsystems
+       if(cb)cb->amount_complete(0, 100);
+       if(cb)cb->task(_("Starting Subsystem \"Modules\""));
+       if(!Module::subsys_init(prefix))
+               throw std::runtime_error(_("Unable to initialize subsystem \"Module\""));
+
+       if(cb)cb->task(_("Starting Subsystem \"Layers\""));
+       if(!Layer::subsys_init())
+       {
+               Module::subsys_stop();
+               throw std::runtime_error(_("Unable to initialize subsystem \"Layers\""));
+       }
+
+       if(cb)cb->task(_("Starting Subsystem \"Targets\""));
+       if(!Target::subsys_init())
+       {
+               Layer::subsys_stop();
+               Module::subsys_stop();
+               throw std::runtime_error(_("Unable to initialize subsystem \"Targets\""));
+       }
+       
+       if(cb)cb->task(_("Starting Subsystem \"Importers\""));
+       if(!Importer::subsys_init())
+       {
+               Target::subsys_stop();
+               Layer::subsys_stop();
+               Module::subsys_stop();
+               throw std::runtime_error(_("Unable to initialize subsystem \"Importers\""));
+       }
+
+       if(cb)cb->task(_("Starting Subsystem \"ValueNodes\""));
+       if(!ValueNode::subsys_init())
+       {
+               Importer::subsys_stop();
+               Target::subsys_stop();
+               Layer::subsys_stop();
+               Module::subsys_stop();
+               throw std::runtime_error(_("Unable to initialize subsystem \"ValueNodes\""));
+       }
+       
+       // Load up the list importer
+       Importer::book()[String("lst")]=ListImporter::create;
+               
+
+       
+       // Load up the modules  
+       std::list<String> modules_to_load;
+       std::vector<String> locations;
+       
+       if(!getenv("SYNFIG_MODULE_LIST"))
+       {
+               locations.push_back("standard");
+               locations.push_back("./"MODULE_LIST_FILENAME);  //1
+               locations.push_back("../etc/"MODULE_LIST_FILENAME);     //1
+               locations.push_back("~/.sinfg/"MODULE_LIST_FILENAME); //2
+               locations.push_back(prefix+"/etc/"+MODULE_LIST_FILENAME); //3
+               locations.push_back("/usr/local/etc/"MODULE_LIST_FILENAME);
+       #ifdef SYSCONFDIR
+               locations.push_back(SYSCONFDIR"/"MODULE_LIST_FILENAME);
+       #endif
+       #ifdef __APPLE__
+               locations.push_back("/Library/Frameworks/synfig.framework/Resources/"MODULE_LIST_FILENAME);
+               locations.push_back("/Library/Synfig/"MODULE_LIST_FILENAME);
+               locations.push_back("~/Library/Synfig/"MODULE_LIST_FILENAME);
+       #endif
+       #ifdef WIN32
+               locations.push_back("C:\\Program Files\\Synfig\\etc\\"MODULE_LIST_FILENAME);
+       #endif
+       }
+       else
+       {
+               locations.push_back(getenv("SYNFIG_MODULE_LIST"));
+       }
+/*     
+       const char *locations[]=
+       {
+               "standard",     //0
+               "./"MODULE_LIST_FILENAME,       //1
+               "../etc/"MODULE_LIST_FILENAME,  //1
+               "~/.sinfg/"MODULE_LIST_FILENAME, //2
+               "/usr/local/lib/sinfg/modules/"MODULE_LIST_FILENAME, //3
+               "/usr/local/etc/"MODULE_LIST_FILENAME,
+#ifdef SYSCONFDIR
+               SYSCONFDIR"/"MODULE_LIST_FILENAME,
+#endif
+#ifdef __APPLE__
+               "/Library/Frameworks/sinfg.framework/Resources/"MODULE_LIST_FILENAME,
+               "/Library/SINFG/"MODULE_LIST_FILENAME,
+               "~/Library/SINFG/"MODULE_LIST_FILENAME,
+#endif
+#ifdef WIN32
+               "C:\\Program Files\\SINFG\\etc\\"MODULE_LIST_FILENAME,
+#endif
+       };
+*/
+       
+       for(i=0;i<locations.size();i++)
+               if(retrieve_modules_to_load(locations[i],modules_to_load))
+                       if(cb)cb->task(strprintf(_("Loading modules from %s"),locations[i].c_str()));
+       
+       std::list<String>::iterator iter;
+       
+       for(i=0,iter=modules_to_load.begin();iter!=modules_to_load.end();++iter,i++)
+       {
+               Module::Register(*iter,cb);
+               if(cb)cb->amount_complete((i+1)*100,modules_to_load.size()*100);
+       }
+       
+//     load_modules(cb);
+       
+       CHECK_EXPIRE_TIME();
+
+       
+       if(cb)cb->amount_complete(100, 100);
+       if(cb)cb->task(_("DONE"));
+}
+
+sinfg::Main::~Main()
+{
+       ref_count_.detach();
+       if(!sinfg_ref_count_.unique())
+               return;
+       sinfg_ref_count_.detach();
+
+       // Add deinitialization after this point
+
+       if(get_open_canvas_map().size())
+       {
+               sinfg::warning("Canvases still open!");
+               std::map<sinfg::String, etl::loose_handle<Canvas> >::iterator iter;
+               for(iter=get_open_canvas_map().begin();iter!=get_open_canvas_map().end();++iter)
+               {
+                       sinfg::warning("%s: count()=%d",iter->first.c_str(), iter->second.count());
+               }
+       }
+               
+       ValueNode::subsys_stop();
+       Importer::subsys_stop();
+       Target::subsys_stop();
+       Layer::subsys_stop();
+
+       /*! \fixme For some reason, uncommenting the next
+       **      line will cause things to crash. This needs to be
+       **      looked into at some point. */
+       //Module::subsys_stop();
+
+#if defined(HAVE_SIGNAL_H) && defined(SIGPIPE)
+       signal(SIGPIPE, SIG_DFL);
+#endif
+}
+
+
+
+
+
+
+
+
+
+void
+sinfg::error(const char *format,...)
+{
+       va_list args;
+       va_start(args,format);
+       error(vstrprintf(format,args));
+}
+
+void
+sinfg::error(const String &str)
+{
+       static Mutex mutex; Mutex::Lock lock(mutex);
+       cerr<<"sinfg("<<getpid()<<"): "<<_("error")<<": "+str<<endl;
+}
+
+void
+sinfg::warning(const char *format,...)
+{
+       va_list args;
+       va_start(args,format);
+       warning(vstrprintf(format,args));
+}
+
+void
+sinfg::warning(const String &str)
+{
+       static Mutex mutex; Mutex::Lock lock(mutex);
+       cerr<<"sinfg("<<getpid()<<"): "<<_("warning")<<": "+str<<endl;
+}
+
+void
+sinfg::info(const char *format,...)
+{
+       va_list args;
+       va_start(args,format);
+       info(vstrprintf(format,args));
+}
+
+void
+sinfg::info(const String &str)
+{
+       static Mutex mutex; Mutex::Lock lock(mutex);
+       cerr<<"sinfg("<<getpid()<<"): "<<_("info")<<": "+str<<endl;
+}
diff --git a/synfig-core/trunk/src/synfig/main.h b/synfig-core/trunk/src/synfig/main.h
new file mode 100644 (file)
index 0000000..b1eeab4
--- /dev/null
@@ -0,0 +1,61 @@
+/* === S I N F G =========================================================== */
+/*!    \file main.h
+**     \brief Template Header
+**
+**     $Id: main.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_MAIN_H
+#define __SINFG_MAIN_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/ref_count>
+#include "general.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+/*!    \class sinfg::Main
+**     \brief \writeme
+**
+**     \writeme
+*/
+class Main
+{
+       etl::reference_counter ref_count_;
+public:
+       Main(const sinfg::String& basepath,ProgressCallback *cb=0);
+       ~Main();
+
+       static void load_modules(ProgressCallback *cb=0);
+
+       const etl::reference_counter& ref_count()const { return ref_count_; }
+}; // END of class Main
+
+}; // END if namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/module.cpp b/synfig-core/trunk/src/synfig/module.cpp
new file mode 100644 (file)
index 0000000..f893b74
--- /dev/null
@@ -0,0 +1,178 @@
+/* === S I N F G =========================================================== */
+/*!    \file module.cpp
+**     \brief writeme
+**
+**     $Id: module.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "module.h"
+#include "general.h"
+#include <ltdl.h>
+#include <ETL/stringf>
+#endif
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+Module::Book *sinfg::Module::book_;
+
+/* === P R O C E D U R E S ================================================= */
+
+bool
+Module::subsys_init(const String &prefix)
+{
+       #ifndef SINFG_LTDL_NO_STATIC
+       //LTDL_SET_PRELOADED_SYMBOLS();
+       #endif
+       
+       if(lt_dlinit())
+       {
+               error(_("Errors on lt_dlinit()"));
+               error(lt_dlerror());
+               return false;
+       }
+
+       lt_dladdsearchdir(".");
+       lt_dladdsearchdir("~/.sinfg/modules");
+       lt_dladdsearchdir((prefix+"/lib/sinfg/modules").c_str());
+#ifdef LIBDIR
+       lt_dladdsearchdir(LIBDIR"/sinfg/modules");
+#endif
+#ifdef __APPLE__
+       lt_dladdsearchdir("/Library/Frameworks/sinfg.framework/Resources/modules");
+#endif
+       lt_dladdsearchdir("/usr/local/lib/sinfg/modules");
+       lt_dladdsearchdir(".");
+       
+       book_=new Book;
+       return true;
+}
+
+bool
+Module::subsys_stop()
+{
+       delete book_;
+       
+       lt_dlexit();
+       return true;
+}
+
+bool
+register_default_modules()
+{
+       return true;
+}
+
+Module::Book&
+Module::book()
+{
+       return *book_;
+}
+
+void
+sinfg::Module::Register(Module::Handle mod)
+{
+       book()[mod->Name()]=mod;
+}
+
+bool
+sinfg::Module::Register(const String &module_name, ProgressCallback *callback)
+{
+       lt_dlhandle module;
+
+       if(callback)callback->task(strprintf(_("Attempting to register \"%s\""),module_name.c_str()));
+
+       module=lt_dlopenext((string("lib")+module_name).c_str());
+       if(!module)module=lt_dlopenext(module_name.c_str());
+       
+       if(!module)
+       {
+               if(callback)callback->error(strprintf(_("Unable to find module \"%s\" (%s)"),module_name.c_str(),lt_dlerror()));
+               return false;
+       }
+
+       if(callback)callback->task(strprintf(_("Found module \"%s\""),module_name.c_str()));
+       
+       Module::constructor_type constructor=NULL;
+       Handle mod;
+
+       if(!constructor)
+       {
+//             if(callback)callback->task(string("looking for -> ")+module_name+"_LTX_new_instance()");
+               constructor=(Module::constructor_type )lt_dlsym(module,(module_name+"_LTX_new_instance").c_str());
+       }
+
+       if(!constructor)
+       {
+//             if(callback)callback->task(string("looking for -> lib")+module_name+"_LTX_new_instance()");
+               constructor=(Module::constructor_type )lt_dlsym(module,(string("lib")+module_name+"_LTX_new_instance").c_str());
+       }
+       if(!constructor)
+       {
+//             if(callback)callback->task(string("looking for -> lib")+module_name+"_LTX_new_instance()");
+               constructor=(Module::constructor_type )lt_dlsym(module,(string("_lib")+module_name+"_LTX_new_instance").c_str());
+       }
+       if(!constructor)
+       {
+//             if(callback)callback->task(string("looking for -> lib")+module_name+"_LTX_new_instance()");
+               constructor=(Module::constructor_type )lt_dlsym(module,(string("_")+module_name+"_LTX_new_instance").c_str());
+       }
+       
+       if(constructor)
+       {
+//             if(callback)callback->task(strprintf("Executing callback for \"%s\"",module_name.c_str()));
+               mod=handle<Module>((*constructor)(callback));
+       }
+       else
+       {
+               if(callback)callback->error(strprintf(_("Unable to find entrypoint in module \"%s\" (%s)"),module_name.c_str(),lt_dlerror()));
+               return false;
+       }
+
+//     if(callback)callback->task(strprintf("Done executing callback for \"%s\"",module_name.c_str()));
+
+       if(mod)
+       {
+//             if(callback)callback->task(strprintf("Registering \"%s\"",module_name.c_str()));
+               Register(mod);
+       }
+       else
+       {
+               if(callback)callback->error(_("Entrypoint did not return a module."));
+               return false;
+    }
+
+       if(callback)callback->task(strprintf(_("Success for \"%s\""),module_name.c_str()));
+       
+       return false;
+}
diff --git a/synfig-core/trunk/src/synfig/module.h b/synfig-core/trunk/src/synfig/module.h
new file mode 100644 (file)
index 0000000..31d3bae
--- /dev/null
@@ -0,0 +1,171 @@
+/* === S I N F G =========================================================== */
+/*!    \file module.h
+**     \brief writeme
+**
+**     $Id: module.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_MODULE_H
+#define __SINFG_MODULE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "general.h"
+#include <ETL/handle>
+#include <map>
+#include "string.h"
+#include <utility>
+#include "vector.h"
+#include "color.h"
+#include "layer.h"
+#include "canvas.h"
+
+//#include "value.h"
+
+/* === M A C R O S ========================================================= */
+
+//! Marks the start of a module description
+#define MODULE_DESC_BEGIN(x) struct x##_modclass : public sinfg::Module { x##_modclass(sinfg::ProgressCallback *callback=NULL); 
+
+//! Sets the localized name of the module
+#define MODULE_NAME(x)                         virtual const char * Name() { return x; }
+
+//! Sets a localized description of the module
+#define MODULE_DESCRIPTION(x)  virtual const char * Desc() { return x; }
+
+//! Sets the name of the module's author
+#define MODULE_AUTHOR(x)               virtual const char * Author() { return x; }
+
+//! Sets the version string for the module
+#define MODULE_VERSION(x)              virtual const char * Version() { return x; }
+
+//! Sets the copyright string for the module
+#define MODULE_COPYRIGHT(x)            virtual const char * Copyright() { return x; }
+
+//! Describes the module's construction function
+#define MODULE_CONSTRUCTOR(x)  bool constructor_(sinfg::ProgressCallback *cb) { return x(cb); }
+
+//! Describes the module's destruction function
+#define MODULE_DESTRUCTOR(x)   virtual void destructor_() { return x(); }
+
+//! Marks the end of a module description
+#define MODULE_DESC_END };
+
+//#if 0
+#ifdef __APPLE__
+//! Marks the start of a module's inventory
+#define MODULE_INVENTORY_BEGIN(x)  extern "C" {                \
+       sinfg::Module* _##x##_LTX_new_instance(sinfg::ProgressCallback *cb) \
+       { if(SINFG_CHECK_VERSION()){x##_modclass *mod=new x##_modclass(cb); mod->constructor_(cb); return mod; }\
+       if(cb)cb->error(#x": Unable to load module due to version mismatch."); return NULL; } \
+       }; x##_modclass::x##_modclass(sinfg::ProgressCallback *cb) { 
+#else
+//! Marks the start of a module's inventory
+#define MODULE_INVENTORY_BEGIN(x)  extern "C" {                \
+       sinfg::Module* x##_LTX_new_instance(sinfg::ProgressCallback *cb) \
+       { if(SINFG_CHECK_VERSION()){x##_modclass *mod=new x##_modclass(cb); mod->constructor_(cb); return mod; }\
+       if(cb)cb->error(#x": Unable to load module due to version mismatch."); return NULL; } \
+       }; x##_modclass::x##_modclass(sinfg::ProgressCallback *cb) { 
+#endif
+
+//! Marks the start of the layers in the module's inventory
+#define BEGIN_LAYERS {
+
+//! DEPRECATED - use @INCLUDE_LAYER()
+//#define LAYER(x) sinfg::Layer::book()[sinfg::String(x::name__)]=x::create;
+#define LAYER(class)   sinfg::Layer::register_in_book(sinfg::Layer::BookEntry(class::create,class::name__,class::local_name__,class::category__,class::cvs_id__,class::version__));
+#define LAYER_ALIAS(class,alias)       sinfg::Layer::register_in_book(sinfg::Layer::BookEntry(class::create,alias,alias,_("Do Not Use"),class::cvs_id__,class::version__));
+
+//! Marks the end of the layers in the module's inventory
+#define END_LAYERS }
+
+//! Marks the start of the targets in the module's inventory
+#define BEGIN_TARGETS {
+
+#define TARGET(x) sinfg::Target::book()[sinfg::String(x::name__)]=std::pair<sinfg::Target::Factory,sinfg::String>(x::create,sinfg::String(x::ext__));sinfg::Target::ext_book()[sinfg::String(x::ext__)]=x::name__;
+
+#define TARGET_EXT(x,y) sinfg::Target::ext_book()[sinfg::String(y)]=x::name__;
+
+//! Marks the end of the targets in the module's inventory
+#define END_TARGETS }
+
+//! Marks the start of the importers in the module's inventory
+#define BEGIN_IMPORTERS {
+
+#define IMPORTER(x) sinfg::Importer::book()[sinfg::String(x::ext__)]=x::create;
+
+#define IMPORTER_EXT(x,y) sinfg::Importer::book()[sinfg::String(y)]=x::create;
+
+//! Marks the end of the importers in the module's inventory
+#define END_IMPORTERS }
+
+//! Marks the end of a module's inventory
+#define MODULE_INVENTORY_END   }
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ProgressCallback;
+
+/*!    \class Module
+**     \todo writeme
+*/
+class Module : public etl::shared_object
+{
+public:
+       bool constructor_(sinfg::ProgressCallback *cb) { return true; }
+       virtual void destructor_() { }
+       
+       typedef etl::handle<Module> Handle;
+       typedef etl::loose_handle<Module> LooseHandle;
+       typedef etl::handle<const Module> ConstHandle;
+       
+public:
+       typedef Module*(*constructor_type)(ProgressCallback *);
+       typedef std::map<String, Handle > Book;
+private:
+       static Book* book_;
+public:
+       static Book& book();
+
+       static bool subsys_init(const String &prefix);
+       static bool subsys_stop();
+       static bool register_default_modules();
+
+       static void Register(Handle mod);
+       static bool Register(const String &module_name, ProgressCallback *cb=NULL);
+       static inline void Register(Module *mod) { Register(Handle(mod)); }
+       
+       virtual const char * Name() { return " "; }
+       virtual const char * Desc() { return " "; }
+       virtual const char * Author() { return " "; }
+       virtual const char * Version() { return " "; }
+       virtual const char * Copyright() { return SINFG_COPYRIGHT; }
+
+       virtual ~Module() { destructor_(); }
+};
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/mutex.cpp b/synfig-core/trunk/src/synfig/mutex.cpp
new file mode 100644 (file)
index 0000000..4ede578
--- /dev/null
@@ -0,0 +1,303 @@
+/* === S I N F G =========================================================== */
+/*!    \file mutex.cpp
+**     \brief Template File
+**
+**     $Id: mutex.cpp,v 1.3 2005/01/12 00:55:46 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "mutex.h"
+
+#ifdef HAVE_LIBPTHREAD
+#define USING_PTHREADS 1
+#else
+#ifdef _WIN32
+#define USING_WIN32_THREADS 1
+#endif
+#endif
+
+#ifdef USING_WIN32_THREADS
+#include <windows.h>
+#endif
+
+#ifdef USING_PTHREADS
+#include <pthread.h>
+#endif
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+//using namespace std;
+//using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+
+
+
+
+
+bool
+Mutex::is_locked()
+{
+       if(try_lock())
+       {
+               unlock();
+               return false;
+       }
+       return true;
+}
+
+void
+RecMutex::unlock_all()
+{
+       while(is_locked()) unlock();
+}
+
+#ifdef USING_PTHREADS
+Mutex::Mutex()
+{
+       pthread_mutex_t*const mtx_ptr(new pthread_mutex_t);
+
+       pthread_mutexattr_t attr;
+       pthread_mutexattr_init(&attr);
+
+       //#ifdef PTHREAD_PRIO_INHERIT
+       //pthread_mutexattr_setprioceiling(&attr,PTHREAD_PRIO_INHERIT);
+       //#endif
+
+       //#ifdef PTHREAD_MUTEX_RECURSIVE
+       //pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
+       //#endif
+
+       pthread_mutex_init(mtx_ptr,&attr);
+       pthread_mutexattr_destroy(&attr);
+       
+       blackbox=mtx_ptr;
+}
+
+Mutex::~Mutex()
+{
+       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
+       pthread_mutex_destroy(mtx_ptr);
+       delete mtx_ptr;
+}
+
+void
+Mutex::lock()
+{
+       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
+       pthread_mutex_lock(mtx_ptr);
+}
+
+void
+Mutex::unlock()
+{
+       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
+       pthread_mutex_unlock(mtx_ptr);
+}
+
+bool
+Mutex::try_lock()
+{
+       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
+       return !(bool) pthread_mutex_trylock(mtx_ptr);
+}
+
+
+RecMutex::RecMutex()
+{
+       pthread_mutex_t*const mtx_ptr(static_cast<pthread_mutex_t*>(blackbox));
+       pthread_mutexattr_t attr;
+
+       // Backtrack and get rid of the non-recursive mutex
+       pthread_mutex_destroy(mtx_ptr);
+
+       pthread_mutexattr_init(&attr);
+
+       pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
+
+       pthread_mutex_init(mtx_ptr,&attr);
+       pthread_mutexattr_destroy(&attr);
+}
+
+
+
+RWLock::RWLock()
+{
+       pthread_rwlock_t*const rwlock_ptr(new pthread_rwlock_t);
+       
+       pthread_rwlock_init(rwlock_ptr, NULL);
+       
+       blackbox=rwlock_ptr;
+}
+
+RWLock::~RWLock()
+{
+       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
+
+       pthread_rwlock_destroy(rwlock_ptr);
+       
+       delete rwlock_ptr;
+}
+
+void
+RWLock::reader_lock()
+{
+       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
+
+       pthread_rwlock_rdlock(rwlock_ptr);
+}
+
+void
+RWLock::reader_unlock()
+{
+       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
+
+       pthread_rwlock_unlock(rwlock_ptr);
+}
+
+bool
+RWLock::reader_trylock()
+{
+       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
+
+       return !pthread_rwlock_tryrdlock(rwlock_ptr);
+}
+
+void
+RWLock::writer_lock()
+{
+       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
+
+       pthread_rwlock_wrlock(rwlock_ptr);
+}
+
+void
+RWLock::writer_unlock()
+{
+       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
+
+       pthread_rwlock_unlock(rwlock_ptr);
+}
+
+bool
+RWLock::writer_trylock()
+{
+       pthread_rwlock_t*const rwlock_ptr(static_cast<pthread_rwlock_t*>(blackbox));
+
+       return !pthread_rwlock_trywrlock(rwlock_ptr);
+}
+
+#endif
+
+#ifdef USING_WIN32_THREADS
+Mutex::Mutex()
+{
+       HANDLE& mtx(*reinterpret_cast<HANDLE*>(&blackbox));
+       mtx=CreateMutex(NULL, FALSE, NULL);
+}
+
+Mutex::~Mutex()
+{
+       HANDLE mtx(reinterpret_cast<HANDLE>(blackbox));
+       CloseHandle(mtx);
+}
+
+void
+Mutex::lock()
+{
+       HANDLE mtx(reinterpret_cast<HANDLE>(blackbox));
+       WaitForSingleObject(mtx, INFINITE);
+}
+
+void
+Mutex::unlock()
+{
+       HANDLE mtx(reinterpret_cast<HANDLE>(blackbox));
+       ReleaseMutex(mtx);
+}
+
+bool
+Mutex::try_lock()
+{
+       HANDLE mtx(reinterpret_cast<HANDLE>(blackbox));
+       return WaitForSingleObject(mtx, 0)==WAIT_FAILED;
+}
+
+
+RecMutex::RecMutex()
+{
+       // Win32 mutexes are recursive by default.
+}
+
+
+RWLock::RWLock()
+{
+}
+
+RWLock::~RWLock()
+{
+}
+
+void
+RWLock::reader_lock()
+{
+}
+
+void
+RWLock::reader_unlock()
+{
+}
+
+bool
+RWLock::reader_trylock()
+{
+}
+
+void
+RWLock::writer_lock()
+{
+}
+
+void
+RWLock::writer_unlock()
+{
+}
+
+bool
+RWLock::writer_trylock()
+{
+}
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/mutex.h b/synfig-core/trunk/src/synfig/mutex.h
new file mode 100644 (file)
index 0000000..04dfb25
--- /dev/null
@@ -0,0 +1,117 @@
+/* === S I N F G =========================================================== */
+/*!    \file mutex.h
+**     \brief Template Header
+**
+**     $Id: mutex.h,v 1.2 2005/01/10 07:40:26 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_MUTEX_H
+#define __SINFG_MUTEX_H
+
+/* === H E A D E R S ======================================================= */
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class RecMutex;
+
+class Mutex
+{
+       friend class RecMutex;
+
+protected:
+       void* blackbox;
+       
+public:
+       
+       class Lock
+       {
+               Mutex& mutex;
+       public:
+               Lock(Mutex& x):mutex(x) { mutex.lock(); }
+               ~Lock() { mutex.unlock(); }
+       };
+       
+       Mutex();
+       ~Mutex();
+       
+       void lock();
+       void unlock();
+       bool try_lock();
+       bool is_locked();
+       
+private:
+       //! Non-copyable
+       Mutex(const Mutex&);
+       
+       //! Non-assignable
+       void operator=(const Mutex&);
+};
+
+class RecMutex : public Mutex
+{
+public:
+       RecMutex();
+
+       void unlock_all();
+};
+
+class RWLock
+{
+       void* blackbox;
+       
+public:
+       
+       class ReaderLock
+       {
+               RWLock& rw_lock;
+       public:
+               ReaderLock(RWLock& x):rw_lock(x) { rw_lock.reader_lock(); }
+               ~ReaderLock() { rw_lock.reader_unlock(); }
+       };
+       class WriterLock
+       {
+               RWLock& rw_lock;
+       public:
+               WriterLock(RWLock& x):rw_lock(x) { rw_lock.writer_lock(); }
+               ~WriterLock() { rw_lock.writer_unlock(); }
+       };
+       
+       RWLock();
+       ~RWLock();
+
+       void reader_lock();
+       void reader_unlock();
+       bool reader_trylock();
+
+       void writer_lock();
+       void writer_unlock();
+       bool writer_trylock();
+};
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/node.cpp b/synfig-core/trunk/src/synfig/node.cpp
new file mode 100644 (file)
index 0000000..fdd2bfe
--- /dev/null
@@ -0,0 +1,302 @@
+/* === S I N F G =========================================================== */
+/*!    \file node.cpp
+**     \brief Template File
+**
+**     $Id: node.cpp,v 1.5 2005/01/07 03:29:12 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define HASH_MAP_H <ext/hash_map>
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "node.h"
+#include "proto/nodebase.h"
+
+#ifdef HASH_MAP_H
+#include HASH_MAP_H
+using namespace __gnu_cxx;
+#else
+#include <map>
+#endif
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+// About BE_FRUGAL_WITH_GUIDS
+// If this macro is set, then a GUID will NOT
+// be calculated until the first call to get_guid()
+// This also means that the node doesn't get
+// added to the database until get_guid() is called
+// for the first time, or set_guid() is called.
+// If it is expensive to calculate GUIDs, then
+// this can improve performance a tad in
+// some cases. Otherwise, it doesn't change
+// much of anything.
+#define BE_FRUGAL_WITH_GUIDS 1
+
+#ifndef __sys_clock
+#ifndef _WIN32
+# include <time.h>
+# define __sys_clock   ::clock
+#else
+# ifdef __GNUG__
+#  include <time.h>
+#  define __sys_clock  ::clock
+# else
+typedef int clock_t;
+extern clock_t _clock();
+#  define CLOCKS_PER_SEC 1000
+#  define __sys_clock  _clock
+# endif
+#endif
+#endif
+
+/* === G L O B A L S ======================================================= */
+
+#ifdef HASH_MAP_H
+typedef hash_map<GUID,Node*,GUIDHash> GlobalNodeMap;
+#else
+typedef map<GUID,Node*> GlobalNodeMap;
+#endif
+
+static GlobalNodeMap* global_node_map_;
+
+static GlobalNodeMap& global_node_map()
+{
+       if(!global_node_map_)
+               global_node_map_=new GlobalNodeMap;
+       return *global_node_map_;
+}
+
+/* === P R O C E D U R E S ================================================= */
+
+sinfg::Node*
+sinfg::find_node(const GUID& guid)
+{
+       if(global_node_map().count(guid)==0)
+               return 0;
+       return global_node_map()[guid];
+}
+
+static void
+refresh_node(sinfg::Node* node, GUID old_guid)
+{
+       assert(global_node_map().count(old_guid));
+       global_node_map().erase(old_guid);
+       assert(!global_node_map().count(old_guid));
+       global_node_map()[node->get_guid()]=node;
+}
+
+/* === M E T H O D S ======================================================= */
+
+void
+TimePoint::absorb(const TimePoint& x)
+{
+       if(get_guid()==x.get_guid())
+               return;
+       set_guid(get_guid()^x.get_guid());
+       
+       if(get_after()==INTERPOLATION_NIL)
+               set_after(x.get_after());
+       if(get_before()==INTERPOLATION_NIL)
+               set_before(x.get_before());
+       
+       if(get_after()!=x.get_after() && x.get_after()!=INTERPOLATION_NIL)
+               set_after(INTERPOLATION_UNDEFINED);
+       if(get_before()!=x.get_before() && x.get_before()!=INTERPOLATION_NIL)
+               set_before(INTERPOLATION_UNDEFINED);    
+}
+
+TimePointSet::iterator
+TimePointSet::insert(const TimePoint& x)
+{
+       iterator iter(find(x));
+       if(iter!=end())
+       {
+               const_cast<TimePoint&>(*iter).absorb(x);
+               return iter;
+       }
+       return std::set<TimePoint>::insert(x).first;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Node::Node():
+       guid_(0),
+       bchanged(true),
+       deleting_(false)
+{
+#ifndef BE_FRUGAL_WITH_GUIDS
+       guid_.make_unique();
+       assert(guid_);
+       assert(!global_node_map().count(guid_));
+       global_node_map()[guid_]=this;  
+#endif
+}
+
+Node::~Node()
+{
+       begin_delete();
+
+       if(guid_)
+       {
+               assert(global_node_map().count(guid_));
+               global_node_map().erase(guid_);
+               assert(!global_node_map().count(guid_));
+       }
+}
+
+void
+Node::changed()
+{
+       time_last_changed_=__sys_clock();
+       on_changed();
+}
+
+
+//! Gets the GUID for this value node
+const GUID&
+Node::get_guid()const
+{
+#ifdef BE_FRUGAL_WITH_GUIDS
+       if(!guid_)
+       {
+               guid_.make_unique();
+               assert(guid_);
+               assert(!global_node_map().count(guid_));
+               global_node_map()[guid_]=this;  
+       }
+#endif
+       
+       return guid_;
+}
+
+//! Sets the GUID for this value node
+void
+Node::set_guid(const GUID& x)
+{
+       assert(x);
+
+#ifdef BE_FRUGAL_WITH_GUIDS
+       if(!guid_)
+       {
+               guid_=x;
+               assert(!global_node_map().count(guid_));
+               global_node_map()[guid_]=this;  
+       }
+       else
+#endif
+       if(guid_!=x)
+       {
+               GUID oldguid(guid_);
+               guid_=x;
+               refresh_node(this, oldguid);
+               on_guid_changed(oldguid);
+       }
+}
+
+int
+Node::get_time_last_changed()const
+{
+       return time_last_changed_;
+}
+
+void
+Node::add_child(Node*x)
+{
+       x->parent_set.insert(this);
+}
+
+void
+Node::remove_child(Node*x)
+{
+       if(x->parent_set.count(this)) x->parent_set.erase(this);
+}
+
+int
+Node::parent_count()const
+{
+       return parent_set.size();
+}
+
+const Node::time_set &
+Node::get_times() const
+{
+       if(bchanged)
+       {
+               times.clear();
+               get_times_vfunc(times);
+               bchanged = false;
+       }
+       
+       //set the output set...
+       return times;
+}
+
+void
+Node::begin_delete()
+{
+       if(!deleting_)
+       {
+               deleting_=true; signal_deleted()();
+       }
+}
+
+void
+Node::on_changed()
+{
+       bchanged = true;
+       signal_changed()();
+
+       std::set<Node*>::iterator iter;
+       for(iter=parent_set.begin();iter!=parent_set.end();++iter)
+       {
+               (*iter)->changed();
+       }
+}
+
+void
+Node::on_guid_changed(GUID guid)
+{
+       signal_guid_changed()(guid);
+}
diff --git a/synfig-core/trunk/src/synfig/node.h b/synfig-core/trunk/src/synfig/node.h
new file mode 100644 (file)
index 0000000..ac87725
--- /dev/null
@@ -0,0 +1,243 @@
+/* === S I N F G =========================================================== */
+/*!    \file node.h
+**     \brief Template Header
+**
+**     $Id: node.h,v 1.3 2005/01/10 07:40:26 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_PARENTNODE_H
+#define __SINFG_PARENTNODE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <sigc++/signal.h>
+#include <set>
+#include "time.h"
+#include "guid.h"
+#include <ETL/handle>
+#include "interpolation.h"
+#include "mutex.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class TimePoint
+{
+       GUID guid;
+       Time time;
+       Interpolation before,after;
+public:
+
+       TimePoint(const Time& x=Time::begin()):
+               guid(0),
+               time(x),
+               before(INTERPOLATION_NIL),
+               after(INTERPOLATION_NIL)
+       {
+       }
+
+       const GUID& get_guid()const { return guid; }
+       const Time& get_time()const { return time; }
+       Interpolation get_before()const { return before; }
+       Interpolation get_after()const { return after; }
+
+       void set_guid(const GUID& x) { guid=x; }
+       void set_time(const Time& x) { time=x; }
+       void set_before(Interpolation x) { before=x; }
+       void set_after(Interpolation x) { after=x; }
+       
+       void absorb(const TimePoint& x);
+}; // END of class TimePoint
+
+inline TimePoint operator+(TimePoint lhs,const Time& rhs)
+       { lhs.set_time(lhs.get_time()+rhs); return lhs; }
+
+inline bool operator<(const TimePoint& lhs,const TimePoint& rhs)
+       { return lhs.get_time()<rhs.get_time(); }
+
+inline bool operator<(const TimePoint& lhs,const Time& rhs)
+       { return lhs.get_time()<rhs; }
+
+inline bool operator<(const Time& lhs,const TimePoint& rhs)
+       { return lhs<rhs.get_time(); }
+
+inline bool operator==(const TimePoint& lhs,const TimePoint& rhs)
+       { return lhs.get_time()==rhs.get_time(); }
+
+inline bool operator!=(const TimePoint& lhs,const TimePoint& rhs)
+       { return lhs.get_time()!=rhs.get_time(); }
+
+class TimePointSet : public std::set<TimePoint>
+{
+public:
+       iterator insert(const TimePoint& x);
+
+       template <typename ITER> void insert(ITER begin, ITER end)
+               { for(;begin!=end;++begin) insert(*begin); }
+
+}; // END of class TimePointSet
+       
+class Node : public etl::rshared_object
+{
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public: 
+       
+       //! \writeme
+       typedef TimePointSet    time_set;
+
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+private:
+
+       //! \writeme
+       GUID guid_;
+
+       //! cached time values for all the childrens
+       mutable time_set        times;
+
+       //! \writeme
+       mutable bool            bchanged;
+
+       //! \writeme
+       mutable int time_last_changed_;
+
+       //! \writeme
+       mutable RWLock rw_lock_;
+       
+       //! \writeme
+       bool deleting_;
+
+public:
+
+       //! \todo This should really be private
+       std::set<Node*>         parent_set;
+
+       /*
+ -- ** -- S I G N A L S -------------------------------------------------------
+       */
+
+private:
+       
+       sigc::signal<void> signal_changed_;
+
+       //!     GUID Changed
+       /*! \note The second parameter is the *OLD* guid! */
+       sigc::signal<void,GUID> signal_guid_changed_;   
+
+       //!     Deleted
+       sigc::signal<void> signal_deleted_;     
+
+       /*
+ -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
+       */
+
+public:
+
+       sigc::signal<void>& signal_deleted() { return signal_deleted_; }
+
+       sigc::signal<void>& signal_changed() { return signal_changed_; }
+
+       //!     GUID Changed
+       /*! \note The second parameter is the *OLD* guid! */
+       sigc::signal<void,GUID>& signal_guid_changed() { return signal_guid_changed_; }
+
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+protected:
+
+       Node();
+
+       // This class cannot be copied -- use clone() if necessary
+private:
+       Node(const Node &x);
+
+public:
+       virtual ~Node();
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+       
+public:
+
+       void changed();
+
+       //! Gets the GUID for this value node
+       const GUID& get_guid()const;
+
+       //! Sets the GUID for this value node
+       void set_guid(const GUID& x);
+
+       int get_time_last_changed()const;
+       
+       void add_child(Node*x);
+
+       void remove_child(Node*x);
+
+       int parent_count()const;
+       
+       const time_set &get_times() const;
+
+       RWLock& get_rw_lock()const { return rw_lock_; }
+       
+protected:
+       
+       void begin_delete();
+       
+       /*
+ --    ** -- V I R T U A L   F U N C T I O N S -----------------------------------
+       */
+
+protected:
+       virtual void on_changed();
+
+       virtual void on_guid_changed(GUID guid);
+
+       /*!     Function to be overloaded that fills 
+       */
+       virtual void get_times_vfunc(time_set &set) const = 0;
+};     
+
+sinfg::Node* sinfg::find_node(const sinfg::GUID& guid);
+
+template<typename T> etl::handle<T>
+guid_cast(const sinfg::GUID& guid)
+{
+       return etl::handle<T>::cast_dynamic(sinfg::find_node(guid));
+}
+
+typedef etl::handle<Node> NodeHandle;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/palette.cpp b/synfig-core/trunk/src/synfig/palette.cpp
new file mode 100644 (file)
index 0000000..4ff3a66
--- /dev/null
@@ -0,0 +1,321 @@
+/* === S I N F G =========================================================== */
+/*!    \file template.cpp
+**     \brief Template File
+**
+**     $Id: palette.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "palette.h"
+#include "surface.h"
+#include "general.h"
+#include <fstream>
+#include <iostream>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+#define PALETTE_FILE_COOKIE    "SINFGPAL1.0"
+
+/* === G L O B A L S ======================================================= */
+
+bool weight_less_than(const PaletteItem& lhs,const PaletteItem& rhs)
+{
+       return lhs.weight<rhs.weight;
+}
+
+bool luma_less_than(const PaletteItem& lhs,const PaletteItem& rhs)
+{
+       return lhs.color.get_y()<rhs.color.get_y();
+}
+
+bool luma_less_than(const PaletteItem& lhs,const float& rhs)
+{
+       return lhs.color.get_y()<rhs;
+}
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Palette::Palette():
+       name_(_("Unnamed"))
+{
+}
+
+Palette::Palette(const String& name_):
+       name_(name_)
+{
+}
+
+void
+PaletteItem::add(const Color& x,int xweight)
+{
+       color=(color*weight+x*xweight)/(weight+xweight);
+       weight+=xweight;
+}
+
+Palette::Palette(const Surface& surface, int max_colors):
+       name_(_("Surface Palette"))
+{      
+       max_colors-=2;
+       for(int y=0;y<surface.get_h();y++)
+               for(int x=0;x<surface.get_w();x++)
+               {
+                       float dist;
+                       Color color(surface[y][x]);
+                                               
+                       if(empty())
+                       {
+                               push_back(color);
+                               continue;
+                       }
+
+                       if(color.get_a()==0)
+                       {
+                               if(front().color.get_a()!=0)
+                                       insert(begin(),Color(1,0,1,0));
+                               front().weight+=400;
+                               continue;
+                       }
+
+                       iterator iter(find_closest(color,&dist));
+                       if(sqrt(dist)<0.005)
+                       {
+                               iter->add(color);
+                               continue;
+                       }
+                       
+                       /*if(size()>=max_colors)
+                       {
+                               iterator iterlight(find_light());
+                               PaletteItem light(*iterlight);
+                               erase(iterlight);
+                               find_closest(light.color)->add(light.color,light.weight);
+                       }
+                       */
+                       
+                       push_back(color);
+                       continue;                       
+               }
+       sort(rbegin(),rend());
+
+       iterator iter;
+
+       iterator best_match(begin());
+       while((signed)size()>max_colors)
+       {
+               PaletteItem item(back());
+               pop_back();
+               find_closest(item.color)->add(item.color,item.weight);
+       }
+       push_back(Color::black());
+       push_back(Color::white());
+
+//     sort(begin(),end(),&luma_less_than);
+}
+
+Palette::const_iterator
+Palette::find_closest(const Color& color, float* dist)const
+{
+       // For the sake of avoiding cut-and-paste
+       // bugs, we'll just use the non-const
+       // find_closest()... It doesn't change anything
+       // anyway.
+       return const_cast<Palette*>(this)->find_closest(color,dist);
+}
+
+Palette::iterator
+Palette::find_closest(const Color& color, float* dist)
+{
+       iterator iter;
+
+       iterator best_match(begin());
+       float best_dist(1000000);
+
+       const float prep_y(powf(color.get_y(),2.2f)*color.get_a());
+       const float prep_u(color.get_u());
+       const float prep_v(color.get_v());
+       
+       for(iter=begin();iter!=end();++iter)
+       {
+               const float diff_y(prep_y-powf(iter->color.get_y(),2.2f)*iter->color.get_a());
+               const float diff_u(prep_u-iter->color.get_u());
+               const float diff_v(prep_v-iter->color.get_v());
+               const float diff_a(color.get_a()-iter->color.get_a());
+
+
+               const float dist(
+                       diff_y*diff_y*1.5f+
+                       diff_a*diff_a+
+
+                       diff_u*diff_u+  
+                       diff_v*diff_v
+                       
+                       // cross product
+                       /*abs(
+                               prep_u*iter->color.get_u()-     
+                               prep_v*iter->color.get_v()
+                       )*/
+               );
+               if(dist<best_dist)
+               {
+                       best_dist=dist;
+                       best_match=iter;
+               }
+       }
+       if(dist)
+               *dist=best_dist;
+       
+       return best_match;
+}
+
+
+Palette::iterator
+Palette::find_heavy()
+{
+       iterator iter;
+
+       iterator best_match(begin());
+       
+       for(iter=begin();iter!=end();++iter)
+       {
+               if(iter->weight>best_match->weight)
+                       best_match=iter;
+       }
+       
+       return best_match;
+}
+
+Palette::iterator
+Palette::find_light()
+{
+       iterator iter;
+
+       iterator best_match(begin());
+       
+       for(iter=begin();iter!=end();++iter)
+       {
+               if(iter->weight<best_match->weight)
+                       best_match=iter;
+       }
+       
+       return best_match;
+}
+
+Palette
+Palette::grayscale(int steps)
+{
+       Palette ret;
+       for(int i=0;i<steps;i++)
+       {
+               float amount(i/(steps-1));
+               float y(powf(amount,2.2f));
+               ret.push_back(
+                       PaletteItem(
+                               Color(y,y,y),
+                               strprintf(_("%0.2f%% Gray"),amount)
+                       )
+               );
+       }
+       return ret;
+}
+
+void
+Palette::save_to_file(const sinfg::String& filename)const
+{
+       const_iterator iter;
+
+       std::ofstream file(filename.c_str());
+       
+       if(!file)
+               throw strprintf(_("Unable to open %s for write"),filename.c_str());
+       
+       file<<PALETTE_FILE_COOKIE<<endl;
+       file<<name_<<endl;      
+       for(iter=begin();iter!=end();++iter)
+       {
+               file<<iter->name<<endl;
+               file
+                       <<iter->color.get_r()<<endl
+                       <<iter->color.get_g()<<endl
+                       <<iter->color.get_b()<<endl
+                       <<iter->color.get_a()<<endl;
+               
+       }
+}
+
+Palette
+Palette::load_from_file(const sinfg::String& filename)
+{
+       std::ifstream file(filename.c_str());
+       
+       if(!file)
+               throw strprintf(_("Unable to open %s for read"),filename.c_str());
+       
+       Palette ret;
+       String line;
+       
+       getline(file,line);
+
+       if(line!=PALETTE_FILE_COOKIE)
+               throw strprintf(_("%s does not appear to be a palette file"),filename.c_str());
+
+       getline(file,ret.name_);
+       
+       while(!file.eof())
+       {
+               PaletteItem item;
+               getline(file,item.name);
+               if(!file.eof())break;
+
+               getline(file,line);
+               if(!file.eof())break;
+               item.color.set_r(atof(line.c_str()));
+
+               getline(file,line);
+               if(!file.eof())break;
+               item.color.set_g(atof(line.c_str()));
+
+               getline(file,line);
+               if(!file.eof())break;
+               item.color.set_b(atof(line.c_str()));
+
+               getline(file,line);
+               if(!file.eof())break;
+               item.color.set_a(atof(line.c_str()));
+               
+               ret.push_back(item);
+       }
+       
+       return ret;
+}
diff --git a/synfig-core/trunk/src/synfig/palette.h b/synfig-core/trunk/src/synfig/palette.h
new file mode 100644 (file)
index 0000000..066e4e0
--- /dev/null
@@ -0,0 +1,93 @@
+/* === S I N F G =========================================================== */
+/*!    \file Palette.h
+**     \brief Template Header
+**
+**     $Id: palette.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_PALETTE_H
+#define __SINFG_PALETTE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "color.h"
+#include "string.h"
+#include <vector>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Surface;
+       
+struct PaletteItem
+{
+       Color color;
+       String name;
+       int weight;
+       
+       PaletteItem():weight(1) { }
+
+       PaletteItem(const Color& color, const String& name, int weight=1):
+               color(color),name(name),weight(weight) { }
+
+       PaletteItem(const Color& color, int weight=1):
+               color(color),weight(weight) { }
+               
+       void add(const Color& x, int weight=1);
+               
+       bool operator<(const PaletteItem& rhs)const { return weight<rhs.weight; }
+}; // END of struct PaletteItem
+
+class Palette : public std::vector<PaletteItem>
+{
+       String name_;
+       
+public:
+       Palette();
+       Palette(const String& name_);
+       
+       /*! Generates a palette for the given
+       **      surface
+       */
+       Palette(const Surface& surface, int size=256);
+
+       iterator find_closest(const Color& color, float* dist=0);
+       const_iterator find_closest(const Color& color, float* dist=0)const;
+
+       iterator find_heavy();
+       
+       iterator find_light();
+
+       static Palette grayscale(int steps=16);
+
+       void save_to_file(const sinfg::String& filename)const;
+
+       static Palette load_from_file(const sinfg::String& filename);
+}; // END of class Palette
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/paramdesc.cpp b/synfig-core/trunk/src/synfig/paramdesc.cpp
new file mode 100644 (file)
index 0000000..0734782
--- /dev/null
@@ -0,0 +1,98 @@
+/* === S I N F G =========================================================== */
+/*!    \file paramdesc.cpp
+**     \brief Template File
+**
+**     $Id: paramdesc.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "paramdesc.h"
+#include "value.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ParamDesc::ParamDesc(sinfg::Color::BlendMethod, const String &a):
+       name_                   (a),
+       local_name_             (a),
+       scalar_                 (1.0),
+       critical_               (true),
+       hidden_                 (false),
+       invisible_duck_ (false),
+               is_distance_    (false),
+               animation_only_ (false)
+{
+       set_local_name(_("Blend Method"))
+       .set_hint("enum")
+       .add_enum_value(Color::BLEND_COMPOSITE,"composite",_("Composite"))
+       .add_enum_value(Color::BLEND_STRAIGHT,"straight",_("Straight"))
+       .add_enum_value(Color::BLEND_ONTO,"onto",_("Onto"))
+       .add_enum_value(Color::BLEND_STRAIGHT_ONTO,"straightonto",_("StraightOnto"))
+       .add_enum_value(Color::BLEND_BEHIND,"behind",_("Behind"))
+       .add_enum_value(Color::BLEND_SCREEN,"screen",_("Screen"))
+       .add_enum_value(Color::BLEND_OVERLAY,"overlay",_("Overlay"))
+       .add_enum_value(Color::BLEND_HARD_LIGHT,"hard_light",_("Hard Light"))
+       .add_enum_value(Color::BLEND_MULTIPLY,"multiply",_("Multiply"))
+       .add_enum_value(Color::BLEND_DIVIDE,"divide",_("Divide"))
+       .add_enum_value(Color::BLEND_ADD,"add",_("Add"))
+       .add_enum_value(Color::BLEND_SUBTRACT,"subtract",_("Subtract"))
+       .add_enum_value(Color::BLEND_DIFFERENCE,"difference",_("Difference"))
+       .add_enum_value(Color::BLEND_BRIGHTEN,"brighten",_("Brighten"))
+       .add_enum_value(Color::BLEND_DARKEN,"darken",_("Darken"))
+       .add_enum_value(Color::BLEND_COLOR,"color",_("Color"))
+       .add_enum_value(Color::BLEND_HUE,"hue",_("Hue"))
+       .add_enum_value(Color::BLEND_SATURATION,"saturation",_("Saturation"))
+       .add_enum_value(Color::BLEND_LUMINANCE,"luminance",_("Luminance"))
+// These are deprecated
+       .add_enum_value(Color::BLEND_ALPHA_OVER,"alphaover",_("Alpha Over"))
+//     .add_enum_value(Color::BLEND_ALPHA_BRIGHTEN,"alphabrighten",_("Alpha Brighten"))
+//     .add_enum_value(Color::BLEND_ALPHA_DARKEN,"alphadarken",_("Alpha Darken"))
+       ; // end of enums
+}
+
+ParamDesc::ParamDesc(const ValueBase&, const String &a):
+       name_                   (a),
+       local_name_             (a),
+       scalar_                 (1.0),
+       critical_               (true),
+       hidden_                 (false),
+       invisible_duck_ (false),
+               is_distance_    (false),
+               animation_only_ (false)
+{
+}
diff --git a/synfig-core/trunk/src/synfig/paramdesc.h b/synfig-core/trunk/src/synfig/paramdesc.h
new file mode 100644 (file)
index 0000000..3daf7a3
--- /dev/null
@@ -0,0 +1,226 @@
+/* === S I N F G =========================================================== */
+/*!    \file paramdesc.h
+**     \brief ParamDesc Class Implementation
+**
+**     $Id: paramdesc.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_PARAMDESC_H
+#define __SINFG_PARAMDESC_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "string.h"
+#include "real.h"
+#include "color.h"
+#include <list>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueBase;
+       
+/*!    \class ParamDesc
+**     \brief Parameter Description Class
+**     \todo writeme
+*/
+class ParamDesc
+{
+public:
+
+       //! \writeme
+       struct EnumData
+       {
+               int value;
+               String name;
+               String local_name;
+               EnumData(int value, const String &name, const String &local_name):
+                       value(value),
+                       name(name),
+                       local_name(local_name)
+               {
+               }
+       };
+       
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+private:
+       String name_;                   //! The actual parameter name
+       String local_name_;     //! Localized name
+       String desc_;                   //! Short description of parameter (Think tooltops)
+       String group_;                  //! Which group this parameter is a member of (optional)
+       String hint_;                   //! Parameter hint
+       String origin_;                 //! Parameter origin
+       String connect_;
+       String box_;
+       Real scalar_;                   //! Scalar value for visual editing
+       bool critical_;
+       bool hidden_;
+       bool invisible_duck_;
+       bool is_distance_;
+       bool animation_only_;
+
+       std::list<EnumData> enum_list_;
+       
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+public:
+
+       ParamDesc(const String &a="IM_A_BUG_SO_REPORT_ME"):
+               name_                   (a),
+               local_name_             (a),
+               scalar_                 (1.0),
+               critical_               (true),
+               hidden_                 (false),
+               invisible_duck_ (false),
+               is_distance_    (false),
+               animation_only_ (false)
+       { }
+
+       ParamDesc(const ValueBase&, const String &a);
+
+       ParamDesc(sinfg::Color::BlendMethod, const String &a);
+
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //! \writeme
+       const std::list<EnumData> &get_enum_list()const { return enum_list_; }
+       
+       //! Sets the localized name of the parameter.
+       ParamDesc &set_local_name(const String &n) { local_name_=n; return *this; }
+
+       //! Sets the localized description of the parameter.
+       ParamDesc &set_description(const String &d) { desc_=d; return *this; }
+
+       //! Sets the group that this parameter is a member of
+       ParamDesc &set_group(const String &n) { group_=n; return *this; }
+
+       //! Sets a "hint" for the parameter.
+       ParamDesc &set_hint(const String &h) { hint_=h; return *this; }
+
+       //! \writeme
+       ParamDesc &set_connect(const String &h) { connect_=h; return *this; }
+
+       //! \writeme
+       ParamDesc &set_box(const String &h) { box_=h; return *this; }
+
+       //! Sets a flag regarding the duck visibility
+       ParamDesc &set_invisible_duck(bool x=true) { invisible_duck_=x; return *this; }
+
+       //! Returns the flag regarding duck visibility
+       bool get_invisible_duck() { return invisible_duck_; }
+
+       
+       //! \writeme
+       ParamDesc &set_animation_only(bool x=true) { animation_only_=x; return *this; }
+
+       //! \writeme
+       bool get_animation_only() { return animation_only_; }
+
+       
+       //! Sets which parameter is to be used as the origin when the user edits visually.
+       ParamDesc &set_origin(const String &h) { origin_=h; return *this; }
+
+       //! Sets the scalar value for the parameter
+       /*! This value determines how the value is to be presented
+       **      to the user when editing visually. */
+       ParamDesc &set_scalar(const Real &n) { scalar_=n; return *this; }
+       ParamDesc &set_scalar(const String &h) { hint_=h; return *this; }
+
+       //!     Marks the parameter as not necessary for saving or copying
+       ParamDesc &not_critical() { critical_=false; return *this; }
+
+       //!     \writeme
+       ParamDesc &hidden() { hidden_=true; return *this; }
+
+       //!     Marks the parameter as only readable. Implies not_critical()
+       /*!     \todo This function needs to be written, as it is only a stub */
+       ParamDesc &read_only() { return *this; }
+
+       //!     Marks the parameter as only writable. Implies not_critical()
+       /*!     \todo This function needs to be written, as it is only a stub */
+       ParamDesc &write_only() { return *this; }
+
+       //! Adds a description of a possible enumeration value
+       /*!     Only relevant if the parameter is of an integer type and hint set to \c "enum" . */
+       ParamDesc &add_enum_value(int val, const String &enum_name,const String &enum_local_name)
+               { enum_list_.push_back(EnumData(val,enum_name,enum_local_name)); return *this; }
+
+       //! Returns the localized name of the parameter
+       const String &get_local_name()const { return local_name_; }
+
+       //! Returns the name of the parameter
+       const String &get_name()const { return name_; }
+
+       //! Returns the localized description of the parameter
+       const String &get_description()const { return desc_; }
+
+       //! Returns the paramater's group
+       const String &get_group()const { return group_; }
+
+       //! Returns a "hint" about the parameter, regarding how it is to be displayed to the user
+       const String &get_hint()const { return hint_; }
+
+       //! Returns the name of the parameter that is defined as the "origin". Used for visual editing.
+       const String &get_origin()const { return origin_; }
+
+       //! \writeme
+       const String &get_connect()const { return connect_; }
+
+               //! \writeme
+       const String &get_box()const { return box_; }
+
+       //! Returns the scalar value for the parameter. Used for visual editing.
+       const Real &get_scalar()const { return scalar_; }
+
+       //! Returns \c true if the layer is critical, \c false otherwise.
+       bool get_critical()const { return critical_; }
+
+       //! Returns \c true if the layer is hidden, \c false otherwise.
+       bool get_hidden()const { return hidden_; }
+
+       
+       
+       ParamDesc& set_is_distance(bool x=true) { is_distance_=x; return *this;}
+       bool get_is_distance()const { return is_distance_; }
+}; // END of class ParamDesc
+
+class ParamVocab : public std::list< ParamDesc >
+{
+};
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/pch.h b/synfig-core/trunk/src/synfig/pch.h
new file mode 100644 (file)
index 0000000..08a60d6
--- /dev/null
@@ -0,0 +1,33 @@
+/* ========================================================================
+** Sinfg
+** Pre-Compiled Header
+** $Id: pch.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+** This software and associated documentation
+** are CONFIDENTIAL and PROPRIETARY property of
+** the above-mentioned copyright holder.
+**
+** You may not copy, print, publish, or in any
+** other way distribute this software without
+** a prior written agreement with
+** the copyright holder.
+**
+** === N O T E S ===========================================================
+**
+** ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_PCH_H
+#define __SINFG_PCH_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <iostream>
+#include "sinfg.h"
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/polynomial_root.cpp b/synfig-core/trunk/src/synfig/polynomial_root.cpp
new file mode 100644 (file)
index 0000000..e9cf76d
--- /dev/null
@@ -0,0 +1,266 @@
+/* === S I N F G =========================================================== */
+/*!    \file template.cpp
+**     \brief Template File
+**
+**     $Id: polynomial_root.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "polynomial_root.h"
+#include <complex>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+//using namespace etl;
+//using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+typedef complex<float> Complex;
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+#define EPSS 1.0e-7
+#define MR 8
+#define MT 10
+#define MAXIT (MT*MR)
+
+/*EPSS is the estimated fractional roundoff error.  We try to break (rare) limit
+cycles with MR different fractional values, once every MT steps, for MAXIT total allowed iterations.
+*/
+
+/*     Explanation:
+       
+       A polynomial can be represented like so:
+       Pn(x) = (x - x1)(x - x2)...(x - xn)     where xi = complex roots
+
+       We can get the following:
+       ln|Pn(x)| = ln|x - x1| + ln|x - x2| + ... + ln|x - xn|  
+       
+       G := d ln|Pn(x)| / dx =
+       +1/(x-x1) + 1/(x-x2) + ... + 1/(x-xn)
+       
+       and
+       
+       H := - d2 ln|Pn(x)| / d2x =
+       +1/(x-x1)^2 + 1/(x-x2)^2 + ... + 1/(x-xn)^2
+       
+       which gives
+       H = [Pn'/Pn]^2 - Pn''/Pn
+       
+       Laguerre's formula guesses that the root we are seeking x1 is located 
+       some distance a from our current guess x, and all the other roots are
+       located at distance b.
+       
+       Using this:
+       
+       1/a + (n-1)/b = G
+       
+       and 
+       
+       1/a^2 + (n-1)/b^2 = H
+
+       which yields this solution for a:
+       
+       a = n / G +- sqrt( (n-1)(nH - G^2) )
+       
+       where +- is determined by which ever yields the largest magnitude for the denominator.
+       a can easily be complex since the factor inside the square-root can be negative.
+       
+       This method iterates (x=x-a) until a is sufficiently small.
+*/
+
+/* Given the degree m and the m+1 complex coefficients a[0..m] of the polynomial sum(i=0,m){a[i]x^i},
+and given a complex value x, this routine improves x by laguerre's method until it converges,
+within the acheivable roundoff limit, to a root of teh given polynomial.  The number of iterations taken 
+is returned as its.
+*/
+void laguer(Complex a[], int m, Complex *x, int *its)
+{
+       int iter,j;
+       float abx, abp, abm, err;
+       Complex dx,x1,b,d,f,g,h,sq,gp,gm,g2;
+       
+       //Fractions used to break a limit cycle
+       static float frac[MR+1] = {0.0,0.5,0.25,0.75,0.13,0.38,0.62,0.88,1.0};
+       
+       for(iter = 1; iter <= MAXIT; ++iter)
+       {
+               *its = iter; //number of iterations so far
+               
+               b       = a[m];         //the highest coefficient
+               err     = abs(b);       //its magnitude
+               
+               d = f = Complex(0,0); //clear variables for use
+               abx = abs(*x);  //the magnitude of the current root
+               
+               //Efficent computation of the polynomial and it's first 2 derivatives
+               for(j = m-1; j >= 0; --j)
+               {
+                       f = (*x)*f + d;
+                       d = (*x)*d + b;
+                       b = (*x)*b + a[j];
+                       
+                       err = abs(b) + abx*err;
+               }
+               
+               //Estimate the roundoff error in evaluation polynomial
+               err *= EPSS;
+               
+               //Are we on the root?
+               if(abs(b) < err)
+               {
+                       return;
+               }
+               
+               //General case: use Laguerre's formula
+               //a = n / G +- sqrt( (n-1)(nH - G^2) )
+               //x = x - a
+               
+               g = d / b;      //get G
+               g2 = g * g; //for the sqrt calc
+               
+               h = g2 - 2.0f * (f / b);        //get H
+               
+               sq = pow( (float)(m-1) * ((float)m*h - g2), 0.5f ); //get the sqrt
+               
+               //get the denominator
+               gp = g + sq;
+               gm = g - sq;
+
+               abp = abs(gp);
+               abm = abs(gm);          
+               
+               //get the denominator with the highest magnitude
+               if(abp < abm)
+               {
+                       abp = abm;
+                       gp = gm;
+               }
+                       
+               //if the denominator is positive do one thing, otherwise do the other
+               dx = (abp > 0.0) ? (float)m / gp : polar((1+abx),(float)iter);
+               x1 = *x - dx;
+               
+               //Have we converged?
+               if( *x == x1 )
+               {
+                       return;
+               }
+               
+               //Every so often take a fractional step, to break any limit cycle (itself a rare occurrence).
+               if( iter % MT )
+               {
+                       *x = x1;
+               }else
+               {
+                       *x = *x - (frac[iter/MT]*dx);
+               }
+       }
+       
+       //very unusual - can occur only for complex roots.  Try a different starting guess for the root.
+       //nrerror("too many iterations in laguer");
+       return;
+}
+
+#define EPS 2.0e-6
+#define MAXM 100       //a small number, and maximum anticipated value of m..
+
+/*     Given the degree m ad the m+1 complex coefficients a[0..m] of the polynomial a0 + a1*x +...+ an*x^n
+       the routine successively calls laguer and finds all m complex roots in roots[1..m].
+       The boolean variable polish should be input as true (1) if polishing (also by Laguerre's Method)
+       is desired, false (0) if teh roots will be subsequently polished by other means.
+*/
+void RootFinder::find_all_roots(bool polish)
+{
+       int i,its,j,jj;
+       Complex x,b,c;
+       int m = coefs.size()-1;
+       
+       //make sure roots is big enough
+       roots.resize(m);
+       
+       if(workcoefs.size() < MAXM) workcoefs.resize(MAXM);
+
+       //Copy the coefficients for successive deflation
+       for(j = 0; j <= m; ++j)
+       {
+               workcoefs[j] = coefs[j];
+       }
+       
+       //Loop over each root to be found
+       for(j = m-1; j >= 0; --j)
+       {
+               //Start at 0 to favor convergence to smallest remaining root, and find the root
+               x = Complex(0,0);               
+               laguer(&workcoefs[0],j+1,&x,&its); //must add 1 to get the degree
+               
+               //if it is close enough to a real root, then make it so
+               if(abs(x.imag()) <= 2.0*EPS*abs(x.real()))
+               {
+                       x = Complex(x.real());
+               }
+               
+               roots[j] = x;
+               
+               //forward deflation
+               
+               //the degree is j+1 since j(0,m-1)
+               b = workcoefs[j+1];
+               for(jj = j; jj >= 0; --jj)
+               {
+                       c = workcoefs[jj];
+                       workcoefs[jj] = b;
+                       b = x*b + c;
+               }
+       }
+       
+       //Polish the roots using the undeflated coefficients
+       if(polish)
+       {
+               for(j = 0; j < m; ++j)
+               {
+                       laguer(&coefs[0],m,&roots[j],&its);
+               }
+       }
+       
+       //Sort roots by their real parts by straight insertion
+       for(j = 1; j < m; ++j)
+       {
+               x = roots[j];
+               for( i = j-1; i >= 1; --i)
+               {
+                       if(roots[i].real() <= x.real()) break;
+                       roots[i+1] = roots[i];
+               }
+               roots[i+1] = x;
+       }
+}
diff --git a/synfig-core/trunk/src/synfig/polynomial_root.h b/synfig-core/trunk/src/synfig/polynomial_root.h
new file mode 100644 (file)
index 0000000..a1a5c31
--- /dev/null
@@ -0,0 +1,119 @@
+/* === S I N F G =========================================================== */
+/*!    \file polynomial_root.h
+**     \brief Polynomial Root Finder Header
+**
+**     $Id: polynomial_root.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_POLYNOMIAL_ROOT_H
+#define __SINFG_POLYNOMIAL_ROOT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <complex>
+#include <vector>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+template < typename T = float, typename F = float >
+class Polynomial : public std::vector<T> //a0 + a1x + a2x^2 + ... + anx^n
+{              
+public:
+       
+       //Will maintain all lower constants
+       void degree(unsigned int d, const T & def = (T)0) { resize(d+1,def); }
+       unsigned int degree()const { return size() - 1; }
+       
+       const Polynomial & operator+=(const Polynomial &p)
+       {
+               if(p.size() > size())
+                       resize(p.size(), (T)0);
+               
+               for(int i = 0; i < p.size(); ++i)
+               {
+                       (*this)[i] += p[i];
+               }
+               return *this;
+       }
+       
+       const Polynomial & operator-=(const Polynomial &p)
+       {
+               if(p.size() > size())
+                       resize(p.size(), (T)0);
+               
+               for(int i = 0; i < p.size(); ++i)
+               {
+                       (*this)[i] -= p[i];
+               }
+               return *this;
+       }
+       
+       const Polynomial & operator*=(const Polynomial &p)
+       {
+               if(p.size() < 1)
+               {
+                       resize(0);
+                       return *this;
+               }
+               
+               unsigned int i,j;
+               std::vector<T> nc(*this);
+               
+               //in place for constant stuff
+               for(i = 0; i < nc.size(); ++i)
+               {
+                       (*this)[i] *= p[0];
+               }
+               
+               if(p.size() < 2) return *this;
+                       
+               resize(size() + p.degree());            
+               for(int i = 0; i < nc.size(); ++i)
+               {
+                       for(int j = 1; j < p.size(); ++j)
+                       {
+                               nc[i+j] += nc[i]*p[j];
+                       }
+               }
+               
+               return *this;
+       }       
+};
+
+class RootFinder
+{
+       std::vector< std::complex<float> >      workcoefs;
+       int     its;
+       
+public:
+       std::vector< std::complex<float> >      coefs; //the number of coefficients determines the degree of polynomial
+
+       std::vector< std::complex<float> >      roots;
+
+       void find_all_roots(bool polish);
+};
+
+
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/proto/Makefile b/synfig-core/trunk/src/synfig/proto/Makefile
new file mode 100644 (file)
index 0000000..68ce978
--- /dev/null
@@ -0,0 +1,18 @@
+
+M4=m4
+
+PROTO_PP=$(M4) proto.m4
+
+FILES=nodebase.h
+
+all: $(FILES)
+
+clean:
+       $(RM) $(FILES)
+
+SUFFIXES=.px .h
+
+.SUFFIXES: $(SUFFIXES)
+
+.px.h: proto.m4
+       $(PROTO_PP) $< > $@
diff --git a/synfig-core/trunk/src/synfig/proto/nodebase.px b/synfig-core/trunk/src/synfig/proto/nodebase.px
new file mode 100644 (file)
index 0000000..19b4ea2
--- /dev/null
@@ -0,0 +1,73 @@
+/* === S I N F G =========================================================== */
+/*!    \file nodebase.h
+**     \brief Template Header
+**
+**     $Id: template.h,v 1.1.1.1 2005/01/04 01:23:09 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_NODEBASE_H
+#define __SINFG_NODEBASE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "../protocol.h"
+#include "../string.h"
+#include "../guid.h"
+#include <sigc++/slot.h>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+namespace Proto {
+
+typedef int Query;
+typedef int NodeList;
+
+class NodeBase : public Protocol
+{
+public:
+
+       PX_DEFINE_DATA(guid, GUID)
+
+       PX_DEFINE_FUNC(func_test, float, int, int)
+
+       PX_DEFINE_DATA(id, String)
+
+       PX_DEFINE_DATA(root, NodeHandle)
+
+       PX_DEFINE_FUNC(signal_changed, sigc::signal<void>)
+       PX_DEFINE_FUNC(signal_deleted, sigc::signal<void>)
+               
+       PX_DEFINE_FUNC_CONST(get_parents, const NodeList)
+       PX_DEFINE_FUNC_CONST(get_children, const NodeList)
+
+       PX_DEFINE_FUNC(query_children, NodeList, Query)
+
+}; // END of class Proto::NodeBase
+
+}; // END of namespace Proto
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/proto/proto.m4 b/synfig-core/trunk/src/synfig/proto/proto.m4
new file mode 100644 (file)
index 0000000..91800eb
--- /dev/null
@@ -0,0 +1,37 @@
+dnl
+
+ define(`forloop',
+               `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
+ define(`_forloop',
+               `$4`'ifelse($1, `$3', ,
+                          `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
+
+define(`_PRINT_ARGS',`dnl
+ifelse($#,1,,`$2 v$1`'ifelse($#,2,,`, _PRINT_ARGS(incr($1), shift(shift($@)))')')dnl
+')dnl
+
+define(`_PRINT_ARGS2',`dnl
+ifelse($#,1,,`v$1`'ifelse($#,2,,`, _PRINT_ARGS2(incr($1), shift(shift($@)))')')dnl
+')dnl
+
+dnl PX_DEFINE_FUNC(func_name, ret_type, args...)
+define(`PX_DEFINE_FUNC',`
+       sigc::slot< $2`'ifelse($#,2,,`, shift(shift($@))') > _slot_$1;
+       $2 $1(ifelse($#,2,,`_PRINT_ARGS(1,shift(shift($@)))')) {
+               return _slot_$1(ifelse($#,2,,`_PRINT_ARGS2(1,shift(shift($@)))'));
+       }
+')dnl
+
+dnl PX_DEFINE_FUNC_CONST(func_name, ret_type, args...)
+define(`PX_DEFINE_FUNC_CONST',`
+       sigc::slot< $2`'ifelse($#,2,,`, shift(shift($@))') > _slot_$1_const;
+       $2 $1(ifelse($#,2,,`_PRINT_ARGS(1,shift(shift($@)))'))const {
+               return _slot_$1_const(ifelse($#,2,,`_PRINT_ARGS2(1,shift(shift($@)))'));
+       }
+')dnl
+
+define(`PX_DEFINE_DATA', `dnl
+PX_DEFINE_FUNC_CONST(get_$1, $2)
+PX_DEFINE_FUNC(set_$1, void, $2)
+')dnl
+
diff --git a/synfig-core/trunk/src/synfig/protocol.h b/synfig-core/trunk/src/synfig/protocol.h
new file mode 100644 (file)
index 0000000..33ec3f1
--- /dev/null
@@ -0,0 +1,65 @@
+/* === S I N F G =========================================================== */
+/*!    \file protocol.h
+**     \brief Template Header
+**
+**     $Id: template.h,v 1.1.1.1 2005/01/04 01:23:09 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_PROTOCOL_H
+#define __SINFG_PROTOCOL_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <sigc++/signal.h>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Object
+{
+public:
+       
+       sigc::signal_
+       bool find_protocol(Protocol& proto)
+       {
+               
+       }
+};
+
+class Protocol
+{
+public:
+       class Type;
+       
+}; // END of class Protocol
+
+class Protocol::Type
+{
+}; // END of class Protocol::Type
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/real.h b/synfig-core/trunk/src/synfig/real.h
new file mode 100644 (file)
index 0000000..edc65ed
--- /dev/null
@@ -0,0 +1,40 @@
+/* === S I N F G =========================================================== */
+/*!    \file real.h
+**     \brief Provides the sinfg::Real typedef
+**
+**     $Id: real.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_REAL_H
+#define __SINFG_REAL_H
+
+/* === T Y P E D E F S ===================================================== */
+
+namespace sinfg {
+
+/*!    \typedef Real
+**     \todo writeme
+*/
+typedef double Real;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/rect.cpp b/synfig-core/trunk/src/synfig/rect.cpp
new file mode 100644 (file)
index 0000000..a420ea0
--- /dev/null
@@ -0,0 +1,59 @@
+/* === S I N F G =========================================================== */
+/*!    \file rect.cpp
+**     \brief Template File
+**
+**     $Id: rect.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "rect.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Rect
+Rect::full_plane()
+{
+       const double infinity(HUGE_VAL);
+       return Rect(
+               -infinity,
+               -infinity,
+               infinity,
+               infinity
+       );
+}
diff --git a/synfig-core/trunk/src/synfig/rect.h b/synfig-core/trunk/src/synfig/rect.h
new file mode 100644 (file)
index 0000000..87f8dc5
--- /dev/null
@@ -0,0 +1,173 @@
+/* === S I N F G =========================================================== */
+/*!    \file rect.h
+**     \brief Rectangle Class
+**
+**     $Id: rect.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_RECT_H
+#define __SINFG_RECT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/rect>
+#include "real.h"
+#include "vector.h"
+#include <limits>
+#include <cmath>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Rect : public etl::rect<Real>
+{
+public:
+
+       using etl::rect<Real>::set_point;
+       using etl::rect<Real>::expand;
+       using etl::rect<Real>::set;
+
+       static Rect full_plane();
+
+       static Rect zero()
+       {
+               return Rect(
+                       0,
+                       0,
+                       0,
+                       0
+               );
+       }
+
+       Rect() { }
+
+       Rect(const Point& x) { set_point(x); }
+
+       Rect(const Point& min, const Point& max) { set_point(min); expand(max); }
+
+       Rect(const value_type &x1,const value_type &y1) { set_point(x1,y1); }
+       
+       Rect(const value_type &x1,const value_type &y1,
+                       const value_type &x2,const value_type &y2)
+       {
+               set_point(x1,y1);
+               expand(x2,y2);
+       }
+               
+       void set_point(const Point& max) { set_point(max[0],max[1]);    }
+       
+       Rect& expand(const Point& max) { expand(max[0],max[1]); return *this; }
+
+       Rect& expand(const Real& r) { minx-=r; miny-=r; maxx+=r; maxy+=r; return *this; }
+
+       Rect& expand_x(const Real& r) { minx-=r; maxx+=r; return *this; }
+
+       Rect& expand_y(const Real& r) { miny-=r; maxy+=r; return *this; }
+       
+       Rect& set(const Point& min,const Point& max) { set(min[0],min[1],max[0],max[1]); return *this; }
+       
+       Point get_min()const { return Point(minx,miny); }
+       Point get_max()const { return Point(maxx,maxy); }
+       
+       bool is_inside(const Point& x) { return x[0]>minx && x[0]<maxx && x[1]>miny && x[1]<maxy; }
+               
+       Real area()const
+       {
+               return (maxx-minx)*(maxy-miny);
+       }
+       
+       // Operators
+       
+       Rect& operator+=(const Vector& rhs)
+       {
+               minx+=rhs[0]; miny+=rhs[1];
+               maxx+=rhs[0]; maxy+=rhs[1];
+               return *this;
+       }
+
+       Rect& operator-=(const Vector& rhs)
+       {
+               minx-=rhs[0]; miny-=rhs[1];
+               maxx-=rhs[0]; maxy-=rhs[1];
+               return *this;
+       }
+
+       Rect& operator*=(const Real& rhs)
+       {
+               minx*=rhs; miny*=rhs;
+               maxx*=rhs; maxy*=rhs;
+               return *this;
+       }
+
+       Rect& operator/=(Real rhs)
+       {
+               rhs=1.0/rhs; // Avoid doing several divisions
+               minx*=rhs; miny*=rhs;
+               maxx*=rhs; maxy*=rhs;
+               return *this;
+       }
+
+       Rect& operator&=(const Rect& rhs)
+       {
+               if(rhs.area()>0.00000001 && area()>0.00000001)
+                       etl::set_intersect(*this,*this,rhs);
+               else
+                       *this=zero();
+               return *this;
+       }
+
+       Rect& operator|=(const Rect& rhs)
+       {
+               if(rhs.area()>0.00000001 && area()>0.00000001)
+                       etl::set_union(*this,*this,rhs);
+               else
+               {
+                       if(area()<rhs.area())
+                               *this=rhs;
+               }
+               return *this;
+       }
+
+       Rect operator+(const Vector& rhs)const { return Rect(*this)+=rhs; }
+
+       Rect operator-(const Vector& rhs)const { return Rect(*this)-=rhs; }
+
+       Rect operator*(const Real& rhs)const { return Rect(*this)*=rhs; }
+
+       Rect operator/(const Real& rhs)const { return Rect(*this)/=rhs; }
+
+       Rect operator&(const Rect& rhs)const { return Rect(*this)&=rhs; }
+
+       Rect operator|(const Rect& rhs)const { return Rect(*this)|=rhs; }
+
+       bool operator&&(const Rect& rhs)const { return etl::intersect(*this, rhs); }
+
+       bool is_valid()const { return valid(); }
+}; // END of class Rect
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/renddesc.cpp b/synfig-core/trunk/src/synfig/renddesc.cpp
new file mode 100644 (file)
index 0000000..0973b81
--- /dev/null
@@ -0,0 +1,558 @@
+/* === S I N F G =========================================================== */
+/*!    \file renddesc.h_
+**     \brief RendDesc
+**
+**     $Id: renddesc.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "renddesc.h"
+#include <ETL/misc>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+RendDesc &
+RendDesc::apply(const RendDesc &x)
+{
+       operator=(x);
+       return *this;
+}
+
+const Color &
+RendDesc::get_bg_color()const
+{
+       return background;
+}
+
+RendDesc &
+RendDesc::set_bg_color(const Color &bg)
+{
+       background=bg; return *this;
+}
+
+Real
+RendDesc::get_physical_w()const
+{
+       return (Real)get_w()/get_x_res();
+}
+
+Real
+RendDesc::get_physical_h()const
+{
+       return (Real)get_h()/get_y_res();
+}
+
+RendDesc&
+RendDesc::set_physical_w(Real w)
+{
+       set_w(round_to_int(w*get_x_res()));
+       return *this;
+}
+
+RendDesc&
+RendDesc::set_physical_h(Real h)
+{
+       set_h(round_to_int(h*get_y_res()));
+       return *this;
+}
+
+int
+RendDesc::get_w()const
+{
+       return w_;
+}
+
+RendDesc &
+RendDesc::set_w(int x)
+{
+       if(FLAGS(flags,LINK_PX_ASPECT))
+       {
+               h_=h_*x/w_;
+               w_=x;
+       }
+       else if(FLAGS(flags,LINK_PX_AREA))
+       {
+               //! \writeme
+               w_=x;
+       }
+       else if(FLAGS(flags,PX_ASPECT))
+       {
+               Vector d=br_-tl_;
+               float old_span=get_span();
+
+               // If we should preserve image width
+               if(             FLAGS(flags,IM_W)
+                       || (FLAGS(flags,IM_ZOOMIN) && d[1]>d[1]/x*w_)
+                       || (FLAGS(flags,IM_ZOOMOUT) && d[1]<d[1]/x*w_))
+               {
+                       br_[1]-=focus[1];
+                       br_[1]=br_[1]/x*w_;
+                       br_[1]+=focus[1];
+                       tl_[1]-=focus[1];
+                       tl_[1]=tl_[1]/x*w_;
+                       tl_[1]+=focus[1];
+               } else
+               {
+                       br_[0]-=focus[0];
+                       br_[0]=br_[0]/w_*x;
+                       br_[0]+=focus[0];
+                       tl_[0]-=focus[0];
+                       tl_[0]=tl_[0]/w_*x;
+                       tl_[0]+=focus[0];
+               }
+
+               w_=x;
+
+               if(FLAGS(flags,IM_SPAN))
+                       set_span(old_span);
+       }
+       else if(FLAGS(flags,PX_AREA))
+       {
+               //! \writeme
+               w_=x;
+       }
+       else
+               w_=x;
+
+       return *this;
+}
+
+int
+RendDesc::get_h()const
+{
+       return h_;
+}
+
+RendDesc &
+RendDesc::set_h(int y)
+{
+       if(FLAGS(flags,LINK_PX_ASPECT))
+       {
+               w_=w_*y/h_;
+               h_=y;
+       }
+       else if(FLAGS(flags,LINK_PX_AREA))
+       {
+               //! \writeme
+               h_=y;
+       }
+       else if(FLAGS(flags,PX_ASPECT))
+       {
+               Vector d=br_-tl_;
+               float old_span=get_span();
+
+               // If we should preserve image width
+               if(             FLAGS(flags,IM_W)
+                       || (FLAGS(flags,IM_ZOOMIN) && d[0]>d[0]/y*h_)
+                       || (FLAGS(flags,IM_ZOOMOUT) && d[0]<d[0]/y*h_))
+               {
+                       br_[0]-=focus[0];
+                       br_[0]=br_[0]/y*h_;
+                       br_[0]+=focus[0];
+                       tl_[0]-=focus[0];
+                       tl_[0]=tl_[0]/y*h_;
+                       tl_[0]+=focus[0];
+               } else
+               {
+                       br_[1]-=focus[1];
+                       br_[1]=br_[1]/h_*y;
+                       br_[1]+=focus[1];
+                       tl_[1]-=focus[1];
+                       tl_[1]=tl_[1]/h_*y;
+                       tl_[1]+=focus[1];
+               }
+
+               h_=y;
+
+               if(FLAGS(flags,IM_SPAN))
+                       set_span(old_span);
+       }
+       else if(FLAGS(flags,PX_AREA))
+       {
+               //! \writeme
+               h_=y;
+       }
+       else
+               h_=y;
+
+       return *this;
+}
+
+RendDesc &
+RendDesc::set_wh(int x, int y)
+{
+       // FIXME: This is a working hack...
+       set_w(x);
+       set_h(y);
+
+       return *this;
+}
+
+Real
+RendDesc::get_x_res()const
+{
+       return x_res;
+}
+
+RendDesc &
+RendDesc::set_x_res(Real x)
+{
+       x_res=x; return *this;
+}
+
+Real
+RendDesc::get_y_res()const
+{
+       return y_res;
+}
+
+RendDesc &
+RendDesc::set_y_res(Real y)
+{
+       y_res=y; return *this;
+}
+
+int
+RendDesc::get_frame_start()const
+{
+       return time_begin*frame_rate;
+}
+
+RendDesc &
+RendDesc::set_frame_start(int x)
+{
+       return set_time_start(Time(x)/frame_rate);
+}
+
+int
+RendDesc::get_frame_end()const
+{
+       return time_end*frame_rate;
+}
+
+RendDesc &
+RendDesc::set_frame_end(int x)
+{
+       return set_time_end(Time(x)/frame_rate);
+}
+
+
+const Time
+RendDesc::get_time_start()const
+{
+       return time_begin;
+}
+
+RendDesc &
+RendDesc::set_time_start(Time x)
+{
+       if(x>time_end)
+               time_begin=time_end=x;
+       else
+               time_begin=x;
+       return *this;
+}
+
+
+const Time
+RendDesc::get_time_end()const
+{
+       return time_end;
+}
+
+RendDesc &
+RendDesc::set_time_end(Time x)
+{
+       if(x<time_begin)
+               time_end=time_begin=x;
+       else
+               time_end=x;
+       return *this;
+}
+
+RendDesc &
+RendDesc::set_time(Time x)
+{
+       time_end=time_begin=x;
+       return *this;
+}
+
+RendDesc &
+RendDesc::set_frame(int x)
+{
+       return set_time(Time(x)/frame_rate);
+}
+
+const float &
+RendDesc::get_frame_rate()const
+{
+       return frame_rate;
+}
+
+RendDesc &
+RendDesc::set_frame_rate(float x)
+{
+       frame_rate=x;
+       return *this;
+}
+
+const bool &
+RendDesc::get_interlaced()const
+{
+       return interlaced;
+}
+
+RendDesc &
+RendDesc::set_interlaced(bool x)
+{ interlaced=x; return *this; }        
+
+//! Return the status of the clamp flag
+const bool &
+RendDesc::get_clamp()const
+{ return clamp; }
+
+//! Set the clamp flag
+RendDesc &
+RendDesc::set_clamp(bool x)
+{ clamp=x; return *this; }     
+
+//! Set constraint flags
+RendDesc &
+RendDesc::set_flags(const int &x)
+{ flags=x; return *this; }
+
+//! Clear constraint flags
+RendDesc &
+RendDesc::clear_flags()
+{ flags=0; return *this; }
+
+int
+RendDesc::get_flags()const
+{ return flags; }
+
+
+//!    Return the aspect ratio of a single pixel
+Real
+RendDesc::get_pixel_aspect()const
+{
+       Vector tmp=br_-tl_;
+       tmp[0]/=w_;
+       tmp[1]/=h_;
+       tmp[0]/=tmp[1];
+       if(tmp[0]<0.0)
+               return -tmp[0];
+       return tmp[0];
+}
+
+//!    Return the aspect ratio of the entire image
+Real
+RendDesc::get_image_aspect()const
+{
+       Point tmp=br_-tl_;
+       tmp[0]/=tmp[1];
+       if(tmp[0]<0.0)
+               return -tmp[0];
+       return tmp[0];
+}
+
+
+//! Return the antialias amount
+const int &
+RendDesc::get_antialias()const
+{ return a; }
+
+//! Set the antilaias amount
+RendDesc &
+RendDesc::set_antialias(const int &x)
+{ a=x; return *this; }
+
+
+//! Return the distance from the bottom-right to the top-left
+Real
+RendDesc::get_span()const
+{
+       return (br_-tl_).mag();
+}
+
+//! Set the span distance
+RendDesc &
+RendDesc::set_span(const Real &x)
+{
+       Vector::value_type ratio=x/get_span();
+
+       if(!FLAGS(flags,IM_W|IM_H) || FLAGS(flags,IM_ASPECT))
+       {
+               br_-=focus;
+               br_=br_*ratio;
+               br_+=focus;
+               tl_-=focus;
+               tl_=tl_*ratio;
+               tl_+=focus;
+       }
+       else if(FLAGS(flags,IM_W))
+       {
+               //! \writeme or fix me
+               br_-=focus;
+               br_=br_*ratio;
+               br_+=focus;
+               tl_-=focus;
+               tl_=tl_*ratio;
+               tl_+=focus;
+       }else // IM_H
+       {
+               //! \writeme or fix me
+               br_-=focus;
+               br_=br_*ratio;
+               br_+=focus;
+               tl_-=focus;
+               tl_=tl_*ratio;
+               tl_+=focus;
+       }
+
+       return *this;
+}
+
+
+/*
+const Gamma &
+RendDesc::get_gamma()const
+{ return gamma; }      
+
+RendDesc &
+RendDesc::set_gamma(const Gamma &x)
+{ gamma=x; return *this;  }
+*/
+
+const Point &
+RendDesc::get_focus()const
+{ return focus; }
+
+RendDesc &
+RendDesc::set_focus(const Point &x)
+{ focus=x; return *this; }
+
+
+const Point &
+RendDesc::get_tl()const
+{ return tl_; }
+
+const Point &
+RendDesc::get_br()const
+{ return br_; }
+
+RendDesc &
+RendDesc::set_tl(const Point &x)
+{
+       if(FLAGS(flags,PX_ASPECT))
+       {
+               Vector new_size(x-br_);
+               new_size[0]=abs(new_size[0]);
+               new_size[1]=abs(new_size[1]);
+       
+               Vector old_size(tl_-br_);
+               old_size[0]=abs(old_size[0]);
+               old_size[1]=abs(old_size[1]);
+               
+               if(new_size[0]!=old_size[0])
+                       w_=round_to_int(new_size[0]*w_/old_size[0]);
+       
+               if(new_size[1]!=old_size[1])
+                       h_=round_to_int(new_size[1]*h_/old_size[1]);
+       }
+       
+       tl_=x; return *this;
+}
+
+RendDesc &
+RendDesc::set_br(const Point &x)
+{
+       if(FLAGS(flags,PX_ASPECT))
+       {
+               Vector new_size(x-tl_);
+               new_size[0]=abs(new_size[0]);
+               new_size[1]=abs(new_size[1]);
+       
+               Vector old_size(tl_-br_);
+               old_size[0]=abs(old_size[0]);
+               old_size[1]=abs(old_size[1]);
+               
+               if(new_size[0]!=old_size[0])
+                       w_=round_to_int(new_size[0]*w_/old_size[0]);
+       
+               if(new_size[1]!=old_size[1])
+                       h_=round_to_int(new_size[1]*h_/old_size[1]);
+       }
+       br_=x; return *this;
+}
+
+RendDesc &
+RendDesc::set_viewport(const Point &__tl, const Point &__br)
+{ tl_=__tl; br_=__br; return *this; }
+
+RendDesc &
+RendDesc::set_viewport(Real a,Real b,Real c,Real d)
+{ tl_=Point(a,b); br_=Point(c,d); return *this; }
+
+Real
+RendDesc::get_pw()const
+{
+       return (br_[0] - tl_[0]) / w_;
+}
+
+Real
+RendDesc::get_ph()const
+{
+       return (br_[1] - tl_[1]) / h_;
+}
+
+RendDesc &
+RendDesc::set_subwindow(int x, int y, int w, int h)
+{
+       const Real pw(get_pw());
+       const Real ph(get_ph());
+       
+       tl_[0]+=pw*x;
+       tl_[1]+=ph*y;
+
+       br_[0]-=pw*(w_-(x+w));
+       br_[1]-=ph*(h_-(y+h));
+
+       w_=w;
+       h_=h;
+       
+       return *this;
+}
diff --git a/synfig-core/trunk/src/synfig/renddesc.h b/synfig-core/trunk/src/synfig/renddesc.h
new file mode 100644 (file)
index 0000000..1498fe8
--- /dev/null
@@ -0,0 +1,319 @@
+/* === S I N F G =========================================================== */
+/*!    \file renddesc.h
+**     \brief Template Header
+**
+**     $Id: renddesc.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_RENDERDESC_H
+#define __SINFG_RENDERDESC_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "vector.h"
+#include "color.h"
+#include "types.h"
+#include <cmath>
+#include "rect.h"
+
+/* === M A C R O S ========================================================= */
+
+#ifndef DPM2DPI
+#define DPM2DPI(x)     (float(x)/39.3700787402f)
+#define DPI2DPM(x)     (float(x)*39.3700787402f)
+#endif
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class RendDesc
+**     \todo writeme
+*/
+class RendDesc
+{
+public:
+       enum Lock
+       {
+               PX_ASPECT=(1<<0),
+               PX_AREA=(1<<1),
+               PX_W=(1<<2),
+               PX_H=(1<<3),
+               
+               IM_ASPECT=(1<<4),
+               IM_SPAN=(1<<5),
+               IM_W=(1<<6),
+               IM_H=(1<<7),
+               IM_ZOOMIN=(1<<8),
+               IM_ZOOMOUT=(1<<9),
+                               
+               LINK_PX_ASPECT=(1<<10),
+               LINK_PX_AREA=(1<<11),
+               LINK_IM_ASPECT=(1<<12),
+               LINK_IM_SPAN=(1<<13),
+               LINK_IM_CENTER=(1<<14)
+       };
+       
+private:
+       int w_,h_;
+       Real x_res;
+       Real y_res;
+       Point tl_, br_;
+       Point focus;
+       int a;
+       //Gamma gamma;
+       Color background;
+       int flags;
+       bool interlaced;
+       bool clamp;
+
+       float frame_rate;
+       Time time_begin, time_end;
+               
+public:
+
+       enum
+       {
+               ANTIALIAS_UNIFORM,
+               ANTIALIAS_MONTE_CARLO,
+               ANTIALIAS_JITTERED,
+               ANTIALIAS_ADAPTIVE,
+               ANTIALIAS_QUINTCUNX
+       } AntialiasFilter;
+
+       //! Default Constructor
+       RendDesc():
+               w_                      (480),
+               h_                      (270),
+               x_res           (DPI2DPM(72.0f)),
+               y_res           (DPI2DPM(72.0f)),
+               tl_                     (-4,2.25),
+               br_                     (4,-2.25),
+               focus           (0,0),
+               a                       (2),
+               background      (Color::gray()),
+               flags           (0),
+               interlaced      (false),
+               clamp           (false),
+               frame_rate      (24),
+               time_begin      (0),
+               time_end        (0)
+       { }
+       
+       //! \writeme
+       RendDesc &apply(const RendDesc &x);
+       
+       //! \writeme
+       const Color &get_bg_color()const;
+
+       //! \writeme
+       RendDesc &set_bg_color(const Color &bg);
+
+       //! Return the width of the composition in pixels
+       int get_w()const;
+
+       //! Set the width of the composition in pixels.
+       /*! The other parameters are adjusted according to the
+       **      constraints placed on the flags.
+       */
+       RendDesc &set_w(int x);
+
+       //! Return the height of the composition in pixels
+       int     get_h()const;
+
+       //! Set the height of the composition in pixels.
+       /*! The other parameters are adjusted according to the
+       **      constraints placed on the flags.
+       */
+       RendDesc &set_h(int y);
+
+       //!     Sets the width and height of the composition in pixels
+       RendDesc &set_wh(int x, int y);
+
+    //! Returns the horizontal resolution (in dots per meter)
+       Real get_x_res()const;
+
+       //! Sets the horizontal resolution (in dots per meter)
+       RendDesc &set_x_res(Real x);
+       
+    //! Returns the vertical resolution (in dots per meter)
+       Real get_y_res()const;
+
+       //! Sets the vertical resolution (in dots per meter)
+       RendDesc &set_y_res(Real y);
+
+
+       //! Return the physical width of the composition in meters
+       Real get_physical_w()const;
+
+       //! Return the physical height of the composition in meters
+       Real get_physical_h()const;
+
+       //! Set the physical width of the composition in meters
+       RendDesc &set_physical_w(Real w);
+
+       //! Set the physical height of the composition in meters
+       RendDesc &set_physical_h(Real h);
+
+
+       //!     Return the index of the first frame
+       int get_frame_start()const;
+
+       //! Set the index of the first frame
+       RendDesc &set_frame_start(int x);
+       
+       //!     Return the index of the last frame
+       int get_frame_end()const;
+       
+       //! Set the index of the last frame
+       RendDesc &set_frame_end(int x);
+
+       //!     Return the starting time of the animation
+       const Time get_time_start()const;
+       
+       //!     Set the time that the animation will start
+       RendDesc &set_time_start(Time x);
+
+       //! Return the end time of the animation
+       const Time get_time_end()const;
+       
+       //!     Set the time that the animation will end
+       RendDesc &set_time_end(Time x);
+
+       //!     Setup for one frame at the given time
+       RendDesc &set_time(Time x);
+
+       //!     Setup for one frame
+       RendDesc &set_frame(int x);
+
+       //!     Return the frame rate (frames-per-second)
+       const float &get_frame_rate()const;
+       
+       //! Set the frame rate (frames-per-second)
+       RendDesc &set_frame_rate(float x);
+
+       //! Return the status of the interlaced flag
+       const bool &get_interlaced()const;
+       
+       //! Set the interlace flag
+       RendDesc &set_interlaced(bool x);
+
+       //! Return the status of the clamp flag
+       const bool &get_clamp()const;
+       
+       //! Set the clamp flag
+       RendDesc &set_clamp(bool x);
+
+       //! Set constraint flags
+       RendDesc &set_flags(const int &x);
+       
+       //! Clear constraint flags
+       RendDesc &clear_flags();
+
+       //! Get constraint flags
+       int get_flags()const;
+
+       //!     Return the aspect ratio of a single pixel
+       Point::value_type get_pixel_aspect()const;
+
+       //!     Return the aspect ratio of the entire image
+       Point::value_type get_image_aspect()const;
+       
+       //! Return the antialias amount
+       const int &get_antialias()const;
+
+       //! Set the antilaias amount
+       RendDesc &set_antialias(const int &x);
+
+       //! Return the distance from the bottom-right to the top-left
+       Real get_span()const;
+
+       //! Set the span distance
+       RendDesc& set_span(const Real &x);
+
+       //const Gamma &get_gamma()const;
+
+       //RendDesc &set_gamma(const Gamma &x);
+
+       const Point &get_focus()const;
+
+       RendDesc &set_focus(const Point &x);
+
+       const Point &get_tl()const;
+       
+       RendDesc &set_tl(const Point &x);
+
+       const Point &get_br()const;
+       
+       RendDesc &set_br(const Point &x);
+       
+       Rect get_rect()const { return Rect(get_tl(),get_br()); }
+
+       RendDesc &set_viewport(const Point &__tl, const Point &__br);
+       
+       RendDesc &set_viewport(Vector::value_type a,Vector::value_type b,Vector::value_type c,Vector::value_type d);
+
+       //! Returns the width of one pixel
+       Real get_pw()const;
+
+       //! Returns the height of one pixel
+       Real get_ph()const;
+
+       //! Sets viewport to represent the screen at the give pixel coordinates
+       RendDesc &set_subwindow(int x, int y, int w, int h);
+};     // END of class RendDesc
+
+//! This operator allows the combining of RendDesc::Lock flags using the '|' operator
+/*!    \see RendDesc::Lock, RendDesc */
+inline RendDesc::Lock operator|(RendDesc::Lock lhs, RendDesc::Lock rhs)
+{
+       return static_cast<RendDesc::Lock>((int)lhs|(int)rhs);
+}
+
+//! This operator allows the masking of RendDesc::Lock flags using the '&' operator
+/*!    \see RendDesc::Lock, RendDesc */
+inline RendDesc::Lock operator&(RendDesc::Lock lhs, RendDesc::Lock rhs)
+{
+       return static_cast<RendDesc::Lock>((int)lhs&(int)rhs);
+}
+
+//! This operator allows the inverting of RendDesc::Lock flags using the '~' operator
+/*!    \see RendDesc::Lock, RendDesc */
+inline RendDesc::Lock operator~(RendDesc::Lock rhs)
+{
+       return static_cast<RendDesc::Lock>(~(int)rhs);
+}
+
+//! This operator is for checking RendDesc::Lock flags.
+/*! Don't think of it as "less then or equal to", but think of it
+**     like an arrow. Is \a rhs inside of \a lhs ?
+**     \see RendDesc::Lock, RendDesc */
+inline bool operator<=(RendDesc::Lock lhs, RendDesc::Lock rhs)
+{
+       return static_cast<int>(lhs) & static_cast<int>(rhs)==static_cast<int>(rhs);
+}
+
+
+}; /* end namespace sinfg */
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/render.cpp b/synfig-core/trunk/src/synfig/render.cpp
new file mode 100644 (file)
index 0000000..acfcbe3
--- /dev/null
@@ -0,0 +1,525 @@
+/* === S I N F G =========================================================== */
+/*!    \file render.cpp
+**     \brief Renderer
+**
+**     $Id: render.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#ifndef WIN32
+#include <unistd.h>
+#include <sys/types.h>
+#include <signal.h>
+#endif
+
+#include "render.h"
+#include "target.h"
+#include "canvas.h"
+#include <ETL/handle>
+#include <cassert>
+#include "context.h"
+#include "surface.h"
+
+#endif
+
+using namespace std;
+using namespace sinfg;
+using namespace etl;
+
+/* === M A C R O S ========================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+bool
+sinfg::parametric_render(
+       Context context,
+       Surface &surface,
+       const RendDesc &desc,
+       ProgressCallback *callback
+)
+{
+       Point::value_type
+               u,v,            // Current location in image
+               su,sv,          // Starting locations
+               du, dv,         // Distance between pixels
+               dsu,dsv;        // Distance between subpixels
+
+       bool
+               no_clamp=!desc.get_clamp();
+       
+       int
+               w(desc.get_w()),
+               h(desc.get_h()),
+               a(desc.get_antialias());
+       
+       Point
+               tl(desc.get_tl()),
+               br(desc.get_br());
+       
+       //Gamma
+       //      gamma(desc.get_gamma());
+
+       int
+               x,y,            // Current location on output bitmap
+               x2,y2;          // Subpixel counters
+
+       Color::value_type
+               pool;           // Alpha pool (for correct alpha antialiasing)
+       
+       // Calculate the number of channels
+       //chan=channels(desc.get_pixel_format());
+               
+       // Calculate the distance between pixels
+       du=(br[0]-tl[0])/(Point::value_type)w;
+       dv=(br[1]-tl[1])/(Point::value_type)h;
+
+       // Calculate the distance between sub pixels
+       dsu=du/(Point::value_type)a;
+       dsv=dv/(Point::value_type)a;
+
+       // Calculate the starting points
+       //su=tl[0]+(du-dsu)/(Point::value_type)2.0;
+       //sv=tl[1]-(dv-dsv)/(Point::value_type)2.0;
+       su=tl[0];
+       sv=tl[1];
+       
+       surface.set_wh(desc.get_w(),desc.get_h());
+
+       assert(surface);
+       
+       // Loop through all horizontal lines
+       for(y=0,v=sv;y<h;y++,v+=dv)
+       {
+               // Set the current pixel pointer
+               // to the start of the line
+               Color *colordata=surface[y];
+
+               assert(colordata);
+               
+               // If we have a callback that we need
+               // to report to, do so now.
+               if(callback)
+                       if( callback->amount_complete(y,h) == false )
+                       {
+                               // If the callback returns false,
+                               // then the render has been aborted.
+
+                               return false;
+                       }
+
+               // Loop through every pixel in row
+               for(x=0,u=su;x<w;x++,u+=du)
+               {
+                       Color &c(*(colordata++));
+                       c=Color::alpha();
+
+                       // Loop through all subpixels
+                       for(y2=0,pool=0;y2<a;y2++)
+                               for(x2=0;x2<a;x2++)
+                               {
+                                       Color color=context.get_color(
+                                               Point(
+                                                       u+(Point::value_type)(x2)*dsu,
+                                                       v+(Point::value_type)(y2)*dsv
+                                                       )
+                                               );
+                                       if(!no_clamp)
+                                       {
+                                               color=color.clamped();
+                                               c+=color*color.get_a();
+                                               pool+=color.get_a();
+                                       }
+                                       else
+                                       {
+                                               c+=color*color.get_a();
+                                               pool+=color.get_a();
+                                       }
+                               }
+                       if(pool)
+                               c/=pool;
+               }
+       }
+       
+       // Give the callback one more last call,
+       // this time with the full height as the
+       // current line
+       if(callback)
+               callback->amount_complete(h,h);
+
+       // Report our success
+       return(true);
+}
+
+bool
+sinfg::render(
+       Context context,
+       Target_Scanline::Handle target,
+       const RendDesc &desc,
+       ProgressCallback *callback)
+{
+       Point::value_type
+               u,v,            // Current location in image
+               su,sv,          // Starting locations
+               du, dv,         // Distance between pixels
+               dsu,dsv;        // Distance between subpixels
+
+       bool
+               no_clamp=!desc.get_clamp();
+       
+       int
+               w(desc.get_w()),
+               h(desc.get_h()),
+               a(desc.get_antialias());
+       
+       Point
+               tl(desc.get_tl()),
+               br(desc.get_br());
+       
+       //Gamma
+       //      gamma(desc.get_gamma());
+
+       int
+               x,y,            // Current location on output bitmap
+               x2,y2;          // Subpixel counters
+
+       Color::value_type
+               pool;           // Alpha pool (for correct alpha antialiasing)
+
+       assert(target);
+       
+       // If we do not have a a target then bail
+       if(!target)
+               return false;
+       
+       // Calculate the number of channels
+       //chan=channels(desc.get_pixel_format());
+               
+       // Calculate the distance between pixels
+       du=(br[0]-tl[0])/(Point::value_type)w;
+       dv=(br[1]-tl[1])/(Point::value_type)h;
+
+       // Calculate the distance between sub pixels
+       dsu=du/(Point::value_type)a;
+       dsv=dv/(Point::value_type)a;
+
+       // Calculate the starting points
+       su=tl[0]+(du-dsu)/(Point::value_type)2.0;
+       sv=tl[1]-(dv-dsv)/(Point::value_type)2.0;
+
+       // Mark the start of a new frame.
+       if(!target->start_frame(callback))
+               return false;
+                       
+       // Loop through all horizontal lines
+       for(y=0,v=sv;y<h;y++,v+=dv)
+       {
+               // Set the current pixel pointer
+               // to the start of the line
+               Color *colordata=target->start_scanline(y);
+
+               if(!colordata)
+               {
+                       if(callback)callback->error(_("Target panic"));
+                       else throw(string(_("Target panic")));
+                       return false;
+               }
+               
+               // If we have a callback that we need
+               // to report to, do so now.
+               if(callback)
+                       if( callback->amount_complete(y,h) == false )
+                       {
+                               // If the callback returns false,
+                               // then the render has been aborted.
+                               // Exit gracefuly.
+
+                               target->end_scanline();
+                               target->end_frame();
+                               return false;
+                       }
+
+               // Loop through every pixel in row
+               for(x=0,u=su;x<w;x++,u+=du)
+               {
+                       Color &c(*(colordata++));
+                       c=Color::alpha();
+
+                       // Loop through all subpixels
+                       for(y2=0,pool=0;y2<a;y2++)
+                               for(x2=0;x2<a;x2++)
+                               {
+                                       Color color=context.get_color(
+                                               Point(
+                                                       u+(Point::value_type)(x2)*dsu,
+                                                       v+(Point::value_type)(y2)*dsv
+                                                       )
+                                               );
+                                       if(!no_clamp)
+                                       {
+                                               color=color.clamped();
+                                               c+=color*color.get_a();
+                                               pool+=color.get_a();
+                                       }
+                                       else
+                                       {
+                                               c+=color*color.get_a();
+                                               pool+=color.get_a();
+                                       }
+                               }
+                       if(pool)
+                               c/=pool;
+               }
+
+               // Send the buffer to the render target.
+               // If anything goes wrong, cleanup and bail.
+               if(!target->end_scanline())
+               {
+                       if(callback)callback->error(_("Target panic"));
+                       else throw(string(_("Target panic")));
+                       return false;
+               }
+       }
+       
+       // Finish up the target's frame
+       target->end_frame();
+
+       // Give the callback one more last call,
+       // this time with the full height as the
+       // current line
+       if(callback)
+               callback->amount_complete(h,h);
+
+       // Report our success
+       return(true);
+}
+
+bool
+sinfg::render_threaded(
+       Context context,
+       Target_Scanline::Handle target,
+       const RendDesc &desc,
+       ProgressCallback *callback,
+       int threads)
+{
+#ifndef WIN32
+    struct _render_thread
+    {
+               int
+                       pipe_read,
+                       pipe_write,
+                       pid;
+               _render_thread()
+               {
+                       pipe(&pipe_read);
+                       pid=0;
+               }
+               ~_render_thread()
+               {
+                       close(pipe_read);
+                       close(pipe_write);
+                       if(pid)
+                       {
+                               kill(pid,9);
+                       }
+               }
+    } *render_thread;
+    
+    int i, mythread=-1;
+       
+       Point::value_type
+               u,v,            // Current location in image
+               su,sv,          // Starting locations
+               du, dv,         // Distance between pixels
+               dsu,dsv;        // Distance between subpixels
+
+       bool
+               no_clamp=!desc.get_clamp();
+       
+       int
+               w(desc.get_w()),
+               h(desc.get_h()),
+               a(desc.get_antialias());
+       
+       Point
+               tl(desc.get_tl()),
+               br(desc.get_br());
+       
+       int
+               x,y,            // Current location on output bitmap
+               x2,y2;          // Subpixel counters
+
+       Color::value_type
+               pool;           // Alpha pool (for correct alpha antialiasing)
+
+       assert(target);
+       
+       // If we do not have a a target then bail
+       if(!target)
+               return false;
+                       
+       // Calculate the distance between pixels
+       du=(br[0]-tl[0])/(Point::value_type)w;
+       dv=(br[1]-tl[1])/(Point::value_type)h;
+
+       // Calculate the distance between sub pixels
+       dsu=du/(Point::value_type)a;
+       dsv=dv/(Point::value_type)a;
+
+       // Calculate the starting points
+       su=tl[0]+(du-dsu)/(Point::value_type)2.0;
+       sv=tl[1]-(dv-dsv)/(Point::value_type)2.0;
+
+    render_thread=new _render_thread[threads];
+    
+       // Start the forks
+    for(i=0;i<threads;i++)
+    {
+               int pid=fork();
+               if(pid==0)
+               {
+               mythread=i;
+               goto renderthread;
+               }
+               render_thread[i].pid=pid;
+    }
+    
+       // Mark the start of a new frame.
+       if(!target->start_frame(callback))
+               return false;
+
+    for(y=0;y<h;y++)
+    {
+               // Set the current pixel pointer
+               // to the start of the line
+               Color *colordata(target->start_scanline(y));
+
+               if(!colordata)
+               {
+                       if(callback)callback->error(_("Target panic"));
+                       else throw(string(_("Target panic")));
+                       return false;
+               }
+               
+               // If we have a callback that we need
+               // to report to, do so now.
+               if(callback)
+                       if( callback->amount_complete(y,h) == false )
+                       {
+                               // If the callback returns false,
+                               // then the render has been aborted.
+                               // Exit gracefuly.
+
+                               target->end_scanline();
+                               target->end_frame();
+                               delete [] render_thread;
+                               return false;
+                       }
+                               
+               read(render_thread[y%threads].pipe_read,colordata,w*sizeof(Color));
+               
+               // Send the buffer to the render target.
+               // If anything goes wrong, cleanup and bail.
+               if(!target->end_scanline())
+               {
+                       delete [] render_thread;
+                       if(callback)callback->error(_("Target panic"));
+                       else throw(string(_("Target panic")));
+                       return false;
+               }
+    }
+
+       // Finish up the target's frame
+       target->end_frame();
+
+       // Give the callback one more last call,
+       // this time with the full height as the
+       // current line
+       if(callback)
+               callback->amount_complete(h,h);
+    
+    delete [] render_thread;
+    return true;
+
+renderthread:
+       
+       // Change the random seed, so that each thread has a different one
+       srand(mythread*20+threads+time(0));
+       
+       Color *buffer(new Color[w]);
+
+       // Loop through all horizontal lines
+       for(y=mythread,v=sv+dv*(Real)mythread;y<h;y+=threads,v+=dv*(Real)threads)
+       {
+               // Set the current pixel pointer
+               // to the start of the line
+               Color* colordata(buffer);
+               
+               // Loop through every pixel in row
+               for(x=0,u=su;x<w;x++,u+=du)
+               {
+                       Color &c(*(colordata++));
+                       c=Color::alpha();
+
+                       // Loop through all subpixels
+                       for(y2=0,pool=0;y2<a;y2++)
+                               for(x2=0;x2<a;x2++)
+                               {
+                                       Color color=context.get_color(
+                                               Point(
+                                                       u+(Point::value_type)(x2)*dsu,
+                                                       v+(Point::value_type)(y2)*dsv
+                                                       )
+                                               );
+                                       if(!no_clamp)
+                                       {
+                                               color=color.clamped();
+                                               c+=color*color.get_a();
+                                               pool+=color.get_a();
+                                       }
+                                       else
+                                       {
+                                               c+=color*color.get_a();
+                                               pool+=color.get_a();
+                                       }
+                               }
+                       if(pool)
+                               c/=pool;
+               }
+               
+               // Send the buffer to the primary thread.
+               write(render_thread[mythread].pipe_write,buffer,w*sizeof(Color));
+       }
+       
+       delete [] buffer;
+       
+    _exit(0);
+       return false;   
+#else
+       return render(context, target, desc, callback);
+
+#endif 
+}
diff --git a/synfig-core/trunk/src/synfig/render.h b/synfig-core/trunk/src/synfig/render.h
new file mode 100644 (file)
index 0000000..30b3364
--- /dev/null
@@ -0,0 +1,65 @@
+/* === S I N F G =========================================================== */
+/*!    \file render.h
+**     \brief Template Header
+**
+**     $Id: render.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_RENDER_H
+#define __SINFG_RENDER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "target_scanline.h"
+#include "vector.h"
+#include "color.h"
+#include "renddesc.h"
+#include "general.h"
+#include "layer.h"
+#include "canvas.h"
+#include <ETL/handle>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+//! Renders starting at \a context to \a target
+/*! \warning \a Target::set_rend_desc() must have
+**             already been called on \a target before
+**             you call this function!
+*/
+extern bool render(Context context, Target_Scanline::Handle target, const RendDesc &desc,ProgressCallback *);
+
+extern bool parametric_render(Context context, Surface &surface, const RendDesc &desc,ProgressCallback *);
+
+extern bool render_threaded(   Context context,
+       Target_Scanline::Handle target,
+       const RendDesc &desc,
+       ProgressCallback *callback,
+       int threads);
+
+}; /* end namespace sinfg */
+
+/* -- E N D ----------------------------------------------------------------- */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/savecanvas.cpp b/synfig-core/trunk/src/synfig/savecanvas.cpp
new file mode 100644 (file)
index 0000000..32c8203
--- /dev/null
@@ -0,0 +1,755 @@
+/* === S I N F G =========================================================== */
+/*!    \file savecanvas.cpp
+**     \brief Writeme
+**
+**     $Id: savecanvas.cpp,v 1.2 2005/01/07 03:29:12 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "savecanvas.h"
+#include "general.h"
+#include "valuenode.h"
+#include "valuenode_subtract.h"
+#include "valuenode_animated.h"
+#include "valuenode_composite.h"
+#include "valuenode_const.h"
+#include "valuenode_linear.h"
+#include "valuenode_dynamiclist.h"
+#include "valuenode_reference.h"
+#include "valuenode_segcalctangent.h"
+#include "valuenode_segcalcvertex.h"
+#include "valuenode_bline.h"
+#include "time.h"
+#include "keyframe.h"
+#include "layer.h"
+#include "string.h"
+#include "paramdesc.h"
+
+#include <libxml++/libxml++.h>
+#include <ETL/stringf>
+#include "gradient.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+#define COLOR_VALUE_TYPE_FORMAT                "%f"
+#define        VECTOR_VALUE_TYPE_FORMAT        "%0.10f"
+#define        TIME_TYPE_FORMAT                        "%0.3f"
+#define        VIEW_BOX_FORMAT                         "%f %f %f %f"
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+xmlpp::Element* encode_canvas(xmlpp::Element* root,Canvas::ConstHandle canvas);
+xmlpp::Element* encode_value_node(xmlpp::Element* root,ValueNode::ConstHandle value_node,Canvas::ConstHandle canvas);
+
+xmlpp::Element* encode_keyframe(xmlpp::Element* root,const Keyframe &kf, float fps)
+{
+       root->set_name("keyframe");
+       root->set_attribute("time",kf.get_time().get_string(fps));
+       if(!kf.get_description().empty())
+               root->set_child_text(kf.get_description());
+       return root;
+}
+
+
+xmlpp::Element* encode_real(xmlpp::Element* root,Real v)
+{
+       root->set_name("real");
+       root->set_attribute("value",strprintf(VECTOR_VALUE_TYPE_FORMAT,v));
+       return root;
+}
+
+xmlpp::Element* encode_time(xmlpp::Element* root,Time t, float fps=0)
+{
+       root->set_name("time");
+       //root->set_attribute("value",t.get_string(fps));
+       root->set_attribute("value",t.get_string());
+       return root;
+}
+
+xmlpp::Element* encode_integer(xmlpp::Element* root,int i)
+{
+       root->set_name("integer");
+       root->set_attribute("value",strprintf("%i",i));
+       return root;
+}
+
+xmlpp::Element* encode_bool(xmlpp::Element* root,bool b)
+{
+       root->set_name("bool");
+       root->set_attribute("value",b?"true":"false");
+       return root;
+}
+
+xmlpp::Element* encode_string(xmlpp::Element* root,const String &str)
+{
+       root->set_name("string");
+       root->set_child_text(str);
+       return root;
+}
+
+xmlpp::Element* encode_vector(xmlpp::Element* root,Vector vect)
+{
+       root->set_name("vector");
+       root->add_child("x")->set_child_text(strprintf(VECTOR_VALUE_TYPE_FORMAT,(float)vect[0]));
+       root->add_child("y")->set_child_text(strprintf(VECTOR_VALUE_TYPE_FORMAT,(float)vect[1]));
+       return root;
+}
+
+xmlpp::Element* encode_color(xmlpp::Element* root,Color color)
+{
+       root->set_name("color");
+       root->add_child("r")->set_child_text(strprintf(COLOR_VALUE_TYPE_FORMAT,(float)color.get_r()));
+       root->add_child("g")->set_child_text(strprintf(COLOR_VALUE_TYPE_FORMAT,(float)color.get_g()));
+       root->add_child("b")->set_child_text(strprintf(COLOR_VALUE_TYPE_FORMAT,(float)color.get_b()));
+       root->add_child("a")->set_child_text(strprintf(COLOR_VALUE_TYPE_FORMAT,(float)color.get_a()));
+       return root;
+}
+
+xmlpp::Element* encode_angle(xmlpp::Element* root,Angle theta)
+{
+       root->set_name("angle");
+       root->set_attribute("value",strprintf("%f",(float)Angle::deg(theta).get()));
+       return root;
+}
+
+xmlpp::Element* encode_segment(xmlpp::Element* root,Segment seg)
+{
+       root->set_name("segment");
+       encode_vector(root->add_child("p1")->add_child("vector"),seg.p1);
+       encode_vector(root->add_child("t1")->add_child("vector"),seg.t1);
+       encode_vector(root->add_child("p2")->add_child("vector"),seg.p2);
+       encode_vector(root->add_child("t2")->add_child("vector"),seg.t2);
+       return root;
+}
+
+xmlpp::Element* encode_bline_point(xmlpp::Element* root,BLinePoint bline_point)
+{
+       root->set_name(ValueBase::type_name(ValueBase::TYPE_BLINEPOINT));
+
+       encode_vector(root->add_child("vertex")->add_child("vector"),bline_point.get_vertex());
+       encode_vector(root->add_child("t1")->add_child("vector"),bline_point.get_tangent1());
+
+       if(bline_point.get_split_tangent_flag())
+               encode_vector(root->add_child("t2")->add_child("vector"),bline_point.get_tangent2());
+       
+       encode_real(root->add_child("width")->add_child("real"),bline_point.get_width());
+       encode_real(root->add_child("origin")->add_child("real"),bline_point.get_origin());
+       return root;
+}
+
+xmlpp::Element* encode_gradient(xmlpp::Element* root,Gradient x)
+{
+       root->set_name("gradient");
+       
+       Gradient::const_iterator iter;
+       x.sort();
+       for(iter=x.begin();iter!=x.end();iter++)
+       {
+               xmlpp::Element *cpoint(encode_color(root->add_child("color"),iter->color));
+               cpoint->set_attribute("pos",strprintf("%f",iter->pos));
+       }
+       return root;
+}
+
+
+xmlpp::Element* encode_value(xmlpp::Element* root,const ValueBase &data,Canvas::ConstHandle canvas=0);
+
+xmlpp::Element* encode_list(xmlpp::Element* root,std::list<ValueBase> list, Canvas::ConstHandle canvas=0)
+{
+       root->set_name("list");
+       
+       while(!list.empty())
+       {
+               encode_value(root->add_child("value"),list.front(),canvas);
+               list.pop_front();
+       }
+
+       return root;
+}
+
+xmlpp::Element* encode_value(xmlpp::Element* root,const ValueBase &data,Canvas::ConstHandle canvas)
+{
+       switch(data.get_type())
+       {
+       case ValueBase::TYPE_REAL:
+               return encode_real(root,data.get(Real()));
+       case ValueBase::TYPE_TIME:
+               if(canvas)
+                       return encode_time(root,data.get(Time()),canvas->rend_desc().get_frame_rate());
+               else
+                       return encode_time(root,data.get(Time()));
+       case ValueBase::TYPE_INTEGER:
+               return encode_integer(root,data.get(int()));
+       case ValueBase::TYPE_COLOR:
+               return encode_color(root,data.get(Color()));
+       case ValueBase::TYPE_VECTOR:
+               return encode_vector(root,data.get(Vector()));
+       case ValueBase::TYPE_ANGLE:
+               return encode_angle(root,data.get(Angle()));
+       case ValueBase::TYPE_BOOL:
+               return encode_bool(root,data.get(bool()));
+       case ValueBase::TYPE_STRING:
+               return encode_string(root,data.get(String()));
+       case ValueBase::TYPE_SEGMENT:
+               return encode_segment(root,data.get(Segment()));
+       case ValueBase::TYPE_BLINEPOINT:
+               return encode_bline_point(root,data.get(BLinePoint()));
+       case ValueBase::TYPE_GRADIENT:
+               return encode_gradient(root,data.get(Gradient()));
+       case ValueBase::TYPE_LIST:
+               return encode_list(root,data,canvas);
+       case ValueBase::TYPE_CANVAS:
+               return encode_canvas(root,data.get(Canvas::Handle()).get());
+       case ValueBase::TYPE_NIL:
+               sinfg::error("Encountered NIL ValueBase");
+               root->set_name("nil");
+               return root;
+       default:
+               sinfg::error(strprintf("Unknown value(%s), cannot create XML representation!",ValueBase::type_name(data.get_type()).c_str()));
+               root->set_name("nil");
+               return root;
+       }
+}
+
+xmlpp::Element* encode_animated(xmlpp::Element* root,ValueNode_Animated::ConstHandle value_node,Canvas::ConstHandle canvas=0)
+{
+       assert(value_node);
+       root->set_name("animated");
+
+       root->set_attribute("type",ValueBase::type_name(value_node->get_type()));
+
+       const ValueNode_Animated::WaypointList &waypoint_list=value_node->waypoint_list();
+       ValueNode_Animated::WaypointList::const_iterator iter;
+
+       for(iter=waypoint_list.begin();iter!=waypoint_list.end();++iter)
+       {
+               xmlpp::Element *waypoint_node=root->add_child("waypoint");
+               //waypoint_node->set_attribute("time",iter->get_time().get_string(canvas->rend_desc().get_frame_rate()));
+               waypoint_node->set_attribute("time",iter->get_time().get_string());
+
+               //waypoint_node->add_child(encode_value(iter->get_value(),canvas));
+               if(iter->get_value_node()->is_exported())
+                       waypoint_node->set_attribute("use",iter->get_value_node()->get_relative_id(canvas));
+               else
+                       encode_value_node(waypoint_node->add_child("value_node"),iter->get_value_node(),canvas);
+                                       
+               switch(iter->get_before())
+               {
+               case INTERPOLATION_HALT:
+                       waypoint_node->set_attribute("before","halt");
+                       break;
+               case INTERPOLATION_LINEAR:
+                       waypoint_node->set_attribute("before","linear");
+                       break;
+               case INTERPOLATION_MANUAL:
+                       waypoint_node->set_attribute("before","manual");
+                       break;
+               case INTERPOLATION_CONSTANT:
+                       waypoint_node->set_attribute("before","constant");
+                       break;
+               case INTERPOLATION_TCB:
+                       // This is the default value, so don't add a new attribute
+                       break;
+               default:
+                       error("Unknown waypoint type for \"before\" attribute");
+               }
+
+               switch(iter->get_after())
+               {
+               case INTERPOLATION_HALT:
+                       waypoint_node->set_attribute("after","halt");
+                       break;
+               case INTERPOLATION_LINEAR:
+                       waypoint_node->set_attribute("after","linear");
+                       break;
+               case INTERPOLATION_MANUAL:
+                       waypoint_node->set_attribute("after","manual");
+                       break;
+               case INTERPOLATION_CONSTANT:
+                       waypoint_node->set_attribute("after","constant");
+                       break;
+               case INTERPOLATION_TCB:
+                       // This is the default value, so don't add a new attribute
+                       break;
+               default:
+                       error("Unknown waypoint type for \"before\" attribute");
+               }
+
+               if(iter->get_tension()!=0.0)
+                       waypoint_node->set_attribute("tension",strprintf("%f",iter->get_tension()));
+               if(iter->get_time_tension()!=0.0)
+                       waypoint_node->set_attribute("temporal-tension",strprintf("%f",iter->get_time_tension()));
+               if(iter->get_continuity()!=0.0)
+                       waypoint_node->set_attribute("continuity",strprintf("%f",iter->get_continuity()));
+               if(iter->get_bias()!=0.0)
+                       waypoint_node->set_attribute("bias",strprintf("%f",iter->get_bias()));
+
+       }
+
+       return root;
+}
+
+xmlpp::Element* encode_composite(xmlpp::Element* root,ValueNode_Composite::ConstHandle value_node,Canvas::ConstHandle canvas=0)
+{
+       assert(value_node);
+       root->set_name("composite");
+
+       root->set_attribute("type",ValueBase::type_name(value_node->get_type()));
+
+       int i;
+       for(i=0;i<value_node->link_count();i++)
+       {
+               string name(strprintf("c%d",i+1));
+               assert(value_node->get_link(i));
+               if(value_node->get_link(i)->is_exported())
+                       root->set_attribute(name,value_node->get_link(i)->get_relative_id(canvas));
+               else
+                       encode_value_node(root->add_child(name)->add_child("value_node"),value_node->get_link(i).constant(),canvas);
+       }
+
+       return root;
+}
+
+xmlpp::Element* encode_subtract(xmlpp::Element* root,ValueNode_Subtract::ConstHandle value_node,Canvas::ConstHandle canvas=0)
+{
+       assert(value_node);
+       root->set_name("subtract");
+
+       ValueNode::ConstHandle lhs=value_node->get_lhs();
+       ValueNode::ConstHandle rhs=value_node->get_rhs();
+       ValueNode::ConstHandle scalar=value_node->get_scalar();
+
+       assert(lhs);
+       assert(rhs);
+
+       root->set_attribute("type",ValueBase::type_name(value_node->get_type()));
+
+       if(lhs==rhs)
+               warning("LHS is equal to RHS, this <subtract> will always be zero!");
+
+       //if(value_node->get_scalar()!=1)
+       //      root->set_attribute("scalar",strprintf(VECTOR_VALUE_TYPE_FORMAT,value_node->get_scalar()));
+
+       if(!scalar->get_id().empty())
+               root->set_attribute("scalar",scalar->get_relative_id(canvas));
+       else
+               encode_value_node(root->add_child("scalar")->add_child("value_node"),scalar,canvas);
+
+       if(!lhs->get_id().empty())
+               root->set_attribute("lhs",lhs->get_relative_id(canvas));
+       else
+               encode_value_node(root->add_child("lhs")->add_child("value_node"),lhs,canvas);
+
+       if(!rhs->get_id().empty())
+               root->set_attribute("rhs",rhs->get_relative_id(canvas));
+       else
+               encode_value_node(root->add_child("rhs")->add_child("value_node"),rhs,canvas);
+
+       return root;
+}
+
+xmlpp::Element* encode_dynamic_list(xmlpp::Element* root,ValueNode_DynamicList::ConstHandle value_node,Canvas::ConstHandle canvas=0)
+{
+       assert(value_node);
+//     const float fps(canvas?canvas->rend_desc().get_frame_rate():0);
+       const float fps(0);
+       
+       root->set_name(value_node->get_name());
+
+       root->set_attribute("type",ValueBase::type_name(value_node->get_contained_type()));
+
+       vector<ValueNode_DynamicList::ListEntry>::const_iterator iter;
+
+       ValueNode_BLine::ConstHandle bline_value_node(ValueNode_BLine::ConstHandle::cast_dynamic(value_node));
+       
+       if(bline_value_node)
+       {
+               if(bline_value_node->get_loop())
+                       root->set_attribute("loop","true");
+               else
+                       root->set_attribute("loop","false");
+       }
+       
+       for(iter=value_node->list.begin();iter!=value_node->list.end();++iter)
+       {
+               xmlpp::Element  *entry_node=root->add_child("entry");
+               assert(iter->value_node);
+               if(!iter->value_node->get_id().empty())
+                       entry_node->set_attribute("use",iter->value_node->get_relative_id(canvas));
+               else
+                       encode_value_node(entry_node->add_child("value_node"),iter->value_node,canvas);
+
+               // process waypoints
+               {
+                       typedef sinfg::ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
+                       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+                       String begin_sequence;
+                       String end_sequence;
+
+                       const ActivepointList& timing_info(iter->timing_info);
+                       ActivepointList::const_iterator entry_iter;
+                       
+                       for(entry_iter=timing_info.begin();entry_iter!=timing_info.end();++entry_iter)
+                               if(entry_iter->state==true)
+                               {
+                                       if(entry_iter->priority)
+                                               begin_sequence+=strprintf("p%d ",entry_iter->priority);
+                                       begin_sequence+=entry_iter->time.get_string(fps)+", ";
+                               }       
+                               else
+                               {
+                                       if(entry_iter->priority)
+                                               end_sequence+=strprintf("p%d ",entry_iter->priority);
+                                       end_sequence+=entry_iter->time.get_string(fps)+", ";
+                               }
+                       
+                       // If this is just a plane-jane vanilla entry,
+                       // then don't bother with begins and ends
+                       if(end_sequence.empty() && begin_sequence=="SOT, ")
+                               begin_sequence.clear();
+                       
+                       if(!begin_sequence.empty())
+                       {
+                               // Remove the last ", " stuff
+                               begin_sequence=String(begin_sequence.begin(),begin_sequence.end()-2);
+                               // Add the attribute
+                               entry_node->set_attribute("on",begin_sequence);                         
+                       }                               
+
+                       if(!end_sequence.empty())
+                       {
+                               // Remove the last ", " stuff
+                               end_sequence=String(end_sequence.begin(),end_sequence.end()-2);
+                               // Add the attribute
+                               entry_node->set_attribute("off",end_sequence);                          
+                       }                               
+               }
+       }
+
+       return root;
+}
+
+// Generic linkable data node entry
+xmlpp::Element* encode_linkable_value_node(xmlpp::Element* root,LinkableValueNode::ConstHandle value_node,Canvas::ConstHandle canvas=0)
+{
+       assert(value_node);
+       root->set_name(value_node->get_name());
+
+       root->set_attribute("type",ValueBase::type_name(value_node->get_type()));
+
+       int i;
+       for(i=0;i<value_node->link_count();i++)
+       {
+               ValueNode::ConstHandle link=value_node->get_link(i).constant();
+               if(!link)
+                       throw runtime_error("Bad link");
+               if(link->is_exported())
+                       root->set_attribute(value_node->link_name(i),link->get_relative_id(canvas));
+               else
+                       encode_value_node(root->add_child(value_node->link_name(i))->add_child("value_node"),link,canvas);
+       }
+
+       return root;
+}
+
+xmlpp::Element* encode_value_node(xmlpp::Element* root,ValueNode::ConstHandle value_node,Canvas::ConstHandle canvas)
+{
+       assert(value_node);
+
+       if(ValueNode_Animated::ConstHandle::cast_dynamic(value_node))
+               encode_animated(root,ValueNode_Animated::ConstHandle::cast_dynamic(value_node),canvas);
+       else
+       if(ValueNode_Composite::ConstHandle::cast_dynamic(value_node))
+               encode_composite(root,ValueNode_Composite::ConstHandle::cast_dynamic(value_node),canvas);
+       else
+       if(ValueNode_Subtract::ConstHandle::cast_dynamic(value_node))
+               encode_subtract(root,ValueNode_Subtract::ConstHandle::cast_dynamic(value_node),canvas);
+       else
+       if(ValueNode_DynamicList::ConstHandle::cast_dynamic(value_node))
+               encode_dynamic_list(root,ValueNode_DynamicList::ConstHandle::cast_dynamic(value_node),canvas);
+       else if(ValueNode_Const::ConstHandle::cast_dynamic(value_node))
+       {
+               encode_value(root,ValueNode_Const::ConstHandle::cast_dynamic(value_node)->get_value(),canvas);
+       }
+       else
+       if(LinkableValueNode::ConstHandle::cast_dynamic(value_node))
+               encode_linkable_value_node(root,LinkableValueNode::ConstHandle::cast_dynamic(value_node),canvas);
+       else
+       {
+               error(_("Unknown ValueNode Type (%s), cannot create an XML representation"),value_node->get_local_name().c_str());
+               root->set_name("nil");
+       }
+
+       assert(root);
+
+       if(!value_node->get_id().empty())
+               root->set_attribute("id",value_node->get_id());
+
+       if(value_node->rcount()>1)
+               root->set_attribute("guid",(value_node->get_guid()^canvas->get_root()->get_guid()).get_string());
+
+       return root;
+}
+
+xmlpp::Element* encode_layer(xmlpp::Element* root,Layer::ConstHandle layer)
+{
+       root->set_name("layer");
+
+       root->set_attribute("type",layer->get_name());
+       root->set_attribute("active",layer->active()?"true":"false");
+
+       if(!layer->get_version().empty())
+               root->set_attribute("version",layer->get_version());
+       if(!layer->get_description().empty())
+               root->set_attribute("desc",layer->get_description());
+       if(!layer->get_group().empty())
+               root->set_attribute("group",layer->get_group());
+
+       Layer::Vocab vocab(layer->get_param_vocab());
+       Layer::Vocab::const_iterator iter;
+
+       const Layer::DynamicParamList &dynamic_param_list=layer->dynamic_param_list();
+
+       for(iter=vocab.begin();iter!=vocab.end();++iter)
+       {
+               // Handle dynamic parameters
+               if(dynamic_param_list.count(iter->get_name()))
+               {
+                       xmlpp::Element *node=root->add_child("param");
+                       node->set_attribute("name",iter->get_name());
+
+                       handle<const ValueNode> value_node=dynamic_param_list.find(iter->get_name())->second;
+
+                       // If the valuenode.has no ID, then it must be defined in-place
+                       if(value_node->get_id().empty())
+                       {
+                               encode_value_node(node->add_child("value_node"),value_node,layer->get_canvas().constant());
+                       }
+                       else
+                       {
+                               node->set_attribute("use",value_node->get_relative_id(layer->get_canvas()));
+                       }
+               }
+               else  // Handle normal parameters
+               if(iter->get_critical())
+               {
+                       ValueBase value=layer->get_param(iter->get_name());
+                       if(!value.is_valid())
+                       {
+                               error("Layer doesn't know it's own vocabulary -- "+iter->get_name());
+                               continue;
+                       }
+
+                       if(value.get_type()==ValueBase::TYPE_CANVAS && !value.get(Canvas::LooseHandle())->is_inline())
+                       {
+                               Canvas::Handle child(value.get(Canvas::LooseHandle()));
+                               
+                               if(!value.get(Canvas::Handle()))
+                                       continue;
+                               xmlpp::Element *node=root->add_child("param");
+                               node->set_attribute("name",iter->get_name());
+                               node->set_attribute("use",child->get_relative_id(layer->get_canvas()));
+                               continue;
+                       }
+                       xmlpp::Element *node=root->add_child("param");
+                       node->set_attribute("name",iter->get_name());
+
+                       encode_value(node->add_child("value"),value,layer->get_canvas().constant());
+               }               
+       }
+
+
+       return root;
+}
+
+xmlpp::Element* encode_canvas(xmlpp::Element* root,Canvas::ConstHandle canvas)
+{
+       assert(canvas);
+       const RendDesc &rend_desc=canvas->rend_desc();
+       root->set_name("canvas");
+       
+       if(canvas->is_root())
+               root->set_attribute("version","0.1");
+
+       if(!canvas->get_id().empty() && !canvas->is_root() && !canvas->is_inline())
+               root->set_attribute("id",canvas->get_id());
+
+       if(!canvas->parent() || canvas->parent()->rend_desc().get_w()!=canvas->rend_desc().get_w())
+               root->set_attribute("width",strprintf("%d",rend_desc.get_w()));
+
+       if(!canvas->parent() || canvas->parent()->rend_desc().get_h()!=canvas->rend_desc().get_h())
+               root->set_attribute("height",strprintf("%d",rend_desc.get_h()));
+
+       if(!canvas->parent() || canvas->parent()->rend_desc().get_x_res()!=canvas->rend_desc().get_x_res())
+               root->set_attribute("xres",strprintf("%f",rend_desc.get_x_res()));
+
+       if(!canvas->parent() || canvas->parent()->rend_desc().get_y_res()!=canvas->rend_desc().get_y_res())
+               root->set_attribute("yres",strprintf("%f",rend_desc.get_y_res()));
+
+
+       if(!canvas->parent() ||
+               canvas->parent()->rend_desc().get_tl()!=canvas->rend_desc().get_tl() ||
+               canvas->parent()->rend_desc().get_br()!=canvas->rend_desc().get_br())
+       root->set_attribute("view-box",strprintf(VIEW_BOX_FORMAT,
+               rend_desc.get_tl()[0],
+               rend_desc.get_tl()[1],
+               rend_desc.get_br()[0],
+               rend_desc.get_br()[1])
+       );
+
+       if(!canvas->parent() || canvas->parent()->rend_desc().get_antialias()!=canvas->rend_desc().get_antialias())
+               root->set_attribute("antialias",strprintf("%d",rend_desc.get_antialias()));
+
+       if(!canvas->parent())
+               root->set_attribute("fps",strprintf(TIME_TYPE_FORMAT,rend_desc.get_frame_rate()));
+
+       if(!canvas->parent() || canvas->parent()->rend_desc().get_time_start()!=canvas->rend_desc().get_time_start())
+               root->set_attribute("begin-time",rend_desc.get_time_start().get_string(rend_desc.get_frame_rate()));
+
+       if(!canvas->parent() || canvas->parent()->rend_desc().get_time_end()!=canvas->rend_desc().get_time_end())
+               root->set_attribute("end-time",rend_desc.get_time_end().get_string(rend_desc.get_frame_rate()));
+       
+       if(!canvas->is_inline())
+       {
+               root->set_attribute("bgcolor",strprintf(VIEW_BOX_FORMAT,
+                       rend_desc.get_bg_color().get_r(),
+                       rend_desc.get_bg_color().get_g(),
+                       rend_desc.get_bg_color().get_b(),
+                       rend_desc.get_bg_color().get_a())
+               );
+
+               if(!canvas->get_name().empty())
+                       root->add_child("name")->set_child_text(canvas->get_name());
+               if(!canvas->get_description().empty())
+                       root->add_child("desc")->set_child_text(canvas->get_description());
+               if(!canvas->get_author().empty())
+                       root->add_child("author")->set_child_text(canvas->get_description());
+
+               std::list<String> meta_keys(canvas->get_meta_data_keys());
+               while(!meta_keys.empty())
+               {
+                       xmlpp::Element* meta_element(root->add_child("meta"));
+                       meta_element->set_attribute("name",meta_keys.front());
+                       meta_element->set_attribute("content",canvas->get_meta_data(meta_keys.front()));
+                       meta_keys.pop_front();
+               }
+               for(KeyframeList::const_iterator iter=canvas->keyframe_list().begin();iter!=canvas->keyframe_list().end();++iter)
+                       encode_keyframe(root->add_child("keyframe"),*iter,canvas->rend_desc().get_frame_rate());
+       }
+       
+       // Output the <defs> section
+       if(!canvas->is_inline() && !canvas->value_node_list().empty() || !canvas->children().empty())
+       {
+               xmlpp::Element *node=root->add_child("defs");
+               const ValueNodeList &value_node_list(canvas->value_node_list());
+
+               for(ValueNodeList::const_iterator iter=value_node_list.begin();iter!=value_node_list.end();++iter)
+               {
+                       // If the value_node is a constant, then use the shorthand
+                       if(handle<ValueNode_Const>::cast_dynamic(*iter))
+                       {
+                               ValueNode_Const::Handle value_node(ValueNode_Const::Handle::cast_dynamic(*iter));
+                               reinterpret_cast<xmlpp::Element*>(encode_value(node->add_child("value"),value_node->get_value()))->set_attribute("id",value_node->get_id());
+                               continue;
+                       }
+                       encode_value_node(node->add_child("value_node"),*iter,canvas);
+                       // writeme
+               }
+
+               for(Canvas::Children::const_iterator iter=canvas->children().begin();iter!=canvas->children().end();++iter)
+               {
+                       encode_canvas(node->add_child("canvas"),*iter);
+               }
+       }       
+
+       Canvas::const_reverse_iterator iter;
+
+       for(iter=canvas->rbegin();iter!=canvas->rend();++iter)
+               encode_layer(root->add_child("layer"),*iter);   
+
+       return root;
+}
+
+bool
+sinfg::save_canvas(const String &filename, Canvas::ConstHandle canvas)
+{
+       sinfg::String tmp_filename(filename+".TMP");
+
+       try
+       {
+               assert(canvas);
+               xmlpp::Document document;
+       
+               encode_canvas(document.create_root_node("canvas"),canvas);
+       
+               document.write_to_file_formatted(tmp_filename);
+       }
+       catch(...) { sinfg::error("sinfg::save_canvas(): Caught unknown exception"); return false; }
+       
+       
+#ifdef _WIN32
+       // On Win32 platforms, rename() has bad behavior. work around it.
+       char old_file[80]="sif.XXXXXXXX";
+       mktemp(old_file);
+       rename(filename.c_str(),old_file);      
+       if(rename(tmp_filename.c_str(),filename.c_str())!=0)
+       {
+               rename(old_file,tmp_filename.c_str());
+               sinfg::error("sinfg::save_canvas(): Unable to rename file to correct filename, errno=%d",errno);
+               return false;
+       }
+       remove(old_file);
+#else
+       if(rename(tmp_filename.c_str(),filename.c_str())!=0)
+       {
+               sinfg::error("sinfg::save_canvas(): Unable to rename file to correct filename, errno=%d",errno);
+               return false;
+       }
+#endif
+
+       return true;
+}
+
+String
+sinfg::canvas_to_string(Canvas::ConstHandle canvas)
+{
+       assert(canvas);
+
+       xmlpp::Document document;
+
+       encode_canvas(document.create_root_node("canvas"),canvas);
+
+       return document.write_to_string_formatted();
+}
diff --git a/synfig-core/trunk/src/synfig/savecanvas.h b/synfig-core/trunk/src/synfig/savecanvas.h
new file mode 100644 (file)
index 0000000..e519415
--- /dev/null
@@ -0,0 +1,53 @@
+/* === S I N F G =========================================================== */
+/*!    \file savecanvas.h
+**     \brief writeme
+**
+**     $Id: savecanvas.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_SAVECANVAS_H
+#define __SINFG_SAVECANVAS_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "string.h"
+#include "canvas.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/* === E X T E R N S ======================================================= */
+
+//!    Saves a canvas to \a filename
+/*!    \return \c true on success, \c false on error. */
+bool save_canvas(const String &filename, Canvas::ConstHandle canvas);
+
+//! Stores a Canvas in a string in XML format
+String canvas_to_string(Canvas::ConstHandle canvas);
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/segment.h b/synfig-core/trunk/src/synfig/segment.h
new file mode 100644 (file)
index 0000000..10b1ab3
--- /dev/null
@@ -0,0 +1,66 @@
+/* === S I N F G =========================================================== */
+/*!    \file segment.h
+**     \brief Template Header
+**
+**     $Id: segment.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_SEGMENT_H
+#define __SINFG_SEGMENT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "vector.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+/*!    \struct Segment
+**     \todo writeme
+*/
+struct Segment
+{
+       Point   p1,p2;
+       Vector  t1,t2;
+
+       Segment() { }
+       Segment(Point p1,Vector t1,Point p2, Vector t2):
+               p1(p1),
+               p2(p2),
+               t1(t1),
+               t2(t2)
+       { }
+       Segment(Point p1,Point p2):
+               p1(p1),
+               p2(p2),
+               t1(p2-p1),
+               t2(p2-p1)
+       { }
+}; // END of struct Segment
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/sinfg.h b/synfig-core/trunk/src/synfig/sinfg.h
new file mode 100644 (file)
index 0000000..6f2c4e8
--- /dev/null
@@ -0,0 +1,137 @@
+/* === S I N F G =========================================================== */
+/*!    \file sinfg.h
+**     \brief Primary Header for Sinfg
+**
+**     $Id: sinfg.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG__
+#define __SINFG__
+
+#ifndef __cplusplus
+#error Sorry, Sinfg only supports C++ at this time. See README for details.
+#endif
+
+#warning The use of this header is deprecated. Please use the individual header files.
+
+/* === M A C R O S ========================================================= */
+
+/*! \def SINFG_LEAN
+**     \brief Define this to remove unused features, speeding up compile time.
+**
+**     Define SINFG_LEAN if your plug-in
+**     or program doesn't use the sinfg::Angle class
+**     or the rendering subsystem. This can speed up
+**     compiles. You may also wish to individualy
+**     use the macros SINFG_NO_ANGLE and
+**     SINFG_NO_RENDER.
+**     \see SINFG_NO_ANGLE, SINFG_NO_RENDER
+*/
+#ifdef SINFG_LEAN
+# ifndef SINFG_NO_ANGLE
+#  define SINFG_NO_ANGLE
+# endif
+# ifndef SINFG_NO_RENDER
+#  define SINFG_NO_RENDER
+# endif
+#endif
+
+/*!    \def SINFG_LAYER
+**     The SINFG_LAYER macro is useful for when you
+**     are compiling layers, and can help to improve
+**     build time.
+*/
+#ifdef SINFG_LAYER
+# ifndef SINFG_NO_RENDER
+#  define SINFG_NO_RENDER
+# endif
+# define SINFG_NO_LOADSAVE
+#endif
+
+/*!    \def SINFG_TARGET
+**     The SINFG_TARGET macro is useful for when you
+**     are compiling render targets, and can help to
+**     improve build time.
+*/
+#ifdef SINFG_TARGET
+# ifdef SINFG_NO_RENDER
+#  error You defined SINFG_TARGET, but also SINFG_NO_RENDER. This doesnt make sense.
+# endif
+# ifndef SINFG_NO_ANGLE
+#  define SINFG_NO_ANGLE
+# endif
+# define SINFG_NO_LOADSAVE
+#endif
+
+/*!    \def SINFG_MODULE
+**     \todo Writeme
+*/
+#ifdef SINFG_MODULE
+# define SINFG_NO_LOADSAVE
+#endif
+
+/*! \namespace sinfg
+**     \brief Where every function and class of the sinfg library can be found
+**     \todo Writeme
+*/
+
+/* === H E A D E R S ======================================================= */
+
+#include "version.h"
+#include "general.h"
+#include "module.h"
+#include "color.h"
+#include "canvas.h"
+#include "layer.h"
+#include "vector.h"
+#include "types.h"
+#include "segment.h"
+
+#ifndef SINFG_NO_RENDER
+# include "render.h"
+#endif
+
+#ifndef SINFG_LAYER
+#include "target.h"
+#endif
+
+#include "valuenode.h"
+#include "valuenode_subtract.h"
+//#include "valuenode_animated.h"
+#include "valuenode_composite.h"
+#include "valuenode_const.h"
+#include "valuenode_linear.h"
+#include "valuenode_dynamiclist.h"
+#include "valuenode_reference.h"
+
+#ifndef SINFG_NO_LOADSAVE
+# include "savecanvas.h"
+# include "loadcanvas.h"
+#endif
+
+#include "importer.h"
+#include "surface.h"
+
+#include "string.h"
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/sinfg.nsh b/synfig-core/trunk/src/synfig/sinfg.nsh
new file mode 100644 (file)
index 0000000..f7c484a
--- /dev/null
@@ -0,0 +1,19 @@
+; The stuff to install\r
+Section "Synfig Core"\r
+\r
+  SectionIn RO\r
+  \r
+  ; Set output path to the installation directory.\r
+  SetOutPath "$INSTDIR\bin"\r
+  \r
+  ; Put file there\r
+  File "src\sinfg\.libs\libsinfg-0.dll"\r
+\r
+SectionEnd\r
+\r
+Section "un.Synfig Core"\r
+       Delete "$INSTDIR\bin\libsinfg-0.dll"\r
+       RMDir "$INSTDIR"\r
+SectionEnd\r
+\r
+\r
diff --git a/synfig-core/trunk/src/synfig/smartfile.h b/synfig-core/trunk/src/synfig/smartfile.h
new file mode 100644 (file)
index 0000000..25d2de3
--- /dev/null
@@ -0,0 +1,51 @@
+/* === S I N F G =========================================================== */
+/*!    \file smartfile.h
+**     \brief Template Header
+**
+**     $Id: smartfile.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_SMARTFILE_H
+#define __SINFG_SMARTFILE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <cstdio>
+#include <ETL/smart_ptr>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+struct _FILE_deleter
+{
+       void operator()(FILE* x)const { if(x!=stdout && x!=stdin) fclose(x); }
+};
+       
+typedef etl::smart_ptr<FILE,_FILE_deleter> SmartFILE;
+       
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/string.h b/synfig-core/trunk/src/synfig/string.h
new file mode 100644 (file)
index 0000000..58d8bec
--- /dev/null
@@ -0,0 +1,61 @@
+/* === S I N F G =========================================================== */
+/*!    \file string.h
+**     \brief Template Header
+**
+**     $Id: string.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_STRING_H
+#define __SINFG_STRING_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <string>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+/*
+namespace std
+{
+template<class _CharT> struct char_traits;
+template<> struct char_traits<char>;
+template<typename _Alloc> class allocator;
+template<typename _CharT, typename _Traits,typename _Alloc>class basic_string;
+typedef basic_string<char,char_traits<char>,allocator<char> >    string;
+
+}; // END of namespace std
+*/
+
+namespace sinfg
+{
+
+/*!    \typedef String
+**     \todo writeme
+*/
+typedef std::string String;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/string_decl.h b/synfig-core/trunk/src/synfig/string_decl.h
new file mode 100644 (file)
index 0000000..17cbd61
--- /dev/null
@@ -0,0 +1,57 @@
+/* === S I N F G =========================================================== */
+/*!    \file string_decl.h
+**     \brief Template Header
+**
+**     $Id: string_decl.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_STRING_DECL_H
+#define __SINFG_STRING_DECL_H
+
+/* === H E A D E R S ======================================================= */
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace std
+{
+template<class _CharT> struct char_traits;
+template<> struct char_traits<char>;
+template<typename _Alloc> class allocator;
+template<typename _CharT, typename _Traits,typename _Alloc>class basic_string;
+typedef basic_string<char,char_traits<char>,allocator<char> >    string;
+
+}; // END of namespace std
+
+namespace sinfg
+{
+
+/*!    \typedef String
+**     \todo writeme
+*/
+typedef std::string String;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/surface.cpp b/synfig-core/trunk/src/synfig/surface.cpp
new file mode 100644 (file)
index 0000000..fb905b7
--- /dev/null
@@ -0,0 +1,238 @@
+/* ========================================================================
+** Sinfg
+** Template File
+** $Id: surface.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**
+** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+** This software and associated documentation
+** are CONFIDENTIAL and PROPRIETARY property of
+** the above-mentioned copyright holder.
+**
+** You may not copy, print, publish, or in any
+** other way distribute this software without
+** a prior written agreement with
+** the copyright holder.
+**
+** === N O T E S ===========================================================
+**
+** ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "canvas.h"
+#include "surface.h"
+#include "target_scanline.h"
+#include "general.h"
+
+#ifdef HAS_VIMAGE
+#include <Accelerate/Accelerate.h>
+#endif
+
+#endif
+
+using namespace sinfg;
+using namespace std;
+using namespace etl;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+class target2surface : public sinfg::Target_Scanline
+{
+public:
+       Surface *surface;
+       bool     sized;
+public:
+       target2surface(Surface *surface);
+       virtual ~target2surface();
+
+       virtual bool set_rend_desc(sinfg::RendDesc *newdesc);
+       
+       virtual bool start_frame(sinfg::ProgressCallback *cb);
+       
+       virtual void end_frame();
+
+       virtual Color * start_scanline(int scanline);
+
+       virtual bool end_scanline();
+};
+
+target2surface::target2surface(Surface *surface):surface(surface)
+{
+}
+
+target2surface::~target2surface()
+{
+}
+
+bool
+target2surface::set_rend_desc(sinfg::RendDesc *newdesc)
+{
+       assert(newdesc);
+       assert(surface);
+       desc=*newdesc;
+       return sinfg::Target_Scanline::set_rend_desc(newdesc);
+}
+       
+bool
+target2surface::start_frame(sinfg::ProgressCallback *cb) 
+{ 
+       if(surface->get_w() != desc.get_w() || surface->get_h() != desc.get_h())
+       {
+               surface->set_wh(desc.get_w(),desc.get_h());
+       }
+       return true; 
+}
+       
+void
+target2surface::end_frame()
+{
+       return;
+}
+       
+Color *
+target2surface::start_scanline(int scanline)
+{
+       return (*surface)[scanline];
+}
+
+bool
+target2surface::end_scanline()
+{
+       return true;
+}
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Target_Scanline::Handle
+sinfg::surface_target(Surface *surface)
+{
+       return Target_Scanline::Handle(new target2surface(surface));
+}
+
+void
+sinfg::Surface::clear()
+{
+#ifdef HAS_VIMAGE
+       fill(Color(0.5,0.5,0.5,0.0000001));
+#else
+       etl::surface<Color, ColorAccumulator, ColorPrep>::clear();
+#endif
+}
+
+void
+sinfg::Surface::blit_to(alpha_pen& pen, int x, int y, int w, int h)
+{
+       static const float epsilon(0.00001);
+       const float alpha(pen.get_alpha());
+       if(     pen.get_blend_method()==Color::BLEND_STRAIGHT && fabs(alpha-1.0f)<epsilon )
+       {
+               if(x>=get_w() || y>=get_w())
+                       return;
+
+               //clip source origin
+               if(x<0)
+               {
+                       w+=x;   //decrease
+                       x=0;            
+               }
+               
+               if(y<0)
+               {
+                       h+=y;   //decrease
+                       y=0;            
+               }
+                               
+               //clip width against dest width
+               w = min(w,pen.end_x()-pen.x());
+               h = min(h,pen.end_y()-pen.y());
+               
+               //clip width against src width
+               w = min(w,get_w()-x);           
+               h = min(h,get_h()-y);   
+
+               if(w<=0 || h<=0)
+                       return;
+                               
+               for(int i=0;i<h;i++)
+               {
+                       char* src(static_cast<char*>(static_cast<void*>(operator[](y)+x))+i*get_w()*sizeof(Color));
+                       char* dest(static_cast<char*>(static_cast<void*>(pen.x()))+i*pen.get_width()*sizeof(Color));
+                       memcpy(dest,src,w*sizeof(Color));
+               }
+               return;
+       }
+       
+#ifdef HAS_VIMAGE      
+       if(     pen.get_blend_method()==Color::BLEND_COMPOSITE && fabs(alpha-1.0f)<epsilon )
+       {
+               if(x>=get_w() || y>=get_w())
+                       return;
+
+               //clip source origin
+               if(x<0)
+               {
+                       //u-=x; //increase
+                       w+=x;   //decrease
+                       x=0;            
+               }
+               
+               if(y<0)
+               {
+                       //v-=y; //increase
+                       h+=y;   //decrease
+                       y=0;            
+               }
+                               
+               //clip width against dest width
+               w = min(w,pen.end_x()-pen.x());
+               h = min(h,pen.end_y()-pen.y());
+               
+               //clip width against src width
+               w = min(w,get_w()-x);           
+               h = min(h,get_h()-y);   
+
+               if(w<=0 || h<=0)
+                       return;
+
+
+
+               vImage_Buffer top,bottom;
+               vImage_Buffer& dest(bottom);
+               
+               top.data=static_cast<void*>(operator[](y)+x);
+               top.height=h;
+               top.width=w;
+               //top.rowBytes=get_w()*sizeof(Color); //! \fixme this should get the pitch!!
+               top.rowBytes=get_pitch();
+
+               bottom.data=static_cast<void*>(pen.x());
+               bottom.height=h;
+               bottom.width=w;
+               //bottom.rowBytes=pen.get_width()*sizeof(Color); //! \fixme this should get the pitch!!
+               bottom.rowBytes=pen.get_pitch(); //! \fixme this should get the pitch!!
+                               
+               vImage_Error ret;
+               ret=vImageAlphaBlend_ARGBFFFF(&top,&bottom,&dest,kvImageNoFlags);
+               
+               assert(ret!=kvImageNoError);
+               
+               return;
+       }
+#endif
+       etl::surface<Color, ColorAccumulator, ColorPrep>::blit_to(pen,x,y,w,h);
+}
+
diff --git a/synfig-core/trunk/src/synfig/surface.h b/synfig-core/trunk/src/synfig/surface.h
new file mode 100644 (file)
index 0000000..976b159
--- /dev/null
@@ -0,0 +1,158 @@
+/* === S I N F G =========================================================== */
+/*!    \file surface.h
+**     \brief Surface and Pen Definitions
+**
+**     $Id: surface.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_SURFACE_H
+#define __SINFG_SURFACE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "color.h"
+#include "renddesc.h"
+#include <ETL/pen>
+#include <ETL/surface>
+#include <ETL/handle>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Target;
+class Target_Scanline;
+
+class ColorPrep
+{
+public:
+       ColorAccumulator cook(Color x)const
+       {
+               x.set_r(x.get_r()*x.get_a());
+               x.set_g(x.get_g()*x.get_a());
+               x.set_b(x.get_b()*x.get_a());
+               return x;
+       }
+       Color uncook(ColorAccumulator x)const
+       {
+               if(!x.get_a())
+                       return Color::alpha();
+               
+               const float a(1.0f/x.get_a());
+               
+               x.set_r(x.get_r()*a);
+               x.set_g(x.get_g()*a);
+               x.set_b(x.get_b()*a);
+               return x;
+       }
+};
+
+/*!    \class Surface
+**     \brief Bitmap Surface
+**     \todo writeme
+*/
+class Surface : public etl::surface<Color, ColorAccumulator, ColorPrep>
+{
+public:
+       typedef Color value_type;
+       class alpha_pen;
+
+       Surface() { }
+
+       Surface(const size_type::value_type &w, const size_type::value_type &h):
+               etl::surface<Color, ColorAccumulator,ColorPrep>(w,h) { }
+
+       Surface(const size_type &s):
+               etl::surface<Color, ColorAccumulator,ColorPrep>(s) { }
+
+       template <typename _pen>
+       Surface(const _pen &_begin, const _pen &_end):
+               etl::surface<Color, ColorAccumulator,ColorPrep>(_begin,_end) { }
+
+       template <class _pen> void blit_to(_pen &pen)
+       { return blit_to(pen,0,0, get_w(),get_h()); }
+
+       template <class _pen> void
+       blit_to(_pen& DEST_PEN, int x, int y, int w, int h)
+       {
+               etl::surface<Color, ColorAccumulator, ColorPrep>::blit_to(DEST_PEN,x,y,w,h);
+       }
+
+       void clear();
+
+       void blit_to(alpha_pen& DEST_PEN, int x, int y, int w, int h);
+};     // END of class Surface
+
+#ifndef DOXYGEN_SKIP
+
+/*! \internal Used by Pen_Alpha */
+struct _BlendFunc
+{
+       Color::BlendMethod blend_method;
+
+       _BlendFunc(Color::BlendMethod b= Color::BLEND_COMPOSITE):blend_method(b) { }
+
+       Color operator()(const Color &a,const Color &b,const Color::value_type &t)const
+       {
+               return Color::blend(b,a,t,blend_method);
+       }
+};     // END of class _BlendFunc
+
+#endif
+
+/*!    \class Surface::alpha_pen
+**     \brief Alpha-Blending Pen
+**
+**     This pen works like a normal alpha pen, except that it supports
+**     a variety of blending methods. Use set_blend_method() to select
+**     which blending method you want to use.
+**     The default blending method is Color::BLEND_COMPOSITE.
+**     \see Color::BlendMethod
+*/
+class Surface::alpha_pen : public etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc >
+{
+public:
+       alpha_pen() { }
+       alpha_pen(const etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc > &x):
+               etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc >(x)
+       { }
+       
+       alpha_pen(const etl::generic_pen<Color, ColorAccumulator>& pen, const Color::value_type &a = 1, const _BlendFunc &func = _BlendFunc()):
+               etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc >(pen,a,func)
+       { }
+
+       //! Sets the blend method to that described by \a method
+       void set_blend_method(Color::BlendMethod method) { affine_func_.blend_method=method; }
+
+       //! Returns the blend method being used for this pen
+       Color::BlendMethod get_blend_method()const { return affine_func_.blend_method; }
+};     // END of class Surface::alpha_pen
+
+//! Creates a target that will render to \a surface
+etl::handle<Target_Scanline> surface_target(Surface *surface);
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/surfacenew.cpp b/synfig-core/trunk/src/synfig/surfacenew.cpp
new file mode 100644 (file)
index 0000000..42814f6
--- /dev/null
@@ -0,0 +1,705 @@
+/* === S I N F G =========================================================== */
+/*!    \file surfacenew.cpp
+**     \brief Template File
+**
+**     $Id: surfacenew.cpp,v 1.1 2005/01/21 19:29:10 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "surfacenew.h"
+#include <ETL/ref_count>
+#include "mutex.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+class SurfaceNew::ChannelData
+{
+private:
+       etl::reference_counter ref_count_;
+
+       float* data_;
+       float* origin_;
+       
+       int w_,h_,stride_;
+       
+public:
+
+       RWLock rw_lock;
+
+       ChannelData():
+               is_defined_(false),
+               data_(0),
+               origin_(0),
+               w_(0),
+               h_(0)
+       {
+       }
+       
+       ~ChannelData()
+       {
+               if(ref_count_.unique())
+                       delete [] data_;
+       }
+       
+       void set_wh(int w, int h)
+       {
+               w_=w;
+               h_=h;
+               stride_=w;
+               
+               if(data_&&ref_count_.is_unique())
+                       delete [] data_;
+                       
+               ref_count.make_unique();
+               data_=new float [w_*h_];
+               origin_=data_;
+               clear();
+       }
+       
+       void crop(int x, int y, int w, int h)
+       {
+               origin_=origin+y*stride_+x;
+               w_=w;
+               h_=h;
+       }
+       
+       int get_stride()const
+       {
+               return stride_;
+       }
+       
+       void clear()
+       {
+               for(int i=0;i<h;i++)
+                       bzero(origin_+stride_*i,w_*sizeof(float));
+       }
+
+       void fill(float v)
+       {
+               float* ptr(get_data());
+               
+               for(int y=0;y<h;y++,ptr+=stride_)
+                       for(int i=0;i<w_;i++)
+                               ptr[i]=v;
+       }
+
+       float* get_data() { return origin_; }
+
+       void make_unique()
+       {
+               if(!ref_count_.unique())
+               {
+                       ref_count_.make_unique();
+                       float* old_data(origin_);
+                       int old_stride;
+                       
+                       data_=new float [w_*h_];
+                       origin_=data_;
+                       stride_=w_;
+                       
+                       for(int i=0;i<h;i++)
+                               memcpy(data_+i*stride_,old_data+i*old_stride,sizeof(float)*w_);
+               }
+       }
+}; // END of class ChannelData
+
+/* === M E T H O D S ======================================================= */
+
+SurfaceNew::SurfaceNew():
+       w_(0),
+       h_(0),
+       color_system_(COLORSYS_RGB),
+       premult_flag_(false)
+{
+}
+
+SurfaceNew~SurfaceNew()
+{
+}
+
+SurfaceNew::Handle
+SurfaceNew::create(int w, int h, ColorSystem sys=COLORSYS_RGB)
+{
+       Handle ret(new SurfaceNew);
+       
+       ret.set_wh(w,h);
+       ret.set_color_system(sys);
+       
+       return ret;
+}
+
+SurfaceNew::Handle
+SurfaceNew::create(const Surface&)
+{
+       // ***WRITEME***
+       return 0;
+}
+
+SurfaceNew::Handle
+SurfaceNew::create(HandleConst orig)
+{
+       Lock lock(orig);
+       
+       Handle ret(new SurfaceNew);
+
+       ret.w_=orig.w_;
+       ret.h_=orig.h_;
+       ret.color_system_=orig.color_system_;
+       ret.premult_flag_=orig.premult_flag_;
+       ret.channel_map_=orig.channel_map_;
+       
+       return ret;
+}
+
+Handle
+SurfaceNew::crop(HandleConst, int x, int y, int w, int h)
+{
+       Lock lock(orig);
+       
+       Handle ret(new SurfaceNew);
+
+       ret.w_=orig.w_;
+       ret.h_=orig.h_;
+       ret.color_system_=orig.color_system_;
+       ret.premult_flag_=orig.premult_flag_;
+       ret.channel_map_=orig.channel_map_;
+
+       std::map<Channel,ChannelData>::iterator iter;
+       for(iter=ret.channel_map_.begin();iter!=ret.channel_map_.end();++iter)
+               iter->crop(x,y,w,h);
+       
+       return ret;
+}
+
+int
+SurfaceNew::get_w()const
+{
+       return w_;
+}
+       
+int
+SurfaceNew::get_h()const
+{
+       return h_;
+}
+       
+void
+SurfaceNew::set_wh(int w, int h)
+{
+       if(w!=w_ || h!=h_)
+       {
+               w_=w;
+               h_=h;
+               channel_map_.clear();
+       }
+}
+
+SurfaceNew::ColorSystem
+SurfaceNew::get_color_system()const
+{
+       return color_system_;
+}
+
+void
+SurfaceNew::set_color_system(SurfaceNew::ColorSystem x)
+{
+       color_system_=x;
+}
+
+Color
+SurfaceNew::get_color(int x, int y)const
+{
+       // This operation is rather expensive, as it should be.
+       // I want to discurage people from using it all over the place.
+       
+       Color ret(
+               lock_channel_const(CHAN_R).get_value(x,y),
+               lock_channel_const(CHAN_G).get_value(x,y),
+               lock_channel_const(CHAN_B).get_value(x,y),
+               lock_channel_const(CHAN_A).get_value(x,y)
+       );
+       
+       if(get_premult())
+       {
+               ret=ret.demult_alpha();
+       }
+       
+       return ret;
+}
+       
+void
+SurfaceNew::lock()
+{
+       mutex_.lock();
+}
+       
+void
+SurfaceNew::unlock()
+{
+       mutex_.unlock();
+}
+       
+bool
+SurfaceNew::trylock()
+{
+       return mutex_.trylock();
+}
+       
+SurfaceNew::ChannelLock
+SurfaceNew::lock_channel(SurfaceNew::Channel chan)
+{
+       if(!is_channel_defined(chan)
+               channel_map_[chan].set_wh(get_w(),get_h());
+       else
+               channel_map_[chan].make_unique();
+
+       ChannelLockConst channel_lock;
+       
+       channel_lock.surface_=this;
+       channel_lock.channel_=chan;
+
+       channel_map_[chan].rw_lock.writer_lock();
+       
+       return channel_lock;
+}
+
+SurfaceNew::ChannelLockConst
+SurfaceNew::lock_channel_const(SurfaceNew::Channel chan)const
+{
+       if(!is_channel_defined(chan)
+               channel_map_[chan].set_wh(get_w(),get_h());
+
+       ChannelLockConst channel_lock;
+       
+       channel_lock.surface_=this;
+       channel_lock.channel_=chan;
+
+       channel_map_[chan].rw_lock.reader_lock();
+       
+       return channel_lock;
+}
+
+SurfaceNew::ChannelLock
+SurfaceNew::lock_channel_alpha(SurfaceNew::Channel chan)
+{
+       // Change this when per-channel alpha
+       // is implemented
+       return lock_channel(CHAN_A);
+}
+
+SurfaceNew::ChannelLockConst
+SurfaceNew::lock_channel_alpha_const(SurfaceNew::Channel chan)const
+{
+       // Change this when per-channel alpha
+       // is implemented
+       return lock_channel_const(CHAN_A);
+}
+
+bool
+SurfaceNew::is_channel_defined(Channel chan)const
+{
+       return channel_map_.count(chan);
+}
+
+bool
+SurfaceNew::get_premult()const
+{
+       return premult_flag_;
+}
+
+void
+SurfaceNew::set_premult(bool x)
+{
+       if(x==premult_flag_)
+               return;
+               
+       premult_flag_=x;
+       
+       for(int i=0;i<3;i++)
+       {
+               Channel chan;
+               if(get_color_system()==COLORSYS_RGB)switch(i)
+               {
+                       case 0: chan=CHAN_R;
+                       case 1: chan=CHAN_G;
+                       case 2: chan=CHAN_B;
+               }
+               else
+               if(get_color_system()==COLORSYS_YUV)switch(i)
+               {
+                       case 0: chan=CHAN_Y;
+                       case 1: chan=CHAN_U;
+                       case 2: chan=CHAN_V;
+               }
+               
+               // If this channel isn't defined, then
+               // skip it and move on to the next one
+               if(!is_channel_defined(chan))
+                       continue;
+                       
+               ChannelLock color_channel(lock_channel(chan));
+               ChannelLockConst alpha_channel(lock_channel_alpha_const(chan));
+               const int w(get_w());
+               const int h(get_h());
+               
+               float* color_ptr(color_channel.get_data_ptr());
+               const float* alpha_ptr(alpha_channel.get_data_ptr());
+               
+               const int color_pitch(color_channel.get_data_ptr_stride()-w);
+               const int alpha_pitch(alpha_channel.get_data_ptr_stride()-w);
+               
+               if(premult_flag_)
+               {
+                       for(int y=0;y<h;y++,color_ptr+=color_pitch,alpha_ptr+=alpha_pitch)
+                               for(int x=0;x<w;x++,color_ptr++,alpha_ptr++)
+                                       *color_ptr *= *alpha_ptr;
+               }
+               else
+               {
+                       for(int y=0;y<h;y++,color_ptr+=color_pitch,alpha_ptr+=alpha_pitch)
+                               for(int x=0;x<w;x++,color_ptr++,alpha_ptr++)
+                                       *color_ptr /= *alpha_ptr;
+               }
+       }
+}
+
+void
+SurfaceNew::blit(
+       Handle dest, int x_dest, int y_dest,
+       HandleConst src, int x_src, int y_src, int w_src, int h_src,
+       float amount=1.0, Color::BlendMethod bm=Color::BLEND_COMPOSITE
+)
+{
+       blit(
+               dest,
+               x_dest,
+               y_dest,
+               crop(
+                       src,
+                       x,
+                       y,
+                       w,
+                       h
+               ),
+               amount,
+               bm
+       );
+}
+
+void
+SurfaceNew::blit(
+       Handle dest, int x_dest, int y_dest,
+       HandleConst src
+       float amount=1.0, Color::BlendMethod bm=Color::BLEND_COMPOSITE
+)
+{
+       int w(src->get_w()), h(src->get_h);
+       
+       // Clip
+       {
+               int x(0), y(0);
+               
+               if(x_dest+w>dest.get_w())
+                       w=dest.get_w()-x_dest;
+               if(y_dest+h>dest.get_h())
+                       h=dest.get_h()-y_dest;
+               if(x_dest<0)
+               {
+                       x-=x_dest;
+                       w+=x_dest;
+               }
+               if(y_dest<0)
+               {
+                       y-=y_dest;
+                       h+=y_dest;
+               }
+               src=crop(src,x,y,w,h);
+       }
+       
+       dest=crop(dest,x_dest,y_dest,w,h);
+
+       if(bm==Color::BLEND_STRAIGHT)
+       {
+               chan_mlt(dest,amount/(1.0-amount));
+               chan_add(dest,src);
+               chan_mlt(dest,(1.0-amount)/amount);
+       }
+       
+       if(bm==Color::BLEND_COMPOSITE)
+       {
+               
+       }
+}
+
+
+
+// -----------------------------------------------------------------------------------
+
+SurfaceChannelLockConst::SurfaceChannelLockConst():
+       data_ptr_checked_out_(false)
+{
+}
+
+SurfaceChannelLockConst::~SurfaceChannelLockConst()
+{
+       if(data_ptr_checked_out_)
+               release_data_ptr();
+               
+       if(surface_ && ref_count_.is_unique())
+               return surface->channel_map_[channel_].rw_lock.reader_unlock();
+       surface=0;
+}
+
+SurfaceChannel
+SurfaceChannelLockConst::get_channel()const
+{
+       return channel_;
+}
+
+int
+SurfaceChannelLockConst::get_w()const
+{
+       return surface_->get_w();
+}
+       
+int
+SurfaceChannelLockConst::get_h()const
+{
+       return surface_->get_h();
+}
+       
+float
+SurfaceChannelLockConst::get_value(int x, int y)
+{
+       // WOW! CRAZY SLOW!
+       const ChannelData& channel_data(surface_->channel_map_[channel_]);
+       return *(channel_data.get_data()+y*channel_data.get_stride()+x);
+}
+
+const float*
+SurfaceChannelLockConst::get_data_ptr()const
+{
+       data_ptr_checked_out_=true;
+       
+       // WOW! CRAZY SLOW!
+       return surface_->channel_map_[channel_].get_data();
+}
+
+int
+SurfaceChannelLockConst::get_data_ptr_stride()const
+{
+       return surface_->channel_map_[channel_].get_stride();
+}
+
+void
+SurfaceChannelLockConst::release_data_ptr()const
+{
+       data_ptr_checked_out_=false;
+}
+
+SurfaceChannelLockConst::operator bool()const
+{
+       return static_cast<bool>(surface_);
+}
+
+// -----------------------------------------------------------------------------------
+
+SurfaceChannelLock::SurfaceChannelLock()
+{
+}
+
+SurfaceChannelLock::~SurfaceChannelLock()
+{
+       if(data_ptr_checked_out_)
+               release_data_ptr();
+
+       if(surface_ && ref_count_.is_unique())
+               return surface_->channel_map_[channel_].rw_lock.writer_unlock();
+       surface=0;
+}
+
+void
+SurfaceChannelLock::clear()
+{
+       return surface_->channel_map_[channel_].clear();
+}
+
+void
+SurfaceChannelLock::fill(float v)
+{
+       return surface_->channel_map_[channel_].fill(v);
+}
+
+void
+SurfaceChannelLock::set_value(int x, int y, float v)
+{
+       // WOW! CRAZY SLOW!
+       const ChannelData& channel_data(surface_->channel_map_[channel_]);
+       *(channel_data.get_data()+y*channel_data.get_stride()+x)=v;
+}
+
+float*
+SurfaceChannelLock::get_data_ptr()
+{
+       data_ptr_checked_out_=true;
+
+       // WOW! CRAZY SLOW!
+       return surface_->channel_map_[channel_].get_data();
+}
+
+
+
+// -----------------------------------------------------------------------------------
+
+
+
+void
+SurfaceNew::chan_mlt(ChannelLock& dest, float x)
+{
+       float* ptr(dest.get_data_ptr());
+       const int w(dest.get_w());
+       const int h(dest.get_h());
+       const int pitch(dest.get_data_pitch()-w);
+       
+       int(y=0;y<h;y++,ptr+=pitch)
+               int(x=0;x<w;x++,ptr++)
+                       *ptr*=x;
+}
+
+void
+SurfaceNew::chan_mlt(ChannelLock& dest, const ChannelLockConst& x)
+{
+       float* d_ptr(dest.get_data_ptr());
+       const float* s_ptr(x.get_data_ptr());
+       const int w(dest.get_w());
+       const int h(dest.get_h());
+       const int d_pitch(dest.get_data_stride()-w);
+       const int s_pitch(x.get_data_stride()-w);
+       
+       int(y=0;y<h;y++,d_ptr+=d_pitch,s_ptr+=s_pitch)
+               int(x=0;x<w;x++,d_ptr++,s_ptr++)
+                       *d_ptr *= *s_ptr;
+}
+
+void
+SurfaceNew::chan_div(ChannelLock& dest, float x)
+{
+       float* ptr(dest.get_data_ptr());
+       const int w(dest.get_w());
+       const int h(dest.get_h());
+       const int pitch(dest.get_data_pitch()-w);
+       
+       int(y=0;y<h;y++,ptr+=pitch)
+               int(x=0;x<w;x++,ptr++)
+                       *ptr/=x;
+}
+
+void
+SurfaceNew::chan_div(ChannelLock& dest, const ChannelLockConst& x)
+{
+       float* d_ptr(dest.get_data_ptr());
+       const float* s_ptr(x.get_data_ptr());
+       const int w(dest.get_w());
+       const int h(dest.get_h());
+       const int d_pitch(dest.get_data_stride()-w);
+       const int s_pitch(x.get_data_stride()-w);
+       
+       int(y=0;y<h;y++,d_ptr+=d_pitch,s_ptr+=s_pitch)
+               int(x=0;x<w;x++,d_ptr++,s_ptr++)
+                       *d_ptr /= *s_ptr;
+}
+
+void
+SurfaceNew::chan_add(ChannelLock& dest, float x)
+{
+       float* ptr(dest.get_data_ptr());
+       const int w(dest.get_w());
+       const int h(dest.get_h());
+       const int pitch(dest.get_data_pitch()-w);
+       
+       int(y=0;y<h;y++,ptr+=pitch)
+               int(x=0;x<w;x++,ptr++)
+                       *ptr+=x;
+}
+
+void
+SurfaceNew::chan_add(ChannelLock& dest, const ChannelLockConst& x)
+{
+       float* d_ptr(dest.get_data_ptr());
+       const float* s_ptr(x.get_data_ptr());
+       const int w(dest.get_w());
+       const int h(dest.get_h());
+       const int d_pitch(dest.get_data_stride()-w);
+       const int s_pitch(x.get_data_stride()-w);
+       
+       int(y=0;y<h;y++,d_ptr+=d_pitch,s_ptr+=s_pitch)
+               int(x=0;x<w;x++,d_ptr++,s_ptr++)
+                       *d_ptr += *s_ptr;
+}
+
+void
+SurfaceNew::chan_sub(ChannelLock& dest, float x)
+{
+       float* ptr(dest.get_data_ptr());
+       const int w(dest.get_w());
+       const int h(dest.get_h());
+       const int pitch(dest.get_data_pitch()-w);
+       
+       int(y=0;y<h;y++,ptr+=pitch)
+               int(x=0;x<w;x++,ptr++)
+                       *ptr-=x;
+}
+
+void
+SurfaceNew::chan_sub(ChannelLock& dest, const ChannelLockConst& x)
+{
+       float* d_ptr(dest.get_data_ptr());
+       const float* s_ptr(x.get_data_ptr());
+       const int w(dest.get_w());
+       const int h(dest.get_h());
+       const int d_pitch(dest.get_data_stride()-w);
+       const int s_pitch(x.get_data_stride()-w);
+       
+       int(y=0;y<h;y++,d_ptr+=d_pitch,s_ptr+=s_pitch)
+               int(x=0;x<w;x++,d_ptr++,s_ptr++)
+                       *d_ptr -= *s_ptr;
+}
+
+
+
diff --git a/synfig-core/trunk/src/synfig/surfacenew.h b/synfig-core/trunk/src/synfig/surfacenew.h
new file mode 100644 (file)
index 0000000..173baca
--- /dev/null
@@ -0,0 +1,399 @@
+/* === S I N F G =========================================================== */
+/*!    \file surfacenew.h
+**     \brief Template Header
+**
+**     $Id: surfacenew.h,v 1.1 2005/01/21 19:29:10 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_SURFACENEW_H
+#define __SINFG_SURFACENEW_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/handle>
+#include <ETL/ref_count>
+#include "color.h"
+#include "mutex.h"
+#include <map>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Surface;
+class SurfaceChannelLock;
+class SurfaceChannelLockConst;
+
+//! \writeme
+enum SurfaceColorSystem
+{
+       COLORSYS_RGB,
+       COLORSYS_YUV,
+       
+       COLORSYS_END
+}; // END of enum SurfaceColorSystem
+
+//! \writeme
+enum SurfaceChannel
+{
+       CHAN_A,
+       CHAN_R,
+       CHAN_G,
+       CHAN_B,
+
+       CHAN_Y,
+       CHAN_U,
+       CHAN_V,
+
+       CHAN_END
+}; // END of enum SurfaceChannel
+
+class SurfaceNew : etl::shared_object
+{
+       friend class SurfaceChannelLock;
+
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public: 
+
+       //! \writeme
+       typedef etl::handle<SurfaceNew> Handle;
+
+       //! \writeme
+       typedef etl::handle<const SurfaceNew> HandleConst;
+       
+       //! \writeme
+       typedef etl::loose_handle<SurfaceNew> LooseHandle;
+
+       //! \writeme
+       typedef SurfaceChannel;
+
+       //! \writeme
+       typedef SurfaceChannelLock ChannelLock;
+
+       //! \writeme
+       typedef SurfaceChannelLockConst ChannelLockConst;
+
+       //! \writeme
+       typedef SurfaceColorSystem;
+       
+       //! \writeme
+       class Lock
+       {
+               Handle x;
+       public:
+               Lock(const Handle& x):x(x) { x->lock(); }
+               void unlock() { if(x){ x->unlock(); x=0; } }
+               ~Lock() { unlock(); }           
+       }; // END of class Lock
+       friend class Lock;
+       
+private:
+
+       //! \writeme
+       class ChannelData;
+       
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+private:
+       
+       //! \writeme
+       RecMutex mutex_;
+       
+       //! \writeme
+       int w_,h_;
+
+       //! \writeme
+       ColorSystem color_system_;
+       
+       //! \writeme
+       bool premult_flag_;
+
+       //! \writeme
+       std::map<Channel,ChannelData> channel_map_;
+       
+       /*
+ -- ** -- S I G N A L S -------------------------------------------------------
+       */
+
+private:
+
+       /*
+ -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
+       */
+
+public:
+
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+protected:
+       
+       //! \writeme
+       SurfaceNew();
+
+public:
+
+       //! \writeme
+       virtual ~SurfaceNew();
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //! \writeme
+       int get_w()const;
+       
+       //! \writeme
+       int get_h()const;
+       
+       //! \writeme
+       void set_wh(int w, int h);
+
+       //! \writeme
+       ColorSystem get_color_system()const;
+
+       //! \writeme
+       void set_color_system(ColorSystem x);
+
+       //! Should only be used in certain circumstances
+       Color get_color(int x, int y)const;
+       
+       //! \writeme
+       void lock();
+       
+       //! \writeme
+       void unlock();
+       
+       //! \writeme
+       bool trylock();
+       
+       //! \writeme
+       ChannelLock lock_channel(Channel chan);
+
+       //! \writeme
+       ChannelLockConst lock_channel_const(Channel chan)const;
+
+       //! \writeme
+       ChannelLock lock_channel_alpha(Channel chan);
+
+       //! \writeme
+       ChannelLockConst lock_channel_alpha_const(Channel chan)const;
+
+       //! \writeme
+       bool is_channel_defined(Channel chan)const;
+       
+       //! \writeme
+       bool get_premult()const;
+
+       //! \writeme
+       void set_premult();
+       
+       /*
+ --    ** -- S T A T I C   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //! Normal SurfaceNew Constructor
+       static Handle create(int w=0, int h=0, ColorSystem sys=COLORSYS_RGB);
+
+       //! Converts an old Surface to a SurfaceNew
+       static Handle create(const Surface&);
+
+       //! Dupilcates a surface
+       static Handle create(HandleConst);
+
+       //! Creates a cropped copy of a surface
+       static Handle crop(HandleConst, int x, int y, int w, int h);
+       
+       static void blit(
+               Handle dest,
+               int x_dest,
+               int y_dest,
+               HandleConst src,
+               float amount=1.0,
+               Color::BlendMethod bm=Color::BLEND_COMPOSITE
+       );
+       
+       static void blit(
+               Handle dest,
+               int x_dest,
+               int y_dest,
+               Handle src,
+               int x_src,
+               int y_src,
+               int w_src,
+               int h_src,
+               float amount=1.0,
+               Color::BlendMethod bm=Color::BLEND_COMPOSITE
+       );
+       
+       
+       static void chan_mlt(ChannelLock& dest, float x);
+       static void chan_mlt(ChannelLock& dest, const ChannelLockConst& x);
+
+       static void chan_div(ChannelLock& dest, float x);
+       static void chan_div(ChannelLock& dest, const ChannelLockConst& x);
+
+       static void chan_add(ChannelLock& dest, float x);
+       static void chan_add(ChannelLock& dest, const ChannelLockConst& x);
+
+       static void chan_sub(ChannelLock& dest, float x);
+       static void chan_sub(ChannelLock& dest, const ChannelLockConst& x);
+}; // END of class SurfaceNew
+
+//! \writeme
+class SurfaceChannelLockConst
+{
+       friend class SurfaceNew;
+
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public: 
+
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+protected:
+       
+       //! \writeme
+       SurfaceNew::Handle surface_;
+       
+       //! \writeme
+       etl::reference_counter ref_count_;
+
+       //! \writeme
+       SurfaceChannel channel_;
+
+       //! \writeme
+       bool data_ptr_checked_out_;
+       
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+public:
+
+       SurfaceChannelLockConst();
+       
+       //! \writeme
+       ~SurfaceChannelLockConst();
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+       
+       //! \writeme
+       SurfaceChannel get_channel()const;
+       
+       //! \writeme
+       int get_w()const;
+       
+       //! \writeme
+       int get_h()const;
+       
+       //! \writeme
+       float get_value(int x, int y);
+       
+       //! \writeme
+       const float* get_data_ptr()const;
+       
+       //! \writeme
+       int get_data_ptr_stride()const;
+       
+       //! Releases the pointer obtained with get_data_ptr()
+       void release_data_ptr()const;
+       
+       //! \writeme
+       operator bool()const;
+}; // END of class SurfaceChannelLockConst
+
+
+//! \writeme
+class SurfaceChannelLock : public SurfaceChannelLockConst
+{
+       friend class SurfaceNew;
+
+       using SurfaceChannelLock::get_data_ptr;
+       
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public: 
+
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+private:
+       
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+public:
+
+       //! \writeme
+       SurfaceChannelLock();
+
+       //! \writeme
+       ~SurfaceChannelLock();
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //! \writeme
+       void clear();
+       
+       //! \writeme
+       void fill(float value);
+               
+       //! \writeme
+       void set_value(int x, int y, float v);
+
+       float* get_data_ptr();
+}; // END of class ChannelLock
+
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/target.cpp b/synfig-core/trunk/src/synfig/target.cpp
new file mode 100644 (file)
index 0000000..5fb1790
--- /dev/null
@@ -0,0 +1,111 @@
+/* === S I N F G =========================================================== */
+/*!    \file target.cpp
+**     \brief Target Class Implementation
+**
+**     $Id: target.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "target.h"
+#include "string.h"
+#include "canvas.h"
+#include "target_null.h"
+#include "target_null_tile.h"
+
+using namespace sinfg;
+using namespace etl;
+using namespace std;
+
+sinfg::Target::Book* sinfg::Target::book_;
+sinfg::Target::ExtBook* sinfg::Target::ext_book_;
+
+static sinfg::Gamma* default_gamma_;
+
+/* === P R O C E D U R E S ================================================= */
+
+bool
+Target::subsys_init()
+{
+       book_=new sinfg::Target::Book();
+       ext_book_=new sinfg::Target::ExtBook();
+       
+       default_gamma_=new sinfg::Gamma(1.0/2.2);
+       //default_gamma_->set_black_level(0.05); // Default to 5% black level.
+       
+       book()["null"]=std::pair<sinfg::Target::Factory,String>(Target_Null::create,"null");
+       ext_book()["null"]="null";
+       book()["null-tile"]=std::pair<sinfg::Target::Factory,String>(Target_Null_Tile::create,"null-tile");
+       ext_book()["null-tile"]="null-tile";
+
+       return true;
+}
+
+bool
+Target::subsys_stop()
+{
+       delete book_;
+       delete ext_book_;
+       delete default_gamma_;
+       return true;
+}
+
+Target::Book&
+Target::book()
+{
+       return *book_;
+}
+
+Target::ExtBook&
+Target::ext_book()
+{
+       return *ext_book_;
+}
+
+
+/* === M E T H O D S ======================================================= */
+
+Target::Target():
+       quality_(4),
+       gamma_(*default_gamma_),
+       remove_alpha(false)
+{
+}
+
+void
+sinfg::Target::set_canvas(Canvas::Handle c)
+{
+       canvas=c;
+       RendDesc desc=canvas->rend_desc();
+       set_rend_desc(&desc);
+}
+
+
+Target::Handle
+Target::create(const String &name, const String &filename)
+{
+       if(!book().count(name))
+               return handle<Target>();
+               
+       return Target::Handle(book()[name].first(filename.c_str()));
+}
diff --git a/synfig-core/trunk/src/synfig/target.h b/synfig-core/trunk/src/synfig/target.h
new file mode 100644 (file)
index 0000000..e2c48cc
--- /dev/null
@@ -0,0 +1,163 @@
+/* === S I N F G =========================================================== */
+/*!    \file target.h
+**     \brief Target Class Implementation
+**
+**     $Id: target.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TARGET_H
+#define __SINFG_TARGET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "string_decl.h"
+#include <utility>
+//#include <list>
+#include <map>
+#include <ETL/handle>
+#include "renddesc.h"
+//#include "general.h"
+#include "color.h"
+#include "canvas.h"
+
+/* === M A C R O S ========================================================= */
+
+//! \writeme
+#define SINFG_TARGET_MODULE_EXT public: static const char name__[], version__[], ext__[],cvs_id__[]; static Target *create(const char *filename);
+
+//! Sets the name of the target
+#define SINFG_TARGET_SET_NAME(class,x) const char class::name__[]=x
+
+//! \writeme
+#define SINFG_TARGET_SET_EXT(class,x) const char class::ext__[]=x
+
+//! Sets the version of the target
+#define SINFG_TARGET_SET_VERSION(class,x) const char class::version__[]=x
+
+//! Sets the CVS ID of the target
+#define SINFG_TARGET_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
+
+//! \writeme
+#define SINFG_TARGET_INIT(class) sinfg::Target* class::create(const char *filename) { return new class(filename); }
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Surface;
+class RendDesc;
+class Canvas;
+class ProgressCallback;
+
+/*!    \class Target
+**     \brief Render-target
+**     \todo writeme
+*/
+class Target : public etl::shared_object
+{
+public:
+       typedef etl::handle<Target> Handle;
+       typedef etl::loose_handle<Target> LooseHandle;
+       typedef etl::handle<const Target> ConstHandle;
+
+       typedef Target* (*Factory)(const char *filename);
+
+       //! A type for a map of targets, indexed by the name of the Target
+       typedef std::map<String,std::pair<Factory,String> > Book;
+
+       typedef std::map<String,String> ExtBook;
+
+       //! Target Book, indexed by the target's name
+       static Book* book_;
+
+       //! Map of target names indexed by associated file extension
+       static ExtBook* ext_book_;
+       
+       static Book& book();
+       static ExtBook& ext_book();
+
+       static bool subsys_init();
+       static bool subsys_stop();
+       
+       //! Adjusted Render description set by set_rend_desc()
+       RendDesc desc;
+
+       etl::handle<Canvas> canvas;
+
+       int quality_;
+       Gamma gamma_;
+
+       bool remove_alpha;
+       
+       bool avoid_time_sync_;
+       
+protected:
+
+       Target();
+
+public:
+       virtual ~Target() { }
+
+       int get_quality()const { return quality_; }
+       
+       void set_quality(int q) { quality_=q; }
+       
+       void set_avoid_time_sync(bool x=true) { avoid_time_sync_=x; }
+
+       bool get_avoid_time_sync()const { return avoid_time_sync_; }
+       
+       bool get_remove_alpha()const { return remove_alpha; }
+
+       void set_remove_alpha(bool x=true) { remove_alpha=x; }
+       
+       Gamma &gamma() { return gamma_; }
+
+       const Gamma &gamma()const { return gamma_; }
+
+       virtual void set_canvas(etl::handle<Canvas> c);
+
+       const etl::handle<Canvas> &get_canvas()const { return canvas; }
+
+       RendDesc &rend_desc() { return desc; }
+       const RendDesc &rend_desc()const { return desc; }
+       
+       //! Renders the canvas to the target
+       virtual bool render(ProgressCallback *cb=NULL)=0;
+
+       //! Sets the RendDesc for the Target to \a desc.
+       /*!     If there are any parts of \a desc that the render target
+       **      is not capable of doing, the render target will adjust
+       **      \a desc to fit it's needs.
+       */
+       virtual bool set_rend_desc(RendDesc *d) { desc=*d; return true; }
+
+       virtual bool init() { return true; }
+
+       //! Creates a new Target described by \a type, outputing to a file described by \a filename.
+       static Handle create(const String &type, const String &filename);
+}; // END of class Target
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#include "canvas.h"
+#endif
diff --git a/synfig-core/trunk/src/synfig/target_multi.cpp b/synfig-core/trunk/src/synfig/target_multi.cpp
new file mode 100644 (file)
index 0000000..0e22b63
--- /dev/null
@@ -0,0 +1,118 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_multi.cpp
+**     \brief Template File
+**
+**     $Id: target_multi.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "target_multi.h"
+#include "string.h"
+#include "surface.h"
+#include "canvas.h"
+#include "context.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Target_Multi::Target_Multi(Target_Scanline::Handle a,Target_Scanline::Handle b):
+       a(a),
+       b(b)
+{
+}
+
+Target_Multi::~Target_Multi()
+{
+}
+
+void
+Target_Multi::set_canvas(etl::handle<Canvas> c)
+{
+       canvas=c;
+       RendDesc desc=canvas->rend_desc();
+       a->set_canvas(c);
+       b->set_canvas(c);
+       set_rend_desc(&desc);
+}
+
+bool
+Target_Multi::set_rend_desc(RendDesc *d)
+{
+       desc=*d;
+       return a->set_rend_desc(d) && b->set_rend_desc(d);
+}
+
+bool
+Target_Multi::init()
+{
+       return a->init() && b->init();
+}
+
+bool
+Target_Multi::add_frame(const sinfg::Surface *surface)
+{
+       return a->add_frame(surface) && b->add_frame(surface);
+}
+
+bool
+Target_Multi::start_frame(ProgressCallback *cb)
+{
+       return a->start_frame(cb) && b->start_frame(cb);
+}
+
+void
+Target_Multi::end_frame()
+{
+       a->end_frame();
+       b->end_frame();
+}
+
+Color *
+Target_Multi::start_scanline(int scanline)
+{
+       buffer_a=a->start_scanline(scanline);
+       buffer_b=b->start_scanline(scanline);
+       return buffer_a;
+}
+
+bool
+Target_Multi::end_scanline()
+{
+       memcpy(buffer_b,buffer_a,sizeof(Color)*desc.get_w());
+       return a->end_scanline() && b->end_scanline();
+}
diff --git a/synfig-core/trunk/src/synfig/target_multi.h b/synfig-core/trunk/src/synfig/target_multi.h
new file mode 100644 (file)
index 0000000..c086d37
--- /dev/null
@@ -0,0 +1,67 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_multi.h
+**     \brief Template Header
+**
+**     $Id: target_multi.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TARGET_MULTI_H
+#define __SINFG_TARGET_MULTI_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "target_scanline.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Target_Multi
+**     \brief Render-target
+**     \todo writeme
+*/
+class Target_Multi : public Target_Scanline
+{
+       Target_Scanline::Handle a,b;
+       Color *buffer_a;
+       Color *buffer_b;
+public:
+
+       Target_Multi(Target_Scanline::Handle a,Target_Scanline::Handle b);
+       virtual ~Target_Multi();
+       virtual bool add_frame(const sinfg::Surface *surface);
+       virtual bool start_frame(ProgressCallback *cb=NULL);
+       virtual void end_frame();
+       virtual Color * start_scanline(int scanline);
+       virtual bool end_scanline();
+       
+       virtual void set_canvas(etl::handle<Canvas> c);
+       virtual bool set_rend_desc(RendDesc *d);
+       virtual bool init();
+}; // END of class Target_Multi
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/target_null.cpp b/synfig-core/trunk/src/synfig/target_null.cpp
new file mode 100644 (file)
index 0000000..50b97c6
--- /dev/null
@@ -0,0 +1,49 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_null.cpp
+**     \brief Template File
+**
+**     $Id: target_null.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+//#include "target_null.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+//using namespace std;
+//using namespace etl;
+//using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+/* === E N T R Y P O I N T ================================================= */
diff --git a/synfig-core/trunk/src/synfig/target_null.h b/synfig-core/trunk/src/synfig/target_null.h
new file mode 100644 (file)
index 0000000..ae95bfc
--- /dev/null
@@ -0,0 +1,70 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_null.h
+**     \brief Template Header
+**
+**     $Id: target_null.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TARGET_NULL_H
+#define __SINFG_TARGET_NULL_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "target_scanline.h"
+#include "general.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Target_Null
+**     \brief A target which renders to nothing. Useful for benchmarks and other tests.
+**     \todo writeme
+*/
+class Target_Null : public Target_Scanline
+{
+       Color *buffer;
+       
+       Target_Null():buffer(0) { }
+       
+public:
+
+       ~Target_Null() { delete buffer; } 
+
+       virtual bool start_frame(ProgressCallback *cb=NULL)
+               { delete buffer; buffer=new Color[desc.get_w()*sizeof(Color)]; return true; }
+
+       virtual void end_frame() { delete buffer; buffer=0; return; }
+
+       virtual Color * start_scanline(int scanline) { return buffer; }
+
+       virtual bool end_scanline() { return true; }
+       
+       static Target* create(const char *filename=0) { return new Target_Null(); }
+}; // END of class Target_Null
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/target_null_tile.cpp b/synfig-core/trunk/src/synfig/target_null_tile.cpp
new file mode 100644 (file)
index 0000000..7e4333f
--- /dev/null
@@ -0,0 +1,49 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_null_tile.cpp
+**     \brief Template File
+**
+**     $Id: target_null_tile.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+//#include "target_null.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+//using namespace std;
+//using namespace etl;
+//using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+/* === E N T R Y P O I N T ================================================= */
diff --git a/synfig-core/trunk/src/synfig/target_null_tile.h b/synfig-core/trunk/src/synfig/target_null_tile.h
new file mode 100644 (file)
index 0000000..2d7627c
--- /dev/null
@@ -0,0 +1,65 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_null_tile.h
+**     \brief Template Header
+**
+**     $Id: target_null_tile.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TARGET_NULL_TILE_H
+#define __SINFG_TARGET_NULL_TILE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "target_tile.h"
+#include "general.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Target_Null_Tile
+**     \brief A target which renders to nothing using tiles. Useful for benchmarks and other tests.
+**     \todo writeme
+*/
+class Target_Null_Tile : public Target_Tile
+{
+       Target_Null_Tile() { }
+       
+public:
+
+       ~Target_Null_Tile() {  } 
+       virtual bool add_tile(const sinfg::Surface &surface, int x, int y) { return true; }
+
+       virtual bool start_frame(ProgressCallback *cb=NULL)
+               { return true; }
+
+       virtual void end_frame() { return; }
+       
+       static Target* create(const char *filename=0) { return new Target_Null_Tile(); }
+}; // END of class Target_Null_Tile
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/target_scanline.cpp b/synfig-core/trunk/src/synfig/target_scanline.cpp
new file mode 100644 (file)
index 0000000..e1cea2d
--- /dev/null
@@ -0,0 +1,499 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_scanline.cpp
+**     \brief Template File
+**
+**     $Id: target_scanline.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "target_scanline.h"
+#include "string.h"
+#include "surface.h"
+#include "render.h"
+#include "canvas.h"
+#include "context.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+#define SINFG_OPTIMIZE_LAYER_TREE 1
+
+#define PIXEL_RENDERING_LIMIT 1500000
+
+#define USE_PIXELRENDERING_LIMIT 0
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Target_Scanline::Target_Scanline():
+       threads_(2)
+{
+       curr_frame_=0;
+}
+
+int
+Target_Scanline::next_frame(Time& time)
+{
+       int
+               total_frames(1),
+               frame_start(0),
+               frame_end(0);
+       Time
+               time_start(0),
+               time_end(0);
+
+       // If the description's end frame is equal to
+       // the start frame, then it is assumed that we
+       // are rendering only one frame. Correct it.
+       if(desc.get_frame_end()==desc.get_frame_start())
+               desc.set_frame_end(desc.get_frame_start()+1);
+
+       frame_start=desc.get_frame_start();
+       frame_end=desc.get_frame_end();
+       time_start=desc.get_time_start();
+       time_end=desc.get_time_end();
+       
+       // Calculate the number of frames
+       total_frames=frame_end-frame_start;
+       if(total_frames<=0)total_frames=1;
+       
+       //RendDesc rend_desc=desc;
+       //rend_desc.set_gamma(1);
+
+//     int total_tiles(total_tiles());
+       time=(time_end-time_start)*curr_frame_/total_frames+time_start;
+       curr_frame_++;
+
+/*     sinfg::info("curr_frame_: %d",curr_frame_);
+       sinfg::info("total_frames: %d",total_frames);
+       sinfg::info("time_end: %s",time_end.get_string().c_str());
+       sinfg::info("time_start: %s",time_start.get_string().c_str());
+*/
+//     sinfg::info("time: %s",time.get_string().c_str());
+
+       return total_frames- curr_frame_+1;
+}
+bool
+sinfg::Target_Scanline::render(ProgressCallback *cb)
+{
+       SuperCallback super_cb;
+       int
+//             i=0,
+               total_frames,
+               quality=get_quality(),
+               frame_start,
+               frame_end;
+       Time
+               t=0,
+               time_start,
+               time_end;
+
+       assert(canvas);
+       curr_frame_=0;
+
+       init();
+       
+       // If the description's end frame is equal to
+       // the start frame, then it is assumed that we
+       // are rendering only one frame. Correct it.
+       if(desc.get_frame_end()==desc.get_frame_start())
+               desc.set_frame_end(desc.get_frame_start()+1);
+
+       frame_start=desc.get_frame_start();
+       frame_end=desc.get_frame_end();
+       time_start=desc.get_time_start();
+       time_end=desc.get_time_end();
+       
+       // Calculate the number of frames
+       total_frames=frame_end-frame_start;
+       
+       
+       //RendDesc rend_desc=desc;
+               
+       try {
+       // Grab the time
+       int i=next_frame(t);
+       
+       //sinfg::info("1time_set_to %s",t.get_string().c_str());
+       
+       if(i>1)
+       do{
+       
+       //if(total_frames>1)
+       //for(i=0,t=time_start;i<total_frames;i++)
+       //{
+               //t=((time_end-time_start)*((Real)i/(Real)total_frames)).round(desc.get_frame_rate())+time_start;
+
+               // If we have a callback, and it returns
+               // false, go ahead and bail. (it may be a user cancel)
+               if(cb && !cb->amount_complete(total_frames-(i-1),total_frames))
+                       return false;
+               
+               // Set the time that we wish to render
+               if(!get_avoid_time_sync() || canvas->get_time()!=t)
+                       canvas->set_time(t);
+               
+               Context context;
+               
+               #ifdef SINFG_OPTIMIZE_LAYER_TREE
+               Canvas::Handle op_canvas(Canvas::create());
+               optimize_layers(canvas->get_context(), op_canvas);
+               context=op_canvas->get_context();
+               #else
+               context=canvas->get_context();
+               #endif
+               
+               // If the quality is set to zero, then we
+               // use the parametric scanline-renderer.
+               if(quality==0)
+               {
+                       if(threads_<=0)
+                       {
+                               if(!sinfg::render(context,this,desc,0))
+                                       return false;
+                       }
+                       else
+                       {
+                               if(!sinfg::render_threaded(context,this,desc,0,threads_))
+                                       return false;
+                       }
+               }
+               else // If quality is set otherwise, then we use the accelerated renderer
+               {
+                       #if USE_PIXELRENDERING_LIMIT
+                       if(desc.get_w()*desc.get_h() > PIXEL_RENDERING_LIMIT)
+                       {                                       
+                               sinfg::info("Render BROKEN UP! (%d pixels)", desc.get_w()*desc.get_h());
+                                                               
+                               Surface surface;                                
+                               int rowheight = PIXEL_RENDERING_LIMIT/desc.get_w();
+                               int rows = desc.get_h()/rowheight;
+                               int lastrowheight = desc.get_h() - rows*rowheight;
+                               
+                               rows++;
+                               
+                               sinfg::info("\t blockh=%d,remh=%d,totrows=%d", rowheight,lastrowheight,rows);                           
+                               
+                               // loop through all the full rows
+                               if(!start_frame())
+                               {
+                                       throw(string("add_frame(): target panic on start_frame()"));
+                                       return false;
+                               }
+                               
+                               for(int i=0; i < rows; ++i)
+                               {
+                                       RendDesc        blockrd = desc;
+                                       
+                                       //render the strip at the normal size unless it's the last one...
+                                       if(i == rows)
+                                       {
+                                               if(!lastrowheight) break;
+                                               blockrd.set_subwindow(0,i*rowheight,desc.get_w(),lastrowheight);
+                                       }
+                                       else
+                                       {
+                                               blockrd.set_subwindow(0,i*rowheight,desc.get_w(),rowheight);
+                                       }
+                                       
+                                       if(!context.accelerated_render(&surface,quality,blockrd,0))
+                                       {
+                                               if(cb)cb->error(_("Accelerated Renderer Failure"));
+                                               return false;
+                                       }else
+                                       {
+                                               int y;
+                                               int rowspan=sizeof(Color)*surface.get_w();
+                                               Surface::pen pen = surface.begin();
+                                               
+                                               int yoff = i*rowheight;
+                                               
+                                               for(y = 0; y < blockrd.get_h(); y++, pen.inc_y())
+                                               {
+                                                       Color *colordata= start_scanline(y + yoff);
+                                                       if(!colordata)
+                                                       {
+                                                               throw(string("add_frame(): call to start_scanline(y) returned NULL"));
+                                                               return false;
+                                                       }
+                                                       
+                                                       if(get_remove_alpha())
+                                                       {
+                                                               for(int i = 0; i < surface.get_w(); i++)
+                                                                       colordata[i] = Color::blend(surface[y][i],desc.get_bg_color(),1.0f);
+                                                       }
+                                                       else
+                                                               memcpy(colordata,surface[y],rowspan);
+                                               
+                                                       if(!end_scanline())
+                                                       {
+                                                               throw(string("add_frame(): target panic on end_scanline()"));
+                                                               return false;
+                                                       }
+                                               }
+                                       }
+                               }       
+
+                               end_frame();                            
+                               
+                       }else //use normal rendering...
+                       {
+                       #endif
+                               Surface surface;
+                               
+                               if(!context.accelerated_render(&surface,quality,desc,0))
+                               {
+                                       // For some reason, the accelerated renderer failed.
+                                       if(cb)cb->error(_("Accelerated Renderer Failure"));
+                                       return false;
+                               }
+                               else
+                               {
+                                       // Put the surface we renderer
+                                       // onto the target.
+                                       if(!add_frame(&surface))
+                                       {
+                                               if(cb)cb->error(_("Unable to put surface on target"));
+                                               return false;
+                                       }
+                               }
+                       #if USE_PIXELRENDERING_LIMIT
+                       }
+                       #endif
+               }
+       }while((i=next_frame(t)));
+    else
+    {
+               // Set the time that we wish to render
+               if(!get_avoid_time_sync() || canvas->get_time()!=t)
+                       canvas->set_time(t);
+               Context context;
+               
+               #ifdef SINFG_OPTIMIZE_LAYER_TREE
+               Canvas::Handle op_canvas(Canvas::create());
+               optimize_layers(canvas->get_context(), op_canvas);
+               context=op_canvas->get_context();
+               #else
+               context=canvas->get_context();
+               #endif
+               
+               // If the quality is set to zero, then we
+               // use the parametric scanline-renderer.
+               if(quality==0)
+               {
+                       if(threads_<=0)
+                       {
+                               if(!sinfg::render(context,this,desc,cb))
+                                       return false;
+                       }
+                       else
+                       {
+                               if(!sinfg::render_threaded(context,this,desc,cb,threads_))
+                                       return false;
+                       }
+               }
+               else // If quality is set otherwise, then we use the accelerated renderer
+               {
+                       #if USE_PIXELRENDERING_LIMIT
+                       if(desc.get_w()*desc.get_h() > PIXEL_RENDERING_LIMIT)
+                       {
+                               sinfg::info("Render BROKEN UP! (%d pixels)", desc.get_w()*desc.get_h());
+                               
+                               Surface surface;                                
+                               int totalheight = desc.get_h();                         
+                               int rowheight = PIXEL_RENDERING_LIMIT/desc.get_w();
+                               int rows = desc.get_h()/rowheight;
+                               int lastrowheight = desc.get_h() - rows*rowheight;
+                               
+                               rows++;
+                               
+                               sinfg::info("\t blockh=%d,remh=%d,totrows=%d", rowheight,lastrowheight,rows);                           
+                               
+                               // loop through all the full rows
+                               if(!start_frame())
+                               {
+                                       throw(string("add_frame(): target panic on start_frame()"));
+                                       return false;
+                               }
+                               
+                               for(int i=0; i < rows; ++i)
+                               {
+                                       RendDesc        blockrd = desc;
+                                       
+                                       //render the strip at the normal size unless it's the last one...
+                                       if(i == rows)
+                                       {
+                                               if(!lastrowheight) break;
+                                               blockrd.set_subwindow(0,i*rowheight,desc.get_w(),lastrowheight);
+                                       }
+                                       else
+                                       {
+                                               blockrd.set_subwindow(0,i*rowheight,desc.get_w(),rowheight);
+                                       }
+                                       
+                                       SuperCallback   sc(cb, i*rowheight, (i+1)*rowheight, totalheight);
+                                       
+                                       if(!context.accelerated_render(&surface,quality,blockrd,&sc))
+                                       {
+                                               if(cb)cb->error(_("Accelerated Renderer Failure"));
+                                               return false;
+                                       }else
+                                       {
+                                               int y;
+                                               int rowspan=sizeof(Color)*surface.get_w();
+                                               Surface::pen pen = surface.begin();
+                                               
+                                               int yoff = i*rowheight;
+                                               
+                                               for(y = 0; y < blockrd.get_h(); y++, pen.inc_y())
+                                               {
+                                                       Color *colordata= start_scanline(y + yoff);
+                                                       if(!colordata)
+                                                       {
+                                                               throw(string("add_frame(): call to start_scanline(y) returned NULL"));
+                                                               return false;
+                                                       }
+                                                       
+                                                       if(get_remove_alpha())
+                                                       {
+                                                               for(int i = 0; i < surface.get_w(); i++)
+                                                                       colordata[i] = Color::blend(surface[y][i],desc.get_bg_color(),1.0f);
+                                                       }
+                                                       else
+                                                               memcpy(colordata,surface[y],rowspan);
+                                               
+                                                       if(!end_scanline())
+                                                       {
+                                                               throw(string("add_frame(): target panic on end_scanline()"));
+                                                               return false;
+                                                       }
+                                               }
+                                       }
+                                       
+                                       //I'm done with this part
+                                       sc.amount_complete(100,100);
+                               }       
+
+                               end_frame();                            
+                               
+                       }else
+                       {
+                       #endif                  
+                               Surface surface;
+                               
+                               if(!context.accelerated_render(&surface,quality,desc,cb))
+                               {
+                                       if(cb)cb->error(_("Accelerated Renderer Failure"));
+                                       return false;
+                               }
+                               else
+                               {
+                                       // Put the surface we renderer
+                                       // onto the target.
+                                       if(!add_frame(&surface))
+                                       {
+                                               if(cb)cb->error(_("Unable to put surface on target"));
+                                               return false;
+                                       }
+                               }
+                       #if USE_PIXELRENDERING_LIMIT
+                       }
+                       #endif
+               }
+       }
+       
+       }
+       catch(String str)
+       {
+               if(cb)cb->error(_("Caught string :")+str);
+               return false;
+       }
+       catch(std::bad_alloc)
+       {
+               if(cb)cb->error(_("Ran out of memory (Probably a bug)"));
+               return false;
+       }
+       catch(...)
+       {
+               if(cb)cb->error(_("Caught unknown error, rethrowing..."));
+               throw;
+       }
+       return true;
+}
+
+bool
+Target_Scanline::add_frame(const Surface *surface)
+{
+       assert(surface);
+
+
+       int y;
+       int rowspan=sizeof(Color)*surface->get_w();
+       Surface::const_pen pen=surface->begin();
+       
+       if(!start_frame())
+       {
+               throw(string("add_frame(): target panic on start_frame()"));
+               return false;
+       }
+               
+       for(y=0;y<surface->get_h();y++,pen.inc_y())
+       {
+               Color *colordata= start_scanline(y);
+               if(!colordata)
+               {
+                       throw(string("add_frame(): call to start_scanline(y) returned NULL"));
+                       return false;
+               }
+               
+               if(get_remove_alpha())
+               {
+                       for(int i=0;i<surface->get_w();i++)
+                               colordata[i]=Color::blend((*surface)[y][i],desc.get_bg_color(),1.0f);
+               }
+               else
+                       memcpy(colordata,(*surface)[y],rowspan);
+       
+               if(!end_scanline())
+               {
+                       throw(string("add_frame(): target panic on end_scanline()"));
+                       return false;
+               }
+       }
+       
+       end_frame();
+       
+       return true;
+}
diff --git a/synfig-core/trunk/src/synfig/target_scanline.h b/synfig-core/trunk/src/synfig/target_scanline.h
new file mode 100644 (file)
index 0000000..b3aa862
--- /dev/null
@@ -0,0 +1,99 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_scanline.h
+**     \brief Template Header
+**
+**     $Id: target_scanline.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TARGET_SCANLINE_H
+#define __SINFG_TARGET_SCANLINE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "target.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Target_Scanline
+**     \brief Render-target
+**     \todo writeme
+*/
+class Target_Scanline : public Target
+{
+       int threads_;
+       int curr_frame_;
+
+public:
+       typedef etl::handle<Target_Scanline> Handle;
+       typedef etl::loose_handle<Target_Scanline> LooseHandle;
+       typedef etl::handle<const Target_Scanline> ConstHandle;
+
+       Target_Scanline();
+
+       //! Renders the canvas to the target
+       virtual bool render(ProgressCallback *cb=NULL);
+
+       //! Marks the start of a frame
+       /*! \return \c true on success, \c false upon an error.
+       **      \see end_frame(), start_scanline()
+       */
+       virtual bool start_frame(ProgressCallback *cb=NULL)=0;
+
+       virtual int next_frame(Time& time);
+
+       //! Marks the end of a frame
+       /*! \see start_frame() */
+       virtual void end_frame()=0;
+
+       //! Marks the start of a scanline
+       /*!     \param scanline Which scanline is going to be rendered.
+       **      \return The address where the target wants the scanline
+       **              to be written.
+       **      \warning Must be called after start_frame()
+       **      \see end_scanline(), start_frame()
+       */
+       virtual Color * start_scanline(int scanline)=0;
+
+       //! Marks the end of a scanline
+       /*! Takes the data that was put at the address returned to by start_scanline()
+       **      and does whatever it is supose to do with it.
+       **      \return \c true on success, \c false on failure.
+       **      \see start_scanline()
+       */
+       virtual bool end_scanline()=0;
+       
+       void set_threads(int x) { threads_=x; }
+
+       int get_threads()const { return threads_; }
+
+       bool add_frame(const sinfg::Surface *surface);
+private:
+}; // END of class Target_Scanline
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/target_tile.cpp b/synfig-core/trunk/src/synfig/target_tile.cpp
new file mode 100644 (file)
index 0000000..e8232e2
--- /dev/null
@@ -0,0 +1,426 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_tile.cpp
+**     \brief Template File
+**
+**     $Id: target_tile.cpp,v 1.2 2005/01/12 06:46:45 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "target_tile.h"
+#include "string.h"
+#include "surface.h"
+#include "render.h"
+#include "canvas.h"
+#include "context.h"
+#include "general.h"
+#include <ETL/clock>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+const unsigned int     DEF_TILE_WIDTH = 64;
+const unsigned int     DEF_TILE_HEIGHT= 64;
+
+#define SINFG_OPTIMIZE_LAYER_TREE      1
+#ifdef _DEBUG
+#define SINFG_DISPLAY_EFFICIENCY       1
+#endif
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Target_Tile::Target_Tile():
+       threads_(2),
+       tile_w_(DEF_TILE_WIDTH),
+       tile_h_(DEF_TILE_HEIGHT),
+       curr_tile_(0),
+       clipping_(true)
+{
+       curr_frame_=0;
+}
+
+int
+Target_Tile::next_frame(Time& time)
+{
+       int
+               total_frames(1),
+               frame_start(0),
+               frame_end(0);
+       Time
+               time_start(0),
+               time_end(0);
+
+       // If the description's end frame is equal to
+       // the start frame, then it is assumed that we
+       // are rendering only one frame. Correct it.
+       if(desc.get_frame_end()==desc.get_frame_start())
+               desc.set_frame_end(desc.get_frame_start()+1);
+
+       frame_start=desc.get_frame_start();
+       frame_end=desc.get_frame_end();
+       time_start=desc.get_time_start();
+       time_end=desc.get_time_end();
+       
+       // Calculate the number of frames
+       total_frames=frame_end-frame_start;
+       if(total_frames<=0)total_frames=1;
+       
+       //RendDesc rend_desc=desc;
+       //rend_desc.set_gamma(1);
+
+//     int total_tiles(total_tiles());
+       time=(time_end-time_start)*curr_frame_/total_frames+time_start;
+       curr_frame_++;
+
+/*     sinfg::info("curr_frame_: %d",curr_frame_);
+       sinfg::info("total_frames: %d",total_frames);
+       sinfg::info("time_end: %s",time_end.get_string().c_str());
+       sinfg::info("time_start: %s",time_start.get_string().c_str());
+*/
+//     sinfg::info("time: %s",time.get_string().c_str());
+
+       return total_frames- curr_frame_+1;
+}
+
+int
+Target_Tile::next_tile(int& x, int& y)
+{
+       // Width of the image(in tiles)
+       int tw(rend_desc().get_w()/tile_w_);
+       int th(rend_desc().get_h()/tile_h_);
+
+       // Add the last tiles (which will be clipped)
+       if(rend_desc().get_w()%tile_w_!=0)tw++;
+       if(rend_desc().get_h()%tile_h_!=0)th++;
+       
+       x=(curr_tile_%tw)*tile_h_;
+       y=(curr_tile_/tw)*tile_w_;
+
+       curr_tile_++;
+       return (tw*th)-curr_tile_+1;
+}
+
+bool
+sinfg::Target_Tile::render_frame_(Context context,ProgressCallback *cb)
+{
+       if(tile_w_<=0||tile_h_<=0)
+       {
+               if(cb)cb->error(_("Bad Tile Size"));
+               return false;
+       }
+       const RendDesc &rend_desc(desc);
+#define total_tiles total_tiles()
+
+       etl::clock total_time;
+       etl::clock::value_type work_time(0);
+       etl::clock::value_type find_tile_time(0);
+       etl::clock::value_type add_tile_time(0);
+       total_time.reset();
+       
+       // If the quality is set to zero, then we
+       // use the parametric scanline-renderer.
+       if(get_quality()==0)
+       {
+               Surface surface;
+               
+               RendDesc tile_desc;
+               int x,y,w,h;
+               int i;
+               etl::clock tile_timer;
+               tile_timer.reset();
+               while((i=next_tile(x,y)))
+               {
+                       find_tile_time+=tile_timer();
+                       SuperCallback   super(cb,(total_tiles-i+1)*1000,(total_tiles-i+2)*1000,total_tiles*1000);
+                       if(!super.amount_complete(0,1000))
+                               return false;
+                       //if(cb && !cb->amount_complete(total_tiles-i,total_tiles))
+                       //      return false;
+
+                       // Perform clipping on the tile
+                       if(clipping_)
+                       {
+                               w=x+tile_w_<rend_desc.get_w()?tile_w_:rend_desc.get_w()-x;
+                               h=y+tile_h_<rend_desc.get_h()?tile_h_:rend_desc.get_h()-y;
+                               if(w<=0||h<=0)continue;
+                       }
+                       else
+                       {
+                               w=tile_w_;
+                               h=tile_h_;
+                       }
+
+                       tile_desc=rend_desc;
+                       tile_desc.set_subwindow(x,y,w,h);
+                       if(!parametric_render(context, surface, tile_desc,&super))
+                       {
+                               // For some reason, the parametric renderer failed.
+                               if(cb)cb->error(_("Parametric Renderer Failure"));
+                               return false;
+                       }
+                       else
+                       {
+                               if(!surface)
+                               {
+                                       if(cb)cb->error(_("Bad surface"));
+                                       return false;
+                               }
+                               if(get_remove_alpha())
+                                       for(int i=0;i<surface.get_w()*surface.get_h();i++)
+                                               surface[0][i]=Color::blend(surface[0][i],desc.get_bg_color(),1.0f);
+                               
+                               // Add the tile to the target
+                               if(!add_tile(surface,x,y))
+                               {
+                                       if(cb)cb->error(_("add_tile():Unable to put surface on target"));
+                                       return false;
+                               }
+                       }
+               tile_timer.reset();
+               }
+       }
+       else // If quality is set otherwise, then we use the accelerated renderer
+       {
+               Surface surface;
+               
+               RendDesc tile_desc;
+               int x,y,w,h;
+               int i;
+               etl::clock tile_timer;
+               tile_timer.reset();
+               while((i=next_tile(x,y)))
+               {
+                       find_tile_time+=tile_timer();
+                       SuperCallback   super(cb,(total_tiles-i)*1000,(total_tiles-i+1)*1000,total_tiles*1000);
+                       if(!super.amount_complete(0,1000))
+                               return false;
+//                     if(cb && !cb->amount_complete(total_tiles-i,total_tiles))
+//                             return false;
+                       // Perform clipping on the tile
+                       if(clipping_)
+                       {
+                               w=x+tile_w_<rend_desc.get_w()?tile_w_:rend_desc.get_w()-x;
+                               h=y+tile_h_<rend_desc.get_h()?tile_h_:rend_desc.get_h()-y;
+                               if(w<=0||h<=0)continue;
+                       }
+                       else
+                       {
+                               w=tile_w_;
+                               h=tile_h_;
+                       }
+
+                       tile_desc=rend_desc;
+                       tile_desc.set_subwindow(x,y,w,h);
+                       
+                       etl::clock timer2;
+                       timer2.reset();
+                       
+                       if(!context.accelerated_render(&surface,get_quality(),tile_desc,&super))
+                       {
+                               // For some reason, the accelerated renderer failed.
+                               if(cb)cb->error(_("Accelerated Renderer Failure"));
+                               return false;
+                       }
+                       else
+                       {
+                               work_time+=timer2();
+                               if(!surface)
+                               {
+                                       if(cb)cb->error(_("Bad surface"));
+                                       return false;
+                               }
+                               if(get_remove_alpha())
+                                       for(int i=0;i<surface.get_w()*surface.get_h();i++)
+                                               surface[0][i]=Color::blend(surface[0][i],desc.get_bg_color(),1.0f);
+
+                               etl::clock timer;
+                               timer.reset();
+                               // Add the tile to the target
+                               if(!add_tile(surface,x,y))
+                               {
+                                       if(cb)cb->error(_("add_tile():Unable to put surface on target"));
+                                       return false;
+                               }
+                               add_tile_time+=timer();
+                       }
+                       tile_timer.reset();
+               }
+       }
+       if(cb && !cb->amount_complete(total_tiles,total_tiles))
+               return false;
+       
+#if SINFG_DISPLAY_EFFICIENCY==1
+       sinfg::info(">>>>>> Render Time: %fsec, Find Tile Time: %fsec, Add Tile Time: %fsec, Total Time: %fsec",work_time,find_tile_time,add_tile_time,total_time());
+       sinfg::info(">>>>>> FRAME EFICIENCY: %f%%",(100.0f*work_time/total_time()));
+#endif
+#undef total_tiles
+       return true;
+}
+
+bool
+sinfg::Target_Tile::render(ProgressCallback *cb)
+{
+       SuperCallback super_cb;
+       int
+               i=0,
+               total_frames,
+               frame_start,
+               frame_end;
+       Time
+               t=0,
+               time_start,
+               time_end;
+
+       assert(canvas);
+       curr_frame_=0;
+       init();
+       
+       // If the description's end frame is equal to
+       // the start frame, then it is assumed that we
+       // are rendering only one frame. Correct it.
+       if(desc.get_frame_end()==desc.get_frame_start())
+               desc.set_frame_end(desc.get_frame_start()+1);
+
+       frame_start=desc.get_frame_start();
+       frame_end=desc.get_frame_end();
+       time_start=desc.get_time_start();
+       time_end=desc.get_time_end();
+       
+       // Calculate the number of frames
+       total_frames=frame_end-frame_start;
+       
+       
+       
+       try {
+               // Grab the time
+               i=next_frame(t);
+               
+               //sinfg::info("1time_set_to %s",t.get_string().c_str());
+               
+               if(i>=1)
+               {
+               do
+               {
+                       curr_tile_=0;
+                       
+                       // If we have a callback, and it returns
+                       // false, go ahead and bail. (maybe a use cancel)
+                       if(cb && !cb->amount_complete(total_frames-(i-1),total_frames))
+                               return false;
+                       
+                       if(!start_frame(cb))
+                               return false;
+
+                       // Set the time that we wish to render
+                       //if(!get_avoid_time_sync() || canvas->get_time()!=t)
+                               canvas->set_time(t);
+                       
+                       Context context;
+                       
+                       #ifdef SINFG_OPTIMIZE_LAYER_TREE
+                       Canvas::Handle op_canvas(Canvas::create());
+                       optimize_layers(canvas->get_context(), op_canvas);
+                       context=op_canvas->get_context();
+                       #else
+                       context=canvas->get_context();
+                       #endif
+                       
+/*
+                       #ifdef SINFG_OPTIMIZE_LAYER_TREE
+                       Context context;
+                       Canvas::Handle op_canvas(Canvas::create());
+                       // Set the time that we wish to render
+                       canvas->set_time(t);
+                       optimize_layers(canvas->get_context(), op_canvas);
+                       context=op_canvas->get_context();
+                       #else
+                       Context context;
+                       // Set the time that we wish to render
+                       canvas->set_time(t);
+                       context=canvas->get_context();
+                       #endif
+*/
+                       
+                       if(!render_frame_(context,0))
+                               return false;
+                       end_frame();
+               }while((i=next_frame(t)));
+               //sinfg::info("tilerenderer: i=%d, t=%s",i,t.get_string().c_str());
+               }
+               else
+               {
+                       curr_tile_=0;
+       
+                       if(!start_frame(cb))
+                               return false;
+
+                       // Set the time that we wish to render
+//                     if(!get_avoid_time_sync() || canvas->get_time()!=t)
+                               canvas->set_time(t);
+
+                       //sinfg::info("2time_set_to %s",t.get_string().c_str());
+
+                       Context context;
+                       
+                       #ifdef SINFG_OPTIMIZE_LAYER_TREE
+                       Canvas::Handle op_canvas(Canvas::create());
+                       optimize_layers(canvas->get_context(), op_canvas);
+                       context=op_canvas->get_context();
+                       #else
+                       context=canvas->get_context();
+                       #endif
+               
+                       if(!render_frame_(context, cb))
+                               return false;
+                       end_frame();
+               }
+       
+       }
+       catch(String str)
+       {
+               if(cb)cb->error(_("Caught string :")+str);
+               return false;
+       }
+       catch(std::bad_alloc)
+       {
+               if(cb)cb->error(_("Ran out of memory (Probably a bug)"));
+               return false;
+       }
+       catch(...)
+       {
+               if(cb)cb->error(_("Caught unknown error, rethrowing..."));
+               throw;
+       }
+       return true;
+}
diff --git a/synfig-core/trunk/src/synfig/target_tile.h b/synfig-core/trunk/src/synfig/target_tile.h
new file mode 100644 (file)
index 0000000..c585373
--- /dev/null
@@ -0,0 +1,120 @@
+/* === S I N F G =========================================================== */
+/*!    \file target_tile.h
+**     \brief Template Header
+**
+**     $Id: target_tile.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TARGET_TILE_H
+#define __SINFG_TARGET_TILE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "target.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Target_Tile
+**     \brief Render-target
+**     \todo writeme
+*/
+class Target_Tile : public Target
+{
+       int threads_;
+       int tile_w_;
+       int tile_h_;
+       int curr_tile_;
+       int curr_frame_;
+       bool clipping_;
+public:
+       typedef etl::handle<Target_Tile> Handle;
+       typedef etl::loose_handle<Target_Tile> LooseHandle;
+       typedef etl::handle<const Target_Tile> ConstHandle;
+
+       Target_Tile();
+
+       //! Renders the canvas to the target
+       virtual bool render(ProgressCallback *cb=NULL);
+
+       //! Determines which tile needs to be rendered next.
+       /*!     Most cases will not have to redefine this function. 
+       **      The default should be adequate in nearly all situations.
+       **      \returns The number of tiles left to go <i>plus one</i>.
+       **              This means that whenever this function returns zero,
+       **              there are no more tiles to render and that any value
+       **              in \a x or \a y should be disregarded. */
+       virtual int next_tile(int& x, int& y);
+
+       virtual int next_frame(Time& time);
+
+       //! Adds the tile at \a x , \a y contained in \a surface 
+       virtual bool add_tile(const sinfg::Surface &surface, int x, int y)=0;
+
+       virtual int total_tiles()const
+       {
+               // Width of the image(in tiles)
+               const int tw(rend_desc().get_w()/tile_w_+(rend_desc().get_w()%tile_w_?1:0));
+               const int th(rend_desc().get_h()/tile_h_+(rend_desc().get_h()%tile_h_?1:0));
+               
+               return tw*th;
+       }
+
+       //! Marks the start of a frame
+       /*! \return \c true on success, \c false upon an error.
+       **      \see end_frame(), start_scanline()
+       */
+       virtual bool start_frame(ProgressCallback *cb=NULL)=0;
+
+       //! Marks the end of a frame
+       /*! \see start_frame() */
+       virtual void end_frame()=0;
+       
+       void set_threads(int x) { threads_=x; }
+
+       int get_threads()const { return threads_; }
+
+       void set_tile_w(int w) { tile_w_=w; }
+
+       int get_tile_w()const { return tile_w_; }
+
+       void set_tile_h(int h) { tile_h_=h; }
+
+       int get_tile_h()const { return tile_h_; }
+       
+       bool get_clipping()const { return clipping_; }
+
+       void set_clipping(bool x) { clipping_=x; }
+       
+private:
+       
+       bool render_frame_(Context context,ProgressCallback *cb=0);
+       
+}; // END of class Target_Tile
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/time.cpp b/synfig-core/trunk/src/synfig/time.cpp
new file mode 100644 (file)
index 0000000..e225633
--- /dev/null
@@ -0,0 +1,253 @@
+/* === S I N F G =========================================================== */
+/*!    \file time.cpp
+**     \brief Template File
+**
+**     $Id: time.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "time.h"
+#include <ETL/stringf>
+#include <ETL/misc>
+#include "general.h"
+#include <cmath>
+#include <cassert>
+#include <ctype.h>
+#include <math.h>
+
+#ifndef isnan
+
+#ifdef WIN32
+#include <float.h>
+#ifndef isnan
+extern "C" { int _isnan(double x); }
+#define isnan _isnan
+#endif
+#endif
+
+#ifdef __APPLE__
+#define isnan __isnan
+#endif
+
+#endif
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+#define tolower ::tolower
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Time::Time(const String &str_, float fps):
+       value_(0)
+{
+       String str(str_);
+       std::transform(str.begin(),str.end(),str.begin(),&tolower);
+
+       // Start/Begin Of Time
+       if(str=="SOT" || str=="BOT")
+       {
+               operator=(begin());
+               return;
+       }
+       // End Of Time
+       if(str=="EOT")
+       {
+               operator=(end());
+               return;
+       }
+
+
+       unsigned int pos=0;
+       int read;
+       float amount;
+       
+       // Now try to read it in the letter-abreviated format
+       while(pos<str.size() && sscanf(String(str,pos).c_str(),"%f%n",&amount,&read))
+       {
+               pos+=read;
+               if(pos>=str.size() || read==0)
+               {
+                       // Throw up a warning if there are no units
+                       // and the amount isn't zero. There is no need
+                       // to warn about units if the value is zero
+                       // it is the only case where units are irrelevant.
+                       if(amount!=0)
+                               sinfg::warning("Time(): No unit provided in time code, assuming SECONDS (\"%s\")",str.c_str());
+                       value_+=amount;
+                       return;
+               }
+               switch(str[pos])
+               {
+                       case 'h':
+                       case 'H':
+                               value_+=amount*3600;
+                               break;
+                       case 'm':
+                       case 'M':
+                               value_+=amount*60;
+                               break;
+                       case 's':
+                       case 'S':
+                               value_+=amount;
+                               break;
+                       case 'f':
+                       case 'F':
+                               if(fps)
+                                       value_+=amount/fps;
+                               else
+                                       sinfg::warning("Time(): Individual frames referenced, but frame rate is unknown");
+                               break;
+                       case ':':
+                               // try to read it in as a traditional time format
+                               {
+                                       int hour,minute,second;
+                                       float frame;
+                                       if(fps && sscanf(str.c_str(),"%d:%d:%d.%f",&hour,&minute,&second,&frame)==4)
+                                       {
+                                                       value_=frame/fps+(hour*3600+minute*60+second);
+                                                       return;
+                                       }
+                       
+                                       if(sscanf(str.c_str(),"%d:%d:%d",&hour,&minute,&second)==3)
+                                       {
+                                               value_=hour*3600+minute*60+second;
+                                               return;
+                                       }
+                               }
+                               sinfg::warning("Time(): Bad time format");
+                               break;
+
+                       default:
+                               value_+=amount;
+                               sinfg::warning("Time(): Unexpected character '%c' when parsing time string \"%s\"",str[pos],str.c_str());
+                               break;
+               }
+               pos++;
+               amount=0;
+       }
+}
+
+String
+Time::get_string(float fps, Time::Format format)const
+{
+       Time time(*this);
+       
+       if(time<=begin())
+               return "SOT";   // Start Of Time
+       if(time>=end())
+               return "EOT";   // End Of Time
+       
+       if(fps<0)fps=0;
+       
+       if(ceil(time.value_)-time.value_<epsilon_())
+               time.value_=ceil(time.value_);
+       
+       int hour,minute;
+       
+       hour=time/3600;time-=hour*3600;
+       minute=time/60;time-=minute*60;
+       
+       if(format<=FORMAT_VIDEO)
+       {
+               int second;
+               second=time;time-=second;
+
+               if(fps)
+               {
+                       int frame;
+                       frame=round_to_int(time*fps);
+
+                       return strprintf("%02d:%02d:%02d.%02d",hour,minute,second,frame);
+               }
+               else
+                       return strprintf("%02d:%02d:%02d",hour,minute,second);
+       }
+       
+       String ret;
+
+       if(format<=FORMAT_FULL || hour)
+               ret+=strprintf(format<=FORMAT_NOSPACES?"%dh":"%dh ",hour);
+       
+       if(format<=FORMAT_FULL || hour || minute)
+               ret+=strprintf(format<=FORMAT_NOSPACES?"%dm":"%dm ",minute);
+       
+       if(fps)
+       {
+               int second;
+               float frame;
+               second=time;time-=second;
+               frame=time*fps;
+               if(format<=FORMAT_FULL || second)
+                       ret+=strprintf(format<=FORMAT_NOSPACES?"%ds":"%ds ",(int)second);
+               
+               if(abs(frame-floor(frame)>=epsilon_()))
+                       ret+=strprintf("%0.3ff",frame);
+               else
+                       ret+=strprintf("%0.0ff",frame);
+       }
+       else
+       {
+               float second;
+               second=time;
+               if(abs(second-floor(second))>=epsilon_())
+                       ret+=strprintf("%0.8fs",second);
+               else
+                       ret+=strprintf("%0.0fs",second);
+       }
+       
+       return ret;
+}
+
+Time
+Time::round(float fps)const
+{
+       assert(fps>0);
+
+       value_type time(*this);
+
+       time*=fps;
+
+       if(abs(time-floor(time))<0.5)
+               return floor(time)/fps;
+       else
+               return ceil(time)/fps;
+}
+
+//! \writeme
+bool
+Time::is_valid()const
+{
+       return !isnan(value_);
+}
diff --git a/synfig-core/trunk/src/synfig/time.h b/synfig-core/trunk/src/synfig/time.h
new file mode 100644 (file)
index 0000000..ca29908
--- /dev/null
@@ -0,0 +1,164 @@
+/* === S I N F G =========================================================== */
+/*!    \file time.h
+**     \brief Template Header
+**
+**     $Id: time.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TIME_H
+#define __SINFG_TIME_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "string_decl.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Time
+**     \todo writeme
+**     \see TimeFormat, time_to_string(), string_to_time()
+*/
+class Time
+{
+public:
+       typedef double value_type;
+
+       /*!     \enum Format
+       **      \todo writeme
+       **      \see Time, get_string() */
+       enum Format
+       {
+               FORMAT_NORMAL=0,                //!< Represents the default method of printing the time
+               FORMAT_NOSPACES=(1<<0), //!< Remove any whitespace
+               FORMAT_FULL=(1<<1),             //!< Do not remove units that have "zero" value
+               FORMAT_VIDEO=(1<<2),    //!< Use the HH:MM:SS.ff format
+       
+               FORMAT_END=(1<<4)               //!< \internal Not used
+       }; // END of enum Format
+
+private:
+       value_type value_;
+
+       static const value_type epsilon_() { return static_cast<value_type>(0.0005); }
+
+public:
+       Time() { }
+
+       Time(const value_type &x):value_(x) { }
+
+       Time(int x):value_(x) { }
+
+       Time(int hour, int minute, float second):value_(static_cast<value_type>(second+hour*3600+minute*60)) { }
+
+       //! Constructs Time from the given string.
+       /*!     \note If the string references frames, then the
+       **      frame rate (\afps) should be provided from the
+       **      correct source. (Which is most likely the RendDesc
+       **      of the current Canvas)
+       **      The frame count will be ignored if the
+       **      FPS is not given. */
+       Time(const String &string, float fps=0);
+
+       //! Marks the exclusive negative boundary of time
+       static const Time begin() { return static_cast<sinfg::Time>(-32767.0f*512.0f); }
+       
+       //! Marks the exclusive positive boundary of time
+       static const Time end() { return static_cast<sinfg::Time>(32767.0f*512.0f); }
+
+       //! Marks zero time
+       static const Time zero() { return static_cast<sinfg::Time>(0); }
+       
+       //! The amount of allowable error in calculations
+       static const Time epsilon() { return static_cast<sinfg::Time>(epsilon_()); }
+       
+       //! Returns a string describing the current time value
+       /*!     \see Format */
+       String get_string(float fps=0, Time::Format format=FORMAT_NORMAL)const;
+       
+       //! \writeme
+       bool is_valid()const;
+       
+       //! Rounds time to the nearest frame for the given frame rate, \a fps
+       Time round(float fps)const;
+
+       bool is_equal(const Time& rhs)const { return (value_>rhs.value_)?value_-rhs.value_<=epsilon_():rhs.value_-value_<=epsilon_(); }
+       bool is_less_than(const Time& rhs)const { return rhs.value_-value_ > epsilon_(); }
+       bool is_more_than(const Time& rhs)const { return value_-rhs.value_ > epsilon_(); }
+       
+       operator double()const { return value_; }
+
+       template<typename U> bool operator<(const U& rhs)const { return value_<rhs; }
+       template<typename U> bool operator>(const U& rhs)const { return value_>rhs; }
+       template<typename U> bool operator<=(const U& rhs)const { return value_<=rhs; }
+       template<typename U> bool operator>=(const U& rhs)const { return value_>=rhs; }
+       template<typename U> bool operator==(const U& rhs)const { return value_==rhs; }
+       template<typename U> bool operator!=(const U& rhs)const { return value_!=rhs; }
+
+#if 0
+       bool operator<(const Time& rhs)const { return value_<rhs.value_; }
+       bool operator>(const Time& rhs)const { return value_>rhs.value_; }
+       bool operator<=(const Time& rhs)const { return value_<=rhs.value_; }
+       bool operator>=(const Time& rhs)const { return value_>=rhs.value_; }
+       bool operator==(const Time& rhs)const { return value_==rhs.value_; }
+       bool operator!=(const Time& rhs)const { return value_!=rhs.value_; }
+#else
+       bool operator<(const Time& rhs)const { return is_less_than(rhs); }
+       bool operator>(const Time& rhs)const { return is_more_than(rhs); }
+       bool operator<=(const Time& rhs)const { return is_less_than(rhs)||is_equal(rhs); }
+       bool operator>=(const Time& rhs)const { return is_more_than(rhs)||is_equal(rhs); }
+       bool operator==(const Time& rhs)const { return is_equal(rhs); }
+       bool operator!=(const Time& rhs)const { return !is_equal(rhs); }
+#endif
+       
+       template<typename U> const Time& operator+=(const U &rhs) { value_+=static_cast<value_type>(rhs); return *this; }
+       template<typename U> const Time& operator-=(const U &rhs) { value_-=static_cast<value_type>(rhs); return *this; }
+       template<typename U> const Time& operator*=(const U &rhs) { value_*=static_cast<value_type>(rhs); return *this; }
+       template<typename U> const Time& operator/=(const U &rhs) { value_/=static_cast<value_type>(rhs); return *this; }
+
+       template<typename U> Time operator+(const U &rhs)const { return value_+static_cast<value_type>(rhs); }
+       template<typename U> Time operator-(const U &rhs)const { return value_-static_cast<value_type>(rhs); }
+       template<typename U> Time operator*(const U &rhs)const { return value_*static_cast<value_type>(rhs); }
+       template<typename U> Time operator/(const U &rhs)const { return value_/static_cast<value_type>(rhs); }
+       
+       Time operator-()const { return -value_; }
+}; // END of class Time
+
+//! This operator allows the combining of Time::Format flags using the '|' operator
+/*!    \see Time::Format, Time::get_string() */
+inline Time::Format operator|(Time::Format lhs, Time::Format rhs)
+{ return static_cast<Time::Format>((int)lhs|(int)rhs); }
+
+//! This operator is for checking Time::Format flags.
+/*! Don't think of it as "less then or equal to", but think of it
+**     like an arrow. Is \a rhs inside of \a lhs ?
+**     \see Time::Format, Time::get_string() */
+inline bool operator<=(Time::Format lhs, Time::Format rhs)
+{ return (static_cast<int>(lhs) & static_cast<int>(rhs))==static_cast<int>(rhs); }
+
+}; // END of namespace sinfg
+       
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/timepointcollect.cpp b/synfig-core/trunk/src/synfig/timepointcollect.cpp
new file mode 100644 (file)
index 0000000..9300a8a
--- /dev/null
@@ -0,0 +1,145 @@
+/* === S I N F G =========================================================== */
+/*!    \file template.cpp
+**     \brief Template File
+**
+**     $Id: timepointcollect.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "timepointcollect.h"
+#include "valuenode_animated.h"
+#include "layer.h"
+#include "canvas.h"
+#include "value.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+//! \writeme
+int
+sinfg::waypoint_collect(set<Waypoint, std::less<UniqueID> >& waypoint_set,const Time& time, const etl::handle<Node>& node)
+{      
+       const TimePointSet& timepoint_set(node->get_times());
+
+       // Check to see if there is anything in here at the given time
+       if(timepoint_set.find(time)==timepoint_set.end())
+               return 0;
+
+       // Check if we are a linkable value node
+       LinkableValueNode::Handle linkable_value_node;
+       linkable_value_node=linkable_value_node.cast_dynamic(node);
+       if(linkable_value_node)
+       {
+               const int link_count(linkable_value_node->link_count());
+               int i,ret(0);
+               for(i=0;i<link_count;i++)
+               {
+                       ret+=waypoint_collect(waypoint_set,time,linkable_value_node->get_link(i).get());
+               }
+               return ret;
+       }
+
+       // Check if we are a layer
+       Layer::Handle layer;
+       layer=layer.cast_dynamic(node);
+       if(layer)
+       {
+               const Layer::DynamicParamList& dyn_param_list(layer->dynamic_param_list());
+               Layer::DynamicParamList::const_iterator iter;
+               int ret(0);
+               for(iter=dyn_param_list.begin();iter!=dyn_param_list.end();++iter)
+               {
+                       ret+=waypoint_collect(waypoint_set,time,iter->second);
+               }
+               ValueBase canvas_value(layer->get_param("canvas"));
+               if(canvas_value.get_type()==ValueBase::TYPE_CANVAS)
+               {
+                       ret+=waypoint_collect(waypoint_set,time,Canvas::Handle(canvas_value.get(Canvas::Handle())));
+               }
+               return ret;
+       }
+
+       // Check if we are a canvas
+       Canvas::Handle canvas;
+       canvas=canvas.cast_dynamic(node);
+       if(canvas)
+       {
+               Canvas::const_iterator iter;
+               int ret(0);
+               for(iter=canvas->begin();iter!=canvas->end();++iter)
+                       ret+=waypoint_collect(waypoint_set,time,*iter);
+               return ret;
+       }
+
+       // Check if we are an animated value node
+       ValueNode_Animated::Handle value_node_animated;
+       value_node_animated=value_node_animated.cast_dynamic(node);
+       if(value_node_animated)
+       {
+               try{
+                       Waypoint waypoint=*value_node_animated->find(time);
+                       
+                       // If it is already in the waypoint set, then
+                       // don't bother adding it again
+                       if(waypoint_set.find(waypoint)!=waypoint_set.end())
+                       {
+                               return 0;
+                       }
+                       waypoint_set.insert(waypoint);
+                       return 1;
+               }catch(...)
+               {
+                       return 0;
+               }
+       }
+
+       return 0;
+}
+
+//! \writeme
+int
+sinfg::activepoint_collect(set<Activepoint, std::less<UniqueID> >& activepoint_set,const Time& time, const etl::handle<Node>& node)
+{
+       const TimePointSet& timepoint_set(node->get_times());
+
+       // Check to see if there is anything in here at the given time
+       if(timepoint_set.find(time)==timepoint_set.end());
+               return 0;
+
+       return 0;
+}
diff --git a/synfig-core/trunk/src/synfig/timepointcollect.h b/synfig-core/trunk/src/synfig/timepointcollect.h
new file mode 100644 (file)
index 0000000..8825f25
--- /dev/null
@@ -0,0 +1,53 @@
+/* === S I N F G =========================================================== */
+/*!    \file timepointcollect.h
+**     \brief Template Header
+**
+**     $Id: timepointcollect.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TIMEPOINTCOLLECT_H
+#define __SINFG_TIMEPOINTCOLLECT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <set>
+#include "activepoint.h"
+#include "waypoint.h"
+#include "node.h"
+#include "time.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+//! \writeme
+int waypoint_collect(std::set<Waypoint, std::less<UniqueID> >& waypoint_set,const Time& time, const etl::handle<Node>& node);
+
+//! \writeme
+int activepoint_collect(std::set<Activepoint, std::less<UniqueID> >& activepoint_set,const Time& time, const etl::handle<Node>& node);
+       
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/transform.cpp b/synfig-core/trunk/src/synfig/transform.cpp
new file mode 100644 (file)
index 0000000..17826f4
--- /dev/null
@@ -0,0 +1,148 @@
+/* === S I N F G =========================================================== */
+/*!    \file template.cpp
+**     \brief Template File
+**
+**     $Id: transform.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "transform.h"
+#include <algorithm>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::GUID
+TransformStack::get_guid()const
+{
+       GUID ret(0);
+       
+       for(const_iterator iter(begin());iter!=end();++iter)
+               ret%=(*iter)->get_guid();
+       return ret;
+}
+
+sinfg::Vector
+TransformStack::perform(const sinfg::Vector& x)const
+{
+       sinfg::Vector ret(x);
+       
+       for(const_reverse_iterator iter(rbegin());iter!=rend();++iter)
+               ret=(*iter)->perform(ret);
+       
+       return ret;
+}
+
+sinfg::Vector
+TransformStack::unperform(const sinfg::Vector& x)const
+{
+       sinfg::Vector ret(x);
+       
+       for(const_iterator iter(begin());iter!=end();++iter)
+               ret=(*iter)->unperform(ret);
+       
+       return ret;
+}
+
+sinfg::Rect
+TransformStack::perform(const sinfg::Rect& x)const
+{
+       Point min(x.get_min());
+       Point max(x.get_max());
+       Rect ret(perform(min),perform(max));
+
+       std::swap(min[1],max[1]);
+       ret
+               .expand(perform(min))
+               .expand(perform(max))
+       ;
+       return ret;
+}
+
+sinfg::Rect
+TransformStack::unperform(const sinfg::Rect& x)const
+{
+       Point min(x.get_min());
+       Point max(x.get_max());
+       Rect ret(unperform(min),unperform(max));
+
+       std::swap(min[1],max[1]);
+       ret
+               .expand(unperform(min))
+               .expand(unperform(max))
+       ;
+       return ret;
+}
+
+sinfg::Rect
+Transform::perform(const sinfg::Rect& x)const
+{
+       if(x.area()>1000000000000.0)
+               return Rect::full_plane();
+
+       Point min(x.get_min());
+       Point max(x.get_max());
+
+       Rect ret(perform(min),perform(max));
+
+       std::swap(min[1],max[1]);
+       ret
+               .expand(perform(min))
+               .expand(perform(max))
+       ;
+       return ret;
+}
+
+sinfg::Rect
+Transform::unperform(const sinfg::Rect& x)const
+{
+       if(x.area()>1000000000000.0)
+               return Rect::full_plane();
+
+       Point min(x.get_min());
+       Point max(x.get_max());
+               
+       Rect ret(unperform(min),unperform(max));
+
+       std::swap(min[1],max[1]);
+       ret
+               .expand(unperform(min))
+               .expand(unperform(max))
+       ;
+       return ret;
+}
diff --git a/synfig-core/trunk/src/synfig/transform.h b/synfig-core/trunk/src/synfig/transform.h
new file mode 100644 (file)
index 0000000..61fdd6d
--- /dev/null
@@ -0,0 +1,85 @@
+/* === S I N F G =========================================================== */
+/*!    \file transform.h
+**     \brief Template Header
+**
+**     $Id: transform.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TRANSFORM_H
+#define __SINFG_TRANSFORM_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/handle>
+#include "vector.h"
+#include <list>
+#include "rect.h"
+#include "guid.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Transform : public etl::shared_object
+{
+       GUID guid_;
+       
+public:
+       typedef etl::handle<Transform> Handle;
+
+protected:
+       Transform(const GUID& guid=GUID(0)):guid_(guid) { }
+
+public:
+
+       const GUID& get_guid()const { return guid_; }
+
+       virtual ~Transform() { }
+       virtual sinfg::Vector perform(const sinfg::Vector& x)const=0;
+       virtual sinfg::Vector unperform(const sinfg::Vector& x)const=0;
+
+       virtual sinfg::Rect perform(const sinfg::Rect& x)const;
+       virtual sinfg::Rect unperform(const sinfg::Rect& x)const;
+
+}; // END of class Transform
+
+class TransformStack : public std::list<Transform::Handle>
+{
+public:
+       GUID get_guid()const;
+
+       sinfg::Vector perform(const sinfg::Vector& x)const;
+       sinfg::Vector unperform(const sinfg::Vector& x)const;
+       
+       sinfg::Rect perform(const sinfg::Rect& x)const;
+       sinfg::Rect unperform(const sinfg::Rect& x)const;
+       
+       void push(const Transform::Handle& x) { if(x)push_back(x); }
+       void pop() { pop_back(); }
+}; // END of class TransformStack
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/types.h b/synfig-core/trunk/src/synfig/types.h
new file mode 100644 (file)
index 0000000..d7239a2
--- /dev/null
@@ -0,0 +1,46 @@
+/* === S I N F G =========================================================== */
+/*!    \file types.h
+**     \brief Template Header
+**
+**     $Id: types.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_TYPES_H
+#define __SINFG_TYPES_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <cmath>
+
+#ifndef SINFG_NO_ANGLE
+#include "angle.h"
+#endif
+
+#include "time.h"
+#include "vector.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/uniqueid.cpp b/synfig-core/trunk/src/synfig/uniqueid.cpp
new file mode 100644 (file)
index 0000000..904b83c
--- /dev/null
@@ -0,0 +1,50 @@
+/* === S I N F G =========================================================== */
+/*!    \file uniqueid.cpp
+**     \brief Template File
+**
+**     $Id: uniqueid.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "uniqueid.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace sinfg;
+
+/* === G L O B A L S ======================================================= */
+
+static int uniqueid_pool_(0);
+
+/* === M E T H O D S ======================================================= */
+
+int
+sinfg::UniqueID::next_id()
+{
+       return ++uniqueid_pool_;
+}
diff --git a/synfig-core/trunk/src/synfig/uniqueid.h b/synfig-core/trunk/src/synfig/uniqueid.h
new file mode 100644 (file)
index 0000000..c8f396f
--- /dev/null
@@ -0,0 +1,90 @@
+/* === S I N F G =========================================================== */
+/*!    \file uniqueid.h
+**     \brief Template Header
+**
+**     $Id: uniqueid.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_UNIQUEID_H
+#define __SINFG_UNIQUEID_H
+
+/* === H E A D E R S ======================================================= */
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+       
+class UniqueIDLessThan;
+       
+/*! \class UniqueID
+**     \brief \todo
+*/
+class UniqueID
+{
+       friend class UniqueIDLessThan;
+       
+       int id_;
+       
+       explicit UniqueID(int id_):id_(id_) { }
+       
+       static int next_id();
+       
+public:
+       
+       //! Returns the internal unique identifier for this object.
+       /*! The return value from this isn't really useful for
+       **      much other than debug output. Nonetheless, that is
+       **      one step above useless, so here it is. */
+       const int &get_uid()const { return id_; }
+       
+       UniqueID():id_(next_id()) { }
+       
+       void make_unique() { id_=next_id(); }
+       
+       static const UniqueID nil() { return UniqueID(0); }
+       
+       operator bool()const { return static_cast<bool>(id_); }
+
+       void mimic(const UniqueID& x) { id_=x.id_; }
+       
+       bool operator==(const UniqueID &rhs)const { return id_==rhs.id_; }
+       bool operator!=(const UniqueID &rhs)const { return id_!=rhs.id_; }
+       bool operator<(const UniqueID &rhs)const { return id_<rhs.id_; }
+}; // END of class UniqueID
+
+/*! \class UniqueIDLessThan
+**     \brief A function class used for sorting based on UniqueIDs
+*/
+class UniqueIDLessThan
+{
+public:
+       bool operator()(const UniqueID &lhs, const UniqueID &rhs)const
+       { return lhs.id_<rhs.id_; }
+};
+
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/value.cpp b/synfig-core/trunk/src/synfig/value.cpp
new file mode 100644 (file)
index 0000000..b942308
--- /dev/null
@@ -0,0 +1,406 @@
+/* === S I N F G =========================================================== */
+/*!    \file value.cpp
+**     \brief Template Header
+**
+**     $Id: value.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "value.h"
+#include "general.h"
+#include <ETL/stringf>
+#include "canvas.h"
+#include "gradient.h"
+
+
+
+#include "vector.h"
+#include "time.h"
+#include "segment.h"
+#include "color.h"
+
+#endif
+
+using namespace sinfg;
+using namespace std;
+using namespace etl;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueBase::ValueBase():type(TYPE_NIL),data(0),ref_count(0),loop_(0)
+{
+}
+
+ValueBase::ValueBase(Type x):
+       type(x),
+       data(0),
+       loop_(0)
+{
+
+       switch(type)
+       {
+       case TYPE_BOOL:
+               static_cast<bool*>(data)=new bool();
+               break;
+       case TYPE_INTEGER:
+               static_cast<int*>(data)=new int();
+               break;
+       case TYPE_ANGLE:
+               static_cast<Angle*>(data)=new Angle();
+               break;
+       case TYPE_VECTOR:
+               static_cast<Vector*>(data)=new Vector();
+               break;
+       case TYPE_TIME:
+               static_cast<Time*>(data)=new Time();
+               break;
+       case TYPE_REAL:
+               static_cast<Real*>(data)=new Real();
+               break;
+       case TYPE_COLOR:
+               static_cast<Color*>(data)=new Color();
+               break;
+       case TYPE_SEGMENT:
+               static_cast<Segment*>(data)=new Segment();
+               break;
+       case TYPE_BLINEPOINT:
+               static_cast<BLinePoint*>(data)=new BLinePoint();
+               break;
+       case TYPE_LIST:
+               static_cast<list_type*>(data)=new list_type();
+               break;
+       case TYPE_STRING:
+               static_cast<String*>(data)=new String();
+               break;
+       case TYPE_GRADIENT:
+               static_cast<Gradient*>(data)=new Gradient();
+               break;
+       case TYPE_CANVAS:
+               static_cast<etl::handle<Canvas>*>(data)=new etl::handle<Canvas>();
+               break;
+       default:
+               break;
+       }
+}
+
+ValueBase::~ValueBase()
+{
+       clear();
+}
+
+const char*
+ValueBase::get(const char*)const
+{
+       return get(String()).c_str();
+}
+
+
+
+
+void
+ValueBase::set(Canvas* x)
+{
+       clear();
+       if(x && x->is_inline())
+       {
+               _set(etl::handle<Canvas>(x));
+       }
+       else
+       {
+               _set(etl::loose_handle<Canvas>(x));
+       }
+       assert(get(x)==x);
+}
+
+void
+ValueBase::set(etl::loose_handle<Canvas> x)
+{
+       clear();
+       if(x && x->is_inline())
+       {
+               _set(etl::handle<Canvas>(x));
+       }
+       else
+       {
+               _set(etl::loose_handle<Canvas>(x));
+       }
+       assert(get(x)==x);
+}
+
+void
+ValueBase::set(etl::handle<Canvas> x)
+{
+       clear();
+       if(x && x->is_inline())
+       {
+               _set(etl::handle<Canvas>(x));
+       }
+       else
+       {
+               _set(etl::loose_handle<Canvas>(x));
+       }
+       assert(get(x)==x);
+}
+
+void
+ValueBase::set(const list_type &x)
+{
+       _set(x);
+}
+
+void
+ValueBase::set(const char* x)
+{
+       _set(String(x));
+}
+
+bool
+ValueBase::is_valid()const
+{
+       return type>TYPE_NIL && type<TYPE_END && ref_count;
+}
+
+bool
+ValueBase::empty()const
+{
+       return !is_valid() || ((type==TYPE_LIST)?get_list().empty():false);
+}
+
+ValueBase::Type
+ValueBase::get_contained_type()const
+{
+       if(type!=TYPE_LIST || empty())
+               return TYPE_NIL;
+       return get_list().front().get_type();
+}
+
+ValueBase&
+ValueBase::operator=(const ValueBase& x)
+{
+       if(data!=x.data)
+       {
+               clear();
+               type=x.type;
+               data=x.data;
+               ref_count=x.ref_count;
+       }
+       loop_=x.loop_;
+       return *this;
+}
+
+void
+ValueBase::clear()
+{
+       if(ref_count.unique() && data)
+       {
+               switch(type)
+               {
+               case TYPE_BOOL:
+                       delete static_cast<bool*>(data);
+                       break;
+               case TYPE_INTEGER:
+                       delete static_cast<int*>(data);
+                       break;
+               case TYPE_ANGLE:
+                       delete static_cast<Angle*>(data);
+                       break;
+               case TYPE_VECTOR:
+                       delete static_cast<Vector*>(data);
+                       break;
+               case TYPE_TIME:
+                       delete static_cast<Time*>(data);
+                       break;
+               case TYPE_REAL:
+                       delete static_cast<Real*>(data);
+                       break;
+               case TYPE_COLOR:
+                       delete static_cast<Color*>(data);
+                       break;
+               case TYPE_SEGMENT:
+                       delete static_cast<Segment*>(data);
+                       break;
+               case TYPE_BLINEPOINT:
+                       delete static_cast<BLinePoint*>(data);
+                       break;
+               case TYPE_LIST:
+                       delete static_cast<list_type*>(data);
+                       break;
+               case TYPE_STRING:
+                       delete static_cast<String*>(data);
+                       break;
+               case TYPE_GRADIENT:
+                       delete static_cast<Gradient*>(data);
+                       break;
+
+
+               case TYPE_CANVAS:
+               {
+                       etl::handle<Canvas> canvas(get(etl::loose_handle<Canvas>()));
+                       if(canvas && canvas->is_inline())
+                       {
+                               delete static_cast<etl::handle<Canvas>*>(data);
+                       }
+                       else
+                       {
+                               delete static_cast<etl::loose_handle<Canvas>*>(data);
+                       }
+                       break;
+               }
+               default:
+                       break;
+               }
+       }
+       
+       ref_count.detach();
+       data=0;
+       type=TYPE_NIL;
+}
+
+
+String
+ValueBase::type_name(Type id)
+{
+       switch(id)
+       {
+       case TYPE_REAL:
+               return "real";
+       case TYPE_TIME:
+               return "time";
+       case TYPE_INTEGER:
+               return "integer";
+       case TYPE_BOOL:
+               return "bool";
+       case TYPE_ANGLE:
+               return "angle";
+       case TYPE_VECTOR:
+               return "vector";
+       case TYPE_COLOR:
+               return "color";
+       case TYPE_STRING:
+               return "string";
+       case TYPE_CANVAS:
+               return "canvas";
+       case TYPE_LIST:
+               return "list";
+       case TYPE_SEGMENT:
+               return "segment";
+       case TYPE_GRADIENT:
+               return "gradient";
+       case TYPE_BLINEPOINT:
+               return "bline_point";
+       case TYPE_NIL:
+               return "nil";
+       default:
+               break;
+       }
+       sinfg::warning("Encountered unknown ValueBase with an Type of %d",id);
+//     assert(0);
+       return "UNKNOWN";
+}
+
+ValueBase::Type
+ValueBase::ident_type(const String &str)
+{
+       if(str=="nil" || str=="null")
+               return TYPE_NIL;
+       else if(str=="time" || str==_("time"))
+               return TYPE_TIME;
+       else if(str=="real" || str=="float" || str==_("real"))
+               return TYPE_REAL;
+       else if(str=="integer" || str=="int" || str==_("integer"))
+               return TYPE_INTEGER;
+       else if(str=="bool" || str==_("bool"))
+               return TYPE_BOOL;
+       else if(str=="angle" || str=="degrees" || str=="radians" || str=="rotations")
+               return TYPE_ANGLE;
+       else if(str=="vector" || str=="point")
+               return TYPE_VECTOR;
+       else if(str=="color")
+               return TYPE_COLOR;
+       else if(str=="string")
+               return TYPE_STRING;
+       else if(str=="canvas")
+               return TYPE_CANVAS;
+       else if(str=="list")
+               return TYPE_LIST;
+       else if(str=="segment")
+               return TYPE_SEGMENT;
+       else if(str=="gradient")
+               return TYPE_GRADIENT;
+       else if(str=="bline_point" || str=="blinepoint")
+               return TYPE_BLINEPOINT;
+
+       return TYPE_NIL;
+}
+
+bool
+ValueBase::operator==(const ValueBase& rhs)const
+{
+       if(get_type()!=rhs.get_type())
+               return false;
+       if(data==rhs.data)
+               return true;
+       
+       switch(get_type())
+       {
+       case TYPE_TIME:
+               return get(Time()).is_equal(rhs.get(Time()));
+       case TYPE_REAL:
+               return abs(get(Real())-rhs.get(Real()))<=0.00000000000001;
+       case TYPE_INTEGER:
+               return get(int())==rhs.get(int());
+       case TYPE_BOOL:
+               return get(bool())==rhs.get(bool());
+       case TYPE_ANGLE:
+               return get(Angle())==rhs.get(Angle());
+       case TYPE_VECTOR:
+               return get(Vector()).is_equal_to(rhs.get(Vector()));
+       case TYPE_COLOR:
+               return get(Color())==rhs.get(Color());
+       case TYPE_STRING:
+               return get(String())==rhs.get(String());
+       case TYPE_CANVAS:
+               return get(Canvas::LooseHandle())==rhs.get(Canvas::LooseHandle());
+       case TYPE_LIST:
+               return get_list()==rhs.get_list();
+       case TYPE_SEGMENT:
+//             return get(Segment())==rhs.get(Segment());
+       case TYPE_GRADIENT:
+//             return get(Gradient())==rhs.get(Gradient());
+       case TYPE_BLINEPOINT:
+//             return get(BLinePoint())==rhs.get(BLinePoint());
+       case TYPE_NIL:
+       default:
+               return false;
+               break;
+       }
+       return false;
+}
diff --git a/synfig-core/trunk/src/synfig/value.h b/synfig-core/trunk/src/synfig/value.h
new file mode 100644 (file)
index 0000000..6c9ab9c
--- /dev/null
@@ -0,0 +1,454 @@
+/* === S I N F G =========================================================== */
+/*!    \file value.h
+**     \brief Template Header
+**
+**     $Id: value.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUE_H
+#define __SINFG_VALUE_H
+
+/* === H E A D E R S ======================================================= */
+
+//#include "vector.h"
+//#include "time.h"
+#include "segment.h"
+//#include "color.h"
+#include "string.h"
+#include <list>
+#include <vector>
+#include <ETL/trivial>
+#include <ETL/handle>
+#include "general.h"
+//#include "gradient.h"
+#include "blinepoint.h"
+#include "exception.h"
+
+#ifndef SINFG_NO_ANGLE
+#include "angle.h"
+#endif
+
+#include <ETL/ref_count>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Canvas;
+class Vector;
+class Time;
+class Segment;
+class Gradient;
+class BLinePoint;
+class Color;
+       
+/*!    \class ValueBase
+**     \todo writeme
+*/
+class ValueBase
+{
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public:
+
+       //! \writeme
+       enum Type
+       {
+               TYPE_NIL=0,                     //!< Represents an empty value
+               
+               TYPE_BOOL,
+               TYPE_INTEGER,
+               TYPE_ANGLE,                     //!< Angle
+
+               // All types after this point are larger than 32 bits
+               
+               TYPE_TIME,                      //!< Time
+               TYPE_REAL,                      //!< Real
+
+               // All types after this point are larger than 64 bits
+               
+               TYPE_VECTOR,            //!< Vector
+               TYPE_COLOR,                     //!< Color
+               TYPE_SEGMENT,           //!< Segment
+               TYPE_BLINEPOINT,        //!< BLinePoint
+
+               // All types after this point require construction/destruction
+               
+               TYPE_LIST,                      //!< List
+               TYPE_CANVAS,            //!< Canvas
+               TYPE_STRING,            //!< String
+               TYPE_GRADIENT,          //!< Color Gradient
+
+               TYPE_END                        //!< Not a valid type, used for sanity checks
+       };
+       
+private:
+
+       typedef std::vector<ValueBase> list_type;
+
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+protected:
+       
+       Type type;
+       void *data;
+       etl::reference_counter ref_count;
+       bool loop_;     
+
+       /*
+ --    ** -- C O N S T R U C T O R S -----------------------------------
+       */
+       
+public:
+
+       //! \writeme
+       ValueBase();
+
+       //! \writeme
+       template <typename T>
+       ValueBase(const T &x, bool loop_=false):
+               type(TYPE_NIL),data(0),ref_count(0),loop_(loop_)
+               { set(x); }
+
+       //! \writeme
+       ValueBase(Type x);
+
+       //! \writeme
+       ~ValueBase();
+               
+       /*
+ --    ** -- O P E R A T O R S ---------------------------------------------------
+       */
+
+public:
+
+       //! \writeme
+       template <class T> ValueBase& operator=(const T& x)
+               { set(x); return *this; }
+
+       //! \writeme
+       ValueBase& operator=(const ValueBase& x);       
+
+       //! \writeme
+       bool operator==(const ValueBase& rhs)const;
+
+       //! \writeme
+       bool operator!=(const ValueBase& rhs)const { return !operator==(rhs); }
+
+       //!     Constant index operator for when value is of type TYPE_LIST
+       const ValueBase &operator[](int index)const
+               { assert(type==TYPE_LIST); assert(index>0); return get_list()[index]; }
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //! \writeme
+       void clear();
+
+       //! \writeme
+       bool get_loop()const { return loop_; }
+
+       //! \writeme
+       void set_loop(bool x) { loop_=x; }      
+               
+       //! \writeme
+       bool empty()const;
+
+       //! \writeme
+       Type get_contained_type()const;
+       
+       //! Returns true if the contained value is defined and valid.
+       bool is_valid()const;
+
+       //!     Returns a string containing the name of the type
+       String type_name()const { return type_name(type); }
+
+       //! Returns the type of the contained value
+       const Type & get_type()const { return type; }
+       
+       //! Checks the type of the parameter against itself. Returns true if they are of the same type.
+       template <class T> bool
+       same_as(const T &x)const
+       {
+               const Type testtype(get_type(x));
+               
+               if(testtype==type)return true;
+               if(     (type==TYPE_REAL || type==TYPE_TIME) &&
+                       (testtype==TYPE_REAL || testtype==TYPE_TIME) )
+                       return true;
+               return false;
+       }
+       
+       
+       // === GET MEMBERS ========================================================     
+       template <typename T>
+       const T &get(const T& x)const
+       {
+               assert(is_valid() && same_as(x));
+               return *static_cast<const T*>(data);
+       }
+       float get(const float &)const { return get(Real()); }
+       etl::loose_handle<Canvas> get(const etl::handle<Canvas>&)const
+               { return get(etl::loose_handle<Canvas>()); }
+       etl::loose_handle<Canvas> get(Canvas*)const
+               { return get(etl::loose_handle<Canvas>()); }
+       const char* get(const char*)const;
+       const list_type& get_list()const { return get(list_type()); }
+       // ========================================================================
+       
+       
+       
+       // === PUT MEMBERS ========================================================     
+       template <typename T>
+       void put(T* x)const
+       {
+               assert(same_as(*x));
+               *x=*static_cast<const T*>(data);
+       }
+       void put(float* x)const { *x=get(Real()); }
+       void put(char** x)const;
+       // ========================================================================
+
+       
+       
+       // === SET MEMBERS ========================================================     
+       template <typename T> void set(const T& x) { _set(x); }
+       void set(const float &x) { _set(Real(x)); }
+       void set(const list_type &x);
+       void set(const char* x);        
+       void set(Canvas*x);
+       void set(etl::loose_handle<Canvas> x);
+       void set(etl::handle<Canvas> x);
+       template <class T> void set(const std::vector<T> &x)
+               { _set(list_type(x.begin(),x.end())); }
+       template <class T> void set(const std::list<T> &x)
+               { _set(list_type(x.begin(),x.end())); } 
+       // ========================================================================
+
+               
+       /*
+ --    ** -- S T A T I C   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //!     Returns a string containing the name of the given Type
+       static String type_name(Type id);
+
+       //!     Returns a the corresponding Type of the described type
+       static Type ident_type(const String &str);
+
+
+       // === GET TYPE MEMBERS ===================================================     
+       static const Type get_type(bool) { return TYPE_BOOL; }
+       static const Type get_type(int) { return TYPE_INTEGER; }
+       static const Type get_type(const Time&) { return TYPE_TIME; }
+       static const Type get_type(const Real&) { return TYPE_REAL; }
+       static const Type get_type(const float&) { return TYPE_REAL; }
+       static const Type get_type(const Vector&) { return TYPE_VECTOR; }
+       static const Type get_type(const Color&) { return TYPE_COLOR; }
+       static const Type get_type(const Segment&) { return TYPE_SEGMENT; }
+       static const Type get_type(const BLinePoint&) { return TYPE_BLINEPOINT; }
+       static const Type get_type(const String&) { return TYPE_STRING; }
+       static const Type get_type(const Gradient&) { return TYPE_GRADIENT; }
+       static const Type get_type(Canvas*) { return TYPE_CANVAS; }
+       static const Type get_type(const etl::handle<Canvas>&)
+               { return TYPE_CANVAS; }
+       static const Type get_type(const etl::loose_handle<Canvas>&)
+               { return TYPE_CANVAS; } 
+       static const Type get_type(const list_type&) { return TYPE_LIST; }
+       template <class T> static const Type get_type(const std::vector<T> &x)
+               { return TYPE_LIST; }
+       template <class T> static const Type get_type(const std::list<T> &x)
+               { return TYPE_LIST; }
+       // ========================================================================
+
+               
+       /*
+ --    ** -- C A S T   O P E R A T O R S -----------------------------------------
+       */
+
+public:
+
+       template <class T>
+       operator std::list<T>()const
+       {
+               assert(type==TYPE_LIST);
+               std::list<T> ret(get_list().begin(),get_list().end());
+               return ret;
+       }
+       template <class T>
+       operator std::vector<T>()const
+       {
+               assert(type==TYPE_LIST);
+               std::vector<T> ret(get_list().begin(),get_list().end());
+               return ret;
+       }
+       operator const list_type&()const { return get_list(); }
+       //operator const Color&()const { return get(Color()); }
+       //operator const Real&()const { return get(Real()); }
+       //operator const Time&()const { return get(Time()); }
+       
+       operator const Vector&()const {  return get(Vector()); }
+       operator const BLinePoint&()const {  return get(BLinePoint()); }
+       //operator const int&()const {  return get(int()); }
+       //operator const String&()const {  return get(String()); }
+       //operator const char *()const {  return get(String()).c_str(); }
+       operator const Segment&()const { return get(Segment()); }
+
+       /*
+ --    ** -- O T H E R -----------------------------------------------------------
+       */
+
+public:
+
+#ifdef USE_HALF_TYPE
+       half get(const half &)const { return get(Real()); }
+       void put(half*x)const { *x=get(Real()); }
+       void set(const half &x) { _set(Real(x)); }
+       static const Type get_type(const half&) { return TYPE_REAL; }
+       operator half()const { return get(Real()); }
+#endif
+       
+#ifndef SINFG_NO_ANGLE
+       operator const Angle&()const { return get(Angle()); }
+       static const Type get_type(const Angle&) { return TYPE_ANGLE; }
+#endif
+
+       
+private:
+       
+       template <typename T> void
+       _set(const T& x)
+       {
+               const Type newtype(get_type(x));
+               
+               assert(newtype!=TYPE_NIL);
+               
+               if(newtype==type)
+               {
+                       if(ref_count.unique())
+                       {
+                               *reinterpret_cast<T*>(data)=x;
+                               return;
+                       }
+               }
+
+               clear();
+
+               type=newtype;
+               ref_count.reset();
+               data=new T(x);
+       }       
+}; // END of class ValueBase
+
+
+/*!    \class Value
+**     \todo writeme
+*/
+template <class T>
+class Value : public ValueBase
+{
+public:
+       Value(const T &x):ValueBase(x)
+       {
+       }
+       
+       Value(const ValueBase &x):ValueBase(x)
+       {
+               if(!x.same_as(T()))
+                       throw Exception::BadType("Value<T>(ValueBase): Type Mismatch");
+       }
+       
+       Value()
+       {
+       }
+       
+       T get()const { return ValueBase::get(T()); }
+
+       void put(T* x)const     { ValueBase::put(x); }
+       
+       void set(const T& x) { ValueBase::operator=(x); }
+
+       Value<T>& operator=(const T& x) { set(x); return *this; }
+
+       Value<T>& operator=(const Value<T>& x) { return ValueBase::operator=(x); }
+
+       Value<T>& operator=(const ValueBase& x)
+       {
+               if(!x.same_as(T()))
+                       throw Exception::BadType("Value<T>(ValueBase): Type Mismatch");
+               return ValueBase::operator=(x);
+       }
+       
+}; // END of class Value
+
+/*
+template <>
+class Value< std::list<CT> > : public ValueBase
+{
+public:
+       Value(const T &x):ValueBase(x)
+       {
+       }
+       Value(const ValueBase &x):ValueBase(x)
+       {
+               if(!x.same_as(T()))
+                       throw Exception::BadType("Value<T>(ValueBase): Type Mismatch");
+       }
+       Value()
+       {
+       }
+       
+       T get()const { return ValueBase::get(T()); }
+
+       void put(T* x)const     { ValueBase::put(x); }
+       
+       void set(const T& x) { ValueBase::operator=(x); }
+
+       Value<T>& operator=(const T& x) { set(x); return *this; }
+
+       Value<T>& operator=(const Value<T>& x) { return ValueBase::operator=(x); }
+
+       Value<T>& operator=(const ValueBase& x)
+       {
+               if(!x.same_as(T()))
+                       throw Exception::BadType("Value<T>(ValueBase): Type Mismatch");
+               return ValueBase::operator=(x);
+       }
+       
+}; // END of class Value
+*/
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode.cpp b/synfig-core/trunk/src/synfig/valuenode.cpp
new file mode 100644 (file)
index 0000000..5358530
--- /dev/null
@@ -0,0 +1,501 @@
+/* === S I N F G =========================================================== */
+/*!    \file value_node.cpp
+**     \brief Template File
+**
+**     $Id: valuenode.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#define SINFG_NO_ANGLE
+
+//#define HAS_HASH_MAP 1
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode.h"
+#include "general.h"
+#include "canvas.h"
+
+#include "valuenode_const.h"
+#include "valuenode_linear.h"
+#include "valuenode_composite.h"
+#include "valuenode_reference.h"
+#include "valuenode_scale.h"
+#include "valuenode_segcalctangent.h"
+#include "valuenode_segcalcvertex.h"
+#include "valuenode_stripes.h"
+#include "valuenode_subtract.h"
+#include "valuenode_timedswap.h"
+#include "valuenode_twotone.h"
+#include "valuenode_bline.h"
+#include "valuenode_dynamiclist.h"
+#include "valuenode_radialcomposite.h"
+#include "valuenode_gradientrotate.h"
+#include "valuenode_sine.h"
+
+#include "layer.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+static int value_node_count(0);
+
+static LinkableValueNode::Book *book_;
+
+
+ValueNode::LooseHandle
+sinfg::find_value_node(const GUID& guid)
+{
+       return guid_cast<ValueNode>(guid);
+}
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+bool
+ValueNode::subsys_init()
+{
+       book_=new LinkableValueNode::Book();
+
+#define ADD_VALUENODE(c,n) (*book_)[n].factory=reinterpret_cast<LinkableValueNode::Factory>(&c::create); (*book_)[n].check_type=&c::check_type;(*book_)[n].local_name=n
+#define ADD_VALUENODE2(c,n) (*book_)[n].factory=reinterpret_cast<LinkableValueNode::Factory>(&c::create_from); (*book_)[n].check_type=&c::check_type;(*book_)[n].local_name=n
+
+       ADD_VALUENODE(ValueNode_Linear,"linear");
+       ADD_VALUENODE(ValueNode_Composite,"composite");
+       ADD_VALUENODE(ValueNode_RadialComposite,"radial_composite");
+       ADD_VALUENODE(ValueNode_Reference,"reference");
+       ADD_VALUENODE(ValueNode_Scale,"scale");
+       ADD_VALUENODE(ValueNode_SegCalcTangent,"segcalctangent");
+       ADD_VALUENODE(ValueNode_SegCalcVertex,"segcalcvertex");
+       ADD_VALUENODE(ValueNode_Stripes,"stripes");
+       ADD_VALUENODE(ValueNode_Subtract,"subtract");
+       //ADD_VALUENODE(ValueNode_TimedSwap,"timed_swap");
+       ADD_VALUENODE(ValueNode_TwoTone,"twotone");
+       ADD_VALUENODE(ValueNode_BLine,"bline");
+       ADD_VALUENODE2(ValueNode_DynamicList,"dynamic_list");
+       ADD_VALUENODE(ValueNode_GradientRotate,"gradient_rotate");
+       ADD_VALUENODE(ValueNode_Sine,"sine");
+       
+#undef ADD_VALUENODE
+       return true;
+}
+
+bool
+ValueNode::subsys_stop()
+{
+       delete book_;
+/*     if(global_value_node_map.size() || value_node_count)
+       {
+               if(value_node_count)
+                       sinfg::error("%d ValueNodes haven't been destroyed yet!",value_node_count);
+
+               if(global_value_node_map.size()!=value_node_count)
+                       sinfg::error("value node count mismatch! map.size()!=value_node_count (%d!=%d)",global_value_node_map.size(),value_node_count);
+               
+               GlobalValueNodeMap::iterator iter;              
+               for(iter=global_value_node_map.begin();iter!=global_value_node_map.end();++iter)
+               {
+                       if(!iter->second->is_exported())
+                               sinfg::info("%s: count:%d name:%s type:%s",
+                                       iter->first.get_string().c_str(),
+                                       iter->second->count(),
+                                       iter->second->get_name().c_str(),
+                                       ValueBase::type_name(iter->second->get_type()).c_str()
+                               );
+                       else
+                               sinfg::info("%s: id:%s count:%d name:%s type:%s",
+                                       iter->first.get_string().c_str(),
+                                       iter->second->get_id().c_str(),
+                                       iter->second->count(),
+                                       iter->second->get_name().c_str(),
+                                       ValueBase::type_name(iter->second->get_type()).c_str()
+                               );
+               }
+       }
+*/
+       return true;
+}
+
+ValueNode::ValueNode(ValueBase::Type type):type(type)
+{
+       value_node_count++;
+}
+
+LinkableValueNode::Book&
+LinkableValueNode::book()
+{
+       return *book_;
+}
+
+LinkableValueNode::Handle
+LinkableValueNode::create(const String &name, const ValueBase& x)
+{
+       if(!book().count(name))
+               return 0;
+       return book()[name].factory(x);
+}
+
+bool
+LinkableValueNode::check_type(const String &name, ValueBase::Type x)
+{
+       if(!book().count(name) || !book()[name].check_type)
+               return false;
+       return book()[name].check_type(x);
+}
+
+bool
+LinkableValueNode::set_link(int i,ValueNode::Handle x)
+{
+       ValueNode::Handle previous(get_link(i));
+       
+       if(set_link_vfunc(i,x))
+       {
+               if(previous)
+                       remove_child(previous.get());
+               add_child(x.get());
+               
+               if(!x->is_exported() && get_parent_canvas())
+               {
+                       x->set_parent_canvas(get_parent_canvas());
+               }
+               changed();
+               return true;
+       }
+       return false;
+}
+
+ValueNode::LooseHandle
+LinkableValueNode::get_link(int i)const
+{
+       return get_link_vfunc(i);
+}
+
+void
+LinkableValueNode::unlink_all()
+{
+       for(int i=0;i<link_count();i++)
+       {
+               ValueNode::LooseHandle value_node(get_link(i));
+               if(value_node)
+                       value_node->parent_set.erase(this);
+       }
+}
+
+ValueNode::~ValueNode()
+{
+       value_node_count--;
+       
+       begin_delete();
+
+       //DEBUGPOINT();
+}
+
+void
+ValueNode::on_changed()
+{
+       if(get_parent_canvas())
+               get_parent_canvas()->signal_value_node_changed()(this);
+       else if(get_root_canvas() && get_parent_canvas())
+               get_root_canvas()->signal_value_node_changed()(this);
+       
+       Node::on_changed();
+}
+
+int
+ValueNode::replace(etl::handle<ValueNode> x)
+{
+       if(x.get()==this)
+               return 0;
+       
+       while(parent_set.size())
+       {
+               (*parent_set.begin())->add_child(x.get());
+               (*parent_set.begin())->remove_child(this);
+               //x->parent_set.insert(*parent_set.begin());
+               //parent_set.erase(parent_set.begin());
+       }
+       int r(RHandle(this).replace(x));
+       x->changed();
+       return r;
+}
+
+void
+ValueNode::set_id(const String &x)
+{
+       if(name!=x)
+       {
+               name=x;
+               signal_id_changed_();
+       }
+}
+
+ValueNodeList::ValueNodeList():
+       placeholder_count_(0)
+{
+}
+
+bool
+ValueNodeList::count(const String &id)const
+{
+       const_iterator iter;
+
+       if(id.empty())
+               return false;
+
+       for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
+
+       if(iter==end())
+               return false;
+
+       return true;
+}
+
+ValueNode::Handle
+ValueNodeList::find(const String &id)
+{
+       iterator iter;
+
+       if(id.empty())
+               throw Exception::IDNotFound("Empty ID");
+
+       for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
+
+       if(iter==end())
+               throw Exception::IDNotFound("ValueNode in ValueNodeList: "+id);
+
+       return *iter;
+}
+
+ValueNode::ConstHandle
+ValueNodeList::find(const String &id)const
+{
+       const_iterator iter;
+
+       if(id.empty())
+               throw Exception::IDNotFound("Empty ID");
+
+       for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
+
+       if(iter==end())
+               throw Exception::IDNotFound("ValueNode in ValueNodeList: "+id);
+
+       return *iter;
+}
+
+ValueNode::Handle
+ValueNodeList::surefind(const String &id)
+{
+       if(id.empty())
+               throw Exception::IDNotFound("Empty ID");
+       
+       ValueNode::Handle value_node;
+       
+       try
+       {
+               value_node=find(id);
+       }
+       catch(Exception::IDNotFound)
+       {
+               value_node=PlaceholderValueNode::create();
+               value_node->set_id(id);
+               push_back(value_node);
+               placeholder_count_++;
+       }
+
+       return value_node;
+}
+
+bool
+ValueNodeList::erase(ValueNode::Handle value_node)
+{
+       assert(value_node);
+
+       iterator iter;
+
+       for(iter=begin();iter!=end();++iter)
+               if(value_node.get()==iter->get())
+               {
+                       std::list<ValueNode::RHandle>::erase(iter);
+                       if(PlaceholderValueNode::Handle::cast_dynamic(value_node))
+                               placeholder_count_--;
+                       return true;
+               }
+       return false;
+}
+
+bool
+ValueNodeList::add(ValueNode::Handle value_node)
+{
+       if(!value_node)
+               return false;
+       if(value_node->get_id().empty())
+               return false;
+
+       try
+       {
+               ValueNode::RHandle other_value_node=find(value_node->get_id());
+               if(PlaceholderValueNode::Handle::cast_dynamic(other_value_node))
+               {
+                       other_value_node->replace(value_node);
+                       placeholder_count_--;
+                       return true;
+               }
+
+               return false;
+       }
+       catch(Exception::IDNotFound)
+       {       
+               push_back(value_node);
+               return true;
+       }
+       
+       return false;
+}
+
+void
+ValueNodeList::audit()
+{
+       iterator iter,next;
+
+       for(next=begin(),iter=next++;iter!=end();iter=next++)
+               if(iter->count()==1)
+                       std::list<ValueNode::RHandle>::erase(iter);
+}
+
+
+String
+PlaceholderValueNode::get_name()const
+{
+       return "placeholder";
+}
+
+String
+PlaceholderValueNode::get_local_name()const
+{
+       return _("Placeholder");
+}
+
+ValueNode*
+PlaceholderValueNode::clone(const GUID& deriv_guid)const
+{
+       ValueNode* ret(new PlaceholderValueNode());
+       ret->set_guid(get_guid()^deriv_guid);
+       return ret;
+}
+
+PlaceholderValueNode::Handle
+PlaceholderValueNode::create(ValueBase::Type type)
+{
+       return new PlaceholderValueNode(type);
+}
+
+ValueBase
+PlaceholderValueNode::operator()(Time t)const
+{
+       assert(0);
+       return ValueBase();
+}
+
+PlaceholderValueNode::PlaceholderValueNode(ValueBase::Type type):
+       ValueNode(type)
+{
+}
+
+ValueNode*
+LinkableValueNode::clone(const GUID& deriv_guid)const
+{
+       { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
+
+       int i;
+       LinkableValueNode *ret=create_new();
+       ret->set_guid(get_guid()^deriv_guid);
+       
+       for(i=0;i<link_count();i++)
+       {
+               ValueNode::Handle link=get_link_vfunc(i);
+               if(!link->is_exported())
+               {
+                       ValueNode::LooseHandle value_node(find_value_node(link->get_guid()^deriv_guid));
+                       if(!value_node)
+                               value_node=link->clone(deriv_guid);
+                       ret->set_link(i,value_node);
+               }
+               else
+                       ret->set_link(i,link);
+       }
+
+       return ret;
+}
+
+String
+ValueNode::get_relative_id(etl::loose_handle<const Canvas> x)const
+{
+       assert(is_exported());
+       assert(canvas_);
+       
+       if(x.get()==canvas_.get())
+               return get_id();
+       
+       return canvas_->_get_relative_id(x)+':'+get_id();
+}
+
+void
+ValueNode::set_parent_canvas(etl::loose_handle<Canvas> x)
+{
+       canvas_=x; if(x) root_canvas_=x->get_root();
+}
+
+void
+ValueNode::set_root_canvas(etl::loose_handle<Canvas> x)
+{
+       root_canvas_=x->get_root();
+}
+
+void LinkableValueNode::get_times_vfunc(Node::time_set &set) const
+{
+       ValueNode::LooseHandle  h;
+       
+       int size = link_count();
+               
+       //just add it to the set...
+       for(int i=0; i < size; ++i)
+       {
+               h = get_link(i);
+
+               if(h)
+               {
+                       const Node::time_set &tset = h->get_times();
+                       set.insert(tset.begin(),tset.end());
+               }
+       }
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode.h b/synfig-core/trunk/src/synfig/valuenode.h
new file mode 100644 (file)
index 0000000..a9d9f89
--- /dev/null
@@ -0,0 +1,386 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode.h
+**     \brief Template Header
+**
+**     $Id: valuenode.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_H
+#define __SINFG_VALUENODE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "vector.h"
+#include "value.h"
+#include "string.h"
+#include <ETL/handle>
+#include <ETL/stringf>
+#include "exception.h"
+#include <map>
+#include <sigc++/signal.h>
+#include "guid.h"
+
+#ifndef SINFG_NO_ANGLE
+#include <ETL/angle>
+#endif
+
+#include "node.h"
+
+#include <set>
+
+/* === M A C R O S ========================================================= */
+
+// This is a hack for GCC 3.0.4... which has a broken dynamic_cast<>
+// It is deprecated, and will be removed soon.
+#if ( __GNUC__ == 3 ) && ( __GNUC__MINOR__ == 0 )
+# define DCAST_HACK_BASECLASS()        int cast__
+# define DCAST_HACK_ID(x)              static const int my_cast__(void) { return x; }
+# define DCAST_HACK_ENABLE()   cast__=my_cast__()
+#else
+# define DCAST_HACK_BASECLASS()
+# define DCAST_HACK_ID(x)
+# define DCAST_HACK_ENABLE()
+#endif
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class Canvas;
+class LinkableValueNode;
+class Layer;
+       
+/*!    \class ValueNode
+**     \todo writeme
+*/
+class ValueNode : public sinfg::Node
+{
+       friend class Layer;
+       friend class LinkableValueNode;
+               
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public:
+
+       typedef etl::handle<ValueNode> Handle;
+
+       typedef etl::loose_handle<ValueNode> LooseHandle;
+
+       typedef etl::handle<const ValueNode> ConstHandle;
+
+       typedef etl::rhandle<ValueNode> RHandle;
+
+
+       static bool subsys_init();
+
+       static bool subsys_stop();
+
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+
+private:
+       ValueBase::Type type;
+       String name;
+       etl::loose_handle<Canvas> canvas_;
+       etl::loose_handle<Canvas> root_canvas_;
+       
+       /*
+ -- ** -- S I G N A L S -------------------------------------------------------
+       */
+
+private:
+
+       //!     ValueBase Changed
+       sigc::signal<void> signal_value_changed_;       
+
+       //!     Children Reordered
+       sigc::signal<void,int*> signal_children_reordered_;     
+
+       //!     Child Changed
+       sigc::signal<void,int> signal_child_changed_;   
+
+       //!     Child Removed
+       sigc::signal<void,int> signal_child_removed_;   
+
+       //!     Child Inserted
+       sigc::signal<void,int> signal_child_inserted_;  
+
+       //!     ID Changed
+       sigc::signal<void> signal_id_changed_;  
+
+       /*
+ -- ** -- S I G N A L   I N T E R F A C E -------------------------------------
+       */
+
+public:
+
+       //!     ValueBase Changed
+       sigc::signal<void>& signal_value_changed() { return signal_value_changed_; }
+
+       //!     Children Reordered
+       sigc::signal<void,int*>& signal_children_reordered() { return signal_children_reordered_; }
+
+       //!     Child Changed
+       sigc::signal<void,int>& signal_child_changed() { return signal_child_changed_; }
+
+       //!     Child Removed
+       sigc::signal<void,int>& signal_child_removed() { return signal_child_removed_; }
+
+       //!     Child Inserted
+       sigc::signal<void,int>& signal_child_inserted() { return signal_child_inserted_; }
+
+       //!     ID Changed
+       sigc::signal<void>& signal_id_changed() { return signal_id_changed_; }
+
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+protected:
+       
+       ValueNode(ValueBase::Type type=ValueBase::TYPE_NIL);
+
+public:
+
+       virtual ~ValueNode();
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       //! Returns the value of the ValueNode at time \a t
+       virtual ValueBase operator()(Time t)const
+               { return ValueBase(); }
+
+       //! \internal Sets the id of the ValueNode
+       void set_id(const String &x);
+
+       //! Returns the id of the ValueNode
+       /*!     The ID is used for keeping track of a
+       **      specific instance of a ValueNode. */
+       const String &get_id()const { return name; }
+
+       //! Returns the name of the ValueNode type
+       virtual String get_name()const=0;
+
+       //! Returns the localized name of the ValueNode type
+       virtual String get_local_name()const=0;
+
+
+       //! \writeme
+       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const=0;
+
+       //! \writeme
+       bool is_exported()const { return !get_id().empty(); }
+       
+       //! Returns the type of the ValueNode
+       ValueBase::Type get_type()const { return type; }
+
+       //! Returns a handle to the parent canvas, if it has one.
+       etl::loose_handle<Canvas> get_parent_canvas()const { return canvas_; }
+
+       //! Returns a handle to the parent canvas, if it has one.
+       etl::loose_handle<Canvas> get_root_canvas()const { return root_canvas_; }
+       
+       //! \writeme
+       void set_parent_canvas(etl::loose_handle<Canvas> x);
+
+       //! \writeme
+       void set_root_canvas(etl::loose_handle<Canvas> x);
+       
+       //! \writeme
+       String get_relative_id(etl::loose_handle<const Canvas> x)const;
+       
+       int replace(etl::handle<ValueNode> x);
+       
+protected:
+       //! Sets the type of the ValueNode
+       void set_type(ValueBase::Type t) { type=t; }
+
+       virtual void on_changed();
+       
+public:
+       DCAST_HACK_BASECLASS();
+       DCAST_HACK_ID(0);
+}; // END of class ValueNode
+
+/*!    \class PlaceholderValueNode
+**     \todo writeme
+*/
+class PlaceholderValueNode : public ValueNode
+{
+public:
+       typedef etl::handle<PlaceholderValueNode> Handle;
+       typedef etl::loose_handle<PlaceholderValueNode> LooseHandle;
+       typedef etl::handle<const PlaceholderValueNode> ConstHandle;
+       typedef etl::rhandle<PlaceholderValueNode> RHandle;
+
+private:
+
+       PlaceholderValueNode(ValueBase::Type type=ValueBase::TYPE_NIL);
+
+public:
+       
+       virtual ValueBase operator()(Time t)const;
+
+       virtual String get_name()const;
+
+       virtual String get_local_name()const;
+
+       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
+
+       static Handle create(ValueBase::Type type=ValueBase::TYPE_NIL);
+
+protected:
+       virtual void get_times_vfunc(Node::time_set &set) const {}
+}; // END of class PlaceholderValueNode
+
+
+/*!    \class LinkableValueNode
+**     \todo writeme
+*/
+class LinkableValueNode : public ValueNode
+{
+       friend class ValueNode;
+public:
+
+       typedef etl::handle<LinkableValueNode> Handle;
+
+       typedef etl::loose_handle<LinkableValueNode> LooseHandle;
+
+       typedef etl::handle<const LinkableValueNode> ConstHandle;
+
+       typedef etl::rhandle<LinkableValueNode> RHandle;
+
+
+       //! Type that represents a pointer to a ValueNode's constructor
+       typedef LinkableValueNode* (*Factory)(const ValueBase&);
+
+       typedef bool (*CheckType)(ValueBase::Type);
+
+       struct BookEntry
+       {
+               String local_name;
+               Factory factory;
+               CheckType check_type;           
+       };
+       
+       typedef std::map<String,BookEntry> Book;
+
+       static Book& book();
+
+       static Handle create(const String &name, const ValueBase& x);
+
+       static bool check_type(const String &name, ValueBase::Type x);
+
+public:
+       LinkableValueNode(ValueBase::Type type=ValueBase::TYPE_NIL):
+               ValueNode(type) { }
+
+protected:
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x)=0;
+
+       void unlink_all();
+
+public:
+       
+       virtual int link_count()const=0;
+
+       virtual String link_local_name(int i)const=0;
+
+       virtual String link_name(int i)const=0;
+
+       virtual int get_link_index_from_name(const String &name)const=0;
+               
+       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
+
+       bool set_link(int i,ValueNode::Handle x);
+       bool set_link(const String &name,ValueNode::Handle x) { return set_link(get_link_index_from_name(name),x);      }               
+               
+       ValueNode::LooseHandle get_link(int i)const;
+       ValueNode::LooseHandle get_link(const String &name)const { return get_link(get_link_index_from_name(name)); }
+
+protected:
+       //! Sets the type of the ValueNode
+       void set_type(ValueBase::Type t) { ValueNode::set_type(t); }
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const=0;
+
+       // Wrapper for new operator, used by clone()
+       virtual LinkableValueNode* create_new()const=0;
+       
+       virtual void get_times_vfunc(Node::time_set &set) const;
+}; // END of class LinkableValueNode
+
+/*!    \class ValueNodeList
+**     \brief A searchable value_node list container
+**     \warning Do not confuse with ValueNode_DynamicList!
+**     \todo writeme
+*/
+class ValueNodeList : public std::list<ValueNode::RHandle>
+{
+       int placeholder_count_;
+public:
+       ValueNodeList();
+
+       //! Finds the ValueNode in the list with the given \a name
+       /*!     \return If found, returns a handle to the ValueNode.
+       **              Otherwise, returns an empty handle.
+       */
+       ValueNode::Handle find(const String &name);
+
+       //! Finds the ValueNode in the list with the given \a name
+       /*!     \return If found, returns a handle to the ValueNode.
+       **              Otherwise, returns an empty handle.
+       */
+       ValueNode::ConstHandle find(const String &name)const;
+
+       //! Removes the \a value_node from the list
+       bool erase(ValueNode::Handle value_node);
+
+       //! \writeme
+       bool add(ValueNode::Handle value_node);
+
+       //! \writeme
+       bool count(const String &id)const;
+
+       //! Similar to find, but will create a placeholder value_node if it cannot be found.
+       ValueNode::Handle surefind(const String &name);
+
+       //! Removes any value_nodes with reference counts of 1.
+       void audit();
+       
+       //! Placeholder Count
+       int placeholder_count()const { return placeholder_count_; }
+};
+
+ValueNode::LooseHandle find_value_node(const GUID& guid);
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_animated.cpp b/synfig-core/trunk/src/synfig/valuenode_animated.cpp
new file mode 100644 (file)
index 0000000..85ee428
--- /dev/null
@@ -0,0 +1,1174 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_animated.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_animated.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include <vector>
+#include <list>
+#include <stdexcept>
+
+#include <cmath>
+
+#include <ETL/bezier>
+#include <ETL/hermite>
+#include <ETL/spline>
+#include <ETL/handle>
+#include <ETL/misc>
+
+#include <algorithm>
+#include <typeinfo>
+
+#include "canvas.h"
+#include "general.h"
+#include "valuenode_animated.h"
+#include "valuenode_const.h"
+#include "exception.h"
+#include "gradient.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+// Fast binary search implementation
+/*
+template<typename I, typename T> inline I
+binary_find(I begin, I end, const T& value)
+{
+       I iter(begin+(end-begin)/2);
+       
+       while(end-begin>1 && !(*iter==value))
+       {
+               ((*iter<value)?begin:end) = iter;
+               
+               iter = begin+(end-begin)/2;
+       }
+       return iter;
+}
+*/
+
+/*
+template<typename T> String tangent_info(T a, T b, T v)
+{
+       return "...";
+}
+
+String tangent_info(Vector a, Vector b, Vector v)
+{
+       if(a==b)
+               return strprintf("(should be zero) T=[%f,%f], Pp=[%f,%f], Pn=[%f,%f]",v[0],v[1],a[0],a[1],b[0],b[1]);
+       else
+               return strprintf("(should NOT be zero) T=[%f,%f], Pp=[%f,%f], Pn=[%f,%f]",v[0],v[1],a[0],a[1],b[0],b[1]);
+}
+*/
+
+template <class T>
+struct subtractor : public std::binary_function<T, T, T>
+{
+       T operator()(const T &a,const T &b)const
+       {
+               return a-b;
+       }
+};
+
+template <>
+struct subtractor<Angle> : public std::binary_function<Angle, Angle, Angle>
+{
+       Angle operator()(const Angle &a,const Angle &b)const
+       {
+               return a.dist(b);
+       }
+};
+
+template <class T>
+struct magnitude : public std::unary_function<float, T>
+{
+       float operator()(const T &a)const
+       {
+               return abs(a);
+       }
+};
+
+template <>
+struct magnitude<Angle> : public std::unary_function<float, Angle>
+{
+       float operator()(const Angle &a)const
+       {
+               return abs(Angle::rad(a).get());
+       }
+};
+
+template <>
+struct magnitude<Vector> : public std::unary_function<float, Vector>
+{
+       float operator()(const Vector &a)const
+       {
+               return a.mag();
+       }
+};
+
+template <>
+struct magnitude<Color> : public std::unary_function<float, Color>
+{
+       float operator()(const Color &a)const
+       {
+               return abs(a.get_y());
+       }
+};
+
+
+
+
+
+template <class T>
+struct is_angle_type
+{
+       bool operator()()const
+       {
+               return false;
+       }
+};
+
+template <>
+struct is_angle_type<Angle>
+{
+       bool operator()()const
+       {
+               return true;
+       }
+};
+
+/* === G L O B A L S ======================================================= */
+
+/* === C L A S S E S ======================================================= */
+
+template<typename T>
+class _Hermite : public sinfg::ValueNode_Animated
+{
+public:
+       typedef T value_type;
+       affine_combo<value_type,Time> affine_combo_func;
+       subtractor<value_type>  subtract_func;
+       magnitude<value_type>   magnitude_func;
+       is_angle_type<value_type>       is_angle;
+private:
+       struct PathSegment
+       {
+               is_angle_type<value_type>       is_angle;
+               subtractor<value_type>  subtract_func;
+               
+               mutable hermite<Time,Time> first;
+               mutable hermite<value_type,Time> second;
+               WaypointList::iterator start;
+               WaypointList::iterator end;
+               
+               value_type resolve(const Time &t)const
+               {
+                       bool start_static(start->is_static());
+                       bool end_static(end->is_static());
+                       
+                       if(!start_static || !end_static)
+                       {
+                               //if(!start_static)
+                                       second.p1()=start->get_value(t).get(value_type());                                      
+                               if(start->get_after()==INTERPOLATION_CONSTANT || end->get_before()==INTERPOLATION_CONSTANT)
+                                       return second.p1();
+                               //if(!end_static)
+                                       second.p2()=end->get_value(t).get(value_type());
+
+                               // At the moment, the only type of non-constant interpolation
+                               // that we support is linear.
+                               second.t1()=
+                               second.t2()=subtract_func(second.p2(),second.p1());
+                               
+                               second.sync();
+                       }
+
+                       return second(first(t));
+               }
+       };
+       typedef vector <
+               PathSegment
+               /*
+               pair <
+                       hermite<Time,Time>,
+                       hermite<value_type,Time>
+               >
+               */
+       > curve_list_type;
+
+       curve_list_type curve_list;
+               
+       // Bounds of this curve
+       Time r,s;
+       
+public:
+       ValueNode* clone(const GUID& deriv_guid)const
+       {
+               { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
+               _Hermite<T>* ret(new _Hermite<T>());
+               ret->set_guid(get_guid()^deriv_guid);
+               for(WaypointList::const_iterator iter=waypoint_list().begin();iter!=waypoint_list().end();++iter)
+                       ret->add(iter->clone(deriv_guid));
+               return ret;
+       }
+
+       _Hermite()
+       {
+               set_type(ValueBase(value_type()).get_type());
+       }
+
+       virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)
+       {
+               // Make sure we are getting data of the correct type
+               //if(data.type!=type)
+               //      return waypoint_list_type::iterator();
+               
+               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
+               Waypoint waypoint(value,t);
+               waypoint.set_parent_value_node(this);
+               
+               waypoint_list_.push_back(waypoint);
+               WaypointList::iterator ret=waypoint_list_.end();
+               --ret;
+               
+               if(is_angle())
+               {
+                       ret->set_before(INTERPOLATION_LINEAR);
+                       ret->set_after(INTERPOLATION_LINEAR);
+               }
+               
+               changed();
+               
+               return ret;
+       }
+
+       virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)
+       {
+               // Make sure we are getting data of the correct type
+               //if(data.type!=type)
+               //      return waypoint_list_type::iterator();
+               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
+               
+               Waypoint waypoint(value_node,t);
+               waypoint.set_parent_value_node(this);
+               
+               waypoint_list_.push_back(waypoint);
+               WaypointList::iterator ret=waypoint_list_.end();
+               --ret;
+
+               if(is_angle())
+               {
+                       ret->set_before(INTERPOLATION_LINEAR);
+                       ret->set_after(INTERPOLATION_LINEAR);
+               }
+
+               changed();
+               
+               return ret;
+       }
+       
+       virtual void on_changed()
+       {
+               ValueNode_Animated::on_changed();
+               
+               if(waypoint_list_.size()<=1)
+                       return;
+               std::sort(waypoint_list_.begin(),waypoint_list_.end());
+               //waypoint_list_.sort();
+
+               r=waypoint_list_.front().get_time();
+               s=waypoint_list_.back().get_time();
+               
+               curve_list.clear();
+               
+               WaypointList::iterator prev,iter,next=waypoint_list_.begin();
+               int i=0;
+               
+               for(iter=next++;iter!=waypoint_list_.end() && next!=waypoint_list_.end();prev=iter,iter=next++,i++)
+               {
+                       typename curve_list_type::value_type curve;
+                       WaypointList::iterator after_next(next);
+                       ++after_next;
+
+                       curve.start=iter;
+                       curve.end=next;
+                       
+                       // Set up the positions
+                       curve.first.set_rs(iter->get_time(), next->get_time());
+                       curve.second.set_rs(iter->get_time(), next->get_time());
+                       
+                       Waypoint::Interpolation iter_get_after(iter->get_after());
+                       Waypoint::Interpolation next_get_after(next->get_after());
+                       Waypoint::Interpolation iter_get_before(iter->get_before());
+                       Waypoint::Interpolation next_get_before(next->get_before());
+                       
+                       if(is_angle())
+                       {
+                               if(iter_get_after==INTERPOLATION_TCB)
+                                       iter_get_after=INTERPOLATION_LINEAR;
+                               if(next_get_after==INTERPOLATION_TCB)
+                                       next_get_after=INTERPOLATION_LINEAR;
+                               if(iter_get_before==INTERPOLATION_TCB)
+                                       iter_get_before=INTERPOLATION_LINEAR;
+                               if(next_get_before==INTERPOLATION_TCB)
+                                       next_get_before=INTERPOLATION_LINEAR;
+                       }
+                       
+                       if(iter->is_static() && next->is_static())
+                       {
+                               curve.second.p1()=iter->get_value().get(T());
+                               curve.second.p2()=next->get_value().get(T());
+                               if(iter_get_after==INTERPOLATION_CONSTANT || next_get_before==INTERPOLATION_CONSTANT)
+                               {
+                                       // Sections must be constant on both sides.
+                                       // NOTE: this is commented out because of some
+                                       // user interface issues. Namely, if a section is
+                                       // constant and the user turns off the constant on
+                                       // one waypoint, this will end up turning it back on.
+                                       // Confusing.
+                                       //iter->get_after()=next->get_before()=INTERPOLATION_CONSTANT;
+                                       curve.second.p1()=
+                                       curve.second.p2()=iter->get_value().get(T());
+                                       curve.second.t1()=
+                                       curve.second.t2()=subtract_func(curve.second.p1(),curve.second.p2());
+                               }
+                               else
+                               {
+                                       if(iter_get_after==INTERPOLATION_TCB && iter!=waypoint_list_.begin() && !is_angle())
+                                       {
+                                               if(iter->get_before()!=INTERPOLATION_TCB && !curve_list.empty())
+                                               {
+                                                       curve.second.t1()=curve_list.back().second.t2();
+                                               }
+                                               else
+                                               {
+
+                                               const Real& t(iter->get_tension());             // Tension
+                                               const Real& c(iter->get_continuity());  // Continuity
+                                               const Real& b(iter->get_bias());                        // Bias
+                                               
+                                               // The folloing line works where the previous line fails.
+                                               value_type Pp; Pp=curve_list.back().second.p1();        // P_{i-1}
+                                               
+                                               const value_type& Pc(curve.second.p1());        // P_i
+                                               const value_type& Pn(curve.second.p2());        // P_{i+1}
+                                               
+                                               // TCB
+                                               value_type vect(static_cast<value_type>(subtract_func(Pc,Pp)*(((1.0-t)*(1.0+c)*(1.0+b))/2.0)+(Pn-Pc)*(((1.0-t)*(1.0-c)*(1.0-b))/2.0)));
+                                               
+                                               // Tension Only
+                                               //value_type vect=(value_type)((Pn-Pp)*(1.0-t));
+                                               
+                                               // Linear
+                                               //value_type vect=(value_type)(Pn-Pc);
+
+                                               // Debugging stuff
+                                               //sinfg::info("%d:t1: %s",i,tangent_info(Pp,Pn,vect).c_str());
+       
+                                               // Adjust for time
+                                               //vect=value_type(vect*(curve.second.get_dt()*2.0)/(curve.second.get_dt()+curve_list.back().second.get_dt()));
+                                               //vect=value_type(vect*(curve.second.get_dt())/(curve_list.back().second.get_dt()));
+       
+                                               curve.second.t1()=vect;
+                                               }
+                                       }
+                                       else if(
+                                               iter_get_after==INTERPOLATION_LINEAR || iter_get_after==INTERPOLATION_HALT ||
+                                               (iter_get_after==INTERPOLATION_TCB && iter==waypoint_list_.begin()))
+                                       {
+                                               curve.second.t1()=subtract_func(curve.second.p2(),curve.second.p1());
+                                       }
+
+                                       if(iter_get_before==INTERPOLATION_TCB && iter->get_after()!=INTERPOLATION_TCB && !curve_list.empty())
+                                       {
+                                               curve_list.back().second.t2()=curve.second.t1();
+                                               curve_list.back().second.sync();
+                                       }
+
+                                       
+                                       if(next_get_before==INTERPOLATION_TCB && after_next!=waypoint_list_.end()  && !is_angle())
+                                       {
+                                               const Real &t(next->get_tension());             // Tension
+                                               const Real &c(next->get_continuity());  // Continuity
+                                               const Real &b(next->get_bias());                        // Bias
+                                               const value_type &Pp(curve.second.p1());        // P_{i-1}
+                                               const value_type &Pc(curve.second.p2());        // P_i
+                                               value_type Pn; Pn=after_next->get_value().get(T());     // P_{i+1}
+                                               
+                                               // TCB
+                                               value_type vect(static_cast<value_type>(subtract_func(Pc,Pp)*(((1.0-t)*(1.0-c)*(1.0+b))/2.0)+(Pn-Pc)*(((1.0-t)*(1.0+c)*(1.0-b))/2.0)));
+
+                                               // Tension Only
+                                               //value_type vect((value_type)((Pn-Pp)*(1.0-t)));
+                                               
+                                               // Linear
+                                               //value_type vect=(value_type)(Pc-Pp);
+
+                                               // Debugging stuff
+                                               //sinfg::info("%d:t2: %s",i,tangent_info(Pp,Pn,vect).c_str());
+
+                                               // Adjust for time
+                                               //vect=value_type(vect*(curve.second.get_dt()*2.0)/(curve.second.get_dt()+(after_next->get_time()-next->get_time())));
+                                               //vect=value_type(vect*(curve.second.get_dt()/((after_next->get_time()-next->get_time()))));
+
+                                               curve.second.t2()=vect;
+                                       }
+                                       else if(
+                                               next_get_before==INTERPOLATION_LINEAR || next_get_before==INTERPOLATION_HALT ||
+                                               (next_get_before==INTERPOLATION_TCB && after_next==waypoint_list_.end()))
+                                       {
+                                               curve.second.t2()=subtract_func(curve.second.p2(),curve.second.p1());
+                                       }
+
+                                       // Adjust for time
+                                       const float timeadjust(0.5);
+                                       
+                                       if(!curve_list.empty())
+                                               curve.second.t1()*=(curve.second.get_dt()*(timeadjust+1))/(curve.second.get_dt()*timeadjust+curve_list.back().second.get_dt());
+                                       if(after_next!=waypoint_list_.end())
+                                               curve.second.t2()*=(curve.second.get_dt()*(timeadjust+1))/(curve.second.get_dt()*timeadjust+(after_next->get_time()-next->get_time()));
+
+                                       if(iter_get_after==INTERPOLATION_HALT)
+                                               curve.second.t1()*=0;
+               
+                                       if(next_get_before==INTERPOLATION_HALT)
+                                               curve.second.t2()*=0;                                   
+                               }
+                       }
+
+                       // Set up the time to the default stuff
+                       curve.first.set_rs(iter->get_time(), next->get_time());
+                       curve.first.p1()=iter->get_time();
+                       curve.first.p2()=next->get_time();
+                       curve.first.t1()=(curve.first.p2()-curve.first.p1())*(1.0f-iter->get_time_tension());
+                       curve.first.t2()=(curve.first.p2()-curve.first.p1())*(1.0f-next->get_time_tension());
+
+
+                       curve.first.sync();
+                       curve.second.sync();
+
+                       curve_list.push_back(curve);
+               }
+       }
+       
+       virtual ValueBase operator()(Time t)const
+       {
+               if(waypoint_list_.empty())
+                       return value_type();    //! \todo Perhaps we should throw something here?
+               if(waypoint_list_.size()==1)
+                       return waypoint_list_.front().get_value(t);
+               if(t<=r)
+                       return waypoint_list_.front().get_value(t);
+               if(t>=s)
+                       return waypoint_list_.back().get_value(t);
+                                               
+               typename curve_list_type::const_iterator iter;
+
+               // This next line will set iter to the
+               // correct iterator for the given time.
+               for(iter=curve_list.begin();iter<curve_list.end() && t>=iter->first.get_s();++iter)
+                       continue;
+               if(iter==curve_list.end())
+                       return waypoint_list_.back().get_value(t);
+               return iter->resolve(t);
+       }       
+};  
+
+
+template<typename T>
+class _Constant : public sinfg::ValueNode_Animated
+{
+public:
+       typedef T value_type;
+
+private:
+
+       // Bounds of this curve
+       Time r,s;
+
+public:
+       ValueNode* clone(const GUID& deriv_guid)const
+       {
+               { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
+               _Constant<T>* ret(new _Constant<T>());
+               ret->set_guid(get_guid()^deriv_guid);
+               for(WaypointList::const_iterator iter=waypoint_list().begin();iter!=waypoint_list().end();++iter)
+                       ret->add(iter->clone(deriv_guid));
+               return ret;
+       }
+
+       _Constant()
+       {
+               set_type(ValueBase(value_type()).get_type());
+       }
+
+       virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)
+       {
+               // Make sure we are getting data of the correct type
+               //if(data.type!=type)
+               //      return waypoint_list_type::iterator();
+               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
+               
+               Waypoint waypoint(value,t);
+               waypoint.set_parent_value_node(this);
+               
+               waypoint_list_.push_back(waypoint);
+               WaypointList::iterator ret=waypoint_list_.end();
+               --ret;
+               changed();
+
+               return ret;
+       }
+
+       virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)
+       {
+               // Make sure we are getting data of the correct type
+               //if(data.type!=type)
+               //      return waypoint_list_type::iterator();
+               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
+
+               Waypoint waypoint(value_node,t);
+               waypoint.set_parent_value_node(this);
+               
+               waypoint_list_.push_back(waypoint);
+               WaypointList::iterator ret=waypoint_list_.end();
+               --ret;
+               changed();
+
+               return ret;
+       }
+
+       virtual void on_changed()
+       {
+               ValueNode_Animated::on_changed();
+               
+               if(waypoint_list_.size()<=1)
+                       return;
+               std::sort(waypoint_list_.begin(),waypoint_list_.end());
+               //waypoint_list_.sort();
+               r=waypoint_list_.front().get_time();
+               s=waypoint_list_.back().get_time();
+
+       }
+
+       virtual ValueBase operator()(Time t)const
+       {
+               if(waypoint_list_.size()==1)
+                       return waypoint_list_.front().get_value(t);
+               if(waypoint_list_.empty())
+                       return value_type();
+               if(t<=r)
+                       return waypoint_list_.front().get_value(t);
+               if(t>=s)
+                       return waypoint_list_.back().get_value(t);
+
+               typename WaypointList::const_iterator iter;
+               typename WaypointList::const_iterator next;
+
+               // This next line will set iter to the
+               // correct iterator for the given time.
+               for(next=waypoint_list_.begin(),iter=next++;next!=waypoint_list_.end() && t>=next->get_time();iter=next++)
+                       continue;
+
+               return iter->get_value(t);
+       }
+};
+
+class _AnimBool : public sinfg::ValueNode_Animated
+{
+public:
+       typedef bool value_type;
+
+private:
+
+       // Bounds of this curve
+       Time r,s;
+
+public:
+       ValueNode* clone(const GUID& deriv_guid)const
+       {
+               { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
+               _AnimBool* ret(new _AnimBool());
+               ret->set_guid(get_guid()^deriv_guid);
+               for(WaypointList::const_iterator iter=waypoint_list().begin();iter!=waypoint_list().end();++iter)
+                       ret->add(iter->clone(deriv_guid));
+               return ret;
+       }
+
+       _AnimBool()
+       {
+               set_type(ValueBase(value_type()).get_type());
+       }
+
+       virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)
+       {
+               // Make sure we are getting data of the correct type
+               //if(data.type!=type)
+               //      return waypoint_list_type::iterator();
+               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
+
+               
+               Waypoint waypoint(value,t);
+               waypoint.set_parent_value_node(this);
+               
+               waypoint_list_.push_back(waypoint);
+               WaypointList::iterator ret=waypoint_list_.end();
+               --ret;
+               changed();
+
+               return ret;
+       }
+
+       virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)
+       {
+               // Make sure we are getting data of the correct type
+               //if(data.type!=type)
+               //      return waypoint_list_type::iterator();
+               try { find(t); throw Exception::BadTime(_("A waypoint already exists at this point in time")); } catch(Exception::NotFound) { };
+
+               Waypoint waypoint(value_node,t);
+               waypoint.set_parent_value_node(this);
+               
+               waypoint_list_.push_back(waypoint);
+               WaypointList::iterator ret=waypoint_list_.end();
+               --ret;
+               changed();
+
+               return ret;
+       }
+
+       virtual void on_changed()
+       {
+               ValueNode_Animated::on_changed();
+               
+               if(waypoint_list_.size()<=1)
+                       return;
+               std::sort(waypoint_list_.begin(),waypoint_list_.end());
+               //waypoint_list_.sort();
+               r=waypoint_list_.front().get_time();
+               s=waypoint_list_.back().get_time();
+
+       }
+
+       virtual ValueBase operator()(Time t)const
+       {
+               if(waypoint_list_.size()==1)
+                       return waypoint_list_.front().get_value(t);
+               if(waypoint_list_.empty())
+                       return false;
+               if(t<r)
+                       return waypoint_list_.front().get_value(t);
+               if(t>s)
+                       return waypoint_list_.back().get_value(t);
+
+               WaypointList::const_iterator iter;
+               WaypointList::const_iterator next;
+
+               // This next line will set iter to the
+               // correct iterator for the given time.
+               for(next=waypoint_list_.begin(),iter=next++;next!=waypoint_list_.end() && t>=next->get_time();iter=next++)
+                       if(iter->get_time()==t)
+                               return iter->get_value(t);
+
+               if(iter->get_time()==t)
+                       return iter->get_value(t);
+               
+               if(next!=waypoint_list_.end())
+                       return iter->get_value(t).get(bool()) || next->get_value(t).get(bool());
+               return iter->get_value(t);
+       }
+};
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_Animated::ValueNode_Animated()
+{
+       DCAST_HACK_ENABLE();
+}
+
+int
+ValueNode_Animated::find(const Time& begin,const Time& end,std::vector<Waypoint*>& selected)
+{
+       Time curr_time(begin);
+       int ret(0);
+       
+       // try to grab first waypoint
+       try
+       {
+               WaypointList::iterator iter;
+               iter=find(curr_time);
+               selected.push_back(&*iter);
+               ret++;
+       }
+       catch(...) { }
+       
+       try
+       {
+               WaypointList::iterator iter;
+               while(true)
+               {
+                       iter=find_next(curr_time);
+                       curr_time=iter->get_time();
+                       if(curr_time>=end)
+                               break;
+                       selected.push_back(&*iter);
+                       ret++;
+               }
+       }
+       catch(...) { }
+       
+       return ret;
+}
+
+/*
+void
+ValueNode_Animated::manipulate_time(const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end)
+{
+#define old_2_new(x)   (((x)-old_begin)/(old_end-old_begin)*(new_end-new_begin)+new_begin)
+       std::vector<Waypoint*> selected;
+       std::vector<Waypoint*>::iterator iter;
+
+       if(find(old_begin,old_end,selected))
+       {
+               // check to make sure this operation is OK
+               for(iter=selected.begin();iter!=selected.end();++iter)
+               {
+                       try
+                       {
+                               Time new_time(old_2_new((*iter)->get_time()));
+                               if(new_time>=old_begin && new_time<old_end)
+                                       continue;
+                               find(new_time);
+                               // If we found a waypoint already at that time, then
+                               // we need to abort
+                               throw Exception::BadTime(_("Waypoint Conflict"));
+                       }
+                       catch(Exception::NotFound) { }
+                       
+                       selected.back()->set_time(old_2_new(selected.back()->get_time()));
+                       selected.pop_back();
+               }
+       
+               
+               while(!selected.empty())
+               {
+                       selected.back()->set_time(old_2_new(selected.back()->get_time()));
+                       selected.pop_back();
+               }
+               
+               changed();
+       }
+#undef old_2_new
+}
+*/
+
+Waypoint
+ValueNode_Animated::new_waypoint_at_time(const Time& time)const
+{
+       Waypoint waypoint;
+       try
+       {
+               // Trivial case, we are sitting on a waypoint
+               waypoint=*find(time);
+               waypoint.make_unique();
+       }
+       catch(...)
+       {       
+               if(waypoint_list().empty())
+               {
+                       waypoint.set_value((*this)(time));
+               }
+               else
+               {
+                       WaypointList::const_iterator prev;
+                       WaypointList::const_iterator next;
+
+                       bool has_prev(false), has_next(false);
+                       
+                       try { prev=find_prev(time); has_prev=true; } catch(...) { }
+                       try { next=find_next(time); has_next=true; } catch(...) { }
+                       
+                       /*
+                       WaypointList::const_iterator closest;
+
+                       if(has_prev&&!has_next)
+                               closest=prev;
+                       else if(has_next&&!has_prev)
+                               closest=next;
+                       else if(time-prev->get_time()<next->get_time()-time)
+                               closest=prev;
+                       else
+                               closest=next;
+                               
+                       for(iter=waypoint_list().begin();iter!=waypoint_list().end();++iter)
+                       {
+                               const Real dist(abs(iter->get_time()-time));
+                               if(dist<abs(closest->get_time()-time))
+                                       closest=iter;
+                       }
+                       */
+                       
+                       if(has_prev && !prev->is_static())
+                               waypoint.set_value_node(prev->get_value_node());
+                       if(has_next && !next->is_static())
+                               waypoint.set_value_node(next->get_value_node());
+                       else
+                               waypoint.set_value((*this)(time));
+                       
+                       /*if(has_prev)
+                               waypoint.set_after(prev->get_before());
+                       if(has_next)
+                               waypoint.set_before(next->get_after());
+                       */
+               }
+       }
+       waypoint.set_time(time);
+       waypoint.set_parent_value_node(const_cast<ValueNode_Animated*>(this));
+//     sinfg::info("waypoint.get_after()=set to %d",waypoint.get_after());
+//     sinfg::info("waypoint.get_before()=set to %d",waypoint.get_before());
+       
+       return waypoint;
+}
+
+ValueNode_Animated::WaypointList::iterator
+ValueNode_Animated::find(const UniqueID &x)
+{
+       ValueNode_Animated::WaypointList::iterator iter;
+       iter=std::find(waypoint_list().begin(),waypoint_list().end(),x);
+       if(iter==waypoint_list().end() || iter->get_uid()!=x.get_uid())
+               throw Exception::NotFound(strprintf("ValueNode_Animated::find(): Can't find UniqueID %d",x.get_uid()));
+       return iter;
+}
+
+ValueNode_Animated::WaypointList::const_iterator
+ValueNode_Animated::find(const UniqueID &x)const
+{
+       return const_cast<ValueNode_Animated*>(this)->find(x);
+       /*
+       ValueNode_Animated::WaypointList::const_iterator iter;
+       iter=std::find(waypoint_list().begin(),waypoint_list().end(),x);
+       if(iter!=waypoint_list().end() && iter->get_uid()!=x.get_uid())
+               throw Exception::NotFound(strprintf("ValueNode_Animated::find()const: Can't find UniqueID %d",x.get_uid()));
+       return iter;
+       */
+}
+
+ValueNode_Animated::WaypointList::iterator
+ValueNode_Animated::find(const Time &x)
+{
+       WaypointList::iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
+
+       if(iter!=waypoint_list().end() && x.is_equal(iter->get_time()))
+               return iter;
+
+       throw Exception::NotFound(strprintf("ValueNode_Animated::find(): Can't find Waypoint at %s",x.get_string().c_str()));
+}
+
+ValueNode_Animated::WaypointList::const_iterator
+ValueNode_Animated::find(const Time &x)const
+{
+       return const_cast<ValueNode_Animated*>(this)->find(x);
+       /*
+       WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
+
+       if(iter!=waypoint_list().end() && x.is_equal(iter->get_time()))
+               return iter;
+
+       throw Exception::NotFound(strprintf("ValueNode_Animated::find(): Can't find Waypoint at %s",x.get_string().c_str()));
+       */
+}
+
+ValueNode_Animated::WaypointList::iterator
+ValueNode_Animated::find_next(const Time &x)
+{
+       WaypointList::iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
+
+       if(iter!=waypoint_list().end())
+       {
+               if(iter->get_time().is_more_than(x))
+                       return iter;
+               ++iter;
+               if(iter!=waypoint_list().end() && iter->get_time().is_more_than(x))
+                       return iter;
+       }
+       
+       throw Exception::NotFound(strprintf("ValueNode_Animated::find_next(): Can't find Waypoint after %s",x.get_string().c_str()));
+}
+
+ValueNode_Animated::WaypointList::const_iterator
+ValueNode_Animated::find_next(const Time &x)const
+{
+       return const_cast<ValueNode_Animated*>(this)->find_next(x);
+       /*
+       WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
+
+       if(iter!=waypoint_list().end())
+       {
+               if(iter->get_time()-Time::epsilon()>x)
+                       return iter;
+               ++iter;
+               if(iter!=waypoint_list().end() && iter->get_time()-Time::epsilon()>x)
+                       return iter;
+       }
+       
+       throw Exception::NotFound(strprintf("ValueNode_Animated::find_next(): Can't find Waypoint after %s",x.get_string().c_str()));
+*/
+}
+
+ValueNode_Animated::WaypointList::iterator
+ValueNode_Animated::find_prev(const Time &x)
+{
+       WaypointList::iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
+
+       if(iter!=waypoint_list().end())
+       {
+               if(iter->get_time().is_less_than(x))
+                       return iter;
+               if(iter!=waypoint_list().begin() && (--iter)->get_time().is_less_than(x))
+                       return iter;
+       }
+       
+       throw Exception::NotFound(strprintf("ValueNode_Animated::find_prev(): Can't find Waypoint after %s",x.get_string().c_str()));
+}
+
+ValueNode_Animated::WaypointList::const_iterator
+ValueNode_Animated::find_prev(const Time &x)const
+{
+       return const_cast<ValueNode_Animated*>(this)->find_prev(x);
+       /*
+       WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x));
+
+       if(iter!=waypoint_list().end())
+       {
+               if(iter->get_time()+Time::epsilon()<x)
+                       return iter;
+               if(iter!=waypoint_list().begin() && (--iter)->get_time()+Time::epsilon()<x)
+                       return iter;
+       }
+       throw Exception::NotFound(strprintf("ValueNode_Animated::find_prev(): Can't find Waypoint after %s",x.get_string().c_str()));
+       */
+}
+
+void
+ValueNode_Animated::erase(const UniqueID &x)
+{
+       waypoint_list().erase(find(x));
+}
+
+ValueNode_Animated::WaypointList::iterator
+ValueNode_Animated::add(const Waypoint &x)
+{
+       Waypoint waypoint(x);
+       waypoint.set_parent_value_node(this);
+       waypoint_list_.push_back(waypoint);
+       //assert(waypoint_list_.back().get_parent_value_node()==this);
+       WaypointList::iterator ret=waypoint_list_.end();
+       --ret;
+       changed();
+       return ret;
+}
+
+void
+ValueNode_Animated::set_type(ValueBase::Type t)
+{
+       ValueNode::set_type(t);
+}
+
+ValueNode_Animated::Handle
+sinfg::ValueNode_Animated::create(ValueBase::Type type)
+{
+       switch(type)
+       {
+               case ValueBase::TYPE_TIME:
+                       return ValueNode_Animated::Handle(new _Hermite<Time>);
+               case ValueBase::TYPE_REAL:
+                       return ValueNode_Animated::Handle(new _Hermite<Vector::value_type>);
+               case ValueBase::TYPE_INTEGER:
+                       return ValueNode_Animated::Handle(new _Hermite<int>);
+               case ValueBase::TYPE_ANGLE:
+                       return ValueNode_Animated::Handle(new _Hermite<Angle>);
+               case ValueBase::TYPE_VECTOR:
+                       return ValueNode_Animated::Handle(new _Hermite<Vector>);
+               case ValueBase::TYPE_COLOR:
+                       return ValueNode_Animated::Handle(new _Hermite<Color>);
+                       
+               case ValueBase::TYPE_STRING:
+                       return ValueNode_Animated::Handle(new _Constant<String>);
+               case ValueBase::TYPE_GRADIENT:
+                       return ValueNode_Animated::Handle(new _Constant<Gradient>);
+               case ValueBase::TYPE_BOOL:
+                       return ValueNode_Animated::Handle(new _AnimBool);
+               case ValueBase::TYPE_CANVAS:
+                       return ValueNode_Animated::Handle(new _Constant<Canvas::LooseHandle>);
+               default:
+                       throw
+                               Exception::BadType(strprintf(_("%s: You cannot use a %s in an animated ValueNode"),"sinfg::ValueNode_Animated::create()",
+                                       ValueBase::type_name(type).c_str())
+                               );
+                       break;
+       }
+       return ValueNode_Animated::Handle();
+}
+
+ValueNode_Animated::Handle
+ValueNode_Animated::create(const ValueBase& value, const Time& time)
+{
+       return create(ValueNode::Handle(ValueNode_Const::create(value)),time);
+}
+
+ValueNode_Animated::Handle
+ValueNode_Animated::create(ValueNode::Handle value_node, const Time& time)
+{
+       ValueNode_Animated::Handle ret(create(value_node->get_type()));
+       ret->new_waypoint(time,value_node);
+       return ret;
+}
+
+ValueNode_Animated::~ValueNode_Animated()
+{
+}
+
+String
+ValueNode_Animated::get_name()const
+{
+       return "animated";
+}
+
+String
+ValueNode_Animated::get_local_name()const
+{
+       return _("Animated");
+}
+
+void ValueNode_Animated::get_times_vfunc(Node::time_set &set) const
+{
+       //add all the way point times to the value node...
+       
+       WaypointList::const_iterator    i = waypoint_list().begin(),
+                                                                       end = waypoint_list().end();
+
+       for(; i != end; ++i)
+       {
+               TimePoint t;
+               t.set_time(i->get_time());
+               t.set_before(i->get_before());
+               t.set_after(i->get_after());
+               t.set_guid(i->get_guid());
+               set.insert(t);
+       }
+}
+struct timecmp
+ {
+       Time t;
+       timecmp(const Time &c) :t(c) {}
+       bool operator()(const Waypoint &rhs) const
+       {
+               return t.is_equal(rhs.get_time());
+       }
+ };
+ ValueNode_Animated::findresult
+ ValueNode_Animated::find_uid(const UniqueID &x)
+ {
+       findresult      f;
+       f.second = false;
+       
+       //search for it... and set the bool part of the return value to true if we found it!
+       f.first = std::find(waypoint_list_.begin(), waypoint_list_.end(), x);
+       if(f.first != waypoint_list_.end())
+               f.second = true;
+               
+       return f;
+ }
+ ValueNode_Animated::const_findresult
+ ValueNode_Animated::find_uid(const UniqueID &x)const
+ {
+       const_findresult        f;
+       f.second = false;
+       
+       //search for it... and set the bool part of the return value to true if we found it!
+       f.first = std::find(waypoint_list_.begin(), waypoint_list_.end(), x);
+       if(f.first != waypoint_list_.end())
+               f.second = true;
+               
+       return f;
+ }
+ ValueNode_Animated::findresult        
+ ValueNode_Animated::find_time(const Time &x)
+ {
+       findresult      f;
+       f.second = false;
+       
+       //search for it... and set the bool part of the return value to true if we found it!
+       f.first = std::find_if(waypoint_list_.begin(), waypoint_list_.end(), timecmp(x));
+       if(f.first != waypoint_list_.end())
+               f.second = true;
+               
+       return f;
+ }
+ValueNode_Animated::const_findresult
+ValueNode_Animated::find_time(const Time &x)const
+{
+       const_findresult        f;
+       f.second = false;
+       
+       //search for it... and set the bool part of the return value to true if we found it!
+       f.first = std::find_if(waypoint_list_.begin(), waypoint_list_.end(), timecmp(x));
+       if(f.first != waypoint_list_.end())
+               f.second = true;
+               
+       return f;
+}
+
+void
+ValueNode_Animated::insert_time(const Time& location, const Time& delta)
+{
+       if(!delta)
+               return;
+       try
+       {
+               WaypointList::iterator iter(find_next(location));
+               for(;iter!=waypoint_list().end();++iter)
+               {
+                       iter->set_time(iter->get_time()+delta);
+               }
+               changed();
+       }
+       catch(Exception::NotFound) { }
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_animated.h b/synfig-core/trunk/src/synfig/valuenode_animated.h
new file mode 100644 (file)
index 0000000..97351bd
--- /dev/null
@@ -0,0 +1,116 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_animated.h
+**     \brief Template Header
+**
+**     $Id: valuenode_animated.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_ANIMATED_H
+#define __SINFG_VALUENODE_ANIMATED_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <list>
+
+#include "valuenode.h"
+#include "uniqueid.h"
+#include "waypoint.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+struct ValueNode_Animated : public ValueNode
+{
+public:
+       typedef etl::handle<ValueNode_Animated> Handle;
+       typedef etl::handle<const ValueNode_Animated> ConstHandle;
+
+       typedef sinfg::Waypoint Waypoint;
+       typedef sinfg::WaypointList WaypointList;
+       
+       typedef std::pair<WaypointList::iterator,bool>  findresult;
+       typedef std::pair<WaypointList::const_iterator,bool>    const_findresult;
+
+protected:
+       WaypointList waypoint_list_;
+
+public:
+       WaypointList &waypoint_list() { return waypoint_list_; }
+
+       const WaypointList &waypoint_list()const { return waypoint_list_; }
+
+       virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)=0;
+
+       virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)=0;
+
+       /*! \note this does not add any waypoint to the ValueNode! */
+       Waypoint new_waypoint_at_time(const Time& t)const;
+       
+       WaypointList::iterator add(const Waypoint &x);
+
+       void erase(const UniqueID &x);
+       
+       //either use find result (return bool and iterator) or 
+       findresult                      find_uid(const UniqueID &x);
+       const_findresult        find_uid(const UniqueID &x)const;
+       findresult                      find_time(const Time &x);       
+       const_findresult        find_time(const Time &x)const;
+               
+       WaypointList::iterator find(const UniqueID &x);
+       WaypointList::const_iterator find(const UniqueID &x)const;
+       WaypointList::iterator find(const Time &x);     
+       WaypointList::const_iterator find(const Time &x)const;
+       
+       WaypointList::iterator find_next(const Time &x);
+       WaypointList::const_iterator find_next(const Time &x)const;
+       WaypointList::iterator find_prev(const Time &x);
+       WaypointList::const_iterator find_prev(const Time &x)const;
+
+       virtual ~ValueNode_Animated();
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+       static Handle create(ValueBase::Type type);
+
+       static Handle create(const ValueBase& value, const Time& time);
+
+       static Handle create(ValueNode::Handle value_node, const Time& time);
+
+       int find(const Time& begin,const Time& end,std::vector<Waypoint*>& list);
+
+       void insert_time(const Time& location, const Time& delta);
+       
+protected:
+       ValueNode_Animated();
+
+       void set_type(ValueBase::Type t);
+       virtual void get_times_vfunc(Node::time_set &set) const;
+public:
+       DCAST_HACK_ID(4);
+};
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_bline.cpp b/synfig-core/trunk/src/synfig/valuenode_bline.cpp
new file mode 100644 (file)
index 0000000..c8259fc
--- /dev/null
@@ -0,0 +1,799 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_bline.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_bline.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_bline.h"
+#include "valuenode_const.h"
+#include "valuenode_composite.h"
+#include "general.h"
+#include "exception.h"
+#include "blinepoint.h"
+#include <vector>
+#include <list>
+#include <algorithm>
+#include <ETL/hermite>
+#include <ETL/calculus>
+#include "segment.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+inline Vector
+linear_interpolation(const Vector& a, const Vector& b, float c)
+{ return (b-a)*c+a; }
+
+inline Vector
+radial_interpolation(const Vector& a, const Vector& b, float c)
+{
+       affine_combo<Real,float> mag_combo;
+       affine_combo<Angle,float> ang_combo;
+       
+       Real mag(mag_combo(a.mag(),b.mag(),c));
+       Angle ang(ang_combo(Angle::tan(a[1],a[0]),Angle::tan(b[1],b[0]),c));
+       
+       return Point( mag*Angle::cos(ang).get(),mag*Angle::sin(ang).get() );
+}
+
+
+
+ValueBase
+sinfg::convert_bline_to_segment_list(const ValueBase& bline)
+{
+       std::vector<Segment> ret;
+       
+//     std::vector<BLinePoint> list(bline.operator std::vector<BLinePoint>());
+       //std::vector<BLinePoint> list(bline);
+       std::vector<BLinePoint> list(bline.get_list().begin(),bline.get_list().end());
+       std::vector<BLinePoint>::const_iterator iter;
+
+       BLinePoint prev,first;
+       
+       //start with prev = first and iter on the second...
+       
+       if(list.empty()) return ValueBase(ret,bline.get_loop());
+       first = prev = list.front();
+       
+       for(iter=++list.begin();iter!=list.end();++iter)
+       {
+               ret.push_back(
+                       Segment(
+                               prev.get_vertex(),
+                               prev.get_tangent2(),
+                               iter->get_vertex(),
+                               iter->get_tangent1()
+                       )
+               );
+               prev=*iter;
+       }               
+       if(bline.get_loop())
+       {
+               ret.push_back(
+                       Segment(
+                               prev.get_vertex(),
+                               prev.get_tangent2(),
+                               first.get_vertex(),
+                               first.get_tangent1()
+                       )
+               );
+       }
+       return ValueBase(ret,bline.get_loop());
+}
+
+ValueBase
+sinfg::convert_bline_to_width_list(const ValueBase& bline)
+{
+       std::vector<Real> ret;
+//     std::vector<BLinePoint> list(bline.operator std::vector<BLinePoint>());
+       //std::vector<BLinePoint> list(bline);
+       std::vector<BLinePoint> list(bline.get_list().begin(),bline.get_list().end());
+       std::vector<BLinePoint>::const_iterator iter;
+       
+       if(bline.empty())
+               return ValueBase(ValueBase::TYPE_LIST);
+       
+       for(iter=list.begin();iter!=list.end();++iter)
+               ret.push_back(iter->get_width());
+
+       if(bline.get_loop())
+               ret.push_back(list.front().get_width());
+
+       return ValueBase(ret,bline.get_loop());
+}
+
+
+/* === M E T H O D S ======================================================= */
+
+
+ValueNode_BLine::ValueNode_BLine():
+       ValueNode_DynamicList(ValueBase::TYPE_BLINEPOINT)
+{
+}
+
+ValueNode_BLine::~ValueNode_BLine()
+{
+}
+
+ValueNode_BLine*
+ValueNode_BLine::create(const ValueBase &value)
+{
+       if(value.get_type()!=ValueBase::TYPE_LIST)
+               return 0;
+       
+       ValueNode_BLine* value_node(new ValueNode_BLine());
+
+       if(!value.empty())
+       {
+               switch(value.get_contained_type())
+               {
+               case ValueBase::TYPE_BLINEPOINT:
+               {
+//                     std::vector<BLinePoint> bline_points(value.operator std::vector<BLinePoint>());
+                       //std::vector<BLinePoint> bline_points(value);
+                       std::vector<BLinePoint> bline_points(value.get_list().begin(),value.get_list().end());
+                       std::vector<BLinePoint>::const_iterator iter;
+
+                       for(iter=bline_points.begin();iter!=bline_points.end();iter++)
+                       {       
+                               value_node->add(ValueNode::Handle(ValueNode_Composite::create(*iter)));
+                       }
+                       value_node->set_loop(value.get_loop());
+               }
+                       break;
+               case ValueBase::TYPE_SEGMENT:
+               {
+                       // Here, we want to convert a list of segments
+                       // into a list of BLinePoints. We make an assumption
+                       // that the segment list is continuous(sp), but not necessarily
+                       // smooth.
+                       
+                       value_node->set_loop(false);
+//                     std::vector<Segment> segments(value.operator std::vector<Segment>());
+//                     std::vector<Segment> segments(value);
+                       std::vector<Segment> segments(value.get_list().begin(),value.get_list().end());
+                       std::vector<Segment>::const_iterator iter,last(segments.end());
+                       --last;
+                       ValueNode_Const::Handle prev,first;
+                       
+                       for(iter=segments.begin();iter!=segments.end();iter++)
+                       {       
+#define PREV_POINT     prev->get_value().get(BLinePoint())
+#define FIRST_POINT    first->get_value().get(BLinePoint())
+#define CURR_POINT     curr->get_value().get(BLinePoint())
+                               if(iter==segments.begin())
+                               {
+                                       prev=ValueNode_Const::create(ValueBase::TYPE_BLINEPOINT);
+                                       {
+                                               BLinePoint prev_point(PREV_POINT);
+                                               prev_point.set_vertex(iter->p1);                                        
+                                               prev_point.set_tangent1(iter->t1);
+                                               prev_point.set_width(0.01);
+                                               prev_point.set_origin(0.5);
+                                               prev_point.set_split_tangent_flag(false);
+                                               prev->set_value(prev_point);
+                                       }
+                                       first=prev;
+                                       value_node->add(ValueNode::Handle(prev));
+                                       
+                               }
+                               if(iter==last && iter->p2.is_equal_to(FIRST_POINT.get_vertex()))
+                               {
+                                       value_node->set_loop(true);
+                                       if(!iter->t2.is_equal_to(FIRST_POINT.get_tangent1()))
+                                       {
+                                               BLinePoint first_point(FIRST_POINT);
+                                               first_point.set_tangent1(iter->t2);
+                                               first->set_value(first_point);
+                                       }
+                                       continue;
+                               }
+                                       
+                               ValueNode_Const::Handle curr;
+                               curr=ValueNode_Const::create(ValueBase::TYPE_BLINEPOINT);
+                               {
+                                       BLinePoint curr_point(CURR_POINT);
+                                       curr_point.set_vertex(iter->p2);                                        
+                                       curr_point.set_tangent1(iter->t2);
+                                       curr_point.set_width(0.01);
+                                       curr_point.set_origin(0.5);
+                                       curr_point.set_split_tangent_flag(false);
+                                       curr->set_value(curr_point);
+                               }
+                               if(!PREV_POINT.get_tangent1().is_equal_to(iter->t1))
+                               {
+                                       BLinePoint prev_point(PREV_POINT);
+                                       prev_point.set_split_tangent_flag(true);
+                                       prev_point.set_tangent2(iter->t1);
+                                       prev->set_value(prev_point);
+                               }
+                               value_node->add(ValueNode::Handle(curr));
+                               prev=curr;
+                       }
+                       
+               }
+                       break;
+               default:
+                       // We got a list of who-knows-what. We don't have any idea
+                       // what to do with it.
+                       return 0;
+                       break;
+               }
+       }
+       
+       
+       return value_node;
+}
+
+ValueNode_BLine::ListEntry
+ValueNode_BLine::create_list_entry(int index, Time time, Real origin)
+{
+       ValueNode_BLine::ListEntry ret;
+
+       
+       sinfg::BLinePoint prev,next;
+
+       int prev_i,next_i;
+
+       index=index%link_count();
+
+       assert(index>=0);
+       ret.index=index;
+       ret.set_parent_value_node(this);
+
+       if(!list[index].status_at_time(time))
+               next_i=find_next_valid_entry(index,time);
+       else
+               next_i=index;
+       prev_i=find_prev_valid_entry(index,time);
+       
+       sinfg::info("index=%d, next_i=%d, prev_i=%d",index,next_i,prev_i);
+       
+       next=(*list[next_i].value_node)(time);
+       prev=(*list[prev_i].value_node)(time);
+       
+       etl::hermite<Vector> curve(prev.get_vertex(),next.get_vertex(),prev.get_tangent2(),next.get_tangent1());
+       etl::derivative< etl::hermite<Vector> > deriv(curve);
+
+       sinfg::BLinePoint bline_point;
+       bline_point.set_vertex(curve(origin));
+       bline_point.set_width((next.get_width()-prev.get_width())*origin+prev.get_width());
+       bline_point.set_tangent1(deriv(origin)*min(1.0-origin,origin));
+       bline_point.set_tangent2(bline_point.get_tangent1());
+       bline_point.set_split_tangent_flag(false);
+       bline_point.set_origin(origin);
+       
+       ret.value_node=ValueNode_Composite::create(bline_point);
+       
+       return ret;
+}
+
+ValueBase
+ValueNode_BLine::operator()(Time t)const
+{
+       std::vector<BLinePoint> ret_list;
+       
+       std::vector<ListEntry>::const_iterator iter,first_iter;
+       bool first_flag(true);
+       bool rising;
+       int index(0);
+       float next_scale(1.0f);
+       
+       BLinePoint prev,first;
+       first.set_origin(100.0f);
+       
+       for(iter=list.begin();iter!=list.end();++iter,index++)
+       {
+               float amount(iter->amount_at_time(t,&rising));
+               
+               assert(amount>=0.0f);
+               assert(amount<=1.0f);
+               
+               if(amount==1.0f)
+               {
+                       if(first_flag)
+                       {
+                               first_iter=iter;
+                               first=prev=(*iter->value_node)(t).get(prev);
+                               first_flag=false;
+                               ret_list.push_back(first);
+                               continue;
+                       }
+                       
+                       BLinePoint curr;
+                       curr=(*iter->value_node)(t).get(prev);
+                       
+                       if(next_scale!=1.0f)
+                       {
+                               ret_list.back().set_split_tangent_flag(true);
+                               ret_list.back().set_tangent2(prev.get_tangent2()*next_scale);
+
+                               ret_list.push_back(curr);
+
+                               ret_list.back().set_split_tangent_flag(true);
+                               ret_list.back().set_tangent2(curr.get_tangent2());
+                               ret_list.back().set_tangent1(curr.get_tangent1()*next_scale);
+
+                               next_scale=1.0f;
+                       }
+                       else
+                       {
+                               ret_list.push_back(curr);
+
+                       }
+                       
+                       prev=curr;
+               }
+               else
+               if(amount>0.0f)
+               {
+                       std::vector<ListEntry>::const_iterator begin_iter,end_iter;
+                       
+                       // This is where the interesting stuff happens
+                       // We need to seek forward in the list to see what the next
+                       // active point is
+                       
+                       BLinePoint curr;
+                       BLinePoint begin;       // begin of dynamic group
+                       BLinePoint end;         // End of dynamic group
+                       Time blend_time;
+                       int dist_from_begin(0), dist_from_end(0);
+                       BLinePoint ret;
+                       
+                       Time begin_time;
+                       Time end_time;
+                       
+                       if(!rising)
+                       {
+                               try{ end_time=iter->find_prev(t)->get_time(); }
+                               catch(...) { end_time=Time::begin(); }
+                               try{ begin_time=iter->find_next(t)->get_time(); }
+                               catch(...) { begin_time=Time::end(); }
+                       }
+                       else
+                       {
+                               try{ begin_time=iter->find_prev(t)->get_time(); }
+                               catch(...) { begin_time=Time::begin(); }
+                               try{ end_time=iter->find_next(t)->get_time(); }
+                               catch(...) { end_time=Time::end(); }
+                       }
+                       blend_time=begin_time;
+                       curr=(*iter->value_node)(end_time).get(curr);                           
+
+//                     curr=(*iter->value_node)(t).get(curr);
+                       
+                       // Find "end" of dynamic group
+                       end_iter=iter;
+//                     for(++end_iter;begin_iter!=list.end();++end_iter)
+                       for(++end_iter;end_iter!=list.end();++end_iter)
+                               if(end_iter->amount_at_time(t)>amount)
+                               {
+                                       end=(*end_iter->value_node)(blend_time).get(prev);
+                                       break;
+                               }
+                       
+                       // If we did not find an end of the dynamic group...
+                       if(end_iter==list.end())
+                       {
+                               if(get_loop())
+                               {
+                                       end_iter=first_iter;
+                                       end=(*end_iter->value_node)(blend_time).get(prev);
+//                                     end=first;
+                               }
+                               else
+                               {
+                                       // Writeme!
+                                       end_iter=first_iter;
+                                       end=(*end_iter->value_node)(blend_time).get(prev);
+//                                     end=first;
+                               }
+                       }
+
+                       // Find "begin" of dynamic group
+                       begin_iter=iter;
+                       begin.set_origin(100.0f); // set the origin to 100 (which is crazy) so that we can check to see if it was found
+                       do
+                       {
+                               if(begin_iter==list.begin())
+                               {
+                                       if(get_loop())
+                                               begin_iter=list.end();
+                                       else
+                                               break;
+                               }
+                               
+                               --begin_iter;
+                               dist_from_begin++;
+                               
+                               if(begin_iter==iter)
+                                       break;
+
+                               if(begin_iter->amount_at_time(t)>amount)
+                               {
+                                       begin=(*begin_iter->value_node)(blend_time).get(prev);
+                                       break;
+                               }
+                       }while(begin_iter!=iter);
+                       
+                       // If we did not find a begin
+                       if(begin.get_origin()==100.0f)
+                       {
+                               if(get_loop())
+                               {
+                                       begin_iter=first_iter;
+                                       begin=(*begin_iter->value_node)(blend_time).get(prev);
+//                                     begin=first;
+                               }
+                               else
+                               {
+                                       // Writeme!
+                                       begin_iter=first_iter;
+                                       begin=(*begin_iter->value_node)(blend_time).get(prev);
+//                                     begin=first;
+                               }
+                       }
+                       
+                       etl::hermite<Vector> curve(begin.get_vertex(),end.get_vertex(),begin.get_tangent2(),end.get_tangent1());
+                       etl::derivative< etl::hermite<Vector> > deriv(curve);
+       
+                       ret.set_vertex(curve(curr.get_origin()));
+
+                       ret.set_width((end.get_width()-begin.get_width())*curr.get_origin()+begin.get_width());
+
+                       ret.set_tangent1(deriv(curr.get_origin()));
+                       ret.set_tangent2(deriv(curr.get_origin()));
+                       
+                       float prev_tangent_scalar(1.0f);
+                       float next_tangent_scalar(1.0f);
+                       
+                       //sinfg::info("index_%d:dist_from_begin=%d",index,dist_from_begin);
+                       //sinfg::info("index_%d:dist_from_end=%d",index,dist_from_end);
+                       
+                       // If we are the next to the begin
+                       if(begin_iter==--std::vector<ListEntry>::const_iterator(iter) || dist_from_begin==1)
+                       {
+                               prev_tangent_scalar=(1.0f-curr.get_origin())*amount+curr.get_origin();
+                       }
+                       else
+                       {
+                               float origin=curr.get_origin()-prev.get_origin();
+                               prev_tangent_scalar=(1.0f-origin)*amount+origin;                                
+                       }
+
+                       // If we are the next to the end
+                       if(end_iter==++std::vector<ListEntry>::const_iterator(iter) || dist_from_end==1)
+                       {
+                               float origin=1.0-curr.get_origin();
+                               next_tangent_scalar=(1.0f-origin)*amount+origin;
+                       }
+                       else
+                       if(list.end()!=++std::vector<ListEntry>::const_iterator(iter))
+                       {
+                               BLinePoint next;
+                               next=((*(++std::vector<ListEntry>::const_iterator(iter))->value_node)(t).get(prev));
+                               float origin=next.get_origin()-curr.get_origin();
+                               next_tangent_scalar=(1.0f-origin)*amount+origin;                                
+                       }
+                       next_scale=next_tangent_scalar;
+                       
+                       //ret.set_vertex((curr.get_vertex()-ret.get_vertex())*amount+ret.get_vertex());
+                       if(false)
+                       {
+                               // My first try
+                               Point ref_point_begin(
+                                       (
+                                               (*begin_iter->value_node)(begin_time).get(prev).get_vertex() +
+                                               (*end_iter->value_node)(begin_time).get(prev).get_vertex()
+                                       ) * 0.5
+                               );
+                               Point ref_point_end(
+                                       (
+                                               (*begin_iter->value_node)(end_time).get(prev).get_vertex() +
+                                               (*end_iter->value_node)(end_time).get(prev).get_vertex()
+                                       ) * 0.5
+                               );
+                               Point ref_point_now(
+                                       (
+                                               (*begin_iter->value_node)(t).get(prev).get_vertex() +
+                                               (*end_iter->value_node)(t).get(prev).get_vertex()
+                                       ) * 0.5
+                               );
+                               Point ref_point_linear((ref_point_end-ref_point_begin)*amount+ref_point_begin);
+
+                               ret.set_vertex(
+                                       (curr.get_vertex()-ret.get_vertex())*amount+ret.get_vertex() +
+                                       (ref_point_now-ref_point_linear)
+                               );
+                               ret.set_tangent1((curr.get_tangent1()-ret.get_tangent1())*amount+ret.get_tangent1());
+                               ret.set_split_tangent_flag(curr.get_split_tangent_flag());
+                               if(ret.get_split_tangent_flag())
+                                       ret.set_tangent2((curr.get_tangent2()-ret.get_tangent2())*amount+ret.get_tangent2());
+                       }
+                       else
+                       {
+                               // My second try
+                               Point begin_cord_sys[2], begin_cord_origin;
+                               Point end_cord_sys[2], end_cord_origin;
+                               Point curr_cord_sys[2], curr_cord_origin;
+                               
+                               {
+                                       const Point a((*end_iter->value_node)(begin_time).get(prev).get_vertex());
+                                       const Point b((*begin_iter->value_node)(begin_time).get(prev).get_vertex());
+                                       begin_cord_origin=(a+b)/2;
+                                       begin_cord_sys[0]=( b - a ).norm();
+                                       begin_cord_sys[1]=begin_cord_sys[0].perp();
+                               }
+                               {
+                                       const Point a((*end_iter->value_node)(end_time).get(prev).get_vertex());
+                                       const Point b((*begin_iter->value_node)(end_time).get(prev).get_vertex());
+                                       end_cord_origin=(a+b)/2;
+                                       end_cord_sys[0]=( b - a ).norm();
+                                       end_cord_sys[1]=end_cord_sys[0].perp();
+                               }
+                               {
+                                       const Point a((*end_iter->value_node)(t).get(prev).get_vertex());
+                                       const Point b((*begin_iter->value_node)(t).get(prev).get_vertex());
+                                       curr_cord_origin=(a+b)/2;
+                                       curr_cord_sys[0]=( b - a ).norm();
+                                       curr_cord_sys[1]=curr_cord_sys[0].perp();
+                               }
+                               
+                               /*
+                               end_cord_origin=(*end_iter->value_node)(end_time).get(prev).get_vertex();
+                               end_cord_sys[0]=(
+                                       (*begin_iter->value_node)(end_time).get(prev).get_vertex() -
+                                       end_cord_origin
+                               ).norm();
+                               end_cord_sys[1]=end_cord_sys[0].perp();
+                               
+                               curr_cord_origin=(*end_iter->value_node)(t).get(prev).get_vertex();
+                               curr_cord_sys[0]=(
+                                       (*begin_iter->value_node)(t).get(prev).get_vertex() -
+                                       curr_cord_origin
+                               ).norm();
+                               curr_cord_sys[1]=curr_cord_sys[0].perp();
+                               */
+                               
+                               // Convert start point
+                               Point a;
+                               Vector at1,at2;
+                               {
+                                       Point tmp(ret.get_vertex()-begin_cord_origin);
+                                       a[0]=tmp*begin_cord_sys[0];
+                                       a[1]=tmp*begin_cord_sys[1];
+#define COORD_SYS_RADIAL_TAN_INTERP 1
+                                       
+#ifdef COORD_SYS_RADIAL_TAN_INTERP
+                                       tmp=ret.get_tangent1()+ret.get_vertex()-begin_cord_origin;
+                                       at1[0]=tmp*begin_cord_sys[0];
+                                       at1[1]=tmp*begin_cord_sys[1];
+                                       
+                                       if(curr.get_split_tangent_flag())
+                                       {
+                                               tmp=ret.get_tangent2()+ret.get_vertex()-begin_cord_origin;
+                                               at2[0]=tmp*begin_cord_sys[0];
+                                               at2[1]=tmp*begin_cord_sys[1];
+                                       }
+#endif
+                               }
+                               
+                               // Convert finish point
+                               Point b;
+                               Vector bt1,bt2;
+                               {
+                                       Point tmp(curr.get_vertex()-end_cord_origin);
+                                       b[0]=tmp*end_cord_sys[0];
+                                       b[1]=tmp*end_cord_sys[1];
+                                       
+#ifdef COORD_SYS_RADIAL_TAN_INTERP
+                                       tmp=curr.get_tangent1()+curr.get_vertex()-end_cord_origin;
+                                       bt1[0]=tmp*end_cord_sys[0];
+                                       bt1[1]=tmp*end_cord_sys[1];
+
+                                       if(curr.get_split_tangent_flag())
+                                       {
+                                               tmp=curr.get_tangent2()+curr.get_vertex()-end_cord_origin;
+                                               bt2[0]=tmp*end_cord_sys[0];
+                                               bt2[1]=tmp*end_cord_sys[1];
+                                       }
+#endif
+                               }
+                                                               
+                               // Convert current point
+                               Point c;
+                               Vector ct1,ct2;
+                               {
+                                       // Transpose (invert)
+                                       swap(curr_cord_sys[0][1],curr_cord_sys[1][0]);
+
+                                       Point tmp((b-a)*amount+a);
+                                       c[0]=tmp*curr_cord_sys[0];
+                                       c[1]=tmp*curr_cord_sys[1];
+                                       c+=curr_cord_origin;
+
+#define INTERP_FUNCTION                radial_interpolation
+//#define INTERP_FUNCTION              linear_interpolation
+                                       
+#ifdef COORD_SYS_RADIAL_TAN_INTERP
+                                       tmp=INTERP_FUNCTION(at1,bt1,amount);
+                                       ct1[0]=tmp*curr_cord_sys[0];
+                                       ct1[1]=tmp*curr_cord_sys[1];
+                                       ct1+=curr_cord_origin;
+                                       ct1-=c;
+                                       
+                                       if(curr.get_split_tangent_flag())
+                                       {
+                                               tmp=INTERP_FUNCTION(at2,bt2,amount);
+                                               ct2[0]=tmp*curr_cord_sys[0];
+                                               ct2[1]=tmp*curr_cord_sys[1];
+                                               ct2+=curr_cord_origin;
+                                               ct2-=c;
+                                       }
+#endif
+                               }
+
+                               ret.set_vertex(c);
+#ifndef COORD_SYS_RADIAL_TAN_INTERP
+                               ret.set_tangent1(radial_interpolation(ret.get_tangent1(),curr.get_tangent1(),amount));
+                               ret.set_split_tangent_flag(curr.get_split_tangent_flag());
+                               if(ret.get_split_tangent_flag())
+                                       ret.set_tangent2(radial_interpolation(ret.get_tangent2(),curr.get_tangent2(),amount));
+#else                          
+                               ret.set_tangent1(ct1);
+                               ret.set_split_tangent_flag(curr.get_split_tangent_flag());
+                               if(ret.get_split_tangent_flag())
+                                       ret.set_tangent2(ct2);
+#endif
+                       }
+                       
+                       ret.set_origin(curr.get_origin());
+                       ret.set_width((curr.get_width()-ret.get_width())*amount+ret.get_width());
+                       
+
+                       // Handle the case where we are the first vertex
+                       if(first_flag)
+                       {
+                               ret.set_tangent1(ret.get_tangent1()*prev_tangent_scalar);
+                               first_iter=iter;
+                               first=prev=ret;
+                               first_flag=false;
+                               ret_list.push_back(ret);
+                               continue;
+                       }
+
+                       ret_list.back().set_split_tangent_flag(true);
+                       ret_list.back().set_tangent2(prev.get_tangent2()*prev_tangent_scalar);
+                       ret_list.push_back(ret);
+                       ret_list.back().set_split_tangent_flag(true);
+                       //ret_list.back().set_tangent2(ret.get_tangent1());
+                       ret_list.back().set_tangent1(ret.get_tangent1()*prev_tangent_scalar);
+
+                       prev=ret;
+               }
+       }
+       
+       if(next_scale!=1.0f)
+       {
+               ret_list.back().set_split_tangent_flag(true);
+               ret_list.back().set_tangent2(prev.get_tangent2()*next_scale);
+       }
+
+/*
+       if(get_loop() && !first_flag)
+       {
+               ret_list.push_back(
+                       Segment(
+                       prev.get_vertex(),
+                       prev.get_tangent2(),
+                       first.get_vertex(),
+                       first.get_tangent1()
+                       )
+               );
+       }
+*/
+       
+       if(list.empty())
+               sinfg::warning(string("ValueNode_BLine::operator()():")+_("No entries in list"));
+       else
+       if(ret_list.empty())
+               sinfg::warning(string("ValueNode_BLine::operator()():")+_("No entries in ret_list"));
+
+       return ValueBase(ret_list,get_loop());
+}
+
+String
+ValueNode_BLine::link_local_name(int i)const
+{
+       assert(i>=0 && (unsigned)i<list.size());
+       return etl::strprintf(_("Vertex %03d"),i+1);
+}      
+
+ValueNode*
+ValueNode_BLine::clone(const GUID& deriv_guid)const
+{
+       { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
+
+       ValueNode_BLine* ret=new ValueNode_BLine();
+       ret->set_guid(get_guid()^deriv_guid);
+       
+       std::vector<ListEntry>::const_iterator iter;
+
+       for(iter=list.begin();iter!=list.end();++iter)
+       {
+               if(iter->value_node->is_exported())
+                       ret->add(*iter);
+               else
+               {
+                       ListEntry list_entry(*iter);
+                       //list_entry.value_node=find_value_node(iter->value_node->get_guid()^deriv_guid).get();
+                       //if(!list_entry.value_node)
+                               list_entry.value_node=iter->value_node->clone(deriv_guid);
+                       ret->add(list_entry);
+                       //ret->list.back().value_node=iter->value_node.clone();
+               }
+       }
+       ret->set_loop(get_loop());
+       
+       return ret;
+}
+
+String
+ValueNode_BLine::get_name()const
+{
+       return "bline";
+}
+
+String
+ValueNode_BLine::get_local_name()const
+{
+       return _("BLine");
+}
+
+LinkableValueNode*
+ValueNode_BLine::create_new()const
+{
+       assert(0);
+       return 0;
+}
+
+bool
+ValueNode_BLine::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_LIST;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_bline.h b/synfig-core/trunk/src/synfig/valuenode_bline.h
new file mode 100644 (file)
index 0000000..b88ba86
--- /dev/null
@@ -0,0 +1,97 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_bline.h
+**     \brief Template Header
+**
+**     $Id: valuenode_bline.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_BLINE_H
+#define __SINFG_VALUENODE_BLINE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <vector>
+#include <list>
+
+#include "valuenode.h"
+#include "time.h"
+#include "uniqueid.h"
+#include "blinepoint.h"
+#include "valuenode_dynamiclist.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+
+//! Converts a list of bline points into a list of segments
+ValueBase convert_bline_to_segment_list(const ValueBase &bline);
+
+//! Converts a list of bline points into a list of widths
+ValueBase convert_bline_to_width_list(const ValueBase &bline);
+       
+/*! \class ValueNode_BLine
+**     \brief \writeme
+*/
+class ValueNode_BLine : public ValueNode_DynamicList
+{
+public:
+
+       typedef etl::handle<ValueNode_BLine> Handle;
+       typedef etl::handle<const ValueNode_BLine> ConstHandle;
+       
+
+       ValueNode_BLine();
+
+public:
+       
+
+       
+       virtual ValueBase operator()(Time t)const;
+
+       virtual ~ValueNode_BLine();
+
+       virtual String link_local_name(int i)const;
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
+       
+       virtual ListEntry create_list_entry(int index, Time time=0, Real origin=0.5);
+
+protected:
+       
+       LinkableValueNode* create_new()const;
+
+public:
+       //using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_BLine* create(const ValueBase &x=ValueBase::TYPE_LIST);
+}; // END of class ValueNode_BLine
+
+typedef ValueNode_BLine::ListEntry::ActivepointList ActivepointList;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_composite.cpp b/synfig-core/trunk/src/synfig/valuenode_composite.cpp
new file mode 100644 (file)
index 0000000..3e03ed6
--- /dev/null
@@ -0,0 +1,389 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_composite.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_composite.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_composite.h"
+#include "valuenode_const.h"
+#include <stdexcept>
+#include "general.h"
+#include "valuenode_radialcomposite.h"
+#include "vector.h"
+#include "color.h"
+#include "segment.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::ValueNode_Composite::ValueNode_Composite(const ValueBase &value):
+       LinkableValueNode(value.get_type())
+{
+       switch(get_type())
+       {
+               case ValueBase::TYPE_VECTOR:
+                       set_link("x",ValueNode_Const::create(value.get(Vector())[0]));
+                       set_link("y",ValueNode_Const::create(value.get(Vector())[1]));
+                       break;
+               case ValueBase::TYPE_COLOR:
+                       set_link("r",ValueNode_Const::create(value.get(Color()).get_r()));
+                       set_link("g",ValueNode_Const::create(value.get(Color()).get_g()));
+                       set_link("b",ValueNode_Const::create(value.get(Color()).get_b()));
+                       set_link("a",ValueNode_Const::create(value.get(Color()).get_a()));
+                       break;
+               case ValueBase::TYPE_SEGMENT:
+                       set_link("p1",ValueNode_Const::create(value.get(Segment()).p1));
+                       set_link("t1",ValueNode_Const::create(value.get(Segment()).t1));
+                       set_link("p2",ValueNode_Const::create(value.get(Segment()).p2));
+                       set_link("t2",ValueNode_Const::create(value.get(Segment()).t2));
+                       break;
+               case ValueBase::TYPE_BLINEPOINT:
+               {
+                       BLinePoint bline_point(value);
+                       set_link(0,ValueNode_Const::create(bline_point.get_vertex()));
+                       set_link(1,ValueNode_Const::create(bline_point.get_width()));
+                       set_link(2,ValueNode_Const::create(bline_point.get_origin()));
+                       set_link(3,ValueNode_Const::create(bline_point.get_split_tangent_flag()));
+                       set_link(4,ValueNode_RadialComposite::create(bline_point.get_tangent1()));
+                       set_link(5,ValueNode_RadialComposite::create(bline_point.get_tangent2()));
+                       break;
+               }
+               default:
+                       assert(0);
+                       throw Exception::BadType(ValueBase::type_name(get_type()));                     
+       }
+}
+
+ValueNode_Composite::~ValueNode_Composite()
+{
+       unlink_all();
+}
+
+ValueNode_Composite*
+ValueNode_Composite::create(const ValueBase &value)
+{
+       return new ValueNode_Composite(value);
+}
+       
+LinkableValueNode*
+ValueNode_Composite::create_new()const
+{
+       return new ValueNode_Composite(ValueBase(get_type()));
+}
+
+ValueBase
+sinfg::ValueNode_Composite::operator()(Time t)const
+{
+       switch(get_type())
+       {
+               case ValueBase::TYPE_VECTOR:
+               {
+                       Vector vect;
+                       assert(components[0] && components[1]);
+                       vect[0]=(*components[0])(t).get(Vector::value_type());
+                       vect[1]=(*components[1])(t).get(Vector::value_type());
+                       return vect;
+               }
+               case ValueBase::TYPE_COLOR:
+               {
+                       Color color;
+                       assert(components[0] && components[1] && components[2] && components[3]);
+                       color.set_r((*components[0])(t).get(Vector::value_type()));
+                       color.set_g((*components[1])(t).get(Vector::value_type()));
+                       color.set_b((*components[2])(t).get(Vector::value_type()));
+                       color.set_a((*components[3])(t).get(Vector::value_type()));
+                       return color;
+               }
+               case ValueBase::TYPE_SEGMENT:
+               {
+                       Segment seg;
+                       assert(components[0] && components[1] && components[2] && components[3]);
+                       seg.p1=(*components[0])(t).get(Point());
+                       seg.t1=(*components[1])(t).get(Vector());
+                       seg.p2=(*components[2])(t).get(Point());
+                       seg.t2=(*components[3])(t).get(Vector());
+                       return seg;
+               }
+               case ValueBase::TYPE_BLINEPOINT:
+               {
+                       BLinePoint ret;
+                       assert(components[0] && components[1] && components[2] && components[3] && components[4] && components[5]);
+                       ret.set_vertex((*components[0])(t).get(Point()));
+                       ret.set_width((*components[1])(t).get(Real()));
+                       ret.set_origin((*components[2])(t).get(Real()));
+                       ret.set_split_tangent_flag((*components[3])(t).get(bool()));
+                       ret.set_tangent1((*components[4])(t).get(Vector()));
+                       if(ret.get_split_tangent_flag())
+                               ret.set_tangent2((*components[5])(t).get(Vector()));
+                       return ret;
+               }
+               default:
+                       sinfg::error(string("ValueNode_Composite::operator():")+_("Bad type for composite"));
+                       assert(components[0]);
+                       return (*components[0])(t);
+       }
+}
+
+int
+ValueNode_Composite::link_count()const
+{
+       switch(get_type())
+       {
+       case ValueBase::TYPE_VECTOR:
+               return 2;
+       case ValueBase::TYPE_COLOR:
+               return 4;
+       case ValueBase::TYPE_SEGMENT:
+               return 4;
+       case ValueBase::TYPE_BLINEPOINT:
+               return 6;
+       default:
+               sinfg::warning(string("ValueNode_Composite::component_count():")+_("Bad type for composite"));
+               return 1;
+       }
+}
+
+bool
+ValueNode_Composite::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i>=0);
+       assert(i<6);
+       
+       if(PlaceholderValueNode::Handle::cast_dynamic(x))
+       {
+               components[i]=x;
+               return true;
+       }
+
+       switch(get_type())
+       {
+               case ValueBase::TYPE_VECTOR:
+                       assert(i<2);
+                       if(x->get_type()==ValueBase(Real()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
+                       {
+                               components[i]=x;
+                               return true;
+                       }
+                       break;
+
+               case ValueBase::TYPE_COLOR:
+                       assert(i<4);
+                       if(x->get_type()==ValueBase(Real()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
+                       {
+                               components[i]=x;
+                               return true;
+                       }
+                       break;
+                       
+               case ValueBase::TYPE_SEGMENT:
+                       assert(i<4);
+                       if(x->get_type()==ValueBase(Point()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
+                       {
+                               components[i]=x;
+                               return true;
+                       }
+                       break;
+
+               case ValueBase::TYPE_BLINEPOINT:
+                       assert(i<6);
+                       if((i==0 || i==4 || i==5) && x->get_type()==ValueBase(Point()).get_type())
+                       {
+                               components[i]=x;
+                               return true;
+                       }
+                       if((i==1 || i==2) && x->get_type()==ValueBase(Real()).get_type())
+                       {
+                               components[i]=x;
+                               return true;
+                       }
+                       if(i==3 && x->get_type()==ValueBase(bool()).get_type())
+                       {
+                               components[i]=x;
+                               return true;
+                       }
+                       break;
+                       
+               default:
+                       break;
+       }
+       return false;   
+}
+
+ValueNode::LooseHandle
+ValueNode_Composite::get_link_vfunc(int i)const
+{
+       assert(i>=0 && i<6);
+       return components[i];
+}
+
+String
+ValueNode_Composite::link_local_name(int i)const
+{
+       assert(i>=0 && i<6);
+       switch(get_type())
+       {
+               case ValueBase::TYPE_VECTOR:
+                       return strprintf("%c-Axis",'X'+i);
+
+               case ValueBase::TYPE_COLOR:
+                       if(i==0)
+                               return _("Red");
+                       else if(i==1)
+                               return _("Green");
+                       else if(i==2)
+                               return _("Blue");
+                       else if(i==3)
+                               return _("Alpha");
+                       
+               case ValueBase::TYPE_SEGMENT:
+                       if(i==0)
+                               return _("Vertex 1");
+                       else if(i==1)
+                               return _("Tangent 1");
+                       else if(i==2)
+                               return _("Vertex 2");
+                       else if(i==3)
+                               return _("Tangent 2");
+
+               case ValueBase::TYPE_BLINEPOINT:
+                       if(i==0)
+                               return _("Vertex");
+                       else if(i==1)
+                               return _("Width");
+                       else if(i==2)
+                               return _("Origin");
+                       else if(i==3)
+                               return _("Split Tangents");
+                       else if(i==4)
+                               return _("Tangent 1");
+                       else if(i==5)
+                               return _("Tangent 2");
+
+               default:
+                       break;
+       }
+       return etl::strprintf(_("C%d"),i+1);    
+}      
+
+
+String
+ValueNode_Composite::link_name(int i)const
+{
+       assert(i>=0 && i<5);
+       return strprintf("c%d",i);
+}      
+
+int
+ValueNode_Composite::get_link_index_from_name(const String &name)const
+{
+       if(name.empty())
+               throw Exception::BadLinkName(name);
+
+       if(name[0]=='c')
+               return name[1]-'0';
+
+       switch(get_type())
+       {
+       case ValueBase::TYPE_COLOR:
+               if(name[0]=='r')
+                       return 0;
+               if(name[0]=='g')
+                       return 1;
+               if(name[0]=='b')
+                       return 2;
+               if(name[0]=='a')
+                       return 3;
+       case ValueBase::TYPE_SEGMENT:
+               if(name=="p1")
+                       return 0;
+               if(name=="t1")
+                       return 1;
+               if(name=="p2")
+                       return 2;
+               if(name=="t2")
+                       return 3;
+       case ValueBase::TYPE_VECTOR:
+               if(name[0]=='x')
+                       return 0;
+               if(name[0]=='y')
+                       return 1;
+               if(name[0]=='z')
+                       return 2;
+       case ValueBase::TYPE_BLINEPOINT:
+               if(name[0]=='p' || name=="v1" || name=="p1")
+                       return 0;
+               if(name=="w" || name=="width")
+                       return 1;
+               if(name=="o" || name=="origin")
+                       return 2;
+               if(name=="split")
+                       return 3;
+               if(name=="t1")
+                       return 4;
+               if(name=="t2")
+                       return 5;
+       default:                        
+               break;
+       }
+
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_Composite::get_name()const
+{
+       return "composite";
+}
+
+String
+ValueNode_Composite::get_local_name()const
+{
+       return _("Composite");
+}
+
+bool
+ValueNode_Composite::check_type(ValueBase::Type type)
+{
+       return
+               type==ValueBase::TYPE_SEGMENT ||
+               type==ValueBase::TYPE_VECTOR ||
+               type==ValueBase::TYPE_COLOR ||
+               type==ValueBase::TYPE_BLINEPOINT;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_composite.h b/synfig-core/trunk/src/synfig/valuenode_composite.h
new file mode 100644 (file)
index 0000000..45fad3b
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_composite.h
+**     \brief Template Header
+**
+**     $Id: valuenode_composite.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_COMPOSITE_H
+#define __SINFG_VALUENODE_COMPOSITE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueNode_Composite : public LinkableValueNode
+{
+       ValueNode::RHandle components[6];
+       ValueNode_Composite(const ValueBase &value);
+       
+public:
+       typedef etl::handle<ValueNode_Composite> Handle;
+       typedef etl::handle<const ValueNode_Composite> ConstHandle;
+
+
+       ~ValueNode_Composite();
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+       virtual int link_count()const;
+       virtual String link_name(int i)const;
+       virtual String link_local_name(int i)const;
+       virtual ValueBase operator()(Time t)const;
+
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+       virtual int get_link_index_from_name(const String &name)const;
+       
+protected:
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+       
+       LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_Composite* create(const ValueBase &x);
+}; // END of class ValueNode_Composite
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_const.cpp b/synfig-core/trunk/src/synfig/valuenode_const.cpp
new file mode 100644 (file)
index 0000000..b412733
--- /dev/null
@@ -0,0 +1,130 @@
+/* === S I N F G =========================================================== */
+/*!    \file template.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_const.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_const.h"
+#include "general.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_Const::ValueNode_Const()
+{
+       DCAST_HACK_ENABLE();
+}
+
+
+ValueNode_Const::ValueNode_Const(const ValueBase &x):
+       ValueNode       (x.get_type()),
+       value           (x)
+{
+       DCAST_HACK_ENABLE();
+}
+
+
+ValueNode_Const*
+ValueNode_Const::create(const ValueBase &x)
+{
+       return new ValueNode_Const(x);
+}
+
+
+ValueNode*
+ValueNode_Const::clone(const GUID& deriv_guid)const
+{
+       { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
+       ValueNode* ret(new ValueNode_Const(value));
+       ret->set_guid(get_guid()^deriv_guid);
+       return ret;
+}
+
+
+ValueNode_Const::~ValueNode_Const()
+{
+}
+
+
+ValueBase
+ValueNode_Const::operator()(Time t)const
+{
+       return value;
+}
+
+
+const ValueBase &
+ValueNode_Const::get_value()const
+{
+       return value;
+}
+
+ValueBase &
+ValueNode_Const::get_value()
+{
+       return value;
+}
+
+void
+ValueNode_Const::set_value(const ValueBase &data)
+{
+       if(data!=value)
+       {
+               value=data;
+               changed();
+       }
+}
+
+
+String
+ValueNode_Const::get_name()const
+{
+       return "constant";
+}
+
+String
+ValueNode_Const::get_local_name()const
+{
+       return _("Constant");
+}
+
+void ValueNode_Const::get_times_vfunc(Node::time_set &set) const
+{
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_const.h b/synfig-core/trunk/src/synfig/valuenode_const.h
new file mode 100644 (file)
index 0000000..c2a3dca
--- /dev/null
@@ -0,0 +1,75 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_const.h
+**     \brief Template Header
+**
+**     $Id: valuenode_const.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_CONST_H
+#define __SINFG_VALUENODE_CONST_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueNode_Const : public ValueNode
+{
+public:
+       typedef etl::handle<ValueNode_Const> Handle;
+       typedef etl::handle<const ValueNode_Const> ConstHandle;
+
+private:
+       ValueBase value;
+       
+       ValueNode_Const();
+       ValueNode_Const(const ValueBase &x);
+
+public:
+       
+       virtual ValueBase operator()(Time t)const;
+       virtual ~ValueNode_Const();
+
+       const ValueBase &get_value()const;
+       ValueBase &get_value();
+       void set_value(const ValueBase &data);
+       
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
+       
+public:
+       static ValueNode_Const* create(const ValueBase &x=ValueBase());
+
+protected:
+       virtual void get_times_vfunc(Node::time_set &set) const;
+};
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp b/synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp
new file mode 100644 (file)
index 0000000..198b993
--- /dev/null
@@ -0,0 +1,881 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_dynamiclist.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_dynamiclist.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_dynamiclist.h"
+#include "valuenode_const.h"
+#include "valuenode_composite.h"
+#include "general.h"
+#include "exception.h"
+#include <vector>
+#include <list>
+#include <algorithm>
+#include "canvas.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_DynamicList::ListEntry::ListEntry():
+       index(0)
+{
+}
+
+ValueNode_DynamicList::ListEntry::ListEntry(const ValueNode::Handle &value_node):
+       value_node(value_node),
+       index(0)
+{
+}
+
+ValueNode_DynamicList::ListEntry::ListEntry(const ValueNode::Handle &value_node,Time begin, Time end):
+       value_node(value_node)
+{
+       add(begin,false);
+       add(end,false);
+       add((begin+end)*0.5,true);
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::iterator
+ValueNode_DynamicList::ListEntry::add(Time time, bool status, int priority)
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList::iterator iterator;
+       
+       //! \optimize
+       Activepoint ap(time,status,priority);
+       ap.set_parent_index(get_index());
+       ap.set_parent_value_node(get_parent_value_node());
+       timing_info.push_back(ap);
+       iterator iter(--iterator(timing_info.end()));
+       timing_info.sort();
+       
+       return iter;
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::iterator
+ValueNode_DynamicList::ListEntry::add(const Activepoint &x)
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList::iterator iterator;
+       
+       //! \optimize
+       Activepoint ap(x);
+       ap.set_parent_index(get_index());
+       ap.set_parent_value_node(get_parent_value_node());
+       timing_info.push_back(ap);
+       iterator iter(--iterator(timing_info.end()));
+       timing_info.sort();
+       
+       return iter;
+}
+
+void
+ValueNode_DynamicList::reindex()
+{
+       int i(0);
+       
+       std::vector<ListEntry>::iterator iter;
+
+       for(iter=list.begin();iter!=list.end();++iter)
+       {
+               assert(iter->value_node);
+               if(iter->index!=i || iter->get_parent_value_node().get()!=this)
+               {
+                       ActivepointList::iterator iter2;
+
+                       if(iter->timing_info.size()) // is this line really necessary?
+                       for(iter2=iter->timing_info.begin();iter2!=iter->timing_info.end();++iter2)
+                       {
+                               iter2->set_parent_index(i);
+                               iter2->set_parent_value_node(this);
+                       }
+                       iter->index=i;          
+                       iter->set_parent_value_node(this);
+               }
+       }
+}
+
+ValueNode_DynamicList::ListEntry
+ValueNode_DynamicList::create_list_entry(int index, Time time, Real origin)
+{
+       ValueNode_DynamicList::ListEntry ret;
+       
+       
+       sinfg::ValueBase prev,next;
+
+       index=index%link_count();
+
+       assert(index>=0);
+       
+       ret.index=index;
+       ret.set_parent_value_node(this);
+       
+       next=(*list[index].value_node)(time);
+       
+       if(index!=0)
+               prev=(*list[index-1].value_node)(time);
+       else
+       {
+               if(get_loop())
+                       prev=(*list[link_count()-1].value_node)(time);
+               else
+               {
+                       prev=next;
+               }
+       }
+       
+       
+       switch(get_contained_type())
+       {
+       case ValueBase::TYPE_VECTOR:
+       {
+               Vector a(prev.get(Vector())), b(next.get(Vector()));
+               ret.value_node=ValueNode_Const::create((b-a)*origin+a);
+               break;
+       }
+       case ValueBase::TYPE_REAL:
+       {
+               Real a(prev.get(Real())), b(next.get(Real()));
+               ret.value_node=ValueNode_Const::create((b-a)*origin+a);
+               break;
+       }
+       case ValueBase::TYPE_COLOR:
+       {
+               Color a(prev.get(Color())), b(next.get(Color()));
+               ret.value_node=ValueNode_Composite::create((b-a)*origin+a);
+               break;
+       }
+       case ValueBase::TYPE_ANGLE:
+       {
+               Angle a(prev.get(Angle())), b(next.get(Angle()));
+               ret.value_node=ValueNode_Const::create((b-a)*origin+a);
+               break;
+       }
+       case ValueBase::TYPE_TIME:
+       {
+               Time a(prev.get(Time())), b(next.get(Time()));
+               ret.value_node=ValueNode_Const::create((b-a)*origin+a);
+               break;
+       }
+       default:
+               ret.value_node=ValueNode_Const::create(get_contained_type());
+               break;
+       }
+
+       
+       return ret;
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::iterator
+ValueNode_DynamicList::ListEntry::find(const UniqueID& x)
+{
+       return std::find(timing_info.begin(),timing_info.end(),x);
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator
+ValueNode_DynamicList::ListEntry::find(const UniqueID& x)const
+{
+       return std::find(timing_info.begin(),timing_info.end(),x);
+}
+
+void
+ValueNode_DynamicList::ListEntry::erase(const UniqueID& x)
+{
+       timing_info.erase(find(x));
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::iterator
+ValueNode_DynamicList::ListEntry::find(const Time& x)
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+       
+       ActivepointList::iterator iter;
+
+       for(iter=timing_info.begin();iter!=timing_info.end();++iter)
+               if(iter->time==x)
+                       return iter;
+
+       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find():"+x.get_string());  
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator
+ValueNode_DynamicList::ListEntry::find(const Time& x)const
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+       
+       ActivepointList::const_iterator iter;
+
+       for(iter=timing_info.begin();iter!=timing_info.end();++iter)
+               if(iter->time==x)
+                       return iter;
+
+       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find()const:"+x.get_string());     
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::iterator
+ValueNode_DynamicList::ListEntry::find_next(const Time& x)
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+       
+       ActivepointList::iterator iter;
+
+       for(iter=timing_info.begin();iter!=timing_info.end();++iter)
+               if(iter->time>x)
+                       return iter;
+
+       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find_next():"+x.get_string());     
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator
+ValueNode_DynamicList::ListEntry::find_next(const Time& x)const
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+       
+       ActivepointList::const_iterator iter;
+
+       for(iter=timing_info.begin();iter!=timing_info.end();++iter)
+               if(iter->time>x)
+                       return iter;
+
+       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find_next()const:"+x.get_string());        
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::iterator
+ValueNode_DynamicList::ListEntry::find_prev(const Time& x)
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+       
+       ActivepointList::iterator iter;
+       iter=timing_info.end();
+       do
+       {
+               --iter;
+               if(iter->time<x)
+                       return iter;
+       }
+       while(iter!=timing_info.begin());
+
+       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find_prev():"+x.get_string());     
+}
+
+ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator
+ValueNode_DynamicList::ListEntry::find_prev(const Time& x)const
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+       
+       ActivepointList::const_iterator iter;
+       iter=timing_info.end();
+       do
+       {
+               --iter;
+               if(iter->time<x)
+                       return iter;
+       }
+       while(iter!=timing_info.begin());
+
+       throw Exception::NotFound("ValueNode_DynamicList::ListEntry::find_prev()const:"+x.get_string());        
+}
+
+int
+ValueNode_DynamicList::ListEntry::find(const Time& begin,const Time& end,std::vector<Activepoint*>& selected)
+{
+       Time curr_time(begin);
+       int ret(0);
+       
+       // try to grab first waypoint
+       try
+       {
+               ActivepointList::iterator iter;
+               iter=find(curr_time);
+               selected.push_back(&*iter);
+               ret++;
+       }
+       catch(...) { }
+       
+       try
+       {
+               ActivepointList::iterator iter;
+               while(true)
+               {
+                       iter=find_next(curr_time);
+                       curr_time=iter->get_time();
+                       if(curr_time>=end)
+                               break;
+                       selected.push_back(&*iter);
+                       ret++;
+               }
+       }
+       catch(...) { }
+       
+       return ret;
+}
+
+float
+ValueNode_DynamicList::ListEntry::amount_at_time(const Time &t,bool *rising)const
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+       
+       if(timing_info.empty())
+               return 1.0f;
+               
+       try
+       {
+               ActivepointList::const_iterator iter;
+               iter=find(t);
+               return iter->state?1.0f:0.0f;
+       }
+       catch(...) { }
+
+       ActivepointList::const_iterator prev_iter;
+       ActivepointList::const_iterator next_iter;
+
+       try     { prev_iter=find_prev(t); }
+       catch(...) { return find_next(t)->state?1.0f:0.0f; }
+       
+       try     { next_iter=find_next(t); }
+       catch(...) { return prev_iter->state?1.0f:0.0f; }
+       
+       if(next_iter->state==prev_iter->state)
+               return next_iter->state?1.0f:0.0f;
+       
+       if(rising)*rising=next_iter->state;
+
+       if(next_iter->state==true)
+               return float((t-prev_iter->time)/(next_iter->time-prev_iter->time));
+
+       return float((next_iter->time-t)/(next_iter->time-prev_iter->time));
+}
+
+Activepoint
+ValueNode_DynamicList::ListEntry::new_activepoint_at_time(const Time& time)const
+{
+       Activepoint activepoint;
+       
+       activepoint.set_state(status_at_time(time));
+       activepoint.set_priority(0);
+       
+       return activepoint;
+}
+
+bool
+ValueNode_DynamicList::ListEntry::status_at_time(const Time &t)const
+{
+       typedef sinfg::ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
+       typedef sinfg::ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+       
+       ActivepointList::const_iterator entry_iter;
+       ActivepointList::const_iterator prev_iter;
+       bool state(true);
+
+       // New "symetric" state mechanism
+       if(!timing_info.empty())
+       {
+               if(timing_info.size()==1)
+                       state=timing_info.front().state;
+               else
+               {
+                       //! \optimize Perhaps we should use a binary search...?
+                       // This will give us the first activepoint that is after t.
+                       for(entry_iter=timing_info.begin();entry_iter!=timing_info.end();++entry_iter)
+                       {
+                               if(entry_iter->time==t)
+                               {
+                                       // If we hit the entry right on the nose, then we don't
+                                       // have to do anything more
+                                       return entry_iter->state;
+                               }
+                               if(entry_iter->time>t)
+                                       break;
+                               
+                       }
+                       prev_iter=entry_iter;
+                       prev_iter--;
+                       
+                       // ie:
+                       //
+                       //              |-------|---t---|-------|
+                       //         prev_iter^           ^entry_iter
+                       
+                       if(entry_iter==timing_info.end())
+                       {
+                               state=prev_iter->state;
+                       }
+                       else
+                       if(entry_iter==timing_info.begin())
+                       {
+                               state=entry_iter->state;
+                       }
+                       else
+                       if(entry_iter->priority==prev_iter->priority)
+                       {
+                               state=entry_iter->state || prev_iter->state;
+                       }
+                       else
+                       if(entry_iter->priority>prev_iter->priority)
+                       {
+                               state=entry_iter->state;
+                       }
+                       else
+                       {
+                               state=prev_iter->state;                         
+                       }                               
+               }
+       }
+       return state;
+}
+
+
+
+
+void
+ValueNode_DynamicList::add(const ValueNode::Handle &value_node, int index)
+{
+       ListEntry list_entry(value_node);
+       list_entry.timing_info.size();
+       
+       if(index<0 || index>=(int)list.size())
+       {
+               list.push_back(list_entry);
+       }
+       else
+       {
+               list.insert(list.begin()+index,list_entry);
+       }
+
+       add_child(value_node.get());
+       reindex();
+       //changed();
+
+       if(get_parent_canvas())
+               get_parent_canvas()->signal_value_node_child_added()(this,value_node);
+       else if(get_root_canvas() && get_parent_canvas())
+               get_root_canvas()->signal_value_node_child_added()(this,value_node);
+}
+
+void
+ValueNode_DynamicList::add(const ListEntry &list_entry, int index)
+{
+       if(index<0 || index>=(int)list.size())
+               list.push_back(list_entry);
+       else
+               list.insert(list.begin()+index,list_entry);
+       add_child(list_entry.value_node.get());
+
+       reindex();
+       //changed();
+
+       if(get_parent_canvas())
+               get_parent_canvas()->signal_value_node_child_added()(this,list_entry.value_node);
+       else if(get_root_canvas() && get_parent_canvas())
+               get_root_canvas()->signal_value_node_child_added()(this,list_entry.value_node);
+}
+
+void
+ValueNode_DynamicList::erase(const ValueNode::Handle &value_node_)
+{
+       ValueNode::Handle value_node(value_node_);
+       
+       assert(value_node);
+       if(!value_node)
+               throw String("ValueNode_DynamicList::erase(): Passed bad value node");
+       
+       std::vector<ListEntry>::iterator iter;
+       for(iter=list.begin();iter!=list.end();++iter)
+               if(iter->value_node==value_node)
+               {
+                       list.erase(iter);
+                       if(value_node)
+                       {
+                               remove_child(value_node.get());
+                               if(get_parent_canvas())
+                                       get_parent_canvas()->signal_value_node_child_removed()(this,value_node);
+                               else if(get_root_canvas() && get_parent_canvas())
+                                       get_root_canvas()->signal_value_node_child_removed()(this,value_node);
+                       }
+                       break;
+               }
+       reindex();
+}
+
+
+ValueNode_DynamicList::ValueNode_DynamicList(ValueBase::Type container_type):
+       LinkableValueNode(ValueBase::TYPE_LIST),
+       container_type  (container_type),
+       loop_(false)
+{
+       DCAST_HACK_ENABLE();
+}
+
+ValueNode_DynamicList::Handle
+ValueNode_DynamicList::create(ValueBase::Type id)
+{
+       return new ValueNode_DynamicList(id);
+}
+
+ValueNode_DynamicList::~ValueNode_DynamicList()
+{
+       unlink_all();
+}
+
+ValueNode_DynamicList*
+ValueNode_DynamicList::create_from(const ValueBase &value)
+{
+       //vector<ValueBase> value_list(value.operator vector<ValueBase>());
+       vector<ValueBase> value_list(value.get_list());
+
+       vector<ValueBase>::iterator iter;
+
+       if(value_list.empty())
+               return 0;
+       
+       ValueNode_DynamicList* value_node(new ValueNode_DynamicList(value_list.front().get_type()));
+       
+       for(iter=value_list.begin();iter!=value_list.end();++iter)
+       {
+               ValueNode::Handle item(ValueNode_Const::create(*iter));
+               value_node->add(ListEntry(item));
+               assert(value_node->list.back().value_node);
+       }
+       return value_node;
+}
+
+ValueBase
+ValueNode_DynamicList::operator()(Time t)const
+{
+       std::vector<ValueBase> ret_list;
+       std::vector<ListEntry>::const_iterator iter;
+
+       assert(container_type);
+
+       for(iter=list.begin();iter!=list.end();++iter)
+       {
+               bool state(iter->status_at_time(t));
+               
+               if(state)
+               {
+                       if(iter->value_node->get_type()==container_type)
+                               ret_list.push_back((*iter->value_node)(t));
+                       else
+                       {
+                               sinfg::warning(string("ValueNode_DynamicList::operator()():")+_("List type/item type mismatch, throwing away mismatch"));
+                       }
+               }
+       }
+       
+       if(list.empty())
+               sinfg::warning(string("ValueNode_DynamicList::operator()():")+_("No entries in list"));
+       else
+       if(ret_list.empty())
+               sinfg::warning(string("ValueNode_DynamicList::operator()():")+_("No entries in ret_list"));
+
+       return ret_list;
+}
+
+bool
+ValueNode_DynamicList::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i>=0);
+       if((unsigned)i>=list.size())
+               return false;
+       if(x->get_type()!=container_type)
+               return false;
+       list[i].value_node=x;
+       return true;
+}
+
+ValueNode::LooseHandle
+ValueNode_DynamicList::get_link_vfunc(int i)const
+{
+       assert(i>=0);
+       if((unsigned)i>=list.size())
+               return 0;
+       return list[i].value_node;
+}
+
+int
+ValueNode_DynamicList::link_count()const
+{
+       return list.size();
+}
+
+String
+ValueNode_DynamicList::link_local_name(int i)const
+{
+       assert(i>=0 && (unsigned)i<list.size());
+       return etl::strprintf(_("Item %03d"),i+1);
+}      
+
+ValueNode*
+ValueNode_DynamicList::clone(const GUID& deriv_guid)const
+{
+       { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
+
+       ValueNode_DynamicList* ret=new ValueNode_DynamicList(container_type);
+       ret->set_guid(get_guid()^deriv_guid);
+
+       std::vector<ListEntry>::const_iterator iter;
+
+       for(iter=list.begin();iter!=list.end();++iter)
+       {
+               if(iter->value_node->is_exported())
+                       ret->add(*iter);
+               else
+               {               
+                       ListEntry list_entry(*iter);
+                       //list_entry.value_node=find_value_node(iter->value_node->get_guid()^deriv_guid).get();
+                       //if(!list_entry.value_node)
+                               list_entry.value_node=iter->value_node->clone(deriv_guid);
+                       ret->add(list_entry);
+                       //ret->list.back().value_node=iter->value_node.clone();
+               }
+       }
+       ret->set_loop(get_loop());
+       return ret;
+}
+
+String
+ValueNode_DynamicList::link_name(int i)const
+{
+       return strprintf("item%04d",i);
+}
+
+int
+ValueNode_DynamicList::get_link_index_from_name(const String &name)const
+{
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_DynamicList::get_name()const
+{
+       return "dynamic_list";
+}
+
+String
+ValueNode_DynamicList::get_local_name()const
+{
+       return _("Dynamic List");
+}
+
+bool
+ValueNode_DynamicList::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_LIST;
+}
+
+ValueBase::Type
+ValueNode_DynamicList::get_contained_type()const
+{
+       return container_type;
+}
+
+LinkableValueNode*
+ValueNode_DynamicList::create_new()const
+{
+       assert(0);
+       return 0;
+}
+
+int
+ValueNode_DynamicList::find_next_valid_entry(int orig_item, Time t)const
+{
+       int curr_item;
+       
+       for(curr_item=orig_item+1;curr_item!=orig_item;curr_item++)
+       {
+               if(curr_item==(int)list.size())
+               {
+                       curr_item=0;
+                       continue;
+               }
+               if(list[curr_item].status_at_time(t))
+                       return curr_item;
+       }
+       return curr_item;
+}
+
+int
+ValueNode_DynamicList::find_prev_valid_entry(int orig_item, Time t)const
+{
+       int curr_item;
+       
+       for(curr_item=orig_item-1;curr_item!=orig_item;curr_item--)
+       {
+               if(curr_item==-1)
+               {
+                       curr_item=list.size();
+                       continue;
+               }
+               if(list[curr_item].status_at_time(t))
+                       return curr_item;
+       }
+       return curr_item;
+}
+
+const sinfg::Node::time_set    & ValueNode_DynamicList::ListEntry::get_times() const
+{
+       sinfg::ActivepointList::const_iterator  j = timing_info.begin(),
+                                                                                       end = timing_info.end();
+               
+       //must remerge with all the other values because we don't know if we've changed...
+       times = value_node->get_times();
+       
+       for(; j != end; ++j)
+       {
+               TimePoint t;
+               t.set_time(j->get_time());
+               t.set_guid(j->get_guid());
+
+               times.insert(t);
+       }
+       
+       return times;
+}
+
+void ValueNode_DynamicList::get_times_vfunc(Node::time_set &set) const
+{
+       //add in the active points
+       int size = list.size();
+       
+       //rebuild all the info...
+       for(int i = 0; i < size; ++i)
+       {
+               const Node::time_set & tset= list[i].get_times();
+               set.insert(tset.begin(),tset.end());
+       }
+}
+
+
+//new find functions that don't throw
+struct timecmp
+{
+       Time t;
+
+       timecmp(const Time &c) :t(c) {}
+
+       bool operator()(const Activepoint &rhs) const
+       {
+               return t.is_equal(rhs.get_time());
+       }
+};
+
+ValueNode_DynamicList::ListEntry::findresult ValueNode_DynamicList::ListEntry::find_uid(const UniqueID& x)
+{
+       findresult f;
+       f.second = false;
+       
+       f.first = std::find(timing_info.begin(),timing_info.end(),x);
+       
+       if(f.first != timing_info.end())
+       {
+               f.second = true;
+       }
+       
+       return f;
+}
+
+ValueNode_DynamicList::ListEntry::const_findresult ValueNode_DynamicList::ListEntry::find_uid(const UniqueID& x) const
+{
+       const_findresult f;
+       f.second = false;
+       
+       f.first = std::find(timing_info.begin(),timing_info.end(),x);
+       
+       if(f.first != timing_info.end())
+       {
+               f.second = true;
+       }
+       
+       return f;
+}
+
+ValueNode_DynamicList::ListEntry::findresult ValueNode_DynamicList::ListEntry::find_time(const Time& x)
+{
+       findresult f;
+       f.second = false;
+       
+       f.first = std::find_if(timing_info.begin(),timing_info.end(),timecmp(x));
+       
+       if(f.first != timing_info.end())
+       {
+               f.second = true;
+       }
+       
+       return f;
+}
+
+ValueNode_DynamicList::ListEntry::const_findresult ValueNode_DynamicList::ListEntry::find_time(const Time& x)const
+{
+       const_findresult f;
+       f.second = false;
+       
+       f.first = std::find_if(timing_info.begin(),timing_info.end(),timecmp(x));
+       
+       if(f.first != timing_info.end())
+       {
+               f.second = true;
+       }
+       
+       return f;
+}
+
+void
+ValueNode_DynamicList::insert_time(const Time& location, const Time& delta)
+{
+       if(!delta)
+               return;
+
+       std::vector<ListEntry>::iterator iter(list.begin());
+       for(;iter!=list.end();++iter)
+       {
+               try
+               {
+                       ListEntry& item(*iter);
+                       
+                       ActivepointList::iterator iter(item.find_next(location));
+                       for(;iter!=item.timing_info.end();++iter)
+                       {
+                               iter->set_time(iter->get_time()+delta);
+                       }
+               }
+               catch(Exception::NotFound) { }
+       }
+       changed();
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_dynamiclist.h b/synfig-core/trunk/src/synfig/valuenode_dynamiclist.h
new file mode 100644 (file)
index 0000000..83c6a7b
--- /dev/null
@@ -0,0 +1,244 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_dynamiclist.h
+**     \brief Template Header
+**
+**     $Id: valuenode_dynamiclist.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_DYNAMICLIST_H
+#define __SINFG_VALUENODE_DYNAMICLIST_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <vector>
+#include <list>
+
+#include "valuenode.h"
+#include "time.h"
+#include "uniqueid.h"
+#include "activepoint.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+class ValueNode_BLine;
+       
+/*! \class ValueNode_DynamicList
+**     \brief Animated List ValueNode
+**
+**     This ValueNode was originaly set up to have a list
+**     of ValueNodes and their associated "on" and "off" points.
+**     ie: Any time that was directly after an "on" point,
+**     the item would be "on", and any time that was directly 
+**     after an "off" point would be "off". This is pretty intuitive.
+**     However, it does have it's problems.
+**
+**     The problems arrise when we introduce the concept of a
+**     Keyframe. Keyframes can be manipulated via the Sinfg
+**     Application Library. They allow the user to quickly
+**     and "automagickly" rearange an animation by moving
+**     the associated keyframes. With they old way that the
+**     "on" and "off" points were handled, this task became
+**     overly complicated.
+**
+**     What is required is a "symetric" system of describing
+**     "on" and "off" points. Instead of the point representing
+**     the state of the item after that point in time, we have
+**     the point represent <i>only that frame</i>. The state
+**     of the item is calculated by looking at the points
+**     around it: If either (or both) points are "on", then the
+**     current state is "on". Otherwise, the point is "off"
+**
+**     This may be a bit confusing at first, but it is required
+**     if we want the keyframe mechanism to "just work".
+*/
+class ValueNode_DynamicList : public LinkableValueNode
+{
+public:
+       
+       /*! \class ListEntry
+       **      \brief Contains a potential list item, and associated timing information
+       **
+       **      This structure contains a RHandle to a ValueNode,
+       **      as well as the associated on/off timing information
+       **      which determines when this item is included in the list.
+       **
+       **      The timing information is stored in the member <tt>timing_info</tt>.
+       */
+       struct ListEntry : public UniqueID
+       {
+               friend class ValueNode_DynamicList;
+               friend class ValueNode_BLine;
+       public:
+               typedef sinfg::Activepoint Activepoint;
+               
+               typedef std::list<Activepoint> ActivepointList;
+       
+               typedef std::pair<ActivepointList::iterator,bool>               findresult;
+               typedef std::pair<ActivepointList::const_iterator,bool> const_findresult;
+
+               
+       private:
+               mutable Node::time_set  times;
+       public:
+               ValueNode::RHandle value_node;
+               
+               ActivepointList timing_info;
+               
+       private:
+               int index;
+               etl::loose_handle<ValueNode> parent_;
+               void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }        
+
+       public:
+
+               int get_index()const { return index; }
+               
+                               
+               bool status_at_time(const Time &x)const;
+
+               float amount_at_time(const Time &x, bool *rising=0)const;
+
+               ActivepointList::iterator add(Time time, bool status, int priority=0);
+               ActivepointList::iterator add(const Activepoint &x);
+       
+               findresult find_uid(const UniqueID& x);
+               const_findresult find_uid(const UniqueID& x)const;
+       
+               findresult find_time(const Time& x);
+               const_findresult find_time(const Time& x)const;
+               
+               ActivepointList::iterator find(const UniqueID& x);
+               ActivepointList::const_iterator find(const UniqueID& x)const;
+               ActivepointList::iterator find(const Time& x);
+               ActivepointList::const_iterator find(const Time& x)const;
+               ActivepointList::iterator find_prev(const Time& x);
+               ActivepointList::const_iterator find_prev(const Time& x)const;
+               ActivepointList::iterator find_next(const Time& x);
+               ActivepointList::const_iterator find_next(const Time& x)const;
+
+               Activepoint new_activepoint_at_time(const Time& x)const;
+
+               ActivepointList::iterator add(Time time)
+                       { return add(time, status_at_time(time)); }
+
+               void erase(const UniqueID& x);          
+               
+               int find(const Time& begin,const Time& end,std::vector<Activepoint*>& list);
+                       
+               const sinfg::Node::time_set     &get_times() const;
+
+               const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
+
+               ListEntry();
+               ListEntry(const ValueNode::Handle &value_node);
+               ListEntry(const ValueNode::Handle &value_node,Time begin, Time end);
+       }; // END of struct ValueNode_DynamicList::ListEntry
+       
+       typedef etl::handle<ValueNode_DynamicList> Handle;
+       typedef etl::handle<const ValueNode_DynamicList> ConstHandle;
+
+protected:
+       ValueNode_DynamicList(ValueBase::Type container_type=ValueBase::TYPE_NIL);
+
+       ValueBase::Type container_type;
+
+       bool loop_;
+
+
+public:
+       std::vector<ListEntry> list;
+
+public:
+       
+       void add(const ValueNode::Handle &value_node, int index=-1);
+       void add(const ListEntry &value_node, int index=-1);
+       void erase(const ValueNode::Handle &value_node);
+       void reindex();
+
+       int find_next_valid_entry(int x, Time t)const;
+       int find_prev_valid_entry(int x, Time t)const;
+       
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+
+       virtual int link_count()const;
+
+       virtual String link_name(int i)const;
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual ~ValueNode_DynamicList();
+
+       virtual String link_local_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+       bool get_loop()const { return loop_; }
+       void set_loop(bool x) { loop_=x; }
+
+       ValueBase::Type get_contained_type()const;
+
+
+       template <typename iterator> static Handle
+       create(iterator begin, iterator end)
+       {
+               Handle ret=create((*begin)->get_type());
+               for(;begin!=end;++begin)
+                       ret->add(ListEntry(*begin));
+               return ret;
+       }
+
+       void insert_time(const Time& location, const Time& delta);
+       //void manipulate_time(const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end);
+
+       virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
+
+       virtual ListEntry create_list_entry(int index, Time time=0, Real origin=0.5);
+
+protected:
+       
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+       LinkableValueNode* create_new()const;
+
+       virtual void get_times_vfunc(Node::time_set &set) const;
+
+public:
+       /*! \note The construction parameter (\a id) is the type that the list
+       **      contains, rather than the type that it will yield
+       **      (which is ValueBase::TYPE_LIST)
+       */
+       static Handle create(ValueBase::Type id=ValueBase::TYPE_NIL);
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_DynamicList* create_from(const ValueBase &x=ValueBase::TYPE_GRADIENT);
+}; // END of class ValueNode_DynamicList
+
+typedef ValueNode_DynamicList::ListEntry::Activepoint Activepoint;
+typedef ValueNode_DynamicList::ListEntry::ActivepointList ActivepointList;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_gradientrotate.cpp b/synfig-core/trunk/src/synfig/valuenode_gradientrotate.cpp
new file mode 100644 (file)
index 0000000..8af3228
--- /dev/null
@@ -0,0 +1,214 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_gradientrotate.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_gradientrotate.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "general.h"
+#include "valuenode_gradientrotate.h"
+#include "valuenode_const.h"
+#include <stdexcept>
+#include "gradient.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::ValueNode_GradientRotate::ValueNode_GradientRotate():
+       LinkableValueNode(sinfg::ValueBase::TYPE_GRADIENT)
+{
+       set_link("gradient",ValueNode_Const::create(Gradient()));
+       set_link("offset",ValueNode_Const::create(Real(0)));
+       DCAST_HACK_ENABLE();
+}
+
+LinkableValueNode*
+ValueNode_GradientRotate::create_new()const
+{
+       return new ValueNode_GradientRotate();
+}
+
+ValueNode_GradientRotate*
+ValueNode_GradientRotate::create(const ValueBase& x)
+{
+       ValueBase::Type id(x.get_type());
+       if(id!=ValueBase::TYPE_GRADIENT)
+       {
+               assert(0);
+               throw runtime_error("sinfg::ValueNode_GradientRotate:Bad type "+ValueBase::type_name(id));                      
+       }               
+
+       ValueNode_GradientRotate* value_node=new ValueNode_GradientRotate();
+       value_node->set_gradient(ValueNode_Const::create(x.get(Gradient())));
+
+       assert(value_node->get_type()==id);
+       
+       return value_node;
+}
+
+sinfg::ValueNode_GradientRotate::~ValueNode_GradientRotate()
+{
+       unlink_all();
+}
+
+bool
+sinfg::ValueNode_GradientRotate::set_gradient(ValueNode::Handle a)
+{
+       if(a->get_type()!=ValueBase::TYPE_GRADIENT&& !PlaceholderValueNode::Handle::cast_dynamic(a))
+               return false;
+
+       ref_gradient=a;
+
+       return true;
+}
+
+bool
+sinfg::ValueNode_GradientRotate::set_offset(ValueNode::Handle b)
+{
+       if(b->get_type()!=ValueBase::TYPE_REAL&& !PlaceholderValueNode::Handle::cast_dynamic(b))
+               return false;
+       ref_offset=b;
+       return true;
+}
+
+sinfg::ValueBase
+sinfg::ValueNode_GradientRotate::operator()(Time t)const
+{
+       Gradient gradient;
+       gradient=(*ref_gradient)(t).get(gradient);
+       Real offset((*ref_offset)(t).get(Real()));
+       Gradient::iterator iter;
+       for(iter=gradient.begin();iter!=gradient.end();++iter)
+               iter->pos+=offset;
+       
+       return gradient;
+}
+
+bool
+ValueNode_GradientRotate::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i>=0 && i<3);
+       switch(i)
+       {
+               case 0:
+                       if(set_gradient(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+               case 1:
+                       if(set_offset(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+       }
+
+       return false;
+}
+
+ValueNode::LooseHandle
+ValueNode_GradientRotate::get_link_vfunc(int i)const
+{
+       assert(i>=0 && i<3);
+       switch(i)
+       {
+               case 0:
+                       return ref_gradient;
+               case 1:
+                       return ref_offset;
+       }
+       return 0;
+}
+
+int
+ValueNode_GradientRotate::link_count()const
+{
+       return 2;
+}
+
+String
+ValueNode_GradientRotate::link_local_name(int i)const
+{
+       assert(i>=0 && i<2);
+       switch(i)
+       {
+               case 0:
+                       return _("Gradient");
+               case 1:
+                       return _("Offset");
+       }
+       return String();
+}      
+
+String
+ValueNode_GradientRotate::link_name(int i)const
+{
+       assert(i>=0 && i<2);
+       switch(i)
+       {
+               case 0:
+                       return "gradient";
+               case 1:
+                       return "offset";
+       }
+       return String();
+}      
+
+int
+ValueNode_GradientRotate::get_link_index_from_name(const String &name)const
+{
+       if(name=="gradient")
+               return 0;
+       if(name=="offset")
+               return 1;
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_GradientRotate::get_name()const
+{
+       return "gradient_rotate";
+}
+
+String
+ValueNode_GradientRotate::get_local_name()const
+{
+       return _("Gradient Rotate");
+}
+
+bool
+ValueNode_GradientRotate::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_GRADIENT;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_gradientrotate.h b/synfig-core/trunk/src/synfig/valuenode_gradientrotate.h
new file mode 100644 (file)
index 0000000..a101758
--- /dev/null
@@ -0,0 +1,102 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_twotone.h
+**     \brief Template Header
+**
+**     $Id: valuenode_gradientrotate.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_GRADIENTROTATE_H
+#define __SINFG_VALUENODE_GRADIENTROTATE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+struct ValueNode_GradientRotate : public LinkableValueNode
+{
+       typedef etl::handle<ValueNode_GradientRotate> Handle;
+       typedef etl::handle<const ValueNode_GradientRotate> ConstHandle;
+       
+protected:
+
+       ValueNode_GradientRotate();
+
+private:
+
+       ValueNode::RHandle ref_gradient;
+       ValueNode::RHandle ref_offset;
+
+public:
+
+       virtual ~ValueNode_GradientRotate();
+
+//     static Handle create(ValueBase::Type id=ValueBase::TYPE_GRADIENT);
+
+       //! Sets the left-hand-side value_node
+       bool set_gradient(ValueNode::Handle a);
+
+       //! Gets the left-hand-side value_node
+       ValueNode::Handle get_gradient()const { return ref_gradient; }
+
+       //! Sets the right-hand-side value_node
+       bool set_offset(ValueNode::Handle b);
+
+       //! Gets the right-hand-side value_node
+       ValueNode::Handle get_offset()const { return ref_gradient; }
+
+
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+
+       virtual int link_count()const;
+
+       virtual String link_local_name(int i)const;
+       virtual String link_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+//     static bool check_type(const ValueBase::Type &type);
+protected:
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+
+       LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_GradientRotate* create(const ValueBase &x=ValueBase::TYPE_GRADIENT);
+}; // END of class ValueNode_GradientRotate
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_linear.cpp b/synfig-core/trunk/src/synfig/valuenode_linear.cpp
new file mode 100644 (file)
index 0000000..625d729
--- /dev/null
@@ -0,0 +1,214 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_linear.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_linear.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_linear.h"
+#include "valuenode_const.h"
+#include "general.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_Linear::ValueNode_Linear(const ValueBase::Type &x):
+       LinkableValueNode(x)
+{
+       switch(x)
+       {
+       case ValueBase::TYPE_REAL:
+               set_link("slope",ValueNode_Const::create(Real(1)));
+               set_link("offset",ValueNode_Const::create(Real(0)));
+               break;
+       case ValueBase::TYPE_TIME:
+               set_link("slope",ValueNode_Const::create(Time(1)));
+               set_link("offset",ValueNode_Const::create(Time(0)));
+               break;
+       case ValueBase::TYPE_VECTOR:
+               set_link("slope",ValueNode_Const::create(Vector(1.0,1.0)));
+               set_link("offset",ValueNode_Const::create(Vector(0.0,0.0)));
+               break;
+       case ValueBase::TYPE_ANGLE:
+               set_link("slope",ValueNode_Const::create(Angle::deg(90)));
+               set_link("offset",ValueNode_Const::create(Angle::deg(0)));
+               break;
+       default:
+               throw Exception::BadType(ValueBase::type_name(x));
+       }
+
+       DCAST_HACK_ENABLE();
+}
+
+ValueNode_Linear*
+ValueNode_Linear::create(const ValueBase &x)
+{
+       return new ValueNode_Linear(x.get_type());
+}
+
+ValueNode_Linear::~ValueNode_Linear()
+{
+       unlink_all();
+}
+
+ValueBase
+ValueNode_Linear::operator()(Time t)const
+{
+       switch(get_type())
+       {
+       case ValueBase::TYPE_TIME:
+               return (*m_)(t).get(Time())*t+(*b_)(t).get(Time());
+       case ValueBase::TYPE_REAL:
+               return (*m_)(t).get(Real())*t+(*b_)(t).get(Real());
+       case ValueBase::TYPE_VECTOR:
+               return (*m_)(t).get(Vector())*t+(*b_)(t).get(Vector());
+       case ValueBase::TYPE_ANGLE:
+               return (*m_)(t).get(Angle())*t+(*b_)(t).get(Angle());
+       default:
+               assert(0);
+               break;
+       }
+       return ValueBase();
+}
+
+
+String
+ValueNode_Linear::get_name()const
+{
+       return "linear";
+}
+
+String
+ValueNode_Linear::get_local_name()const
+{
+       return _("Linear");
+}
+               
+bool
+ValueNode_Linear::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_REAL
+               || type==ValueBase::TYPE_VECTOR
+               || type==ValueBase::TYPE_TIME
+               || type==ValueBase::TYPE_ANGLE;
+}
+
+bool
+ValueNode_Linear::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i==0 || i==1);
+       if(i==0)
+       {
+               m_=x;
+               signal_child_changed()(i);signal_value_changed()();
+               return true;
+       }
+       if(i==1)
+       {
+               b_=x;
+               signal_child_changed()(i);signal_value_changed()();
+               return true;
+       }
+       return false;
+}
+
+ValueNode::LooseHandle
+ValueNode_Linear::get_link_vfunc(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return m_;
+       if(i==1)
+               return b_;
+
+       return 0;
+}
+
+int
+ValueNode_Linear::link_count()const
+{
+       return 2;
+}
+
+String
+ValueNode_Linear::link_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return "slope";
+       if(i==1)
+               return "offset";
+       return String();
+}
+
+String
+ValueNode_Linear::link_local_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               switch(get_type())
+               {
+               case ValueBase::TYPE_REAL:
+               case ValueBase::TYPE_TIME:
+               case ValueBase::TYPE_ANGLE:
+                       return _("Rate");
+               default:
+                       return _("Slope");
+               }
+       if(i==1)
+               return _("Offset");
+       return String();
+}
+
+int
+ValueNode_Linear::get_link_index_from_name(const String &name)const
+{
+       if(name=="slope")
+               return 0;
+       if(name=="offset")
+               return 1;
+       
+       throw Exception::BadLinkName(name);
+}
+
+LinkableValueNode*
+ValueNode_Linear::create_new()const
+{
+       return new ValueNode_Linear(get_type());
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_linear.h b/synfig-core/trunk/src/synfig/valuenode_linear.h
new file mode 100644 (file)
index 0000000..c8e7513
--- /dev/null
@@ -0,0 +1,81 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_linear.h
+**     \brief Template Header
+**
+**     $Id: valuenode_linear.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_INTERPOLATION_LINEAR_H
+#define __SINFG_VALUENODE_INTERPOLATION_LINEAR_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueNode_Linear : public LinkableValueNode
+{
+       ValueNode::RHandle m_;
+       ValueNode::RHandle b_;
+       
+       ValueNode_Linear(const ValueBase::Type &x);
+
+public:
+
+       typedef etl::handle<ValueNode_Linear> Handle;
+       typedef etl::handle<const ValueNode_Linear> ConstHandle;
+
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual ~ValueNode_Linear();
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+       virtual int link_count()const;
+       virtual String link_name(int i)const;
+
+       virtual String link_local_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+protected:
+       LinkableValueNode* create_new()const;
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_Linear* create(const ValueBase &x);
+}; // END of class ValueNode_Linear
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_radialcomposite.cpp b/synfig-core/trunk/src/synfig/valuenode_radialcomposite.cpp
new file mode 100644 (file)
index 0000000..8b21fab
--- /dev/null
@@ -0,0 +1,275 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_radialcomposite.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_radialcomposite.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_radialcomposite.h"
+#include "valuenode_const.h"
+#include <stdexcept>
+#include "general.h"
+#include "color.h"
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::ValueNode_RadialComposite::ValueNode_RadialComposite(const ValueBase &value):
+       LinkableValueNode(value.get_type())
+{
+       switch(get_type())
+       {
+               case ValueBase::TYPE_VECTOR:
+               {
+                       Vector vect(value.get(Vector()));
+                       set_link("r",ValueNode_Const::create(vect.mag()));
+                       set_link("t",ValueNode_Const::create(Angle(Angle::tan(vect[1],vect[0]))));
+               }
+                       break;
+               case ValueBase::TYPE_COLOR:
+                       set_link("y",ValueNode_Const::create(value.get(Color()).get_y()));
+                       set_link("s",ValueNode_Const::create(value.get(Color()).get_s()));
+                       set_link("h",ValueNode_Const::create(value.get(Color()).get_hue()));
+                       set_link("a",ValueNode_Const::create(value.get(Color()).get_a()));
+                       break;
+               default:
+                       assert(0);
+                       throw Exception::BadType(ValueBase::type_name(get_type()));                     
+       }
+}
+
+ValueNode_RadialComposite::~ValueNode_RadialComposite()
+{
+       unlink_all();
+}
+
+ValueNode_RadialComposite*
+ValueNode_RadialComposite::create(const ValueBase &value)
+{
+       return new ValueNode_RadialComposite(value);
+}
+       
+LinkableValueNode*
+ValueNode_RadialComposite::create_new()const
+{
+       return new ValueNode_RadialComposite(ValueBase(get_type()));
+}
+
+ValueBase
+sinfg::ValueNode_RadialComposite::operator()(Time t)const
+{
+       switch(get_type())
+       {
+               case ValueBase::TYPE_VECTOR:
+               {
+                       Real mag;
+                       Angle angle;
+                       assert(components[0] && components[1]);
+                       mag=(*components[0])(t).get(mag);
+                       angle=(*components[1])(t).get(angle);
+                       return Vector(Angle::cos(angle).get()*mag,Angle::sin(angle).get()*mag);
+               }
+               case ValueBase::TYPE_COLOR:
+               {
+                       assert(components[0] && components[1] && components[2] && components[3]);
+                       return Color::YUV(
+                               (*components[0])(t).get(Real()),
+                               (*components[1])(t).get(Real()),
+                               (*components[2])(t).get(Angle()),
+                               (*components[3])(t).get(Real())
+                       );
+               }
+               default:
+                       sinfg::error(string("ValueNode_RadialComposite::operator():")+_("Bad type for radialcomposite"));
+                       assert(components[0]);
+                       return (*components[0])(t);
+       }
+}
+
+int
+ValueNode_RadialComposite::link_count()const
+{
+       switch(get_type())
+       {
+       case ValueBase::TYPE_VECTOR:
+               return 2;
+       case ValueBase::TYPE_COLOR:
+               return 4;
+       default:
+               sinfg::warning(string("ValueNode_RadialComposite::component_count():")+_("Bad type for radialcomposite"));
+               return 1;
+       }
+}
+
+bool
+ValueNode_RadialComposite::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i>=0);
+       assert(i<6);
+       
+       if(PlaceholderValueNode::Handle::cast_dynamic(x))
+       {
+               components[i]=x;
+               return true;
+       }
+
+       switch(get_type())
+       {
+               case ValueBase::TYPE_VECTOR:
+                       assert(i<2);
+                       if(i==0 && x->get_type()!=ValueBase::TYPE_REAL)
+                               return false;
+                       if(i==1 && x->get_type()!=ValueBase::TYPE_ANGLE)
+                               return false;
+                       components[i]=x;
+                       return true;
+                       break;
+
+               case ValueBase::TYPE_COLOR:
+                       assert(i<4);
+                       if((i==0 || i==1 || i==3) && x->get_type()!=ValueBase::TYPE_REAL)
+                               return false;
+                       if((i==2) && x->get_type()!=ValueBase::TYPE_ANGLE)
+                               return false;
+                       components[i]=x;
+                       return true;
+                       break;
+                       
+                       
+               default:
+                       break;
+       }
+       return false;   
+}
+
+ValueNode::LooseHandle
+ValueNode_RadialComposite::get_link_vfunc(int i)const
+{
+       assert(i>=0 && i<6);
+       return components[i];
+}
+
+String
+ValueNode_RadialComposite::link_local_name(int i)const
+{
+       assert(i>=0 && i<6);
+       switch(get_type())
+       {
+               case ValueBase::TYPE_VECTOR:
+                       if(i==0)
+                               return _("Radius");
+                       else if(i==1)
+                               return _("Theta");
+                       break;
+
+               case ValueBase::TYPE_COLOR:
+                       if(i==0)
+                               return _("Luma");
+                       else if(i==1)
+                               return _("Saturation");
+                       else if(i==2)
+                               return _("Hue");
+                       else if(i==3)
+                               return _("Alpha");
+                       break;
+                       
+               default:
+                       break;
+       }
+       return etl::strprintf(_("C%d"),i+1);    
+}      
+
+
+String
+ValueNode_RadialComposite::link_name(int i)const
+{
+       assert(i>=0 && i<5);
+       return strprintf("c%d",i);
+}      
+
+int
+ValueNode_RadialComposite::get_link_index_from_name(const String &name)const
+{
+       if(name.empty())
+               throw Exception::BadLinkName(name);
+
+       if(name[0]=='c')
+               return name[1]-'0';
+
+       switch(get_type())
+       {
+       case ValueBase::TYPE_COLOR:
+               if(name[0]=='y')
+                       return 0;
+               if(name[0]=='s')
+                       return 1;
+               if(name[0]=='h')
+                       return 2;
+               if(name[0]=='a')
+                       return 3;
+       case ValueBase::TYPE_VECTOR:
+               if(name[0]=='r')
+                       return 0;
+               if(name[0]=='t')
+                       return 1;
+       default:                        
+               break;
+       }
+
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_RadialComposite::get_name()const
+{
+       return "radial_composite";
+}
+
+String
+ValueNode_RadialComposite::get_local_name()const
+{
+       return _("RadialComposite");
+}
+
+bool
+ValueNode_RadialComposite::check_type(ValueBase::Type type)
+{
+       return
+               type==ValueBase::TYPE_VECTOR ||
+               type==ValueBase::TYPE_COLOR;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_radialcomposite.h b/synfig-core/trunk/src/synfig/valuenode_radialcomposite.h
new file mode 100644 (file)
index 0000000..5236f4e
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_radialcomposite.h
+**     \brief Template Header
+**
+**     $Id: valuenode_radialcomposite.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_RADIALCOMPOSITE_H
+#define __SINFG_VALUENODE_RADIALCOMPOSITE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueNode_RadialComposite : public LinkableValueNode
+{
+       ValueNode::RHandle components[6];
+       ValueNode_RadialComposite(const ValueBase &value);
+       
+public:
+       typedef etl::handle<ValueNode_RadialComposite> Handle;
+       typedef etl::handle<const ValueNode_RadialComposite> ConstHandle;
+
+
+       virtual ~ValueNode_RadialComposite();
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+       virtual int link_count()const;
+       virtual String link_name(int i)const;
+       virtual String link_local_name(int i)const;
+       virtual ValueBase operator()(Time t)const;
+
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+       virtual int get_link_index_from_name(const String &name)const;
+       
+protected:
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+       
+       LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_RadialComposite* create(const ValueBase &x);
+}; // END of class ValueNode_RadialComposite
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_reference.cpp b/synfig-core/trunk/src/synfig/valuenode_reference.cpp
new file mode 100644 (file)
index 0000000..8349509
--- /dev/null
@@ -0,0 +1,150 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_reference.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_reference.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_reference.h"
+#include "valuenode_const.h"
+#include "general.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_Reference::ValueNode_Reference(const ValueBase::Type &x):
+       LinkableValueNode(x)
+{
+}
+
+ValueNode_Reference::ValueNode_Reference(const ValueNode::Handle &x):
+       LinkableValueNode(x->get_type())
+{
+       set_link("link",x);
+}
+
+ValueNode_Reference*
+ValueNode_Reference::create(const ValueBase &x)
+{
+       return new ValueNode_Reference(ValueNode_Const::create(x));
+}
+
+LinkableValueNode*
+ValueNode_Reference::create_new()const
+{
+       return new ValueNode_Reference(get_type());
+}
+
+ValueNode_Reference::~ValueNode_Reference()
+{
+       unlink_all();
+}
+
+bool
+ValueNode_Reference::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i==0);
+       if(x->get_type()!=get_type() && !PlaceholderValueNode::Handle::cast_dynamic(x))
+               return false;
+       link_=x;
+       signal_child_changed()(i);signal_value_changed()();
+       return true;
+}
+       
+ValueNode::LooseHandle
+ValueNode_Reference::get_link_vfunc(int i)const
+{
+       assert(i==0);
+       return link_;
+}
+
+int
+ValueNode_Reference::link_count()const
+{
+       return 1;
+}
+
+String
+ValueNode_Reference::link_local_name(int i)const
+{
+       assert(i==0);
+       return _("Link");
+}      
+
+String
+ValueNode_Reference::link_name(int i)const
+{
+       return "link";
+}
+
+int
+ValueNode_Reference::get_link_index_from_name(const String &name)const
+{
+       if(name=="link")
+               return 0;
+
+       throw Exception::BadLinkName(name);
+}
+
+ValueBase
+ValueNode_Reference::operator()(Time t)const
+{
+       return (*link_)(t);
+}
+
+
+String
+ValueNode_Reference::get_name()const
+{
+       return "reference";
+}
+
+String
+ValueNode_Reference::get_local_name()const
+{
+       return _("Reference");
+}
+
+bool
+ValueNode_Reference::check_type(ValueBase::Type type)
+{
+       if(type)
+               return true;
+       return false;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_reference.h b/synfig-core/trunk/src/synfig/valuenode_reference.h
new file mode 100644 (file)
index 0000000..9ea1cee
--- /dev/null
@@ -0,0 +1,84 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_reference.h
+**     \brief Template Header
+**
+**     $Id: valuenode_reference.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_REFERENCE_H
+#define __SINFG_VALUENODE_REFERENCE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueNode_Reference : public LinkableValueNode
+{
+       ValueNode::RHandle link_;
+public:
+       typedef etl::handle<ValueNode_Reference> Handle;
+       typedef etl::handle<const ValueNode_Reference> ConstHandle;
+
+       ValueNode_Reference(const ValueBase::Type &x);
+
+       ValueNode_Reference(const ValueNode::Handle &x);
+
+//     static Handle create(const ValueBase::Type &x);
+//     static Handle create(const ValueNode::Handle &x);
+
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+
+       virtual int link_count()const;
+
+       virtual String link_name(int i)const;
+
+       virtual String link_local_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual ~ValueNode_Reference();
+
+       virtual String get_name()const;
+
+       virtual String get_local_name()const;
+
+protected:
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+       
+       LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_Reference* create(const ValueBase &x);
+}; // END of class ValueNode_Reference
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_scale.cpp b/synfig-core/trunk/src/synfig/valuenode_scale.cpp
new file mode 100644 (file)
index 0000000..2911b84
--- /dev/null
@@ -0,0 +1,277 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_scale.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_scale.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "general.h"
+#include "valuenode_scale.h"
+#include "valuenode_const.h"
+#include <stdexcept>
+#include <cassert>
+#include "color.h"
+#include "vector.h"
+#include "time.h"
+#include "angle.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_Scale::ValueNode_Scale():LinkableValueNode(sinfg::ValueBase::TYPE_NIL)
+{
+       set_scalar(1.0);
+}
+
+ValueNode_Scale*
+ValueNode_Scale::create(const ValueBase& x)
+{
+       ValueNode_Scale* value_node;
+       switch(x.get_type())
+       {
+       case ValueBase::TYPE_VECTOR:
+       case ValueBase::TYPE_REAL:
+       case ValueBase::TYPE_TIME:
+       case ValueBase::TYPE_INTEGER:
+       case ValueBase::TYPE_ANGLE:
+       case ValueBase::TYPE_COLOR:
+               value_node=new ValueNode_Scale();
+               if(!value_node->set_value_node(ValueNode_Const::create(x)))
+                       return 0;
+               assert(value_node->get_value_node()->get_type()==x.get_type());
+               break;
+       default:
+               assert(0);
+               throw runtime_error("sinfg::ValueNode_Scale:Bad type "+ValueBase::type_name(x.get_type()));                     
+       }
+       assert(value_node);
+       assert(value_node->get_type()==x.get_type());
+       
+       return value_node;
+}
+
+LinkableValueNode*
+ValueNode_Scale::create_new()const
+{
+       return new ValueNode_Scale();
+}
+
+sinfg::ValueNode_Scale::~ValueNode_Scale()
+{
+       unlink_all();
+}
+
+void
+ValueNode_Scale::set_scalar(Real x)
+{
+       set_link("scalar",ValueNode::Handle(ValueNode_Const::create(x)));
+}
+
+bool
+ValueNode_Scale::set_scalar(const ValueNode::Handle &x)
+{
+       if(!x
+               || x->get_type()!=ValueBase::TYPE_REAL
+               && !PlaceholderValueNode::Handle::cast_dynamic(x)
+       )
+               return false;
+       scalar=x;
+       return true;
+}
+
+ValueNode::Handle
+ValueNode_Scale::get_scalar()const
+{
+       return scalar;
+}
+
+bool
+ValueNode_Scale::set_value_node(const ValueNode::Handle &x)
+{
+       if(!x
+               || ( get_type()==ValueBase::TYPE_NIL
+                       && !check_type(x->get_type()) )
+               || ( get_type()!=ValueBase::TYPE_NIL
+                       && x->get_type()!=get_type() ) &&
+               !PlaceholderValueNode::Handle::cast_dynamic(x)
+       )
+               return false;
+
+       assert(!(PlaceholderValueNode::Handle::cast_dynamic(x) && !get_type()));
+
+       value_node=x;
+
+       if(!get_type())
+               set_type(x->get_type());
+
+       return true;
+}
+
+ValueNode::Handle
+ValueNode_Scale::get_value_node()const
+{
+       return value_node;
+}
+
+
+sinfg::ValueBase
+sinfg::ValueNode_Scale::operator()(Time t)const
+{
+       if(!value_node || !scalar)
+               throw runtime_error(strprintf("ValueNode_Scale: %s",_("One or both of my parameters aren't set!")));
+       else
+       if(get_type()==ValueBase::TYPE_VECTOR)
+               return (*value_node)(t).get(Vector())*(*scalar)(t).get(Real());
+       else
+       if(get_type()==ValueBase::TYPE_REAL)
+               return (*value_node)(t).get(Real())*(*scalar)(t).get(Real());
+       else
+       if(get_type()==ValueBase::TYPE_TIME)
+               return (*value_node)(t).get(Time())*(*scalar)(t).get(Time());
+       else
+       if(get_type()==ValueBase::TYPE_INTEGER)
+               return (*value_node)(t).get(int())*(*scalar)(t).get(Real());
+       else
+       if(get_type()==ValueBase::TYPE_ANGLE)
+               return (*value_node)(t).get(Angle())*(*scalar)(t).get(Real());
+       else
+       if(get_type()==ValueBase::TYPE_COLOR)
+       {
+               Color ret((*value_node)(t).get(Color()));
+               Real s((*scalar)(t).get(Real()));
+               ret.set_r(ret.get_r()*s);
+               ret.set_g(ret.get_r()*s);
+               ret.set_b(ret.get_r()*s);
+               return ret;
+       }
+
+       assert(0);
+       return ValueBase();
+}
+
+
+bool
+ValueNode_Scale::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       if(!(i==0 || i==1))
+               return false;
+       
+       if(i==0 && !set_value_node(x))
+               return false;
+       else
+       if(i==1 && !set_scalar(x))
+               return false;
+       
+       signal_child_changed()(i);signal_value_changed()();
+
+       return true;
+}
+
+ValueNode::LooseHandle
+ValueNode_Scale::get_link_vfunc(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return value_node;
+       else if(i==1)
+               return scalar;
+       return 0;
+}
+
+int
+ValueNode_Scale::link_count()const
+{
+       return 2;
+}
+
+String
+ValueNode_Scale::link_local_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return _("Link");
+       else if(i==1)
+               return _("Scalar");
+       return String();
+}      
+
+String
+ValueNode_Scale::link_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return "link";
+       else if(i==1)
+               return "scalar";
+       return String();
+}
+
+int
+ValueNode_Scale::get_link_index_from_name(const String &name)const
+{
+       if(name=="link")
+               return 0;
+       if(name=="scalar")
+               return 1;
+       
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_Scale::get_name()const
+{
+       return "scale";
+}
+
+String
+ValueNode_Scale::get_local_name()const
+{
+       return _("Scale");
+}
+
+bool
+ValueNode_Scale::check_type(ValueBase::Type type)
+{
+       return
+               type==ValueBase::TYPE_VECTOR ||
+               type==ValueBase::TYPE_REAL ||
+               type==ValueBase::TYPE_INTEGER ||
+               type==ValueBase::TYPE_COLOR ||
+               type==ValueBase::TYPE_ANGLE;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_scale.h b/synfig-core/trunk/src/synfig/valuenode_scale.h
new file mode 100644 (file)
index 0000000..8fe196d
--- /dev/null
@@ -0,0 +1,102 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_scale.h
+**     \brief Template Header
+**
+**     $Id: valuenode_scale.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_SCALE_H
+#define __SINFG_VALUENODE_SCALE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+struct ValueNode_Scale : public LinkableValueNode
+{
+       typedef etl::handle<ValueNode_Scale> Handle;
+       typedef etl::handle<const ValueNode_Scale> ConstHandle;
+       
+private:
+       ValueNode::RHandle value_node;
+       ValueNode::RHandle scalar;
+
+       ValueNode_Scale();
+
+public:
+
+       //static Handle create(ValueBase::Type id=ValueBase::TYPE_NIL);
+
+       //static Handle create(ValueNode::Handle value_node, Real scalar);
+
+       virtual ~ValueNode_Scale();
+
+       //! \writeme
+       bool set_value_node(const ValueNode::Handle &a);
+
+       //! \writeme
+       ValueNode::Handle get_value_node()const;
+
+       void set_scalar(Real x);
+
+       bool set_scalar(const ValueNode::Handle &x);
+
+       ValueNode::Handle get_scalar()const;
+
+
+
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+
+       virtual int link_count()const;
+
+       virtual String link_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual String get_name()const;
+       
+       virtual String get_local_name()const;
+
+       virtual String link_local_name(int i)const;
+
+protected:
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+       
+       virtual LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_Scale* create(const ValueBase &x);
+}; // END of class ValueNode_Scale
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_segcalctangent.cpp b/synfig-core/trunk/src/synfig/valuenode_segcalctangent.cpp
new file mode 100644 (file)
index 0000000..ba7844f
--- /dev/null
@@ -0,0 +1,186 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_segcalctangent.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_segcalctangent.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_segcalctangent.h"
+#include "valuenode_const.h"
+#include "valuenode_composite.h"
+#include "general.h"
+#include "exception.h"
+#include <ETL/hermite>
+#include <ETL/calculus>
+#include "segment.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_SegCalcTangent::ValueNode_SegCalcTangent(const ValueBase::Type &x):
+       LinkableValueNode(x)
+{
+       if(x!=ValueBase::TYPE_VECTOR)
+               throw Exception::BadType(ValueBase::type_name(x));
+       
+       segment_=ValueNode_Composite::create(ValueBase::TYPE_SEGMENT);
+       amount_=ValueNode_Const::create(Real(0.5));
+}
+
+ValueNode_SegCalcTangent*
+ValueNode_SegCalcTangent::create(const ValueBase &x)
+{
+       return new ValueNode_SegCalcTangent(x.get_type());
+}
+
+ValueNode_SegCalcTangent::~ValueNode_SegCalcTangent()
+{
+       unlink_all();
+}
+
+ValueBase
+ValueNode_SegCalcTangent::operator()(Time t)const
+{
+       Segment segment((*segment_)(t).get(Segment()));
+
+       etl::hermite<Vector> curve(segment.p1,segment.p2,segment.t1,segment.t2);
+       etl::derivative< etl::hermite<Vector> > deriv(curve);
+       
+#ifdef ETL_FIXED_DERIVATIVE
+       return deriv((*amount_)(t).get(Real()))*(0.5);
+#else
+       return deriv((*amount_)(t).get(Real()))*(-0.5);
+#endif
+       
+}
+
+
+String
+ValueNode_SegCalcTangent::get_name()const
+{
+       return "segcalctangent";
+}
+
+String
+ValueNode_SegCalcTangent::get_local_name()const
+{
+       return _("SegCalcTangent");
+}
+               
+bool
+ValueNode_SegCalcTangent::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_VECTOR;
+}
+
+bool
+ValueNode_SegCalcTangent::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i==0 || i==1);
+       if(i==0)
+       {
+               segment_=x;
+               signal_child_changed()(i);signal_value_changed()();
+               return true;
+       }
+       if(i==1)
+       {
+               amount_=x;
+               signal_child_changed()(i);signal_value_changed()();
+               return true;
+       }
+       return false;
+}
+
+ValueNode::LooseHandle
+ValueNode_SegCalcTangent::get_link_vfunc(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return segment_;
+       if(i==1)
+               return amount_;
+
+       return 0;
+}
+
+int
+ValueNode_SegCalcTangent::link_count()const
+{
+       return 2;
+}
+
+String
+ValueNode_SegCalcTangent::link_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return "segment";
+       if(i==1)
+               return "amount";
+       return String();
+}
+
+String
+ValueNode_SegCalcTangent::link_local_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return _("Segment");
+       if(i==1)
+               return _("Amount");
+       return String();
+}
+
+int
+ValueNode_SegCalcTangent::get_link_index_from_name(const String &name)const
+{
+       if(name=="segment")
+               return 0;
+       if(name=="amount")
+               return 1;
+       
+       throw Exception::BadLinkName(name);
+}
+
+LinkableValueNode*
+ValueNode_SegCalcTangent::create_new()const
+{
+       return new ValueNode_SegCalcTangent(ValueBase::TYPE_VECTOR);
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_segcalctangent.h b/synfig-core/trunk/src/synfig/valuenode_segcalctangent.h
new file mode 100644 (file)
index 0000000..38ab1ff
--- /dev/null
@@ -0,0 +1,82 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_segcalctangent.h
+**     \brief Template Header
+**
+**     $Id: valuenode_segcalctangent.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_SEGCALCTANGENT_H
+#define __SINFG_VALUENODE_SEGCALCTANGENT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueNode_SegCalcTangent : public LinkableValueNode
+{
+       ValueNode::RHandle segment_;
+       ValueNode::RHandle amount_;
+       
+       ValueNode_SegCalcTangent(const ValueBase::Type &x=ValueBase::TYPE_VECTOR);
+
+public:
+
+       typedef etl::handle<ValueNode_SegCalcTangent> Handle;
+       typedef etl::handle<const ValueNode_SegCalcTangent> ConstHandle;
+
+       //static Handle create(const ValueBase::Type &x=ValueBase::TYPE_VECTOR);
+
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual ~ValueNode_SegCalcTangent();
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+       virtual int link_count()const;
+       virtual String link_name(int i)const;
+
+       virtual String link_local_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+protected:
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+       LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_SegCalcTangent* create(const ValueBase &x=ValueBase::TYPE_VECTOR);
+}; // END of class ValueNode_SegCalcTangent
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_segcalcvertex.cpp b/synfig-core/trunk/src/synfig/valuenode_segcalcvertex.cpp
new file mode 100644 (file)
index 0000000..8684f11
--- /dev/null
@@ -0,0 +1,180 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_segcalcvertex.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_segcalcvertex.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_segcalcvertex.h"
+#include "valuenode_const.h"
+#include "valuenode_composite.h"
+#include "general.h"
+#include "exception.h"
+#include <ETL/hermite>
+#include "segment.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_SegCalcVertex::ValueNode_SegCalcVertex(const ValueBase::Type &x):
+       LinkableValueNode(x)
+{
+       if(x!=ValueBase::TYPE_VECTOR)
+               throw Exception::BadType(ValueBase::type_name(x));
+       
+       segment_=ValueNode_Composite::create(ValueBase::TYPE_SEGMENT);
+       amount_=ValueNode_Const::create(Real(0.5));
+       
+}
+
+ValueNode_SegCalcVertex*
+ValueNode_SegCalcVertex::create(const ValueBase &x)
+{
+       return new ValueNode_SegCalcVertex(x.get_type());
+}
+
+ValueNode_SegCalcVertex::~ValueNode_SegCalcVertex()
+{
+       unlink_all();
+}
+
+ValueBase
+ValueNode_SegCalcVertex::operator()(Time t)const
+{
+       Segment segment((*segment_)(t).get(Segment()));
+
+       etl::hermite<Vector> curve(segment.p1,segment.p2,segment.t1,segment.t2);
+       
+       return curve((*amount_)(t).get(Real()));
+}
+
+
+String
+ValueNode_SegCalcVertex::get_name()const
+{
+       return "segcalcvertex";
+}
+
+String
+ValueNode_SegCalcVertex::get_local_name()const
+{
+       return _("SegCalcVertex");
+}
+               
+bool
+ValueNode_SegCalcVertex::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_VECTOR;
+}
+
+bool
+ValueNode_SegCalcVertex::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i==0 || i==1);
+       if(i==0)
+       {
+               segment_=x;
+               signal_child_changed()(i);signal_value_changed()();
+               return true;
+       }
+       if(i==1)
+       {
+               amount_=x;
+               signal_child_changed()(i);signal_value_changed()();
+               return true;
+       }
+       return false;
+}
+
+ValueNode::LooseHandle
+ValueNode_SegCalcVertex::get_link_vfunc(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return segment_;
+       if(i==1)
+               return amount_;
+
+       return 0;
+}
+
+int
+ValueNode_SegCalcVertex::link_count()const
+{
+       return 2;
+}
+
+String
+ValueNode_SegCalcVertex::link_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return "segment";
+       if(i==1)
+               return "amount";
+       return String();
+}
+
+String
+ValueNode_SegCalcVertex::link_local_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return _("Segment");
+       if(i==1)
+               return _("Amount");
+       return String();
+}
+
+int
+ValueNode_SegCalcVertex::get_link_index_from_name(const String &name)const
+{
+       if(name=="segment")
+               return 0;
+       if(name=="amount")
+               return 1;
+       
+       throw Exception::BadLinkName(name);
+}
+
+LinkableValueNode*
+ValueNode_SegCalcVertex::create_new()const
+{
+       return new ValueNode_SegCalcVertex(ValueBase::TYPE_VECTOR);
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_segcalcvertex.h b/synfig-core/trunk/src/synfig/valuenode_segcalcvertex.h
new file mode 100644 (file)
index 0000000..43a63e7
--- /dev/null
@@ -0,0 +1,83 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_segcalcvertex.h
+**     \brief Template Header
+**
+**     $Id: valuenode_segcalcvertex.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_SEGCALCVERTEX_H
+#define __SINFG_VALUENODE_SEGCALCVERTEX_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueNode_SegCalcVertex : public LinkableValueNode
+{
+       ValueNode::RHandle segment_;
+       ValueNode::RHandle amount_;
+       
+       ValueNode_SegCalcVertex(const ValueBase::Type &x=ValueBase::TYPE_VECTOR);
+
+public:
+
+       typedef etl::handle<ValueNode_SegCalcVertex> Handle;
+       typedef etl::handle<const ValueNode_SegCalcVertex> ConstHandle;
+
+//     static Handle create(const ValueBase::Type &x=ValueBase::TYPE_VECTOR);
+
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual ~ValueNode_SegCalcVertex();
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+//     static bool check_type(const ValueBase::Type &type);
+
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+       virtual int link_count()const;
+       virtual String link_name(int i)const;
+
+       virtual String link_local_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+protected:
+       LinkableValueNode* create_new()const;
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_SegCalcVertex* create(const ValueBase &x=ValueBase::TYPE_VECTOR);
+}; // END of class ValueNode_SegCalcVertex
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_sine.cpp b/synfig-core/trunk/src/synfig/valuenode_sine.cpp
new file mode 100644 (file)
index 0000000..538a1aa
--- /dev/null
@@ -0,0 +1,181 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_sine.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_sine.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "valuenode_sine.h"
+#include "valuenode_const.h"
+#include "general.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_Sine::ValueNode_Sine(const ValueBase::Type &x):
+       LinkableValueNode(x)
+{
+       switch(x)
+       {
+       case ValueBase::TYPE_REAL:
+               set_link("angle",ValueNode_Const::create(Angle::zero()));
+               set_link("amp",ValueNode_Const::create(Real(1)));
+               break;
+       default:
+               throw Exception::BadType(ValueBase::type_name(x));
+       }
+
+       DCAST_HACK_ENABLE();
+}
+
+ValueNode_Sine*
+ValueNode_Sine::create(const ValueBase &x)
+{
+       return new ValueNode_Sine(x.get_type());
+}
+
+ValueNode_Sine::~ValueNode_Sine()
+{
+       unlink_all();
+}
+
+ValueBase
+ValueNode_Sine::operator()(Time t)const
+{
+       return
+               Angle::sin(
+                       (*angle_)(t).get(Angle())
+               ).get() * (*amp_)(t).get(Real())
+       ;
+}
+
+
+String
+ValueNode_Sine::get_name()const
+{
+       return "sine";
+}
+
+String
+ValueNode_Sine::get_local_name()const
+{
+       return _("Sine");
+}
+               
+bool
+ValueNode_Sine::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_REAL;
+}
+
+bool
+ValueNode_Sine::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i==0 || i==1);
+       if(i==0)
+       {
+               angle_=x;
+               signal_child_changed()(i);signal_value_changed()();
+               return true;
+       }
+       if(i==1)
+       {
+               amp_=x;
+               signal_child_changed()(i);signal_value_changed()();
+               return true;
+       }
+       return false;
+}
+
+ValueNode::LooseHandle
+ValueNode_Sine::get_link_vfunc(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return angle_;
+       if(i==1)
+               return amp_;
+
+       return 0;
+}
+
+int
+ValueNode_Sine::link_count()const
+{
+       return 2;
+}
+
+String
+ValueNode_Sine::link_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return "angle";
+       if(i==1)
+               return "amp";
+       return String();
+}
+
+String
+ValueNode_Sine::link_local_name(int i)const
+{
+       assert(i==0 || i==1);
+       if(i==0)
+               return _("Angle");
+       if(i==1)
+               return _("Amplitude");
+       return String();
+}
+
+int
+ValueNode_Sine::get_link_index_from_name(const String &name)const
+{
+       if(name=="angle")
+               return 0;
+       if(name=="amp")
+               return 1;
+       
+       throw Exception::BadLinkName(name);
+}
+
+LinkableValueNode*
+ValueNode_Sine::create_new()const
+{
+       return new ValueNode_Sine(get_type());
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_sine.h b/synfig-core/trunk/src/synfig/valuenode_sine.h
new file mode 100644 (file)
index 0000000..9484c5e
--- /dev/null
@@ -0,0 +1,81 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_sine.h
+**     \brief Template Header
+**
+**     $Id: valuenode_sine.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_SINE_H
+#define __SINFG_VALUENODE_SINE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+class ValueNode_Sine : public LinkableValueNode
+{
+       ValueNode::RHandle angle_;
+       ValueNode::RHandle amp_;
+       
+       ValueNode_Sine(const ValueBase::Type &x);
+
+public:
+
+       typedef etl::handle<ValueNode_Sine> Handle;
+       typedef etl::handle<const ValueNode_Sine> ConstHandle;
+
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual ~ValueNode_Sine();
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+       virtual int link_count()const;
+       virtual String link_name(int i)const;
+
+       virtual String link_local_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+protected:
+       LinkableValueNode* create_new()const;
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_Sine* create(const ValueBase &x);
+}; // END of class ValueNode_Sine
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_stripes.cpp b/synfig-core/trunk/src/synfig/valuenode_stripes.cpp
new file mode 100644 (file)
index 0000000..4849f30
--- /dev/null
@@ -0,0 +1,275 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_subtract.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_stripes.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "general.h"
+#include "valuenode_stripes.h"
+#include "valuenode_const.h"
+#include <stdexcept>
+#include "color.h"
+#include "gradient.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::ValueNode_Stripes::ValueNode_Stripes():LinkableValueNode(sinfg::ValueBase::TYPE_GRADIENT)
+{
+       set_link("color1",ValueNode_Const::create(Color::alpha()));
+       set_link("color2",ValueNode_Const::create(Color::black()));
+       set_link("stripes",stripes_=ValueNode_Const::create(int(5)));
+       set_link("width",ValueNode_Const::create(0.5));
+}
+
+LinkableValueNode*
+ValueNode_Stripes::create_new()const
+{
+       return new ValueNode_Stripes();
+}
+
+ValueNode_Stripes*
+ValueNode_Stripes::create(const ValueBase& x)
+{
+       ValueBase::Type id(x.get_type());
+       
+       if(id!=ValueBase::TYPE_GRADIENT)
+       {
+               assert(0);
+               throw runtime_error("sinfg::ValueNode_Stripes:Bad type "+ValueBase::type_name(id));                     
+       }               
+
+       ValueNode_Stripes* value_node=new ValueNode_Stripes();
+
+       assert(value_node->get_type()==id);
+       
+       return value_node;
+}
+
+sinfg::ValueNode_Stripes::~ValueNode_Stripes()
+{
+       unlink_all();
+}
+
+bool
+sinfg::ValueNode_Stripes::set_color1(ValueNode::Handle a)
+{
+       if(a->get_type()!=ValueBase::TYPE_COLOR)
+               return false;
+
+       color1_=a;
+
+       return true;
+}
+
+bool
+sinfg::ValueNode_Stripes::set_color2(ValueNode::Handle a)
+{
+       if(a->get_type()!=ValueBase::TYPE_COLOR)
+               return false;
+
+       color2_=a;
+
+       return true;
+}
+
+bool
+sinfg::ValueNode_Stripes::set_width(ValueNode::Handle x)
+{
+       if(x->get_type()!=ValueBase::TYPE_REAL)
+               return false;
+
+       width_=x;
+
+       return true;
+}
+
+bool
+sinfg::ValueNode_Stripes::set_stripes(ValueNode::Handle b)
+{
+       if(b->get_type()!=ValueBase::TYPE_INTEGER)
+               return false;
+       stripes_=b;
+       return true;
+}
+
+sinfg::ValueBase
+sinfg::ValueNode_Stripes::operator()(Time t)const
+{
+       const int total((*stripes_)(t).get(int()));             
+       int i;
+       Gradient ret;
+
+       if(total<=0)
+               return ret;
+
+       const Color color1((*color1_)(t).get(Color()));
+       const Color color2((*color2_)(t).get(Color()));
+       const float width(max(0.0,min(1.0,(*width_)(t).get(Real()))));
+       
+       const float stripe_width_a(width/total);
+       const float stripe_width_b((1.0-width)/total);
+       
+       for(i=0;i<total;i++)
+       {
+               float pos(float(i)/total+stripe_width_b/2);
+               ret.push_back(Gradient::CPoint(pos,color1));
+               ret.push_back(Gradient::CPoint(pos,color2));
+               pos+=stripe_width_a;
+               ret.push_back(Gradient::CPoint(pos,color2));
+               ret.push_back(Gradient::CPoint(pos,color1));
+       }
+       return ret;
+}
+
+bool
+ValueNode_Stripes::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i>=0 && i<link_count());
+       switch(i)
+       {
+               case 0:
+                       if(set_color1(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+               case 1:
+                       if(set_color2(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+               case 2:
+                       if(set_stripes(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+               case 3:
+                       if(set_width(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+       }
+
+       return false;
+}
+
+ValueNode::LooseHandle
+ValueNode_Stripes::get_link_vfunc(int i)const
+{
+       assert(i>=0 && i<link_count());
+       switch(i)
+       {
+               case 0:
+                       return color1_;
+               case 1:
+                       return color2_;
+               case 2:
+                       return stripes_;
+               case 3:
+                       return width_;
+       }
+       return 0;
+}
+
+int
+ValueNode_Stripes::link_count()const
+{
+       return 4;
+}
+
+String
+ValueNode_Stripes::link_local_name(int i)const
+{
+       assert(i>=0 && i<link_count());
+       switch(i)
+       {
+               case 0:
+                       return _("Color 1");
+               case 1:
+                       return _("Color 2");
+               case 2:
+                       return _("Stripe Count");
+               case 3:
+                       return _("Width");
+       }
+       return String();
+}      
+
+String
+ValueNode_Stripes::link_name(int i)const
+{
+       assert(i>=0 && i<link_count());
+       switch(i)
+       {
+               case 0:
+                       return "color1";
+               case 1:
+                       return "color2";
+               case 2:
+                       return "stripes";
+               case 3:
+                       return "width";
+       }
+       return String();
+}      
+
+int
+ValueNode_Stripes::get_link_index_from_name(const String &name)const
+{
+       if(name=="color1")
+               return 0;
+       if(name=="color2")
+               return 1;
+       if(name=="stripes")
+               return 2;
+       if(name=="width")
+               return 3;
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_Stripes::get_name()const
+{
+       return "stripes";
+}
+
+String
+ValueNode_Stripes::get_local_name()const
+{
+       return _("Stripes");
+}
+
+bool
+ValueNode_Stripes::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_GRADIENT;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_stripes.h b/synfig-core/trunk/src/synfig/valuenode_stripes.h
new file mode 100644 (file)
index 0000000..2039c8a
--- /dev/null
@@ -0,0 +1,101 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_stripes.h
+**     \brief Template Header
+**
+**     $Id: valuenode_stripes.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_STRIPES_H
+#define __SINFG_VALUENODE_STRIPES_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+struct ValueNode_Stripes : public LinkableValueNode
+{
+       typedef etl::handle<ValueNode_Stripes> Handle;
+       typedef etl::handle<const ValueNode_Stripes> ConstHandle;
+       
+protected:
+
+       ValueNode_Stripes();
+
+private:
+
+       ValueNode::RHandle color1_;
+       ValueNode::RHandle color2_;
+       ValueNode::RHandle stripes_;
+       ValueNode::RHandle width_;
+
+public:
+
+       virtual ~ValueNode_Stripes();
+
+//     static Handle create(ValueBase::Type id=ValueBase::TYPE_GRADIENT);
+
+       bool set_color1(ValueNode::Handle a);
+       ValueNode::Handle get_color1()const { return color1_; }
+
+       bool set_color2(ValueNode::Handle a);
+       ValueNode::Handle get_color2()const { return color2_; }
+
+       bool set_stripes(ValueNode::Handle b);
+       ValueNode::Handle get_stripes()const { return stripes_; }
+
+       bool set_width(ValueNode::Handle x);
+
+
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+
+       virtual int link_count()const;
+
+       virtual String link_local_name(int i)const;
+       virtual String link_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+//     static bool check_type(const ValueBase::Type &type);
+
+       LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_Stripes* create(const ValueBase &x=ValueBase::TYPE_GRADIENT);
+}; // END of class ValueNode_Stripes
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_subtract.cpp b/synfig-core/trunk/src/synfig/valuenode_subtract.cpp
new file mode 100644 (file)
index 0000000..e4c55c3
--- /dev/null
@@ -0,0 +1,315 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_subtract.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_subtract.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "general.h"
+#include "valuenode_subtract.h"
+#include "valuenode_const.h"
+#include <stdexcept>
+#include "color.h"
+#include "vector.h"
+#include "angle.h"
+#include "real.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::ValueNode_Subtract::ValueNode_Subtract():LinkableValueNode(sinfg::ValueBase::TYPE_NIL)
+{
+       set_scalar(1.0);
+}
+
+LinkableValueNode*
+ValueNode_Subtract::create_new()const
+{
+       return new ValueNode_Subtract();
+}
+
+ValueNode_Subtract*
+ValueNode_Subtract::create(const ValueBase& x)
+{
+       ValueBase::Type id(x.get_type());
+       
+       ValueNode_Subtract* value_node=new ValueNode_Subtract();
+       switch(id)
+       {
+       case ValueBase::TYPE_NIL:
+               return value_node;
+       case ValueBase::TYPE_VECTOR:
+       case ValueBase::TYPE_REAL:
+       case ValueBase::TYPE_INTEGER:
+       case ValueBase::TYPE_ANGLE:
+               value_node->set_link("rhs",ValueNode_Const::create(ValueBase(id)));
+               value_node->set_link("lhs",ValueNode_Const::create(ValueBase(id)));
+               assert(value_node->get_rhs()->get_type()==id);
+               assert(value_node->get_lhs()->get_type()==id);
+               break;
+       default:
+               assert(0);
+               throw runtime_error("sinfg::ValueNode_Subtract:Bad type "+ValueBase::type_name(id));                    
+       }
+       assert(value_node->get_type()==id);
+       
+       return value_node;
+}
+
+sinfg::ValueNode_Subtract::~ValueNode_Subtract()
+{
+       unlink_all();
+}
+
+void
+ValueNode_Subtract::set_scalar(Real x)
+{
+       set_link("scalar",ValueNode_Const::create(x));
+}
+
+bool
+sinfg::ValueNode_Subtract::set_scalar(ValueNode::Handle x)
+{
+       if(x->get_type()!=ValueBase::TYPE_REAL&& !PlaceholderValueNode::Handle::cast_dynamic(x))
+               return false;
+       scalar=x;
+       return true;
+}
+
+bool
+sinfg::ValueNode_Subtract::set_lhs(ValueNode::Handle a)
+{
+       ref_a=a;
+       
+       if(PlaceholderValueNode::Handle::cast_dynamic(a))
+               return true;
+       
+       if(!ref_a || !ref_b)
+               set_type(ValueBase::TYPE_NIL);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_VECTOR && ref_a->get_type()==ValueBase::TYPE_VECTOR)
+               set_type(ValueBase::TYPE_VECTOR);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_REAL && ref_a->get_type()==ValueBase::TYPE_REAL)
+               set_type(ValueBase::TYPE_REAL);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_INTEGER && ref_a->get_type()==ValueBase::TYPE_INTEGER)
+               set_type(ValueBase::TYPE_INTEGER);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_ANGLE && ref_a->get_type()==ValueBase::TYPE_ANGLE)
+               set_type(ValueBase::TYPE_ANGLE);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_COLOR && ref_a->get_type()==ValueBase::TYPE_COLOR)
+               set_type(ValueBase::TYPE_COLOR);
+       else
+       {
+               sinfg::warning(get_id()+":(set_a):"+strprintf(_("Types seem to be off for ValueNodes %s and %s"),ref_a->get_id().c_str(),ref_b->get_id().c_str()));
+               set_type(ValueBase::TYPE_NIL);
+       }
+
+       return true;
+}
+
+bool
+sinfg::ValueNode_Subtract::set_rhs(ValueNode::Handle b)
+{
+       ref_b=b;
+
+       if(PlaceholderValueNode::Handle::cast_dynamic(b))
+               return true;
+
+       if(!ref_a || !ref_b)
+               set_type(ValueBase::TYPE_NIL);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_VECTOR && ref_a->get_type()==ValueBase::TYPE_VECTOR)
+               set_type(ValueBase::TYPE_VECTOR);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_REAL && ref_a->get_type()==ValueBase::TYPE_REAL)
+               set_type(ValueBase::TYPE_REAL);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_INTEGER && ref_a->get_type()==ValueBase::TYPE_INTEGER)
+               set_type(ValueBase::TYPE_INTEGER);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_ANGLE && ref_a->get_type()==ValueBase::TYPE_ANGLE)
+               set_type(ValueBase::TYPE_ANGLE);
+       else
+       if(ref_a->get_type()==ValueBase::TYPE_COLOR && ref_a->get_type()==ValueBase::TYPE_COLOR)
+               set_type(ValueBase::TYPE_COLOR);
+       else
+       {
+               sinfg::warning(get_id()+":(set_b):"+strprintf(_("Types seem to be off for ValueNodes %s and %s"),ref_a->get_id().c_str(),ref_b->get_id().c_str()));
+               set_type(ValueBase::TYPE_NIL);
+       }
+
+       return true;
+}
+
+sinfg::ValueBase
+sinfg::ValueNode_Subtract::operator()(Time t)const
+{
+       if(!ref_a || !ref_b)
+               throw runtime_error(strprintf("ValueNode_Subtract: %s",_("One or both of my parameters aren't set!")));
+       else
+       if(get_type()==ValueBase::TYPE_VECTOR)
+               return ((*ref_a)(t).get(Vector())-(*ref_b)(t).get(Vector()))*(*scalar)(t).get(Real());
+       else
+       if(get_type()==ValueBase::TYPE_REAL)
+               return ((*ref_a)(t).get(Vector::value_type())-(*ref_b)(t).get(Vector::value_type()))*(*scalar)(t).get(Real());
+       else
+       if(get_type()==ValueBase::TYPE_INTEGER)
+               return ((*ref_a)(t).get(int())-(*ref_b)(t).get(int()))*(*scalar)(t).get(Real());
+       else
+       if(get_type()==ValueBase::TYPE_ANGLE)
+               return ((*ref_a)(t).get(Angle())-(*ref_b)(t).get(Angle()))*(*scalar)(t).get(Real());
+       else
+       if(get_type()==ValueBase::TYPE_COLOR)
+               return ((*ref_a)(t).get(Color())-(*ref_b)(t).get(Color()))*(*scalar)(t).get(Real());
+
+       sinfg::error(get_id()+':'+strprintf(_("Cannot subtract types of %s and %s"),ValueBase::type_name(ref_a->get_type()).c_str(),ValueBase::type_name(ref_b->get_type()).c_str()));
+       return ValueBase();
+}
+
+bool
+ValueNode_Subtract::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i>=0 && i<3);
+       switch(i)
+       {
+               case 0:
+                       if(set_lhs(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+               case 1:
+                       if(set_rhs(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+               case 2:
+                       scalar=x;
+                       signal_child_changed()(i);signal_value_changed()();
+                       return true;
+       }
+
+       return false;
+}
+
+ValueNode::LooseHandle
+ValueNode_Subtract::get_link_vfunc(int i)const
+{
+       assert(i>=0 && i<3);
+       switch(i)
+       {
+               case 0:
+                       return ref_a;
+               case 1:
+                       return ref_b;
+               case 2:
+                       return scalar;
+       }
+       return 0;
+}
+
+int
+ValueNode_Subtract::link_count()const
+{
+       return 3;
+}
+
+String
+ValueNode_Subtract::link_local_name(int i)const
+{
+       assert(i>=0 && i<3);
+       switch(i)
+       {
+               case 0:
+                       return _("LHS");
+               case 1:
+                       return _("RHS");
+               case 2:
+                       return _("Scalar");
+       }
+       return String();
+}      
+
+String
+ValueNode_Subtract::link_name(int i)const
+{
+       assert(i>=0 && i<3);
+       switch(i)
+       {
+               case 0:
+                       return "lhs";
+               case 1:
+                       return "rhs";
+               case 2:
+                       return "scalar";
+       }
+       return String();
+}      
+
+int
+ValueNode_Subtract::get_link_index_from_name(const String &name)const
+{
+       if(name=="lhs")
+               return 0;
+       if(name=="rhs")
+               return 1;
+       if(name=="scalar")
+               return 2;
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_Subtract::get_name()const
+{
+       return "subtract";
+}
+
+String
+ValueNode_Subtract::get_local_name()const
+{
+       return _("Subtract");
+}
+
+bool
+ValueNode_Subtract::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_VECTOR 
+               || type==ValueBase::TYPE_REAL
+               || type==ValueBase::TYPE_INTEGER
+               || type==ValueBase::TYPE_COLOR
+               || type==ValueBase::TYPE_ANGLE;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_subtract.h b/synfig-core/trunk/src/synfig/valuenode_subtract.h
new file mode 100644 (file)
index 0000000..7e2eac1
--- /dev/null
@@ -0,0 +1,108 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_subtract.h
+**     \brief Template Header
+**
+**     $Id: valuenode_subtract.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_SUBTRACT_H
+#define __SINFG_VALUENODE_SUBTRACT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+struct ValueNode_Subtract : public LinkableValueNode
+{
+       typedef etl::handle<ValueNode_Subtract> Handle;
+       typedef etl::handle<const ValueNode_Subtract> ConstHandle;
+       
+protected:
+
+       ValueNode_Subtract();
+
+private:
+
+       ValueNode::RHandle ref_a;
+       ValueNode::RHandle ref_b;
+       ValueNode::RHandle scalar;
+
+public:
+
+       virtual ~ValueNode_Subtract();
+
+//     static Handle create(ValueBase::Type id=ValueBase::TYPE_NIL);
+
+       //! Sets the left-hand-side value_node
+       bool set_lhs(ValueNode::Handle a);
+
+       //! Gets the left-hand-side value_node
+       ValueNode::Handle get_lhs()const { return ref_a; }
+
+       //! Sets the right-hand-side value_node
+       bool set_rhs(ValueNode::Handle b);
+
+       //! Gets the right-hand-side value_node
+       ValueNode::Handle get_rhs()const { return ref_b; }
+
+       //! Sets the scalar value_node
+       bool set_scalar(ValueNode::Handle x);
+
+       //! Gets the scalar value_node
+       ValueNode::Handle get_scalar()const { return scalar; }
+
+       void set_scalar(Real x);
+
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+
+       virtual int link_count()const;
+
+       virtual String link_local_name(int i)const;
+       virtual String link_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+//     static bool check_type(const ValueBase::Type &type);
+
+       LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_Subtract* create(const ValueBase &x=ValueBase());
+}; // END of class ValueNode_Subtract
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp b/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp
new file mode 100644 (file)
index 0000000..0f51539
--- /dev/null
@@ -0,0 +1,347 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_timedswap.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_timedswap.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "general.h"
+#include "valuenode_timedswap.h"
+#include "valuenode_const.h"
+#include <stdexcept>
+#include "color.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+ValueNode_TimedSwap::ValueNode_TimedSwap(ValueBase::Type type):
+       LinkableValueNode(type)
+{
+       set_before(ValueNode_Const::create(type));
+       set_after(ValueNode_Const::create(type));
+       set_swap_time_real(1.0);
+       set_swap_length_real(1.0);
+
+       DCAST_HACK_ENABLE();
+}
+
+ValueNode_TimedSwap*
+ValueNode_TimedSwap::create(const ValueBase& x)
+{
+       return new ValueNode_TimedSwap(x.get_type());
+}
+
+
+LinkableValueNode*
+ValueNode_TimedSwap::create_new()const
+{
+       return new ValueNode_TimedSwap(get_type());
+}
+
+
+sinfg::ValueNode_TimedSwap::~ValueNode_TimedSwap()
+{
+       unlink_all();
+}
+
+
+
+bool
+ValueNode_TimedSwap::set_before(const ValueNode::Handle &x)
+{
+       if(!x || x->get_type()!=get_type()
+               && !PlaceholderValueNode::Handle::cast_dynamic(x))
+               return false;
+
+       before=x;
+
+       return true;
+}
+
+ValueNode::Handle
+ValueNode_TimedSwap::get_before()const
+{
+       return before;
+}
+
+
+bool
+ValueNode_TimedSwap::set_after(const ValueNode::Handle &x)
+{
+       if(!x || x->get_type()!=get_type()
+               && !PlaceholderValueNode::Handle::cast_dynamic(x))
+               return false;
+
+       after=x;
+
+       return true;
+}
+
+ValueNode::Handle
+ValueNode_TimedSwap::get_after()const
+{
+       return after;
+}
+
+
+void
+ValueNode_TimedSwap::set_swap_time_real(Time x)
+{
+       set_swap_time(ValueNode_Const::create(x));
+}
+
+bool
+ValueNode_TimedSwap::set_swap_time(const ValueNode::Handle &x)
+{
+       if(!x
+               || !ValueBase(ValueBase::TYPE_TIME).same_as(x->get_type())
+               && !PlaceholderValueNode::Handle::cast_dynamic(x)
+       )
+               return false;
+       swap_time=x;
+       return true;
+}
+
+ValueNode::Handle
+ValueNode_TimedSwap::get_swap_time()const
+{
+       return swap_time;
+}
+
+void
+ValueNode_TimedSwap::set_swap_length_real(Time x)
+{
+       set_swap_length(ValueNode_Const::create(x));
+}
+
+bool
+ValueNode_TimedSwap::set_swap_length(const ValueNode::Handle &x)
+{
+       if(!x || (
+               !ValueBase(ValueBase::TYPE_TIME).same_as(x->get_type())
+               && !PlaceholderValueNode::Handle::cast_dynamic(x)
+               )
+       )
+               return false;
+       swap_length=x;
+       return true;
+}
+
+ValueNode::Handle
+ValueNode_TimedSwap::get_swap_length()const
+{
+       return swap_length;
+}
+
+
+
+sinfg::ValueBase
+sinfg::ValueNode_TimedSwap::operator()(Time t)const
+{
+       Time swptime=(*swap_time)(t).get(Time());
+       Time swplength=(*swap_length)(t).get(Time());
+
+       if(t>swptime)
+               return (*after)(t);
+       
+       if(t<=swptime && t>swptime-swplength)
+       {
+               Real amount=(swptime-t)/swplength;
+               // if amount==0.0, then we are after
+               // if amount==1.0, then we are before
+               
+               switch(get_type())
+               {
+               case ValueBase::TYPE_REAL:
+                       {
+                               Real a=(*after)(t).get(Real());
+                               Real b=(*before)(t).get(Real());
+                               return (b-a)*amount+a;
+                       }
+               case ValueBase::TYPE_VECTOR:
+                       {
+                               Vector a=(*after)(t).get(Vector());
+                               Vector b=(*before)(t).get(Vector());
+                               return (b-a)*amount+a;
+                       }
+               case ValueBase::TYPE_ANGLE:
+                       {
+                               Angle a=(*after)(t).get(Angle());
+                               Angle b=(*before)(t).get(Angle());
+                               return (b-a)*amount+a;
+                       }
+               case ValueBase::TYPE_COLOR:
+                       {
+                               Color a=(*after)(t).get(Color());
+                               Color b=(*before)(t).get(Color());
+                               // note: Shouldn't this use a straight blend?
+                               return (b-a)*amount+a;
+                       }
+               case ValueBase::TYPE_INTEGER:
+                       {
+                               float a=(float)(*after)(t).get(int());
+                               float b=(float)(*before)(t).get(int());
+                               return static_cast<int>((b-a)*amount+a+0.5f);
+                       }
+               default:
+                       break;
+               }
+       }
+
+
+       /*! \todo this should interpolate from
+       **      before to after over the period defined
+       **      by swap_length */
+
+       return (*before)(t);
+}
+
+
+bool
+ValueNode_TimedSwap::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i>=0 && i<4);
+       switch(i)
+       {
+       case 0:
+               return set_before(x);
+       case 1:
+               return set_after(x);
+       case 2:
+               return set_swap_time(x);
+       case 3:
+               return set_swap_length(x);
+       }
+       return 0;
+}
+
+ValueNode::LooseHandle
+ValueNode_TimedSwap::get_link_vfunc(int i)const
+{
+       assert(i>=0 && i<4);
+       switch(i)
+       {
+       case 0:
+               return get_before();
+       case 1:
+               return get_after();
+       case 2:
+               return get_swap_time();
+       case 3:
+               return get_swap_length();
+       }
+       return 0;
+}
+
+int
+ValueNode_TimedSwap::link_count()const
+{
+       return 4;
+}
+
+String
+ValueNode_TimedSwap::link_local_name(int i)const
+{
+       assert(i>=0 && i<4);
+       switch(i)
+       {
+       case 0:
+               return _("Before");
+       case 1:
+               return _("After");
+       case 2:
+               return _("Swap Time");
+       case 3:
+               return _("Swap Duration");
+       }
+       return 0;
+}      
+
+String
+ValueNode_TimedSwap::link_name(int i)const
+{
+       assert(i>=0 && i<4);
+       switch(i)
+       {
+       case 0:
+               return "before";
+       case 1:
+               return "after";
+       case 2:
+               return "time";
+       case 3:
+               return "length";
+       }
+       return 0;
+}      
+
+int
+ValueNode_TimedSwap::get_link_index_from_name(const String &name)const
+{
+       if(name=="before")
+               return 0;
+       if(name=="after")
+               return 1;
+       if(name=="time")
+               return 2;
+       if(name=="length")
+               return 3;
+
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_TimedSwap::get_name()const
+{
+       return "timed_swap";
+}
+
+String
+ValueNode_TimedSwap::get_local_name()const
+{
+       return _("Timed Swap");
+}
+
+bool
+ValueNode_TimedSwap::check_type(ValueBase::Type type)
+{
+       if(!type)
+               return false;
+       return true;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_timedswap.h b/synfig-core/trunk/src/synfig/valuenode_timedswap.h
new file mode 100644 (file)
index 0000000..fff875f
--- /dev/null
@@ -0,0 +1,99 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_timedswap.h
+**     \brief Template Header
+**
+**     $Id: valuenode_timedswap.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_TIMEDSWAP_H
+#define __SINFG_VALUENODE_TIMEDSWAP_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+struct ValueNode_TimedSwap : public LinkableValueNode
+{
+       typedef etl::handle<ValueNode_TimedSwap> Handle;
+       typedef etl::handle<const ValueNode_TimedSwap> ConstHandle;
+       
+private:
+
+       ValueNode::RHandle before;
+       ValueNode::RHandle after;
+       ValueNode::RHandle swap_time;
+       ValueNode::RHandle swap_length;
+
+       ValueNode_TimedSwap(ValueBase::Type id);
+
+public:
+
+//     static Handle create(ValueBase::Type id);
+
+       virtual ~ValueNode_TimedSwap();
+
+       bool set_before(const ValueNode::Handle &a);
+       ValueNode::Handle get_before()const;
+       bool set_after(const ValueNode::Handle &a);
+       ValueNode::Handle get_after()const;
+
+       void set_swap_time_real(Time x);
+       bool set_swap_time(const ValueNode::Handle &x);
+       ValueNode::Handle get_swap_time()const;
+
+       void set_swap_length_real(Time x);
+       bool set_swap_length(const ValueNode::Handle &x);
+       ValueNode::Handle get_swap_length()const;
+
+
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+       virtual int link_count()const;
+       virtual String link_local_name(int i)const;
+       virtual String link_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual String get_name()const; 
+       virtual String get_local_name()const;
+//     static bool check_type(const ValueBase::Type &type);
+
+protected:
+       
+       virtual LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_TimedSwap* create(const ValueBase &x);
+}; // END of class ValueNode_TimedSwap
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/valuenode_twotone.cpp b/synfig-core/trunk/src/synfig/valuenode_twotone.cpp
new file mode 100644 (file)
index 0000000..b03ec01
--- /dev/null
@@ -0,0 +1,206 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_subtract.cpp
+**     \brief Template File
+**
+**     $Id: valuenode_twotone.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "general.h"
+#include "valuenode_twotone.h"
+#include "valuenode_const.h"
+#include <stdexcept>
+#include "color.h"
+#include "gradient.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+sinfg::ValueNode_TwoTone::ValueNode_TwoTone():LinkableValueNode(sinfg::ValueBase::TYPE_GRADIENT)
+{
+       set_link("color1",ValueNode_Const::create(Color::black()));
+       set_link("color2",ValueNode_Const::create(Color::white()));
+       DCAST_HACK_ENABLE();
+}
+
+LinkableValueNode*
+ValueNode_TwoTone::create_new()const
+{
+       return new ValueNode_TwoTone();
+}
+
+ValueNode_TwoTone*
+ValueNode_TwoTone::create(const ValueBase& x)
+{
+       ValueBase::Type id(x.get_type());
+       if(id!=ValueBase::TYPE_GRADIENT)
+       {
+               assert(0);
+               throw runtime_error("sinfg::ValueNode_TwoTone:Bad type "+ValueBase::type_name(id));                     
+       }               
+
+       ValueNode_TwoTone* value_node=new ValueNode_TwoTone();
+
+       assert(value_node->get_type()==id);
+       
+       return value_node;
+}
+
+sinfg::ValueNode_TwoTone::~ValueNode_TwoTone()
+{
+       unlink_all();
+}
+
+bool
+sinfg::ValueNode_TwoTone::set_lhs(ValueNode::Handle a)
+{
+       if(a->get_type()!=ValueBase::TYPE_COLOR)
+               return false;
+
+       ref_a=a;
+
+       return true;
+}
+
+bool
+sinfg::ValueNode_TwoTone::set_rhs(ValueNode::Handle b)
+{
+       if(b->get_type()!=ValueBase::TYPE_COLOR)
+               return false;
+       ref_b=b;
+       return true;
+}
+
+sinfg::ValueBase
+sinfg::ValueNode_TwoTone::operator()(Time t)const
+{
+       return Gradient((*ref_a)(t).get(Color()),(*ref_b)(t).get(Color()));
+}
+
+bool
+ValueNode_TwoTone::set_link_vfunc(int i,ValueNode::Handle x)
+{
+       assert(i>=0 && i<3);
+       switch(i)
+       {
+               case 0:
+                       if(set_lhs(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+               case 1:
+                       if(set_rhs(x)) { signal_child_changed()(i);signal_value_changed()(); return true; }
+                       else { return false; }
+       }
+
+       return false;
+}
+
+ValueNode::LooseHandle
+ValueNode_TwoTone::get_link_vfunc(int i)const
+{
+       assert(i>=0 && i<3);
+       switch(i)
+       {
+               case 0:
+                       return ref_a;
+               case 1:
+                       return ref_b;
+       }
+       return 0;
+}
+
+int
+ValueNode_TwoTone::link_count()const
+{
+       return 2;
+}
+
+String
+ValueNode_TwoTone::link_local_name(int i)const
+{
+       assert(i>=0 && i<2);
+       switch(i)
+       {
+               case 0:
+                       return _("Color1");
+               case 1:
+                       return _("Color2");
+       }
+       return String();
+}      
+
+String
+ValueNode_TwoTone::link_name(int i)const
+{
+       assert(i>=0 && i<2);
+       switch(i)
+       {
+               case 0:
+                       return "color1";
+               case 1:
+                       return "color2";
+       }
+       return String();
+}      
+
+int
+ValueNode_TwoTone::get_link_index_from_name(const String &name)const
+{
+       if(name=="color1")
+               return 0;
+       if(name=="color2")
+               return 1;
+       throw Exception::BadLinkName(name);
+}
+
+String
+ValueNode_TwoTone::get_name()const
+{
+       return "twotone";
+}
+
+String
+ValueNode_TwoTone::get_local_name()const
+{
+       return _("Two-Tone");
+}
+
+bool
+ValueNode_TwoTone::check_type(ValueBase::Type type)
+{
+       return type==ValueBase::TYPE_GRADIENT;
+}
diff --git a/synfig-core/trunk/src/synfig/valuenode_twotone.h b/synfig-core/trunk/src/synfig/valuenode_twotone.h
new file mode 100644 (file)
index 0000000..5d28a83
--- /dev/null
@@ -0,0 +1,101 @@
+/* === S I N F G =========================================================== */
+/*!    \file valuenode_twotone.h
+**     \brief Template Header
+**
+**     $Id: valuenode_twotone.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VALUENODE_TWOTONE_H
+#define __SINFG_VALUENODE_TWOTONE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "valuenode.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+struct ValueNode_TwoTone : public LinkableValueNode
+{
+       typedef etl::handle<ValueNode_TwoTone> Handle;
+       typedef etl::handle<const ValueNode_TwoTone> ConstHandle;
+       
+protected:
+
+       ValueNode_TwoTone();
+
+private:
+
+       ValueNode::RHandle ref_a;
+       ValueNode::RHandle ref_b;
+
+public:
+
+       virtual ~ValueNode_TwoTone();
+
+//     static Handle create(ValueBase::Type id=ValueBase::TYPE_GRADIENT);
+
+       //! Sets the left-hand-side value_node
+       bool set_lhs(ValueNode::Handle a);
+
+       //! Gets the left-hand-side value_node
+       ValueNode::Handle get_lhs()const { return ref_a; }
+
+       //! Sets the right-hand-side value_node
+       bool set_rhs(ValueNode::Handle b);
+
+       //! Gets the right-hand-side value_node
+       ValueNode::Handle get_rhs()const { return ref_b; }
+
+
+       virtual bool set_link_vfunc(int i,ValueNode::Handle x);
+
+       virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
+
+       virtual int link_count()const;
+
+       virtual String link_local_name(int i)const;
+       virtual String link_name(int i)const;
+       virtual int get_link_index_from_name(const String &name)const;
+
+       virtual ValueBase operator()(Time t)const;
+
+       virtual String get_name()const;
+       virtual String get_local_name()const;
+
+//     static bool check_type(const ValueBase::Type &type);
+
+       LinkableValueNode* create_new()const;
+
+public:
+       using sinfg::LinkableValueNode::get_link_vfunc;
+
+       using sinfg::LinkableValueNode::set_link_vfunc;
+       static bool check_type(ValueBase::Type type);
+       static ValueNode_TwoTone* create(const ValueBase &x=ValueBase::TYPE_GRADIENT);
+}; // END of class ValueNode_TwoTone
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/vector.h b/synfig-core/trunk/src/synfig/vector.h
new file mode 100644 (file)
index 0000000..a279db8
--- /dev/null
@@ -0,0 +1,279 @@
+/* === S I N F G =========================================================== */
+/*!    \file vector.h
+**     \brief Various discreet type definitions
+**
+**     $Id: vector.h,v 1.2 2005/01/23 04:03:21 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VECTOR_H
+#define __SINFG_VECTOR_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "real.h"
+#include <cmath>
+
+/* === M A C R O S ========================================================= */
+
+#ifndef isnan
+
+#ifdef WIN32
+#include <float.h>
+#ifndef isnan
+extern "C" { int _isnan(double x); }
+#define isnan _isnan
+#endif
+#endif
+
+#ifdef __APPLE__
+#define isnan __isnanf
+#endif
+
+#endif
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+/*!    \class Vector
+**     \todo writeme
+*/
+class Vector
+{
+public:
+       typedef Real value_type;
+
+private:
+       value_type _x, _y;
+
+public:
+       Vector() { };
+       Vector(const value_type &x, const value_type &y):_x(x),_y(y) { };
+
+       bool is_valid()const { return !(isnan(_x) || isnan(_y)); }
+       
+       value_type &
+       operator[](const int& i)
+       { return (&_x)[i] ; }
+
+       const value_type &
+       operator[](const int& i) const
+       { return (&_x)[i] ; }
+       
+       const Vector &
+       operator+=(const Vector &rhs)
+       {
+               _x+=rhs._x;
+               _y+=rhs._y;
+               return *this;
+       }
+       
+       const Vector &
+       operator-=(const Vector &rhs)
+       {
+               _x-=rhs._x;
+               _y-=rhs._y;
+               return *this;
+       }
+       
+       const Vector &
+       operator*=(const value_type &rhs)
+       {
+               _x*=rhs;
+               _y*=rhs;
+               return *this;
+       }
+       
+       const Vector &
+       operator/=(const value_type &rhs)
+       {
+               value_type tmp=1.0/rhs;
+               _x*=tmp;
+               _y*=tmp;
+               return *this;
+       }
+               
+       Vector
+       operator+(const Vector &rhs)const
+               { return Vector(*this)+=rhs; }
+
+       Vector
+       operator-(const Vector &rhs)const
+               { return Vector(*this)-=rhs; }
+
+       Vector
+       operator*(const value_type &rhs)const
+               { return Vector(*this)*=rhs; }
+
+       Vector
+       operator/(const value_type &rhs)const
+               { return Vector(*this)/=rhs; }
+
+       Vector
+       operator-()const
+               { return Vector(-_x,-_y); }
+
+       value_type
+       operator*(const Vector &rhs)const
+               { return _x*rhs._x+_y*rhs._y; }
+
+       bool
+       operator==(const Vector &rhs)const
+               { return _x==rhs._x && _y==rhs._y; }
+       
+       bool
+       operator!=(const Vector &rhs)const
+               { return _y!=rhs._y || _x!=rhs._x; }
+       
+       //! Returns the squared magnitude of the vector
+       value_type mag_squared()const
+               { return _x*_x+_y*_y; }
+       
+       //! Returns the magnitude of the vector
+       value_type mag()const
+               { return sqrt(mag_squared()); }
+
+       //! Returns the reciprocal of the magnitude of the vector
+       value_type inv_mag()const
+               { return 1.0/sqrt(mag_squared()); }
+
+       //! Returns a normalized version of the vector
+       Vector norm()const
+               { return (*this)*inv_mag(); }
+
+       //! Returns a perpendicular version of the vector
+       Vector perp()const
+               { return Vector(_y,-_x); }
+               
+       bool is_equal_to(const Vector& rhs)const
+       {
+               static const value_type epsilon(0.0000000000001);
+//             return (_x>rhs._x)?_x-rhs._x<=epsilon:rhs._x-_x<=epsilon && (_y>rhs._y)?_y-rhs._y<=epsilon:rhs._y-_y<=epsilon;
+               return (*this-rhs).mag_squared()<=epsilon;
+       }
+       
+       static const Vector zero() { return Vector(0,0); }
+};
+
+/*!    \typedef Point
+**     \todo writeme
+*/
+typedef Vector Point;
+
+
+
+}; // END of namespace sinfg
+
+namespace std {
+
+inline sinfg::Vector::value_type
+abs(const sinfg::Vector &rhs)
+       { return rhs.mag(); }
+
+}; // END of namespace std
+
+#include <ETL/bezier>
+
+_ETL_BEGIN_NAMESPACE
+
+template <>
+class bezier_base<sinfg::Vector,float> : public std::unary_function<float,sinfg::Vector>
+{
+public:
+       typedef sinfg::Vector value_type;
+       typedef float time_type;
+private:
+
+       bezier_base<sinfg::Vector::value_type,time_type> bezier_x,bezier_y;
+
+       value_type a,b,c,d;
+
+protected:
+       affine_combo<value_type,time_type> affine_func; 
+
+public:
+       bezier_base() { }
+       bezier_base(
+               const value_type &a, const value_type &b, const value_type &c, const value_type &d,
+               const time_type &r=0.0, const time_type &s=1.0):
+               a(a),b(b),c(c),d(d) { set_rs(r,s); sync(); }
+               
+       void sync()
+       {
+               bezier_x[0]=a[0],bezier_y[0]=a[1];
+               bezier_x[1]=b[0],bezier_y[1]=b[1];
+               bezier_x[2]=c[0],bezier_y[2]=c[1];
+               bezier_x[3]=d[0],bezier_y[3]=d[1];
+               bezier_x.sync();
+               bezier_y.sync();
+       }
+
+       value_type
+       operator()(time_type t)const
+       {
+               return sinfg::Vector(bezier_x(t),bezier_y(t));
+       }
+       
+       void evaluate(time_type t, value_type &f, value_type &df) const
+       {
+               t=(t-get_r())/get_dt();
+               
+               const value_type p1 = affine_func(
+                                                       affine_func(a,b,t),
+                                                       affine_func(b,c,t)
+                                                       ,t);
+               const value_type p2 = affine_func(
+                                                       affine_func(b,c,t),
+                                                       affine_func(c,d,t)
+                                               ,t);
+               
+               f = affine_func(p1,p2,t);
+               df = (p2-p1)*3;
+       }
+
+       void set_rs(time_type new_r, time_type new_s) { bezier_x.set_rs(new_r,new_s); bezier_y.set_rs(new_r,new_s); }
+       void set_r(time_type new_r) { bezier_x.set_r(new_r); bezier_y.set_r(new_r); }
+       void set_s(time_type new_s) { bezier_x.set_s(new_s); bezier_y.set_s(new_s); }
+       const time_type &get_r()const { return bezier_x.get_r(); }
+       const time_type &get_s()const { return bezier_x.get_s(); }
+       time_type get_dt()const { return bezier_x.get_dt(); }
+
+       value_type &
+       operator[](int i)
+       { return (&a)[i]; }
+
+       const value_type &
+       operator[](int i) const
+       { return (&a)[i]; }
+
+       //! Bezier curve intersection function
+       time_type intersect(const bezier_base<value_type,time_type> &x, time_type near=0.0)const
+       {
+               return 0;
+       }
+};
+
+_ETL_END_NAMESPACE
+
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/version.h b/synfig-core/trunk/src/synfig/version.h
new file mode 100644 (file)
index 0000000..841a0d6
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S I N F G =========================================================== */
+/*!    \file version.h
+**     \brief Template Header
+**
+**     $Id: version.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_VERSION_H
+#define __SINFG_VERSION_H
+
+/* === H E A D E R S ======================================================= */
+
+/* === M A C R O S ========================================================= */
+
+/*! \def SINFG_VERSION
+**     \brief Sinfg API Version
+**
+**     The macro SINFG_VERSION can be set to ensure
+**     compile-time compatibility with future versions
+**     of Sinfg. The first two digits are the major
+**     version, the second two digits are the minor
+**     version, and the last two digits are the
+**     revision release.
+*/
+#ifndef SINFG_VERSION
+#define SINFG_VERSION (006000)
+#endif
+
+/*!    Increment this value whenever
+**     the library changes in a way
+**     that breaks library compatibility
+*/
+#define SINFG_LIBRARY_VERSION  47
+
+/*! \writeme */
+#define SINFG_CHECK_VERSION()  sinfg::check_version_(SINFG_LIBRARY_VERSION,sizeof(sinfg::Vector),sizeof(sinfg::Color),sizeof(sinfg::Canvas),sizeof(sinfg::Layer))
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg {
+
+//! Version checker \internal
+/*! Checks to make sure that the library
+**     version matches with what the program
+**     was compiled against.
+**     \see SINFG_CHECK_VERSION()
+*/
+extern bool check_version_(int v,int vec_size, int color_size,int canvas_size,int layer_size);
+
+extern const char *get_version();
+
+extern const char *get_build_date();
+
+extern const char *get_build_time();
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/src/synfig/waypoint.cpp b/synfig-core/trunk/src/synfig/waypoint.cpp
new file mode 100644 (file)
index 0000000..2fa82a2
--- /dev/null
@@ -0,0 +1,154 @@
+/* === S I N F G =========================================================== */
+/*!    \file waypoint.cpp
+**     \brief Template File
+**
+**     $Id: waypoint.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "waypoint.h"
+#include "valuenode_const.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace sinfg;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Waypoint::Waypoint(ValueBase value, Time time):
+       priority_(0),
+       before(INTERPOLATION_TCB),
+       after(INTERPOLATION_TCB),
+       value_node(ValueNode_Const::create(value)),
+       time(time),
+       tension(0.0),
+       continuity(0.0),
+       bias(0),
+       time_tension(0.0f)
+{
+       if(value.get_type()==ValueBase::TYPE_ANGLE)
+               after=before=INTERPOLATION_LINEAR;
+}
+
+Waypoint::Waypoint(ValueNode::Handle value_node, Time time):
+       priority_(0),
+       before(INTERPOLATION_TCB),
+       after(INTERPOLATION_TCB),
+       value_node(value_node),
+       time(time),
+       tension(0.0),
+       continuity(0),
+       bias(0),
+       time_tension(0.0f)
+{
+       if(value_node->get_type()==ValueBase::TYPE_ANGLE)
+               after=before=INTERPOLATION_LINEAR;
+}
+
+Waypoint::Waypoint():
+       priority_(0),
+       before(INTERPOLATION_TCB),
+       after(INTERPOLATION_TCB),
+       tension(0),
+       continuity(0),
+       bias(0),
+       time_tension(0.0f)
+{
+}
+
+void
+Waypoint::set_value(const ValueBase &x)
+{
+       if(!value_node && x.get_type()==ValueBase::TYPE_ANGLE)
+               after=before=INTERPOLATION_LINEAR;
+
+       value_node=ValueNode_Const::create(x);
+}
+
+void
+Waypoint::set_value_node(const ValueNode::Handle &x)
+{
+       if(!value_node && x->get_type()==ValueBase::TYPE_ANGLE)
+               after=before=INTERPOLATION_LINEAR;
+
+       value_node=x;
+}
+
+bool
+Waypoint::is_static()const
+{
+       return static_cast<bool>(ValueNode_Const::Handle::cast_dynamic(value_node)) && value_node && !value_node->is_exported();
+}
+
+void
+Waypoint::set_time(const Time &x)
+{
+       time=x;
+}
+
+void
+Waypoint::apply_model(const Model &x)
+{
+       if(x.priority_flag) set_priority(x.get_priority());
+       if(x.before_flag) set_before(x.get_before());
+       if(x.after_flag) set_after(x.get_after());
+       if(x.tension_flag) set_tension(x.get_tension());
+       if(x.continuity_flag) set_continuity(x.get_continuity());
+       if(x.bias_flag) set_bias(x.get_bias());
+       if(x.temporal_tension_flag) set_temporal_tension(x.get_temporal_tension());
+}
+
+Waypoint
+Waypoint::clone(const GUID& deriv_guid)const
+{
+       Waypoint ret(*this);
+       ret.make_unique();
+       if(!ret.value_node->is_exported())
+               ret.value_node=value_node->clone(deriv_guid);
+       ret.parent_=0;
+       return ret;
+}
+
+ValueBase
+Waypoint::get_value()const { return (*value_node)(0); }
+
+ValueBase
+Waypoint::get_value(const Time &t)const { return (*value_node)(t); }
+
+sinfg::GUID
+Waypoint::get_guid()const
+{
+       return GUID::hasher(get_uid());
+}
diff --git a/synfig-core/trunk/src/synfig/waypoint.h b/synfig-core/trunk/src/synfig/waypoint.h
new file mode 100644 (file)
index 0000000..6315134
--- /dev/null
@@ -0,0 +1,255 @@
+/* === S I N F G =========================================================== */
+/*!    \file waypoint.h
+**     \brief Template Header
+**
+**     $Id: waypoint.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_WAYPOINT_H
+#define __SINFG_WAYPOINT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "time.h"
+#include "real.h"
+#include "value.h"
+//#include "valuenode.h"
+#include "uniqueid.h"
+#include <vector>
+#include "guid.h"
+#include "interpolation.h"
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace sinfg { 
+
+class ValueNode;
+class GUID;
+               
+       
+/*!    \class Waypoint
+**     \brief \writeme
+*/
+class Waypoint : public UniqueID
+{
+       /*
+ --    ** -- T Y P E S -----------------------------------------------------------
+       */
+
+public:
+
+       typedef sinfg::Interpolation Interpolation;
+
+       class Model
+       {
+               friend class Waypoint;
+                       
+               int priority;
+               Interpolation before;
+               Interpolation after;
+               Real tension;
+               Real continuity;
+               Real bias;
+               Real temporal_tension;
+               
+               bool priority_flag,before_flag,after_flag,tension_flag,continuity_flag,bias_flag,temporal_tension_flag;
+       
+       public:
+               Model():
+                       priority_flag(false),
+                       before_flag(false),
+                       after_flag(false),
+                       tension_flag(false),
+                       continuity_flag(false),
+                       bias_flag(false),
+                       temporal_tension_flag(false) { }
+       
+               Interpolation get_before()const { return before; }
+               void set_before(Interpolation x) { before=x; before_flag=true;}
+       
+               Interpolation get_after()const { return after; }
+               void set_after(Interpolation x) { after=x; after_flag=true;}
+       
+               const Real &get_tension()const { return tension; }
+               void set_tension(const Real &x) { tension=x; tension_flag=true;}
+               
+               const Real &get_continuity()const { return continuity; }
+               void set_continuity(const Real &x) { continuity=x; continuity_flag=true;}
+       
+               const Real &get_bias()const { return bias; }
+               void set_bias(const Real &x) { bias=x; bias_flag=true;}
+
+               const Real &get_temporal_tension()const { return temporal_tension; }
+               void set_temporal_tension(const Real &x) { temporal_tension=x; temporal_tension_flag=true;}
+               
+               int get_priority()const { return priority; }
+               void set_priority(int x) { priority=x; priority_flag=true;}     
+
+               #define FLAG_MACRO(x) bool get_##x##_flag()const { return x##_flag; } void set_##x##_flag(bool y) { x##_flag=y; }
+               FLAG_MACRO(priority)
+               FLAG_MACRO(before)
+               FLAG_MACRO(after)
+               FLAG_MACRO(tension)
+               FLAG_MACRO(continuity)
+               FLAG_MACRO(bias)
+               FLAG_MACRO(temporal_tension)
+               #undef FLAG_MACRO
+               
+               void reset()
+               {
+                       priority_flag=false;
+                       before_flag=false;
+                       after_flag=false;
+                       tension_flag=false;
+                       continuity_flag=false;
+                       bias_flag=false;
+                       temporal_tension_flag=false;
+               }
+               
+               bool is_trivial()const
+               {
+                       return !(
+                               priority_flag||
+                               before_flag||
+                               after_flag||
+                               tension_flag||
+                               continuity_flag||
+                               bias_flag||
+                               temporal_tension_flag
+                       );
+               }
+       };
+       
+       /*
+ --    ** -- D A T A -------------------------------------------------------------
+       */
+       
+private:
+       
+       int priority_;
+       etl::loose_handle<ValueNode> parent_;
+
+       Interpolation before, after;
+       
+       etl::rhandle<ValueNode> value_node;
+
+       Time time;
+               
+       // The following are for the INTERPOLATION_TCB type
+       Real tension;
+       Real continuity;
+       Real bias;
+
+       // The following are for the INTERPOLATION_MANUAL type
+       ValueBase cpoint_before,cpoint_after;
+       
+
+       float time_tension;
+       
+       /*
+ --    ** -- C O N S T R U C T O R S ---------------------------------------------
+       */
+
+public:
+
+       Waypoint(ValueBase value, Time time);
+       Waypoint(etl::handle<ValueNode> value_node, Time time);
+       
+       Waypoint();
+
+       /*
+ --    ** -- M E M B E R   F U N C T I O N S -------------------------------------
+       */
+
+public:
+
+       void apply_model(const Model &x);
+
+       Interpolation get_before()const { return before; }
+       void set_before(Interpolation x) { before=x; }
+
+       Interpolation get_after()const { return after; }
+       void set_after(Interpolation x) { after=x; }
+
+       ValueBase get_value()const;
+       ValueBase get_value(const Time &t)const;
+       void set_value(const ValueBase &x);
+       
+       const etl::rhandle<ValueNode> &get_value_node()const { return value_node; }
+       void set_value_node(const etl::handle<ValueNode> &x);
+       
+       const Real &get_tension()const { return tension; }
+       void set_tension(const Real &x) { tension=x; }
+
+       const Real &get_continuity()const { return continuity; }
+       void set_continuity(const Real &x) { continuity=x; }
+
+       const Real &get_bias()const { return bias; }
+       void set_bias(const Real &x) { bias=x; }
+
+       const Time &get_time()const { return time; }
+       void set_time(const Time &x);
+
+       int get_priority()const { return priority_; }
+       void set_priority(int x) { priority_=x; }
+
+       const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
+       void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }
+       
+       bool is_static()const;
+
+       float get_time_tension()const { return time_tension; }
+       void set_time_tension(const float& x) { time_tension=x; }
+       float get_temporal_tension()const { return time_tension; }
+       void set_temporal_tension(const float& x) { time_tension=x; }
+       
+       bool operator<(const Waypoint &rhs)const
+       { return time<rhs.time; }
+       
+       bool operator<(const Time &rhs)const
+       { return time.is_less_than(rhs); }
+       bool operator>(const Time &rhs)const
+       { return time.is_more_than(rhs); }
+       
+       bool operator==(const Time &rhs)const
+       { return time.is_equal(rhs); }
+       bool operator!=(const Time &rhs)const
+       { return !time.is_equal(rhs); }
+       
+       bool operator==(const UniqueID &rhs)const
+       { return get_uid()==rhs.get_uid(); }
+       bool operator!=(const UniqueID &rhs)const
+       { return get_uid()!=rhs.get_uid(); }
+
+       Waypoint clone(const GUID& deriv_guid=GUID())const;
+
+       GUID get_guid()const;
+}; // END of class Waypoint
+
+typedef std::vector< Waypoint > WaypointList;
+
+}; // END of namespace sinfg
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-core/trunk/synfig-config.in b/synfig-core/trunk/synfig-config.in
new file mode 100644 (file)
index 0000000..86463d6
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+
+bindir=@bindir@
+libexecdir=@libexecdir@
+datadir=@datadir@
+sysconfdir=@sysconfdir@
+sharedstatedir=@sharedstatedir@
+localstatedir=@localstatedir@
+libdir=@libdir@
+infodir=@infodir@
+mandir=@mandir@
+includedir=@includedir@
+
+LIBS="@SINFG_LIBS@"
+
+VERSION=@VERSION@
+PACKAGE=@PACKAGE@
+
+CFLAGS="@CONFIG_CFLAGS@"
+
+usage()
+{
+       cat <<EOF
+Usage: sinfg-config [OPTION]...
+
+Generic options
+  --version    print installed version of sinfg.
+  --help        display this help and exit.
+
+Compilation support options
+  --cflags      print pre-processor and compiler flags
+  --libs        print library linking information
+  
+Install directories
+  --prefix --exec-prefix --bindir --libexecdir --datadir
+  --sysconfdir --sharedstatedir --localstatedir --libdir --infodir
+  --mandir --includedir
+
+EOF
+       
+       exit 1
+}
+
+if test $# -eq 0; then
+       usage 1
+fi
+
+case $1 in
+--version)
+       echo $PACKAGE $VERSION
+       exit 0
+       ;;
+--exec-prefix)
+       echo $exec_prefix
+       exit 0
+       ;;
+--prefix)
+       echo $prefix
+       exit 0
+       ;;
+--help)
+       usage 0
+       ;;
+--cflags)
+       echo $CFLAGS
+       exit 0
+       ;;
+--cxxflags)
+       echo $CFLAGS
+       exit 0
+       ;;
+--libs)
+       echo $LIBS
+       exit 0
+       ;;
+esac
+
+echo Unknown option "$1"
+exit 4
diff --git a/synfig-core/trunk/synfig.kdevprj b/synfig-core/trunk/synfig.kdevprj
new file mode 100644 (file)
index 0000000..3fdb1c7
--- /dev/null
@@ -0,0 +1,1198 @@
+[./ChangeLog]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./ETL-0.01.01.spec]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./ETL.kdevprj]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./INSTALL]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./Makefile.am]
+files=./aclocal.m4,./config.status,./README,./configure,./config.log,./ETL-0.01.01.spec,./INSTALL,./ChangeLog,./ETL.kdevprj,./bootstrap,
+sub_dirs=test,config,ETL.pbproj,include,
+type=normal
+
+[./README]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./aclocal.m4]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./bootstrap]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./config.log]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./config.status]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[./configure]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[ChangeLog]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[Config for BinMakefileAm]
+addcxxflags=
+bin_program=sinfg
+cflags=
+cppflags=
+cxxflags=\s-O1
+ldadd=
+ldflags=\s\s
+libtool_dir=./libtool/
+path_to_bin_program=./src/tool
+
+[ETL.pbproj/Makefile.am]
+files=
+sub_dirs=
+type=normal
+
+[General]
+AMChanged=false
+author=darco
+configure_args=\s--build=i386-linux --host=i386-linux --target=i386-linux\s
+debug_args=-v -v -v --version
+dir_where_make_will_be_called=./
+email=darco@voria.net
+execute_args=-v -v -v --version
+kdevprj_version=1.3
+lfv_open_groups=
+make_options=\s-j2 -l 2 -j 2
+makefiles=./Makefile.am,include/Makefile.am,ETL.pbproj/Makefile.am,config/Makefile.am,config/pkg-support/Makefile.am,config/pkg-support/devel-resources/Makefile.am,test/Makefile.am,src/modules/trgt_bmp/Makefile.am,src/modules/Makefile.am,src/Makefile.am,src/modules/trgt_gif/Makefile.am,src/modules/lyr_std/Makefile.am,src/modules/example/Makefile.am,src/sinfg/Makefile.am,src/tool/Makefile.am,Makefile.am,src/modules/trgt_ppm/Makefile.am,src/modules/trgt_mpg/Makefile.am,src/modules/mod_ffmpeg/Makefile.am,src/modules/mptr_mplayer/Makefile.am,src/modules/trgt_dv/Makefile.am,src/modules/mod_imagemagick/Makefile.am
+modifyMakefiles=true
+project_name=Sinfg
+project_type=normal_empty
+short_info=
+sub_dir=
+version=
+version_control=CVS
+workspace=1
+
+[INSTALL]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[LFV Groups]
+GNU=AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,NEWS,
+Headers=*.h,*.hxx,*.hpp,*.H,
+Others=*,
+Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l,
+Translations=*.ts,*.po,
+User Interface=*.ui,*.kdevdlg,*.rc,
+groups=Headers,Sources,GNU,Translations,User Interface,Others
+
+[Makefile.am]
+dist=true
+files=bootstrap,ChangeLog,INSTALL,Makefile.am,README,sinfg.kdevprj,sinfg-config.in
+install=false
+install_location=
+sub_dirs=src,config
+type=DATA
+
+[README]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[bootstrap]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/ETL.m4]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/Makefile.am]
+files=config/depcomp,config/configure.ac,config/config.guess,config/install-sh,config/config.sub,config/missing,config/cxx_macros.m4,config/project.spec.in,config/mkinstalldirs,config/sdl.m4,config/build.cfg,config/libxml.m4,config/ETL.m4,config/sinfg.m4
+sub_dirs=pkg-support,
+type=normal
+
+[config/build.cfg]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/config.guess]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/config.sub]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/configure.ac]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/cxx_macros.m4]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/depcomp]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/install-sh]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/libxml.m4]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/missing]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/mkinstalldirs]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/pkg-support/ETL-devel.info]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/pkg-support/Makefile.am]
+files=config/pkg-support/ETL-devel.info,
+sub_dirs=devel-resources,
+type=normal
+
+[config/pkg-support/devel-resources/Makefile.am]
+files=config/pkg-support/devel-resources/ReadMe.txt,config/pkg-support/devel-resources/install.sh,config/pkg-support/devel-resources/Welcome.txt,
+sub_dirs=
+type=normal
+
+[config/pkg-support/devel-resources/ReadMe.txt]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/pkg-support/devel-resources/Welcome.txt]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/pkg-support/devel-resources/install.sh]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/project.spec.in]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/sdl.m4]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[config/sinfg.m4]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/Makefile.am]
+files=include/ipc,include/_bit_rotate.h,include/_fastangle_tables.h,include/_clock_system.h,include/angle,include/clock,include/fixed,include/_rwlock.h,include/_thread.h,include/etl_profile.h.in~,include/etl_profile.h.in,include/_curve.h,include/_trivial.h,include/etl_profile.h,include/surface,include/_mutex_win32.h,include/_clock_gettimeofday.h,include/handle,include/_clock_base.h,include/_smach.h,include/_fixed.h,include/_condition.h,include/random,include/thread,include/stamp-h.in,include/stamp-h1,include/_surface.h,include/_fastangle.h,include/_mutex_pthreads.h,include/_handle.h,include/_random.h,include/_angle.h,include/etl_config.h,
+sub_dirs=
+type=normal
+
+[include/_angle.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_bit_rotate.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_clock_base.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_clock_gettimeofday.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_clock_system.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_condition.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_curve.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_fastangle.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_fastangle_tables.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_fixed.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_handle.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_mutex_pthreads.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_mutex_win32.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_random.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_rwlock.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_smach.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_surface.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_thread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/_trivial.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/angle]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/clock]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/etl_config.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/etl_profile.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[include/etl_profile.h.in]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/etl_profile.h.in~]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/fixed]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/handle]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/ipc]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/random]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/stamp-h.in]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/stamp-h1]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/surface]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[include/thread]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[sinfg-config.in]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[sinfg.kdevprj]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[src/Makefile.am]
+dist=true
+files=src/Makefile.am,src/template.cpp,src/template.h
+install=false
+install_location=
+sub_dirs=modules,sinfg,tool
+type=static_library
+
+[src/modules/Makefile.am]
+dist=true
+files=src/modules/Makefile.am
+install=false
+install_location=
+sub_dirs=trgt_bmp,trgt_gif,lyr_std,example,trgt_ppm,trgt_mpg,mod_ffmpeg,mptr_mplayer,trgt_dv,mod_imagemagick
+type=DATA
+
+[src/modules/example/Makefile.am]
+dist=true
+files=src/modules/example/main.cpp,src/modules/example/Makefile.am
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:1
+sharedlib_rootname=example
+sub_dirs=
+type=DATA
+
+[src/modules/example/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/Makefile.am]
+dist=true
+files=src/modules/lyr_std/checkerboard.cpp,src/modules/lyr_std/checkerboard.h,src/modules/lyr_std/main.cpp,src/modules/lyr_std/Makefile.am,src/modules/lyr_std/mandelbrot.cpp,src/modules/lyr_std/mandelbrot.h,src/modules/lyr_std/solidcolor.cpp,src/modules/lyr_std/solidcolor.h,src/modules/lyr_std/zoom.cpp,src/modules/lyr_std/zoom.h,src/modules/lyr_std/circle.h,src/modules/lyr_std/circle.cpp,src/modules/lyr_std/blur.cpp,src/modules/lyr_std/blur.h,src/modules/lyr_std/import.cpp,src/modules/lyr_std/import.h,src/modules/lyr_std/polygon.cpp,src/modules/lyr_std/polygon.h
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:1
+sharedlib_rootname=lyr_std
+sub_dirs=
+type=static_library
+
+[src/modules/lyr_std/blur.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/blur.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/lyr_std/checkerboard.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/checkerboard.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/lyr_std/circle.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/circle.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/lyr_std/import.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/import.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/lyr_std/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/mandelbrot.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/mandelbrot.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/lyr_std/polygon.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/polygon.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/lyr_std/solidcolor.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/solidcolor.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/lyr_std/zoom.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/lyr_std/zoom.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/mod_ffmpeg/Makefile.am]
+files=src/modules/mod_ffmpeg/main.cpp,src/modules/mod_ffmpeg/mptr_ffmpeg.cpp,src/modules/mod_ffmpeg/mptr_ffmpeg.h,src/modules/mod_ffmpeg/trgt_ffmpeg.cpp,src/modules/mod_ffmpeg/trgt_ffmpeg.h
+sharedlib_LDFLAGS=-version-info 0:0:0
+sharedlib_rootname=mod_ffmpeg
+sub_dirs=
+type=static_library
+
+[src/modules/mod_ffmpeg/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/mod_ffmpeg/mptr_ffmpeg.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/mod_ffmpeg/mptr_ffmpeg.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/mod_ffmpeg/trgt_ffmpeg.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/mod_ffmpeg/trgt_ffmpeg.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/mod_imagemagick/Makefile.am]
+dist=true
+files=src/modules/mod_imagemagick/main.cpp,src/modules/mod_imagemagick/mptr_imagemagick.cpp,src/modules/mod_imagemagick/mptr_imagemagick.h,src/modules/mod_imagemagick/Makefile.am,src/modules/mod_imagemagick/trgt_imagemagick.cpp,src/modules/mod_imagemagick/trgt_imagemagick.h
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:0
+sharedlib_rootname=mod_imagemagick
+sub_dirs=
+type=static_library
+
+[src/modules/mod_imagemagick/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/mod_imagemagick/mptr_imagemagick.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/mod_imagemagick/mptr_imagemagick.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/mod_imagemagick/trgt_imagemagick.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/mod_imagemagick/trgt_imagemagick.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/mptr_mplayer/Makefile.am]
+dist=true
+files=src/modules/mptr_mplayer/main.cpp,src/modules/mptr_mplayer/mptr_mplayer.cpp,src/modules/mptr_mplayer/Makefile.am,src/modules/mptr_mplayer/mptr_mplayer.h
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:0
+sharedlib_rootname=mptr_mplayer
+sub_dirs=
+type=DATA
+
+[src/modules/mptr_mplayer/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/mptr_mplayer/mptr_mplayer.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/mptr_mplayer/mptr_mplayer.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/trgt_bmp/Makefile.am]
+dist=true
+files=src/modules/trgt_bmp/main.cpp,src/modules/trgt_bmp/trgt_bmp.cpp,src/modules/trgt_bmp/Makefile.am,src/modules/trgt_bmp/trgt_bmp.h
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:1
+sharedlib_rootname=trgt_bmp
+sub_dirs=
+type=DATA
+
+[src/modules/trgt_bmp/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_bmp/trgt_bmp.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_bmp/trgt_bmp.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/trgt_dv/Makefile.am]
+dist=true
+files=src/modules/trgt_dv/main.cpp,src/modules/trgt_dv/trgt_dv.cpp,src/modules/trgt_dv/trgt_dv.h,src/modules/trgt_dv/Makefile.am
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:0
+sharedlib_rootname=trgt_dv
+sub_dirs=
+type=DATA
+
+[src/modules/trgt_dv/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_dv/trgt_dv.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_dv/trgt_dv.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/trgt_gif/Makefile.am]
+dist=true
+files=src/modules/trgt_gif/main.cpp,src/modules/trgt_gif/Makefile.am,src/modules/trgt_gif/trgt_gif.cpp,src/modules/trgt_gif/trgt_gif.h
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:1
+sharedlib_rootname=trgt_gif
+sub_dirs=
+type=static_library
+
+[src/modules/trgt_gif/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_gif/trgt_gif.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_gif/trgt_gif.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/trgt_mpg/Makefile.am]
+dist=true
+files=src/modules/trgt_mpg/main.cpp,src/modules/trgt_mpg/Makefile.am,src/modules/trgt_mpg/trgt_mpg.cpp,src/modules/trgt_mpg/trgt_mpg.h
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:1
+sharedlib_rootname=trgt_mpg
+sub_dirs=
+type=static_library
+
+[src/modules/trgt_mpg/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_mpg/trgt_mpg.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_mpg/trgt_mpg.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/trgt_ppm/Makefile.am]
+dist=true
+files=src/modules/trgt_ppm/Makefile.am,src/modules/trgt_ppm/main.cpp,src/modules/trgt_ppm/trgt_ppm.cpp,src/modules/trgt_ppm/trgt_ppm.h,src/modules/trgt_ppm/mptr_ppm.cpp,src/modules/trgt_ppm/mptr_ppm.h,src/modules/trgt_ppm/trgt_mpg.h,src/modules/trgt_ppm/trgt_mpg.cpp
+install=false
+install_location=
+sub_dirs=
+type=static_library
+
+[src/modules/trgt_ppm/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_ppm/mptr_ppm.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_ppm/mptr_ppm.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/trgt_ppm/trgt_mpg.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_ppm/trgt_mpg.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/modules/trgt_ppm/trgt_ppm.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/modules/trgt_ppm/trgt_ppm.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/Makefile.am]
+dist=true
+files=src/sinfg/animate.cpp,src/sinfg/animate.h,src/sinfg/color.cpp,src/sinfg/color.h,src/sinfg/general.h,src/sinfg/layer.cpp,src/sinfg/layer.h,src/sinfg/main.cpp,src/sinfg/Makefile.am,src/sinfg/modules.cpp,src/sinfg/modules.h,src/sinfg/pch.h,src/sinfg/renddesc.h,src/sinfg/render.cpp,src/sinfg/render.h,src/sinfg/sinfg.h,src/sinfg/target.cpp,src/sinfg/target.h,src/sinfg/vector.h,src/sinfg/bmplayer.cpp,src/sinfg/bmplayer.h,src/sinfg/importer.cpp,src/sinfg/importer.h,src/sinfg/surface.cpp,src/sinfg/surface.h,src/sinfg/datatype.h,src/sinfg/datatype.cpp,src/sinfg/canvas.cpp,src/sinfg/canvas.h,src/sinfg/loadcanvas.cpp,src/sinfg/loadcanvas.h,src/sinfg/savecanvas.cpp,src/sinfg/savecanvas.h
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:1
+sharedlib_rootname=sinfg
+sub_dirs=
+type=static_library
+
+[src/sinfg/animate.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/animate.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/bmplayer.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/bmplayer.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/canvas.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/canvas.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/color.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/color.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/datatype.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/datatype.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/general.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/importer.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/importer.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/layer.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/layer.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/loadcanvas.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/loadcanvas.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/modules.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/modules.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/pch.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/renddesc.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/render.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/render.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/savecanvas.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/savecanvas.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/sinfg.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/surface.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/surface.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/target.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/sinfg/target.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/sinfg/vector.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/template.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[src/template.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[src/tool/Makefile.am]
+dist=true
+files=src/tool/main.cpp,src/tool/Makefile.am
+install=false
+install_location=
+sharedlib_LDFLAGS=-version-info 0:0:1
+sharedlib_rootname=tool
+sub_dirs=
+type=DATA
+
+[src/tool/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[test/Makefile.am]
+files=test/random.cpp,test/angle,test/clock,test/fixed,test/smach,test/smach.cpp,test/handle.cpp,test/handle,test/clock.cpp,test/angle.cpp,test/random,test/fixed.cpp,
+sub_dirs=
+type=normal
+
+[test/angle]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[test/angle.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[test/clock]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[test/clock.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[test/fixed]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[test/fixed.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[test/handle]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[test/handle.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[test/random]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[test/random.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[test/smach]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[test/smach.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
diff --git a/synfig-core/trunk/synfig.pbproj/config.h b/synfig-core/trunk/synfig.pbproj/config.h
new file mode 100644 (file)
index 0000000..5ef5097
--- /dev/null
@@ -0,0 +1,335 @@
+/* config.h.  Generated automatically by configure.  */
+/* config-h.in.  Generated automatically from configure.in by autoheader.  */
+/* Define to the address where bug reports for this package should be sent. */
+
+#define PACKAGE_BUGREPORT "darco@deepdarc.com"
+#define PROJECT_BUILDER 1
+
+/* Define to the full name of this package. */
+#define PACKAGE "sinfg"
+
+/* Define to the version of this package. */
+#define VERSION "0.60.05-mac"
+
+#define LTDL_SHLIB_EXT ".so"
+
+#define PLATFORM_DARWIN_PPC 1
+
+/* Define to empty if the keyword does not work.  */
+/* #undef const */
+
+/* Define as __inline if that's what the C compiler calls it.  */
+/* #undef inline */
+
+#define SINFG_LTDL_NO_STATIC
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* Define if you have the argz_append function.  */
+/* #undef HAVE_ARGZ_APPEND */
+
+/* Define if you have the argz_create_sep function.  */
+/* #undef HAVE_ARGZ_CREATE_SEP */
+
+/* Define if you have the argz_insert function.  */
+/* #undef HAVE_ARGZ_INSERT */
+
+/* Define if you have the argz_next function.  */
+/* #undef HAVE_ARGZ_NEXT */
+
+/* Define if you have the argz_stringify function.  */
+/* #undef HAVE_ARGZ_STRINGIFY */
+
+/* Define if you have the bcopy function.  */
+/* #undef HAVE_BCOPY */
+
+/* Define if you have the dlerror function.  */
+/* #undef HAVE_DLERROR */
+
+/* Define if you have the index function.  */
+/* #undef HAVE_INDEX */
+
+/* Define if you have the memcpy function.  */
+#define HAVE_MEMCPY 1
+
+/* Define if you have the memmove function.  */
+#define HAVE_MEMMOVE 1
+
+/* Define if you have the rindex function.  */
+/* #undef HAVE_RINDEX */
+
+/* Define if you have the strchr function.  */
+#define HAVE_STRCHR 1
+
+/* Define if you have the strcmp function.  */
+#define HAVE_STRCMP 1
+
+/* Define if you have the strrchr function.  */
+#define HAVE_STRRCHR 1
+
+/* Define if you have the <argz.h> header file.  */
+/* #undef HAVE_ARGZ_H */
+
+/* Define if you have the <assert.h> header file.  */
+/* #undef HAVE_ASSERT_H */
+
+/* Define if you have the <ctype.h> header file.  */
+#define HAVE_CTYPE_H 1
+
+/* Define if you have the <dirent.h> header file.  */
+#define HAVE_DIRENT_H 1
+
+/* Define if you have the <dl.h> header file.  */
+/* #undef HAVE_DL_H */
+
+/* Define if you have the <dld.h> header file.  */
+/* #undef HAVE_DLD_H */
+
+/* Define if you have the <dlfcn.h> header file.  */
+#undef HAVE_DLFCN_H
+
+/* Define if you have the <errno.h> header file.  */
+#define HAVE_ERRNO_H 1
+
+/* Define if you have the <malloc.h> header file.  */
+/* #undef HAVE_MALLOC_H */
+
+/* Define if you have the <memory.h> header file.  */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <ndir.h> header file.  */
+/* #undef HAVE_NDIR_H */
+
+/* Define if you have the <stdio.h> header file.  */
+#define HAVE_STDIO_H 1
+
+/* Define if you have the <stdlib.h> header file.  */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <string.h> header file.  */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <strings.h> header file.  */
+/* #undef HAVE_STRINGS_H */
+
+/* Define if you have the <sys/dir.h> header file.  */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define if you have the <sys/dl.h> header file.  */
+/* #undef HAVE_SYS_DL_H */
+
+/* Define if you have the <sys/ndir.h> header file.  */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define if you have the <unistd.h> header file.  */
+#define HAVE_UNISTD_H 1
+
+/* Define to the extension used for shared libraries, say, .so.  */
+/* #undef LTDL_SHLIB_EXT */
+
+/* Define to the name of the environment variable that determines the dynamic library search path.  */
+#define LTDL_SHLIBPATH_VAR "DYLD_LIBRARY_PATH"
+
+/* Define to the system default library search path.  */
+#define LTDL_SYSSEARCHPATH "/lib:/usr/lib"
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.  */
+#define LTDL_OBJDIR ".libs/"
+
+/* Define if libtool can extract symbol lists from object files.  */
+#define HAVE_PRELOADED_SYMBOLS 1
+
+/* Define if you have the libdl library or equivalent.  */
+/* #undef HAVE_LIBDL */
+
+/* Define if you have the libdl library or equivalent. */
+/* #undef HAVE_LIBDL */
+
+/* Define if you have the libdl library or equivalent. */
+/* #undef HAVE_LIBDL */
+
+/* Define if you have the shl_load function. */
+/* #undef HAVE_SHL_LOAD */
+
+/* Define if you have the shl_load function. */
+/* #undef HAVE_SHL_LOAD */
+
+/* Define if you have the GNU dld library. */
+/* #undef HAVE_DLD */
+
+/* Define if dlsym() requires a leading underscode in symbol names.  */
+/* #undef NEED_USCORE */
+
+/* Define if the OS needs help to load dependent libraries for dlopen().  */
+#define LTDL_DLOPEN_DEPLIBS 1
+
+/* Define to a type to use for `error_t' if it is not otherwise available. */
+#define error_t int
+
+/* Define to 1 if you have the `argz_append' function. */
+/* #undef HAVE_ARGZ_APPEND */
+
+/* Define to 1 if you have the `argz_create_sep' function. */
+/* #undef HAVE_ARGZ_CREATE_SEP */
+
+/* Define to 1 if you have the <argz.h> header file. */
+/* #undef HAVE_ARGZ_H */
+
+/* Define to 1 if you have the `argz_insert' function. */
+/* #undef HAVE_ARGZ_INSERT */
+
+/* Define to 1 if you have the `argz_next' function. */
+/* #undef HAVE_ARGZ_NEXT */
+
+/* Define to 1 if you have the `argz_stringify' function. */
+/* #undef HAVE_ARGZ_STRINGIFY */
+
+/* Define to 1 if you have the <assert.h> header file. */
+/* #undef HAVE_ASSERT_H */
+
+/* Define to 1 if you have the `bcopy' function. */
+/* #undef HAVE_BCOPY */
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+   */
+#define HAVE_DIRENT_H 1
+
+/* Define if you have the GNU dld library. */
+/* #undef HAVE_DLD */
+
+/* Define to 1 if you have the <dld.h> header file. */
+/* #undef HAVE_DLD_H */
+
+/* Define to 1 if you have the `dlerror' function. */
+#define HAVE_DLERROR 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <dl.h> header file. */
+/* #undef HAVE_DL_H */
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if the system has the type `error_t'. */
+/* #undef HAVE_ERROR_T */
+
+/* Define to 1 if you have the `index' function. */
+/* #undef HAVE_INDEX */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if you have the libdl library or equivalent. */
+#define HAVE_LIBDL 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+/* #undef HAVE_MALLOC_H */
+
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the `memcpy' function. */
+#define HAVE_MEMCPY 1
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define if libtool can extract symbol lists from object files. */
+#define HAVE_PRELOADED_SYMBOLS 1
+
+/* Define to 1 if you have the `rindex' function. */
+/* #undef HAVE_RINDEX */
+
+/* Define if you have the shl_load function. */
+/* #undef HAVE_SHL_LOAD */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strcmp' function. */
+#define HAVE_STRCMP 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+   */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/dl.h> header file. */
+/* #undef HAVE_SYS_DL_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+   */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if the OS needs help to load dependent libraries for dlopen(). */
+#define LTDL_DLOPEN_DEPLIBS 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LTDL_OBJDIR ".libs/"
+
+/* Define to the name of the environment variable that determines the dynamic
+   library search path. */
+#define LTDL_SHLIBPATH_VAR "DYLD_LIBRARY_PATH"
+
+/* Define to the extension used for shared libraries, say, ".so". */
+/* #undef LTDL_SHLIB_EXT */
+
+/* Define to the system default library search path. */
+#define LTDL_SYSSEARCHPATH "/lib:/usr/lib"
+
+/* Define if dlsym() requires a leading underscode in symbol names. */
+#define NEED_USCORE 1
+
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to a type to use for `error_t' if it is not otherwise available. */
+#define error_t int
+
+#define HAVE_LIBPNG    1
+#define HAVE_OPENEXR   1
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+/* #undef inline */
diff --git a/synfig-core/trunk/synfig.pbproj/darco.mode1 b/synfig-core/trunk/synfig.pbproj/darco.mode1
new file mode 100755 (executable)
index 0000000..3f5cc0e
--- /dev/null
@@ -0,0 +1,1121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>ActivePerspectiveName</key>
+       <string>Project</string>
+       <key>AllowedModules</key>
+       <array>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>PBXSmartGroupTreeModule</string>
+                       <key>Name</key>
+                       <string>Groups and Files Outline View</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>PBXNavigatorGroup</string>
+                       <key>Name</key>
+                       <string>Editor</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>XCTaskListModule</string>
+                       <key>Name</key>
+                       <string>Task List</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>XCDetailModule</string>
+                       <key>Name</key>
+                       <string>File and Smart Group Detail Viewer</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>1</string>
+                       <key>Module</key>
+                       <string>PBXBuildResultsModule</string>
+                       <key>Name</key>
+                       <string>Detailed Build Results Viewer</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>1</string>
+                       <key>Module</key>
+                       <string>PBXProjectFindModule</string>
+                       <key>Name</key>
+                       <string>Project Batch Find Tool</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>PBXRunSessionModule</string>
+                       <key>Name</key>
+                       <string>Run Log</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>PBXBookmarksModule</string>
+                       <key>Name</key>
+                       <string>Bookmarks Tool</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>PBXClassBrowserModule</string>
+                       <key>Name</key>
+                       <string>Class Browser</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>PBXCVSModule</string>
+                       <key>Name</key>
+                       <string>Source Code Control Tool</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>PBXDebugBreakpointsModule</string>
+                       <key>Name</key>
+                       <string>Debug Breakpoints Tool</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>XCDockableInspector</string>
+                       <key>Name</key>
+                       <string>Inspector</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>n</string>
+                       <key>Module</key>
+                       <string>PBXOpenQuicklyModule</string>
+                       <key>Name</key>
+                       <string>Open Quickly Tool</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>1</string>
+                       <key>Module</key>
+                       <string>PBXDebugSessionModule</string>
+                       <key>Name</key>
+                       <string>Debugger</string>
+               </dict>
+               <dict>
+                       <key>BundleLoadPath</key>
+                       <string></string>
+                       <key>MaxInstances</key>
+                       <string>1</string>
+                       <key>Module</key>
+                       <string>PBXDebugCLIModule</string>
+                       <key>Name</key>
+                       <string>Debug Console</string>
+               </dict>
+       </array>
+       <key>Description</key>
+       <string>This workspace mimics that found in Xcode 1.2, with various minor improvements such as including attached editors to the build results window and the project find window.</string>
+       <key>DockingSystemVisible</key>
+       <false/>
+       <key>Extension</key>
+       <string>mode1</string>
+       <key>FirstTimeWindowDisplayed</key>
+       <false/>
+       <key>Identifier</key>
+       <string>com.apple.perspectives.project.mode1</string>
+       <key>MajorVersion</key>
+       <integer>31</integer>
+       <key>MinorVersion</key>
+       <integer>0</integer>
+       <key>Name</key>
+       <string>Default Workspace</string>
+       <key>Notifications</key>
+       <array/>
+       <key>OpenEditors</key>
+       <array/>
+       <key>Perspectives</key>
+       <array>
+               <dict>
+                       <key>ChosenToolbarItems</key>
+                       <array>
+                               <string>active-target-popup</string>
+                               <string>action</string>
+                               <string>NSToolbarFlexibleSpaceItem</string>
+                               <string>buildOrClean</string>
+                               <string>build-and-runOrDebug</string>
+                               <string>clean-target</string>
+                               <string>com.apple.ide.PBXToolbarStopButton</string>
+                               <string>get-info</string>
+                               <string>toggle-editor</string>
+                               <string>NSToolbarFlexibleSpaceItem</string>
+                               <string>com.apple.pbx.toolbar.searchfield</string>
+                       </array>
+                       <key>ControllerClassBaseName</key>
+                       <string></string>
+                       <key>IconName</key>
+                       <string>WindowOfProject</string>
+                       <key>Identifier</key>
+                       <string>perspective.project</string>
+                       <key>IsVertical</key>
+                       <false/>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>ContentConfiguration</key>
+                                       <dict>
+                                               <key>PBXBottomSmartGroupGIDs</key>
+                                               <array>
+                                                       <string>1C37FBAC04509CD000000102</string>
+                                                       <string>1C37FAAC04509CD000000102</string>
+                                                       <string>1C08E77C0454961000C914BD</string>
+                                                       <string>1C37FABC05509CD000000102</string>
+                                                       <string>1C37FABC05539CD112110102</string>
+                                                       <string>E2644B35053B69B200211256</string>
+                                                       <string>1C37FABC04509CD000100104</string>
+                                               </array>
+                                               <key>PBXProjectModuleGUID</key>
+                                               <string>1CE0B1FE06471DED0097A5F4</string>
+                                               <key>PBXProjectModuleLabel</key>
+                                               <string>Files</string>
+                                               <key>PBXProjectStructureProvided</key>
+                                               <string>yes</string>
+                                               <key>PBXSmartGroupTreeModuleColumnData</key>
+                                               <dict>
+                                                       <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+                                                       <array>
+                                                               <real>186</real>
+                                                       </array>
+                                                       <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+                                                       <array>
+                                                               <string>MainColumn</string>
+                                                       </array>
+                                               </dict>
+                                               <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+                                               <dict>
+                                                       <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+                                                       <array>
+                                                               <string>F550016102F0983D01000102</string>
+                                                               <string>F550017202F0ABE401000102</string>
+                                                               <string>A684452D0474A7BD00A80006</string>
+                                                               <string>F588A3BE02F0CCE501000102</string>
+                                                               <string>1C37FABC05509CD000000102</string>
+                                                       </array>
+                                                       <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+                                                       <array>
+                                                               <array>
+                                                                       <integer>0</integer>
+                                                               </array>
+                                                       </array>
+                                                       <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+                                                       <string>{{0, 1804}, {186, 576}}</string>
+                                               </dict>
+                                               <key>PBXTopSmartGroupGIDs</key>
+                                               <array/>
+                                       </dict>
+                                       <key>GeometryConfiguration</key>
+                                       <dict>
+                                               <key>Frame</key>
+                                               <string>{{0, 0}, {203, 594}}</string>
+                                               <key>GroupTreeTableConfiguration</key>
+                                               <array>
+                                                       <string>MainColumn</string>
+                                                       <real>186</real>
+                                               </array>
+                                               <key>RubberWindowFrame</key>
+                                               <string>152 177 935 636 0 0 1152 848 </string>
+                                       </dict>
+                                       <key>Module</key>
+                                       <string>PBXSmartGroupTreeModule</string>
+                                       <key>Proportion</key>
+                                       <string>203pt</string>
+                               </dict>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1CE0B20306471E060097A5F4</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>MyNewFile14.java</string>
+                                                               <key>PBXSplitModuleInNavigatorKey</key>
+                                                               <dict>
+                                                                       <key>Split0</key>
+                                                                       <dict>
+                                                                               <key>PBXProjectModuleGUID</key>
+                                                                               <string>1CE0B20406471E060097A5F4</string>
+                                                                               <key>PBXProjectModuleLabel</key>
+                                                                               <string>MyNewFile14.java</string>
+                                                                       </dict>
+                                                                       <key>SplitCount</key>
+                                                                       <string>1</string>
+                                                               </dict>
+                                                               <key>StatusBarVisibility</key>
+                                                               <true/>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 0}, {726, 0}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>152 177 935 636 0 0 1152 848 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXNavigatorGroup</string>
+                                                       <key>Proportion</key>
+                                                       <string>0pt</string>
+                                               </dict>
+                                               <dict>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1CE0B20506471E060097A5F4</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>Targets</string>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 7}, {726, 587}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>152 177 935 636 0 0 1152 848 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>XCDetailModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>587pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>726pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Project</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>XCModuleDock</string>
+                               <string>PBXSmartGroupTreeModule</string>
+                               <string>XCModuleDock</string>
+                               <string>PBXNavigatorGroup</string>
+                               <string>XCDetailModule</string>
+                       </array>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>A6E2EA81076564F1002AF736</string>
+                               <string>1CE0B1FE06471DED0097A5F4</string>
+                               <string>A6E2EA82076564F1002AF736</string>
+                               <string>1CE0B20306471E060097A5F4</string>
+                               <string>1CE0B20506471E060097A5F4</string>
+                       </array>
+                       <key>ToolbarConfiguration</key>
+                       <string>xcode.toolbar.config.default</string>
+               </dict>
+       </array>
+       <key>PerspectivesBarVisible</key>
+       <false/>
+       <key>StatusbarIsVisible</key>
+       <true/>
+       <key>TimeStamp</key>
+       <real>0.0</real>
+       <key>ToolbarDisplayMode</key>
+       <integer>1</integer>
+       <key>ToolbarIsVisible</key>
+       <true/>
+       <key>ToolbarSizeMode</key>
+       <integer>1</integer>
+       <key>Type</key>
+       <string>Perspectives</string>
+       <key>UpdateMessage</key>
+       <string></string>
+       <key>WindowJustification</key>
+       <integer>5</integer>
+       <key>WindowOrderList</key>
+       <array>
+               <string>A6E2EAF7076568B6002AF736</string>
+               <string>A6E2EB0A07656ADA002AF736</string>
+               <string>/Users/darco/Projects/Voria/sinfg/sinfg.pbproj</string>
+       </array>
+       <key>WindowString</key>
+       <string>152 177 935 636 0 0 1152 848 </string>
+       <key>WindowTools</key>
+       <array>
+               <dict>
+                       <key>FirstTimeWindowDisplayed</key>
+                       <false/>
+                       <key>Identifier</key>
+                       <string>windowTool.build</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1CD0528F0623707200166675</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>time.h</string>
+                                                               <key>PBXSplitModuleInNavigatorKey</key>
+                                                               <dict>
+                                                                       <key>Split0</key>
+                                                                       <dict>
+                                                                               <key>PBXProjectModuleGUID</key>
+                                                                               <string>1CD052900623707200166675</string>
+                                                                               <key>PBXProjectModuleLabel</key>
+                                                                               <string>time.h</string>
+                                                                               <key>bookmark</key>
+                                                                               <string>A6E2EB0907656ADA002AF736</string>
+                                                                               <key>history</key>
+                                                                               <array>
+                                                                                       <string>A6E2EB0807656ADA002AF736</string>
+                                                                               </array>
+                                                                       </dict>
+                                                                       <key>SplitCount</key>
+                                                                       <string>1</string>
+                                                               </dict>
+                                                               <key>StatusBarVisibility</key>
+                                                               <true/>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 0}, {500, 215}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>27 325 500 500 0 0 1152 848 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXNavigatorGroup</string>
+                                                       <key>Proportion</key>
+                                                       <string>215pt</string>
+                                               </dict>
+                                               <dict>
+                                                       <key>BecomeActive</key>
+                                                       <true/>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>XCMainBuildResultsModuleGUID</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>Build</string>
+                                                               <key>XCBuildResultsTrigger_Collapse</key>
+                                                               <integer>1021</integer>
+                                                               <key>XCBuildResultsTrigger_Open</key>
+                                                               <integer>1011</integer>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 222}, {500, 236}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>27 325 500 500 0 0 1152 848 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXBuildResultsModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>236pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>458pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Build Results</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXBuildResultsModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <true/>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>A6E2EAF7076568B6002AF736</string>
+                               <string>A6E2EAF8076568B6002AF736</string>
+                               <string>1CD0528F0623707200166675</string>
+                               <string>XCMainBuildResultsModuleGUID</string>
+                       </array>
+                       <key>ToolbarConfiguration</key>
+                       <string>xcode.toolbar.config.build</string>
+                       <key>WindowString</key>
+                       <string>27 325 500 500 0 0 1152 848 </string>
+                       <key>WindowToolGUID</key>
+                       <string>A6E2EAF7076568B6002AF736</string>
+                       <key>WindowToolIsVisible</key>
+                       <true/>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>windowTool.debugger</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>Debugger</key>
+                                                               <dict>
+                                                                       <key>HorizontalSplitView</key>
+                                                                       <dict>
+                                                                               <key>_collapsingFrameDimension</key>
+                                                                               <real>0.0</real>
+                                                                               <key>_indexOfCollapsedView</key>
+                                                                               <integer>0</integer>
+                                                                               <key>_percentageOfCollapsedView</key>
+                                                                               <real>0.0</real>
+                                                                               <key>isCollapsed</key>
+                                                                               <string>yes</string>
+                                                                               <key>sizes</key>
+                                                                               <array>
+                                                                                       <string>{{0, 0}, {317, 164}}</string>
+                                                                                       <string>{{317, 0}, {377, 164}}</string>
+                                                                               </array>
+                                                                       </dict>
+                                                                       <key>VerticalSplitView</key>
+                                                                       <dict>
+                                                                               <key>_collapsingFrameDimension</key>
+                                                                               <real>0.0</real>
+                                                                               <key>_indexOfCollapsedView</key>
+                                                                               <integer>0</integer>
+                                                                               <key>_percentageOfCollapsedView</key>
+                                                                               <real>0.0</real>
+                                                                               <key>isCollapsed</key>
+                                                                               <string>yes</string>
+                                                                               <key>sizes</key>
+                                                                               <array>
+                                                                                       <string>{{0, 0}, {694, 164}}</string>
+                                                                                       <string>{{0, 164}, {694, 216}}</string>
+                                                                               </array>
+                                                                       </dict>
+                                                               </dict>
+                                                               <key>LauncherConfigVersion</key>
+                                                               <string>8</string>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1C162984064C10D400B95A72</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>Debug - GLUTExamples (Underwater)</string>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>DebugConsoleDrawerSize</key>
+                                                               <string>{100, 120}</string>
+                                                               <key>DebugConsoleVisible</key>
+                                                               <string>None</string>
+                                                               <key>DebugConsoleWindowFrame</key>
+                                                               <string>{{200, 200}, {500, 300}}</string>
+                                                               <key>DebugSTDIOWindowFrame</key>
+                                                               <string>{{200, 200}, {500, 300}}</string>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 0}, {694, 380}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>321 238 694 422 0 0 1440 878 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXDebugSessionModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>380pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>380pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Debugger</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXDebugSessionModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <true/>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>1CD10A99069EF8BA00B06720</string>
+                               <string>1C0AD2AB069F1E9B00FABCE6</string>
+                               <string>1C162984064C10D400B95A72</string>
+                               <string>1C0AD2AC069F1E9B00FABCE6</string>
+                       </array>
+                       <key>ToolbarConfiguration</key>
+                       <string>xcode.toolbar.config.debug</string>
+                       <key>WindowString</key>
+                       <string>321 238 694 422 0 0 1440 878 </string>
+                       <key>WindowToolGUID</key>
+                       <string>1CD10A99069EF8BA00B06720</string>
+                       <key>WindowToolIsVisible</key>
+                       <false/>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>windowTool.find</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>Dock</key>
+                                                       <array>
+                                                               <dict>
+                                                                       <key>ContentConfiguration</key>
+                                                                       <dict>
+                                                                               <key>PBXProjectModuleGUID</key>
+                                                                               <string>1CDD528C0622207200134675</string>
+                                                                               <key>PBXProjectModuleLabel</key>
+                                                                               <string>&lt;No Editor&gt;</string>
+                                                                               <key>PBXSplitModuleInNavigatorKey</key>
+                                                                               <dict>
+                                                                                       <key>Split0</key>
+                                                                                       <dict>
+                                                                                               <key>PBXProjectModuleGUID</key>
+                                                                                               <string>1CD0528D0623707200166675</string>
+                                                                                       </dict>
+                                                                                       <key>SplitCount</key>
+                                                                                       <string>1</string>
+                                                                               </dict>
+                                                                               <key>StatusBarVisibility</key>
+                                                                               <true/>
+                                                                       </dict>
+                                                                       <key>GeometryConfiguration</key>
+                                                                       <dict>
+                                                                               <key>Frame</key>
+                                                                               <string>{{0, 0}, {781, 167}}</string>
+                                                                               <key>RubberWindowFrame</key>
+                                                                               <string>62 385 781 470 0 0 1440 878 </string>
+                                                                       </dict>
+                                                                       <key>Module</key>
+                                                                       <string>PBXNavigatorGroup</string>
+                                                                       <key>Proportion</key>
+                                                                       <string>781pt</string>
+                                                               </dict>
+                                                       </array>
+                                                       <key>Proportion</key>
+                                                       <string>50%</string>
+                                               </dict>
+                                               <dict>
+                                                       <key>BecomeActive</key>
+                                                       <true/>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1CD0528E0623707200166675</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>Project Find</string>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>Frame</key>
+                                                               <string>{{8, 0}, {773, 254}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>62 385 781 470 0 0 1440 878 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXProjectFindModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>50%</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>428pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Project Find</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXProjectFindModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <true/>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>1C530D57069F1CE1000CFCEE</string>
+                               <string>1C530D58069F1CE1000CFCEE</string>
+                               <string>1C530D59069F1CE1000CFCEE</string>
+                               <string>1CDD528C0622207200134675</string>
+                               <string>1C530D5A069F1CE1000CFCEE</string>
+                               <string>1CE0B1FE06471DED0097A5F4</string>
+                               <string>1CD0528E0623707200166675</string>
+                       </array>
+                       <key>WindowString</key>
+                       <string>62 385 781 470 0 0 1440 878 </string>
+                       <key>WindowToolGUID</key>
+                       <string>1C530D57069F1CE1000CFCEE</string>
+                       <key>WindowToolIsVisible</key>
+                       <false/>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>MENUSEPARATOR</string>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>windowTool.debuggerConsole</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>BecomeActive</key>
+                                                       <true/>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1C78EAAC065D492600B07095</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>Debugger Console</string>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 0}, {440, 358}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>650 41 440 400 0 0 1280 1002 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXDebugCLIModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>358pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>358pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Debugger Console</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXDebugCLIModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <true/>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>1C78EAAD065D492600B07095</string>
+                               <string>1C78EAAE065D492600B07095</string>
+                               <string>1C78EAAC065D492600B07095</string>
+                       </array>
+                       <key>WindowString</key>
+                       <string>650 41 440 400 0 0 1280 1002 </string>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>windowTool.run</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>LauncherConfigVersion</key>
+                                                               <string>3</string>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1CD0528B0623707200166675</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>Run</string>
+                                                               <key>Runner</key>
+                                                               <dict>
+                                                                       <key>HorizontalSplitView</key>
+                                                                       <dict>
+                                                                               <key>_collapsingFrameDimension</key>
+                                                                               <real>0.0</real>
+                                                                               <key>_indexOfCollapsedView</key>
+                                                                               <integer>0</integer>
+                                                                               <key>_percentageOfCollapsedView</key>
+                                                                               <real>0.0</real>
+                                                                               <key>isCollapsed</key>
+                                                                               <string>yes</string>
+                                                                               <key>sizes</key>
+                                                                               <array>
+                                                                                       <string>{{0, 0}, {491, 167}}</string>
+                                                                                       <string>{{0, 176}, {491, 267}}</string>
+                                                                               </array>
+                                                                       </dict>
+                                                                       <key>VerticalSplitView</key>
+                                                                       <dict>
+                                                                               <key>_collapsingFrameDimension</key>
+                                                                               <real>0.0</real>
+                                                                               <key>_indexOfCollapsedView</key>
+                                                                               <integer>0</integer>
+                                                                               <key>_percentageOfCollapsedView</key>
+                                                                               <real>0.0</real>
+                                                                               <key>isCollapsed</key>
+                                                                               <string>yes</string>
+                                                                               <key>sizes</key>
+                                                                               <array>
+                                                                                       <string>{{0, 0}, {405, 443}}</string>
+                                                                                       <string>{{414, 0}, {514, 443}}</string>
+                                                                               </array>
+                                                                       </dict>
+                                                               </dict>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 0}, {458, 143}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>342 452 458 185 0 0 1440 878 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXRunSessionModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>143pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>143pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Run Log</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXRunSessionModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <true/>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>1C0AD2B3069F1EA900FABCE6</string>
+                               <string>1C0AD2B4069F1EA900FABCE6</string>
+                               <string>1CD0528B0623707200166675</string>
+                               <string>1C0AD2B5069F1EA900FABCE6</string>
+                       </array>
+                       <key>ToolbarConfiguration</key>
+                       <string>xcode.toolbar.config.run</string>
+                       <key>WindowString</key>
+                       <string>342 452 458 185 0 0 1440 878 </string>
+                       <key>WindowToolGUID</key>
+                       <string>1C0AD2B3069F1EA900FABCE6</string>
+                       <key>WindowToolIsVisible</key>
+                       <false/>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>windowTool.scm</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1C78EAB2065D492600B07095</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>&lt;No Editor&gt;</string>
+                                                               <key>PBXSplitModuleInNavigatorKey</key>
+                                                               <dict>
+                                                                       <key>Split0</key>
+                                                                       <dict>
+                                                                               <key>PBXProjectModuleGUID</key>
+                                                                               <string>1C78EAB3065D492600B07095</string>
+                                                                       </dict>
+                                                                       <key>SplitCount</key>
+                                                                       <string>1</string>
+                                                               </dict>
+                                                               <key>StatusBarVisibility</key>
+                                                               <true/>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 0}, {452, 0}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>743 379 452 308 0 0 1280 1002 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXNavigatorGroup</string>
+                                                       <key>Proportion</key>
+                                                       <string>0pt</string>
+                                               </dict>
+                                               <dict>
+                                                       <key>BecomeActive</key>
+                                                       <true/>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1CD052920623707200166675</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>SCM</string>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>ConsoleFrame</key>
+                                                               <string>{{0, 259}, {452, 0}}</string>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 7}, {452, 259}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>743 379 452 308 0 0 1280 1002 </string>
+                                                               <key>TableConfiguration</key>
+                                                               <array>
+                                                                       <string>Status</string>
+                                                                       <real>30</real>
+                                                                       <string>FileName</string>
+                                                                       <real>199</real>
+                                                                       <string>Path</string>
+                                                                       <real>197.09500122070312</real>
+                                                               </array>
+                                                               <key>TableFrame</key>
+                                                               <string>{{0, 0}, {452, 250}}</string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXCVSModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>259pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>266pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>SCM</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXCVSModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <true/>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>1C78EAB4065D492600B07095</string>
+                               <string>1C78EAB5065D492600B07095</string>
+                               <string>1C78EAB2065D492600B07095</string>
+                               <string>1CD052920623707200166675</string>
+                       </array>
+                       <key>WindowString</key>
+                       <string>743 379 452 308 0 0 1280 1002 </string>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>windowTool.breakpoints</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>BecomeActive</key>
+                                                       <true/>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1CD052930623707200166675</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>Breakpoints</string>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>BreakpointsTreeTableConfiguration</key>
+                                                               <array>
+                                                                       <string>enabledColumn</string>
+                                                                       <real>16</real>
+                                                                       <string>breakpointColumn</string>
+                                                                       <real>201.5830078125</real>
+                                                               </array>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 0}, {240, 195}}</string>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>342 421 240 216 0 0 1440 878 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXDebugBreakpointsModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>195pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>195pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Breakpoints</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXDebugBreakpointsModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <false/>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>1C0AD2AD069F1E9B00FABCE6</string>
+                               <string>1C0AD2AE069F1E9B00FABCE6</string>
+                               <string>1CD052930623707200166675</string>
+                       </array>
+                       <key>WindowString</key>
+                       <string>342 421 240 216 0 0 1440 878 </string>
+                       <key>WindowToolGUID</key>
+                       <string>1C0AD2AD069F1E9B00FABCE6</string>
+                       <key>WindowToolIsVisible</key>
+                       <false/>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>windowTool.bookmarks</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>Module</key>
+                                                       <string>PBXBookmarksModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>166pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>166pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Bookmarks</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXBookmarksModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <false/>
+                       <key>WindowString</key>
+                       <string>538 42 401 187 0 0 1280 1002 </string>
+               </dict>
+               <dict>
+                       <key>Identifier</key>
+                       <string>windowTool.classBrowser</string>
+                       <key>Layout</key>
+                       <array>
+                               <dict>
+                                       <key>Dock</key>
+                                       <array>
+                                               <dict>
+                                                       <key>BecomeActive</key>
+                                                       <true/>
+                                                       <key>ContentConfiguration</key>
+                                                       <dict>
+                                                               <key>OptionsSetName</key>
+                                                               <string>Hierarchy, all classes</string>
+                                                               <key>PBXProjectModuleGUID</key>
+                                                               <string>1CA6456E063B45B4001379D8</string>
+                                                               <key>PBXProjectModuleLabel</key>
+                                                               <string>Class Browser - NSObject</string>
+                                                       </dict>
+                                                       <key>GeometryConfiguration</key>
+                                                       <dict>
+                                                               <key>ClassesFrame</key>
+                                                               <string>{{0, 0}, {374, 96}}</string>
+                                                               <key>ClassesTreeTableConfiguration</key>
+                                                               <array>
+                                                                       <string>PBXClassNameColumnIdentifier</string>
+                                                                       <real>208</real>
+                                                                       <string>PBXClassBookColumnIdentifier</string>
+                                                                       <real>22</real>
+                                                               </array>
+                                                               <key>Frame</key>
+                                                               <string>{{0, 0}, {630, 331}}</string>
+                                                               <key>MembersFrame</key>
+                                                               <string>{{0, 105}, {374, 395}}</string>
+                                                               <key>MembersTreeTableConfiguration</key>
+                                                               <array>
+                                                                       <string>PBXMemberTypeIconColumnIdentifier</string>
+                                                                       <real>22</real>
+                                                                       <string>PBXMemberNameColumnIdentifier</string>
+                                                                       <real>216</real>
+                                                                       <string>PBXMemberTypeColumnIdentifier</string>
+                                                                       <real>97</real>
+                                                                       <string>PBXMemberBookColumnIdentifier</string>
+                                                                       <real>22</real>
+                                                               </array>
+                                                               <key>PBXModuleWindowStatusBarHidden2</key>
+                                                               <true/>
+                                                               <key>RubberWindowFrame</key>
+                                                               <string>385 179 630 352 0 0 1440 878 </string>
+                                                       </dict>
+                                                       <key>Module</key>
+                                                       <string>PBXClassBrowserModule</string>
+                                                       <key>Proportion</key>
+                                                       <string>331pt</string>
+                                               </dict>
+                                       </array>
+                                       <key>Proportion</key>
+                                       <string>331pt</string>
+                               </dict>
+                       </array>
+                       <key>Name</key>
+                       <string>Class Browser</string>
+                       <key>ServiceClasses</key>
+                       <array>
+                               <string>PBXClassBrowserModule</string>
+                       </array>
+                       <key>StatusbarIsVisible</key>
+                       <false/>
+                       <key>TableOfContents</key>
+                       <array>
+                               <string>1C0AD2AF069F1E9B00FABCE6</string>
+                               <string>1C0AD2B0069F1E9B00FABCE6</string>
+                               <string>1CA6456E063B45B4001379D8</string>
+                       </array>
+                       <key>ToolbarConfiguration</key>
+                       <string>xcode.toolbar.config.classbrowser</string>
+                       <key>WindowString</key>
+                       <string>385 179 630 352 0 0 1440 878 </string>
+                       <key>WindowToolGUID</key>
+                       <string>1C0AD2AF069F1E9B00FABCE6</string>
+                       <key>WindowToolIsVisible</key>
+                       <false/>
+               </dict>
+       </array>
+</dict>
+</plist>
diff --git a/synfig-core/trunk/synfig.pbproj/darco.pbxuser b/synfig-core/trunk/synfig.pbproj/darco.pbxuser
new file mode 100755 (executable)
index 0000000..fd19245
--- /dev/null
@@ -0,0 +1,757 @@
+// !$*UTF8*$!
+{
+       A60324DD04425DAD00A80006 = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {806, 2309}}";
+                       sepNavSelRange = "{3451, 79}";
+                       sepNavVisRect = "{{0, 1470}, {459, 183}}";
+                       sepNavWindowFrame = "{{42, 264}, {750, 558}}";
+               };
+       };
+       A60324E904425DF300A80006 = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {938, 8161}}";
+                       sepNavSelRange = "{10705, 0}";
+                       sepNavVisRect = "{{0, 5897}, {711, 428}}";
+               };
+       };
+       A64F6CE3052A991700140006 = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {788, 8231}}";
+                       sepNavSelRange = "{6111, 55}";
+                       sepNavVisRect = "{{0, 3321}, {711, 428}}";
+               };
+       };
+       A65F23E605E843EC005A2B7E = {
+               fallbackIsa = XCSourceControlManager;
+               isSCMEnabled = 0;
+               isa = PBXSourceControlManager;
+               scmConfiguration = {
+               };
+               scmType = scm.cvs;
+       };
+       A65F23E705E843EC005A2B7E = {
+               indexTemplatePath = "";
+               isa = PBXCodeSenseManager;
+               usesDefaults = 1;
+               wantsCodeCompletion = 1;
+               wantsCodeCompletionAutoSuggestions = 0;
+               wantsCodeCompletionCaseSensitivity = 1;
+               wantsCodeCompletionListAlways = 1;
+               wantsCodeCompletionOnlyMatchingItems = 1;
+               wantsCodeCompletionParametersIncluded = 1;
+               wantsCodeCompletionPlaceholdersInserted = 1;
+               wantsCodeCompletionTabCompletes = 1;
+               wantsIndex = 1;
+       };
+       A6E2EB0807656ADA002AF736 = {
+               fRef = A60324DD04425DAD00A80006;
+               isa = PBXTextBookmark;
+               rLen = 1;
+               rLoc = 111;
+               rType = 1;
+       };
+       A6E2EB0907656ADA002AF736 = {
+               fRef = A60324DD04425DAD00A80006;
+               isa = PBXTextBookmark;
+               name = "\ttemplate<typename U> bool operator<(const U& rhs)const { return value_<rhs; }\n";
+               rLen = 79;
+               rLoc = 3451;
+               rType = 0;
+               vrLen = 832;
+               vrLoc = 3108;
+       };
+       A6F67DA003E7AE5C00A80006 = {
+               activeExec = 0;
+       };
+       F50C8476037493D401A80006 = {
+               activeExec = 0;
+       };
+       F50C849D03771AF301A80006 = {
+               activeExec = 0;
+       };
+       F513071503267616012F4765 = {
+               activeExec = 0;
+       };
+       F51307A3032684C7012F4765 = {
+               activeExec = 0;
+       };
+       F536546B03575855012F4ADF = {
+               activeExec = 0;
+       };
+       F550016502F0983D01000102 = {
+               activeBuildStyle = F5F2702E03C932DE01BABFEF;
+               activeExecutable = F5F48EBD0314868C01682FCB;
+               activeTarget = F5F48ECF0314873101682FCB;
+               addToTargets = (
+                       F5F48ECF0314873101682FCB,
+                       F5B07697032A95BC01A80082,
+               );
+               breakpoints = (
+               );
+               codeSenseManager = A65F23E705E843EC005A2B7E;
+               executables = (
+                       F5F48EBD0314868C01682FCB,
+               );
+               perUserDictionary = {
+                       PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = {
+                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+                               PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID;
+                               PBXFileTableDataSourceColumnWidthsKey = (
+                                       20,
+                                       266.8799,
+                                       155.2085,
+                               );
+                               PBXFileTableDataSourceColumnsKey = (
+                                       PBXErrorsWarningsDataSource_TypeID,
+                                       PBXErrorsWarningsDataSource_MessageID,
+                                       PBXErrorsWarningsDataSource_LocationID,
+                               );
+                       };
+                       PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
+                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+                               PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+                               PBXFileTableDataSourceColumnWidthsKey = (
+                                       20,
+                                       452,
+                                       20,
+                                       83,
+                                       43,
+                                       43,
+                                       20,
+                               );
+                               PBXFileTableDataSourceColumnsKey = (
+                                       PBXFileDataSource_FiletypeID,
+                                       PBXFileDataSource_Filename_ColumnID,
+                                       PBXFileDataSource_Built_ColumnID,
+                                       PBXFileDataSource_ObjectSize_ColumnID,
+                                       PBXFileDataSource_Errors_ColumnID,
+                                       PBXFileDataSource_Warnings_ColumnID,
+                                       PBXFileDataSource_Target_ColumnID,
+                               );
+                       };
+                       PBXConfiguration.PBXFileTableDataSource3.PBXSymbolsDataSource = {
+                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+                               PBXFileTableDataSourceColumnSortingKey = PBXSymbolsDataSource_SymbolNameID;
+                               PBXFileTableDataSourceColumnWidthsKey = (
+                                       16,
+                                       128.8008,
+                                       158.0356,
+                                       135.2085,
+                               );
+                               PBXFileTableDataSourceColumnsKey = (
+                                       PBXSymbolsDataSource_SymbolTypeIconID,
+                                       PBXSymbolsDataSource_SymbolNameID,
+                                       PBXSymbolsDataSource_SymbolTypeID,
+                                       PBXSymbolsDataSource_ReferenceNameID,
+                               );
+                       };
+                       PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
+                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+                               PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+                               PBXFileTableDataSourceColumnWidthsKey = (
+                                       20,
+                                       385,
+                                       85,
+                                       20,
+                                       85,
+                                       43,
+                                       43,
+                               );
+                               PBXFileTableDataSourceColumnsKey = (
+                                       PBXFileDataSource_FiletypeID,
+                                       PBXFileDataSource_Filename_ColumnID,
+                                       PBXTargetDataSource_PrimaryAttribute,
+                                       PBXFileDataSource_Built_ColumnID,
+                                       PBXFileDataSource_ObjectSize_ColumnID,
+                                       PBXFileDataSource_Errors_ColumnID,
+                                       PBXFileDataSource_Warnings_ColumnID,
+                               );
+                       };
+                       PBXPerProjectTemplateStateSaveDate = 124085462;
+                       PBXPrepackagedSmartGroups_v2 = (
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       activationKey = OldTargetSmartGroup;
+                                       clz = PBXTargetSmartGroup;
+                                       description = "Displays all targets of the project.";
+                                       globalID = 1C37FABC04509CD000000102;
+                                       name = Targets;
+                                       preferences = {
+                                               image = Targets;
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = PBXTargetSmartGroup2;
+                                       description = "Displays all targets of the project as well as nested build phases.";
+                                       globalID = 1C37FBAC04509CD000000102;
+                                       name = Targets;
+                                       preferences = {
+                                               image = Targets;
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = PBXExecutablesSmartGroup;
+                                       description = "Displays all executables of the project.";
+                                       globalID = 1C37FAAC04509CD000000102;
+                                       name = Executables;
+                                       preferences = {
+                                               image = Executable;
+                                       };
+                               },
+                               {
+                                       " PBXTransientLocationAtTop " = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = PBXErrorsWarningsSmartGroup;
+                                       description = "Displays files with errors or warnings.";
+                                       globalID = 1C08E77C0454961000C914BD;
+                                       name = "Errors and Warnings";
+                                       preferences = {
+                                               fnmatch = "";
+                                               image = WarningsErrors;
+                                               recursive = 1;
+                                               regex = "";
+                                               root = "<PROJECT>";
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = PBXFilenameSmartGroup;
+                                       description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+                                       globalID = 1CC0EA4004350EF90044410B;
+                                       name = "Implementation Files";
+                                       preferences = {
+                                               canSave = 1;
+                                               fnmatch = "";
+                                               image = SmartFolder;
+                                               isLeaf = 0;
+                                               recursive = 1;
+                                               regex = "?*\\.[mcMC]";
+                                               root = "<PROJECT>";
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = PBXFilenameSmartGroup;
+                                       description = "This group displays Interface Builder NIB Files.";
+                                       globalID = 1CC0EA4004350EF90041110B;
+                                       name = "NIB Files";
+                                       preferences = {
+                                               canSave = 1;
+                                               fnmatch = "*.nib";
+                                               image = SmartFolder;
+                                               isLeaf = 0;
+                                               recursive = 1;
+                                               regex = "";
+                                               root = "<PROJECT>";
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = no;
+                                       absolutePathToBundle = "";
+                                       clz = PBXFindSmartGroup;
+                                       description = "Displays Find Results.";
+                                       globalID = 1C37FABC05509CD000000102;
+                                       name = "Find Results";
+                                       preferences = {
+                                               image = spyglass;
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = no;
+                                       absolutePathToBundle = "";
+                                       clz = PBXBookmarksSmartGroup;
+                                       description = "Displays Project Bookmarks.";
+                                       globalID = 1C37FABC05539CD112110102;
+                                       name = Bookmarks;
+                                       preferences = {
+                                               image = Bookmarks;
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = XCSCMSmartGroup;
+                                       description = "Displays files with interesting SCM status.";
+                                       globalID = E2644B35053B69B200211256;
+                                       name = SCM;
+                                       preferences = {
+                                               image = PBXRepository;
+                                               isLeaf = 0;
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = PBXSymbolsSmartGroup;
+                                       description = "Displays all symbols for the project.";
+                                       globalID = 1C37FABC04509CD000100104;
+                                       name = "Project Symbols";
+                                       preferences = {
+                                               image = ProjectSymbols;
+                                               isLeaf = 1;
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = PBXFilenameSmartGroup;
+                                       description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+                                       globalID = PBXTemplateMarker;
+                                       name = "Simple Filter SmartGroup";
+                                       preferences = {
+                                               canSave = 1;
+                                               fnmatch = "*.nib";
+                                               image = SmartFolder;
+                                               isLeaf = 0;
+                                               recursive = 1;
+                                               regex = "";
+                                               root = "<PROJECT>";
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       absolutePathToBundle = "";
+                                       clz = PBXFilenameSmartGroup;
+                                       description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+                                       globalID = PBXTemplateMarker;
+                                       name = "Simple Regular Expression SmartGroup";
+                                       preferences = {
+                                               canSave = 1;
+                                               fnmatch = "";
+                                               image = SmartFolder;
+                                               isLeaf = 0;
+                                               recursive = 1;
+                                               regex = "?*\\.[mcMC]";
+                                               root = "<PROJECT>";
+                                       };
+                               },
+                               {
+                                       PBXTransientLocationAtTop = bottom;
+                                       clz = XDDesignSmartGroup;
+                                       description = "Displays Xdesign models";
+                                       globalID = 2E4A936305E6979E00701470;
+                                       name = Design;
+                                       preferences = {
+                                               image = Design;
+                                               isLeaf = 0;
+                                       };
+                               },
+                       );
+                       PBXWorkspaceContents = (
+                               {
+                                       PBXProjectWorkspaceModule_StateKey_Rev39 = {
+                                               PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = {
+                                                       BoundsStr = "{{0, 0}, {454, 340}}";
+                                                       Rows = (
+                                                               5,
+                                                       );
+                                                       VisibleRectStr = "{{0, 0}, {454, 340}}";
+                                               };
+                                               PBXProjectWorkspaceModule_EditorOpen = false;
+                                               PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = {
+                                                       PBXSplitModuleInNavigatorKey = {
+                                                               SplitCount = 1;
+                                                       };
+                                               };
+                                               PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+                                                       PBXProjectWorkspaceModule_SGTM_Geometry = {
+                                                               _collapsingFrameDimension = 0;
+                                                               _indexOfCollapsedView = 0;
+                                                               _percentageOfCollapsedView = 0;
+                                                               sizes = (
+                                                                       "{{0, 0}, {182, 357}}",
+                                                                       "{{182, 0}, {469, 357}}",
+                                                               );
+                                                       };
+                                               };
+                                               PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {469, 357}}";
+                                               PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 0}, {750, 480}}";
+                                               PBXProjectWorkspaceModule_OldSuperviewFrame = "{{182, 0}, {469, 357}}";
+                                               PBXProjectWorkspaceModule_SGTM = {
+                                                       PBXBottomSmartGroupGIDs = (
+                                                               1C37FBAC04509CD000000102,
+                                                               1C37FAAC04509CD000000102,
+                                                               1C08E77C0454961000C914BD,
+                                                               1CC0EA4004350EF90044410B,
+                                                               1CC0EA4004350EF90041110B,
+                                                               1C37FABC05509CD000000102,
+                                                               1C37FABC05539CD112110102,
+                                                               E2644B35053B69B200211256,
+                                                               1C37FABC04509CD000100104,
+                                                       );
+                                                       PBXSmartGroupTreeModuleColumnData = {
+                                                               PBXSmartGroupTreeModuleColumnWidthsKey = (
+                                                                       165,
+                                                               );
+                                                               PBXSmartGroupTreeModuleColumnsKey_v4 = (
+                                                                       MainColumn,
+                                                               );
+                                                       };
+                                                       PBXSmartGroupTreeModuleOutlineStateKey_v7 = {
+                                                               PBXSmartGroupTreeModuleOutlineStateExpansionKey = (
+                                                                       F550016102F0983D01000102,
+                                                                       F58056B403A2F89101A80006,
+                                                                       F58BF73F03379BB601A80006,
+                                                                       F588A3BE02F0CCE501000102,
+                                                                       1C37FBAC04509CD000000102,
+                                                                       A60D2D0405E8559700A20744,
+                                                               );
+                                                               PBXSmartGroupTreeModuleOutlineStateSelectionKey = (
+                                                                       (
+                                                                               26,
+                                                                               22,
+                                                                               0,
+                                                                       ),
+                                                               );
+                                                               PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 120}, {165, 339}}";
+                                                       };
+                                                       PBXTopSmartGroupGIDs = (
+                                                       );
+                                               };
+                                       };
+                               },
+                       );
+                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXBuildResultsModule" = {
+                       };
+                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugCLIModule" = {
+                       };
+                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugSessionModule" = {
+                       };
+                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXNavigatorGroup" = {
+                               PBXSplitModuleInNavigatorKey = {
+                                       SplitCount = 1;
+                               };
+                       };
+                       "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = {
+                               PBXProjectWorkspaceModule_StateKey_Rev39 = {
+                                       PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = {
+                                               BoundsStr = "{{0, 0}, {454, 340}}";
+                                               Rows = (
+                                               );
+                                               VisibleRectStr = "{{0, 0}, {454, 340}}";
+                                       };
+                                       PBXProjectWorkspaceModule_EditorOpen = false;
+                                       PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = {
+                                               PBXSplitModuleInNavigatorKey = {
+                                                       SplitCount = 1;
+                                               };
+                                       };
+                                       PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+                                               PBXProjectWorkspaceModule_SGTM_Geometry = {
+                                                       _collapsingFrameDimension = 0;
+                                                       _indexOfCollapsedView = 0;
+                                                       _percentageOfCollapsedView = 0;
+                                                       sizes = (
+                                                               "{{0, 0}, {182, 357}}",
+                                                               "{{182, 0}, {469, 357}}",
+                                                       );
+                                               };
+                                       };
+                                       PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {469, 357}}";
+                                       PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 0}, {750, 480}}";
+                                       PBXProjectWorkspaceModule_OldSuperviewFrame = "{{182, 0}, {469, 357}}";
+                                       PBXProjectWorkspaceModule_SGTM = {
+                                               PBXBottomSmartGroupGIDs = (
+                                                       1C37FBAC04509CD000000102,
+                                                       1C37FAAC04509CD000000102,
+                                                       1C08E77C0454961000C914BD,
+                                                       1CC0EA4004350EF90044410B,
+                                                       1CC0EA4004350EF90041110B,
+                                                       1C37FABC05509CD000000102,
+                                                       1C37FABC05539CD112110102,
+                                                       E2644B35053B69B200211256,
+                                                       1C37FABC04509CD000100104,
+                                               );
+                                               PBXSmartGroupTreeModuleColumnData = {
+                                                       PBXSmartGroupTreeModuleColumnWidthsKey = (
+                                                               165,
+                                                       );
+                                                       PBXSmartGroupTreeModuleColumnsKey_v4 = (
+                                                               MainColumn,
+                                                       );
+                                               };
+                                               PBXSmartGroupTreeModuleOutlineStateKey_v7 = {
+                                                       PBXSmartGroupTreeModuleOutlineStateExpansionKey = (
+                                                               F550016102F0983D01000102,
+                                                               F58056B403A2F89101A80006,
+                                                               F513071C032676F4012F4765,
+                                                               F513072A03267792012F4765,
+                                                               F58BF73F03379BB601A80006,
+                                                               1C37FBAC04509CD000000102,
+                                                               A60D2D0405E8559700A20744,
+                                                       );
+                                                       PBXSmartGroupTreeModuleOutlineStateSelectionKey = (
+                                                               (
+                                                                       37,
+                                                                       33,
+                                                                       31,
+                                                               ),
+                                                       );
+                                                       PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 446}, {165, 339}}";
+                                               };
+                                               PBXTopSmartGroupGIDs = (
+                                               );
+                                       };
+                               };
+                       };
+                       PBXWorkspaceGeometries = (
+                               {
+                                       Frame = "{{0, 0}, {651, 357}}";
+                                       PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+                                       };
+                                       RubberWindowFrame = "314 374 651 399 0 0 1280 832 ";
+                               },
+                       );
+                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXBuildResultsModule" = {
+                               Frame = "{{0, 0}, {703, 453}}";
+                               PBXModuleWindowStatusBarHidden = YES;
+                               RubberWindowFrame = "515 102 703 474 0 0 1280 832 ";
+                       };
+                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugCLIModule" = {
+                               Frame = "{{0, 0}, {400, 201}}";
+                               PBXModuleWindowStatusBarHidden = YES;
+                               RubberWindowFrame = "50 804 400 222 0 0 1280 832 ";
+                       };
+                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugSessionModule" = {
+                               DebugConsoleDrawerSize = "{100, 120}";
+                               DebugConsoleVisible = None;
+                               DebugConsoleWindowFrame = "{{200, 200}, {500, 300}}";
+                               DebugSTDIOWindowFrame = "{{200, 200}, {500, 300}}";
+                               Frame = "{{0, 0}, {745, 442}}";
+                               WindowFrame = "{{269, 294}, {745, 520}}";
+                       };
+                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXNavigatorGroup" = {
+                               Frame = "{{0, 0}, {750, 481}}";
+                               PBXModuleWindowStatusBarHidden = YES;
+                               RubberWindowFrame = "532 129 750 502 0 0 1280 832 ";
+                       };
+                       "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = {
+                               Frame = "{{0, 0}, {651, 357}}";
+                               PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+                                       PBXProjectWorkspaceModule_BuildResultsWindowVisible = true;
+                               };
+                               RubberWindowFrame = "314 374 651 399 0 0 1280 832 ";
+                       };
+                       PBXWorkspaceStateSaveDate = 124085462;
+               };
+               perUserProjectItems = {
+                       A6E2EB0807656ADA002AF736 = A6E2EB0807656ADA002AF736;
+                       A6E2EB0907656ADA002AF736 = A6E2EB0907656ADA002AF736;
+               };
+               sourceControlManager = A65F23E605E843EC005A2B7E;
+               userBookmarkGroup = F5CDFD230325C4C0012F4765;
+               userBuildSettings = {
+               };
+       };
+       F57D1CB1033FDE9A01A80006 = {
+               activeExec = 0;
+       };
+       F58056B303A2F5F401A80006 = {
+               activeExec = 0;
+       };
+       F580574A03A2FA0401A80006 = {
+               activeExec = 0;
+       };
+       F581E14903B24E2D0101DBD7 = {
+               activeExec = 0;
+       };
+       F59F5F6D0374911E01A80006 = {
+               activeExec = 0;
+       };
+       F59F5F8A037491BD01A80006 = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {711, 1217}}";
+                       sepNavSelRange = "{870, 0}";
+                       sepNavVisRect = "{{0, 231}, {711, 449}}";
+                       sepNavWindowFrame = "{{111, 185}, {750, 558}}";
+               };
+       };
+       F5B0764C032A77BE01A80082 = {
+               activeExec = 0;
+       };
+       F5B07697032A95BC01A80082 = {
+               activeExec = 0;
+       };
+       F5CDFD230325C4C0012F4765 = {
+               children = (
+                       F5CDFD260325D76A012F4765,
+                       F5CDFD270325D7B3012F4765,
+                       F5CDFD280325E148012F4765,
+               );
+               isa = PBXBookmarkGroup;
+               name = Root;
+       };
+       F5CDFD260325D76A012F4765 = {
+               fRef = F5FB06D103200B2801A80006;
+               isa = PBXTextBookmark;
+               name = "ltdl.c: find_handle_callback";
+               rLen = 0;
+               rLoc = 0;
+               rType = 0;
+               vrLen = 0;
+               vrLoc = 0;
+       };
+       F5CDFD270325D7B3012F4765 = {
+               fRef = F5FB06D103200B2801A80006;
+               isa = PBXTextBookmark;
+               name = "ltdl.c: try_dlopen";
+               rLen = 0;
+               rLoc = 0;
+               rType = 0;
+               vrLen = 0;
+               vrLoc = 0;
+       };
+       F5CDFD280325E148012F4765 = {
+               fRef = F5FB06D103200B2801A80006;
+               isa = PBXTextBookmark;
+               name = "ltdl.c: lt_dlopenext";
+               rLen = 0;
+               rLoc = 0;
+               rType = 0;
+               vrLen = 0;
+               vrLoc = 0;
+       };
+       F5D9889B03317C7401A80006 = {
+               activeExec = 0;
+       };
+       F5F48EBB0314868C01682FCB = {
+               activeExec = 0;
+               executables = (
+                       F5F48EBD0314868C01682FCB,
+               );
+       };
+       F5F48EBD0314868C01682FCB = {
+               activeArgIndex = 11;
+               activeArgIndices = (
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       YES,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+                       NO,
+               );
+               argumentStrings = (
+                       "",
+                       "--help",
+                       "--info",
+                       "--license",
+                       "--version",
+                       "internal_mandel.sif -w 300 -h 200 -a 1 --fps 10 -o mandel.gif",
+                       "mandelbrot.sif --fps 5 --start-time 5 --end-time 10 -a 1 -w 300 -h 200 -o mandel_out.sif",
+                       "--layers",
+                       "-v -v -v --targets",
+                       "--modules",
+                       "internal_mandel.sif -o mandelbrot.bmp -w 800 -h 600 -a 3 --time 15",
+                       "../examples/chitori.sif -o chitori.bmp --time 0 -Q 10",
+                       "mandelbrot.sif --time 15 -o mandelbrot.bmp",
+                       "internal_anim.sif --fps 15 --start-time 0 --end-time 22 -w 320 -h 240 -a 5 -o anim.gif -v",
+                       "internal_mandel.sif -o mandel.mpg --fps 10 --start-time 3 --end-time 6 -w 300 -h 200 -a 1",
+                       "internal_mandel.sif -o mandel.mpg --fps 7 --start-time 0 --end-time 6 -w 300 -h 200 -a 1",
+                       "internal_anim.sif -o anim.sif",
+                       "polygon.sif -w 320 -h 240 --start-time 0 --end-time 120 --fps 7 -o polygon.gif",
+                       "../example/about_icon.sif -w 640 -h 480 --frame 10 -o out.png -v -v -v",
+               );
+               configStateDict = {
+               };
+               cppStopOnCatchEnabled = 0;
+               cppStopOnThrowEnabled = 0;
+               customDataFormattersEnabled = 1;
+               debuggerPlugin = GDBDebugging;
+               disassemblyDisplayState = 0;
+               dylibVariantSuffix = "";
+               enableDebugStr = 1;
+               environmentEntries = (
+                       {
+                               active = YES;
+                               name = "";
+                               value = "";
+                       },
+               );
+               isa = PBXExecutable;
+               libgmallocEnabled = 0;
+               name = "Sinfg Tool";
+               shlibInfoDictList = (
+               );
+               sourceDirectories = (
+               );
+       };
+       F5F48EC2031486BE01682FCB = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {1130, 13747}}";
+                       sepNavSelRange = "{18012, 26}";
+                       sepNavVisRect = "{{0, 10587}, {711, 428}}";
+               };
+       };
+       F5F48EC40314870401682FCB = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {776, 1987}}";
+                       sepNavSelRange = "{888, 23}";
+                       sepNavVisRect = "{{0, 0}, {711, 449}}";
+                       sepNavWindowFrame = "{{157, 143}, {750, 558}}";
+               };
+       };
+       F5F48EC50314870401682FCB = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {836, 5431}}";
+                       sepNavSelRange = "{0, 0}";
+                       sepNavVisRect = "{{0, 0}, {711, 428}}";
+                       sepNavWindowFrame = "{{42, 248}, {750, 558}}";
+               };
+       };
+       F5F48EC60314870401682FCB = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {711, 1931}}";
+                       sepNavSelRange = "{2494, 21}";
+                       sepNavVisRect = "{{0, 1127}, {711, 449}}";
+                       sepNavWindowFrame = "{{134, 164}, {750, 558}}";
+               };
+       };
+       F5F48ECF0314873101682FCB = {
+               activeExec = 0;
+       };
+       F5F7845003482C9101A80006 = {
+               activeExec = 0;
+       };
+       F5F784630348DCAA01A80006 = {
+               activeExec = 0;
+       };
+       F5FB06D103200B2801A80006 = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {711, 55817}}";
+                       sepNavSelRange = "{1363, 22}";
+                       sepNavVisRect = "{{0, 409}, {711, 428}}";
+               };
+       };
+       F5FB06D203200B2801A80006 = {
+               uiCtxt = {
+                       sepNavIntBoundsRect = "{{0, 0}, {806, 5207}}";
+                       sepNavSelRange = "{0, 0}";
+                       sepNavVisRect = "{{0, 0}, {711, 428}}";
+                       sepNavWindowFrame = "{{134, 164}, {750, 558}}";
+               };
+       };
+       F5FB071303201B3201A80006 = {
+               activeExec = 0;
+       };
+}
diff --git a/synfig-core/trunk/synfig.pbproj/doxygen.cfg b/synfig-core/trunk/synfig.pbproj/doxygen.cfg
new file mode 100644 (file)
index 0000000..97a7029
--- /dev/null
@@ -0,0 +1,922 @@
+# Doxyfile 1.2.14
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# ValueBases that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "sinfg"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 0.60.00-CVS
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = doc
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, 
+# German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, 
+# Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish.
+
+OUTPUT_LANGUAGE        = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these class will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH        =
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = YES
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower case letters. If set to YES upper case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# users are adviced to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments  will behave just like the Qt-style comments (thus requiring an 
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# reimplements.
+
+INHERIT_DOCS           = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+# SORT_MEMBER_DOCS       = YES
+SORT_MEMBER_DOCS       = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = YES
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = "legal=\if legal" "endlegal=\endif" "writeme=\todo This needs to be documented" "stub=\todo This is a stub"
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consist of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = src/sinfg
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl
+
+FILE_PATTERNS          = *.h *.hxx *.hpp
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.
+
+INPUT_FILTER           = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse.
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the Html help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+, 
+# or Internet explorer 4.0+). Note that for large projects the tree generation 
+# can take a very long time. In such cases it is better to disable this feature. 
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = letter
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimised for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assigments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = YES
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_XML           = NO
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed.
+
+PREDEFINED             = SINFG_NO_DEPRECATED DOXYGEN_SKIP
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line and do not end with a semicolon. Such function macros are typically 
+# used for boiler-plate code, and will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superceded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yield more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are gif, jpg, and png
+# If left blank gif will be used.
+
+DOT_IMAGE_FORMAT       = gif
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermedate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
+
+# The CGI_NAME tag should be the name of the CGI script that 
+# starts the search engine (doxysearch) with the correct parameters. 
+# A script with this name will be generated by doxygen.
+
+CGI_NAME               = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the 
+# cgi binaries are located. See the documentation of your http daemon for 
+# details.
+
+CGI_URL                = 
+
+# The DOC_URL tag should be the absolute URL to the directory where the 
+# documentation is located. If left blank the absolute path to the 
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL                = 
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the 
+# documentation is located. If left blank the directory on the local machine 
+# will be used.
+
+DOC_ABSPATH            = 
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary 
+# is installed.
+
+BIN_ABSPATH            = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to 
+# documentation generated for other projects. This allows doxysearch to search 
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS          = 
diff --git a/synfig-core/trunk/synfig.pbproj/etl_profile.h b/synfig-core/trunk/synfig.pbproj/etl_profile.h
new file mode 100644 (file)
index 0000000..0e414d7
--- /dev/null
@@ -0,0 +1,28 @@
+/* include/etl_profile.h.  Generated by configure.  */
+/* include/etl_profile.h.in.  Generated from configure.in by autoheader.  */
+
+
+#ifndef __VETL_PROFILE_H
+#define __VETL_PROFILE_H
+
+/* define if target is big endian */
+#define WORDS_BIGENDIAN
+
+#ifndef HAVE_GETTIMEOFDAY
+#define HAVE_GETTIMEOFDAY
+#endif 
+
+#ifndef HAVE_PTHREAD_H
+#define HAVE_PTHREAD_H
+#endif
+
+#ifndef HAVE_SCHED_H
+#define HAVE_SCHED_H
+#endif
+
+#ifndef HAVE_PTHREAD_CREATE
+#define HAVE_PTHREAD_CREATE
+#endif
+
+#endif // __VETL_CONFIG_H
+
diff --git a/synfig-core/trunk/synfig.pbproj/project.pbxproj b/synfig-core/trunk/synfig.pbproj/project.pbxproj
new file mode 100755 (executable)
index 0000000..f6f112d
--- /dev/null
@@ -0,0 +1,6808 @@
+// !$*UTF8*$!
+{
+       archiveVersion = 1;
+       classes = {
+       };
+       objectVersion = 39;
+       objects = {
+               A60324CD0442574800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = insideout.cpp;
+                       path = src/modules/lyr_std/insideout.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324CE0442574800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = insideout.h;
+                       path = src/modules/lyr_std/insideout.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324CF0442574800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = julia.cpp;
+                       path = src/modules/lyr_std/julia.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324D00442574800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = julia.h;
+                       path = src/modules/lyr_std/julia.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324D30442574800A80006 = {
+                       fileRef = A60324CD0442574800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324D40442574800A80006 = {
+                       fileRef = A60324CE0442574800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324D50442574800A80006 = {
+                       fileRef = A60324CF0442574800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324D60442574800A80006 = {
+                       fileRef = A60324D00442574800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324D904425DAD00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = angle.h;
+                       path = src/sinfg/angle.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324DA04425DAD00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = renddesc.cpp;
+                       path = src/sinfg/renddesc.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324DB04425DAD00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = string.h;
+                       path = src/sinfg/string.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324DC04425DAD00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = time.cpp;
+                       path = src/sinfg/time.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324DD04425DAD00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = time.h;
+                       path = src/sinfg/time.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324DE04425DAD00A80006 = {
+                       fileRef = A60324D904425DAD00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A60324DF04425DAD00A80006 = {
+                       fileRef = A60324DA04425DAD00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324E004425DAD00A80006 = {
+                       fileRef = A60324DB04425DAD00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A60324E104425DAD00A80006 = {
+                       fileRef = A60324DC04425DAD00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324E204425DAD00A80006 = {
+                       fileRef = A60324DD04425DAD00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A60324E304425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_animated.cpp;
+                       path = src/sinfg/valuenode_animated.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324E404425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_animated.h;
+                       path = src/sinfg/valuenode_animated.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324E504425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_composite.cpp;
+                       path = src/sinfg/valuenode_composite.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324E604425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_composite.h;
+                       path = src/sinfg/valuenode_composite.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324E704425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_const.cpp;
+                       path = src/sinfg/valuenode_const.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324E804425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_const.h;
+                       path = src/sinfg/valuenode_const.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324E904425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_dynamiclist.cpp;
+                       path = src/sinfg/valuenode_dynamiclist.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324EA04425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_dynamiclist.h;
+                       path = src/sinfg/valuenode_dynamiclist.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324EB04425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_linear.cpp;
+                       path = src/sinfg/valuenode_linear.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324EC04425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_linear.h;
+                       path = src/sinfg/valuenode_linear.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324ED04425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_reference.cpp;
+                       path = src/sinfg/valuenode_reference.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324EE04425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_reference.h;
+                       path = src/sinfg/valuenode_reference.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324EF04425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_scale.cpp;
+                       path = src/sinfg/valuenode_scale.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324F004425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_scale.h;
+                       path = src/sinfg/valuenode_scale.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324F104425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_subtract.cpp;
+                       path = src/sinfg/valuenode_subtract.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324F204425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_subtract.h;
+                       path = src/sinfg/valuenode_subtract.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324F304425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_timedswap.cpp;
+                       path = src/sinfg/valuenode_timedswap.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324F404425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_timedswap.h;
+                       path = src/sinfg/valuenode_timedswap.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324F504425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode.cpp;
+                       path = src/sinfg/valuenode.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324F604425DF300A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode.h;
+                       path = src/sinfg/valuenode.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A60324F704425DF300A80006 = {
+                       fileRef = A60324E304425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324F804425DF300A80006 = {
+                       fileRef = A60324E404425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A60324F904425DF300A80006 = {
+                       fileRef = A60324E504425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324FA04425DF300A80006 = {
+                       fileRef = A60324E604425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A60324FB04425DF300A80006 = {
+                       fileRef = A60324E704425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324FC04425DF300A80006 = {
+                       fileRef = A60324E804425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A60324FD04425DF300A80006 = {
+                       fileRef = A60324E904425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A60324FE04425DF300A80006 = {
+                       fileRef = A60324EA04425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A60324FF04425DF300A80006 = {
+                       fileRef = A60324EB04425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A603250004425DF300A80006 = {
+                       fileRef = A60324EC04425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A603250104425DF300A80006 = {
+                       fileRef = A60324ED04425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A603250204425DF300A80006 = {
+                       fileRef = A60324EE04425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A603250304425DF300A80006 = {
+                       fileRef = A60324EF04425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A603250404425DF300A80006 = {
+                       fileRef = A60324F004425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A603250504425DF300A80006 = {
+                       fileRef = A60324F104425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A603250604425DF300A80006 = {
+                       fileRef = A60324F204425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A603250704425DF300A80006 = {
+                       fileRef = A60324F304425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A603250804425DF300A80006 = {
+                       fileRef = A60324F404425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A603250904425DF300A80006 = {
+                       fileRef = A60324F504425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A603250A04425DF300A80006 = {
+                       fileRef = A60324F604425DF300A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CD2052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = activepoint.cpp;
+                       path = src/sinfg/activepoint.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CD3052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = activepoint.h;
+                       path = src/sinfg/activepoint.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CD4052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = blinepoint.cpp;
+                       path = src/sinfg/blinepoint.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CD5052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = blinepoint.h;
+                       path = src/sinfg/blinepoint.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CD6052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = gamma.cpp;
+                       path = src/sinfg/gamma.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CD7052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = gamma.h;
+                       path = src/sinfg/gamma.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CD8052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = gradient.cpp;
+                       path = src/sinfg/gradient.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CD9052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = gradient.h;
+                       path = src/sinfg/gradient.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CDA052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer_shape.cpp;
+                       path = src/sinfg/layer_shape.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CDB052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer_shape.h;
+                       path = src/sinfg/layer_shape.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CDC052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = main.h;
+                       path = src/sinfg/main.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CDD052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = target_null_tile.cpp;
+                       path = src/sinfg/target_null_tile.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CDE052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = target_null_tile.h;
+                       path = src/sinfg/target_null_tile.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CDF052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = target_scanline.cpp;
+                       path = src/sinfg/target_scanline.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE0052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = target_scanline.h;
+                       path = src/sinfg/target_scanline.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE1052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = target_tile.cpp;
+                       path = src/sinfg/target_tile.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE2052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = target_tile.h;
+                       path = src/sinfg/target_tile.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE3052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_bline.cpp;
+                       path = src/sinfg/valuenode_bline.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE4052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_bline.h;
+                       path = src/sinfg/valuenode_bline.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE5052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_segcalctangent.cpp;
+                       path = src/sinfg/valuenode_segcalctangent.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE6052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_segcalctangent.h;
+                       path = src/sinfg/valuenode_segcalctangent.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE7052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_segcalcvertex.cpp;
+                       path = src/sinfg/valuenode_segcalcvertex.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE8052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_segcalcvertex.h;
+                       path = src/sinfg/valuenode_segcalcvertex.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CE9052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_stripes.cpp;
+                       path = src/sinfg/valuenode_stripes.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CEA052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_stripes.h;
+                       path = src/sinfg/valuenode_stripes.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CEB052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_twotone.cpp;
+                       path = src/sinfg/valuenode_twotone.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CEC052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_twotone.h;
+                       path = src/sinfg/valuenode_twotone.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CED052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = waypoint.cpp;
+                       path = src/sinfg/waypoint.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CEE052A991700140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = waypoint.h;
+                       path = src/sinfg/waypoint.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6CEF052A991700140006 = {
+                       fileRef = A64F6CD2052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6CF0052A991700140006 = {
+                       fileRef = A64F6CD3052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CF1052A991700140006 = {
+                       fileRef = A64F6CD4052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6CF2052A991700140006 = {
+                       fileRef = A64F6CD5052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CF3052A991700140006 = {
+                       fileRef = A64F6CD6052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6CF4052A991700140006 = {
+                       fileRef = A64F6CD7052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CF5052A991700140006 = {
+                       fileRef = A64F6CD8052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6CF6052A991700140006 = {
+                       fileRef = A64F6CD9052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CF7052A991700140006 = {
+                       fileRef = A64F6CDA052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6CF8052A991700140006 = {
+                       fileRef = A64F6CDB052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CF9052A991700140006 = {
+                       fileRef = A64F6CDC052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CFA052A991700140006 = {
+                       fileRef = A64F6CDD052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6CFB052A991700140006 = {
+                       fileRef = A64F6CDE052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CFC052A991700140006 = {
+                       fileRef = A64F6CDF052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6CFD052A991700140006 = {
+                       fileRef = A64F6CE0052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6CFE052A991700140006 = {
+                       fileRef = A64F6CE1052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6CFF052A991700140006 = {
+                       fileRef = A64F6CE2052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6D00052A991700140006 = {
+                       fileRef = A64F6CE3052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6D01052A991700140006 = {
+                       fileRef = A64F6CE4052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6D02052A991700140006 = {
+                       fileRef = A64F6CE5052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6D03052A991700140006 = {
+                       fileRef = A64F6CE6052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6D04052A991700140006 = {
+                       fileRef = A64F6CE7052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6D05052A991700140006 = {
+                       fileRef = A64F6CE8052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6D06052A991700140006 = {
+                       fileRef = A64F6CE9052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6D07052A991700140006 = {
+                       fileRef = A64F6CEA052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6D08052A991700140006 = {
+                       fileRef = A64F6CEB052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6D09052A991700140006 = {
+                       fileRef = A64F6CEC052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6D0A052A991700140006 = {
+                       fileRef = A64F6CED052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6D0B052A991700140006 = {
+                       fileRef = A64F6CEE052A991700140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A64F6D10052A99B800140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = radialgradient.cpp;
+                       path = src/modules/lyr_std/radialgradient.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6D16052A99B800140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = twirl.cpp;
+                       path = src/modules/lyr_std/twirl.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6D17052A99B800140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = twirl.h;
+                       path = src/modules/lyr_std/twirl.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A64F6D1C052A99B800140006 = {
+                       fileRef = A64F6D10052A99B800140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6D22052A99B800140006 = {
+                       fileRef = A64F6D16052A99B800140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A64F6D23052A99B800140006 = {
+                       fileRef = A64F6D17052A99B800140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A65F23C805E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
+                       remoteInfo = "Sinfg Library";
+               };
+               A65F23C905E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5B0764C032A77BE01A80082;
+                       remoteInfo = "BMP Target Module";
+               };
+               A65F23CA05E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5B07697032A95BC01A80082;
+                       remoteInfo = "Std. Layers Module";
+               };
+               A65F23CB05E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F57D1CB1033FDE9A01A80006;
+                       remoteInfo = "PPM Target Module";
+               };
+               A65F23CC05E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F536546B03575855012F4ADF;
+                       remoteInfo = "FFMpeg Module";
+               };
+               A65F23CD05E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F59F5F6D0374911E01A80006;
+                       remoteInfo = "FreeType Font Layer Module";
+               };
+               A65F23CE05E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F50C8476037493D401A80006;
+                       remoteInfo = "ImageMagick Module";
+               };
+               A65F23CF05E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F50C849D03771AF301A80006;
+                       remoteInfo = "DV Target Module";
+               };
+               A65F23D005E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F581E14903B24E2D0101DBD7;
+                       remoteInfo = "PNG Target Module";
+               };
+               A65F23D105E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = A6F67DA003E7AE5C00A80006;
+                       remoteInfo = "OpenEXR Module";
+               };
+               A65F23D205E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5F48EBB0314868C01682FCB;
+                       remoteInfo = "Sinfg Tool";
+               };
+               A65F23D305E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
+                       remoteInfo = "Sinfg Library";
+               };
+               A65F23D405E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F51307A3032684C7012F4765;
+                       remoteInfo = "All Modules";
+               };
+               A65F23D505E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
+                       remoteInfo = "Sinfg Library";
+               };
+               A65F23D605E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
+                       remoteInfo = "Sinfg Library";
+               };
+               A65F23D705E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5F48EBB0314868C01682FCB;
+                       remoteInfo = "Sinfg Tool";
+               };
+               A65F23D805E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F51307A3032684C7012F4765;
+                       remoteInfo = "All Modules";
+               };
+               A65F23D905E843AF005A2B7E = {
+                       containerPortal = F550016502F0983D01000102;
+                       isa = PBXContainerItemProxy;
+                       proxyType = 1;
+                       remoteGlobalIDString = F5F48ECF0314873101682FCB;
+                       remoteInfo = "Sinfg Library";
+               };
+               A6714DEC0413E7BB00F656BD = {
+                       children = (
+                               A64F6CE3052A991700140006,
+                               A64F6CE4052A991700140006,
+                               A64F6CE5052A991700140006,
+                               A64F6CE6052A991700140006,
+                               A64F6CE7052A991700140006,
+                               A64F6CE8052A991700140006,
+                               A64F6CE9052A991700140006,
+                               A64F6CEA052A991700140006,
+                               A64F6CEB052A991700140006,
+                               A64F6CEC052A991700140006,
+                               A60324F504425DF300A80006,
+                               A60324F604425DF300A80006,
+                               A60324E304425DF300A80006,
+                               A60324E404425DF300A80006,
+                               A60324E504425DF300A80006,
+                               A60324E604425DF300A80006,
+                               A60324E704425DF300A80006,
+                               A60324E804425DF300A80006,
+                               A60324E904425DF300A80006,
+                               A60324EA04425DF300A80006,
+                               A60324EB04425DF300A80006,
+                               A60324EC04425DF300A80006,
+                               A60324ED04425DF300A80006,
+                               A60324EE04425DF300A80006,
+                               A60324EF04425DF300A80006,
+                               A60324F004425DF300A80006,
+                               A60324F104425DF300A80006,
+                               A60324F204425DF300A80006,
+                               A60324F304425DF300A80006,
+                               A60324F404425DF300A80006,
+                       );
+                       isa = PBXGroup;
+                       name = ValueNodes;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6714DF40413E80A00F656BD = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = segment.h;
+                       path = src/sinfg/segment.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6714DF50413E80A00F656BD = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = types.h;
+                       path = src/sinfg/types.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6714DFD0413E80A00F656BD = {
+                       fileRef = A6714DF40413E80A00F656BD;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A6714DFE0413E80A00F656BD = {
+                       fileRef = A6714DF50413E80A00F656BD;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A6714E1C0413F56300F656BD = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = rotate.cpp;
+                       path = src/modules/lyr_std/rotate.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6714E1D0413F56300F656BD = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = rotate.h;
+                       path = src/modules/lyr_std/rotate.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6714E1E0413F56300F656BD = {
+                       fileRef = A6714E1C0413F56300F656BD;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6714E1F0413F56300F656BD = {
+                       fileRef = A6714E1D0413F56300F656BD;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A68444F50474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = canvasbase.h;
+                       path = src/sinfg/canvasbase.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444F60474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = context.cpp;
+                       path = src/sinfg/context.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444F70474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = context.h;
+                       path = src/sinfg/context.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444F80474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer_bitmap.cpp;
+                       path = src/sinfg/layer_bitmap.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444F90474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer_bitmap.h;
+                       path = src/sinfg/layer_bitmap.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444FA0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer_composite.cpp;
+                       path = src/sinfg/layer_composite.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444FB0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer_composite.h;
+                       path = src/sinfg/layer_composite.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444FC0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer_mime.cpp;
+                       path = src/sinfg/layer_mime.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444FD0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer_mime.h;
+                       path = src/sinfg/layer_mime.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444FE0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer_motionblur.cpp;
+                       path = src/sinfg/layer_motionblur.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68444FF0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer_motionblur.h;
+                       path = src/sinfg/layer_motionblur.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445000474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer_pastecanvas.cpp;
+                       path = src/sinfg/layer_pastecanvas.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445010474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer_pastecanvas.h;
+                       path = src/sinfg/layer_pastecanvas.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445020474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer_polygon.cpp;
+                       path = src/sinfg/layer_polygon.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445030474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer_polygon.h;
+                       path = src/sinfg/layer_polygon.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445040474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer_solidcolor.cpp;
+                       path = src/sinfg/layer_solidcolor.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445050474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer_solidcolor.h;
+                       path = src/sinfg/layer_solidcolor.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445060474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = paramdesc.h;
+                       path = src/sinfg/paramdesc.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445070474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = real.h;
+                       path = src/sinfg/real.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445080474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = string_decl.h;
+                       path = src/sinfg/string_decl.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A684450B0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = target_multi.cpp;
+                       path = src/sinfg/target_multi.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A684450C0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = target_multi.h;
+                       path = src/sinfg/target_multi.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A684450D0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = target_null.cpp;
+                       path = src/sinfg/target_null.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A684450E0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = target_null.h;
+                       path = src/sinfg/target_null.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A684450F0474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = uniqueid.cpp;
+                       path = src/sinfg/uniqueid.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445100474A77900A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = uniqueid.h;
+                       path = src/sinfg/uniqueid.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445110474A77900A80006 = {
+                       fileRef = A68444F50474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445120474A77900A80006 = {
+                       fileRef = A68444F60474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A68445130474A77900A80006 = {
+                       fileRef = A68444F70474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445140474A77900A80006 = {
+                       fileRef = A68444F80474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A68445150474A77900A80006 = {
+                       fileRef = A68444F90474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445160474A77900A80006 = {
+                       fileRef = A68444FA0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A68445170474A77900A80006 = {
+                       fileRef = A68444FB0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445180474A77900A80006 = {
+                       fileRef = A68444FC0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A68445190474A77900A80006 = {
+                       fileRef = A68444FD0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A684451A0474A77900A80006 = {
+                       fileRef = A68444FE0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684451B0474A77900A80006 = {
+                       fileRef = A68444FF0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A684451C0474A77900A80006 = {
+                       fileRef = A68445000474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684451D0474A77900A80006 = {
+                       fileRef = A68445010474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A684451E0474A77900A80006 = {
+                       fileRef = A68445020474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684451F0474A77900A80006 = {
+                       fileRef = A68445030474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445200474A77900A80006 = {
+                       fileRef = A68445040474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A68445210474A77900A80006 = {
+                       fileRef = A68445050474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445220474A77900A80006 = {
+                       fileRef = A68445060474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445230474A77900A80006 = {
+                       fileRef = A68445070474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445240474A77900A80006 = {
+                       fileRef = A68445080474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445270474A77900A80006 = {
+                       fileRef = A684450B0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A68445280474A77900A80006 = {
+                       fileRef = A684450C0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A68445290474A77900A80006 = {
+                       fileRef = A684450D0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684452A0474A77900A80006 = {
+                       fileRef = A684450E0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A684452B0474A77900A80006 = {
+                       fileRef = A684450F0474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684452C0474A77900A80006 = {
+                       fileRef = A68445100474A77900A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A684452D0474A7BD00A80006 = {
+                       children = (
+                               A64F6CDA052A991700140006,
+                               A64F6CDB052A991700140006,
+                               A68444F80474A77900A80006,
+                               A68444F90474A77900A80006,
+                               A68444FA0474A77900A80006,
+                               A68444FB0474A77900A80006,
+                               A68444FC0474A77900A80006,
+                               A68444FD0474A77900A80006,
+                               A68444FE0474A77900A80006,
+                               A68444FF0474A77900A80006,
+                               A68445000474A77900A80006,
+                               A68445010474A77900A80006,
+                               A68445020474A77900A80006,
+                               A68445030474A77900A80006,
+                               A68445040474A77900A80006,
+                               A68445050474A77900A80006,
+                       );
+                       isa = PBXGroup;
+                       name = Layers;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A684452E0474A7D900A80006 = {
+                       children = (
+                               A64F6CDD052A991700140006,
+                               A64F6CDE052A991700140006,
+                               A64F6CDF052A991700140006,
+                               A64F6CE0052A991700140006,
+                               A64F6CE1052A991700140006,
+                               A64F6CE2052A991700140006,
+                               A684450B0474A77900A80006,
+                               A684450C0474A77900A80006,
+                               A684450D0474A77900A80006,
+                               A684450E0474A77900A80006,
+                       );
+                       isa = PBXGroup;
+                       name = Targets;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A684452F0474A83F00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = clamp.cpp;
+                       path = src/modules/lyr_std/clamp.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445300474A83F00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = clamp.h;
+                       path = src/modules/lyr_std/clamp.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445330474A83F00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = stretch.cpp;
+                       path = src/modules/lyr_std/stretch.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445340474A83F00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = stretch.h;
+                       path = src/modules/lyr_std/stretch.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445350474A83F00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = xorpattern.cpp;
+                       path = src/modules/lyr_std/xorpattern.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445360474A83F00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = xorpattern.h;
+                       path = src/modules/lyr_std/xorpattern.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A68445370474A83F00A80006 = {
+                       fileRef = A684452F0474A83F00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A68445380474A83F00A80006 = {
+                       fileRef = A68445300474A83F00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684453B0474A83F00A80006 = {
+                       fileRef = A68445330474A83F00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684453C0474A83F00A80006 = {
+                       fileRef = A68445340474A83F00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684453D0474A83F00A80006 = {
+                       fileRef = A68445350474A83F00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A684453E0474A83F00A80006 = {
+                       fileRef = A68445360474A83F00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6B861DF03E88E9500A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = archive.ar;
+                       name = libHalf.a;
+                       path = /usr/local/lib/libHalf.a;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               A6B861E003E88E9500A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = archive.ar;
+                       name = libIex.a;
+                       path = /usr/local/lib/libIex.a;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               A6B861E103E88E9500A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = archive.ar;
+                       name = libIlmImf.a;
+                       path = /usr/local/lib/libIlmImf.a;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               A6B861E203E88E9500A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = archive.ar;
+                       name = libImath.a;
+                       path = /usr/local/lib/libImath.a;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               A6B861E303E88E9500A80006 = {
+                       fileRef = A6B861DF03E88E9500A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6B861E403E88E9500A80006 = {
+                       fileRef = A6B861E003E88E9500A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6B861E503E88E9500A80006 = {
+                       fileRef = A6B861E103E88E9500A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6B861E603E88E9500A80006 = {
+                       fileRef = A6B861E203E88E9500A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6B861E703E88E9900A80006 = {
+                       children = (
+                               A6B861E003E88E9500A80006,
+                               A6B861E103E88E9500A80006,
+                               A6B861E203E88E9500A80006,
+                               A6B861DF03E88E9500A80006,
+                       );
+                       isa = PBXGroup;
+                       name = OpenEXR;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6B861E803E88EC100A80006 = {
+                       children = (
+                               F5EC16810332800301A80006,
+                               F51952E003326DBE01A80006,
+                               F58056B103A2DD0F01A80006,
+                       );
+                       isa = PBXGroup;
+                       name = XML;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6B861EB03E8937A00A80006 = {
+                       fileRef = F5FB06D503200BCD01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6B861EC03E893B500A80006 = {
+                       isa = PBXTargetDependency;
+                       target = A6F67DA003E7AE5C00A80006;
+                       targetProxy = A65F23D105E843AF005A2B7E;
+               };
+               A6B861ED03E897E500A80006 = {
+                       fileRef = A6F67DAB03E7AE5C00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1414905E836A0004C1DD1 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = curve_helper.cpp;
+                       path = src/sinfg/curve_helper.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C1414A05E836A0004C1DD1 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = curve_helper.h;
+                       path = src/sinfg/curve_helper.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C1414B05E836A0004C1DD1 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = palette.cpp;
+                       path = src/sinfg/palette.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C1414C05E836A0004C1DD1 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = palette.h;
+                       path = src/sinfg/palette.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C1414D05E836A0004C1DD1 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = polynomial_root.cpp;
+                       path = src/sinfg/polynomial_root.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C1414E05E836A0004C1DD1 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = polynomial_root.h;
+                       path = src/sinfg/polynomial_root.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C1414F05E836A0004C1DD1 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = transform.cpp;
+                       path = src/sinfg/transform.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C1415005E836A0004C1DD1 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = transform.h;
+                       path = src/sinfg/transform.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C1415105E836A0004C1DD1 = {
+                       fileRef = A6C1414905E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415205E836A0004C1DD1 = {
+                       fileRef = A6C1414A05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415305E836A0004C1DD1 = {
+                       fileRef = A6C1414B05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415405E836A0004C1DD1 = {
+                       fileRef = A6C1414C05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415505E836A0004C1DD1 = {
+                       fileRef = A6C1414D05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415605E836A0004C1DD1 = {
+                       fileRef = A6C1414E05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415705E836A0004C1DD1 = {
+                       fileRef = A6C1414F05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415805E836A0004C1DD1 = {
+                       fileRef = A6C1415005E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415905E836A0004C1DD1 = {
+                       fileRef = A6C1414905E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415A05E836A0004C1DD1 = {
+                       fileRef = A6C1414A05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415B05E836A0004C1DD1 = {
+                       fileRef = A6C1414B05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415C05E836A0004C1DD1 = {
+                       fileRef = A6C1414C05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415D05E836A0004C1DD1 = {
+                       fileRef = A6C1414D05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415E05E836A0004C1DD1 = {
+                       fileRef = A6C1414E05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1415F05E836A0004C1DD1 = {
+                       fileRef = A6C1414F05E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C1416005E836A0004C1DD1 = {
+                       fileRef = A6C1415005E836A0004C1DD1;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C8D62B0430F3DC00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = exception.cpp;
+                       path = src/sinfg/exception.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C8D62C0430F3DC00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = keyframe.cpp;
+                       path = src/sinfg/keyframe.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C8D62D0430F3DC00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = keyframe.h;
+                       path = src/sinfg/keyframe.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6C8D62E0430F3DC00A80006 = {
+                       fileRef = A6C8D62B0430F3DC00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C8D62F0430F3DC00A80006 = {
+                       fileRef = A6C8D62C0430F3DC00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6C8D6300430F3DC00A80006 = {
+                       fileRef = A6C8D62D0430F3DC00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A6D879B6042BAC7F00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = exception.h;
+                       path = src/sinfg/exception.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6D879B7042BAC7F00A80006 = {
+                       fileRef = A6D879B6042BAC7F00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A6D879B8042BACED00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = mptr_bmp.cpp;
+                       path = src/modules/mod_bmp/mptr_bmp.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6D879B9042BACED00A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = mptr_bmp.h;
+                       path = src/modules/mod_bmp/mptr_bmp.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6D879BA042BACED00A80006 = {
+                       fileRef = A6D879B8042BACED00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6D879BB042BACED00A80006 = {
+                       fileRef = A6D879B9042BACED00A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6D879BC042BACF900A80006 = {
+                       fileRef = F581E15903B24ECF0101DBD7;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6D879BD042BACFC00A80006 = {
+                       fileRef = F581E15A03B24ECF0101DBD7;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EA8307656625002AF736 = {
+                       children = (
+                       );
+                       isa = PBXGroup;
+                       name = Geometry;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8407656630002AF736 = {
+                       children = (
+                       );
+                       isa = PBXGroup;
+                       name = Gradients;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8507656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = curveset.cpp;
+                       path = src/sinfg/curveset.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8607656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = curveset.h;
+                       path = src/sinfg/curveset.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8707656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = distance.cpp;
+                       path = src/sinfg/distance.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8807656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = distance.h;
+                       path = src/sinfg/distance.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8907656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = guid.cpp;
+                       path = src/sinfg/guid.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8A07656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = guid.h;
+                       path = src/sinfg/guid.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8B07656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = guidset.h;
+                       path = src/sinfg/guidset.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8C07656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = interpolation.h;
+                       path = src/sinfg/interpolation.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8D07656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = node.cpp;
+                       path = src/sinfg/node.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8E07656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = node.h;
+                       path = src/sinfg/node.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA8F07656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = rect.cpp;
+                       path = src/sinfg/rect.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9007656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = rect.h;
+                       path = src/sinfg/rect.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9107656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = smartfile.h;
+                       path = src/sinfg/smartfile.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9207656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = timepointcollect.cpp;
+                       path = src/sinfg/timepointcollect.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9307656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = timepointcollect.h;
+                       path = src/sinfg/timepointcollect.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9407656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_radialcomposite.cpp;
+                       path = src/sinfg/valuenode_radialcomposite.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9507656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_radialcomposite.h;
+                       path = src/sinfg/valuenode_radialcomposite.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9607656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = valuenode_sine.cpp;
+                       path = src/sinfg/valuenode_sine.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9707656673002AF736 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = valuenode_sine.h;
+                       path = src/sinfg/valuenode_sine.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6E2EA9807656673002AF736 = {
+                       fileRef = A6E2EA8507656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EA9907656673002AF736 = {
+                       fileRef = A6E2EA8607656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EA9A07656673002AF736 = {
+                       fileRef = A6E2EA8707656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EA9B07656673002AF736 = {
+                       fileRef = A6E2EA8807656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EA9C07656673002AF736 = {
+                       fileRef = A6E2EA8907656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EA9D07656673002AF736 = {
+                       fileRef = A6E2EA8A07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EA9E07656673002AF736 = {
+                       fileRef = A6E2EA8B07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EA9F07656673002AF736 = {
+                       fileRef = A6E2EA8C07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA007656673002AF736 = {
+                       fileRef = A6E2EA8D07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA107656673002AF736 = {
+                       fileRef = A6E2EA8E07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA207656673002AF736 = {
+                       fileRef = A6E2EA8F07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA307656673002AF736 = {
+                       fileRef = A6E2EA9007656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA407656673002AF736 = {
+                       fileRef = A6E2EA9107656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA507656673002AF736 = {
+                       fileRef = A6E2EA9207656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA607656673002AF736 = {
+                       fileRef = A6E2EA9307656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA707656673002AF736 = {
+                       fileRef = A6E2EA9407656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA807656673002AF736 = {
+                       fileRef = A6E2EA9507656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAA907656673002AF736 = {
+                       fileRef = A6E2EA9607656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAAA07656673002AF736 = {
+                       fileRef = A6E2EA9707656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAAB07656673002AF736 = {
+                       fileRef = A6E2EA8507656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAAC07656673002AF736 = {
+                       fileRef = A6E2EA8607656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAAD07656673002AF736 = {
+                       fileRef = A6E2EA8707656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAAE07656673002AF736 = {
+                       fileRef = A6E2EA8807656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAAF07656673002AF736 = {
+                       fileRef = A6E2EA8907656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB007656673002AF736 = {
+                       fileRef = A6E2EA8A07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB107656673002AF736 = {
+                       fileRef = A6E2EA8B07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB207656673002AF736 = {
+                       fileRef = A6E2EA8C07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB307656673002AF736 = {
+                       fileRef = A6E2EA8D07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB407656673002AF736 = {
+                       fileRef = A6E2EA8E07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB507656673002AF736 = {
+                       fileRef = A6E2EA8F07656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB607656673002AF736 = {
+                       fileRef = A6E2EA9007656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB707656673002AF736 = {
+                       fileRef = A6E2EA9107656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB807656673002AF736 = {
+                       fileRef = A6E2EA9207656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EAB907656673002AF736 = {
+                       fileRef = A6E2EA9307656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EABA07656673002AF736 = {
+                       fileRef = A6E2EA9407656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EABB07656673002AF736 = {
+                       fileRef = A6E2EA9507656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EABC07656673002AF736 = {
+                       fileRef = A6E2EA9607656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6E2EABD07656673002AF736 = {
+                       fileRef = A6E2EA9707656673002AF736;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6F67D8D03E7AD7400A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = listimporter.cpp;
+                       path = src/sinfg/listimporter.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67D8E03E7AD7400A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = listimporter.h;
+                       path = src/sinfg/listimporter.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67D8F03E7AD7400A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = version.h;
+                       path = src/sinfg/version.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67D9C03E7AD7400A80006 = {
+                       fileRef = A6F67D8D03E7AD7400A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6F67D9D03E7AD7400A80006 = {
+                       fileRef = A6F67D8E03E7AD7400A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A6F67D9E03E7AD7400A80006 = {
+                       fileRef = A6F67D8F03E7AD7400A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A6F67D9F03E7AE1900A80006 = {
+                       children = (
+                               A6F67DAD03E7AEF800A80006,
+                               A6F67DAE03E7AEF800A80006,
+                               A6F67DAF03E7AEF800A80006,
+                               A6F67DB003E7AEF800A80006,
+                               A6F67DB103E7AEF800A80006,
+                       );
+                       isa = PBXGroup;
+                       name = OpenEXR;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67DA003E7AE5C00A80006 = {
+                       buildPhases = (
+                               A6F67DA103E7AE5C00A80006,
+                               A6F67DA303E7AE5C00A80006,
+                               A6F67DA603E7AE5C00A80006,
+                               A6F67DAA03E7AE5C00A80006,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = "/usr/local/include/OpenEXR src";
+                               LIBRARY_SEARCH_PATHS = "";
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "-DHAVE_CONFIG_H";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmod_openexr.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "OpenEXR Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = A6F67DAB03E7AE5C00A80006;
+               };
+               A6F67DA103E7AE5C00A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               A6F67DB903E7AEF800A80006,
+                               A6F67DBB03E7AEF800A80006,
+                               A6B861EB03E8937A00A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               A6F67DA303E7AE5C00A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               A6F67DB703E7AEF800A80006,
+                               A6F67DB803E7AEF800A80006,
+                               A6F67DBA03E7AEF800A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               A6F67DA603E7AE5C00A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               A6F67DA703E7AE5C00A80006,
+                               A6F67DA803E7AE5C00A80006,
+                               A6B861E303E88E9500A80006,
+                               A6B861E403E88E9500A80006,
+                               A6B861E503E88E9500A80006,
+                               A6B861E603E88E9500A80006,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               A6F67DA703E7AE5C00A80006 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6F67DA803E7AE5C00A80006 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6F67DAA03E7AE5C00A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               A6F67DAB03E7AE5C00A80006 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmod_openexr.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               A6F67DAD03E7AEF800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mod_openexr/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67DAE03E7AEF800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = mptr_openexr.cpp;
+                       path = src/modules/mod_openexr/mptr_openexr.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67DAF03E7AEF800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = mptr_openexr.h;
+                       path = src/modules/mod_openexr/mptr_openexr.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67DB003E7AEF800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_openexr.cpp;
+                       path = src/modules/mod_openexr/trgt_openexr.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67DB103E7AEF800A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_openexr.h;
+                       path = src/modules/mod_openexr/trgt_openexr.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6F67DB703E7AEF800A80006 = {
+                       fileRef = A6F67DAD03E7AEF800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6F67DB803E7AEF800A80006 = {
+                       fileRef = A6F67DAE03E7AEF800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6F67DB903E7AEF800A80006 = {
+                       fileRef = A6F67DAF03E7AEF800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6F67DBA03E7AEF800A80006 = {
+                       fileRef = A6F67DB003E7AEF800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6F67DBB03E7AEF800A80006 = {
+                       fileRef = A6F67DB103E7AEF800A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6FEFDEC05DEA44C00140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = blur.cpp;
+                       path = src/sinfg/blur.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6FEFDED05DEA44C00140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = blur.h;
+                       path = src/sinfg/blur.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6FEFDEE05DEA44C00140006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = paramdesc.cpp;
+                       path = src/sinfg/paramdesc.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               A6FEFDEF05DEA44C00140006 = {
+                       fileRef = A6FEFDEC05DEA44C00140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               A6FEFDF005DEA44C00140006 = {
+                       fileRef = A6FEFDED05DEA44C00140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               A6FEFDF105DEA44C00140006 = {
+                       fileRef = A6FEFDEE05DEA44C00140006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+//A60
+//A61
+//A62
+//A63
+//A64
+//F50
+//F51
+//F52
+//F53
+//F54
+               F504527502F391C901000102 = {
+                       buildSettings = {
+                               COPY_PHASE_STRIP = NO;
+                               HEADER_SEARCH_PATHS = "\U0001./sinfg.pbproj";
+                               LDFLAGS = "\U0001-flat-namespace";
+                               MACOSX_DEPLOYMENT_TARGET = 10.2;
+                               OPTIMIZATION_CFLAGS = "-O0 -g -faltivec";
+                               OTHER_CFLAGS = "\U0001-DHAVE_CFLAGS -D_DEBUG -DHAVE_CONFIG_H -Wno-long-double";
+                               OTHER_CXXFLAGS = "\U0001-DHAVE_CFLAGS -D_DEBUG -DHAVE_CONFIG_H -Wno-long-double";
+                       };
+                       isa = PBXBuildStyle;
+                       name = "Development (GCC3)";
+               };
+               F50C8475037493C801A80006 = {
+                       isa = PBXTargetDependency;
+                       target = F59F5F6D0374911E01A80006;
+                       targetProxy = A65F23CD05E843AF005A2B7E;
+               };
+               F50C8476037493D401A80006 = {
+                       buildPhases = (
+                               F50C8477037493D401A80006,
+                               F50C847A037493D401A80006,
+                               F50C847E037493D401A80006,
+                               F50C8481037493D401A80006,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmod_imagemagick.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "ImageMagick Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F50C8482037493D401A80006;
+               };
+               F50C8477037493D401A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F50C848B0374945C01A80006,
+                               F50C848D0374945C01A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F50C847A037493D401A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F50C84890374945C01A80006,
+                               F50C848A0374945C01A80006,
+                               F50C848C0374945C01A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F50C847E037493D401A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F50C847F037493D401A80006,
+                               F50C8480037493D401A80006,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F50C847F037493D401A80006 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C8480037493D401A80006 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C8481037493D401A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F50C8482037493D401A80006 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmod_imagemagick.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F50C84830374942C01A80006 = {
+                       children = (
+                               F50C84840374945C01A80006,
+                               F50C84850374945C01A80006,
+                               F50C84860374945C01A80006,
+                               F50C84870374945C01A80006,
+                               F50C84880374945C01A80006,
+                               F50C848E0374947C01A80006,
+                       );
+                       isa = PBXGroup;
+                       name = ImageMagick;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84840374945C01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mod_imagemagick/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84850374945C01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = mptr_imagemagick.cpp;
+                       path = src/modules/mod_imagemagick/mptr_imagemagick.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84860374945C01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = mptr_imagemagick.h;
+                       path = src/modules/mod_imagemagick/mptr_imagemagick.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84870374945C01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_imagemagick.cpp;
+                       path = src/modules/mod_imagemagick/trgt_imagemagick.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84880374945C01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_imagemagick.h;
+                       path = src/modules/mod_imagemagick/trgt_imagemagick.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84890374945C01A80006 = {
+                       fileRef = F50C84840374945C01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C848A0374945C01A80006 = {
+                       fileRef = F50C84850374945C01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C848B0374945C01A80006 = {
+                       fileRef = F50C84860374945C01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C848C0374945C01A80006 = {
+                       fileRef = F50C84870374945C01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C848D0374945C01A80006 = {
+                       fileRef = F50C84880374945C01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C848E0374947C01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/mod_imagemagick/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C848F0374948C01A80006 = {
+                       isa = PBXTargetDependency;
+                       target = F50C8476037493D401A80006;
+                       targetProxy = A65F23CE05E843AF005A2B7E;
+               };
+               F50C8494037496BE01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = translate.cpp;
+                       path = src/modules/lyr_std/translate.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C8495037496BE01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = translate.h;
+                       path = src/modules/lyr_std/translate.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C849A037496BE01A80006 = {
+                       fileRef = F50C8494037496BE01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C849B037496BE01A80006 = {
+                       fileRef = F50C8495037496BE01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C849C03771ACC01A80006 = {
+                       children = (
+                               F50C84AB03771B7B01A80006,
+                               F50C84AC03771B7B01A80006,
+                               F50C84AD03771B7B01A80006,
+                               F50C84B103771B9601A80006,
+                       );
+                       isa = PBXGroup;
+                       name = DV;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C849D03771AF301A80006 = {
+                       buildPhases = (
+                               F50C849E03771AF301A80006,
+                               F50C84A103771AF301A80006,
+                               F50C84A503771AF301A80006,
+                               F50C84A803771AF301A80006,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmod_dv.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "DV Target Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F50C84A903771AF301A80006;
+               };
+               F50C849E03771AF301A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F50C84B003771B7B01A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F50C84A103771AF301A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F50C84AE03771B7B01A80006,
+                               F50C84AF03771B7B01A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F50C84A503771AF301A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F50C84A603771AF301A80006,
+                               F50C84A703771AF301A80006,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F50C84A603771AF301A80006 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C84A703771AF301A80006 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C84A803771AF301A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F50C84A903771AF301A80006 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmod_dv.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F50C84AA03771B0501A80006 = {
+                       isa = PBXTargetDependency;
+                       target = F50C849D03771AF301A80006;
+                       targetProxy = A65F23CF05E843AF005A2B7E;
+               };
+               F50C84AB03771B7B01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mod_dv/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84AC03771B7B01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_dv.cpp;
+                       path = src/modules/mod_dv/trgt_dv.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84AD03771B7B01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_dv.h;
+                       path = src/modules/mod_dv/trgt_dv.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84AE03771B7B01A80006 = {
+                       fileRef = F50C84AB03771B7B01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C84AF03771B7B01A80006 = {
+                       fileRef = F50C84AC03771B7B01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C84B003771B7B01A80006 = {
+                       fileRef = F50C84AD03771B7B01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C84B103771B9601A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/mod_dv/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F50C84B203771D3F01A80006 = {
+                       fileRef = F59F5F860374911E01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C84B303771D4001A80006 = {
+                       fileRef = F50C8482037493D401A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F50C84B403771D4101A80006 = {
+                       fileRef = F50C84A903771AF301A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F51305FF0325FC38012F4765 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = wrapper.framework;
+                       name = ETL.framework;
+                       path = /Library/Frameworks/ETL.framework;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               F51306480325FC38012F4765 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F51306490325FC4E012F4765 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F513064A0325FC51012F4765 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F513071103267616012F4765 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5130731032677CD012F4765,
+                               F5130732032677CD012F4765,
+                               F513073F03267D2C012F4765,
+                               F5130733032677CD012F4765,
+                               F513073B03267CDB012F4765,
+                       );
+                       isa = PBXResourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F513071503267616012F4765 = {
+                       buildPhases = (
+                               F581E13F03B249EA0101DBD7,
+                               F513079E032682CF012F4765,
+                               F513071903267679012F4765,
+                               F513071A03267680012F4765,
+                               F513071103267616012F4765,
+                               F513071B03267685012F4765,
+                       );
+                       buildSettings = {
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PRODUCT_NAME = "sinfg-devel";
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                               WRAPPER_EXTENSION = pkg;
+                       };
+                       dependencies = (
+                               F51307170326764F012F4765,
+                               F513071803267651012F4765,
+                               F51307A5032684D5012F4765,
+                       );
+                       isa = PBXBundleTarget;
+                       name = Package;
+                       productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+                       productName = Package;
+                       productReference = F513071603267616012F4765;
+                       productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleGetInfoString</key>
+       <string></string>
+       <key>CFBundleIconFile</key>
+       <string></string>
+       <key>CFBundleIdentifier</key>
+       <string></string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string></string>
+       <key>CFBundlePackageType</key>
+       <string>PKG</string>
+       <key>CFBundleShortVersionString</key>
+       <string></string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>0.0.1d1</string>
+</dict>
+</plist>
+";
+               };
+               F513071603267616012F4765 = {
+                       explicitFileType = wrapper.cfbundle;
+                       isa = PBXFileReference;
+                       path = "sinfg-devel.pkg";
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F51307170326764F012F4765 = {
+                       isa = PBXTargetDependency;
+                       target = F5F48ECF0314873101682FCB;
+                       targetProxy = A65F23D505E843AF005A2B7E;
+               };
+               F513071803267651012F4765 = {
+                       isa = PBXTargetDependency;
+                       target = F5F48EBB0314868C01682FCB;
+                       targetProxy = A65F23D705E843AF005A2B7E;
+               };
+               F513071903267679012F4765 = {
+                       buildActionMask = 2147483647;
+                       dstPath = "pkg-tmp";
+                       dstSubfolderSpec = 16;
+                       files = (
+                               F5130738032677F3012F4765,
+                       );
+                       isa = PBXCopyFilesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F513071A03267680012F4765 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXShellScriptBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = ". config/build.cfg\n\nset -x\n\n# clean up the framework, remove extra files\nrm -rf build/pkg-tmp/sinfg.framework/Resources/pbdevelopment.plist\n\n# create the module manifest\nls --color=no build/pkg-tmp/sinfg.framework/Resources/modules | sed \"s/.so//;s/.dylib//;s/lib//;\" > build/pkg-tmp/sinfg.framework/Resources/sinfg_modules.cfg\n\n# remove the .DS_Store file to keep tool from crapping out\nrm -rf pkg-support/devel-resources/.DS_Store\n\nsed \"\ns:@_VERSION_@:$VERSION:;\ns:@_PACKAGE_@:$PACKAGE:;\ns:@_RELEASE_@:$RELEASE:;\ns:@_PACKAGE_NAME_@:$PACKAGE_NAME:;\ns:@_PRODUCT_NAME_@:$PRODUCT_NAME:;\n\" < config/pkg-support/sinfg-devel.info > build/$PRODUCT_NAME.info\n\n# create the .pkg\npackage build/pkg-tmp build/$PRODUCT_NAME.info -d  build \n\n# remove temporary files\nrm -rf build/pkg-tmp build/$PRODUCT_NAME.info\n\n# compress\n(cd build; sleep 1; tar -zcvf $PRODUCT_NAME.pkg.tar.gz $PRODUCT_NAME.pkg)";
+               };
+               F513071B03267685012F4765 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXShellScriptBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = ". config/build.cfg\n\nDIR=build/sinfg-devel.pkg/Contents/Resources\n\nsed \"\ns:@_VERSION_@:$VERSION:;\ns:@_PACKAGE_@:$PACKAGE:;\ns:@_RELEASE_@:$RELEASE:;\ns:@_PACKAGE_NAME_@:$PACKAGE_NAME:;\ns:@_PRODUCT_NAME_@:$PRODUCT_NAME:;\n\" < $DIR/install.sh > $DIR/$PRODUCT_NAME.post_install\ncp $DIR/$PRODUCT_NAME.post_install $DIR/$PRODUCT_NAME.post_upgrade\n\nrm $DIR/install.sh\n\n# add execute flag to scripts\nchmod 755 $DIR/$PRODUCT_NAME.post_install $DIR/$PRODUCT_NAME.post_upgrade\n";
+               };
+               F513071C032676F4012F4765 = {
+                       children = (
+                               F513072A03267792012F4765,
+                               F513072703267737012F4765,
+                       );
+                       isa = PBXGroup;
+                       name = "Package Files";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F513072703267737012F4765 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = "sinfg-devel.info";
+                       path = "config/pkg-support/sinfg-devel.info";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F513072A03267792012F4765 = {
+                       children = (
+                               F513072B032677B1012F4765,
+                               F513072C032677B1012F4765,
+                               F513072D032677B1012F4765,
+                       );
+                       isa = PBXGroup;
+                       name = "sinfg-devel";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F513072B032677B1012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.script.sh;
+                       name = install.sh;
+                       path = "config/pkg-support/devel-resources/install.sh";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F513072C032677B1012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = ReadMe.txt;
+                       path = "config/pkg-support/devel-resources/ReadMe.txt";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F513072D032677B1012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Welcome.txt;
+                       path = "config/pkg-support/devel-resources/Welcome.txt";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5130731032677CD012F4765 = {
+                       fileRef = F513072B032677B1012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5130732032677CD012F4765 = {
+                       fileRef = F513072C032677B1012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5130733032677CD012F4765 = {
+                       fileRef = F513072D032677B1012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5130738032677F3012F4765 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F513073A03267C35012F4765 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXShellScriptBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = "[ -e sinfg ] && mv sinfg build\nexit 0";
+               };
+               F513073B03267CDB012F4765 = {
+                       fileRef = F5F48EBC0314868C01682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F513073C03267D1E012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.script.sh;
+                       path = "sinfg-config.in";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F513073F03267D2C012F4765 = {
+                       fileRef = F513073C03267D1E012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F513079503267FC7012F4765 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = file;
+                       name = "sinfg-devel.pkg.tar.gz";
+                       path = "build/sinfg-devel.pkg.tar.gz";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F513079E032682CF012F4765 = {
+                       buildActionMask = 2147483647;
+                       dstPath = sinfg.framework/Resources/modules;
+                       dstSubfolderSpec = 16;
+                       files = (
+                               F536547F0357610A012F4ADF,
+                               F53654800357610B012F4ADF,
+                               F53654820357610C012F4ADF,
+                               F53654840357610E012F4ADF,
+                               F50C84B203771D3F01A80006,
+                               F50C84B303771D4001A80006,
+                               F50C84B403771D4101A80006,
+                               F581E16903B253EE0101DBD7,
+                               A6B861ED03E897E500A80006,
+                       );
+                       isa = PBXCopyFilesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F51307A3032684C7012F4765 = {
+                       buildPhases = (
+                       );
+                       buildSettings = {
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PRODUCT_NAME = "All Modules";
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                               A6B861EC03E893B500A80006,
+                               F581E15603B24E660101DBD7,
+                               F50C84AA03771B0501A80006,
+                               F50C848F0374948C01A80006,
+                               F50C8475037493C801A80006,
+                               F53654760357586F012F4ADF,
+                               F57D1CBC033FDEB701A80006,
+                               F5B076A6032A962601A80082,
+                               F5B07656032A7E8301A80082,
+                       );
+                       isa = PBXAggregateTarget;
+                       name = "All Modules";
+                       productName = "All Modules";
+               };
+               F51307A5032684D5012F4765 = {
+                       isa = PBXTargetDependency;
+                       target = F51307A3032684C7012F4765;
+                       targetProxy = A65F23D805E843AF005A2B7E;
+               };
+               F51307FB0326CBE8012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = render.cpp;
+                       path = src/sinfg/render.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F51307FC0326CBE8012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = render.h;
+                       path = src/sinfg/render.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F51307FE0326CBE8012F4765 = {
+                       fileRef = F51307FC0326CBE8012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F51307FF0326CD28012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = target.cpp;
+                       path = src/sinfg/target.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F51308000326CD28012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = target.h;
+                       path = src/sinfg/target.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F51308010326CD28012F4765 = {
+                       fileRef = F51307FF0326CD28012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F51308020326CD28012F4765 = {
+                       fileRef = F51308000326CD28012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F51952E003326DBE01A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = file;
+                       name = libxml.framework;
+                       path = /Library/Frameworks/libxml.framework;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               F5213F280384B9AF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = supersample.cpp;
+                       path = src/modules/lyr_std/supersample.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5213F290384B9AF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = supersample.h;
+                       path = src/modules/lyr_std/supersample.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5213F2C0384B9AF01A80006 = {
+                       fileRef = F5213F280384B9AF01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5213F2D0384B9AF01A80006 = {
+                       fileRef = F5213F290384B9AF01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536545E0357581B012F4ADF = {
+                       children = (
+                               F536545F03575842012F4ADF,
+                               F536546003575842012F4ADF,
+                               F536546103575842012F4ADF,
+                               F536546203575842012F4ADF,
+                               F536546303575842012F4ADF,
+                               F536546403575842012F4ADF,
+                       );
+                       isa = PBXGroup;
+                       name = FFMpeg;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F536545F03575842012F4ADF = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mod_ffmpeg/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F536546003575842012F4ADF = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/mod_ffmpeg/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F536546103575842012F4ADF = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = mptr_ffmpeg.cpp;
+                       path = src/modules/mod_ffmpeg/mptr_ffmpeg.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F536546203575842012F4ADF = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = mptr_ffmpeg.h;
+                       path = src/modules/mod_ffmpeg/mptr_ffmpeg.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F536546303575842012F4ADF = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_ffmpeg.cpp;
+                       path = src/modules/mod_ffmpeg/trgt_ffmpeg.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F536546403575842012F4ADF = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_ffmpeg.h;
+                       path = src/modules/mod_ffmpeg/trgt_ffmpeg.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F536546B03575855012F4ADF = {
+                       buildPhases = (
+                               F536546C03575855012F4ADF,
+                               F536546E03575855012F4ADF,
+                               F536547103575855012F4ADF,
+                               F536547403575855012F4ADF,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmod_ffmpeg.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "FFMpeg Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F536547503575855012F4ADF;
+               };
+               F536546C03575855012F4ADF = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F536547703575885012F4ADF,
+                               F536547903575887012F4ADF,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F536546E03575855012F4ADF = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F536547803575886012F4ADF,
+                               F536547A03575887012F4ADF,
+                               F536547B03575888012F4ADF,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F536547103575855012F4ADF = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F536547203575855012F4ADF,
+                               F536547303575855012F4ADF,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F536547203575855012F4ADF = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536547303575855012F4ADF = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536547403575855012F4ADF = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F536547503575855012F4ADF = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmod_ffmpeg.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F53654760357586F012F4ADF = {
+                       isa = PBXTargetDependency;
+                       target = F536546B03575855012F4ADF;
+                       targetProxy = A65F23CC05E843AF005A2B7E;
+               };
+               F536547703575885012F4ADF = {
+                       fileRef = F536546403575842012F4ADF;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536547803575886012F4ADF = {
+                       fileRef = F536546303575842012F4ADF;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536547903575887012F4ADF = {
+                       fileRef = F536546203575842012F4ADF;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536547A03575887012F4ADF = {
+                       fileRef = F536546103575842012F4ADF;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536547B03575888012F4ADF = {
+                       fileRef = F536545F03575842012F4ADF;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536547E03575FC6012F4ADF = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F536547F0357610A012F4ADF = {
+                       fileRef = F5B07653032A77BE01A80082;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F53654800357610B012F4ADF = {
+                       fileRef = F5B0769F032A95BC01A80082;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F53654820357610C012F4ADF = {
+                       fileRef = F57D1CBB033FDE9A01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F53654840357610E012F4ADF = {
+                       fileRef = F536547503575855012F4ADF;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F550016102F0983D01000102 = {
+                       children = (
+                               F58056B403A2F89101A80006,
+                               F513071C032676F4012F4765,
+                               F5FB07070320189701A80006,
+                               F5FB06D003200AE401A80006,
+                               F550017202F0ABE401000102,
+                               F550017302F0ABFA01000102,
+                               F58BF73F03379BB601A80006,
+                               F5D988D703325F0301A80006,
+                               F588A3BE02F0CCE501000102,
+                               F550016A02F0987601000102,
+                               F550016B02F0987601000102,
+                               F550016C02F0987601000102,
+                       );
+                       isa = PBXGroup;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F550016302F0983D01000102 = {
+                       buildSettings = {
+                               COPY_PHASE_STRIP = NO;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_ENABLE_FIX_AND_CONTINUE = YES;
+                               GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_VERSION = 2.x;
+                               LDFLAGS = "\U0001-flat-namespace";
+                               MACOSX_DEPLOYMENT_TARGET = 10.2;
+                               OTHER_CFLAGS = "\U0001-DHAVE_CFLAGS  -Wno-long-double";
+                               ZERO_LINK = YES;
+                       };
+                       isa = PBXBuildStyle;
+                       name = Development;
+               };
+               F550016402F0983D01000102 = {
+                       buildSettings = {
+                               COPY_PHASE_STRIP = YES;
+                               LDFLAGS = "\U0001-flat-namespace";
+                               MACOSX_DEPLOYMENT_TARGET = 10.2;
+                               OPTIMIZATION_CFLAGS = "-O2 -ffast-math";
+                               OTHER_CFLAGS = "\U0001-DHAVE_CFLAGS -DNDEBUG  -Wno-long-double";
+                               OTHER_CXXFLAGS = "\U0001-DHAVE_CFLAGS -DNDEBUG -Wno-long-double";
+                               USE_GCC3_PFE_SUPPORT = YES;
+                       };
+                       isa = PBXBuildStyle;
+                       name = "Deployment (GCC3)";
+               };
+               F550016502F0983D01000102 = {
+                       buildSettings = {
+                       };
+                       buildStyles = (
+                               F550016302F0983D01000102,
+                               F504527502F391C901000102,
+                               F550016402F0983D01000102,
+                               F5F2702E03C932DE01BABFEF,
+                       );
+                       hasScannedForEncodings = 1;
+                       isa = PBXProject;
+                       mainGroup = F550016102F0983D01000102;
+                       productRefGroup = F588A3BE02F0CCE501000102;
+                       projectDirPath = "";
+                       targets = (
+                               F5F48ECF0314873101682FCB,
+                               F513071503267616012F4765,
+                               F5F48EBB0314868C01682FCB,
+                               F5FB071303201B3201A80006,
+                               F5B0764C032A77BE01A80082,
+                               F5D9889B03317C7401A80006,
+                               F57D1CB1033FDE9A01A80006,
+                               F5B07697032A95BC01A80082,
+                               F5F7845003482C9101A80006,
+                               F536546B03575855012F4ADF,
+                               F59F5F6D0374911E01A80006,
+                               F50C8476037493D401A80006,
+                               F50C849D03771AF301A80006,
+                               F581E14903B24E2D0101DBD7,
+                               A6F67DA003E7AE5C00A80006,
+                               F51307A3032684C7012F4765,
+                               F5F784630348DCAA01A80006,
+                               F58056B303A2F5F401A80006,
+                               F580574A03A2FA0401A80006,
+                       );
+               };
+               F550016802F0987601000102 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.script.sh;
+                       path = bootstrap;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F550016A02F0987601000102 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       path = INSTALL;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F550016B02F0987601000102 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       path = Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F550016C02F0987601000102 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       path = README;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F550016E02F09B9701000102 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = build.cfg;
+                       path = config/build.cfg;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F550017102F0A69401000102 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = project.spec.in;
+                       path = config/project.spec.in;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F550017202F0ABE401000102 = {
+                       children = (
+                               A6E2EA8507656673002AF736,
+                               A6E2EA8607656673002AF736,
+                               A6E2EA8707656673002AF736,
+                               A6E2EA8807656673002AF736,
+                               A6E2EA8907656673002AF736,
+                               A6E2EA8A07656673002AF736,
+                               A6E2EA8B07656673002AF736,
+                               A6E2EA8C07656673002AF736,
+                               A6E2EA8D07656673002AF736,
+                               A6E2EA8E07656673002AF736,
+                               A6E2EA8F07656673002AF736,
+                               A6E2EA9007656673002AF736,
+                               A6E2EA9107656673002AF736,
+                               A6E2EA9207656673002AF736,
+                               A6E2EA9307656673002AF736,
+                               A6E2EA9407656673002AF736,
+                               A6E2EA9507656673002AF736,
+                               A6E2EA9607656673002AF736,
+                               A6E2EA9707656673002AF736,
+                               A6714DEC0413E7BB00F656BD,
+                               A684452D0474A7BD00A80006,
+                               A684452E0474A7D900A80006,
+                               F5FB06D503200BCD01A80006,
+                               A6714DF40413E80A00F656BD,
+                               A64F6CD2052A991700140006,
+                               A64F6CD3052A991700140006,
+                               A64F6CD4052A991700140006,
+                               A64F6CD5052A991700140006,
+                               A64F6CD6052A991700140006,
+                               A64F6CD7052A991700140006,
+                               A64F6CD8052A991700140006,
+                               A64F6CD9052A991700140006,
+                               A64F6CDC052A991700140006,
+                               A64F6CED052A991700140006,
+                               A64F6CEE052A991700140006,
+                               A6714DF50413E80A00F656BD,
+                               F579DCCA031560A001682FCB,
+                               F579DCD40315734101682FCB,
+                               F5F48EC60314870401682FCB,
+                               F5F48EC40314870401682FCB,
+                               F5F48EC50314870401682FCB,
+                               F579DCC80315607801682FCB,
+                               F579DCCE0315672F01682FCB,
+                               F579DCD003156FA301682FCB,
+                               F579DCD103156FA301682FCB,
+                               F579DCD60315770A01682FCB,
+                               F579DCD70315770A01682FCB,
+                               F579DCE303159B9401682FCB,
+                               F51307FB0326CBE8012F4765,
+                               A68444F50474A77900A80006,
+                               A68444F60474A77900A80006,
+                               A68444F70474A77900A80006,
+                               A68445060474A77900A80006,
+                               A68445070474A77900A80006,
+                               A68445080474A77900A80006,
+                               A684450F0474A77900A80006,
+                               A68445100474A77900A80006,
+                               F51307FC0326CBE8012F4765,
+                               F51307FF0326CD28012F4765,
+                               F51308000326CD28012F4765,
+                               F5A4F3320327E86D01A80006,
+                               A6F67D8D03E7AD7400A80006,
+                               A6F67D8E03E7AD7400A80006,
+                               A6F67D8F03E7AD7400A80006,
+                               F57D1D35034262A601A80006,
+                               F5F784D2034BC0D901A80006,
+                               F591EF12034511A901A80006,
+                               F591EF13034511A901A80006,
+                               F58056A303A2DB6901A80006,
+                               F58056A403A2DB6901A80006,
+                               F58056A503A2DB6901A80006,
+                               F58056A603A2DB6901A80006,
+                               F58056A703A2DB6901A80006,
+                               F58056A803A2DB6901A80006,
+                               F5D51DF50399C8EF01A80006,
+                               F5D51DF60399C8EF01A80006,
+                               A60324D904425DAD00A80006,
+                               A60324DA04425DAD00A80006,
+                               A60324DB04425DAD00A80006,
+                               A60324DC04425DAD00A80006,
+                               A60324DD04425DAD00A80006,
+                               A6D879B6042BAC7F00A80006,
+                               A6C8D62B0430F3DC00A80006,
+                               A6C8D62C0430F3DC00A80006,
+                               A6C8D62D0430F3DC00A80006,
+                               A6FEFDEC05DEA44C00140006,
+                               A6FEFDED05DEA44C00140006,
+                               A6FEFDEE05DEA44C00140006,
+                               A6C1414905E836A0004C1DD1,
+                               A6C1414A05E836A0004C1DD1,
+                               A6C1414B05E836A0004C1DD1,
+                               A6C1414C05E836A0004C1DD1,
+                               A6C1414D05E836A0004C1DD1,
+                               A6C1414E05E836A0004C1DD1,
+                               A6C1414F05E836A0004C1DD1,
+                               A6C1415005E836A0004C1DD1,
+                       );
+                       isa = PBXGroup;
+                       name = "Sinfg Library Sources";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F550017302F0ABFA01000102 = {
+                       children = (
+                               F579DCCC031560BA01682FCB,
+                               F5F48EC2031486BE01682FCB,
+                       );
+                       isa = PBXGroup;
+                       name = "Sinfg Tool Sources";
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F570DBE403257704012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = configure.in;
+                       path = libltdl/configure.in;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F570DBE503257704012F4765 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = libltdl/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCC80315607801682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = module.h;
+                       path = src/sinfg/module.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCC90315607801682FCB = {
+                       fileRef = F579DCC80315607801682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F579DCCA031560A001682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/sinfg/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCCC031560BA01682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/tool/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCCE0315672F01682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = module.cpp;
+                       path = src/sinfg/module.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCCF0315672F01682FCB = {
+                       fileRef = F579DCCE0315672F01682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F579DCD003156FA301682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = layer.cpp;
+                       path = src/sinfg/layer.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCD103156FA301682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = layer.h;
+                       path = src/sinfg/layer.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCD203156FA301682FCB = {
+                       fileRef = F579DCD003156FA301682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F579DCD303156FA301682FCB = {
+                       fileRef = F579DCD103156FA301682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F579DCD40315734101682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = pch.h;
+                       path = src/sinfg/pch.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCD50315734101682FCB = {
+                       fileRef = F579DCD40315734101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F579DCD60315770A01682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = color.cpp;
+                       path = src/sinfg/color.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCD70315770A01682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = color.h;
+                       path = src/sinfg/color.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCD80315770A01682FCB = {
+                       fileRef = F579DCD60315770A01682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F579DCD90315770A01682FCB = {
+                       fileRef = F579DCD70315770A01682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F579DCE303159B9401682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = vector.h;
+                       path = src/sinfg/vector.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F579DCE403159B9401682FCB = {
+                       fileRef = F579DCE303159B9401682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F57D1CAA033FDD6B01A80006 = {
+                       children = (
+                               F57D1CAB033FDE6601A80006,
+                               F57D1CAC033FDE6601A80006,
+                               F57D1CAD033FDE6701A80006,
+                               F57D1CAE033FDE6701A80006,
+                               F57D1CAF033FDE6701A80006,
+                               F57D1CB0033FDE6701A80006,
+                               F5FF0A3F03465FD101A80006,
+                               F5FF0A4003465FD101A80006,
+                       );
+                       isa = PBXGroup;
+                       name = PPM;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1CAB033FDE6601A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mod_ppm/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1CAC033FDE6601A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/mod_ppm/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1CAD033FDE6701A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_mpg.cpp;
+                       path = src/modules/mod_ppm/trgt_mpg.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1CAE033FDE6701A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_mpg.h;
+                       path = src/modules/mod_ppm/trgt_mpg.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1CAF033FDE6701A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_ppm.cpp;
+                       path = src/modules/mod_ppm/trgt_ppm.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1CB0033FDE6701A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_ppm.h;
+                       path = src/modules/mod_ppm/trgt_ppm.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1CB1033FDE9A01A80006 = {
+                       buildPhases = (
+                               F57D1CB2033FDE9A01A80006,
+                               F57D1CB4033FDE9A01A80006,
+                               F57D1CB7033FDE9A01A80006,
+                               F57D1CBA033FDE9A01A80006,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmod_ppm.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "PPM Target Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F57D1CBB033FDE9A01A80006;
+               };
+               F57D1CB2033FDE9A01A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F57D1CC5033FE09001A80006,
+                               F5FF0A4203465FD101A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F57D1CB4033FDE9A01A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F57D1CC6033FE09001A80006,
+                               F57D1CCA033FE09401A80006,
+                               F5FF0A4103465FD101A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F57D1CB7033FDE9A01A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F57D1CB8033FDE9A01A80006,
+                               F57D1CB9033FDE9A01A80006,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F57D1CB8033FDE9A01A80006 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1CB9033FDE9A01A80006 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1CBA033FDE9A01A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F57D1CBB033FDE9A01A80006 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmod_ppm.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F57D1CBC033FDEB701A80006 = {
+                       isa = PBXTargetDependency;
+                       target = F57D1CB1033FDE9A01A80006;
+                       targetProxy = A65F23CB05E843AF005A2B7E;
+               };
+               F57D1CC2033FE08001A80006 = {
+                       fileRef = F5D988A903317CCF01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1CC3033FE08101A80006 = {
+                       fileRef = F5D988AB03317CCF01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1CC4033FE08201A80006 = {
+                       fileRef = F5D988AC03317CCF01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1CC5033FE09001A80006 = {
+                       fileRef = F57D1CB0033FDE6701A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1CC6033FE09001A80006 = {
+                       fileRef = F57D1CAF033FDE6701A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1CCA033FE09401A80006 = {
+                       fileRef = F57D1CAB033FDE6601A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1D2D0340E47601A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = import.cpp;
+                       path = src/modules/lyr_std/import.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1D2E0340E47601A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = import.h;
+                       path = src/modules/lyr_std/import.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1D2F0340E47601A80006 = {
+                       fileRef = F57D1D2D0340E47601A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1D300340E47601A80006 = {
+                       fileRef = F57D1D2E0340E47601A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F57D1D35034262A601A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = surface.h;
+                       path = src/sinfg/surface.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F57D1D36034262A601A80006 = {
+                       fileRef = F57D1D35034262A601A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F58056A303A2DB6901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = canvas.cpp;
+                       path = src/sinfg/canvas.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58056A403A2DB6901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = canvas.h;
+                       path = src/sinfg/canvas.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58056A503A2DB6901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = loadcanvas.cpp;
+                       path = src/sinfg/loadcanvas.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58056A603A2DB6901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = loadcanvas.h;
+                       path = src/sinfg/loadcanvas.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58056A703A2DB6901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = savecanvas.cpp;
+                       path = src/sinfg/savecanvas.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58056A803A2DB6901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = savecanvas.h;
+                       path = src/sinfg/savecanvas.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58056A903A2DB6901A80006 = {
+                       fileRef = F58056A303A2DB6901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F58056AA03A2DB6901A80006 = {
+                       fileRef = F58056A403A2DB6901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F58056AB03A2DB6901A80006 = {
+                       fileRef = F58056A503A2DB6901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F58056AC03A2DB6901A80006 = {
+                       fileRef = F58056A603A2DB6901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F58056AD03A2DB6901A80006 = {
+                       fileRef = F58056A703A2DB6901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F58056AE03A2DB6901A80006 = {
+                       fileRef = F58056A803A2DB6901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F58056B103A2DD0F01A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = "compiled.mach-o.dylib";
+                       name = "libxml++-1.0.dylib";
+                       path = "/usr/local/lib/libxml++-1.0.1.0.3.dylib";
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               F58056B203A2DD0F01A80006 = {
+                       fileRef = F58056B103A2DD0F01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F58056B303A2F5F401A80006 = {
+                       buildArgumentsString = sinfg.pbproj/doxygen.cfg;
+                       buildPhases = (
+                       );
+                       buildSettings = {
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PATH = "\U0001:/sw/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/bin";
+                               PRODUCT_NAME = doc;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       buildToolPath = /sw/bin/doxygen;
+                       dependencies = (
+                       );
+                       isa = PBXLegacyTarget;
+                       name = Doxygen;
+                       passBuildSettingsInEnvironment = 1;
+                       productName = Documentation;
+               };
+               F58056B403A2F89101A80006 = {
+                       children = (
+                               F5D12A4403A2FF4A01A80006,
+                               F58056B503A2F8BF01A80006,
+                               F58056B803A2F96801A80006,
+                               F580574C03A2FD9F01A80006,
+                               F5D12AE603A302D101A80006,
+                       );
+                       isa = PBXGroup;
+                       name = Documentation;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58056B503A2F8BF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = file;
+                       name = index.html;
+                       path = doc/html/index.html;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58056B803A2F96801A80006 = {
+                       includeInIndex = 1;
+                       isa = PBXFileReference;
+                       lastKnownFileType = file;
+                       name = html;
+                       path = doc/html;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F580574A03A2FA0401A80006 = {
+                       buildArgumentsString = pdf;
+                       buildPhases = (
+                       );
+                       buildSettings = {
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PATH = "\U0001:/sw/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/bin:/bin";
+                               PRODUCT_NAME = "LaTeX Documentation";
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       buildToolPath = /usr/bin/gnumake;
+                       buildWorkingDirectory = /Users/darco/src/voria/sinfg/doc/latex/;
+                       dependencies = (
+                       );
+                       isa = PBXLegacyTarget;
+                       name = "PDF Documentation";
+                       passBuildSettingsInEnvironment = 1;
+                       productName = "PDF Documentation";
+               };
+               F580574C03A2FD9F01A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = file;
+                       name = refman.pdf;
+                       path = doc/latex/refman.pdf;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F581E13F03B249EA0101DBD7 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXShellScriptBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = "rm -fr sinfg-devel.pkg";
+               };
+               F581E14003B24C140101DBD7 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = "compiled.mach-o.dylib";
+                       name = libpng.dylib;
+                       path = /usr/local/lib/libpng.3.1.2.5.dylib;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               F581E14803B24DF40101DBD7 = {
+                       children = (
+                               F581E15703B24ECF0101DBD7,
+                               F581E15803B24ECF0101DBD7,
+                               F581E15903B24ECF0101DBD7,
+                               F581E15A03B24ECF0101DBD7,
+                               F581E15B03B24ECF0101DBD7,
+                               F581E15C03B24ECF0101DBD7,
+                       );
+                       isa = PBXGroup;
+                       name = PNG;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F581E14903B24E2D0101DBD7 = {
+                       buildPhases = (
+                               F581E14A03B24E2D0101DBD7,
+                               F581E14D03B24E2D0101DBD7,
+                               F581E15103B24E2D0101DBD7,
+                               F581E15403B24E2D0101DBD7,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_SEARCH_PATHS = "";
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmod_png.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "PNG Target Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F581E15503B24E2D0101DBD7;
+               };
+               F581E14A03B24E2D0101DBD7 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F581E16303B24ED90101DBD7,
+                               A6D879BD042BACFC00A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F581E14D03B24E2D0101DBD7 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F581E16403B24EDA0101DBD7,
+                               F581E16703B24EDC0101DBD7,
+                               A6D879BC042BACF900A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F581E15103B24E2D0101DBD7 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F581E15203B24E2D0101DBD7,
+                               F581E15303B24E2D0101DBD7,
+                               F581E16803B253BB0101DBD7,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F581E15203B24E2D0101DBD7 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F581E15303B24E2D0101DBD7 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F581E15403B24E2D0101DBD7 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F581E15503B24E2D0101DBD7 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmod_png.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F581E15603B24E660101DBD7 = {
+                       isa = PBXTargetDependency;
+                       target = F581E14903B24E2D0101DBD7;
+                       targetProxy = A65F23D005E843AF005A2B7E;
+               };
+               F581E15703B24ECF0101DBD7 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mod_png/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F581E15803B24ECF0101DBD7 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/mod_png/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F581E15903B24ECF0101DBD7 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = mptr_png.cpp;
+                       path = src/modules/mod_png/mptr_png.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F581E15A03B24ECF0101DBD7 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = mptr_png.h;
+                       path = src/modules/mod_png/mptr_png.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F581E15B03B24ECF0101DBD7 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_png.cpp;
+                       path = src/modules/mod_png/trgt_png.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F581E15C03B24ECF0101DBD7 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_png.h;
+                       path = src/modules/mod_png/trgt_png.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F581E16303B24ED90101DBD7 = {
+                       fileRef = F581E15C03B24ECF0101DBD7;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F581E16403B24EDA0101DBD7 = {
+                       fileRef = F581E15B03B24ECF0101DBD7;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F581E16703B24EDC0101DBD7 = {
+                       fileRef = F581E15703B24ECF0101DBD7;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F581E16803B253BB0101DBD7 = {
+                       fileRef = F581E14003B24C140101DBD7;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F581E16903B253EE0101DBD7 = {
+                       fileRef = F581E15503B24E2D0101DBD7;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F588A3B502F0C38001000102 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = configure.ac;
+                       path = config/configure.ac;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F588A3BE02F0CCE501000102 = {
+                       children = (
+                               F5F48EBC0314868C01682FCB,
+                               F5F48ED00314873101682FCB,
+                               F5FB071403201B3201A80006,
+                               F513071603267616012F4765,
+                               F513079503267FC7012F4765,
+                               F5B07653032A77BE01A80082,
+                               F5B0769F032A95BC01A80082,
+                               F5D988A703317C7401A80006,
+                               F57D1CBB033FDE9A01A80006,
+                               F5F7845E03482C9101A80006,
+                               F536547503575855012F4ADF,
+                               F59F5F860374911E01A80006,
+                               F50C8482037493D401A80006,
+                               F50C84A903771AF301A80006,
+                               F581E15503B24E2D0101DBD7,
+                               A6F67DAB03E7AE5C00A80006,
+                       );
+                       isa = PBXGroup;
+                       name = Products;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58BF73F03379BB601A80006 = {
+                       children = (
+                               F550016E02F09B9701000102,
+                               F550016802F0987601000102,
+                               F550017102F0A69401000102,
+                               F588A3B502F0C38001000102,
+                               F513073C03267D1E012F4765,
+                               F58BF74003379C0301A80006,
+                               F58BF74103379C0301A80006,
+                               F58BF74203379C0301A80006,
+                       );
+                       isa = PBXGroup;
+                       name = "Build Configuration";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58BF74003379C0301A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = cxx_macros.m4;
+                       path = config/cxx_macros.m4;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58BF74103379C0301A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = ETL.m4;
+                       path = config/ETL.m4;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F58BF74203379C0301A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = libxml.m4;
+                       path = config/libxml.m4;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F591EF12034511A901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = importer.cpp;
+                       path = src/sinfg/importer.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F591EF13034511A901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = importer.h;
+                       path = src/sinfg/importer.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F591EF14034511A901A80006 = {
+                       fileRef = F591EF12034511A901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F591EF15034511A901A80006 = {
+                       fileRef = F591EF13034511A901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F59F5F6D0374911E01A80006 = {
+                       buildPhases = (
+                               F59F5F6F0374911E01A80006,
+                               F59F5F780374911E01A80006,
+                               F59F5F820374911E01A80006,
+                               F59F5F850374911E01A80006,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = "/usr/X11R6/include/freetype2 /usr/local/include/freetype2 src";
+                               LIBRARY_SEARCH_PATHS = /usr/X11R6/lib;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = liblyr_freetype.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                               F59F5F6E0374911E01A80006,
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "FreeType Font Layer Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F59F5F860374911E01A80006;
+               };
+               F59F5F6E0374911E01A80006 = {
+                       isa = PBXTargetDependency;
+                       target = F5F48ECF0314873101682FCB;
+                       targetProxy = A65F23C805E843AF005A2B7E;
+               };
+               F59F5F6F0374911E01A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F59F5F91037491C201A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F59F5F780374911E01A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F59F5F90037491C201A80006,
+                               F59F5F92037491C301A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F59F5F820374911E01A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F59F5F830374911E01A80006,
+                               F59F5F840374911E01A80006,
+                               F59F5F940374921B01A80006,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F59F5F830374911E01A80006 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F59F5F840374911E01A80006 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F59F5F850374911E01A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F59F5F860374911E01A80006 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = liblyr_freetype.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F59F5F870374916F01A80006 = {
+                       children = (
+                               F59F5F88037491BD01A80006,
+                               F59F5F89037491BD01A80006,
+                               F59F5F8A037491BD01A80006,
+                               F59F5F8B037491BD01A80006,
+                       );
+                       isa = PBXGroup;
+                       name = "FreeType Layer";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F59F5F88037491BD01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = lyr_freetype.cpp;
+                       path = src/modules/lyr_freetype/lyr_freetype.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F59F5F89037491BD01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = lyr_freetype.h;
+                       path = src/modules/lyr_freetype/lyr_freetype.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F59F5F8A037491BD01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/lyr_freetype/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F59F5F8B037491BD01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/lyr_freetype/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F59F5F90037491C201A80006 = {
+                       fileRef = F59F5F8A037491BD01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F59F5F91037491C201A80006 = {
+                       fileRef = F59F5F89037491BD01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F59F5F92037491C301A80006 = {
+                       fileRef = F59F5F88037491BD01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F59F5F930374921B01A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = "compiled.mach-o.dylib";
+                       name = libfreetype.dylib;
+                       path = /usr/X11R6/lib/libfreetype.6.3.dylib;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               F59F5F940374921B01A80006 = {
+                       fileRef = F59F5F930374921B01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5A4F3320327E86D01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = renddesc.h;
+                       path = src/sinfg/renddesc.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5A4F3330327E86D01A80006 = {
+                       fileRef = F5A4F3320327E86D01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F5B07646032A774701A80082 = {
+                       children = (
+                               A6F67D9F03E7AE1900A80006,
+                               F581E14803B24DF40101DBD7,
+                               F50C849C03771ACC01A80006,
+                               F50C84830374942C01A80006,
+                               F536545E0357581B012F4ADF,
+                               F5F7844B03482C5201A80006,
+                               F57D1CAA033FDD6B01A80006,
+                               F5D9889A03317C5A01A80006,
+                               F5B07647032A775701A80082,
+                       );
+                       isa = PBXGroup;
+                       name = "Image Formats";
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B07647032A775701A80082 = {
+                       children = (
+                               F5B07648032A778701A80082,
+                               F5B07649032A778701A80082,
+                               F5EDFADA032D252001A80082,
+                               F5EDFADB032D252001A80082,
+                               A6D879B8042BACED00A80006,
+                               A6D879B9042BACED00A80006,
+                       );
+                       isa = PBXGroup;
+                       name = BMP;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B07648032A778701A80082 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mod_bmp/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B07649032A778701A80082 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/mod_bmp/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B0764C032A77BE01A80082 = {
+                       buildPhases = (
+                               F5B0764D032A77BE01A80082,
+                               F5B0764E032A77BE01A80082,
+                               F5B07650032A77BE01A80082,
+                               F5B07652032A77BE01A80082,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "-lstdc++";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmod_bmp.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "BMP Target Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F5B07653032A77BE01A80082;
+               };
+               F5B0764D032A77BE01A80082 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5EDFADD032D252001A80082,
+                               A6D879BB042BACED00A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5B0764E032A77BE01A80082 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5B07655032A7C8801A80082,
+                               F5EDFADC032D252001A80082,
+                               A6D879BA042BACED00A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5B07650032A77BE01A80082 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5B07651032A77BE01A80082,
+                               F5B0767E032A846D01A80082,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5B07651032A77BE01A80082 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5B07652032A77BE01A80082 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5B07653032A77BE01A80082 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmod_bmp.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F5B07655032A7C8801A80082 = {
+                       fileRef = F5B07648032A778701A80082;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5B07656032A7E8301A80082 = {
+                       isa = PBXTargetDependency;
+                       target = F5B0764C032A77BE01A80082;
+                       targetProxy = A65F23C905E843AF005A2B7E;
+               };
+               F5B0767E032A846D01A80082 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5B07694032A8C0201A80082 = {
+                       fileRef = F51307FB0326CBE8012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5B07695032A957A01A80082 = {
+                       children = (
+                               A6E2EA8407656630002AF736,
+                               A6E2EA8307656625002AF736,
+                               F59F5F870374916F01A80006,
+                               F5B07696032A959401A80082,
+                       );
+                       isa = PBXGroup;
+                       name = Layers;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B07696032A959401A80082 = {
+                       children = (
+                               F5B076A1032A961101A80082,
+                               F5B076A2032A961101A80082,
+                               A64F6D10052A99B800140006,
+                               A64F6D16052A99B800140006,
+                               A64F6D17052A99B800140006,
+                               F5B076B1032ABBA401A80082,
+                               F5B076B2032ABBA401A80082,
+                               F5D988B1033194E101A80006,
+                               F5D988B2033194E101A80006,
+                               F57D1D2D0340E47601A80006,
+                               F57D1D2E0340E47601A80006,
+                               A60324CD0442574800A80006,
+                               A60324CE0442574800A80006,
+                               A60324CF0442574800A80006,
+                               A60324D00442574800A80006,
+                               F50C8494037496BE01A80006,
+                               F50C8495037496BE01A80006,
+                               F5213F280384B9AF01A80006,
+                               F5213F290384B9AF01A80006,
+                               A6714E1C0413F56300F656BD,
+                               A6714E1D0413F56300F656BD,
+                               A684452F0474A83F00A80006,
+                               A68445300474A83F00A80006,
+                               A68445330474A83F00A80006,
+                               A68445340474A83F00A80006,
+                               A68445350474A83F00A80006,
+                               A68445360474A83F00A80006,
+                       );
+                       isa = PBXGroup;
+                       name = "Standard Layers";
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B07697032A95BC01A80082 = {
+                       buildPhases = (
+                               F5B07698032A95BC01A80082,
+                               F5B07699032A95BC01A80082,
+                               F5B0769B032A95BC01A80082,
+                               F5B0769E032A95BC01A80082,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = liblyr_std.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                               F5B076A8032A9B7901A80082,
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "Std. Layers Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F5B0769F032A95BC01A80082;
+               };
+               F5B07698032A95BC01A80082 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5B076B4032ABBA401A80082,
+                               F5D988B4033194E101A80006,
+                               F57D1D300340E47601A80006,
+                               F50C849B037496BE01A80006,
+                               F5213F2D0384B9AF01A80006,
+                               A6714E1F0413F56300F656BD,
+                               A60324D40442574800A80006,
+                               A60324D60442574800A80006,
+                               A68445380474A83F00A80006,
+                               A684453C0474A83F00A80006,
+                               A684453E0474A83F00A80006,
+                               A64F6D23052A99B800140006,
+                               A6C1415A05E836A0004C1DD1,
+                               A6C1415C05E836A0004C1DD1,
+                               A6C1415E05E836A0004C1DD1,
+                               A6C1416005E836A0004C1DD1,
+                               A6E2EAAC07656673002AF736,
+                               A6E2EAAE07656673002AF736,
+                               A6E2EAB007656673002AF736,
+                               A6E2EAB107656673002AF736,
+                               A6E2EAB207656673002AF736,
+                               A6E2EAB407656673002AF736,
+                               A6E2EAB607656673002AF736,
+                               A6E2EAB707656673002AF736,
+                               A6E2EAB907656673002AF736,
+                               A6E2EABB07656673002AF736,
+                               A6E2EABD07656673002AF736,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5B07699032A95BC01A80082 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5B076A5032A961D01A80082,
+                               F5B076B3032ABBA401A80082,
+                               F5D988B3033194E101A80006,
+                               F57D1D2F0340E47601A80006,
+                               F50C849A037496BE01A80006,
+                               F5213F2C0384B9AF01A80006,
+                               A6714E1E0413F56300F656BD,
+                               A60324D30442574800A80006,
+                               A60324D50442574800A80006,
+                               A68445370474A83F00A80006,
+                               A684453B0474A83F00A80006,
+                               A684453D0474A83F00A80006,
+                               A64F6D1C052A99B800140006,
+                               A64F6D22052A99B800140006,
+                               A6C1415905E836A0004C1DD1,
+                               A6C1415B05E836A0004C1DD1,
+                               A6C1415D05E836A0004C1DD1,
+                               A6C1415F05E836A0004C1DD1,
+                               A6E2EAAB07656673002AF736,
+                               A6E2EAAD07656673002AF736,
+                               A6E2EAAF07656673002AF736,
+                               A6E2EAB307656673002AF736,
+                               A6E2EAB507656673002AF736,
+                               A6E2EAB807656673002AF736,
+                               A6E2EABA07656673002AF736,
+                               A6E2EABC07656673002AF736,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5B0769B032A95BC01A80082 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5B0769C032A95BC01A80082,
+                               F5B0769D032A95BC01A80082,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5B0769C032A95BC01A80082 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5B0769D032A95BC01A80082 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5B0769E032A95BC01A80082 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5B0769F032A95BC01A80082 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = liblyr_std.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F5B076A1032A961101A80082 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/lyr_std/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B076A2032A961101A80082 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/lyr_std/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B076A5032A961D01A80082 = {
+                       fileRef = F5B076A1032A961101A80082;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5B076A6032A962601A80082 = {
+                       isa = PBXTargetDependency;
+                       target = F5B07697032A95BC01A80082;
+                       targetProxy = A65F23CA05E843AF005A2B7E;
+               };
+               F5B076A8032A9B7901A80082 = {
+                       isa = PBXTargetDependency;
+                       target = F5F48ECF0314873101682FCB;
+                       targetProxy = A65F23D905E843AF005A2B7E;
+               };
+               F5B076B1032ABBA401A80082 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = mandelbrot.cpp;
+                       path = src/modules/lyr_std/mandelbrot.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B076B2032ABBA401A80082 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = mandelbrot.h;
+                       path = src/modules/lyr_std/mandelbrot.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5B076B3032ABBA401A80082 = {
+                       fileRef = F5B076B1032ABBA401A80082;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5B076B4032ABBA401A80082 = {
+                       fileRef = F5B076B2032ABBA401A80082;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5CDFD240325C617012F4765 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = "compiled.mach-o.dylib";
+                       name = libdl.dylib;
+                       path = /usr/lib/libSystem.B.dylib;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               F5CDFD250325C617012F4765 = {
+                       fileRef = F5CDFD240325C617012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5D12A4403A2FF4A01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = doxygen.cfg;
+                       path = sinfg.pbproj/doxygen.cfg;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D12AE603A302D101A80006 = {
+                       includeInIndex = 1;
+                       isa = PBXFileReference;
+                       lastKnownFileType = file;
+                       name = man;
+                       path = doc/man;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D51DF50399C8EF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = value.cpp;
+                       path = src/sinfg/value.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D51DF60399C8EF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = value.h;
+                       path = src/sinfg/value.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D51DF70399C8EF01A80006 = {
+                       fileRef = F5D51DF50399C8EF01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5D51DF80399C8EF01A80006 = {
+                       fileRef = F5D51DF60399C8EF01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F5D9889A03317C5A01A80006 = {
+                       children = (
+                               F5D988A903317CCF01A80006,
+                               F5D988AA03317CCF01A80006,
+                               F5D988AB03317CCF01A80006,
+                               F5D988AC03317CCF01A80006,
+                       );
+                       isa = PBXGroup;
+                       name = GIF;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D9889B03317C7401A80006 = {
+                       buildPhases = (
+                               F5D9889C03317C7401A80006,
+                               F5D9889F03317C7401A80006,
+                               F5D988A303317C7401A80006,
+                               F5D988A603317C7401A80006,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmod_gif.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "GIF Target Module copy";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F5D988A703317C7401A80006;
+               };
+               F5D9889C03317C7401A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F57D1CC4033FE08201A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5D9889F03317C7401A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F57D1CC2033FE08001A80006,
+                               F57D1CC3033FE08101A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5D988A303317C7401A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5D988A403317C7401A80006,
+                               F5D988A503317C7401A80006,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5D988A403317C7401A80006 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5D988A503317C7401A80006 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5D988A603317C7401A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5D988A703317C7401A80006 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmod_gif.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F5D988A903317CCF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mod_gif/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D988AA03317CCF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/mod_gif/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D988AB03317CCF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_gif.cpp;
+                       path = src/modules/mod_gif/trgt_gif.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D988AC03317CCF01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_gif.h;
+                       path = src/modules/mod_gif/trgt_gif.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D988B1033194E101A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = zoom.cpp;
+                       path = src/modules/lyr_std/zoom.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D988B2033194E101A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = zoom.h;
+                       path = src/modules/lyr_std/zoom.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5D988B3033194E101A80006 = {
+                       fileRef = F5D988B1033194E101A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5D988B4033194E101A80006 = {
+                       fileRef = F5D988B2033194E101A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5D988D703325F0301A80006 = {
+                       children = (
+                               F5CDFD240325C617012F4765,
+                               A6B861E803E88EC100A80006,
+                               F51305FF0325FC38012F4765,
+                               F59F5F930374921B01A80006,
+                               A6B861E703E88E9900A80006,
+                               F581E14003B24C140101DBD7,
+                       );
+                       isa = PBXGroup;
+                       name = "Libraries and Frameworks";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5EC16810332800301A80006 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = "compiled.mach-o.dylib";
+                       name = libxml2.dylib;
+                       path = /usr/local/lib/libxml2.2.6.16.dylib;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               F5EC16820332800301A80006 = {
+                       fileRef = F5EC16810332800301A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5EDFADA032D252001A80082 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = trgt_bmp.cpp;
+                       path = src/modules/mod_bmp/trgt_bmp.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5EDFADB032D252001A80082 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = trgt_bmp.h;
+                       path = src/modules/mod_bmp/trgt_bmp.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5EDFADC032D252001A80082 = {
+                       fileRef = F5EDFADA032D252001A80082;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5EDFADD032D252001A80082 = {
+                       fileRef = F5EDFADB032D252001A80082;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F2702E03C932DE01BABFEF = {
+                       buildSettings = {
+                               COPY_PHASE_STRIP = YES;
+                               GCC_VERSION = 3;
+                               HEADER_SEARCH_PATHS = "\U0001./sinfg.pbproj";
+                               LDFLAGS = "\U0001-flat-namespace";
+                               MACOSX_DEPLOYMENT_TARGET = 10.2;
+                               OPTIMIZATION_CFLAGS = "-O3 -ffast-math -faltivec";
+                               OTHER_CFLAGS = "\U0001-DHAVE_CFLAGS -DNDEBUG -DHAVE_CONFIG_H -Wno-long-double";
+                               OTHER_CXXFLAGS = "\U0001-DHAVE_CFLAGS -DNDEBUG -DHAVE_CONFIG_H -Wno-long-double";
+                               USE_GCC3_PFE_SUPPORT = YES;
+                       };
+                       isa = PBXBuildStyle;
+                       name = "Deployment (GCC3) AltiVec";
+               };
+               F5F48EB70314868C01682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48EB80314868C01682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5F48EC3031486BE01682FCB,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48EB90314868C01682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5F48EE10314895701682FCB,
+                               F51306490325FC4E012F4765,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48EBA0314868C01682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48EBB0314868C01682FCB = {
+                       buildPhases = (
+                               F5F48EB70314868C01682FCB,
+                               F5F48EB80314868C01682FCB,
+                               F5F48EB90314868C01682FCB,
+                               F5F48EBA0314868C01682FCB,
+                               F513073A03267C35012F4765,
+                       );
+                       buildSettings = {
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = sinfg;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               USE_GCC3_PFE_SUPPORT = YES;
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                               F5F48ED50314875A01682FCB,
+                       );
+                       isa = PBXToolTarget;
+                       name = "Sinfg Tool";
+                       productName = "Sinfg Tool";
+                       productReference = F5F48EBC0314868C01682FCB;
+               };
+               F5F48EBC0314868C01682FCB = {
+                       explicitFileType = "compiled.mach-o.executable";
+                       isa = PBXFileReference;
+                       path = sinfg;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F5F48EC2031486BE01682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/tool/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F48EC3031486BE01682FCB = {
+                       fileRef = F5F48EC2031486BE01682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F48EC40314870401682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = general.h;
+                       path = src/sinfg/general.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F48EC50314870401682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/sinfg/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F48EC60314870401682FCB = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = sinfg.h;
+                       path = src/sinfg/sinfg.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F48ECA0314873101682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5FB06D403200B2801A80006,
+                               F5F48ED10314873B01682FCB,
+                               F5F48ED30314873D01682FCB,
+                               F579DCC90315607801682FCB,
+                               F579DCD303156FA301682FCB,
+                               F579DCD50315734101682FCB,
+                               F579DCD90315770A01682FCB,
+                               F579DCE403159B9401682FCB,
+                               F51307FE0326CBE8012F4765,
+                               F51308020326CD28012F4765,
+                               F5A4F3330327E86D01A80006,
+                               F57D1D36034262A601A80006,
+                               F591EF15034511A901A80006,
+                               F5D51DF80399C8EF01A80006,
+                               F5FB06D603200BCD01A80006,
+                               F58056AA03A2DB6901A80006,
+                               F58056AC03A2DB6901A80006,
+                               F58056AE03A2DB6901A80006,
+                               A6F67D9D03E7AD7400A80006,
+                               A6F67D9E03E7AD7400A80006,
+                               A6714DFD0413E80A00F656BD,
+                               A6714DFE0413E80A00F656BD,
+                               A6D879B7042BAC7F00A80006,
+                               A6C8D6300430F3DC00A80006,
+                               A60324DE04425DAD00A80006,
+                               A60324E004425DAD00A80006,
+                               A60324E204425DAD00A80006,
+                               A60324F804425DF300A80006,
+                               A60324FA04425DF300A80006,
+                               A60324FC04425DF300A80006,
+                               A60324FE04425DF300A80006,
+                               A603250004425DF300A80006,
+                               A603250204425DF300A80006,
+                               A603250404425DF300A80006,
+                               A603250604425DF300A80006,
+                               A603250804425DF300A80006,
+                               A603250A04425DF300A80006,
+                               A68445110474A77900A80006,
+                               A68445130474A77900A80006,
+                               A68445150474A77900A80006,
+                               A68445170474A77900A80006,
+                               A68445190474A77900A80006,
+                               A684451B0474A77900A80006,
+                               A684451D0474A77900A80006,
+                               A684451F0474A77900A80006,
+                               A68445210474A77900A80006,
+                               A68445220474A77900A80006,
+                               A68445230474A77900A80006,
+                               A68445240474A77900A80006,
+                               A68445280474A77900A80006,
+                               A684452A0474A77900A80006,
+                               A684452C0474A77900A80006,
+                               A64F6CF0052A991700140006,
+                               A64F6CF2052A991700140006,
+                               A64F6CF4052A991700140006,
+                               A64F6CF6052A991700140006,
+                               A64F6CF8052A991700140006,
+                               A64F6CF9052A991700140006,
+                               A64F6CFB052A991700140006,
+                               A64F6CFD052A991700140006,
+                               A64F6CFF052A991700140006,
+                               A64F6D01052A991700140006,
+                               A64F6D03052A991700140006,
+                               A64F6D05052A991700140006,
+                               A64F6D07052A991700140006,
+                               A64F6D09052A991700140006,
+                               A64F6D0B052A991700140006,
+                               A6FEFDF005DEA44C00140006,
+                               A6C1415205E836A0004C1DD1,
+                               A6C1415405E836A0004C1DD1,
+                               A6C1415605E836A0004C1DD1,
+                               A6C1415805E836A0004C1DD1,
+                               A6E2EA9907656673002AF736,
+                               A6E2EA9B07656673002AF736,
+                               A6E2EA9D07656673002AF736,
+                               A6E2EA9E07656673002AF736,
+                               A6E2EA9F07656673002AF736,
+                               A6E2EAA107656673002AF736,
+                               A6E2EAA307656673002AF736,
+                               A6E2EAA407656673002AF736,
+                               A6E2EAA607656673002AF736,
+                               A6E2EAA807656673002AF736,
+                               A6E2EAAA07656673002AF736,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48ECB0314873101682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXResourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48ECC0314873101682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5F48ED20314873C01682FCB,
+                               F579DCCF0315672F01682FCB,
+                               F579DCD203156FA301682FCB,
+                               F579DCD80315770A01682FCB,
+                               F5FB06D303200B2801A80006,
+                               F51308010326CD28012F4765,
+                               F5B07694032A8C0201A80082,
+                               F591EF14034511A901A80006,
+                               F5F784D3034BC0D901A80006,
+                               F5D51DF70399C8EF01A80006,
+                               F58056A903A2DB6901A80006,
+                               F58056AB03A2DB6901A80006,
+                               F58056AD03A2DB6901A80006,
+                               A6F67D9C03E7AD7400A80006,
+                               A6C8D62E0430F3DC00A80006,
+                               A6C8D62F0430F3DC00A80006,
+                               A60324DF04425DAD00A80006,
+                               A60324E104425DAD00A80006,
+                               A60324F704425DF300A80006,
+                               A60324F904425DF300A80006,
+                               A60324FB04425DF300A80006,
+                               A60324FD04425DF300A80006,
+                               A60324FF04425DF300A80006,
+                               A603250104425DF300A80006,
+                               A603250304425DF300A80006,
+                               A603250504425DF300A80006,
+                               A603250704425DF300A80006,
+                               A603250904425DF300A80006,
+                               A68445120474A77900A80006,
+                               A68445140474A77900A80006,
+                               A68445160474A77900A80006,
+                               A68445180474A77900A80006,
+                               A684451A0474A77900A80006,
+                               A684451C0474A77900A80006,
+                               A684451E0474A77900A80006,
+                               A68445200474A77900A80006,
+                               A68445270474A77900A80006,
+                               A68445290474A77900A80006,
+                               A684452B0474A77900A80006,
+                               A64F6CEF052A991700140006,
+                               A64F6CF1052A991700140006,
+                               A64F6CF3052A991700140006,
+                               A64F6CF5052A991700140006,
+                               A64F6CF7052A991700140006,
+                               A64F6CFA052A991700140006,
+                               A64F6CFC052A991700140006,
+                               A64F6CFE052A991700140006,
+                               A64F6D00052A991700140006,
+                               A64F6D02052A991700140006,
+                               A64F6D04052A991700140006,
+                               A64F6D06052A991700140006,
+                               A64F6D08052A991700140006,
+                               A64F6D0A052A991700140006,
+                               A6FEFDEF05DEA44C00140006,
+                               A6FEFDF105DEA44C00140006,
+                               A6C1415105E836A0004C1DD1,
+                               A6C1415305E836A0004C1DD1,
+                               A6C1415505E836A0004C1DD1,
+                               A6C1415705E836A0004C1DD1,
+                               A6E2EA9807656673002AF736,
+                               A6E2EA9A07656673002AF736,
+                               A6E2EA9C07656673002AF736,
+                               A6E2EAA007656673002AF736,
+                               A6E2EAA207656673002AF736,
+                               A6E2EAA507656673002AF736,
+                               A6E2EAA707656673002AF736,
+                               A6E2EAA907656673002AF736,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48ECD0314873101682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5CDFD250325C617012F4765,
+                               F51306480325FC38012F4765,
+                               F5EC16820332800301A80006,
+                               F58056B203A2DD0F01A80006,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48ECE0314873101682FCB = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F48ECF0314873101682FCB = {
+                       buildPhases = (
+                               F5F48ECA0314873101682FCB,
+                               F5F48ECB0314873101682FCB,
+                               F5F48ECC0314873101682FCB,
+                               F5F48ECD0314873101682FCB,
+                               F5F48ECE0314873101682FCB,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = "\"$(LOCAL_LIBRARY_DIR)/Frameworks\"";
+                               FRAMEWORK_VERSION = 0.60.03;
+                               HEADER_SEARCH_PATHS = "/usr/local/include/libxml++-1.0 /usr/local/include/libxml2 /sw/include libltdl";
+                               LIBRARY_SEARCH_PATHS = /sw/lib;
+                               OTHER_CFLAGS = "\U0001";
+                               OTHER_CXXFLAGS = "\U0001";
+                               OTHER_LDFLAGS = "\U0001";
+                               OTHER_LIBTOOL_FLAGS = "\U0001-dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRINCIPAL_CLASS = "";
+                               PRODUCT_NAME = sinfg;
+                               SECTORDER_FLAGS = "";
+                               USE_GCC3_PFE_SUPPORT = YES;
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                               WRAPPER_EXTENSION = framework;
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXFrameworkTarget;
+                       name = "Sinfg Library";
+                       productInstallPath = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+                       productName = "Sinfg Library";
+                       productReference = F5F48ED00314873101682FCB;
+                       productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleExecutable</key>
+       <string>sinfg</string>
+       <key>CFBundleGetInfoString</key>
+       <string></string>
+       <key>CFBundleIconFile</key>
+       <string></string>
+       <key>CFBundleIdentifier</key>
+       <string></string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>Sinfg Library Framework</string>
+       <key>CFBundlePackageType</key>
+       <string>FMWK</string>
+       <key>CFBundleShortVersionString</key>
+       <string>0.60</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>0.60.03</string>
+</dict>
+</plist>
+";
+               };
+               F5F48ED00314873101682FCB = {
+                       explicitFileType = wrapper.framework;
+                       isa = PBXFileReference;
+                       path = sinfg.framework;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F5F48ED10314873B01682FCB = {
+                       fileRef = F5F48EC60314870401682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F5F48ED20314873C01682FCB = {
+                       fileRef = F5F48EC50314870401682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F48ED30314873D01682FCB = {
+                       fileRef = F5F48EC40314870401682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               F5F48ED50314875A01682FCB = {
+                       isa = PBXTargetDependency;
+                       target = F5F48ECF0314873101682FCB;
+                       targetProxy = A65F23D305E843AF005A2B7E;
+               };
+               F5F48EE10314895701682FCB = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F7844B03482C5201A80006 = {
+                       children = (
+                               F5F7844C03482C7E01A80006,
+                               F5F7844D03482C7E01A80006,
+                               F5F7844E03482C7E01A80006,
+                               F5F7844F03482C7E01A80006,
+                       );
+                       isa = PBXGroup;
+                       name = MPlayer;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F7844C03482C7E01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/mptr_mplayer/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F7844D03482C7E01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/mptr_mplayer/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F7844E03482C7E01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = mptr_mplayer.cpp;
+                       path = src/modules/mptr_mplayer/mptr_mplayer.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F7844F03482C7E01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = mptr_mplayer.h;
+                       path = src/modules/mptr_mplayer/mptr_mplayer.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F7845003482C9101A80006 = {
+                       buildPhases = (
+                               F5F7845103482C9101A80006,
+                               F5F7845503482C9101A80006,
+                               F5F7845A03482C9101A80006,
+                               F5F7845D03482C9101A80006,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libmptr_mplayer.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "MPlayer Importer Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F5F7845E03482C9101A80006;
+               };
+               F5F7845103482C9101A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5F7845F03482CBD01A80006,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F7845503482C9101A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5F7846003482CBD01A80006,
+                               F5F7846103482CBE01A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F7845A03482C9101A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5F7845B03482C9101A80006,
+                               F5F7845C03482C9101A80006,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F7845B03482C9101A80006 = {
+                       fileRef = F51305FF0325FC38012F4765;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F7845C03482C9101A80006 = {
+                       fileRef = F5F48ED00314873101682FCB;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F7845D03482C9101A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5F7845E03482C9101A80006 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libmptr_mplayer.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F5F7845F03482CBD01A80006 = {
+                       fileRef = F5F7844F03482C7E01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F7846003482CBD01A80006 = {
+                       fileRef = F5F7844E03482C7E01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F7846103482CBE01A80006 = {
+                       fileRef = F5F7844C03482C7E01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5F784630348DCAA01A80006 = {
+                       buildPhases = (
+                       );
+                       buildSettings = {
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PRODUCT_NAME = All;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                               F5F784660348DCBE01A80006,
+                               F5F784640348DCB601A80006,
+                               F5F784650348DCBA01A80006,
+                       );
+                       isa = PBXAggregateTarget;
+                       name = All;
+                       productName = All;
+               };
+               F5F784640348DCB601A80006 = {
+                       isa = PBXTargetDependency;
+                       target = F5F48EBB0314868C01682FCB;
+                       targetProxy = A65F23D205E843AF005A2B7E;
+               };
+               F5F784650348DCBA01A80006 = {
+                       isa = PBXTargetDependency;
+                       target = F51307A3032684C7012F4765;
+                       targetProxy = A65F23D405E843AF005A2B7E;
+               };
+               F5F784660348DCBE01A80006 = {
+                       isa = PBXTargetDependency;
+                       target = F5F48ECF0314873101682FCB;
+                       targetProxy = A65F23D605E843AF005A2B7E;
+               };
+               F5F784D2034BC0D901A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = surface.cpp;
+                       path = src/sinfg/surface.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5F784D3034BC0D901A80006 = {
+                       fileRef = F5F784D2034BC0D901A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5FB06D003200AE401A80006 = {
+                       children = (
+                               F5FB06D103200B2801A80006,
+                               F5FB06D203200B2801A80006,
+                               F570DBE403257704012F4765,
+                               F570DBE503257704012F4765,
+                       );
+                       isa = PBXGroup;
+                       name = LTDL;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB06D103200B2801A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.c;
+                       name = ltdl.c;
+                       path = libltdl/ltdl.c;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB06D203200B2801A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = ltdl.h;
+                       path = libltdl/ltdl.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB06D303200B2801A80006 = {
+                       fileRef = F5FB06D103200B2801A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5FB06D403200B2801A80006 = {
+                       fileRef = F5FB06D203200B2801A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                               );
+                       };
+               };
+               F5FB06D503200BCD01A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = config.h;
+                       path = sinfg.pbproj/config.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB06D603200BCD01A80006 = {
+                       fileRef = F5FB06D503200BCD01A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                               );
+                       };
+               };
+               F5FB07070320189701A80006 = {
+                       children = (
+                               F5FB0709032018C201A80006,
+                               F5B07695032A957A01A80082,
+                               F5B07646032A774701A80082,
+                               F5FB0708032018A101A80006,
+                       );
+                       isa = PBXGroup;
+                       name = Modules;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB0708032018A101A80006 = {
+                       children = (
+                               F5FB070B032018E601A80006,
+                               F5FB070C032018E601A80006,
+                       );
+                       isa = PBXGroup;
+                       name = Example;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB0709032018C201A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB070B032018E601A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = main.cpp;
+                       path = src/modules/example/main.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB070C032018E601A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Makefile.am;
+                       path = src/modules/example/Makefile.am;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FB070F03201B3201A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5FB071003201B3201A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F5FB071503201B3A01A80006,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5FB071103201B3201A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               F513064A0325FC51012F4765,
+                               F536547E03575FC6012F4ADF,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5FB071203201B3201A80006 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               F5FB071303201B3201A80006 = {
+                       buildPhases = (
+                               F5FB070F03201B3201A80006,
+                               F5FB071003201B3201A80006,
+                               F5FB071103201B3201A80006,
+                               F5FB071203201B3201A80006,
+                       );
+                       buildSettings = {
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               FRAMEWORK_SEARCH_PATHS = /Users/darco/Library/Frameworks;
+                               HEADER_SEARCH_PATHS = src;
+                               LIBRARY_STYLE = DYNAMIC;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_LIBTOOL_FLAGS = "-module -dynamic";
+                               OTHER_REZFLAGS = "";
+                               PREBINDING = NO;
+                               PREFIX_HEADER = sinfg.pbproj/config.h;
+                               PRODUCT_NAME = libexample.so;
+                               REZ_EXECUTABLE = YES;
+                               SECTORDER_FLAGS = "";
+                               USE_GCC3_PFE_SUPPORT = YES;
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXLibraryTarget;
+                       name = "Example Module";
+                       productInstallPath = /usr/local/lib;
+                       productName = "Example Module";
+                       productReference = F5FB071403201B3201A80006;
+               };
+               F5FB071403201B3201A80006 = {
+                       explicitFileType = "compiled.mach-o.dylib";
+                       isa = PBXFileReference;
+                       path = libexample.so;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+               F5FB071503201B3A01A80006 = {
+                       fileRef = F5FB070B032018E601A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5FF0A3F03465FD101A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.cpp.cpp;
+                       name = mptr_ppm.cpp;
+                       path = src/modules/mod_ppm/mptr_ppm.cpp;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FF0A4003465FD101A80006 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       name = mptr_ppm.h;
+                       path = src/modules/mod_ppm/mptr_ppm.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               F5FF0A4103465FD101A80006 = {
+                       fileRef = F5FF0A3F03465FD101A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               F5FF0A4203465FD101A80006 = {
+                       fileRef = F5FF0A4003465FD101A80006;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+       };
+       rootObject = F550016502F0983D01000102;
+}
diff --git a/synfig-core/trunk/synfig.pc.in b/synfig-core/trunk/synfig.pc.in
new file mode 100644 (file)
index 0000000..10ff4e6
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@sinfgincludedir@
+
+Name: sinfg
+Description: Sinfg Library and Associated Tools
+Requires: @CONFIG_DEPS@
+Version: 0.60.05-CVS
+Libs: -L${libdir} @CONFIG_LIBS@
+Cflags: @CONFIG_CFLAGS@ -I@sinfgincludedir@
diff --git a/synfig-core/trunk/synfig.prj b/synfig-core/trunk/synfig.prj
new file mode 100644 (file)
index 0000000..47d0f55
--- /dev/null
@@ -0,0 +1,214 @@
+# Anjuta Version 1.2.2 
+Compatibility Level: 1 
+
+<PROJECT_DESCRIPTION_START>
+
+<PROJECT_DESCRIPTION_END>
+<CONFIG_PROGS_START>
+<CONFIG_PROGS_END>
+<CONFIG_LIBS_START>
+<CONFIG_LIBS_END>
+<CONFIG_HEADERS_START>
+<CONFIG_HEADERS_END>
+<CONFIG_CHARACTERISTICS_START>
+<CONFIG_CHARACTERISTICS_END>
+<CONFIG_LIB_FUNCS_START>
+<CONFIG_LIB_FUNCS_END>
+<CONFIG_ADDITIONAL_START>
+<CONFIG_ADDITIONAL_END>
+<CONFIG_FILES_START>
+<CONFIG_FILES_END>
+<MAKEFILE_AM_START>
+<MAKEFILE_AM_END>
+
+props.file.type=project
+
+anjuta.version=1.2.2
+anjuta.compatibility.level=1
+
+project.name=sinfg
+project.type=GENERIC
+project.target.type=EXECUTABLE
+project.version=0.60.00
+project.author=Robert B. Quattlebaum Jr
+project.source.target=src/tool/sinfg
+project.has.gettext=0
+project.gui.command=
+project.programming.language=C++
+project.excluded.modules=      intl
+
+project.config.extra.modules.before=
+project.config.extra.modules.after=
+project.config.blocked=1
+project.config.disable.overwriting=1 1 1 1 1 1 1 1 1 
+
+project.menu.entry=sinfg Version 0.60.00
+project.menu.group=Application
+project.menu.comment=sinfg Version 0.60.00
+project.menu.icon=
+project.menu.need.terminal=0
+
+project.configure.options=--enable-warnings=maximum --enable-static=no CXX="g++ -march=athlon -msse -mfpmath=sse"
+anjuta.program.arguments=
+preferences.build.option.jobs=0
+preferences.build.option.silent=0
+preferences.build.option.autosave=0
+preferences.make=make
+preferences.build.option.keep.going=0
+preferences.build.option.warn.undef=0
+preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss
+preferences.indent.opening=0
+preferences.autoformat.disable=0
+preferences.indent.automatic=1
+preferences.use.tabs=1
+preferences.indent.size=4
+preferences.tabsize=4
+preferences.indent.closing=0
+
+module.include.name=.
+module.include.type=
+module.include.files=\
+       sinfg.pbproj/config.h\
+       sinfg.pbproj/etl_profile.h\
+       src/modules/lyr_std/bezier.h\
+       src/modules/lyr_std/blur.h\
+       src/modules/lyr_std/checkerboard.h\
+       src/modules/lyr_std/circle.h\
+       src/modules/lyr_std/image.h\
+       src/modules/lyr_std/import.h\
+       src/modules/lyr_std/mandelbrot.h\
+       src/modules/lyr_std/polygon.h\
+       src/modules/lyr_std/region.h\
+       src/modules/lyr_std/solidcolor.h\
+       src/modules/lyr_std/supersample.h\
+       src/modules/lyr_std/translate.h\
+       src/modules/lyr_std/zoom.h\
+       src/modules/mod_ffmpeg/mptr_ffmpeg.h\
+       src/modules/mod_ffmpeg/trgt_ffmpeg.h\
+       src/modules/mptr_mplayer/mptr_mplayer.h\
+       src/modules/trgt_bmp/trgt_bmp.h\
+       src/modules/trgt_dv/trgt_dv.h\
+       src/modules/trgt_gif/trgt_gif.h\
+       src/modules/trgt_mpg/trgt_mpg.h\
+       src/modules/trgt_ppm/mptr_ppm.h\
+       src/modules/trgt_ppm/trgt_mpg.h\
+       src/modules/trgt_ppm/trgt_ppm.h\
+       src/modules/mod_imagemagick/trgt_imagemagick.h\
+       src/modules/mod_imagemagick/mptr_imagemagick.h\
+       src/modules/lyr_freetype/lyr_freetype.h\
+       src/template.h\
+       src/sinfg/animate.h\
+       src/sinfg/bmplayer.h\
+       src/sinfg/color.h\
+       src/sinfg/general.h\
+       src/sinfg/importer.h\
+       src/sinfg/layer.h\
+       src/sinfg/modules.h\
+       src/sinfg/pch.h\
+       src/sinfg/renddesc.h\
+       src/sinfg/render.h\
+       src/sinfg/sinfg.h\
+       src/sinfg/surface.h\
+       src/sinfg/target.h\
+       src/sinfg/vector.h\
+       src/sinfg/datatype.h\
+       src/sinfg/canvas.h\
+       src/sinfg/loadcanvas.h\
+       src/sinfg/savecanvas.h
+
+module.source.name=.
+module.source.type=
+module.source.files=\
+       src/modules/example/main.cpp\
+       src/modules/lyr_std/bezier.cpp\
+       src/modules/lyr_std/blur.cpp\
+       src/modules/lyr_std/checkerboard.cpp\
+       src/modules/lyr_std/circle.cpp\
+       src/modules/lyr_std/image.cpp\
+       src/modules/lyr_std/import.cpp\
+       src/modules/lyr_std/main.cpp\
+       src/modules/lyr_std/mandelbrot.cpp\
+       src/modules/lyr_std/polygon.cpp\
+       src/modules/lyr_std/region.cpp\
+       src/modules/lyr_std/solidcolor.cpp\
+       src/modules/lyr_std/supersample.cpp\
+       src/modules/lyr_std/translate.cpp\
+       src/modules/lyr_std/zoom.cpp\
+       src/modules/mod_ffmpeg/main.cpp\
+       src/modules/mod_ffmpeg/mptr_ffmpeg.cpp\
+       src/modules/mod_ffmpeg/trgt_ffmpeg.cpp\
+       src/modules/mptr_mplayer/main.cpp\
+       src/modules/mptr_mplayer/mptr_mplayer.cpp\
+       src/modules/trgt_bmp/main.cpp\
+       src/modules/trgt_bmp/trgt_bmp.cpp\
+       src/modules/trgt_dv/main.cpp\
+       src/modules/trgt_dv/trgt_dv.cpp\
+       src/modules/trgt_gif/main.cpp\
+       src/modules/trgt_gif/trgt_gif.cpp\
+       src/modules/trgt_mpg/main.cpp\
+       src/modules/trgt_mpg/trgt_mpg.cpp\
+       src/modules/trgt_ppm/main.cpp\
+       src/modules/trgt_ppm/mptr_ppm.cpp\
+       src/modules/trgt_ppm/trgt_mpg.cpp\
+       src/modules/trgt_ppm/trgt_ppm.cpp\
+       src/modules/mod_imagemagick/mptr_imagemagick.cpp\
+       src/modules/mod_imagemagick/main.cpp\
+       src/modules/mod_imagemagick/trgt_imagemagick.cpp\
+       src/modules/lyr_freetype/main.cpp\
+       src/modules/lyr_freetype/lyr_freetype.cpp\
+       src/template.cpp\
+       src/sinfg/animate.cpp\
+       src/sinfg/bmplayer.cpp\
+       src/sinfg/color.cpp\
+       src/sinfg/importer.cpp\
+       src/sinfg/layer.cpp\
+       src/sinfg/main.cpp\
+       src/sinfg/modules.cpp\
+       src/sinfg/render.cpp\
+       src/sinfg/surface.cpp\
+       src/sinfg/target.cpp\
+       src/sinfg/datatype.cpp\
+       src/sinfg/canvas.cpp\
+       src/sinfg/loadcanvas.cpp\
+       src/sinfg/savecanvas.cpp\
+       src/tool/main.cpp
+
+module.pixmap.name=.
+module.pixmap.type=
+module.pixmap.files=
+
+module.data.name=.
+module.data.type=
+module.data.files=
+
+module.help.name=.
+module.help.type=
+module.help.files=
+
+module.doc.name=.
+module.doc.type=
+module.doc.files=\
+       ChangeLog\
+       INSTALL\
+       README
+
+module.po.files=
+
+compiler.options.supports=
+compiler.options.include.paths=\
+       .\
+       ..
+compiler.options.library.paths=
+compiler.options.libraries=
+compiler.options.libraries.selected=
+compiler.options.defines=\
+       HAVE_CONFIG_H
+compiler.options.defines.selected=
+compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 
+compiler.options.optimize.buttons=0 0 1 0 
+compiler.options.other.buttons=1 0 
+compiler.options.other.c.flags=
+compiler.options.other.l.flags=
+compiler.options.other.l.libs=
+
+project.src.paths=