my log
authordarco <darco@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 8 Jul 2005 10:55:57 +0000 (10:55 +0000)
committerdarco <darco@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 8 Jul 2005 10:55:57 +0000 (10:55 +0000)
git-svn-id: http://svn.voria.com/code@26 1f10aa63-cdf2-0310-b900-c93c546f37ac

580 files changed:
synfig-studio/trunk/Makefile.am
synfig-studio/trunk/config/configure.ac
synfig-studio/trunk/config/sinfg.m4 [deleted file]
synfig-studio/trunk/config/synfig.m4 [new file with mode: 0755]
synfig-studio/trunk/fixer
synfig-studio/trunk/images/Makefile.am
synfig-studio/trunk/images/about_dialog.sif
synfig-studio/trunk/images/sinfg_icon.sif [deleted file]
synfig-studio/trunk/images/synfig_icon.sif [new file with mode: 0644]
synfig-studio/trunk/sinfgstudio.desktop.in [deleted file]
synfig-studio/trunk/sinfgstudio.keys.in [deleted file]
synfig-studio/trunk/sinfgstudio.mime.in [deleted file]
synfig-studio/trunk/src/Makefile.am
synfig-studio/trunk/src/gtkmm/Makefile.am
synfig-studio/trunk/src/gtkmm/about.cpp
synfig-studio/trunk/src/gtkmm/about.h
synfig-studio/trunk/src/gtkmm/adjust_window.cpp
synfig-studio/trunk/src/gtkmm/adjust_window.h
synfig-studio/trunk/src/gtkmm/app.cpp
synfig-studio/trunk/src/gtkmm/app.h
synfig-studio/trunk/src/gtkmm/asyncrenderer.cpp
synfig-studio/trunk/src/gtkmm/asyncrenderer.h
synfig-studio/trunk/src/gtkmm/audiocontainer.cpp
synfig-studio/trunk/src/gtkmm/audiocontainer.h
synfig-studio/trunk/src/gtkmm/autorecover.cpp
synfig-studio/trunk/src/gtkmm/autorecover.h
synfig-studio/trunk/src/gtkmm/canvasoptions.cpp
synfig-studio/trunk/src/gtkmm/canvasoptions.h
synfig-studio/trunk/src/gtkmm/canvasproperties.cpp
synfig-studio/trunk/src/gtkmm/canvasproperties.h
synfig-studio/trunk/src/gtkmm/canvastreestore.cpp
synfig-studio/trunk/src/gtkmm/canvastreestore.h
synfig-studio/trunk/src/gtkmm/canvasview.cpp
synfig-studio/trunk/src/gtkmm/canvasview.h
synfig-studio/trunk/src/gtkmm/cellrenderer_gradient.cpp
synfig-studio/trunk/src/gtkmm/cellrenderer_gradient.h
synfig-studio/trunk/src/gtkmm/cellrenderer_time.cpp
synfig-studio/trunk/src/gtkmm/cellrenderer_time.h
synfig-studio/trunk/src/gtkmm/cellrenderer_timetrack.cpp
synfig-studio/trunk/src/gtkmm/cellrenderer_timetrack.h
synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp
synfig-studio/trunk/src/gtkmm/cellrenderer_value.h
synfig-studio/trunk/src/gtkmm/childrentree.cpp
synfig-studio/trunk/src/gtkmm/childrentree.h
synfig-studio/trunk/src/gtkmm/childrentreestore.cpp
synfig-studio/trunk/src/gtkmm/childrentreestore.h
synfig-studio/trunk/src/gtkmm/compview.cpp
synfig-studio/trunk/src/gtkmm/compview.h
synfig-studio/trunk/src/gtkmm/devicetracker.cpp
synfig-studio/trunk/src/gtkmm/devicetracker.h
synfig-studio/trunk/src/gtkmm/dialog_color.cpp
synfig-studio/trunk/src/gtkmm/dialog_color.h
synfig-studio/trunk/src/gtkmm/dialog_gradient.cpp
synfig-studio/trunk/src/gtkmm/dialog_gradient.h
synfig-studio/trunk/src/gtkmm/dialog_keyframe.cpp
synfig-studio/trunk/src/gtkmm/dialog_keyframe.h
synfig-studio/trunk/src/gtkmm/dialog_preview.cpp
synfig-studio/trunk/src/gtkmm/dialog_preview.h
synfig-studio/trunk/src/gtkmm/dialog_setup.cpp
synfig-studio/trunk/src/gtkmm/dialog_setup.h
synfig-studio/trunk/src/gtkmm/dialog_soundselect.cpp
synfig-studio/trunk/src/gtkmm/dialog_soundselect.h
synfig-studio/trunk/src/gtkmm/dialog_tooloptions.cpp
synfig-studio/trunk/src/gtkmm/dialog_tooloptions.h
synfig-studio/trunk/src/gtkmm/dialog_waypoint.cpp
synfig-studio/trunk/src/gtkmm/dialog_waypoint.h
synfig-studio/trunk/src/gtkmm/dialogsettings.cpp
synfig-studio/trunk/src/gtkmm/dialogsettings.h
synfig-studio/trunk/src/gtkmm/dock_canvases.cpp
synfig-studio/trunk/src/gtkmm/dock_canvases.h
synfig-studio/trunk/src/gtkmm/dock_canvasspecific.cpp
synfig-studio/trunk/src/gtkmm/dock_canvasspecific.h
synfig-studio/trunk/src/gtkmm/dock_children.cpp
synfig-studio/trunk/src/gtkmm/dock_children.h
synfig-studio/trunk/src/gtkmm/dock_curves.cpp
synfig-studio/trunk/src/gtkmm/dock_curves.h
synfig-studio/trunk/src/gtkmm/dock_history.cpp
synfig-studio/trunk/src/gtkmm/dock_history.h
synfig-studio/trunk/src/gtkmm/dock_info.cpp
synfig-studio/trunk/src/gtkmm/dock_info.h
synfig-studio/trunk/src/gtkmm/dock_keyframes.cpp
synfig-studio/trunk/src/gtkmm/dock_keyframes.h
synfig-studio/trunk/src/gtkmm/dock_layergroups.cpp
synfig-studio/trunk/src/gtkmm/dock_layergroups.h
synfig-studio/trunk/src/gtkmm/dock_layers.cpp
synfig-studio/trunk/src/gtkmm/dock_layers.h
synfig-studio/trunk/src/gtkmm/dock_metadata.cpp
synfig-studio/trunk/src/gtkmm/dock_metadata.h
synfig-studio/trunk/src/gtkmm/dock_navigator.cpp
synfig-studio/trunk/src/gtkmm/dock_navigator.h
synfig-studio/trunk/src/gtkmm/dock_params.cpp
synfig-studio/trunk/src/gtkmm/dock_params.h
synfig-studio/trunk/src/gtkmm/dock_timetrack.cpp
synfig-studio/trunk/src/gtkmm/dock_timetrack.h
synfig-studio/trunk/src/gtkmm/dockable.cpp
synfig-studio/trunk/src/gtkmm/dockable.h
synfig-studio/trunk/src/gtkmm/dockbook.cpp
synfig-studio/trunk/src/gtkmm/dockbook.h
synfig-studio/trunk/src/gtkmm/dockdialog.cpp
synfig-studio/trunk/src/gtkmm/dockdialog.h
synfig-studio/trunk/src/gtkmm/dockmanager.cpp
synfig-studio/trunk/src/gtkmm/dockmanager.h
synfig-studio/trunk/src/gtkmm/duck.cpp
synfig-studio/trunk/src/gtkmm/duck.h
synfig-studio/trunk/src/gtkmm/duckmatic.cpp
synfig-studio/trunk/src/gtkmm/duckmatic.h
synfig-studio/trunk/src/gtkmm/ducktransform_rotate.h
synfig-studio/trunk/src/gtkmm/ducktransform_scale.h
synfig-studio/trunk/src/gtkmm/ducktransform_translate.h
synfig-studio/trunk/src/gtkmm/event_layerclick.h
synfig-studio/trunk/src/gtkmm/event_mouse.h
synfig-studio/trunk/src/gtkmm/eventkey.h
synfig-studio/trunk/src/gtkmm/groupactionmanager.cpp
synfig-studio/trunk/src/gtkmm/groupactionmanager.h
synfig-studio/trunk/src/gtkmm/historytreestore.cpp
synfig-studio/trunk/src/gtkmm/historytreestore.h
synfig-studio/trunk/src/gtkmm/iconcontroler.cpp
synfig-studio/trunk/src/gtkmm/iconcontroler.h
synfig-studio/trunk/src/gtkmm/instance.cpp
synfig-studio/trunk/src/gtkmm/instance.h
synfig-studio/trunk/src/gtkmm/ipc.cpp
synfig-studio/trunk/src/gtkmm/ipc.h
synfig-studio/trunk/src/gtkmm/keyframeactionmanager.cpp
synfig-studio/trunk/src/gtkmm/keyframeactionmanager.h
synfig-studio/trunk/src/gtkmm/keyframetree.cpp
synfig-studio/trunk/src/gtkmm/keyframetree.h
synfig-studio/trunk/src/gtkmm/keyframetreestore.cpp
synfig-studio/trunk/src/gtkmm/keyframetreestore.h
synfig-studio/trunk/src/gtkmm/keymapsettings.cpp
synfig-studio/trunk/src/gtkmm/keymapsettings.h
synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp
synfig-studio/trunk/src/gtkmm/layeractionmanager.h
synfig-studio/trunk/src/gtkmm/layergrouptree.cpp
synfig-studio/trunk/src/gtkmm/layergrouptree.h
synfig-studio/trunk/src/gtkmm/layergrouptreestore.cpp
synfig-studio/trunk/src/gtkmm/layergrouptreestore.h
synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp
synfig-studio/trunk/src/gtkmm/layerparamtreestore.h
synfig-studio/trunk/src/gtkmm/layertree.cpp
synfig-studio/trunk/src/gtkmm/layertree.h
synfig-studio/trunk/src/gtkmm/layertreestore.cpp
synfig-studio/trunk/src/gtkmm/layertreestore.h
synfig-studio/trunk/src/gtkmm/main.cpp
synfig-studio/trunk/src/gtkmm/metadatatreestore.cpp
synfig-studio/trunk/src/gtkmm/metadatatreestore.h
synfig-studio/trunk/src/gtkmm/mod_mirror/mod_mirror.cpp
synfig-studio/trunk/src/gtkmm/mod_mirror/mod_mirror.h
synfig-studio/trunk/src/gtkmm/mod_mirror/state_mirror.cpp
synfig-studio/trunk/src/gtkmm/mod_mirror/state_mirror.h
synfig-studio/trunk/src/gtkmm/mod_palette/dock_palbrowse.cpp
synfig-studio/trunk/src/gtkmm/mod_palette/dock_palbrowse.h
synfig-studio/trunk/src/gtkmm/mod_palette/dock_paledit.cpp
synfig-studio/trunk/src/gtkmm/mod_palette/dock_paledit.h
synfig-studio/trunk/src/gtkmm/mod_palette/mod_palette.cpp
synfig-studio/trunk/src/gtkmm/mod_palette/mod_palette.h
synfig-studio/trunk/src/gtkmm/module.cpp
synfig-studio/trunk/src/gtkmm/module.h
synfig-studio/trunk/src/gtkmm/onemoment.cpp
synfig-studio/trunk/src/gtkmm/onemoment.h
synfig-studio/trunk/src/gtkmm/preview.cpp
synfig-studio/trunk/src/gtkmm/preview.h
synfig-studio/trunk/src/gtkmm/renddesc.cpp
synfig-studio/trunk/src/gtkmm/renddesc.h
synfig-studio/trunk/src/gtkmm/render.cpp
synfig-studio/trunk/src/gtkmm/render.h
synfig-studio/trunk/src/gtkmm/renderer_bbox.cpp
synfig-studio/trunk/src/gtkmm/renderer_bbox.h
synfig-studio/trunk/src/gtkmm/renderer_canvas.cpp
synfig-studio/trunk/src/gtkmm/renderer_canvas.h
synfig-studio/trunk/src/gtkmm/renderer_dragbox.cpp
synfig-studio/trunk/src/gtkmm/renderer_dragbox.h
synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp
synfig-studio/trunk/src/gtkmm/renderer_ducks.h
synfig-studio/trunk/src/gtkmm/renderer_grid.cpp
synfig-studio/trunk/src/gtkmm/renderer_grid.h
synfig-studio/trunk/src/gtkmm/renderer_guides.cpp
synfig-studio/trunk/src/gtkmm/renderer_guides.h
synfig-studio/trunk/src/gtkmm/renderer_timecode.cpp
synfig-studio/trunk/src/gtkmm/renderer_timecode.h
synfig-studio/trunk/src/gtkmm/smach.h
synfig-studio/trunk/src/gtkmm/state_bline.cpp
synfig-studio/trunk/src/gtkmm/state_bline.h
synfig-studio/trunk/src/gtkmm/state_circle.cpp
synfig-studio/trunk/src/gtkmm/state_circle.h
synfig-studio/trunk/src/gtkmm/state_draw.cpp
synfig-studio/trunk/src/gtkmm/state_draw.h
synfig-studio/trunk/src/gtkmm/state_eyedrop.cpp
synfig-studio/trunk/src/gtkmm/state_eyedrop.h
synfig-studio/trunk/src/gtkmm/state_fill.cpp
synfig-studio/trunk/src/gtkmm/state_fill.h
synfig-studio/trunk/src/gtkmm/state_gradient.cpp
synfig-studio/trunk/src/gtkmm/state_gradient.h
synfig-studio/trunk/src/gtkmm/state_normal.cpp
synfig-studio/trunk/src/gtkmm/state_normal.h
synfig-studio/trunk/src/gtkmm/state_polygon.cpp
synfig-studio/trunk/src/gtkmm/state_polygon.h
synfig-studio/trunk/src/gtkmm/state_rectangle.cpp
synfig-studio/trunk/src/gtkmm/state_rectangle.h
synfig-studio/trunk/src/gtkmm/state_rotate.cpp
synfig-studio/trunk/src/gtkmm/state_rotate.h
synfig-studio/trunk/src/gtkmm/state_scale.cpp
synfig-studio/trunk/src/gtkmm/state_scale.h
synfig-studio/trunk/src/gtkmm/state_sketch.cpp
synfig-studio/trunk/src/gtkmm/state_sketch.h
synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp
synfig-studio/trunk/src/gtkmm/state_smoothmove.h
synfig-studio/trunk/src/gtkmm/state_stroke.cpp
synfig-studio/trunk/src/gtkmm/state_stroke.h
synfig-studio/trunk/src/gtkmm/state_width.cpp
synfig-studio/trunk/src/gtkmm/state_width.h
synfig-studio/trunk/src/gtkmm/state_zoom.cpp
synfig-studio/trunk/src/gtkmm/state_zoom.h
synfig-studio/trunk/src/gtkmm/statemanager.cpp
synfig-studio/trunk/src/gtkmm/statemanager.h
synfig-studio/trunk/src/gtkmm/toolbox.cpp
synfig-studio/trunk/src/gtkmm/toolbox.h
synfig-studio/trunk/src/gtkmm/valuelink.cpp
synfig-studio/trunk/src/gtkmm/valuelink.h
synfig-studio/trunk/src/gtkmm/widget_canvaschooser.cpp
synfig-studio/trunk/src/gtkmm/widget_canvaschooser.h
synfig-studio/trunk/src/gtkmm/widget_color.cpp
synfig-studio/trunk/src/gtkmm/widget_color.h
synfig-studio/trunk/src/gtkmm/widget_coloredit.cpp
synfig-studio/trunk/src/gtkmm/widget_coloredit.h
synfig-studio/trunk/src/gtkmm/widget_compselect.cpp
synfig-studio/trunk/src/gtkmm/widget_compselect.h
synfig-studio/trunk/src/gtkmm/widget_curves.cpp
synfig-studio/trunk/src/gtkmm/widget_curves.h
synfig-studio/trunk/src/gtkmm/widget_defaults.cpp
synfig-studio/trunk/src/gtkmm/widget_defaults.h
synfig-studio/trunk/src/gtkmm/widget_distance.cpp
synfig-studio/trunk/src/gtkmm/widget_distance.h
synfig-studio/trunk/src/gtkmm/widget_enum.cpp
synfig-studio/trunk/src/gtkmm/widget_enum.h
synfig-studio/trunk/src/gtkmm/widget_filename.cpp
synfig-studio/trunk/src/gtkmm/widget_filename.h
synfig-studio/trunk/src/gtkmm/widget_gradient.cpp
synfig-studio/trunk/src/gtkmm/widget_gradient.h
synfig-studio/trunk/src/gtkmm/widget_sound.cpp
synfig-studio/trunk/src/gtkmm/widget_sound.h
synfig-studio/trunk/src/gtkmm/widget_time.cpp
synfig-studio/trunk/src/gtkmm/widget_time.h
synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp
synfig-studio/trunk/src/gtkmm/widget_timeslider.h
synfig-studio/trunk/src/gtkmm/widget_value.cpp
synfig-studio/trunk/src/gtkmm/widget_value.h
synfig-studio/trunk/src/gtkmm/widget_vector.cpp
synfig-studio/trunk/src/gtkmm/widget_vector.h
synfig-studio/trunk/src/gtkmm/widget_waypoint.cpp
synfig-studio/trunk/src/gtkmm/widget_waypoint.h
synfig-studio/trunk/src/gtkmm/widget_waypointmodel.cpp
synfig-studio/trunk/src/gtkmm/widget_waypointmodel.h
synfig-studio/trunk/src/gtkmm/workarea.cpp
synfig-studio/trunk/src/gtkmm/workarea.h
synfig-studio/trunk/src/gtkmm/workarearenderer.cpp
synfig-studio/trunk/src/gtkmm/workarearenderer.h
synfig-studio/trunk/src/gtkmm/zoomdial.cpp
synfig-studio/trunk/src/gtkmm/zoomdial.h
synfig-studio/trunk/src/sinfgapp/Makefile.am [deleted file]
synfig-studio/trunk/src/sinfgapp/action.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/action.h [deleted file]
synfig-studio/trunk/src/sinfgapp/action_param.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/action_param.h [deleted file]
synfig-studio/trunk/src/sinfgapp/action_system.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/action_system.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointadd.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointadd.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointremove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointremove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointsetoff.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointsetoff.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointseton.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointseton.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointsetsmart.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointsetsmart.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointsimpleadd.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/activepointsimpleadd.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentmerge.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentmerge.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentsplit.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentsplit.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/canvasadd.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/canvasadd.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/canvasremove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/canvasremove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/canvasrenddescset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/canvasrenddescset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/colorset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/colorset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/editmodeset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/editmodeset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/gradientset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/gradientset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/groupaddlayers.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/groupaddlayers.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/groupremove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/groupremove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/groupremovelayers.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/groupremovelayers.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/grouprename.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/grouprename.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframeadd.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframeadd.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframeduplicate.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframeduplicate.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframeremove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframeremove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframeset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframeset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframesetdelta.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframesetdelta.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframewaypointset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/keyframewaypointset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layeractivate.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layeractivate.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layeradd.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layeradd.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerduplicate.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerduplicate.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerencapsulate.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerencapsulate.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerlower.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerlower.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layermove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layermove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerparamconnect.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerparamconnect.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerparamdisconnect.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerparamdisconnect.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerparamset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerparamset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerraise.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerraise.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerremove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layerremove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layersetdesc.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/layersetdesc.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/timepointscopy.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/timepointscopy.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/timepointsdelete.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/timepointsdelete.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/timepointsmove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/timepointsmove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescconnect.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescconnect.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescconvert.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescconvert.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescdisconnect.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescdisconnect.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescexport.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescexport.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedesclink.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedesclink.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuedescset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodeadd.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodeadd.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodeconstset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodeconstset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsert.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsert.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsertsmart.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsertsmart.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistloop.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistloop.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremovesmart.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremovesmart.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistrotateorder.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistrotateorder.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistunloop.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistunloop.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkconnect.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkconnect.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkdisconnect.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkdisconnect.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenoderemove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenoderemove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenoderename.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenoderename.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodereplace.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/valuenodereplace.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointadd.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointadd.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointremove.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointremove.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointset.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointset.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointsetsmart.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointsetsmart.h [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointsimpleadd.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/actions/waypointsimpleadd.h [deleted file]
synfig-studio/trunk/src/sinfgapp/blineconvert.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/blineconvert.h [deleted file]
synfig-studio/trunk/src/sinfgapp/canvasinterface.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/canvasinterface.h [deleted file]
synfig-studio/trunk/src/sinfgapp/cvs.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/cvs.h [deleted file]
synfig-studio/trunk/src/sinfgapp/editmode.h [deleted file]
synfig-studio/trunk/src/sinfgapp/inputdevice.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/inputdevice.h [deleted file]
synfig-studio/trunk/src/sinfgapp/instance.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/instance.h [deleted file]
synfig-studio/trunk/src/sinfgapp/main.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/main.h [deleted file]
synfig-studio/trunk/src/sinfgapp/selectionmanager.h [deleted file]
synfig-studio/trunk/src/sinfgapp/settings.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/settings.h [deleted file]
synfig-studio/trunk/src/sinfgapp/timegather.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/timegather.h [deleted file]
synfig-studio/trunk/src/sinfgapp/uimanager.cpp [deleted file]
synfig-studio/trunk/src/sinfgapp/uimanager.h [deleted file]
synfig-studio/trunk/src/sinfgapp/value_desc.h [deleted file]
synfig-studio/trunk/src/synfigapp/Makefile.am [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/action.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/action.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/action_param.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/action_param.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/action_system.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/action_system.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointadd.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointadd.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointremove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointremove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointseton.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointseton.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointsetsmart.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointsetsmart.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointsimpleadd.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/activepointsimpleadd.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/blinepointtangentmerge.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/blinepointtangentmerge.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/canvasadd.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/canvasadd.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/canvasremove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/canvasremove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/canvasrenddescset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/canvasrenddescset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/colorset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/colorset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/editmodeset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/editmodeset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/gradientset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/gradientset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/groupaddlayers.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/groupaddlayers.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/groupremove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/groupremove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/groupremovelayers.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/groupremovelayers.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/grouprename.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/grouprename.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframeadd.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframeadd.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframeremove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframeremove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframeset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframeset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframesetdelta.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframesetdelta.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframewaypointset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/keyframewaypointset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layeractivate.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layeradd.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layeradd.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerduplicate.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerduplicate.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerencapsulate.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerencapsulate.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerlower.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerlower.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layermove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layermove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerparamconnect.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerparamconnect.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerparamdisconnect.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerparamdisconnect.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerparamset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerparamset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerraise.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerraise.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layerremove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layersetdesc.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/layersetdesc.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/timepointscopy.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/timepointscopy.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/timepointsdelete.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/timepointsdelete.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/timepointsmove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/timepointsmove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescconvert.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescconvert.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescdisconnect.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescdisconnect.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescexport.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescexport.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedesclink.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedesclink.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuedescset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodeadd.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodeadd.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodeconstset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodeconstset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsert.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsert.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsertsmart.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsertsmart.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistloop.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistloop.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremovesmart.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremovesmart.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistrotateorder.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistrotateorder.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistunloop.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistunloop.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodelinkconnect.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodelinkconnect.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodelinkdisconnect.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodelinkdisconnect.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenoderemove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenoderemove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenoderename.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenoderename.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointadd.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointadd.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointremove.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointremove.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointset.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointset.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointsetsmart.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointsetsmart.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/blineconvert.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/blineconvert.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/canvasinterface.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/canvasinterface.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/cvs.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/cvs.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/editmode.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/inputdevice.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/inputdevice.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/instance.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/instance.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/main.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/main.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/selectionmanager.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/settings.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/settings.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/timegather.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/timegather.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/uimanager.cpp [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/uimanager.h [new file with mode: 0644]
synfig-studio/trunk/src/synfigapp/value_desc.h [new file with mode: 0644]
synfig-studio/trunk/src/template.cpp
synfig-studio/trunk/src/template.h
synfig-studio/trunk/synfigstudio.desktop.in [new file with mode: 0644]
synfig-studio/trunk/synfigstudio.keys.in [new file with mode: 0644]
synfig-studio/trunk/synfigstudio.mime.in [new file with mode: 0644]
synfig-studio/trunk/win32inst.nsi.in

index a3ce6b2..4b8d0e8 100644 (file)
@@ -6,23 +6,23 @@ MAINTAINERCLEANFILES=config/package config/ltmain.sh config/config.guess config/
 
 SUBDIRS=images src
 
-EXTRA_DIST=bootstrap config/depcomp config/cxx_macros.m4 @PACKAGE_TARNAME@-@VERSION@.spec config/project.spec.in config/build.cfg sinfg.kdevprj config/ETL.m4
+EXTRA_DIST=bootstrap config/depcomp config/cxx_macros.m4 @PACKAGE_TARNAME@-@VERSION@.spec config/project.spec.in config/build.cfg synfig.kdevprj config/ETL.m4
 
 # Desktop entry
 #desktopdir              = $(datadir)/gnome/apps/Graphics
 desktopdir              = $(prefix)/share/applications
-desktop_DATA            = sinfgstudio.desktop
-#desktop_in_files        = sinfgstudio.desktop.in
+desktop_DATA            = synfigstudio.desktop
+#desktop_in_files        = synfigstudio.desktop.in
 #desktop_DATA            = $(desktop_in_files:.desktop.in=.desktop)
 
 # @INTLTOOL_DESKTOP_RULE@
 
 mimedir              = $(prefix)/share/mime-info
-mime_DATA            = sinfgstudio.keys sinfgstudio.mime
+mime_DATA            = synfigstudio.keys synfigstudio.mime
 
 # Icon
 icondir                 = $(datadir)/pixmaps
-icon_DATA               = images/sinfg_icon.png images/sif_icon.png
+icon_DATA               = images/synfig_icon.png images/sif_icon.png
 
 
 CVS=cvs
index 0357c90..1193af3 100755 (executable)
@@ -69,11 +69,11 @@ PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 gthread-2.0,[],[
 AC_SUBST(GTKMM_CFLAGS)
 AC_SUBST(GTKMM_LIBS)
 
-PKG_CHECK_MODULES(SINFG, synfig ETL sigc++-2.0,,[
+PKG_CHECK_MODULES(SYNFIG, synfig ETL sigc++-2.0,,[
        AC_MSG_ERROR([ ** Unable to set up dependent libraries])
 ])
-AC_SUBST(SINFG_CFLAGS)
-AC_SUBST(SINFG_LIBS)
+AC_SUBST(SYNFIG_CFLAGS)
+AC_SUBST(SYNFIG_LIBS)
 
 windowsys="gtkmm"
 AC_DEFINE(STUDIO_WINSYS_H,"gtkmm/winsys.h",[blah])
@@ -149,12 +149,12 @@ AC_DEFINE_UNQUOTED(IMAGE_DIR,"`echo echo $imagedir | sh`", [ Describes where the
 
 AC_OUTPUT(
 Makefile
-sinfgstudio.desktop
-sinfgstudio.mime
-sinfgstudio.keys
+synfigstudio.desktop
+synfigstudio.mime
+synfigstudio.keys
 src/Makefile
 src/gtkmm/Makefile
-src/sinfgapp/Makefile
+src/synfigapp/Makefile
 images/Makefile
 win32inst.nsi
 pkg-info/macosx/synfig-studio.info
@@ -180,8 +180,8 @@ FMOD Enabled ---------------------> $with_libfmod
 "'$'"CXX ------------------------------> '$CXX'
 "'$'"CXXFLAGS -------------------------> '$CXXFLAGS'
 "'$'"LDFLAGS --------------------------> '$LDFLAGS'
-"'$'"SINFG_CFLAGS ---------------------> '$SINFG_CFLAGS'
-"'$'"SINFG_LIBS -----------------------> '$SINFG_LIBS'
+"'$'"SYNFIG_CFLAGS ---------------------> '$SYNFIG_CFLAGS'
+"'$'"SYNFIG_LIBS -----------------------> '$SYNFIG_LIBS'
 "'$'"GTKMM_CFLAGS ---------------------> '$GTKMM_CFLAGS'
 "'$'"GTKMM_LIBS -----------------------> '$GTKMM_LIBS'
 "
diff --git a/synfig-studio/trunk/config/sinfg.m4 b/synfig-studio/trunk/config/sinfg.m4
deleted file mode 100755 (executable)
index b4df86f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# SINFG M4 Macro
-# For GNU Autotools
-# $Id: sinfg.m4,v 1.1.1.1 2005/01/07 03:34:35 darco Exp $
-#
-# By Robert B. Quattlebaum Jr. <darco@users.sf.net>
-#
-
-AC_DEFUN([SINFG_DEPS],
-[
-       USING_ETL(,$2)
-       AM_PATH_XML2(,,$2)
-       AC_CHECK_FUNCS([floor pow sqrt],,$2)
-       $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])
-                       SINFG_CXXFLAGS="`$SINFG_CONFIG --cxxflags`"
-                       SINFG_CFLAGS="`$SINFG_CONFIG --cflags`"
-                       SINFG_LIBS="`$SINFG_CONFIG --libs`"
-                       CXXFLAGS="$CXXFLAGS $SINFG_CXXFLAGS"
-                       AC_SUBST(SINFG_CXXFLAGS)
-                       AC_SUBST(SINFG_LIBS)
-                       AC_SUBST(SINFG_CFLAGS)
-                       $1
-               else
-                       AC_MSG_RESULT(no)
-                       no_SINFG_config="yes"
-                       $2
-               fi
-       fi
-
-       SINFG_DEPS($1,$2)
-])
-
-
diff --git a/synfig-studio/trunk/config/synfig.m4 b/synfig-studio/trunk/config/synfig.m4
new file mode 100755 (executable)
index 0000000..b4df86f
--- /dev/null
@@ -0,0 +1,51 @@
+# SINFG M4 Macro
+# For GNU Autotools
+# $Id: sinfg.m4,v 1.1.1.1 2005/01/07 03:34:35 darco Exp $
+#
+# By Robert B. Quattlebaum Jr. <darco@users.sf.net>
+#
+
+AC_DEFUN([SINFG_DEPS],
+[
+       USING_ETL(,$2)
+       AM_PATH_XML2(,,$2)
+       AC_CHECK_FUNCS([floor pow sqrt],,$2)
+       $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])
+                       SINFG_CXXFLAGS="`$SINFG_CONFIG --cxxflags`"
+                       SINFG_CFLAGS="`$SINFG_CONFIG --cflags`"
+                       SINFG_LIBS="`$SINFG_CONFIG --libs`"
+                       CXXFLAGS="$CXXFLAGS $SINFG_CXXFLAGS"
+                       AC_SUBST(SINFG_CXXFLAGS)
+                       AC_SUBST(SINFG_LIBS)
+                       AC_SUBST(SINFG_CFLAGS)
+                       $1
+               else
+                       AC_MSG_RESULT(no)
+                       no_SINFG_config="yes"
+                       $2
+               fi
+       fi
+
+       SINFG_DEPS($1,$2)
+])
+
+
index 4bb7098..b189f6d 100755 (executable)
@@ -2,9 +2,22 @@
 
 TEMPFILENAME=~/deleteme.tmp
 
-for filename in `find . -name '*.[ch]*'` ; do {
-       sed '
-s/SigC::Signal./sigc::signal/g;
+SEDSCRIPT='
+s/sinfg/synfig/g;
+s/SINFG/SYNFIG/g;
+s/= S I N F G ===/= S Y N F I G =/g;
+s/Sinfg/Synfig/g;
+';
 
-' < $filename > $TEMPFILENAME && ( diff -q $TEMPFILENAME $filename || cp $TEMPFILENAME $filename )
+for filename in `find . -name "*sinfg*" -a ! -name '*svn*'` ; do {
+       newfilename=`echo $filename | sed "$SEDSCRIPT"`;
+       echo $filename '=>' $newfilename;
+       svn rename $filename  $newfilename || exit 2;
+} ; done
+
+
+#exit 0;
+
+for filename in `find . -name '*.[ch]*' -o -name '*.am' -o -name '*.px' -o -name '*.ac' -o -name '*.nsh' -o -name '*.in' | grep -v .svn` ; do {
+       sed "$SEDSCRIPT" < $filename > $TEMPFILENAME && ( diff -q $TEMPFILENAME $filename || cp $TEMPFILENAME $filename )
 } ; done
index ccffef1..e9e0d53 100644 (file)
@@ -1,9 +1,9 @@
 
-SINFG=sinfg
+SYNFIG=synfig
 EXT=@imageext@
 
 EXTRA_DIST=studio_about.sif
-IMAGES=mirror_icon.$(EXT) time_track_icon.$(EXT) pastecanvas_icon.$(EXT) group_icon.$(EXT) clear_redo_icon.$(EXT) clear_undo_icon.$(EXT) navigator_icon.$(EXT) info_icon.$(EXT) zoom_icon.$(EXT) meta_data_icon.$(EXT) children_icon.$(EXT) keyframe_icon.$(EXT) swap_colors_icon.$(EXT) rotate_icon.$(EXT) scale_icon.$(EXT) smooth_move_icon.$(EXT) width_icon.$(EXT) rectangle_icon.$(EXT) circle_icon.$(EXT) draw_icon.$(EXT) sketch_icon.$(EXT) fill_icon.$(EXT) normal_icon.$(EXT) sif_icon.$(EXT) sinfg_icon.$(EXT) saveall_icon.$(EXT) bool_icon.$(EXT) integer_icon.$(EXT) angle_icon.$(EXT) segment_icon.$(EXT) blinepoint_icon.$(EXT) list_icon.$(EXT) canvas_pointer_icon.$(EXT) string_icon.$(EXT) eyedrop_icon.$(EXT) about_icon.$(EXT) about_dialog.$(EXT) canvas_icon.$(EXT) vector_icon.$(EXT) real_icon.$(EXT) color_icon.$(EXT) valuenode_icon.$(EXT) polygon_icon.$(EXT) bline_icon.$(EXT) layer_icon.$(EXT) duplicate_icon.$(EXT) gradient_icon.$(EXT) keyframe_lock_all.$(EXT) keyframe_lock_past.$(EXT) keyframe_lock_future.$(EXT) keyframe_lock_none.$(EXT)
+IMAGES=mirror_icon.$(EXT) time_track_icon.$(EXT) pastecanvas_icon.$(EXT) group_icon.$(EXT) clear_redo_icon.$(EXT) clear_undo_icon.$(EXT) navigator_icon.$(EXT) info_icon.$(EXT) zoom_icon.$(EXT) meta_data_icon.$(EXT) children_icon.$(EXT) keyframe_icon.$(EXT) swap_colors_icon.$(EXT) rotate_icon.$(EXT) scale_icon.$(EXT) smooth_move_icon.$(EXT) width_icon.$(EXT) rectangle_icon.$(EXT) circle_icon.$(EXT) draw_icon.$(EXT) sketch_icon.$(EXT) fill_icon.$(EXT) normal_icon.$(EXT) sif_icon.$(EXT) synfig_icon.$(EXT) saveall_icon.$(EXT) bool_icon.$(EXT) integer_icon.$(EXT) angle_icon.$(EXT) segment_icon.$(EXT) blinepoint_icon.$(EXT) list_icon.$(EXT) canvas_pointer_icon.$(EXT) string_icon.$(EXT) eyedrop_icon.$(EXT) about_icon.$(EXT) about_dialog.$(EXT) canvas_icon.$(EXT) vector_icon.$(EXT) real_icon.$(EXT) color_icon.$(EXT) valuenode_icon.$(EXT) polygon_icon.$(EXT) bline_icon.$(EXT) layer_icon.$(EXT) duplicate_icon.$(EXT) gradient_icon.$(EXT) keyframe_lock_all.$(EXT) keyframe_lock_past.$(EXT) keyframe_lock_future.$(EXT) keyframe_lock_none.$(EXT)
 
 CLEANFILES=$(IMAGES)
 
@@ -22,7 +22,7 @@ PNGTOICO=pngtoico
 CONVERT=convert
 
 sif_icon.ico: $(srcdir)/sif_icon.sif
-       $(SINFG) $< -w 16 -h 16 -o sif_icon_16.gif sif_icon.sif -w 32 -h 32 -o sif_icon_32.gif sif_icon.sif -w 64 -h 64 -o sif_icon_64.gif
+       $(SYNFIG) $< -w 16 -h 16 -o sif_icon_16.gif sif_icon.sif -w 32 -h 32 -o sif_icon_32.gif sif_icon.sif -w 64 -h 64 -o sif_icon_64.gif
        $(CONVERT) sif_icon_16.gif sif_icon_16.png
        $(CONVERT) sif_icon_32.gif sif_icon_32.png
        $(CONVERT) sif_icon_64.gif sif_icon_64.png
@@ -33,43 +33,43 @@ clean:
        $(RM) $(CLEANFILES)
 
 .sif.bmp:
-       $(SINFG) -q $< -o $@ --time 0
+       $(SYNFIG) -q $< -o $@ --time 0
 
 .sif.$(EXT):
-       $(SINFG) -q $< -o $@ --time 0
+       $(SYNFIG) -q $< -o $@ --time 0
 
 keyframe_lock_all.$(EXT): $(srcdir)/keyframe_lock_icon.sif
-       $(SINFG) -q $< -o $@ --time 0
+       $(SYNFIG) -q $< -o $@ --time 0
 
 keyframe_lock_past.$(EXT): $(srcdir)/keyframe_lock_icon.sif
-       $(SINFG) -q $< -o $@ --time 0 -c PastOnly
+       $(SYNFIG) -q $< -o $@ --time 0 -c PastOnly
 
 keyframe_lock_future.$(EXT): $(srcdir)/keyframe_lock_icon.sif
-       $(SINFG) -q $< -o $@ --time 0 -c FutureOnly
+       $(SYNFIG) -q $< -o $@ --time 0 -c FutureOnly
 
 keyframe_lock_none.$(EXT): $(srcdir)/keyframe_lock_icon.sif
-       $(SINFG) -q $< -o $@ --time 0 -c Disabled
+       $(SYNFIG) -q $< -o $@ --time 0 -c Disabled
 
 #.sif.png:
-#      $(SINFG) -q $< -o $@ --time 0
+#      $(SYNFIG) -q $< -o $@ --time 0
        
 #datanode_icon.$(EXT): datanode_icon.sif
-#      $(SINFG) -q datanode_icon.sif -o datanode_icon.$(EXT) -w 128 -h 128 --time 0
+#      $(SYNFIG) -q datanode_icon.sif -o datanode_icon.$(EXT) -w 128 -h 128 --time 0
 
 #color_icon.$(EXT): color_icon.sif
-#      $(SINFG) -q color_icon.sif -o color_icon.$(EXT) -w 128 -h 128 --time 0
+#      $(SYNFIG) -q color_icon.sif -o color_icon.$(EXT) -w 128 -h 128 --time 0
 
 #real_icon.$(EXT): real_icon.sif
-#      $(SINFG) -q real_icon.sif -o real_icon.$(EXT) -w 128 -h 128 --time 0
+#      $(SYNFIG) -q real_icon.sif -o real_icon.$(EXT) -w 128 -h 128 --time 0
 
 #vector_icon.$(EXT): vector_icon.sif
-#      $(SINFG) -q vector_icon.sif -o vector_icon.$(EXT) -w 128 -h 128 --time 0
+#      $(SYNFIG) -q vector_icon.sif -o vector_icon.$(EXT) -w 128 -h 128 --time 0
 
 #about_dialog.$(EXT): about_dialog.sif
-#      $(SINFG) -q about_dialog.sif -o about_dialog.$(EXT) --time 0
+#      $(SYNFIG) -q about_dialog.sif -o about_dialog.$(EXT) --time 0
 
 #about_icon.$(EXT): about_icon.sif
-#      $(SINFG) -q about_icon.sif -o about_icon.$(EXT) -w 128 -h 128 --time 0
+#      $(SYNFIG) -q about_icon.sif -o about_icon.$(EXT) -w 128 -h 128 --time 0
 
 #canvas_icon.$(EXT): canvas_icon.sif
-#      $(SINFG) -q canvas_icon.sif -o canvas_icon.$(EXT) -w 128 -h 128 --time 0
+#      $(SYNFIG) -q canvas_icon.sif -o canvas_icon.$(EXT) -w 128 -h 128 --time 0
index b6add27..0dc9f0d 100644 (file)
               <y>1.2500000000</y>
             </vector>
           </param>
-          <param name="canvas" use="../images/logo.sif#"/>
+          <param name="canvas" use="logo.sif#"/>
           <param name="zoom">
             <real value="-0.2999999925"/>
           </param>
             </color>
           </param>
           <param name="family">
-            <string>times</string>
+            <string guid="ADD7C86FF44B7A2A37637C9E3C8F4315">Times New Roman</string>
           </param>
           <param name="style">
             <integer value="0"/>
             </color>
           </param>
           <param name="family">
-            <string>times</string>
+            <string guid="ADD7C86FF44B7A2A37637C9E3C8F4315">Times New Roman</string>
           </param>
           <param name="style">
             <integer value="0"/>
             </color>
           </param>
           <param name="family">
-            <string>arialbd</string>
+            <string>Arial</string>
           </param>
           <param name="style">
             <integer value="0"/>
diff --git a/synfig-studio/trunk/images/sinfg_icon.sif b/synfig-studio/trunk/images/sinfg_icon.sif
deleted file mode 100644 (file)
index aff3ee3..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
-<canvas version="0.1" width="128" height="128" xres="2952.755900" yres="2952.755900" view-box="-2.000000 2.000000 2.000000 -2.000000" antialias="1" fps="30.000" begin-time="0f" end-time="0f" bgcolor="0.500000 0.500000 0.500000 1.000000">
-  <name>Untitled0</name>
-  <layer type="PasteCanvas" active="true" version="0.1">
-    <param name="z_depth">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="amount">
-      <real value="1.0000000000"/>
-    </param>
-    <param name="blend_method">
-      <integer value="0"/>
-    </param>
-    <param name="origin">
-      <vector>
-        <x>0.0000000000</x>
-        <y>0.0500000007</y>
-      </vector>
-    </param>
-    <param name="canvas" use="./././logo.sif#"/>
-    <param name="zoom">
-      <real value="0.2750000000"/>
-    </param>
-    <param name="time_offset">
-      <time value="0f"/>
-    </param>
-  </layer>
-  <layer type="shade" active="true" version="0.2">
-    <param name="z_depth">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="amount">
-      <real value="0.7500000000"/>
-    </param>
-    <param name="blend_method">
-      <integer value="12"/>
-    </param>
-    <param name="color">
-      <color>
-        <r>0.000000</r>
-        <g>0.000000</g>
-        <b>0.000000</b>
-        <a>1.000000</a>
-      </color>
-    </param>
-    <param name="offset">
-      <vector>
-        <x>0.1000000015</x>
-        <y>-0.1000000015</y>
-      </vector>
-    </param>
-    <param name="size">
-      <vector>
-        <x>0.2000000030</x>
-        <y>0.2000000030</y>
-      </vector>
-    </param>
-    <param name="type">
-      <integer value="1"/>
-    </param>
-    <param name="invert">
-      <bool value="false"/>
-    </param>
-  </layer>
-</canvas>
diff --git a/synfig-studio/trunk/images/synfig_icon.sif b/synfig-studio/trunk/images/synfig_icon.sif
new file mode 100644 (file)
index 0000000..aff3ee3
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<canvas version="0.1" width="128" height="128" xres="2952.755900" yres="2952.755900" view-box="-2.000000 2.000000 2.000000 -2.000000" antialias="1" fps="30.000" begin-time="0f" end-time="0f" bgcolor="0.500000 0.500000 0.500000 1.000000">
+  <name>Untitled0</name>
+  <layer type="PasteCanvas" active="true" version="0.1">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="1.0000000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="0"/>
+    </param>
+    <param name="origin">
+      <vector>
+        <x>0.0000000000</x>
+        <y>0.0500000007</y>
+      </vector>
+    </param>
+    <param name="canvas" use="./././logo.sif#"/>
+    <param name="zoom">
+      <real value="0.2750000000"/>
+    </param>
+    <param name="time_offset">
+      <time value="0f"/>
+    </param>
+  </layer>
+  <layer type="shade" active="true" version="0.2">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="0.7500000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="12"/>
+    </param>
+    <param name="color">
+      <color>
+        <r>0.000000</r>
+        <g>0.000000</g>
+        <b>0.000000</b>
+        <a>1.000000</a>
+      </color>
+    </param>
+    <param name="offset">
+      <vector>
+        <x>0.1000000015</x>
+        <y>-0.1000000015</y>
+      </vector>
+    </param>
+    <param name="size">
+      <vector>
+        <x>0.2000000030</x>
+        <y>0.2000000030</y>
+      </vector>
+    </param>
+    <param name="type">
+      <integer value="1"/>
+    </param>
+    <param name="invert">
+      <bool value="false"/>
+    </param>
+  </layer>
+</canvas>
diff --git a/synfig-studio/trunk/sinfgstudio.desktop.in b/synfig-studio/trunk/sinfgstudio.desktop.in
deleted file mode 100644 (file)
index 5fdeb2e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Name=@PACKAGE_NAME@
-Comment=A Powerful 2D Animation and Composition Package
-Exec=@prefix@/bin/sinfgstudio
-Terminal=1
-Type=Application
-Icon=@prefix@/share/pixmaps/sinfg_icon.@imageext@
-Categories=Application;Graphics;
-StartupNotify=true
-Encoding=UTF-8
-MimeType=image/sif
diff --git a/synfig-studio/trunk/sinfgstudio.keys.in b/synfig-studio/trunk/sinfgstudio.keys.in
deleted file mode 100644 (file)
index 4d4c1c8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-
-image/sif:
-       open=@prefix@/bin/sinfgstudio %f
-       view=@prefix@/bin/sinfgstudio %f
-       icon-filename=@prefix@/share/pixmaps/sif_icon.@imageext@
-       description=SINFG Composition
-       default_action_type=application
-       short_list_application_ids_for_novice_user_level=sinfgstudio
-       short_list_application_ids_for_intermediate_user_level=sinfgstudio
-       short_list_application_ids_for_advanced_user_level=sinfgstudio
-#    category=Images
-                                                                                
-
-image/sifz:
-       open=@prefix@/bin/sinfgstudio %f
-       view=@prefix@/bin/sinfgstudio %f
-       icon-filename=@prefix@/share/pixmaps/sif_icon.@imageext@
-       description=Compressed SINFG Composition
-       default_action_type=application
-       short_list_application_ids_for_novice_user_level=sinfgstudio
-       short_list_application_ids_for_intermediate_user_level=sinfgstudio
-       short_list_application_ids_for_advanced_user_level=sinfgstudio
-#   category=Images
diff --git a/synfig-studio/trunk/sinfgstudio.mime.in b/synfig-studio/trunk/sinfgstudio.mime.in
deleted file mode 100644 (file)
index 1b95060..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# mime types for sinfg studio
-
-image/sif
-       ext: sif SIF
-
-image/sifz
-       ext: sifZ SIFZ sif.gz SIF.GZ SIF.gz
index bd320f4..e82e505 100644 (file)
@@ -3,18 +3,18 @@
 MAINTAINERCLEANFILES=Makefile.in
 EXTRA_DIST=template.cpp template.h
 
-SUBDIRS=sinfgapp gtkmm
+SUBDIRS=synfigapp gtkmm
 
 #if WINDOWSYS_GTKMM
 #WINDOWSYS_LIBS=$(top_builddir)/src/gtkmm/libwindowsys.a @GTKMM_LIBS@
-#SUBDIRS=sinfgapp gtkmm
+#SUBDIRS=synfigapp gtkmm
 #else
 #WINDOWSYS_LIBS=$(top_builddir)/src/win32/libwindowsys.a @WIN32_LIBS@
 #SUBDIRS=win32
 #endif
 
-#bin_PROGRAMS  =       sinfgstudio
-#sinfgstudio_SOURCES = main.cpp app.cpp app.h instance.cpp instance.h actions.cpp actions.h toolbox.cpp toolbox.h compview.cpp compview.h canvasview.cpp canvasview.h workarea.cpp workarea.h canvasproperties.cpp canvasproperties.h
+#bin_PROGRAMS  =       synfigstudio
+#synfigstudio_SOURCES = main.cpp app.cpp app.h instance.cpp instance.h actions.cpp actions.h toolbox.cpp toolbox.h compview.cpp compview.h canvasview.cpp canvasview.h workarea.cpp workarea.h canvasproperties.cpp canvasproperties.h
 # view.h view.cpp workarea.cpp workarea.h toolbox.cpp toolbox.h trackview.cpp trackview.h actions.cpp actions.h compview.cpp compview.h
-#sinfgstudio_LDADD = @SINFG_LIBS@ $(WINDOWSYS_LIBS)
-#sinfgstudio_LDFLAGS=-dlopen self
+#synfigstudio_LDADD = @SYNFIG_LIBS@ $(WINDOWSYS_LIBS)
+#synfigstudio_LDFLAGS=-dlopen self
index c88314f..ac1d071 100644 (file)
@@ -46,8 +46,8 @@ OTHER_CC=statemanager.cpp module.cpp ipc.cpp asyncrenderer.cpp duckmatic.cpp mai
 
 INCLUDES=-I$(top_srcdir)/src
 
-bin_PROGRAMS   =       sinfgstudio
-sinfgstudio_SOURCES = $(MOD_MIRROR_CC) $(MOD_MIRROR_HH) $(PALETTE_CC) $(PALETTE_HH) $(WORKAREARENDERER_CC) $(WORKAREARENDERER_HH) $(ACTION_MANAGERS_HH) $(ACTION_MANAGERS_CC) $(DOCK_HH) $(DOCK_CC) $(OTHER_HH) $(OTHER_CC) $(EVENTS_HH) $(EVENTS_CC) $(DUCKTRANSFORM_HH) $(DUCKTRANSFORM_CC) $(TREEVIEW_HH) $(TREEVIEW_CC) $(TREESTORE_HH) $(TREESTORE_CC) $(STATE_CC) $(STATE_HH) $(WIDGET_CC) $(WIDGET_HH) $(DIALOG_HH) $(DIALOG_CC) $(CELLRENDERER_HH) $(CELLRENDERER_CC) 
-sinfgstudio_LDADD = -L../sinfgapp -lsinfgapp @SINFG_LIBS@ @GTKMM_LIBS@ @FMOD_LIBS@
-sinfgstudio_LDFLAGS=-dlopen self
-sinfgstudio_CXXFLAGS=@SINFG_CFLAGS@ @GTKMM_CFLAGS@
+bin_PROGRAMS   =       synfigstudio
+synfigstudio_SOURCES = $(MOD_MIRROR_CC) $(MOD_MIRROR_HH) $(PALETTE_CC) $(PALETTE_HH) $(WORKAREARENDERER_CC) $(WORKAREARENDERER_HH) $(ACTION_MANAGERS_HH) $(ACTION_MANAGERS_CC) $(DOCK_HH) $(DOCK_CC) $(OTHER_HH) $(OTHER_CC) $(EVENTS_HH) $(EVENTS_CC) $(DUCKTRANSFORM_HH) $(DUCKTRANSFORM_CC) $(TREEVIEW_HH) $(TREEVIEW_CC) $(TREESTORE_HH) $(TREESTORE_CC) $(STATE_CC) $(STATE_HH) $(WIDGET_CC) $(WIDGET_HH) $(DIALOG_HH) $(DIALOG_CC) $(CELLRENDERER_HH) $(CELLRENDERER_CC) 
+synfigstudio_LDADD = -L../synfigapp -lsynfigapp @SYNFIG_LIBS@ @GTKMM_LIBS@ @FMOD_LIBS@
+synfigstudio_LDFLAGS=-dlopen self
+synfigstudio_CXXFLAGS=@SYNFIG_CFLAGS@ @GTKMM_CFLAGS@
index 819ed63..ebf7916 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template File
 ** $Id: about.cpp,v 1.2 2005/01/13 21:11:16 darco Exp $
 **
@@ -38,7 +38,7 @@
 #include <gtkmm/label.h>
 #include <gtkmm/fixed.h>
 
-#include <sinfg/general.h>
+#include <synfig/general.h>
 
 #include "about.h"
 #include "app.h"
@@ -53,7 +53,7 @@ using namespace studio;
 
 #ifndef VERSION
 #define VERSION        "unknown"
-#define PACKAGE        "sinfgstudio"
+#define PACKAGE        "synfigstudio"
 #endif
 
 #ifdef WIN32
@@ -80,7 +80,7 @@ extern      const guint gtk_interface_age;
 
 /* === P R O C E D U R E S ================================================= */
 
-class studio::AboutProgress : public sinfg::ProgressCallback
+class studio::AboutProgress : public synfig::ProgressCallback
 {
        About &about;
        
@@ -176,7 +176,7 @@ About::About():
        Logo->set_padding(0,0);
        
        // Create the Copyright Label
-       Gtk::Label *CopyrightLabel = manage(new class Gtk::Label(SINFG_COPYRIGHT));
+       Gtk::Label *CopyrightLabel = manage(new class Gtk::Label(SYNFIG_COPYRIGHT));
        CopyrightLabel->set_size_request(image_w,24);
        CopyrightLabel->set_alignment(0.5,0.5);
        CopyrightLabel->set_padding(0,0);
@@ -195,8 +195,8 @@ About::About():
        // Set the version label to contain the correct information
        string ver;
        ver+="Version "VERSION" ("__DATE__" "__TIME__")\n";
-       ver+="Using SINFG ";
-       ver+=sinfg::get_version();
+       ver+="Using SYNFIG ";
+       ver+=synfig::get_version();
        #ifdef __GNUC__
                ver+=strprintf(" and GNU G++ %d.%d.%d",__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__);
        #endif
@@ -240,7 +240,7 @@ About::About():
        fixed1->put(*tasklabel, 0, image_h);
 
        // Set up the parameters for this pop-up window
-       set_title("Sinfg Studio "VERSION);
+       set_title("Synfig Studio "VERSION);
        set_modal(false);
        property_window_position().set_value(Gtk::WIN_POS_CENTER);
        set_resizable(false);
@@ -282,7 +282,7 @@ About::set_can_self_destruct(bool x)
                CloseButton->hide();            
 }
 
-sinfg::ProgressCallback *
+synfig::ProgressCallback *
 About::get_callback()
 {
        return cb;
index 1766bfd..b543ee5 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template Header File
 ** $Id: about.h,v 1.1.1.1 2005/01/07 03:34:35 darco Exp $
 **
@@ -20,8 +20,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_ABOUT_H
-#define __SINFG_GTKMM_ABOUT_H
+#ifndef __SYNFIG_GTKMM_ABOUT_H
+#define __SYNFIG_GTKMM_ABOUT_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -38,7 +38,7 @@
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfg { class ProgressCallback; };
+namespace synfig { class ProgressCallback; };
 
 namespace studio {
 
@@ -62,7 +62,7 @@ class About : public Gtk::Window
        
 public:
        
-       sinfg::ProgressCallback *get_callback();        
+       synfig::ProgressCallback *get_callback();       
 
        void set_can_self_destruct(bool x);
 
index 90ca220..105b72b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file adjust_window.cpp
 **     \brief Adjustment Window Implementation File
 **
@@ -37,7 +37,7 @@
 
 using namespace std;
 //using namespace etl;
-//using namespace sinfg;
+//using namespace synfig;
 
 using studio::Adjust_Window;
 
@@ -83,7 +83,7 @@ void Adjust_Window::set_child_adjustment(Gtk::Adjustment *child)
        
        adj_child = child;
        
-       sinfg::info("Adjust: connecting to child signals");
+       synfig::info("Adjust: connecting to child signals");
        if(child)
        {
                childchanged = child->signal_changed().connect(sigc::mem_fun(*this,&Adjust_Window::update_fromchild));
index 5cbf4a4..a638560 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file adjust_window.h
 **     \brief Adjustment Window Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_TEMPLATE_H
-#define __SINFG_TEMPLATE_H
+#ifndef __SYNFIG_TEMPLATE_H
+#define __SYNFIG_TEMPLATE_H
 
 /* === H E A D E R S ======================================================= */
 #include <gtkmm/adjustment.h>
index 49cce74..7295b3e 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file app.cpp
 **     \brief writeme
 **
@@ -43,7 +43,7 @@
 
 #include <gtk/gtk.h>
 
-#include <sinfg/loadcanvas.h>
+#include <synfig/loadcanvas.h>
 
 #include "app.h"
 #include "about.h"
@@ -79,7 +79,7 @@
 
 #include "autorecover.h"
 
-#include <sinfgapp/settings.h>
+#include <synfigapp/settings.h>
 #include "dock_history.h"
 #include "dock_canvases.h"
 #include "dock_keyframes.h"
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -144,7 +144,7 @@ using namespace studio;
 #      define IMAGE_EXT        "tif"
 #endif
 
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 /* === S I G N A L S ======================================================= */
 
@@ -180,11 +180,11 @@ const std::list<std::string>& App::get_recent_files() { return recent_files; }
 int    App::Busy::count;
 bool App::shutdown_in_progress;
 
-sinfg::Gamma App::gamma;
+synfig::Gamma App::gamma;
 
 Glib::RefPtr<studio::UIManager>        App::ui_manager_;
 
-sinfg::Distance::System App::distance_system;
+synfig::Distance::System App::distance_system;
 
 studio::Dialog_Setup* App::dialog_setup;
 
@@ -193,8 +193,8 @@ etl::handle< studio::ModPalette > mod_palette_;
 
 std::list<etl::handle<Instance> > App::instance_list;
 
-static etl::handle<sinfgapp::UIInterface> ui_interface_;
-const etl::handle<sinfgapp::UIInterface>& App::get_ui_interface() { return ui_interface_; }
+static etl::handle<synfigapp::UIInterface> ui_interface_;
+const etl::handle<synfigapp::UIInterface>& App::get_ui_interface() { return ui_interface_; }
 
 etl::handle<Instance> App::selected_instance;
 etl::handle<CanvasView> App::selected_canvas_view;
@@ -238,7 +238,7 @@ static int max_recent_files_=25;
 int studio::App::get_max_recent_files() { return max_recent_files_; }
 void studio::App::set_max_recent_files(int x) { max_recent_files_=x; }
 
-static sinfg::String app_base_path_;
+static synfig::String app_base_path_;
 
 namespace studio {
 }; // END of namespace studio
@@ -247,7 +247,7 @@ studio::StateManager* state_manager;
 
 
 
-class GlobalUIInterface : public sinfgapp::UIInterface
+class GlobalUIInterface : public synfigapp::UIInterface
 {
 public:
 
@@ -484,9 +484,9 @@ int check_license(String basedir)
                        fclose(file);
                }
                else
-                       sinfg::error("Unable to save license key!");
+                       synfig::error("Unable to save license key!");
        }
-       sinfg::info("License Authenticated -- Serial #%05d",serial);
+       synfig::info("License Authenticated -- Serial #%05d",serial);
        return serial;
 }
 
@@ -509,7 +509,7 @@ studio::UIManager::remove_action_group (const Glib::RefPtr<Gtk::ActionGroup>& ac
                        Gtk::UIManager::remove_action_group(action_group);
                        return;
                }
-       sinfg::error("Unable to find action group");
+       synfig::error("Unable to find action group");
 }
 
 void
@@ -527,7 +527,7 @@ studio::add_action_group_to_top(Glib::RefPtr<studio::UIManager> ui_manager, Glib
                DEBUGPOINT();
                if(*iter && (*iter)->get_name()!="menus")
                {
-                       sinfg::info("Removing action group "+(*iter)->get_name());
+                       synfig::info("Removing action group "+(*iter)->get_name());
                        ui_manager->remove_action_group(*iter);
                }
        }
@@ -543,10 +543,10 @@ studio::add_action_group_to_top(Glib::RefPtr<studio::UIManager> ui_manager, Glib
        DEBUGPOINT();
 }
 */
-class Preferences : public sinfgapp::Settings
+class Preferences : public synfigapp::Settings
 {
 public:
-       virtual bool get_value(const sinfg::String& key, sinfg::String& value)const
+       virtual bool get_value(const synfig::String& key, synfig::String& value)const
        {
                if(key=="gamma")
                {
@@ -584,10 +584,10 @@ public:
                        return true;
                }
                
-               return sinfgapp::Settings::get_value(key,value);
+               return synfigapp::Settings::get_value(key,value);
        }
        
-       virtual bool set_value(const sinfg::String& key,const sinfg::String& value)
+       virtual bool set_value(const synfig::String& key,const synfig::String& value)
        {
                if(key=="gamma")
                {
@@ -607,7 +607,7 @@ public:
                if(key=="time_format")
                {
                        int i(atoi(value.c_str()));
-                       App::set_time_format(static_cast<sinfg::Time::Format>(i));
+                       App::set_time_format(static_cast<synfig::Time::Format>(i));
                        return true;
                }
                if(key=="auto_recover_backup_interval")
@@ -634,12 +634,12 @@ public:
                        return true;
                }
                
-               return sinfgapp::Settings::set_value(key,value);
+               return synfigapp::Settings::set_value(key,value);
        }
        
        virtual KeyList get_key_list()const
        {
-               KeyList ret(sinfgapp::Settings::get_key_list());
+               KeyList ret(synfigapp::Settings::get_key_list());
                ret.push_back("gamma");
                ret.push_back("time_format");
                ret.push_back("distance_system");
@@ -674,9 +674,9 @@ init_ui_manager()
        menus_action_group->add( Gtk::Action::create("menu-state", "State") );
        menus_action_group->add( Gtk::Action::create("menu-toolbox", "Toolbox") );
 
-       // Add the sinfgapp actions...
-       sinfgapp::Action::Book::iterator iter;
-       for(iter=sinfgapp::Action::book().begin();iter!=sinfgapp::Action::book().end();++iter)
+       // Add the synfigapp actions...
+       synfigapp::Action::Book::iterator iter;
+       for(iter=synfigapp::Action::book().begin();iter!=synfigapp::Action::book().end();++iter)
        {
                actions_action_group->add(Gtk::Action::create(
                        "action-"+iter->second.name,
@@ -690,15 +690,15 @@ init_ui_manager()
 #define DEFINE_ACTION_SIG(group,x,stock,sig) { Glib::RefPtr<Gtk::Action> action( Gtk::Action::create(x, stock) ); /*action->set_sensitive(false);*/ group->add(action,sig); }
 
        DEFINE_ACTION2("keyframe-properties", Gtk::StockID("gtk-properties"), _("Keyframe Properties"));
-       DEFINE_ACTION("about", Gtk::StockID("sinfg-about"));
+       DEFINE_ACTION("about", Gtk::StockID("synfig-about"));
        DEFINE_ACTION("open", Gtk::Stock::OPEN);
        DEFINE_ACTION("save", Gtk::Stock::SAVE);
        DEFINE_ACTION("save-as", Gtk::Stock::SAVE_AS);
        DEFINE_ACTION("revert", Gtk::Stock::REVERT_TO_SAVED);
-       DEFINE_ACTION("cvs-add", Gtk::StockID("sinfg-cvs_add"));
-       DEFINE_ACTION("cvs-update", Gtk::StockID("sinfg-cvs_update"));
-       DEFINE_ACTION("cvs-commit", Gtk::StockID("sinfg-cvs_commit"));
-       DEFINE_ACTION("cvs-revert", Gtk::StockID("sinfg-cvs_revert"));
+       DEFINE_ACTION("cvs-add", Gtk::StockID("synfig-cvs_add"));
+       DEFINE_ACTION("cvs-update", Gtk::StockID("synfig-cvs_update"));
+       DEFINE_ACTION("cvs-commit", Gtk::StockID("synfig-cvs_commit"));
+       DEFINE_ACTION("cvs-revert", Gtk::StockID("synfig-cvs_revert"));
        DEFINE_ACTION("import", _("Import"));
        DEFINE_ACTION("render", _("Render"));
        DEFINE_ACTION("preview", _("Preview"));
@@ -767,15 +767,15 @@ init_ui_manager()
 #undef DEFINE_ACTION
 
 
-// Set up sinfgapp actions
+// Set up synfigapp actions
        /*{
-               sinfgapp::Action::Book::iterator iter;
+               synfigapp::Action::Book::iterator iter;
        
-               for(iter=sinfgapp::Action::book().begin();iter!=sinfgapp::Action::book().end();++iter)
+               for(iter=synfigapp::Action::book().begin();iter!=synfigapp::Action::book().end();++iter)
                {
                        Gtk::StockID stock_id;
                        
-                       if(!(iter->second.category&sinfgapp::Action::CATEGORY_HIDDEN))
+                       if(!(iter->second.category&synfigapp::Action::CATEGORY_HIDDEN))
                        {
                                //Gtk::Image* image(manage(new Gtk::Image()));
                                if(iter->second.task=="raise")                  stock_id=Gtk::Stock::GO_UP;
@@ -787,7 +787,7 @@ init_ui_manager()
                                else if(iter->second.task=="set_off")   stock_id=Gtk::Stock::NO;
                                //else if(iter->second.task=="duplicate")       stock_id=Gtk::Stock::COPY;
                                else if(iter->second.task=="remove")    stock_id=Gtk::Stock::DELETE;
-                               else                                                                    stock_id=Gtk::StockID("sinfg-"+iter->second.task);
+                               else                                                                    stock_id=Gtk::StockID("synfig-"+iter->second.task);
        
                                actions_action_group->add(Gtk::Action::create(
                                        "action-"+iter->second.name,
@@ -946,7 +946,7 @@ init_ui_manager()
        }
        catch(const Glib::Error& ex)
        {
-               sinfg::error("building menus and toolbars failed: " + ex.what());
+               synfig::error("building menus and toolbars failed: " + ex.what());
        }
 
        // Add default keyboard accelerators
@@ -1051,11 +1051,11 @@ App::App(int *argc, char ***argv):
        if(mkdir(get_user_app_directory().c_str(),ACCESSPERMS)<0)
        {
                if(errno!=EEXIST)
-                       sinfg::error("UNABLE TO CREATE \"%s\"",get_user_app_directory().c_str());
+                       synfig::error("UNABLE TO CREATE \"%s\"",get_user_app_directory().c_str());
        }
        else
        {
-               sinfg::info("Created directory \"%s\"",get_user_app_directory().c_str());
+               synfig::info("Created directory \"%s\"",get_user_app_directory().c_str());
        }
        
        
@@ -1063,50 +1063,50 @@ App::App(int *argc, char ***argv):
        
        try
        {
-               if(!SINFG_CHECK_VERSION())
+               if(!SYNFIG_CHECK_VERSION())
                {
-               cerr<<"FATAL: Sinfg Version Mismatch"<<endl;
-               dialog_error_blocking("SINFG Studio",
-                       "This copy of SINFG Studio was compiled against a\n"
-                       "different version of libsinfg than what is currently\n"
-                       "installed. Sinfg Studio will now abort. Try downloading\n"
-                       "the latest version from the SINFG Development Website at\n"
-                       "http://dev.sinfg.com/ "
+               cerr<<"FATAL: Synfig Version Mismatch"<<endl;
+               dialog_error_blocking("SYNFIG Studio",
+                       "This copy of SYNFIG Studio was compiled against a\n"
+                       "different version of libsynfig than what is currently\n"
+                       "installed. Synfig Studio will now abort. Try downloading\n"
+                       "the latest version from the SYNFIG Development Website at\n"
+                       "http://dev.synfig.com/ "
                );
                throw 40;
                }
        }
-       catch(sinfg::SoftwareExpired)
+       catch(synfig::SoftwareExpired)
        {
                cerr<<"FATAL: Software Expired"<<endl;
-               dialog_error_blocking("SINFG Studio",
-                       "This copy of SINFG Studio has expired.\n"
+               dialog_error_blocking("SYNFIG Studio",
+                       "This copy of SYNFIG Studio has expired.\n"
                        "Please erase this copy, or download and\n"
-                       "install the latest copy from the SINFG\n"
-                       "Development Website at http://dev.sinfg.com/ ."
+                       "install the latest copy from the SYNFIG\n"
+                       "Development Website at http://dev.synfig.com/ ."
                );
                throw 39;
        }
-       Glib::set_application_name(_("SINFG Studio"));
+       Glib::set_application_name(_("SYNFIG Studio"));
        
        About about_window;
        about_window.set_can_self_destruct(false);
        about_window.show();
 
        shutdown_in_progress=false;
-       SuperCallback sinfg_init_cb(about_window.get_callback(),0,9000,10000);
+       SuperCallback synfig_init_cb(about_window.get_callback(),0,9000,10000);
        SuperCallback studio_init_cb(about_window.get_callback(),9000,10000,10000);
        
-       // Initialize the Sinfg library
-       try { sinfgapp_main=etl::smart_ptr<sinfgapp::Main>(new sinfgapp::Main(etl::dirname((*argv)[0]),&sinfg_init_cb)); }
+       // Initialize the Synfig library
+       try { synfigapp_main=etl::smart_ptr<synfigapp::Main>(new synfigapp::Main(etl::dirname((*argv)[0]),&synfig_init_cb)); }
        catch(...)
        {
-               get_ui_interface()->error("Failed to initialize sinfg!");
+               get_ui_interface()->error("Failed to initialize synfig!");
                throw;
        }
 
        // add the preferences to the settings
-       sinfgapp::Main::settings().add_domain(&_preferences,"pref");
+       synfigapp::Main::settings().add_domain(&_preferences,"pref");
        
        try
        {
@@ -1236,11 +1236,11 @@ App::App(int *argc, char ***argv):
                        if(
                                get_ui_interface()->yes_no(
                                        "Auto Recovery",
-                                       "SINFG Studio seems to have crashed\n"
+                                       "SYNFIG Studio seems to have crashed\n"
                                        "before you could save all your files.\n"
                                        "Would you like to re-open those files\n"
                                        "and recover your unsaved changes?"
-                               )==sinfgapp::UIInterface::RESPONSE_YES
+                               )==synfigapp::UIInterface::RESPONSE_YES
                        )
                        {
                                if(!auto_recover->recover())
@@ -1249,7 +1249,7 @@ App::App(int *argc, char ***argv):
                                }
                                else
                                get_ui_interface()->error(
-                                       _("SINFG Studio has attempted to recover\n"
+                                       _("SYNFIG Studio has attempted to recover\n"
                                        "from a previous crash. The files that it has\n"
                                        "recovered are NOT YET SAVED. It would be a good\n"
                                        "idea to review them and save them now.")
@@ -1288,7 +1288,7 @@ App::~App()
 
        save_settings();
 
-       sinfgapp::Main::settings().remove_domain("pref");
+       synfigapp::Main::settings().remove_domain("pref");
        
        selected_instance=0;
 
@@ -1329,11 +1329,15 @@ App::~App()
 String
 App::get_user_app_directory()
 {
-       return Glib::build_filename(Glib::get_home_dir(),"sinfg");
+#ifdef __APPLE__
+       return Glib::build_filename(Glib::get_home_dir(),"Library/Synfig");
+#else
+       return Glib::build_filename(Glib::get_home_dir(),"Synfig");
+#endif
 }
 
-sinfg::String
-App::get_config_file(const sinfg::String& file)
+synfig::String
+App::get_config_file(const synfig::String& file)
 {
        return Glib::build_filename(get_user_app_directory(),file);
 }
@@ -1388,7 +1392,7 @@ App::get_time_format()
 }
 
 void
-App::set_time_format(sinfg::Time::Format x)
+App::set_time_format(synfig::Time::Format x)
 {
        _App_time_format=x;
 }
@@ -1410,7 +1414,7 @@ App::save_settings()
                
                        if(!file)
                        {
-                               sinfg::warning("Unable to save %s",filename.c_str());
+                               synfig::warning("Unable to save %s",filename.c_str());
                                break;
                        }
                
@@ -1421,11 +1425,11 @@ App::save_settings()
                }while(0);
 
                std::string filename=get_config_file("settings");
-               sinfgapp::Main::settings().save_to_file(filename);
+               synfigapp::Main::settings().save_to_file(filename);
        }
        catch(...)
        {
-               sinfg::warning("Caught exception when attempting to save settings.");
+               synfig::warning("Caught exception when attempting to save settings.");
        }
 }
 
@@ -1452,32 +1456,32 @@ App::load_settings()
                        }
                }
                std::string filename=get_config_file("settings");
-               if(!sinfgapp::Main::settings().load_from_file(filename))
+               if(!synfigapp::Main::settings().load_from_file(filename))
                {
-                       //std::string filename=Glib::build_filename(Glib::get_home_dir(),".sinfgrc");
-                       //if(!sinfgapp::Main::settings().load_from_file(filename))
+                       //std::string filename=Glib::build_filename(Glib::get_home_dir(),".synfigrc");
+                       //if(!synfigapp::Main::settings().load_from_file(filename))
                        {
                                gamma.set_gamma(1.0/2.2);
-                               sinfgapp::Main::settings().set_value("dock.dialog.1.comp_selector","1");
-                               sinfgapp::Main::settings().set_value("dock.dialog.1.contents","navigator - info pal_edit pal_browse - tool_options history canvases - layers groups");
-                               sinfgapp::Main::settings().set_value("dock.dialog.1.contents_size","225 167 207");
-                               sinfgapp::Main::settings().set_value("dock.dialog.1.pos","1057 32");
-                               sinfgapp::Main::settings().set_value("dock.dialog.1.size","208 1174");
-                               sinfgapp::Main::settings().set_value("dock.dialog.2.comp_selector","0");
-                               sinfgapp::Main::settings().set_value("dock.dialog.2.contents","params children keyframes | timetrack curves meta_data");
-                               sinfgapp::Main::settings().set_value("dock.dialog.2.contents_size","263");
-                               sinfgapp::Main::settings().set_value("dock.dialog.2.pos","0 973");
-                               sinfgapp::Main::settings().set_value("dock.dialog.2.size","1045 235");
-                               sinfgapp::Main::settings().set_value("pref.distance_system","pt");
-                               sinfgapp::Main::settings().set_value("pref.use_colorspace_gamma","1");
-                               sinfgapp::Main::settings().set_value("window.toolbox.pos","4 4");
+                               synfigapp::Main::settings().set_value("dock.dialog.1.comp_selector","1");
+                               synfigapp::Main::settings().set_value("dock.dialog.1.contents","navigator - info pal_edit pal_browse - tool_options history canvases - layers groups");
+                               synfigapp::Main::settings().set_value("dock.dialog.1.contents_size","225 167 207");
+                               synfigapp::Main::settings().set_value("dock.dialog.1.pos","1057 32");
+                               synfigapp::Main::settings().set_value("dock.dialog.1.size","208 1174");
+                               synfigapp::Main::settings().set_value("dock.dialog.2.comp_selector","0");
+                               synfigapp::Main::settings().set_value("dock.dialog.2.contents","params children keyframes | timetrack curves meta_data");
+                               synfigapp::Main::settings().set_value("dock.dialog.2.contents_size","263");
+                               synfigapp::Main::settings().set_value("dock.dialog.2.pos","0 973");
+                               synfigapp::Main::settings().set_value("dock.dialog.2.size","1045 235");
+                               synfigapp::Main::settings().set_value("pref.distance_system","pt");
+                               synfigapp::Main::settings().set_value("pref.use_colorspace_gamma","1");
+                               synfigapp::Main::settings().set_value("window.toolbox.pos","4 4");
                        }
                }
                
        }
        catch(...)
        {
-               sinfg::warning("Caught exception when attempting to load settings.");
+               synfig::warning("Caught exception when attempting to load settings.");
        }
 }
 
@@ -1509,20 +1513,20 @@ App::quit()
                        return;
 
 /*
-               if((*iter)->sinfgapp::Instance::get_action_count())
+               if((*iter)->synfigapp::Instance::get_action_count())
                {
-                       handle<sinfgapp::UIInterface> uim;
+                       handle<synfigapp::UIInterface> uim;
                        uim=(*iter)->find_canvas_view((*iter)->get_canvas())->get_ui_interface();
                        assert(uim);
                        string str=strprintf(_("Would you like to save your changes to %s?"),(*iter)->get_file_name().c_str() );
-                       switch(uim->yes_no_cancel((*iter)->get_canvas()->get_name(),str,sinfgapp::UIInterface::RESPONSE_YES))
+                       switch(uim->yes_no_cancel((*iter)->get_canvas()->get_name(),str,synfigapp::UIInterface::RESPONSE_YES))
                        {
-                               case sinfgapp::UIInterface::RESPONSE_NO:
+                               case synfigapp::UIInterface::RESPONSE_NO:
                                        break;
-                               case sinfgapp::UIInterface::RESPONSE_YES:
+                               case synfigapp::UIInterface::RESPONSE_YES:
                                        (*iter)->save();
                                        break;
-                               case sinfgapp::UIInterface::RESPONSE_CANCEL:
+                               case synfigapp::UIInterface::RESPONSE_CANCEL:
                                        return;
                                default:
                                        assert(0);
@@ -1531,20 +1535,20 @@ App::quit()
                }
 
 
-               if((*iter)->sinfgapp::Instance::is_modified())
+               if((*iter)->synfigapp::Instance::is_modified())
                {
-                       handle<sinfgapp::UIInterface> uim;
+                       handle<synfigapp::UIInterface> uim;
                        uim=(*iter)->find_canvas_view((*iter)->get_canvas())->get_ui_interface();
                        assert(uim);
                        string str=strprintf(_("%s has changes not yet on the CVS repository.\nWould you like to commit these changes?"),(*iter)->get_file_name().c_str() );
-                       switch(uim->yes_no_cancel((*iter)->get_canvas()->get_name(),str,sinfgapp::UIInterface::RESPONSE_YES))
+                       switch(uim->yes_no_cancel((*iter)->get_canvas()->get_name(),str,synfigapp::UIInterface::RESPONSE_YES))
                        {
-                               case sinfgapp::UIInterface::RESPONSE_NO:
+                               case synfigapp::UIInterface::RESPONSE_NO:
                                        break;
-                               case sinfgapp::UIInterface::RESPONSE_YES:
+                               case synfigapp::UIInterface::RESPONSE_YES:
                                        (*iter)->dialog_cvs_commit();
                                        break;
-                               case sinfgapp::UIInterface::RESPONSE_CANCEL:
+                               case synfigapp::UIInterface::RESPONSE_CANCEL:
                                        return;
                                default:
                                        assert(0);
@@ -1637,7 +1641,7 @@ App::dialog_open_file(const std::string &title, std::string &filename)
        return false;
        
 #else
-       sinfg::String prev_path;
+       synfig::String prev_path;
        if(!_preferences.get_value("curr_path",prev_path))
                prev_path=".";
        
@@ -1919,7 +1923,7 @@ App::open_as(std::string filename,std::string as)
        {
                OneMoment one_moment;
        
-               etl::handle<sinfg::Canvas> canvas(open_canvas_as(filename,as));
+               etl::handle<synfig::Canvas> canvas(open_canvas_as(filename,as));
                if(canvas && get_instance(canvas))
                {
                        get_instance(canvas)->find_canvas_view(canvas)->present();
@@ -1960,7 +1964,7 @@ App::open_as(std::string filename,std::string as)
 void
 App::new_instance()
 {
-       handle<sinfg::Canvas> canvas=sinfg::Canvas::create();
+       handle<synfig::Canvas> canvas=synfig::Canvas::create();
        canvas->set_name(strprintf("Untitled%d",Instance::get_count()));
 
        String file_name(strprintf("untitled%d.sif",Instance::get_count()));
@@ -2084,7 +2088,7 @@ studio::App::redo()
                selected_instance->redo();
 }
 
-sinfg::String
+synfig::String
 studio::App::get_base_path()
 {
        return app_base_path_;
index decaaf8..0359794 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file app.h
 **     \brief writeme
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_APP_H
-#define __SINFG_STUDIO_APP_H
+#ifndef __SYNFIG_STUDIO_APP_H
+#define __SYNFIG_STUDIO_APP_H
 
 /* === H E A D E R S ======================================================= */
 
 
 #include <ETL/smart_ptr>
 
-#include <sinfg/distance.h>
-#include <sinfg/string.h>
-#include <sinfg/time.h>
+#include <synfig/distance.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
 
 #include <gtkmm/uimanager.h>
 
-#include <sinfgapp/instance.h>
+#include <synfigapp/instance.h>
 #include "iconcontroler.h"
 
 /* === M A C R O S ========================================================= */
@@ -57,7 +57,7 @@ namespace Gtk
        class ActionGroup;
 };
 
-namespace sinfgapp
+namespace synfigapp
 {
        class UIInterface;
        class Main;
@@ -123,7 +123,7 @@ public:
        */
 
 private:
-       //static etl::handle<sinfgapp::UIInterface> ui_interface_;
+       //static etl::handle<synfigapp::UIInterface> ui_interface_;
        //static int max_recent_files;
 
 /*
@@ -141,7 +141,7 @@ private:
        static IPC *ipc;
 */
 
-       etl::smart_ptr<sinfgapp::Main> sinfgapp_main;
+       etl::smart_ptr<synfigapp::Main> synfigapp_main;
 
 
        static etl::handle<Instance> selected_instance;
@@ -170,9 +170,9 @@ public:
 //     static Dialog_Palette* dialog_palette;
        static Dialog_ToolOptions *dialog_tool_options;
 
-       static sinfg::Distance::System distance_system;
+       static synfig::Distance::System distance_system;
 
-       static sinfg::Gamma gamma;
+       static synfig::Gamma gamma;
 
        static Toolbox *toolbox;
 
@@ -258,19 +258,19 @@ public:
 
        static void add_recent_file(const std::string &filename);
 
-       static sinfg::String get_base_path();
+       static synfig::String get_base_path();
        static void save_settings();
        static void load_settings();
 
        static const std::list<std::string>& get_recent_files();
 
-       static const etl::handle<sinfgapp::UIInterface>& get_ui_interface();
+       static const etl::handle<synfigapp::UIInterface>& get_ui_interface();
 
 
        static void set_selected_instance(etl::loose_handle<Instance> instance);
        static void set_selected_canvas_view(etl::loose_handle<CanvasView>);
 
-       static etl::loose_handle<Instance> get_instance(etl::handle<sinfg::Canvas> canvas);
+       static etl::loose_handle<Instance> get_instance(etl::handle<synfig::Canvas> canvas);
 
        static etl::loose_handle<Instance> get_selected_instance() { return selected_instance; }
        static etl::loose_handle<CanvasView> get_selected_canvas_view() { return selected_canvas_view; }
@@ -296,8 +296,8 @@ public:
        static void set_max_recent_files(int x);
 
 
-       static sinfg::Time::Format get_time_format();
-       static void set_time_format(sinfg::Time::Format x);
+       static synfig::Time::Format get_time_format();
+       static void set_time_format(synfig::Time::Format x);
 
        static bool shutdown_request(GdkEventAny*bleh=NULL);
        
@@ -319,8 +319,8 @@ public:
        
        static void dialog_not_implemented();
 
-       static sinfg::String get_user_app_directory();
-       static sinfg::String get_config_file(const sinfg::String& file);
+       static synfig::String get_user_app_directory();
+       static synfig::String get_config_file(const synfig::String& file);
 }; // END of class App
 
 }; // END namespace studio
index 9c41444..900f24d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file asyncrenderer.cpp
 **     \brief Template File
 **
@@ -48,7 +48,7 @@
 #include <signal.h>
 #endif
 
-#include <sinfg/general.h>
+#include <synfig/general.h>
 #include <ETL/clock>
 
 #endif
@@ -57,7 +57,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 #define BOREDOM_TIMEOUT                50
@@ -70,10 +70,10 @@ using namespace studio;
 
 /* === C L A S S E S ======================================================= */
 
-class AsyncTarget_Tile : public sinfg::Target_Tile
+class AsyncTarget_Tile : public synfig::Target_Tile
 {
 public:
-       etl::handle<sinfg::Target_Tile> warm_target;
+       etl::handle<synfig::Target_Tile> warm_target;
        
        struct tile_t
        {
@@ -97,7 +97,7 @@ public:
        sigc::connection ready_connection;
        
 public:
-       AsyncTarget_Tile(etl::handle<sinfg::Target_Tile> warm_target):
+       AsyncTarget_Tile(etl::handle<synfig::Target_Tile> warm_target):
                warm_target(warm_target)
        {
                set_avoid_time_sync(warm_target->get_avoid_time_sync());
@@ -145,14 +145,14 @@ public:
                return warm_target->next_frame(time);
        }
        
-       virtual bool start_frame(sinfg::ProgressCallback *cb=0)
+       virtual bool start_frame(synfig::ProgressCallback *cb=0)
        {
                if(!alive_flag)
                        return false;
                return warm_target->start_frame(cb);
        }
        
-       virtual bool add_tile(const sinfg::Surface &surface, int gx, int gy)
+       virtual bool add_tile(const synfig::Surface &surface, int gx, int gy)
        {
                assert(surface);
                if(!alive_flag)
@@ -219,10 +219,10 @@ public:
 
 
 
-class AsyncTarget_Scanline : public sinfg::Target_Scanline
+class AsyncTarget_Scanline : public synfig::Target_Scanline
 {
 public:
-       etl::handle<sinfg::Target_Scanline> warm_target;
+       etl::handle<synfig::Target_Scanline> warm_target;
        
        int scanline_;
        Surface surface;
@@ -239,7 +239,7 @@ public:
 
 
 public:
-       AsyncTarget_Scanline(etl::handle<sinfg::Target_Scanline> warm_target):
+       AsyncTarget_Scanline(etl::handle<synfig::Target_Scanline> warm_target):
                warm_target(warm_target)
        {
                set_avoid_time_sync(warm_target->get_avoid_time_sync());
@@ -274,7 +274,7 @@ public:
                alive_flag=false;
        }
        
-       virtual bool start_frame(sinfg::ProgressCallback *cb=0)
+       virtual bool start_frame(synfig::ProgressCallback *cb=0)
        {               
                return alive_flag;
        }
@@ -338,27 +338,27 @@ public:
 
 /* === M E T H O D S ======================================================= */
 
-AsyncRenderer::AsyncRenderer(etl::handle<sinfg::Target> target_,sinfg::ProgressCallback *cb):
+AsyncRenderer::AsyncRenderer(etl::handle<synfig::Target> target_,synfig::ProgressCallback *cb):
        error(false),
        success(false),
        cb(cb)
 {
        render_thread=0;
-       if(etl::handle<sinfg::Target_Tile>::cast_dynamic(target_))
+       if(etl::handle<synfig::Target_Tile>::cast_dynamic(target_))
        {
                etl::handle<AsyncTarget_Tile> wrap_target(
-                       new AsyncTarget_Tile(etl::handle<sinfg::Target_Tile>::cast_dynamic(target_))
+                       new AsyncTarget_Tile(etl::handle<synfig::Target_Tile>::cast_dynamic(target_))
                );
                
                signal_stop_.connect(sigc::mem_fun(*wrap_target,&AsyncTarget_Tile::set_dead));
                
                target=wrap_target;
        }
-       else if(etl::handle<sinfg::Target_Scanline>::cast_dynamic(target_))
+       else if(etl::handle<synfig::Target_Scanline>::cast_dynamic(target_))
        {
                etl::handle<AsyncTarget_Scanline> wrap_target(
                        new AsyncTarget_Scanline(
-                               etl::handle<sinfg::Target_Scanline>::cast_dynamic(target_)
+                               etl::handle<synfig::Target_Scanline>::cast_dynamic(target_)
                        )
                );
        
index f9721c9..028fa1e 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file asyncrenderer.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_ASYNCRENDERER_H
-#define __SINFG_ASYNCRENDERER_H
+#ifndef __SYNFIG_ASYNCRENDERER_H
+#define __SYNFIG_ASYNCRENDERER_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -31,9 +31,9 @@
 #include <sigc++/trackable.h>
 #include <sigc++/connection.h>
 
-#include <sinfg/target_scanline.h>
-#include <sinfg/target_tile.h>
-#include <sinfg/surface.h>
+#include <synfig/target_scanline.h>
+#include <synfig/target_tile.h>
+#include <synfig/surface.h>
 #include <glibmm/main.h>
 #include <ETL/ref_count>
 #include <glibmm/thread.h>
@@ -54,14 +54,14 @@ class AsyncRenderer : public etl::shared_object, public sigc::trackable
 
        std::list<sigc::connection> activity_connection_list;
        
-       //etl::handle<sinfg::Target_Scanline> target_scanline;
-       //etl::handle<sinfg::Target_Tile> target_tile;
-       etl::handle<sinfg::Target> target;
+       //etl::handle<synfig::Target_Scanline> target_scanline;
+       //etl::handle<synfig::Target_Tile> target_tile;
+       etl::handle<synfig::Target> target;
 
        bool error;
        bool success;
        
-       sinfg::ProgressCallback *cb;
+       synfig::ProgressCallback *cb;
        
        sigc::signal<void> signal_stop_;
 
@@ -75,7 +75,7 @@ class AsyncRenderer : public etl::shared_object, public sigc::trackable
        */
 public:
 
-       AsyncRenderer(etl::handle<sinfg::Target> target,sinfg::ProgressCallback *cb=0);
+       AsyncRenderer(etl::handle<synfig::Target> target,synfig::ProgressCallback *cb=0);
        virtual ~AsyncRenderer();
 
        void start();
index dd3b295..5beeb32 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file audiocontainer.cpp
 **     \brief Audio Container implementation File
 **
@@ -36,7 +36,7 @@
 //#include <ETL/thread>
 #include <glibmm/thread.h>
 
-#include <sinfg/general.h>
+#include <synfig/general.h>
 
 #include <glibmm/main.h>
 
@@ -59,7 +59,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 
 /* === M A C R O S ========================================================= */
 #ifdef __WIN32
@@ -89,7 +89,7 @@ bool build_profile(FSOUND_SAMPLE *sample, double &samplerate, std::vector<char>
        //trivial rejection...
        if(!sample || sps < 1)
        {
-               sinfg::warning("build_profile: Sample rate was too low or sample was invalid");
+               synfig::warning("build_profile: Sample rate was too low or sample was invalid");
                return false;
        }
        
@@ -116,7 +116,7 @@ bool build_profile(FSOUND_SAMPLE *sample, double &samplerate, std::vector<char>
        
        if(sizeall <= 0)
        {
-               sinfg::warning("ProfileAudio: Sample buffer cannot be size smaller than 1 (%X)",FSOUND_GetError());
+               synfig::warning("ProfileAudio: Sample buffer cannot be size smaller than 1 (%X)",FSOUND_GetError());
                return false;
        }
        
@@ -126,7 +126,7 @@ bool build_profile(FSOUND_SAMPLE *sample, double &samplerate, std::vector<char>
        float stride = allsamplerate/(float)sps;
        
        //down sampling to 8 bit min/max values 
-       sinfg::warning("About to downsample from %d Hz to %.1f Hz, sample stride: %f", allsamplerate, sps, stride);
+       synfig::warning("About to downsample from %d Hz to %.1f Hz, sample stride: %f", allsamplerate, sps, stride);
        
        char *sampledata=0,*useless = 0;
        unsigned int len1,len2;
@@ -134,10 +134,10 @@ bool build_profile(FSOUND_SAMPLE *sample, double &samplerate, std::vector<char>
        {
                if(!FSOUND_Sample_Lock(sample,0,sizeall,(void**)&sampledata,(void**)&useless,&len1,&len2))
                {
-                       sinfg::warning("ProfileAudio: Unable to lock the sound buffer... (%X)",FSOUND_GetError());
+                       synfig::warning("ProfileAudio: Unable to lock the sound buffer... (%X)",FSOUND_GetError());
                        return false;
                }
-               sinfg::warning("Locked: %X: %d bytes, %X: %d bytes",sampledata,len1,useless,len2);
+               synfig::warning("Locked: %X: %d bytes, %X: %d bytes",sampledata,len1,useless,len2);
                
                if(channelsize == 1)
                {
@@ -154,7 +154,7 @@ bool build_profile(FSOUND_SAMPLE *sample, double &samplerate, std::vector<char>
                        int i = 0;
                        
                        //HACK - to prevent if statement inside inner loop
-                       //sinfg::warning("wo baby wo baby, inc: %d, stride: %f, size: %d", inc, stride, sizeall);
+                       //synfig::warning("wo baby wo baby, inc: %d, stride: %f, size: %d", inc, stride, sizeall);
                        while(iter < end)
                        {
                                int maxs = 0, mins = 0;
@@ -189,7 +189,7 @@ bool build_profile(FSOUND_SAMPLE *sample, double &samplerate, std::vector<char>
                        int i = 0;
                        
                        //HACK - to prevent if statement inside inner loop
-                       //sinfg::warning("wo baby wo baby, inc: %d, stride: %f, size: %d", inc, stride, sizeall);
+                       //synfig::warning("wo baby wo baby, inc: %d, stride: %f, size: %d", inc, stride, sizeall);
                        while(iter < end)
                        {
                                int maxs = 0, mins = 0;
@@ -212,12 +212,12 @@ bool build_profile(FSOUND_SAMPLE *sample, double &samplerate, std::vector<char>
                }
        }
        
-       sinfg::warning("Stats: %f seconds with %d bytes now %d bytes", (samples.size()/2)/sps, sizeall, samples.size());
-       sinfg::warning("                %f seconds before", numsamples/(float)allsamplerate);
+       synfig::warning("Stats: %f seconds with %d bytes now %d bytes", (samples.size()/2)/sps, sizeall, samples.size());
+       synfig::warning("               %f seconds before", numsamples/(float)allsamplerate);
        
        //we're done yay!, unlock
        FSOUND_Sample_Unlock(sample,sampledata,useless,len1,len2);
-       sinfg::info("Unlocked");
+       synfig::info("Unlocked");
        
        //FSOUND_PlaySound(FSOUND_FREE,sound); //test
        
@@ -433,7 +433,7 @@ struct scrubinfo
                        FSOUND_SetPaused(channel,true);
                }else
                {
-                       //sinfg::info("DSP f = %d Hz", freq);
+                       //synfig::info("DSP f = %d Hz", freq);
                        FSOUND_SetPaused(channel,false);
                        if(!FSOUND_SetFrequency(channel,freq))
                        {
@@ -515,7 +515,7 @@ void * scrubdspwrap(void *originalbuffer, void *newbuffer, int length, void *use
                }
        }
        
-       //sinfg::info(dsp);
+       //synfig::info(dsp);
 
        return newbuffer;
 }
@@ -539,21 +539,21 @@ public:
                if(!loaded)
                {
                        #ifdef WITH_FMOD
-                       sinfg::info("Initializing FMOD on demand...");
+                       synfig::info("Initializing FMOD on demand...");
                        
                        {
                                FSOUND_SetOutput(AUDIO_OUTPUT);
                                
                                /*int numdrivers = FSOUND_GetNumDrivers();
-                               sinfg::info("Num FMOD drivers = %d",numdrivers);
-                               sinfg::info("Current Driver is #%d", FSOUND_GetDriver());
+                               synfig::info("Num FMOD drivers = %d",numdrivers);
+                               synfig::info("Current Driver is #%d", FSOUND_GetDriver());
                                
                                for(int i = 0; i < numdrivers; ++i)
                                {
                                        unsigned int caps = 0;
                                        FSOUND_GetDriverCaps(i,&caps);
                                        
-                                       sinfg::info("   Caps for driver %d (%s) = %x",i,FSOUND_GetDriverName(i),caps);
+                                       synfig::info("   Caps for driver %d (%s) = %x",i,FSOUND_GetDriverName(i),caps);
                                }
                                
                                FSOUND_SetDriver(0);*/
@@ -563,7 +563,7 @@ public:
                                
                                if(!FSOUND_Init(44100, 32, 0))
                                {
-                                       sinfg::warning("Unable to load FMOD");
+                                       synfig::warning("Unable to load FMOD");
                                }else
                                {
                                        loaded = true;
@@ -580,18 +580,18 @@ public:
                
                //add to the refcount
                ++refcount;
-               //sinfg::info("Audio: increment fmod refcount %d", refcount);
+               //synfig::info("Audio: increment fmod refcount %d", refcount);
        }
        
        void decref()
        {
                if(refcount <= 0)
                {
-                       sinfg::warning("FMOD refcount is already 0...");
+                       synfig::warning("FMOD refcount is already 0...");
                }else
                {
                        --refcount;
-                       //sinfg::info("Audio: decrement fmod refcount %d", refcount);
+                       //synfig::info("Audio: decrement fmod refcount %d", refcount);
                        
                        //NOTE: UNCOMMENT THIS IF YOU WANT FMOD TO UNLOAD ITSELF WHEN IT ISN'T NEEDED ANYMORE...
                        flush();
@@ -611,7 +611,7 @@ public:
                if(loaded && refcount <= 0)
                {
                        #ifdef WITH_FMOD
-                       sinfg::info("Unloading FMOD");
+                       synfig::info("Unloading FMOD");
                        if(scrubdspunit) FSOUND_DSP_Free(scrubdspunit);
                        FSOUND_Close();                 
                        #endif
@@ -706,7 +706,7 @@ struct studio::AudioContainer::AudioImp
                                channel = FSOUND_PlaySoundEx(FSOUND_FREE,sample,0,true);
                                if(channel < 0 || FSOUND_GetError() != FMOD_ERR_NONE)
                                {
-                                       sinfg::warning("Could not play the sample...");
+                                       synfig::warning("Could not play the sample...");
                                        return false;
                                }
                        }
@@ -856,11 +856,11 @@ handle<studio::AudioProfile> studio::AudioContainer::get_profile(float samplerat
        //if we already have done our work, then we're good
        if(profilevalid && prof)
        {
-               //sinfg::info("Using already built profile");
+               //synfig::info("Using already built profile");
                return prof;
        }
        
-       //sinfg::info("Before profile");
+       //synfig::info("Before profile");
        //make a new profile at current sample rate
        
        //NOTE: We might want to reuse the structure already there...   
@@ -869,18 +869,18 @@ handle<studio::AudioProfile> studio::AudioContainer::get_profile(float samplerat
        
        if(!prof)
        {
-               sinfg::warning("Couldn't allocate audioprofile...");
+               synfig::warning("Couldn't allocate audioprofile...");
                return handle<studio::AudioProfile>();
        }
        
        //setting the info for the sample rate
-       //sinfg::info("Setting info...");
+       //synfig::info("Setting info...");
        
-       sinfg::info("Building Profile...");
+       synfig::info("Building Profile...");
        prof->samplerate = samplerate;
        if(build_profile(imp->sample,prof->samplerate,prof->samples))
        {
-               sinfg::info("   Success!");
+               synfig::info("  Success!");
                profilevalid = true;
                return prof;
        }else
@@ -1001,22 +1001,22 @@ bool studio::AudioContainer::AudioImp::load(const std::string &filename,
        if(!is_absolute_path(file))
        {
                file=filedirectory+filename;
-               sinfg::warning("Not absolute hoooray");
+               synfig::warning("Not absolute hoooray");
        }
-       sinfg::info("Loading Audio file: %s", file.c_str());
+       synfig::info("Loading Audio file: %s", file.c_str());
        
        //check to see if file exists
        {
                struct stat     s;
                if(stat(file.c_str(),&s) == -1 && errno == ENOENT)
                {
-                       sinfg::info("There was no audio file...");                      
+                       synfig::info("There was no audio file...");                     
                        return false;
                }
        }
        
        //load fmod if we can...
-       //sinfg::warning("I'm compiled with FMOD!");
+       //synfig::warning("I'm compiled with FMOD!");
        fmodinit.addref();
        
        //load the stream
@@ -1025,15 +1025,15 @@ bool studio::AudioContainer::AudioImp::load(const std::string &filename,
        
        if(!sm)
        {
-               sinfg::warning("Could not open the audio file as a sample: %s",file.c_str());
+               synfig::warning("Could not open the audio file as a sample: %s",file.c_str());
                goto error;
        }
        
-       //sinfg::warning("Opened a file as a sample! :)");
+       //synfig::warning("Opened a file as a sample! :)");
        
        /*{
                int bufferlen = FSOUND_DSP_GetBufferLength();
-               sinfg::info("Buffer length = %d samples, %.3lf s",bufferlen, bufferlen / (double)FSOUND_GetOutputRate());
+               synfig::info("Buffer length = %d samples, %.3lf s",bufferlen, bufferlen / (double)FSOUND_GetOutputRate());
        }*/
        
        //set all the variables since everything has worked out...
@@ -1045,12 +1045,12 @@ bool studio::AudioContainer::AudioImp::load(const std::string &filename,
                FSOUND_Sample_GetDefaults(sm,&sfreq,&volume,0,0);
                
                //double len = length / (double)sfreq;          
-               //sinfg::info("Sound info: %.2lf s long, %d Hz, %d Vol",(double)length,sfreq,volume);
+               //synfig::info("Sound info: %.2lf s long, %d Hz, %d Vol",(double)length,sfreq,volume);
        }
        
-       //sinfg::warning("Got all info, and setting up everything, %.2f sec.", length);
-       //sinfg::warning("      BigSample: composed of %d samples", FSOUND_Sample_GetLength(sm));
-       sinfg::info("Successfully opened %s as a sample and initialized it.",file.c_str());
+       //synfig::warning("Got all info, and setting up everything, %.2f sec.", length);
+       //synfig::warning("     BigSample: composed of %d samples", FSOUND_Sample_GetLength(sm));
+       synfig::info("Successfully opened %s as a sample and initialized it.",file.c_str());
        
        //set up the playable info
        sample = sm;
@@ -1088,7 +1088,7 @@ void studio::AudioContainer::AudioImp::play(double t)
        if(t < 0)
        {
                unsigned int timeout = (int)floor(-t * 1000 + 0.5);
-               //sinfg::info("Playing audio delayed by %d ms",timeout);
+               //synfig::info("Playing audio delayed by %d ms",timeout);
                //delay for t seconds...
                delaycon = Glib::signal_timeout().connect(
                                                sigc::mem_fun(*this,&studio::AudioContainer::AudioImp::start_playing_now),timeout);             
@@ -1103,7 +1103,7 @@ void studio::AudioContainer::AudioImp::play(double t)
        
        if(position >= FSOUND_Sample_GetLength(sample))
        {
-               sinfg::warning("Can't play audio when past length...");
+               synfig::warning("Can't play audio when past length...");
                return;
        }
        
@@ -1112,7 +1112,7 @@ void studio::AudioContainer::AudioImp::play(double t)
        FSOUND_SetCurrentPosition(channel,position);
        FSOUND_SetPaused(channel,false);
        
-       //sinfg::info("Playing audio with position %d samples",position);
+       //synfig::info("Playing audio with position %d samples",position);
        
        #endif          
 }
@@ -1162,7 +1162,7 @@ void studio::AudioContainer::AudioImp::clear()
 
 void AudioContainer::AudioImp::start_scrubbing(double t)
 {
-       //sinfg::info("Start scrubbing: %lf", t);
+       //synfig::info("Start scrubbing: %lf", t);
        if(playing) stop();
                        
        set_scrubbing(true);
@@ -1199,21 +1199,21 @@ void AudioContainer::AudioImp::start_scrubbing(double t)
                scrinfo.pos = curscrubpos;
                scrinfo.delaystart = delay_factor*buffer_length_sec;
                                
-               //sinfg::info("\tStarting at %d samps, with %d p %.3f delay",
+               //synfig::info("\tStarting at %d samps, with %d p %.3f delay",
                //                              FSOUND_GetCurrentPosition(channel), (int)scrinfo.pos, scrinfo.delaystart);
        }
        
        
        
        //enable the dsp...
-       //sinfg::info("\tActivating DSP");
+       //synfig::info("\tActivating DSP");
        FSOUND_DSP_SetActive(scrubdspunit,true);
        #endif
 }
 
 void AudioContainer::AudioImp::stop_scrubbing()
 {
-       //sinfg::info("Stop scrubbing");
+       //synfig::info("Stop scrubbing");
        
        if(is_scrubbing())
        {
@@ -1223,7 +1223,7 @@ void AudioContainer::AudioImp::stop_scrubbing()
                g_scrubdata.scrub = 0;
        
                //stop the dsp...
-               //sinfg::info("\tDeactivating DSP");
+               //synfig::info("\tDeactivating DSP");
                FSOUND_DSP_SetActive(scrubdspunit,false);
                if(FSOUND_IsPlaying(channel)) FSOUND_SetPaused(channel,true);
                #endif
@@ -1235,7 +1235,7 @@ void AudioContainer::AudioImp::stop_scrubbing()
 void AudioContainer::AudioImp::scrub(double t)
 {
        #ifdef WITH_FMOD
-       //sinfg::info("Scrub to %lf",t);
+       //synfig::info("Scrub to %lf",t);
        if(is_scrubbing())
        {               
                //What should we do?
@@ -1256,7 +1256,7 @@ void AudioContainer::AudioImp::scrub(double t)
                        //Outside so completely stopped...
                        if(newpos < 0 || oldpos >= length)
                        {
-                               //sinfg::info("\tOut +");
+                               //synfig::info("\tOut +");
                                if(FSOUND_IsPlaying(channel))
                                {
                                        FSOUND_SetPaused(channel,true);
@@ -1278,7 +1278,7 @@ void AudioContainer::AudioImp::scrub(double t)
                                init_play();
                                FSOUND_SetCurrentPosition(channel,0);
                                
-                               sinfg::info("\tIn + %d", FSOUND_GetCurrentPosition(channel));
+                               synfig::info("\tIn + %d", FSOUND_GetCurrentPosition(channel));
                                
                                scrinfo.Lock();
                                scrinfo.pos = 0;
@@ -1297,7 +1297,7 @@ void AudioContainer::AudioImp::scrub(double t)
                                //should we restart the delay cycle... (is it done?)                            
                                if(!isRunning() || (scrinfo.delaystart <= 0 && scrinfo.deltatime <= 0 && isPaused()))
                                {
-                                       //sinfg::info("Starting + at %d",(int)newpos);
+                                       //synfig::info("Starting + at %d",(int)newpos);
                                        scrinfo.deltatime = 0;
                                        scrinfo.delaystart = delay_factor*buffer_length_sec;
                                        scrinfo.Unlock();
@@ -1326,7 +1326,7 @@ void AudioContainer::AudioImp::scrub(double t)
                        //completely stopped...
                        if(newpos >= length || oldpos < 0)
                        {
-                               //sinfg::info("Out -");
+                               //synfig::info("Out -");
                                if(FSOUND_IsPlaying(channel))
                                {
                                        FSOUND_SetPaused(channel,true);
@@ -1342,7 +1342,7 @@ void AudioContainer::AudioImp::scrub(double t)
                        //going in? - start going backwards at the end...
                        /*else if(oldpos >= length)
                        {
-                               sinfg::info("In -");
+                               synfig::info("In -");
                                //Set up the sound to be playing paused at the start...
                                init_play();
                                FSOUND_SetCurrentPosition(channel,length-1);                            
@@ -1364,7 +1364,7 @@ void AudioContainer::AudioImp::scrub(double t)
                                //should we restart the delay cycle... (is it done?)                            
                                if(!isRunning() ||(scrinfo.delaystart <= 0 && scrinfo.deltatime <= 0 && isPaused()))
                                {
-                                       //sinfg::info("Starting - at %d",(int)newpos);
+                                       //synfig::info("Starting - at %d",(int)newpos);
                                        scrinfo.deltatime = 0;
                                        scrinfo.delaystart = delay_factor*buffer_length_sec;
                                        scrinfo.Unlock();
index cc449e8..39b165f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file audiocontainer.h
 **     \brief Sound info header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_AUDIOCONTAINER_H
-#define __SINFG_AUDIOCONTAINER_H
+#ifndef __SYNFIG_AUDIOCONTAINER_H
+#define __SYNFIG_AUDIOCONTAINER_H
 
 /* === H E A D E R S ======================================================= */
 #include <sigc++/signal.h>
@@ -32,7 +32,7 @@
 #include <vector>
 #include <string>
 
-#include <sinfg/time.h>
+#include <synfig/time.h>
 
 /* === M A C R O S ========================================================= */
 const float DEF_DISPLAYSAMPLERATE = 400;
index 06c1db3..f1e8567 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file autorecover.cpp
 **     \brief Template File
 **
@@ -32,8 +32,8 @@
 
 //#include <unistd.h>
 #include "app.h"
-#include <sinfg/savecanvas.h>
-#include <sinfg/loadcanvas.h>
+#include <synfig/savecanvas.h>
+#include <synfig/loadcanvas.h>
 #include <fstream>
 #include <iostream>
 #include "instance.h"
@@ -64,7 +64,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -87,11 +87,11 @@ AutoRecover::AutoRecover()
        if(mkdir(get_shadow_directory().c_str(),ACCESSPERMS)<0)
        {
                if(errno!=EEXIST)
-                       sinfg::error("UNABLE TO CREATE \"%s\"",get_shadow_directory().c_str());
+                       synfig::error("UNABLE TO CREATE \"%s\"",get_shadow_directory().c_str());
        }
        else
        {
-               sinfg::info("Created directory \"%s\"",get_shadow_directory().c_str());
+               synfig::info("Created directory \"%s\"",get_shadow_directory().c_str());
        }
 }
 
@@ -99,7 +99,7 @@ AutoRecover::~AutoRecover()
 {
 }
 
-sinfg::String
+synfig::String
 AutoRecover::get_shadow_directory()
 {
        return Glib::build_filename(App::get_user_app_directory(),"tmp");
@@ -122,8 +122,8 @@ AutoRecover::set_timeout(int milliseconds)
 //             auto_backup_connect=App::main.get_context()->signal_timeout().connect(sigc::mem_fun(&AutoRecover::auto_backup),timeout);
 }
 
-sinfg::String
-AutoRecover::get_shadow_file_name(const sinfg::String& filename)
+synfig::String
+AutoRecover::get_shadow_file_name(const synfig::String& filename)
 {
        unsigned int hash1(0xdeadbeef);
        unsigned int hash2(0x83502529);
@@ -165,15 +165,15 @@ AutoRecover::cleanup_pid(int pid)
        int status=0;
        if(waitpid(pid,&status,WNOHANG)==-1)
        {
-               sinfg::info("PID %d isn't a zombie yet",pid);
+               synfig::info("PID %d isn't a zombie yet",pid);
                return true;
        }
        if(WEXITSTATUS(status)!=0)
        {
-               sinfg::error("Autobackup seems to have failed! (PID=%d)",pid);
+               synfig::error("Autobackup seems to have failed! (PID=%d)",pid);
        }
        else
-               sinfg::info("PID=%d has been cleaned up",pid);
+               synfig::info("PID=%d has been cleaned up",pid);
 #endif
        return false;
 }
@@ -219,12 +219,12 @@ AutoRecover::auto_backup()
                        }
                        
                        if(savecount)
-                               sinfg::info("AutoRecover::auto_backup(): %d Files backed up.",savecount);
+                               synfig::info("AutoRecover::auto_backup(): %d Files backed up.",savecount);
                }
                catch(...)
                {
-                       sinfg::error("AutoRecover::auto_backup(): UNKNOWN EXCEPTION THROWN.");
-                       sinfg::error("AutoRecover::auto_backup(): FILES NOT BACKED UP.");
+                       synfig::error("AutoRecover::auto_backup(): UNKNOWN EXCEPTION THROWN.");
+                       synfig::error("AutoRecover::auto_backup(): FILES NOT BACKED UP.");
                }
                
 #ifdef HAVE_FORK
@@ -313,7 +313,7 @@ AutoRecover::normal_shutdown()
 }
 
 void
-AutoRecover::clear_backup(sinfg::Canvas::Handle canvas)
+AutoRecover::clear_backup(synfig::Canvas::Handle canvas)
 {
        if(canvas)
                remove(get_shadow_file_name(canvas->get_file_name()).c_str());
index c6a4ed0..4b018ef 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file autorecover.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_AUTORECOVER_H
-#define __SINFG_AUTORECOVER_H
+#ifndef __SYNFIG_AUTORECOVER_H
+#define __SYNFIG_AUTORECOVER_H
 
 /* === H E A D E R S ======================================================= */
 
-#include <sinfg/string.h>
-#include <sinfg/canvas.h>
+#include <synfig/string.h>
+#include <synfig/canvas.h>
 #include <sigc++/connection.h>
 
 /* === M A C R O S ========================================================= */
@@ -47,7 +47,7 @@ public:
        ~AutoRecover();
 
        static int pid();
-       static sinfg::String get_shadow_file_name(const sinfg::String& filename);
+       static synfig::String get_shadow_file_name(const synfig::String& filename);
 
        static bool auto_backup();
 
@@ -56,14 +56,14 @@ public:
        void set_timeout(int milliseconds);
        int get_timeout()const { return timeout; }
        
-       static sinfg::String get_shadow_directory();
+       static synfig::String get_shadow_directory();
        
        bool recovery_needed()const;
        bool recover();
        
        void normal_shutdown();
        
-       void clear_backup(sinfg::Canvas::Handle canvas);
+       void clear_backup(synfig::Canvas::Handle canvas);
 }; // END of class AutoRecover
 
 }; // END of namespace studio
index 44d47a7..4b5b1ee 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file canvasoptions.cpp
 **     \brief Template File
 **
@@ -42,7 +42,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
index c34847b..4ce2950 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file canvasoptions.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_CANVASOPTIONS_H
-#define __SINFG_GTKMM_CANVASOPTIONS_H
+#ifndef __SYNFIG_GTKMM_CANVASOPTIONS_H
+#define __SYNFIG_GTKMM_CANVASOPTIONS_H
 
 /* === H E A D E R S ======================================================= */
 
index 46ecc17..ca4990d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file canvasproperties.cpp
 **     \brief Template File
 **
@@ -33,7 +33,7 @@
 #include <gtkmm/table.h>
 #include <gtkmm/label.h>
 #include <gtkmm/notebook.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 #include "metadatatreestore.h"
 #include <gtkmm/treeview.h>
 #include <gtkmm/scrolledwindow.h>
@@ -45,7 +45,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -56,7 +56,7 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-CanvasProperties::CanvasProperties(Gtk::Window& parent,handle<sinfgapp::CanvasInterface> canvas_interface):
+CanvasProperties::CanvasProperties(Gtk::Window& parent,handle<synfigapp::CanvasInterface> canvas_interface):
        Gtk::Dialog(_("Canvas Properties"),parent,false,true),
        canvas_interface_(canvas_interface)
 {
@@ -157,7 +157,7 @@ CanvasProperties::create_meta_data_view()
 void
 CanvasProperties::on_button_meta_data_add()
 {
-       sinfg::String key;
+       synfig::String key;
        if(App::dialog_entry("New MetaData Entry", "Please enter the name of the key",key) && !key.empty())
        {
                canvas_interface_->set_meta_data(key," ");
index 057ddf1..c360e06 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file canvasproperties.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_CANVASPROPERTIES_H
-#define __SINFG_GTKMM_CANVASPROPERTIES_H
+#ifndef __SYNFIG_GTKMM_CANVASPROPERTIES_H
+#define __SYNFIG_GTKMM_CANVASPROPERTIES_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -43,7 +43,7 @@
 /* === C L A S S E S & S T R U C T S ======================================= */
 
 namespace Gtk { class TreeView; };
-namespace sinfgapp { class CanvasInterface; };
+namespace synfigapp { class CanvasInterface; };
 
 namespace studio
 {      
@@ -51,7 +51,7 @@ class CanvasProperties  :  public Gtk::Dialog
 {
        Gtk::Tooltips tooltips;
 
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::handle<synfigapp::CanvasInterface> canvas_interface_;
        Widget_RendDesc widget_rend_desc;
        Gtk::Entry entry_id;
        Gtk::Entry entry_name;
@@ -64,7 +64,7 @@ class CanvasProperties  :  public Gtk::Dialog
        void on_button_meta_data_delete();
        
 public:
-       CanvasProperties(Gtk::Window& parent,etl::handle<sinfgapp::CanvasInterface> canvas_interface);
+       CanvasProperties(Gtk::Window& parent,etl::handle<synfigapp::CanvasInterface> canvas_interface);
        ~CanvasProperties();
 
        void refresh();
index 4a4ea6f..470da31 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file canvastreestore.cpp
 **     \brief Template File
 **
 #endif
 
 #include "canvastreestore.h"
-#include <sinfg/valuenode.h>
+#include <synfig/valuenode.h>
 #include "iconcontroler.h"
-#include <sinfg/valuenode_timedswap.h>
-#include <sinfg/valuenode_animated.h>
+#include <synfig/valuenode_timedswap.h>
+#include <synfig/valuenode_animated.h>
 #include <gtkmm/button.h>
-#include <sinfgapp/instance.h>
+#include <synfigapp/instance.h>
 #include "cellrenderer_value.h"
 #include "cellrenderer_timetrack.h"
 #include <ETL/clock>
@@ -45,7 +45,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -63,7 +63,7 @@ static CanvasTreeStore::Model& ModelHack()
        return *model;
 }
 
-CanvasTreeStore::CanvasTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_):
+CanvasTreeStore::CanvasTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_):
        Gtk::TreeStore(ModelHack()),
        canvas_interface_               (canvas_interface_)
 {
@@ -78,9 +78,9 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
 {
        if(column==model.value.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
-               Glib::Value<sinfg::ValueBase> x;
+               Glib::Value<synfig::ValueBase> x;
                g_value_init(x.gobj(),x.value_type());
 
                if(!value_desc)
@@ -95,7 +95,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
                        x.set((*value_desc.get_value_node())(canvas_interface()->get_time()));
                else
                {
-                       sinfg::error(__FILE__":%d: Unable to figure out value",__LINE__);
+                       synfig::error(__FILE__":%d: Unable to figure out value",__LINE__);
                        return;
                }
                
@@ -105,7 +105,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.is_value_node.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
                Glib::Value<bool> x;
                g_value_init(x.gobj(),x.value_type());
@@ -118,7 +118,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.is_shared.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
                Glib::Value<bool> x;
                g_value_init(x.gobj(),x.value_type());
@@ -131,7 +131,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.is_exported.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
                Glib::Value<bool> x;
                g_value_init(x.gobj(),x.value_type());
@@ -144,7 +144,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.is_canvas.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
                Glib::Value<bool> x;
                g_value_init(x.gobj(),x.value_type());
@@ -157,7 +157,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.id.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
                Glib::Value<Glib::ustring> x;
                g_value_init(x.gobj(),x.value_type());
@@ -175,12 +175,12 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.is_editable.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
                Glib::Value<bool> x;
                g_value_init(x.gobj(),x.value_type());
 
-               x.set(!value_desc.is_value_node() || sinfgapp::is_editable(value_desc.get_value_node()));
+               x.set(!value_desc.is_value_node() || synfigapp::is_editable(value_desc.get_value_node()));
                
                g_value_init(value.gobj(),x.value_type());
                g_value_copy(x.gobj(),value.gobj());
@@ -188,7 +188,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.type.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
                Glib::Value<Glib::ustring> x;
                g_value_init(x.gobj(),x.value_type());
@@ -217,7 +217,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.label.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
 
                Glib::Value<Glib::ustring> x;
                g_value_init(x.gobj(),x.value_type());
@@ -258,7 +258,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
        else
        if(column==model.icon.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
                if(!value_desc)
                        return Gtk::TreeStore::get_value_vfunc(iter,column,value);
 
@@ -275,7 +275,7 @@ CanvasTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colu
 }
 
 bool
-CanvasTreeStore::find_first_value_desc(const sinfgapp::ValueDesc& value_desc, Gtk::TreeIter& iter)
+CanvasTreeStore::find_first_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter)
 {
        iter=children().begin();
        while(iter && value_desc!=(*iter)[model.value_desc])
@@ -299,7 +299,7 @@ CanvasTreeStore::find_first_value_desc(const sinfgapp::ValueDesc& value_desc, Gt
 }
 
 bool
-CanvasTreeStore::find_next_value_desc(const sinfgapp::ValueDesc& value_desc, Gtk::TreeIter& iter)
+CanvasTreeStore::find_next_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter)
 {
        if(!iter) return find_first_value_desc(value_desc,iter);
                
@@ -382,7 +382,7 @@ CanvasTreeStore::find_next_value_node(const ValueNode::Handle& value_node, Gtk::
 }
 
 void
-CanvasTreeStore::set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc, bool do_children)
+CanvasTreeStore::set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc, bool do_children)
 {
        Gtk::TreeModel::Children children = row.children();
        while(!children.empty() && erase(children.begin()));
@@ -401,7 +401,7 @@ CanvasTreeStore::set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc, bool d
                        row[model.value_node] = value_node;
                        //row[model.is_canvas] = false;
                        //row[model.is_value_node] = true;
-                       //row[model.is_editable] = sinfgapp::is_editable(value_node);
+                       //row[model.is_editable] = synfigapp::is_editable(value_node);
                        //row[model.id]=value_node->get_id();
                        
                        // Set the canvas
@@ -422,7 +422,7 @@ CanvasTreeStore::set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc, bool d
                                        child_row[model.link_id] = i;
                                        child_row[model.canvas] = static_cast<Canvas::Handle>(row[model.canvas]);
                                        child_row[model.name] = linkable->link_local_name(i);
-                                       set_row(child_row,sinfgapp::ValueDesc(linkable,i));
+                                       set_row(child_row,synfigapp::ValueDesc(linkable,i));
                                }
                        }
                        return;
@@ -435,9 +435,9 @@ CanvasTreeStore::set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc, bool d
                        return;
                }
        }
-       catch(sinfg::Exception::IDNotFound x)
+       catch(synfig::Exception::IDNotFound x)
        {
-               sinfg::error(__FILE__":%d: IDNotFound thrown",__LINE__);
+               synfig::error(__FILE__":%d: IDNotFound thrown",__LINE__);
                erase(row);
                return;
        }
@@ -449,7 +449,7 @@ CanvasTreeStore::set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc, bool d
 void
 CanvasTreeStore::refresh_row(Gtk::TreeModel::Row &row, bool do_children)
 {
-       sinfgapp::ValueDesc value_desc=row[model.value_desc];
+       synfigapp::ValueDesc value_desc=row[model.value_desc];
 
        if(value_desc)
        {
@@ -517,7 +517,7 @@ CanvasTreeStore::refresh_row(Gtk::TreeModel::Row &row, bool do_children)
 void
 CanvasTreeStore::rebuild_row(Gtk::TreeModel::Row &row, bool do_children)
 {
-       sinfgapp::ValueDesc value_desc=(sinfgapp::ValueDesc)row[model.value_desc];
+       synfigapp::ValueDesc value_desc=(synfigapp::ValueDesc)row[model.value_desc];
 
        if(value_desc && value_desc.get_value_node())
        {
index b011fbb..252f319 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file canvastreestore.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_CANVASTREESTORE_H
-#define __SINFG_STUDIO_CANVASTREESTORE_H
+#ifndef __SYNFIG_STUDIO_CANVASTREESTORE_H
+#define __SYNFIG_STUDIO_CANVASTREESTORE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 #include <gdkmm/pixbuf.h>
-#include <sinfgapp/value_desc.h>
+#include <synfigapp/value_desc.h>
 #include <gtkmm/treeview.h>
 
 /* === M A C R O S ========================================================= */
@@ -70,12 +70,12 @@ public:
                Gtk::TreeModelColumn<Glib::ustring> name;
                Gtk::TreeModelColumn<Glib::ustring> id;
 
-               Gtk::TreeModelColumn<sinfg::Canvas::Handle> canvas;
+               Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
                Gtk::TreeModelColumn<bool> is_canvas;
 
-               Gtk::TreeModelColumn<sinfg::ValueNode::Handle> value_node;
+               Gtk::TreeModelColumn<synfig::ValueNode::Handle> value_node;
                Gtk::TreeModelColumn<bool> is_value_node;
-               Gtk::TreeModelColumn<sinfg::ValueBase> value;
+               Gtk::TreeModelColumn<synfig::ValueBase> value;
                Gtk::TreeModelColumn<Glib::ustring> type;
                Gtk::TreeModelColumn<int> link_id;
                Gtk::TreeModelColumn<int> link_count;
@@ -85,7 +85,7 @@ public:
                Gtk::TreeModelColumn<bool> is_shared;
                Gtk::TreeModelColumn<bool> is_exported;
        
-               Gtk::TreeModelColumn<sinfgapp::ValueDesc> value_desc;
+               Gtk::TreeModelColumn<synfigapp::ValueDesc> value_desc;
        
                Gtk::TreeModelColumn<Glib::ustring> tooltip;
 
@@ -129,7 +129,7 @@ public:
 
 private:
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
 
        /*
  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
@@ -152,32 +152,32 @@ private:
 
 public:
        
-       CanvasTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       CanvasTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
        ~CanvasTreeStore();
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
-       etl::loose_handle<const sinfgapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
+       etl::loose_handle<const synfigapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
 
        virtual void rebuild_row(Gtk::TreeModel::Row &row, bool do_children=true);
 
        virtual void refresh_row(Gtk::TreeModel::Row &row, bool do_children=true);
 
-       virtual void set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc, bool do_children=true);
+       virtual void set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc, bool do_children=true);
 
-       bool find_first_value_desc(const sinfgapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
-       bool find_next_value_desc(const sinfgapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
+       bool find_first_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
+       bool find_next_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter);
 
-       bool find_first_value_node(const sinfg::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
-       bool find_next_value_node(const sinfg::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
+       bool find_first_value_node(const synfig::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
+       bool find_next_value_node(const synfig::ValueNode::Handle& value_node, Gtk::TreeIter& iter);
        
        
        static CellRenderer_ValueBase* add_cell_renderer_value(Gtk::TreeView::Column* column);
 
        static CellRenderer_TimeTrack* add_cell_renderer_value_node(Gtk::TreeView::Column* column);
 
-       etl::loose_handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+       etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
 
-       virtual void on_value_node_changed(sinfg::ValueNode::Handle value_node)=0;
+       virtual void on_value_node_changed(synfig::ValueNode::Handle value_node)=0;
 
        /*
  -- ** -- P R O T E C T E D   M E T H O D S -----------------------------------
index 5d4c96b..1911347 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file canvasview.cpp
 **     \brief Template File
 **
 #include <gtk/gtktreestore.h>
 #include <gtk/gtkversion.h>
 
-#include <sinfg/valuenode_reference.h>
-#include <sinfg/valuenode_subtract.h>          
-#include <sinfg/valuenode_linear.h>            
-#include <sinfg/valuenode_timedswap.h>         
-#include <sinfg/valuenode_scale.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_twotone.h>
-#include <sinfg/valuenode_stripes.h>
-#include <sinfg/layer.h>
-
-#include <sinfgapp/uimanager.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/selectionmanager.h>
-//#include <sinfgapp/action_setwaypoint.h>
-//#include <sinfgapp/action_deletewaypoint.h>
+#include <synfig/valuenode_reference.h>
+#include <synfig/valuenode_subtract.h>         
+#include <synfig/valuenode_linear.h>           
+#include <synfig/valuenode_timedswap.h>                
+#include <synfig/valuenode_scale.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_twotone.h>
+#include <synfig/valuenode_stripes.h>
+#include <synfig/layer.h>
+
+#include <synfigapp/uimanager.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/selectionmanager.h>
+//#include <synfigapp/action_setwaypoint.h>
+//#include <synfigapp/action_deletewaypoint.h>
 
 #include <sigc++/retype_return.h>
 #include <sigc++/retype.h>
@@ -93,8 +93,8 @@
 #include "audiocontainer.h"
 #include "widget_timeslider.h"
 
-#include <sinfgapp/main.h>
-#include <sinfgapp/inputdevice.h>
+#include <synfigapp/main.h>
+#include <synfigapp/inputdevice.h>
 
 #endif
 
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 using namespace SigC;
 
@@ -110,7 +110,7 @@ using namespace SigC;
 
 #define GRAB_HINT_DATA(y)      { \
                String x; \
-               if(sinfgapp::Main::settings().get_value(String("pref.")+y+"_hints",x)) \
+               if(synfigapp::Main::settings().get_value(String("pref.")+y+"_hints",x)) \
                { \
                        set_type_hint((Gdk::WindowTypeHint)atoi(x.c_str()));    \
                } \
@@ -229,7 +229,7 @@ public:
 };
 
        
-class studio::CanvasViewUIInterface : public sinfgapp::UIInterface
+class studio::CanvasViewUIInterface : public synfigapp::UIInterface
 {
        CanvasView *view;
 
@@ -393,7 +393,7 @@ public:
        }
 };
 
-class studio::CanvasViewSelectionManager : public sinfgapp::SelectionManager
+class studio::CanvasViewSelectionManager : public synfigapp::SelectionManager
 {
        CanvasView *view;
        CanvasView::LayerTreeModel layer_tree_model;
@@ -407,7 +407,7 @@ public:
                
 
 private:
-       void _set_selected_layer(const sinfg::Layer::Handle &layer)
+       void _set_selected_layer(const synfig::Layer::Handle &layer)
        {
                view->layer_tree->select_layer(layer);
 /*
@@ -422,7 +422,7 @@ private:
                        const Gtk::TreeRow row = *(view->layer_tree->get_selection()->get_selected());
 
                        // Don't do anything if that layer is already selected
-                       if(layer == static_cast<sinfg::Layer::Handle>(row[layer_tree_model.layer]))
+                       if(layer == static_cast<synfig::Layer::Handle>(row[layer_tree_model.layer]))
                                return;
                }
                Gtk::TreeModel::Children::iterator iter;
@@ -455,16 +455,16 @@ public:
        {
 //             assert(view->layer_tree);
                
-               if(!view->layer_tree) { DEBUGPOINT(); sinfg::error("canvas_view.layer_tree not defined!?"); return LayerList(); }
+               if(!view->layer_tree) { DEBUGPOINT(); synfig::error("canvas_view.layer_tree not defined!?"); return LayerList(); }
                return view->layer_tree->get_selected_layers();
        }
        
        //! Returns the first layer selected or an empty handle if none are selected.
-       virtual sinfg::Layer::Handle get_selected_layer()const
+       virtual synfig::Layer::Handle get_selected_layer()const
        {
 //             assert(view->layer_tree);
                
-               if(!view->layer_tree) { DEBUGPOINT(); sinfg::error("canvas_view.layer_tree not defined!?"); return 0; }
+               if(!view->layer_tree) { DEBUGPOINT(); synfig::error("canvas_view.layer_tree not defined!?"); return 0; }
                return view->layer_tree->get_selected_layer();
        }
        
@@ -473,7 +473,7 @@ public:
        {
 //             assert(view->layer_tree);
                
-               if(!view->layer_tree) { DEBUGPOINT(); sinfg::error("canvas_view.layer_tree not defined!?"); return; }
+               if(!view->layer_tree) { DEBUGPOINT(); synfig::error("canvas_view.layer_tree not defined!?"); return; }
                view->layer_tree->select_layers(layer_list);
                //view->get_smach().process_event(EVENT_REFRESH_DUCKS);
 
@@ -481,11 +481,11 @@ public:
        }
 
        //! Sets which layer should be selected.
-       virtual void set_selected_layer(const sinfg::Layer::Handle &layer)
+       virtual void set_selected_layer(const synfig::Layer::Handle &layer)
        {
 //             assert(view->layer_tree);
                
-               if(!view->layer_tree) { DEBUGPOINT(); sinfg::error("canvas_view.layer_tree not defined!?"); return; }
+               if(!view->layer_tree) { DEBUGPOINT(); synfig::error("canvas_view.layer_tree not defined!?"); return; }
                view->layer_tree->select_layer(layer);
                //view->queue_rebuild_ducks();
        }
@@ -508,7 +508,7 @@ public:
        static inline void __child_grabber(const Gtk::TreeModel::iterator& iter, ChildrenList* ret)
        {
                const CanvasView::ChildrenTreeModel children_tree_model;
-               sinfgapp::ValueDesc value_desc((*iter)[children_tree_model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[children_tree_model.value_desc]);
                if(value_desc)
                        ret->push_back(value_desc);
        }
@@ -542,7 +542,7 @@ public:
                {
                        Gtk::TreeModel::Row row = *iter;
                        if(selection->is_selected(row))
-                               ret.push_back((sinfgapp::ValueDesc)row[children_tree_model.value_desc]);
+                               ret.push_back((synfigapp::ValueDesc)row[children_tree_model.value_desc]);
                }
                */
                return ret;
@@ -662,7 +662,7 @@ CanvasView::IsWorking::operator bool()const
 
 /* === M E T H O D S ======================================================= */
 
-CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<sinfgapp::CanvasInterface> canvas_interface_):
+CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<synfigapp::CanvasInterface> canvas_interface_):
        smach_                                  (this),
        instance_                               (instance),
        canvas_interface_               (canvas_interface_),
@@ -698,7 +698,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<sinfgapp
        
        disp_audio = new Widget_Sound();
        
-       //sinfg::info("Canvasview: Entered constructor");
+       //synfig::info("Canvasview: Entered constructor");
        // Minor hack
        get_canvas()->set_time(0);
        //layer_tree_store_->rebuild();
@@ -721,7 +721,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<sinfgapp
        //notebook->append_page(*create_children_tree(),"Children");
        //notebook->append_page(*create_keyframe_tree(),"Keyframes");
        
-       //sinfg::info("Canvasview: Before big chunk of allocation and tabling stuff");
+       //synfig::info("Canvasview: Before big chunk of allocation and tabling stuff");
        //create all allocated stuff for this canvas
        audio = new AudioContainer();
        
@@ -742,7 +742,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<sinfgapp
 
        //set_transient_for(*App::toolbox);
 
-       //sinfg::info("Canvasview: Before Signals");
+       //synfig::info("Canvasview: Before Signals");
        /*
  --    ** -- Signals -------------------------------------------------------------
        */
@@ -840,10 +840,10 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<sinfgapp
        }
        */
        
-       //sinfg::info("Canvasview: Before Sound Hookup");
+       //synfig::info("Canvasview: Before Sound Hookup");
        //load sound info from meta data
        {
-               //sinfg::warning("Should load Audio: %s with %s offset",apath.c_str(),aoffset.c_str());
+               //synfig::warning("Should load Audio: %s with %s offset",apath.c_str(),aoffset.c_str());
                
                on_audio_file_notify(); //redundant setting of the metadata, but oh well, it's no big deal :)
                on_audio_offset_notify();
@@ -865,7 +865,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<sinfgapp
                //universal_scrubber=std::auto_ptr<UniversalScrubber>(new UniversalScrubber(this));
        }
        
-       //sinfg::info("Canvasview: Before Final time set up");
+       //synfig::info("Canvasview: Before Final time set up");
        //MORE TIME STUFF
        time_window_adjustment().set_value(get_canvas()->rend_desc().get_time_start());
        time_window_adjustment().value_changed();
@@ -884,7 +884,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<sinfgapp
        hide_tables();
 
        on_time_changed();      
-       //sinfg::info("Canvasview: Constructor Done");  
+       //synfig::info("Canvasview: Constructor Done"); 
 }
 
 CanvasView::~CanvasView()
@@ -914,7 +914,7 @@ CanvasView::~CanvasView()
                
        hide();
        
-       sinfg::info("CanvasView:~CanvasView(): Destructor Finished");
+       synfig::info("CanvasView:~CanvasView(): Destructor Finished");
 }
 
 
@@ -948,7 +948,7 @@ CanvasView::create_time_bar()
        animatebutton->signal_clicked().connect(sigc::mem_fun(*this, &studio::CanvasView::on_animate_button_pressed));
        animatebutton->show();
 
-       NORMAL_BUTTON(keyframebutton,"sinfg-keyframe_lock_all","All Keyframes Locked");
+       NORMAL_BUTTON(keyframebutton,"synfig-keyframe_lock_all","All Keyframes Locked");
        keyframebutton->signal_clicked().connect(sigc::mem_fun(*this, &studio::CanvasView::on_keyframe_button_pressed));
        keyframebutton->show();
        
@@ -996,7 +996,7 @@ Gtk::Widget*
 CanvasView::create_status_bar()
 {
        Gtk::Image *icon;
-       Gtk::IconSize iconsize=Gtk::IconSize::from_name("sinfg-small_icon");
+       Gtk::IconSize iconsize=Gtk::IconSize::from_name("synfig-small_icon");
        cancel=false;
 
        // Create the status bar at the bottom of the window
@@ -1079,7 +1079,7 @@ CanvasView::create_keyframe_tree()
        //keyframe_tree->show();
        //keyframe_tree->set_model(keyframe_tree_store());
        keyframe_tree->set_editable(true);
-       //keyframe_tree->signal_edited().connect(sigc::hide_return(sigc::mem_fun(*canvas_interface(), &sinfgapp::CanvasInterface::update_keyframe)));
+       //keyframe_tree->signal_edited().connect(sigc::hide_return(sigc::mem_fun(*canvas_interface(), &synfigapp::CanvasInterface::update_keyframe)));
 
        keyframe_tree->signal_event().connect(sigc::mem_fun(*this, &studio::CanvasView::on_keyframe_tree_event));
        
@@ -1095,10 +1095,10 @@ CanvasView::create_keyframe_tree()
        layout_table->attach(*scroll_layer_tree, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
        
        Gtk::Image *icon;
-       Gtk::IconSize iconsize(Gtk::IconSize::from_name("sinfg-small_icon"));
+       Gtk::IconSize iconsize(Gtk::IconSize::from_name("synfig-small_icon"));
 
        NEW_SMALL_BUTTON(button_add,"gtk-add","New Keyframe");
-       NEW_SMALL_BUTTON(button_duplicate,"sinfg-duplicate","Duplicate Keyframe");
+       NEW_SMALL_BUTTON(button_duplicate,"synfig-duplicate","Duplicate Keyframe");
        NEW_SMALL_BUTTON(button_delete,"gtk-delete","Delete Keyframe");
 
        Gtk::HBox *hbox(manage(new Gtk::HBox()));
@@ -1191,16 +1191,16 @@ CanvasView::init_menus()
        action_group->add( Gtk::Action::create("revert", Gtk::Stock::REVERT_TO_SAVED),
                sigc::hide_return(sigc::mem_fun(*get_instance().get(), &studio::Instance::safe_revert))
        );
-       action_group->add( Gtk::Action::create("cvs-add", Gtk::StockID("sinfg-cvs_add")),
+       action_group->add( Gtk::Action::create("cvs-add", Gtk::StockID("synfig-cvs_add")),
                sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_add))
        );
-       action_group->add( Gtk::Action::create("cvs-update", Gtk::StockID("sinfg-cvs_update")),
+       action_group->add( Gtk::Action::create("cvs-update", Gtk::StockID("synfig-cvs_update")),
                sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_update))
        );
-       action_group->add( Gtk::Action::create("cvs-revert", Gtk::StockID("sinfg-cvs_revert")),
+       action_group->add( Gtk::Action::create("cvs-revert", Gtk::StockID("synfig-cvs_revert")),
                sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_revert))
        );
-       action_group->add( Gtk::Action::create("cvs-commit", Gtk::StockID("sinfg-cvs_commit")),
+       action_group->add( Gtk::Action::create("cvs-commit", Gtk::StockID("synfig-cvs_commit")),
                sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_commit))
        );
        action_group->add( Gtk::Action::create("import", _("Import")),
@@ -1273,7 +1273,7 @@ CanvasView::init_menus()
                }
        }
 
-       action_group->add( Gtk::Action::create("play", Gtk::StockID("sinfg-play")),
+       action_group->add( Gtk::Action::create("play", Gtk::StockID("synfig-play")),
                sigc::mem_fun(*this, &studio::CanvasView::play)
        );
        
@@ -1310,28 +1310,28 @@ CanvasView::init_menus()
                Glib::RefPtr<Gtk::Action> action;
                
                action=Gtk::Action::create("seek-next-frame", Gtk::Stock::GO_FORWARD,_("Next Frame"),_("Next Frame"));
-               action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::seek_frame),1));
+               action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_frame),1));
                action=Gtk::Action::create("seek-prev-frame", Gtk::Stock::GO_BACK,_("Prev Frame"),_("Prev Frame"));
-               action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::seek_frame),-1));
+               action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_frame),-1));
 
                action=Gtk::Action::create("seek-next-second", Gtk::Stock::GO_FORWARD,_("Seek Foward"),_("Seek Foward"));
-               action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::seek_time),Time(1)));
+               action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time),Time(1)));
                action=Gtk::Action::create("seek-prev-second", Gtk::Stock::GO_BACK,_("Seek Backward"),_("Seek Backward"));
-               action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::seek_time),Time(-1)));
+               action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time),Time(-1)));
 
                // Broken...!?
                /*
                action=Gtk::Action::create("seek-end", Gtk::Stock::GOTO_LAST,_("Seek to End"),_("Seek to End"));
-               action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::seek_time),Time::end()));
+               action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time),Time::end()));
                */
                action=Gtk::Action::create("seek-begin", Gtk::Stock::GOTO_FIRST,_("Seek to Begin"),_("Seek to Begin"));
-               action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::seek_time),Time::begin()));
+               action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time),Time::begin()));
 
                action=Gtk::Action::create("jump-next-keyframe", Gtk::Stock::GO_FORWARD,_("Jump to Next Keyframe"),_("Jump to Next Keyframe"));
-               action_group->add( action,sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::jump_to_next_keyframe));
+               action_group->add( action,sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::jump_to_next_keyframe));
 
                action=Gtk::Action::create("jump-prev-keyframe", Gtk::Stock::GO_BACK,_("Jump to Prev Keyframe"),_("Jump to Prev Keyframe"));
-               action_group->add( action,sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::jump_to_prev_keyframe));
+               action_group->add( action,sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::jump_to_prev_keyframe));
 
                action=Gtk::Action::create("canvas-zoom-in", Gtk::Stock::ZOOM_IN);
                action_group->add( action,sigc::mem_fun(*work_area, &studio::WorkArea::zoom_in));
@@ -1374,16 +1374,16 @@ CanvasView::init_menus()
                Glib::RefPtr<Gtk::Action> action;
                
                action=Gtk::Action::create("seek-next-frame", Gtk::StockID("gtk-forward"),_("Next Frame"),_("Next Frame"));
-               accel_action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::seek),1));
+               accel_action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek),1));
 
                action=Gtk::Action::create("seek-prev-frame", Gtk::StockID("gtk-forward"),_("Prev Frame"),_("Prev Frame"));
-               accel_action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::seek),-1));
+               accel_action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek),-1));
 
                action=Gtk::Action::create("jump-next-keyframe", Gtk::StockID("gtk-forward"),_("Jump to Next Keyframe"),_("Jump to Next Keyframe"));
-               accel_action_group->add( action,sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::jump_to_next_keyframe));
+               accel_action_group->add( action,sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::jump_to_next_keyframe));
 
                action=Gtk::Action::create("jump-prev-keyframe", Gtk::StockID("gtk-back"),_("Jump to Prev Keyframe"),_("Jump to Prev Keyframe"));
-               accel_action_group->add( action,sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::jump_to_prev_keyframe));
+               accel_action_group->add( action,sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::jump_to_prev_keyframe));
 
                action=Gtk::Action::create("canvas-zoom-in", Gtk::StockID("gtk-zoom-in"));
                accel_action_group->add( action,sigc::mem_fun(*work_area, &studio::WorkArea::zoom_in));
@@ -1434,9 +1434,9 @@ CanvasView::init_menus()
        filemenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-revert-to-saved"),hide_return(sigc::mem_fun(*get_instance().get(), &studio::Instance::safe_revert))));
        filemenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
 
-       filemenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-cvs_add"),sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_add))));
-       filemenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-cvs_update"),sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_update))));
-       filemenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-cvs_commit"),sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_commit))));
+       filemenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-cvs_add"),sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_add))));
+       filemenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-cvs_update"),sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_update))));
+       filemenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-cvs_commit"),sigc::hide_return(sigc::mem_fun(*get_instance(), &studio::Instance::dialog_cvs_commit))));
 
        filemenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
        filemenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Import..."),Gtk::AccelKey('I',Gdk::CONTROL_MASK),sigc::hide_return(sigc::mem_fun(*this, &studio::CanvasView::image_import))));
@@ -1474,11 +1474,11 @@ CanvasView::init_menus()
        editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-stop"),Gtk::AccelKey(GDK_Escape,static_cast<Gdk::ModifierType>(0)),SLOT_EVENT(EVENT_STOP)));
        editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-refresh"),Gtk::AccelKey('k',Gdk::CONTROL_MASK),SLOT_EVENT(EVENT_REFRESH)));
        editmenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
-       editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-rotoscope_bline"),
+       editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-rotoscope_bline"),
                sigc::mem_fun(*this, &studio::CanvasView::do_rotoscope_bline)));
-       editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-rotoscope_polygon"),
+       editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-rotoscope_polygon"),
                sigc::mem_fun(*this, &studio::CanvasView::do_rotoscope_poly)));
-       editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-eyedrop"),
+       editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-eyedrop"),
                sigc::mem_fun(*this, &studio::CanvasView::do_eyedrop)));
        editmenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
        editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-properties"),Gtk::AccelKey("F8"),
@@ -1490,10 +1490,10 @@ CanvasView::init_menus()
 
 
        {
-               sinfgapp::Action::ParamList param_list;
+               synfigapp::Action::ParamList param_list;
                param_list.add("canvas",Canvas::Handle(get_canvas()));
                param_list.add("canvas_interface",canvas_interface());
-               add_actions_to_menu(&canvasmenu, param_list,sinfgapp::Action::CATEGORY_CANVAS);
+               add_actions_to_menu(&canvasmenu, param_list,synfigapp::Action::CATEGORY_CANVAS);
        }
 
        
@@ -1590,7 +1590,7 @@ CanvasView::init_menus()
                viewmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Preview Quality"),qualitymenu));
        }
        
-       viewmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-play"),
+       viewmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-play"),
                sigc::mem_fun(*this, &studio::CanvasView::play)));
        viewmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("Flipbook Dialog"),
                sigc::mem_fun(*preview_dialog, &studio::Dialog_Preview::present)));
@@ -1624,9 +1624,9 @@ CanvasView::init_menus()
                sigc::mem_fun(*this, &studio::CanvasView::time_zoom_out)));
 
        viewmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Jump to Next Keyframe"),Gtk::AccelKey(']',static_cast<Gdk::ModifierType>(0)),
-               sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::jump_to_next_keyframe)));
+               sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::jump_to_next_keyframe)));
        viewmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Jump to Prev Keyframe"),Gtk::AccelKey('[',static_cast<Gdk::ModifierType>(0)),
-               sigc::mem_fun(*canvas_interface().get(), &sinfgapp::CanvasInterface::jump_to_prev_keyframe)));
+               sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::jump_to_prev_keyframe)));
 
        mainmenu.items().push_back(Gtk::Menu_Helpers::TearoffMenuElem());
        mainmenu.items().push_back(Gtk::Menu_Helpers::MenuElem("_File",filemenu));
@@ -1662,7 +1662,7 @@ CanvasView::init_menus()
        filemenu.set_accel_path("<synfig>/File");
        editmenu.set_accel_path("<synfig>/Edit");
        layermenu.set_accel_path("<synfig>/Layer");
-       //mainmenu.set_accel_path("<sinfg-main>");
+       //mainmenu.set_accel_path("<synfig-main>");
        canvasmenu.set_accel_path("<synfig>/Canvas");
        viewmenu.set_accel_path("<synfig>/View");
        duckmaskmenu.set_accel_path("<synfig>/DuckMask");
@@ -1691,11 +1691,11 @@ CanvasView::show_keyframe_dialog()
 }
 
 void
-CanvasView::add_layer(sinfg::String x)
+CanvasView::add_layer(synfig::String x)
 {
        Canvas::Handle canvas;
        
-       sinfgapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
        
        int target_depth(0);
        
@@ -1719,13 +1719,13 @@ CanvasView::add_layer(sinfg::String x)
 }
 
 void
-CanvasView::popup_layer_menu(sinfg::Layer::Handle layer)
+CanvasView::popup_layer_menu(synfig::Layer::Handle layer)
 {
        //Gtk::Menu* menu(manage(new Gtk::Menu));
        Gtk::Menu* menu(&parammenu);
        menu->items().clear();
        
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list.add("time",canvas_interface()->get_time());
        param_list.add("canvas",Canvas::Handle(layer->get_canvas()));
        param_list.add("canvas_interface",canvas_interface());
@@ -1749,13 +1749,13 @@ CanvasView::popup_layer_menu(sinfg::Layer::Handle layer)
                ));
        }
        
-       add_actions_to_menu(menu, param_list,sinfgapp::Action::CATEGORY_LAYER);
+       add_actions_to_menu(menu, param_list,synfigapp::Action::CATEGORY_LAYER);
        
        menu->popup(3,gtk_get_current_event_time());
 }
 
 void
-CanvasView::register_layer_type(sinfg::Layer::Book::value_type &lyr,std::map<sinfg::String,Gtk::Menu*>* category_map)
+CanvasView::register_layer_type(synfig::Layer::Book::value_type &lyr,std::map<synfig::String,Gtk::Menu*>* category_map)
 {
 /*     if(lyr.second.category==_("Do Not Use"))
                return;
@@ -1778,11 +1778,11 @@ void
 CanvasView::build_new_layer_menu(Gtk::Menu &menu)
 {
 /*
-       std::map<sinfg::String,Gtk::Menu*> category_map;
+       std::map<synfig::String,Gtk::Menu*> category_map;
 
        std::for_each(
-               sinfg::Layer::book().begin(),
-               sinfg::Layer::book().end(),
+               synfig::Layer::book().begin(),
+               synfig::Layer::book().end(),
                sigc::bind(
                        sigc::mem_fun(
                                *this,
@@ -1795,7 +1795,7 @@ CanvasView::build_new_layer_menu(Gtk::Menu &menu)
        menu.items().clear();
        menu.items().push_back(Gtk::Menu_Helpers::TearoffMenuElem());
 
-       std::map<sinfg::String,Gtk::Menu*>::iterator iter;
+       std::map<synfig::String,Gtk::Menu*>::iterator iter;
        for(iter=category_map.begin();iter!=category_map.end();++iter)
                menu.items().push_back(Gtk::Menu_Helpers::MenuElem(iter->first,*iter->second)); 
 
@@ -1825,7 +1825,7 @@ CanvasView::on_refresh_pressed()
 }
 
 void
-CanvasView::workarea_layer_selected(sinfg::Layer::Handle layer)
+CanvasView::workarea_layer_selected(synfig::Layer::Handle layer)
 {
        get_selection_manager()->clear_selected_layers();
        if(layer)
@@ -1840,7 +1840,7 @@ CanvasView::refresh_rend_desc()
 
        
        //????
-       //sinfg::info("Canvasview: Refreshing render desc info");
+       //synfig::info("Canvasview: Refreshing render desc info");
        if(!get_time().is_equal(time_adjustment().get_value()))
        {
                time_adjustment().set_value(get_time());
@@ -1869,7 +1869,7 @@ CanvasView::refresh_rend_desc()
        // Setup the time_window adjustment
        time_window_adjustment().set_lower(begin_time);
        time_window_adjustment().set_upper(end_time);
-       time_window_adjustment().set_step_increment(sinfg::Time(1.0/get_canvas()->rend_desc().get_frame_rate()));
+       time_window_adjustment().set_step_increment(synfig::Time(1.0/get_canvas()->rend_desc().get_frame_rate()));
 
        //Time length(get_canvas()->rend_desc().get_time_end()-get_canvas()->rend_desc().get_time_start());
        if(length < time_window_adjustment().get_page_size())
@@ -1878,7 +1878,7 @@ CanvasView::refresh_rend_desc()
                time_window_adjustment().set_page_size(length);
        }
        
-       /*sinfg::info("w: %p - [%.3f,%.3f] (%.3f,%.3f) child: %p\n",
+       /*synfig::info("w: %p - [%.3f,%.3f] (%.3f,%.3f) child: %p\n",
                                &time_window_adjustment_, time_window_adjustment_.get_lower(),
                                time_window_adjustment_.get_upper(),time_window_adjustment_.get_value(),
                                time_window_adjustment_.get_page_size(),time_window_adjustment_.get_child_adjustment()
@@ -1894,13 +1894,13 @@ CanvasView::refresh_rend_desc()
        
 //     time_adjustment().set_lower(get_canvas()->rend_desc().get_time_start());
 //     time_adjustment().set_upper(get_canvas()->rend_desc().get_time_end());
-       time_adjustment().set_step_increment(sinfg::Time(1.0/get_canvas()->rend_desc().get_frame_rate()));
-       time_adjustment().set_page_increment(sinfg::Time(1.0));
+       time_adjustment().set_step_increment(synfig::Time(1.0/get_canvas()->rend_desc().get_frame_rate()));
+       time_adjustment().set_page_increment(synfig::Time(1.0));
        time_adjustment().set_page_size(0);
        
        time_adjustment().changed();
        
-       /*sinfg::info("w: %p - [%.3f,%.3f] (%.3f,%.3f) child: %p\n",
+       /*synfig::info("w: %p - [%.3f,%.3f] (%.3f,%.3f) child: %p\n",
                                &time_window_adjustment_, time_window_adjustment_.get_lower(),
                                time_window_adjustment_.get_upper(),time_window_adjustment_.get_value(),
                                time_window_adjustment_.get_page_size(),time_window_adjustment_.get_child_adjustment()
@@ -1928,7 +1928,7 @@ CanvasView::refresh_rend_desc()
                time_adjustment().value_changed();
        }
        
-       /*sinfg::info("Time stats: \n"
+       /*synfig::info("Time stats: \n"
                                "w: %p - [%.3f,%.3f] (%.3f,%.3f) child: %p\n"
                                "t: %p - [%.3f,%.3f] %.3f",
                                &time_window_adjustment_, time_window_adjustment_.get_lower(),
@@ -1954,7 +1954,7 @@ CanvasView::close()
 handle<CanvasView>
 CanvasView::create(loose_handle<Instance> instance,handle<Canvas> canvas)
 {
-       etl::handle<studio::CanvasView> view(new CanvasView(instance,instance->sinfgapp::Instance::find_canvas_interface(canvas)));
+       etl::handle<studio::CanvasView> view(new CanvasView(instance,instance->synfigapp::Instance::find_canvas_interface(canvas)));
        instance->canvas_view_list().push_front(view);
        instance->signal_canvas_view_created()(view.get());
        return view;
@@ -1972,15 +1972,15 @@ CanvasView::update_title()
        else
                title+='"'+get_canvas()->get_name()+'"';
 
-       if(get_instance()->sinfgapp::Instance::get_action_count())
+       if(get_instance()->synfigapp::Instance::get_action_count())
                title+=_(" (Unsaved)");
 
-       if(get_instance()->sinfgapp::Instance::in_repository())
+       if(get_instance()->synfigapp::Instance::in_repository())
        {
                title+=" (CVS";
-               if(get_instance()->sinfgapp::Instance::is_modified())
+               if(get_instance()->synfigapp::Instance::is_modified())
                        title+=_("-MODIFIED");
-               if(get_instance()->sinfgapp::Instance::is_updated())
+               if(get_instance()->synfigapp::Instance::is_updated())
                        title+=_("-UPDATED");
                title+=')';
        }
@@ -2061,9 +2061,9 @@ CanvasView::build_tables()
 }
 
 void
-CanvasView::on_layer_toggle(sinfg::Layer::Handle layer)
+CanvasView::on_layer_toggle(synfig::Layer::Handle layer)
 {
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_activate"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("layer_activate"));
        assert(action);
        
        if(!action)
@@ -2072,7 +2072,7 @@ CanvasView::on_layer_toggle(sinfg::Layer::Handle layer)
        action->set_param("canvas",Canvas::Handle(layer->get_canvas()));
        if(!action->set_param("canvas_interface",canvas_interface()))
 //     if(!action->set_param("canvas_interface",get_instance()->find_canvas_interface(layer->get_canvas())))
-               sinfg::error("LayerActivate didn't like CanvasInterface...?");
+               synfig::error("LayerActivate didn't like CanvasInterface...?");
        action->set_param("time",get_time());
        action->set_param("layer",layer);
        action->set_param("new_status",!layer->active());
@@ -2084,7 +2084,7 @@ CanvasView::on_layer_toggle(sinfg::Layer::Handle layer)
 
 
 void
-CanvasView::popup_param_menu(sinfgapp::ValueDesc value_desc, float location)
+CanvasView::popup_param_menu(synfigapp::ValueDesc value_desc, float location)
 {
        parammenu.items().clear();
        get_instance()->make_param_menu(&parammenu,get_canvas(),value_desc,location);
@@ -2093,7 +2093,7 @@ CanvasView::popup_param_menu(sinfgapp::ValueDesc value_desc, float location)
 }
 
 void
-CanvasView::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList &param_list,sinfgapp::Action::Category category)const
+CanvasView::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamList &param_list,synfigapp::Action::Category category)const
 {
        get_instance()->add_actions_to_menu(menu, param_list, category);
 }
@@ -2133,7 +2133,7 @@ CanvasView::on_layer_user_click(int button, Gtk::TreeRow row, LayerTree::ColumnI
                        if(column_id==COLUMNID_TIME_TRACK)
                                return false;
                        
-                       //sinfgapp::ValueDesc value_desc(row[layer_param_tree_model.value_desc]);
+                       //synfigapp::ValueDesc value_desc(row[layer_param_tree_model.value_desc]);
                        //ValueNode::Handle value_node(row[layer_param_tree_model.value_node]);
                        //ValueNode::Handle parent_value_node;
                        //ValueBase value=row[layer_param_tree_model.value];
@@ -2145,7 +2145,7 @@ CanvasView::on_layer_user_click(int button, Gtk::TreeRow row, LayerTree::ColumnI
 
                        {
                                Layer::Handle layer(row[layer_tree_model.layer]);
-                               sinfgapp::Action::ParamList param_list;
+                               synfigapp::Action::ParamList param_list;
                                param_list.add("time",canvas_interface()->get_time());
                                param_list.add("canvas",Canvas::Handle(row[layer_tree_model.canvas]));
                                param_list.add("canvas_interface",canvas_interface());
@@ -2153,8 +2153,8 @@ CanvasView::on_layer_user_click(int button, Gtk::TreeRow row, LayerTree::ColumnI
                                        param_list.add("layer",layer);
                                else
                                {
-                                       sinfgapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
-                                       sinfgapp::SelectionManager::LayerList::iterator iter;
+                                       synfigapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
+                                       synfigapp::SelectionManager::LayerList::iterator iter;
                                
                                        for(iter=layer_list.begin();iter!=layer_list.end();++iter)
                                                param_list.add("layer",Layer::Handle(*iter));
@@ -2179,12 +2179,12 @@ CanvasView::on_layer_user_click(int button, Gtk::TreeRow row, LayerTree::ColumnI
                                        ));
                                }
                                
-                               add_actions_to_menu(&parammenu, param_list,sinfgapp::Action::CATEGORY_LAYER);
+                               add_actions_to_menu(&parammenu, param_list,synfigapp::Action::CATEGORY_LAYER);
                                parammenu.popup(button,gtk_get_current_event_time());
                                return true;
                        }
 /*
-                       else if(column_id==LayerTree::COLUMNID_TIME_TRACK && value_node && handle<sinfg::ValueNode_Animated>::cast_dynamic(value_node))
+                       else if(column_id==LayerTree::COLUMNID_TIME_TRACK && value_node && handle<synfig::ValueNode_Animated>::cast_dynamic(value_node))
                        {                                       
                                // Right-click on time track with animated
 //                             trackmenu.popup(0,0);
@@ -2203,10 +2203,10 @@ CanvasView::on_layer_user_click(int button, Gtk::TreeRow row, LayerTree::ColumnI
 #if 0
                                        parammenu.items().clear();
                                        parammenu.items().push_back(Gtk::Menu_Helpers::MenuElem("Connect",
-                                               hide_return(sigc::mem_fun(*canvas_interface().get(),&sinfgapp::CanvasInterface::connect_selected_layer_params))
+                                               hide_return(sigc::mem_fun(*canvas_interface().get(),&synfigapp::CanvasInterface::connect_selected_layer_params))
                                        ));
                                        parammenu.items().push_back(Gtk::Menu_Helpers::MenuElem("Disconnect",
-                                               hide_return(sigc::mem_fun(*canvas_interface().get(),&sinfgapp::CanvasInterface::disconnect_selected_layer_params))
+                                               hide_return(sigc::mem_fun(*canvas_interface().get(),&synfigapp::CanvasInterface::disconnect_selected_layer_params))
                                        ));
                                        parammenu.popup(0,0);
 #endif
@@ -2238,7 +2238,7 @@ CanvasView::on_children_user_click(int button, Gtk::TreeRow row, ChildrenTree::C
                                return false;
                        if(!(bool)row[children_tree_model.is_canvas])
                        {
-                               sinfgapp::ValueDesc value_desc=row[children_tree_model.value_desc];
+                               synfigapp::ValueDesc value_desc=row[children_tree_model.value_desc];
                                assert(value_desc);
                                popup_param_menu(value_desc);
                                return true;
@@ -2355,19 +2355,19 @@ CanvasView::time_zoom_out()
 void
 CanvasView::time_was_changed()
 {
-       sinfg::Time time((sinfg::Time)(double)time_adjustment().get_value());
+       synfig::Time time((synfig::Time)(double)time_adjustment().get_value());
        set_time(time);
 }
 
 void
-CanvasView::on_edited_value(sinfgapp::ValueDesc value_desc,sinfg::ValueBase new_value)
+CanvasView::on_edited_value(synfigapp::ValueDesc value_desc,synfig::ValueBase new_value)
 {
        canvas_interface()->change_value(value_desc,new_value);
 }
 
 /*
 void
-CanvasView::on_children_edited_value(const Glib::ustring&path_string,sinfg::ValueBase value)
+CanvasView::on_children_edited_value(const Glib::ustring&path_string,synfig::ValueBase value)
 {
        Gtk::TreePath path(path_string);
        
@@ -2375,7 +2375,7 @@ CanvasView::on_children_edited_value(const Glib::ustring&path_string,sinfg::Valu
 
        assert((bool)row[children_tree_model.is_value_node]);
 
-       sinfgapp::ValueDesc value_desc=row[children_tree_model.value_desc];
+       synfigapp::ValueDesc value_desc=row[children_tree_model.value_desc];
        assert(value_desc);
 
        on_edited_value(value_desc,value);
@@ -2390,10 +2390,10 @@ CanvasView::on_id_changed()
 
 
 void
-CanvasView::on_mode_changed(sinfgapp::CanvasInterface::Mode mode)
+CanvasView::on_mode_changed(synfigapp::CanvasInterface::Mode mode)
 {
        // If the aninimate flag was set in mode...
-       if(mode&sinfgapp::MODE_ANIMATE)
+       if(mode&synfigapp::MODE_ANIMATE)
        {
                Gtk::Image *icon;
                icon=manage(new Gtk::Image(Gtk::StockID("gtk-no"),Gtk::ICON_SIZE_BUTTON));
@@ -2414,40 +2414,40 @@ CanvasView::on_mode_changed(sinfgapp::CanvasInterface::Mode mode)
                icon->show();
        }
 
-       if((mode&sinfgapp::MODE_ANIMATE_FUTURE) && (mode&sinfgapp::MODE_ANIMATE_PAST))
+       if((mode&synfigapp::MODE_ANIMATE_FUTURE) && (mode&synfigapp::MODE_ANIMATE_PAST))
        {
                Gtk::Image *icon;
-               icon=manage(new Gtk::Image(Gtk::StockID("sinfg-keyframe_lock_all"),Gtk::ICON_SIZE_BUTTON));
+               icon=manage(new Gtk::Image(Gtk::StockID("synfig-keyframe_lock_all"),Gtk::ICON_SIZE_BUTTON));
                keyframebutton->remove();       
                keyframebutton->add(*icon);     
                tooltips.set_tip(*keyframebutton,_("All Keyframes Locked"));
                icon->set_padding(0,0);
                icon->show();
        }
-       else if((mode&sinfgapp::MODE_ANIMATE_FUTURE) && !(mode&sinfgapp::MODE_ANIMATE_PAST))
+       else if((mode&synfigapp::MODE_ANIMATE_FUTURE) && !(mode&synfigapp::MODE_ANIMATE_PAST))
        {
                Gtk::Image *icon;
-               icon=manage(new Gtk::Image(Gtk::StockID("sinfg-keyframe_lock_future"),Gtk::ICON_SIZE_BUTTON));
+               icon=manage(new Gtk::Image(Gtk::StockID("synfig-keyframe_lock_future"),Gtk::ICON_SIZE_BUTTON));
                keyframebutton->remove();       
                keyframebutton->add(*icon);     
                tooltips.set_tip(*keyframebutton,_("Future Keyframes Locked"));
                icon->set_padding(0,0);
                icon->show();
        }
-       else if(!(mode&sinfgapp::MODE_ANIMATE_FUTURE) && (mode&sinfgapp::MODE_ANIMATE_PAST))
+       else if(!(mode&synfigapp::MODE_ANIMATE_FUTURE) && (mode&synfigapp::MODE_ANIMATE_PAST))
        {
                Gtk::Image *icon;
-               icon=manage(new Gtk::Image(Gtk::StockID("sinfg-keyframe_lock_past"),Gtk::ICON_SIZE_BUTTON));
+               icon=manage(new Gtk::Image(Gtk::StockID("synfig-keyframe_lock_past"),Gtk::ICON_SIZE_BUTTON));
                keyframebutton->remove();       
                keyframebutton->add(*icon);     
                tooltips.set_tip(*keyframebutton,_("Past Keyframes Locked"));
                icon->set_padding(0,0);
                icon->show();
        }
-       else if(!(mode&sinfgapp::MODE_ANIMATE_FUTURE) && !(mode&sinfgapp::MODE_ANIMATE_PAST))
+       else if(!(mode&synfigapp::MODE_ANIMATE_FUTURE) && !(mode&synfigapp::MODE_ANIMATE_PAST))
        {
                Gtk::Image *icon;
-               icon=manage(new Gtk::Image(Gtk::StockID("sinfg-keyframe_lock_none"),Gtk::ICON_SIZE_BUTTON));
+               icon=manage(new Gtk::Image(Gtk::StockID("synfig-keyframe_lock_none"),Gtk::ICON_SIZE_BUTTON));
                keyframebutton->remove();       
                keyframebutton->add(*icon);     
                tooltips.set_tip(*keyframebutton,_("No Keyframes Locked"));
@@ -2461,43 +2461,43 @@ CanvasView::on_mode_changed(sinfgapp::CanvasInterface::Mode mode)
 void
 CanvasView::on_animate_button_pressed()
 {
-       if(get_mode()&sinfgapp::MODE_ANIMATE)
-               set_mode(get_mode()-sinfgapp::MODE_ANIMATE);
+       if(get_mode()&synfigapp::MODE_ANIMATE)
+               set_mode(get_mode()-synfigapp::MODE_ANIMATE);
        else
-               set_mode(get_mode()|sinfgapp::MODE_ANIMATE);
+               set_mode(get_mode()|synfigapp::MODE_ANIMATE);
 }
 
 void
 CanvasView::on_keyframe_button_pressed()
 {
-       sinfgapp::CanvasInterface::Mode mode(get_mode());
+       synfigapp::CanvasInterface::Mode mode(get_mode());
        
-       if((mode&sinfgapp::MODE_ANIMATE_FUTURE) && (mode&sinfgapp::MODE_ANIMATE_PAST))
+       if((mode&synfigapp::MODE_ANIMATE_FUTURE) && (mode&synfigapp::MODE_ANIMATE_PAST))
        {
-               set_mode(get_mode()-sinfgapp::MODE_ANIMATE_FUTURE);
+               set_mode(get_mode()-synfigapp::MODE_ANIMATE_FUTURE);
        }
-       else if(!(mode&sinfgapp::MODE_ANIMATE_FUTURE) && (mode&sinfgapp::MODE_ANIMATE_PAST))
+       else if(!(mode&synfigapp::MODE_ANIMATE_FUTURE) && (mode&synfigapp::MODE_ANIMATE_PAST))
        {
-               set_mode(get_mode()-sinfgapp::MODE_ANIMATE_PAST|sinfgapp::MODE_ANIMATE_FUTURE);
+               set_mode(get_mode()-synfigapp::MODE_ANIMATE_PAST|synfigapp::MODE_ANIMATE_FUTURE);
        }
-       else if((mode&sinfgapp::MODE_ANIMATE_FUTURE) && !(mode&sinfgapp::MODE_ANIMATE_PAST))
+       else if((mode&synfigapp::MODE_ANIMATE_FUTURE) && !(mode&synfigapp::MODE_ANIMATE_PAST))
        {
-               set_mode(get_mode()-sinfgapp::MODE_ANIMATE_FUTURE);
+               set_mode(get_mode()-synfigapp::MODE_ANIMATE_FUTURE);
        }
-       else if(!(mode&sinfgapp::MODE_ANIMATE_FUTURE) && !(mode&sinfgapp::MODE_ANIMATE_PAST))
+       else if(!(mode&synfigapp::MODE_ANIMATE_FUTURE) && !(mode&synfigapp::MODE_ANIMATE_PAST))
        {
-               set_mode(get_mode()|sinfgapp::MODE_ANIMATE_FUTURE|sinfgapp::MODE_ANIMATE_PAST);
+               set_mode(get_mode()|synfigapp::MODE_ANIMATE_FUTURE|synfigapp::MODE_ANIMATE_PAST);
        }
 }
 
 bool
-CanvasView::duck_change_param(const Point &value,sinfg::Layer::Handle layer, sinfg::String param_name)
+CanvasView::duck_change_param(const Point &value,synfig::Layer::Handle layer, synfig::String param_name)
 {
-       return canvas_interface()->change_value(sinfgapp::ValueDesc(layer,param_name),value);
+       return canvas_interface()->change_value(synfigapp::ValueDesc(layer,param_name),value);
 }
 
 bool
-CanvasView::on_duck_changed(const sinfg::Point &value,const sinfgapp::ValueDesc& value_desc)
+CanvasView::on_duck_changed(const synfig::Point &value,const synfigapp::ValueDesc& value_desc)
 {
        switch(value_desc.get_value_type())
        {
@@ -2518,11 +2518,11 @@ CanvasView::on_duck_changed(const sinfg::Point &value,const sinfgapp::ValueDesc&
 void
 CanvasView::selected_layer_color_set(Color color)
 {
-       sinfgapp::SelectionManager::LayerList selected_list(get_selection_manager()->get_selected_layers());
-       sinfgapp::SelectionManager::LayerList::iterator iter;
+       synfigapp::SelectionManager::LayerList selected_list(get_selection_manager()->get_selected_layers());
+       synfigapp::SelectionManager::LayerList::iterator iter;
 
        // Create the action group
-       //sinfgapp::PassiveGrouper group(canvas_interface()->get_instance(),_("Set Colors"));
+       //synfigapp::PassiveGrouper group(canvas_interface()->get_instance(),_("Set Colors"));
 
        Layer::Handle layer;
        for(iter=selected_list.begin();iter!=selected_list.end();++iter)
@@ -2530,12 +2530,12 @@ CanvasView::selected_layer_color_set(Color color)
                if(*iter==layer)
                        continue;
                layer=*iter;
-               on_edited_value(sinfgapp::ValueDesc(layer,"color"),color);
+               on_edited_value(synfigapp::ValueDesc(layer,"color"),color);
        }
 }
 
 void
-CanvasView::rebuild_ducks_layer_(sinfg::TransformStack& transform_stack, Canvas::Handle canvas, std::set<sinfg::Layer::Handle>& selected_list)
+CanvasView::rebuild_ducks_layer_(synfig::TransformStack& transform_stack, Canvas::Handle canvas, std::set<synfig::Layer::Handle>& selected_list)
 {
        int transforms(0);
        String layer_name;
@@ -2544,7 +2544,7 @@ CanvasView::rebuild_ducks_layer_(sinfg::TransformStack& transform_stack, Canvas:
 
        if(!canvas)
        {
-               sinfg::warning("CanvasView::rebuild_ducks_layer_(): Layer doesn't have canvas set");
+               synfig::warning("CanvasView::rebuild_ducks_layer_(): Layer doesn't have canvas set");
                return;
        }
        for(Canvas::iterator iter(canvas->begin());iter!=canvas->end();++iter)
@@ -2576,7 +2576,7 @@ CanvasView::rebuild_ducks_layer_(sinfg::TransformStack& transform_stack, Canvas:
                        {
                                if(!iter->get_hidden() && !iter->get_invisible_duck())
                                {
-                                       sinfgapp::ValueDesc value_desc(layer,iter->get_name());
+                                       synfigapp::ValueDesc value_desc(layer,iter->get_name());
                                        work_area->add_to_ducks(value_desc,this,transform_stack,&*iter);
                                        if(value_desc.is_value_node())
                                                duck_changed_connections.push_back(value_desc.get_value_node()->signal_changed().connect(QUEUE_REBUILD_DUCKS));
@@ -2614,25 +2614,25 @@ CanvasView::rebuild_ducks_layer_(sinfg::TransformStack& transform_stack, Canvas:
 /*                     // Add transforms onto the stack
                        if(layer_name=="Translate")
                        {
-                               transform_stack.push(sinfg::Transform_Translate(layer->get_param("origin").get(Vector())));
+                               transform_stack.push(synfig::Transform_Translate(layer->get_param("origin").get(Vector())));
                                transforms++;
                        }else
                        if(layer_name=="Zoom")
                        {
                                Vector scale;
                                scale[0]=scale[1]=exp(layer->get_param("amount").get(Real()));
-                               transform_stack.push(sinfg::Transform_Scale(scale,layer->get_param("center").get(Vector())));
+                               transform_stack.push(synfig::Transform_Scale(scale,layer->get_param("center").get(Vector())));
                                transforms++;
                        }else
                        if(layer_name=="stretch")
                        {
                                Vector scale(layer->get_param("amount").get(Vector()));
-                               transform_stack.push(sinfg::Transform_Scale(scale,layer->get_param("center").get(Vector())));
+                               transform_stack.push(synfig::Transform_Scale(scale,layer->get_param("center").get(Vector())));
                                transforms++;
                        }else
                        if(layer_name=="Rotate")
                        {
-                               transform_stack.push(sinfg::Transform_Rotate(layer->get_param("amount").get(Angle()),layer->get_param("origin").get(Vector())));
+                               transform_stack.push(synfig::Transform_Rotate(layer->get_param("amount").get(Angle()),layer->get_param("origin").get(Vector())));
                                transforms++;
                        }
 */
@@ -2695,7 +2695,7 @@ CanvasView::rebuild_ducks()
        /*static int i=0;
        i++;
        if(i>30)
-               sinfg::info("%d",i/(i-i));
+               synfig::info("%d",i/(i-i));
        */
        
        rebuild_ducks_queued=false;
@@ -2729,13 +2729,13 @@ CanvasView::rebuild_ducks()
        
        // First do the layers...       
        do{
-               sinfgapp::SelectionManager::LayerList selected_list(get_selection_manager()->get_selected_layers());
-               std::set<sinfg::Layer::Handle> layer_set(selected_list.begin(),selected_list.end());
+               synfigapp::SelectionManager::LayerList selected_list(get_selection_manager()->get_selected_layers());
+               std::set<synfig::Layer::Handle> layer_set(selected_list.begin(),selected_list.end());
                
                if(!layer_set.empty())
                        not_empty=true;
                
-               sinfg::TransformStack transform_stack;
+               synfig::TransformStack transform_stack;
                
                rebuild_ducks_layer_(transform_stack, get_canvas(), layer_set);
 
@@ -2743,9 +2743,9 @@ CanvasView::rebuild_ducks()
 
        // Now do the children
        do{
-               sinfgapp::SelectionManager::ChildrenList selected_list(get_selection_manager()->get_selected_children());
-               sinfgapp::SelectionManager::ChildrenList::iterator iter;
-               sinfg::TransformStack transform_stack;
+               synfigapp::SelectionManager::ChildrenList selected_list(get_selection_manager()->get_selected_children());
+               synfigapp::SelectionManager::ChildrenList::iterator iter;
+               synfig::TransformStack transform_stack;
        
                if(selected_list.empty())
                {
@@ -2853,7 +2853,7 @@ CanvasView::show_tables()
        Smach::event_result x(process_event_key(EVENT_TABLES_SHOW));
        if(x==Smach::RESULT_OK || x==Smach::RESULT_ACCEPT)
        {
-               Gtk::IconSize iconsize=Gtk::IconSize::from_name("sinfg-small_icon");
+               Gtk::IconSize iconsize=Gtk::IconSize::from_name("synfig-small_icon");
                treetogglebutton->remove();
                treetogglebutton->add(*manage(new Gtk::Image(Gtk::StockID("gtk-go-down"),iconsize)));   
                treetogglebutton->show_all();
@@ -2869,7 +2869,7 @@ CanvasView::hide_tables()
        Smach::event_result x(process_event_key(EVENT_TABLES_HIDE));
        if(x==Smach::RESULT_OK || x==Smach::RESULT_ACCEPT)
        {
-               Gtk::IconSize iconsize=Gtk::IconSize::from_name("sinfg-small_icon");
+               Gtk::IconSize iconsize=Gtk::IconSize::from_name("synfig-small_icon");
                treetogglebutton->remove();
                treetogglebutton->add(*manage(new Gtk::Image(Gtk::StockID("gtk-go-up"),iconsize)));     
                treetogglebutton->show_all();
@@ -2946,7 +2946,7 @@ CanvasView::hide_timebar()
 
 
 void
-CanvasView::on_waypoint_clicked(sinfgapp::ValueDesc value_desc,sinfg::Waypoint waypoint,int button)
+CanvasView::on_waypoint_clicked(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint,int button)
 {
        waypoint_dialog.set_value_desc(value_desc);
        waypoint_dialog.set_waypoint(waypoint);
@@ -2964,7 +2964,7 @@ CanvasView::on_waypoint_clicked(sinfgapp::ValueDesc value_desc,sinfg::Waypoint w
                                sigc::bind(
                                        sigc::mem_fun(
                                                *canvas_interface(),
-                                               &sinfgapp::CanvasInterface::set_time
+                                               &synfigapp::CanvasInterface::set_time
                                        ),
                                        waypoint.get_time()
                                )
@@ -2977,12 +2977,12 @@ CanvasView::on_waypoint_clicked(sinfgapp::ValueDesc value_desc,sinfg::Waypoint w
                                )
                        ));
                        
-                       waypoint_menu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-duplicate"),
+                       waypoint_menu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-duplicate"),
                                sigc::bind(
                                        sigc::bind(
                                                sigc::mem_fun(
                                                        *canvas_interface(),
-                                                       &sinfgapp::CanvasInterface::waypoint_duplicate
+                                                       &synfigapp::CanvasInterface::waypoint_duplicate
                                                ),
                                                waypoint
                                        ),
@@ -2994,7 +2994,7 @@ CanvasView::on_waypoint_clicked(sinfgapp::ValueDesc value_desc,sinfg::Waypoint w
                                        sigc::bind(
                                                sigc::mem_fun(
                                                        *canvas_interface(),
-                                                       &sinfgapp::CanvasInterface::waypoint_remove
+                                                       &synfigapp::CanvasInterface::waypoint_remove
                                                ),
                                                waypoint
                                        ),
@@ -3012,7 +3012,7 @@ CanvasView::on_waypoint_clicked(sinfgapp::ValueDesc value_desc,sinfg::Waypoint w
 void
 CanvasView::on_waypoint_changed()
 {
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list.add("canvas",get_canvas());
        param_list.add("canvas_interface",canvas_interface());
        param_list.add("value_node",waypoint_dialog.get_value_desc().get_value_node());
@@ -3025,7 +3025,7 @@ CanvasView::on_waypoint_changed()
 void
 CanvasView::on_waypoint_delete()
 {
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list.add("canvas",get_canvas());
        param_list.add("canvas_interface",canvas_interface());
        param_list.add("value_node",waypoint_dialog.get_value_desc().get_value_node());
@@ -3040,23 +3040,23 @@ CanvasView::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& con
 {
        // We will make this true once we have a solid drop
        bool success(false);
-       //sinfg::info("Droped data of type \"%s\"",selection_data.get_data_type());
-       //sinfg::info("Droped data of target \"%s\"",gdk_atom_name(selection_data->target));
-       //sinfg::info("selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       //synfig::info("Droped data of type \"%s\"",selection_data.get_data_type());
+       //synfig::info("Droped data of target \"%s\"",gdk_atom_name(selection_data->target));
+       //synfig::info("selection=\"%s\"",gdk_atom_name(selection_data->selection));
        
        if ((selection_data_.get_length() >= 0) && (selection_data_.get_format() == 8))
        {
-               if(sinfg::String(selection_data_.get_data_type())=="STRING")do
+               if(synfig::String(selection_data_.get_data_type())=="STRING")do
                {
-                       sinfg::String selection_data((gchar *)(selection_data_.get_data()));
+                       synfig::String selection_data((gchar *)(selection_data_.get_data()));
 
-                       Layer::Handle layer(sinfg::Layer::create("Text"));
+                       Layer::Handle layer(synfig::Layer::create("Text"));
                        if(!layer)
                                break;
                        if(!layer->set_param("text",ValueBase(selection_data)))
                                break;
 
-                       sinfgapp::Action::Handle        action(sinfgapp::Action::create("layer_add"));
+                       synfigapp::Action::Handle       action(synfigapp::Action::create("layer_add"));
                
                        assert(action);
                        if(!action)
@@ -3073,22 +3073,22 @@ CanvasView::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& con
                        success=true;
                } while(0); // END of "STRING"
                
-               if(sinfg::String(selection_data_.get_data_type())=="text/plain")
+               if(synfig::String(selection_data_.get_data_type())=="text/plain")
                {
-                       sinfg::String selection_data((gchar *)(selection_data_.get_data()));
+                       synfig::String selection_data((gchar *)(selection_data_.get_data()));
        
                        // For some reason, GTK hands us a list of URL's seperated
                        // by not only Carrage-Returns, but also Line-Feeds.
                        // Line-Feeds will mess us up. Remove all the line-feeds.
-                       while(selection_data.find_first_of('\r')!=sinfg::String::npos)
+                       while(selection_data.find_first_of('\r')!=synfig::String::npos)
                                selection_data.erase(selection_data.begin()+selection_data.find_first_of('\r'));
        
                        std::stringstream stream(selection_data);
        
-                       //sinfgapp::PassiveGrouper group(canvas_interface()->get_instance(),_("Insert Image"));
+                       //synfigapp::PassiveGrouper group(canvas_interface()->get_instance(),_("Insert Image"));
                        while(stream)
                        {
-                               sinfg::String filename,URI;
+                               synfig::String filename,URI;
                                getline(stream,filename);
                                
                                // If we don't have a filename, move on.
@@ -3099,12 +3099,12 @@ CanvasView::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& con
                                URI=String(filename.begin(),filename.begin()+sizeof("file://")-1);
                                if(URI!="file://")
                                {
-                                       sinfg::warning("Unknown URI (%s) in \"%s\"",URI.c_str(),filename.c_str());
+                                       synfig::warning("Unknown URI (%s) in \"%s\"",URI.c_str(),filename.c_str());
                                        continue;
                                }
                                
                                // Strip the "file://" part from the filename
-                               filename=sinfg::String(filename.begin()+sizeof("file://")-1,filename.end());
+                               filename=synfig::String(filename.begin()+sizeof("file://")-1,filename.end());
 
                                String ext;
                                try{ext=(String(filename.begin()+filename.find_last_of('.')+1,filename.end()));}catch(...){continue;}
@@ -3138,7 +3138,7 @@ CanvasView::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& con
 void
 CanvasView::on_keyframe_add_pressed()
 {
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_add"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_add"));
 
        if(!action)
        {
@@ -3166,7 +3166,7 @@ CanvasView::on_keyframe_duplicate_pressed()
        }               
        keyframe=row[model.keyframe];
 
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_duplicate"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_duplicate"));
 
        if(!action)
        {
@@ -3195,7 +3195,7 @@ CanvasView::on_keyframe_remove_pressed()
        }               
        keyframe=row[model.keyframe];
 
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_remove"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_remove"));
 
        if(!action)
        {
@@ -3249,7 +3249,7 @@ CanvasView::toggle_duck_mask(Duckmatic::Type type)
                break;
 
        default:
-               sinfg::warning("CanvasView::toggle_duck_mask():Unknown duck type!");
+               synfig::warning("CanvasView::toggle_duck_mask():Unknown duck type!");
                break;
        }
 
@@ -3285,8 +3285,8 @@ CanvasView::on_input_device_changed(GdkDevice* device)
        }
        assert(device);
        
-       sinfgapp::InputDevice::Handle input_device;
-       input_device=sinfgapp::Main::select_input_device(device->name);
+       synfigapp::InputDevice::Handle input_device;
+       input_device=synfigapp::Main::select_input_device(device->name);
        App::toolbox->change_state(input_device->get_state());
        process_event_key(EVENT_INPUT_DEVICE_CHANGED);
 }
@@ -3361,7 +3361,7 @@ CanvasView::on_preview_create(const PreviewInfo &info)
 void
 CanvasView::on_audio_option()
 {
-       sinfg::warning("Launching Audio Options");
+       synfig::warning("Launching Audio Options");
        sound_dialog->set_global_fps(get_canvas()->rend_desc().get_frame_rate());
        sound_dialog->present();
 }
@@ -3387,14 +3387,14 @@ CanvasView::on_audio_file_notify()
        
        if(!audio->load(file,dirname(get_canvas()->get_file_name())+string("/")))
        {
-               if(file != "") sinfg::warning("Could not load the file: %s", file.c_str());
+               if(file != "") synfig::warning("Could not load the file: %s", file.c_str());
                get_canvas()->erase_meta_data("audiofile");
                disp_audio->hide();
                disp_audio->set_profile(etl::handle<AudioProfile>());
        }else
        {
                //save in canvasview            
-               sinfg::warning("Getting the profile of the music stuff");
+               synfig::warning("Getting the profile of the music stuff");
                
                //profile specific stuff for the preview widget
                //similar for other attachments
@@ -3405,14 +3405,14 @@ CanvasView::on_audio_file_notify()
                
                if(!prof)
                {
-                       sinfg::warning("Agh, I couldn't build the profile captain!");                   
+                       synfig::warning("Agh, I couldn't build the profile captain!");                  
                }
                pd->get_widget().set_audioprofile(prof);
                
                disp_audio->set_profile(audio->get_profile());
                disp_audio->show();
                
-               sinfg::warning("successfully set the profiles and stuff");
+               synfig::warning("successfully set the profiles and stuff");
        }
        disp_audio->queue_draw();
 }
@@ -3425,7 +3425,7 @@ CanvasView::on_audio_offset_notify()
        sound_dialog->set_offset(t);
        disp_audio->queue_draw();
        
-       sinfg::info("CanvasView::on_audio_offset_notify(): offset time set to %s",t.get_string(get_canvas()->rend_desc().get_frame_rate()).c_str());
+       synfig::info("CanvasView::on_audio_offset_notify(): offset time set to %s",t.get_string(get_canvas()->rend_desc().get_frame_rate()).c_str());
 }
 
 void
@@ -3433,7 +3433,7 @@ CanvasView::play_audio(float t)
 {
        if(audio.get())
        {
-               sinfg::info("Playing audio at %f s",t);
+               synfig::info("Playing audio at %f s",t);
                audio->play(t);
        }               
 }
@@ -3457,49 +3457,49 @@ CanvasView::on_audio_scrub()
 
 
 Glib::RefPtr<Glib::ObjectBase>
-CanvasView::get_ref_obj(const sinfg::String& x)
+CanvasView::get_ref_obj(const synfig::String& x)
 {
        return ref_obj_book_[x];
 }
 
 Glib::RefPtr<const Glib::ObjectBase>
-CanvasView::get_ref_obj(const sinfg::String& x)const
+CanvasView::get_ref_obj(const synfig::String& x)const
 {
        return ref_obj_book_.find(x)->second;
 }
 
 void
-CanvasView::set_ref_obj(const sinfg::String& x, Glib::RefPtr<Glib::ObjectBase> y)
+CanvasView::set_ref_obj(const synfig::String& x, Glib::RefPtr<Glib::ObjectBase> y)
 {
        ref_obj_book_[x]=y;
 }
 
 Glib::RefPtr<Gtk::TreeModel>
-CanvasView::get_tree_model(const sinfg::String& x)
+CanvasView::get_tree_model(const synfig::String& x)
 {
        return Glib::RefPtr<Gtk::TreeModel>::cast_dynamic(ref_obj_book_["_tree_model_"+x]);
 }
 
 Glib::RefPtr<const Gtk::TreeModel>
-CanvasView::get_tree_model(const sinfg::String& x)const
+CanvasView::get_tree_model(const synfig::String& x)const
 {
        return Glib::RefPtr<Gtk::TreeModel>::cast_dynamic(ref_obj_book_.find("_tree_model_"+x)->second);
 }
 
 void
-CanvasView::set_tree_model(const sinfg::String& x, Glib::RefPtr<Gtk::TreeModel> y)
+CanvasView::set_tree_model(const synfig::String& x, Glib::RefPtr<Gtk::TreeModel> y)
 {
        ref_obj_book_["_tree_model_"+x]=Glib::RefPtr<Glib::ObjectBase>::cast_static(y);
 }
 
 Gtk::Widget*
-CanvasView::get_ext_widget(const sinfg::String& x)
+CanvasView::get_ext_widget(const synfig::String& x)
 {
        return ext_widget_book_[x];
 }
 
 void
-CanvasView::set_ext_widget(const sinfg::String& x, Gtk::Widget* y)
+CanvasView::set_ext_widget(const synfig::String& x, Gtk::Widget* y)
 {
        ext_widget_book_[x]=y;
        if(x=="layers_cmp")
@@ -3527,7 +3527,7 @@ static bool _close_instance(etl::handle<Instance> instance)
 {
        etl::handle<Instance> argh(instance);
        instance->safe_close();
-       sinfg::info("closed");
+       synfig::info("closed");
        return false;
 }
 
index 887e622..aea06f3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file canvasview.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_GTKMM_CANVASVIEW_H
-#define __SINFG_STUDIO_GTKMM_CANVASVIEW_H
+#ifndef __SYNFIG_STUDIO_GTKMM_CANVASVIEW_H
+#define __SYNFIG_STUDIO_GTKMM_CANVASVIEW_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/notebook.h>
 #include <gdkmm/device.h>
 
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/selectionmanager.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/selectionmanager.h>
 
-#include <sinfg/canvas.h>
-#include <sinfg/string.h>
-#include <sinfg/time.h>
+#include <synfig/canvas.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
 
 #include "instance.h"
 #include "canvasproperties.h"
 #include <map>
 #include <gtkmm/toggleaction.h>
 #include <gtkmm/radioaction.h>
-#include <sinfg/rect.h>
+#include <synfig/rect.h>
 
 #include "adjust_window.h"
 
-#include <sinfg/transform.h>
+#include <synfig/transform.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -119,7 +119,7 @@ class Widget_Time;
 class Dialog_SoundSelect;
 class Dialog_Preview;
 
-class sinfg::TransformStack;
+class synfig::TransformStack;
 class Dock_Layers;
 class Dock_Children;
 class Dock_Keyframes;
@@ -166,7 +166,7 @@ public:
        };
        friend class IsWorking;
 
-       typedef sinfgapp::CanvasInterface::Mode Mode;
+       typedef synfigapp::CanvasInterface::Mode Mode;
 
        /*
  -- ** -- P R I V A T E   D A T A ---------------------------------------------
@@ -178,10 +178,10 @@ public:
        WorkArea* get_work_area() { return work_area.get(); }
 private:
 
-       sinfg::TransformStack curr_transform_stack;
+       synfig::TransformStack curr_transform_stack;
        bool curr_transform_stack_set;
 
-       sinfg::Rect bbox;
+       synfig::Rect bbox;
 
        DEBUGPOINT_CLASS(1);
 
@@ -191,7 +191,7 @@ private:
        DEBUGPOINT_CLASS(2);
 
        etl::loose_handle<Instance> instance_;
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::handle<synfigapp::CanvasInterface> canvas_interface_;
 
        DEBUGPOINT_CLASS(3);
 
@@ -223,9 +223,9 @@ private:
 
        DEBUGPOINT_CLASS(5);
        
-       //std::map<sinfg::String,Glib::RefPtr<Gtk::TreeModel> > tree_model_book_;
-       std::map<sinfg::String,Glib::RefPtr<Glib::ObjectBase> > ref_obj_book_;
-       std::map<sinfg::String,Gtk::Widget*> ext_widget_book_;
+       //std::map<synfig::String,Glib::RefPtr<Gtk::TreeModel> > tree_model_book_;
+       std::map<synfig::String,Glib::RefPtr<Glib::ObjectBase> > ref_obj_book_;
+       std::map<synfig::String,Gtk::Widget*> ext_widget_book_;
 
 
        //! The time adjustment's scope is defined by the time_window adjustment
@@ -319,8 +319,8 @@ private:
        Glib::RefPtr<Gtk::ActionGroup> action_group;
 
 
-       etl::handle<sinfgapp::UIInterface> ui_interface_;
-       etl::handle<sinfgapp::SelectionManager> selection_manager_;
+       etl::handle<synfigapp::UIInterface> ui_interface_;
+       etl::handle<synfigapp::SelectionManager> selection_manager_;
        
        bool is_playing_;
 
@@ -371,7 +371,7 @@ public:
 private:
        
        // Constructor is private to force the use of the "create()" constructor
-       CanvasView(etl::loose_handle<Instance> instance,etl::handle<sinfgapp::CanvasInterface> canvas_interface);
+       CanvasView(etl::loose_handle<Instance> instance,etl::handle<synfigapp::CanvasInterface> canvas_interface);
 
        //! Constructor Helper
        Gtk::Widget* create_layer_tree();
@@ -388,7 +388,7 @@ private:
        //! Constructor Helper - Initializes all of the menus
        void init_menus();
 
-       bool duck_change_param(const sinfg::Point &value,sinfg::Layer::Handle layer, sinfg::String param_name);
+       bool duck_change_param(const synfig::Point &value,synfig::Layer::Handle layer, synfig::String param_name);
 
        void refresh_time_window();
 
@@ -404,47 +404,47 @@ private:
 
 
 
-       void popup_param_menu_bezier(float location, sinfgapp::ValueDesc value_desc)
+       void popup_param_menu_bezier(float location, synfigapp::ValueDesc value_desc)
        { popup_param_menu(value_desc,location); }
        
-       void popup_param_menu(sinfgapp::ValueDesc value_desc, float location=0);
+       void popup_param_menu(synfigapp::ValueDesc value_desc, float location=0);
 
 
-       void workarea_layer_selected(sinfg::Layer::Handle layer);
+       void workarea_layer_selected(synfig::Layer::Handle layer);
 
-       void selected_layer_color_set(sinfg::Color color);
+       void selected_layer_color_set(synfig::Color color);
                
 
 
-       void register_layer_type(sinfg::Layer::Book::value_type &lyr,std::map<sinfg::String,Gtk::Menu*>*);
+       void register_layer_type(synfig::Layer::Book::value_type &lyr,std::map<synfig::String,Gtk::Menu*>*);
 
        //! Rebuilds the "new layer" menu
        void build_new_layer_menu(Gtk::Menu &menu);
 
-       void rebuild_ducks_layer_(sinfg::TransformStack& transform_stack, sinfg::Canvas::Handle canvas, std::set<sinfg::Layer::Handle>& selected_list);
+       void rebuild_ducks_layer_(synfig::TransformStack& transform_stack, synfig::Canvas::Handle canvas, std::set<synfig::Layer::Handle>& selected_list);
 
        /*
  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
        */
 
 public:
-       const sinfg::TransformStack& get_curr_transform_stack()const { return curr_transform_stack; }
+       const synfig::TransformStack& get_curr_transform_stack()const { return curr_transform_stack; }
 
-       const sinfg::Rect& get_bbox()const { return bbox; }
+       const synfig::Rect& get_bbox()const { return bbox; }
 
-       Glib::RefPtr<Glib::ObjectBase> get_ref_obj(const sinfg::String& x);
-       Glib::RefPtr<const Glib::ObjectBase> get_ref_obj(const sinfg::String& x)const;
-       void set_ref_obj(const sinfg::String& x, Glib::RefPtr<Glib::ObjectBase> y);
+       Glib::RefPtr<Glib::ObjectBase> get_ref_obj(const synfig::String& x);
+       Glib::RefPtr<const Glib::ObjectBase> get_ref_obj(const synfig::String& x)const;
+       void set_ref_obj(const synfig::String& x, Glib::RefPtr<Glib::ObjectBase> y);
 
-       Glib::RefPtr<Gtk::TreeModel> get_tree_model(const sinfg::String& x);
-       Glib::RefPtr<const Gtk::TreeModel> get_tree_model(const sinfg::String& x)const;
-       void set_tree_model(const sinfg::String& x, Glib::RefPtr<Gtk::TreeModel> y);
+       Glib::RefPtr<Gtk::TreeModel> get_tree_model(const synfig::String& x);
+       Glib::RefPtr<const Gtk::TreeModel> get_tree_model(const synfig::String& x)const;
+       void set_tree_model(const synfig::String& x, Glib::RefPtr<Gtk::TreeModel> y);
 
-       Gtk::Widget* get_ext_widget(const sinfg::String& x);
-       void set_ext_widget(const sinfg::String& x, Gtk::Widget* y);
+       Gtk::Widget* get_ext_widget(const synfig::String& x);
+       void set_ext_widget(const synfig::String& x, Gtk::Widget* y);
        
-       //std::map<sinfg::String,Gtk::Widget*>& tree_view_book() { return tree_view_book_; }
-       //std::map<sinfg::String,Gtk::Widget*>& ext_widget_book() { return tree_view_book_; }
+       //std::map<synfig::String,Gtk::Widget*>& tree_view_book() { return tree_view_book_; }
+       //std::map<synfig::String,Gtk::Widget*>& ext_widget_book() { return tree_view_book_; }
 
        void popup_main_menu();
 
@@ -454,7 +454,7 @@ public:
        
        Smach::event_result process_event_key(EventKey x);
        
-       void popup_layer_menu(sinfg::Layer::Handle layer);
+       void popup_layer_menu(synfig::Layer::Handle layer);
 
        virtual ~CanvasView();
 
@@ -470,9 +470,9 @@ public:
        
        const studio::Adjust_Window &time_window_adjustment()const { return time_window_adjustment_; }
 
-       etl::handle<sinfgapp::UIInterface> get_ui_interface() { return ui_interface_;}
+       etl::handle<synfigapp::UIInterface> get_ui_interface() { return ui_interface_;}
 
-       etl::handle<sinfgapp::SelectionManager> get_selection_manager() { return selection_manager_; }
+       etl::handle<synfigapp::SelectionManager> get_selection_manager() { return selection_manager_; }
 
        Glib::RefPtr<Gtk::TreeModel> layer_tree_store() { return get_tree_model("layers"); }
        
@@ -486,19 +486,19 @@ public:
        
        Glib::RefPtr<const Gtk::TreeModel> keyframe_tree_store()const { return get_tree_model("keyframes"); }
 
-       void set_time(sinfg::Time t) { canvas_interface_->set_time(t); }
+       void set_time(synfig::Time t) { canvas_interface_->set_time(t); }
        
-       sinfg::Time get_time() { return canvas_interface_->get_time(); }
+       synfig::Time get_time() { return canvas_interface_->get_time(); }
 
-       etl::handle<sinfg::Canvas> get_canvas()const { return canvas_interface_->get_canvas(); }
+       etl::handle<synfig::Canvas> get_canvas()const { return canvas_interface_->get_canvas(); }
 
        etl::handle<Instance> get_instance()const { return instance_; }
 
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
+       etl::handle<synfigapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
 
-       etl::handle<const sinfgapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
+       etl::handle<const synfigapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
 
-       void add_actions_to_menu(Gtk::Menu *menu,   const sinfgapp::Action::ParamList &param_list, sinfgapp::Action::Category category=sinfgapp::Action::CATEGORY_ALL)const;
+       void add_actions_to_menu(Gtk::Menu *menu,   const synfigapp::Action::ParamList &param_list, synfigapp::Action::Category category=synfigapp::Action::CATEGORY_ALL)const;
 
        //! Updates the title of the window
        void update_title();
@@ -544,7 +544,7 @@ public:
        //! \writeme
        void rebuild_ducks();
        
-       //bool add_to_ducks(sinfgapp::ValueDesc value_desc, sinfg::ParamDesc *param_desc=NULL);
+       //bool add_to_ducks(synfigapp::ValueDesc value_desc, synfig::ParamDesc *param_desc=NULL);
                
        //! Starts "playing" the animation in real-time
        void play();
@@ -578,7 +578,7 @@ public:
        void time_zoom_in();
        void time_zoom_out();
        
-       void add_layer(sinfg::String x);
+       void add_layer(synfig::String x);
        
        void show_keyframe_dialog();
        
@@ -587,7 +587,7 @@ public:
        
        void image_import();
 
-       void on_waypoint_clicked(sinfgapp::ValueDesc,sinfg::Waypoint, int button);
+       void on_waypoint_clicked(synfigapp::ValueDesc,synfig::Waypoint, int button);
        
        void preview_option() {on_preview_option();}
        
@@ -612,7 +612,7 @@ private:
 
        bool on_keyframe_tree_event(GdkEvent *event);
 
-       //void on_children_edited_value(const Glib::ustring&path_string,sinfg::ValueBase value);
+       //void on_children_edited_value(const Glib::ustring&path_string,synfig::ValueBase value);
 
        void on_dirty_preview();
 
@@ -622,11 +622,11 @@ private:
 
 //     void on_layer_toggle(const Glib::ustring& path_string, Gtk::TreeModelColumn<bool> column);
        
-       void on_mode_changed(sinfgapp::CanvasInterface::Mode mode);
+       void on_mode_changed(synfigapp::CanvasInterface::Mode mode);
 
-//     void on_layer_waypoint_clicked(const Glib::ustring &, sinfg::ValueNode_Animated::WaypointList::iterator);
+//     void on_layer_waypoint_clicked(const Glib::ustring &, synfig::ValueNode_Animated::WaypointList::iterator);
        
-       //void on_children_waypoint_clicked(const Glib::ustring &, sinfg::ValueNode_Animated::WaypointList::iterator);
+       //void on_children_waypoint_clicked(const Glib::ustring &, synfig::ValueNode_Animated::WaypointList::iterator);
 
        void on_waypoint_changed();
        
@@ -660,18 +660,18 @@ private:
        
        void on_audio_option();
        void on_audio_file_change(const std::string &f);
-       void on_audio_offset_change(const sinfg::Time &t);
+       void on_audio_offset_change(const synfig::Time &t);
        
        void on_audio_file_notify();
        void on_audio_offset_notify();
        
-       bool on_duck_changed(const sinfg::Point &value,const sinfgapp::ValueDesc& value_desc);
+       bool on_duck_changed(const synfig::Point &value,const synfigapp::ValueDesc& value_desc);
 
-       void on_layer_toggle(sinfg::Layer::Handle);
+       void on_layer_toggle(synfig::Layer::Handle);
 
-       void on_edited_value(sinfgapp::ValueDesc,sinfg::ValueBase);
+       void on_edited_value(synfigapp::ValueDesc,synfig::ValueBase);
 
-       //void on_waypoint_clicked(sinfgapp::ValueDesc,sinfg::ValueNode_Animated::WaypointList::iterator, int button);
+       //void on_waypoint_clicked(synfigapp::ValueDesc,synfig::ValueNode_Animated::WaypointList::iterator, int button);
 
        void on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time);
        
@@ -687,7 +687,7 @@ protected:
 
 public:
        
-       static etl::handle<studio::CanvasView> create(etl::loose_handle<Instance> instance,etl::handle<sinfg::Canvas> canvas);
+       static etl::handle<studio::CanvasView> create(etl::loose_handle<Instance> instance,etl::handle<synfig::Canvas> canvas);
 }; // END of class CanvasView
 
 }; // END of namespace studio
index 07d81f1..e39ce8c 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file cellrenderer_gradient.cpp
 **     \brief Template File
 **
@@ -40,7 +40,7 @@
 
 using namespace std;
 //using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -58,7 +58,7 @@ using namespace studio;
 CellRenderer_Gradient::CellRenderer_Gradient():
        Glib::ObjectBase        (typeid(CellRenderer_Gradient)),
        Gtk::CellRendererText   (),
-       property_gradient_(*this,"gradient",sinfg::Gradient())
+       property_gradient_(*this,"gradient",synfig::Gradient())
 {
        //CellRendererText::signal_edited().connect(sigc::mem_fun(*this,&studio::CellRenderer_Gradient::string_edited_));
 }
index 99ecfce..84a9ee1 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file cellrenderer_gradient.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_CELLRENDERER_GRADIENT_H
-#define __SINFG_STUDIO_CELLRENDERER_GRADIENT_H
+#ifndef __SYNFIG_STUDIO_CELLRENDERER_GRADIENT_H
+#define __SYNFIG_STUDIO_CELLRENDERER_GRADIENT_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -32,7 +32,7 @@
 #include <sigc++/signal.h>
 #include <sigc++/slot.h>
 
-#include <sinfg/gradient.h>
+#include <synfig/gradient.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -47,15 +47,15 @@ namespace studio {
 class CellRenderer_Gradient : public Gtk::CellRendererText
 {
        sigc::signal<void, const Glib::ustring&> signal_secondary_click_;
-       sigc::signal<void, const Glib::ustring&, sinfg::Gradient> signal_edited_;
+       sigc::signal<void, const Glib::ustring&, synfig::Gradient> signal_edited_;
 
-       Glib::Property<sinfg::Gradient> property_gradient_;
+       Glib::Property<synfig::Gradient> property_gradient_;
 
 public:
-       sigc::signal<void, const Glib::ustring&, sinfg::Gradient> &signal_edited()
+       sigc::signal<void, const Glib::ustring&, synfig::Gradient> &signal_edited()
        {return signal_edited_; }
 
-       Glib::PropertyProxy<sinfg::Gradient> property_gradient() { return property_gradient_.get_proxy();}
+       Glib::PropertyProxy<synfig::Gradient> property_gradient() { return property_gradient_.get_proxy();}
        
        CellRenderer_Gradient();
        ~CellRenderer_Gradient();
index e7fe1fa..78560c4 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file cellrenderer_time.cpp
 **     \brief Template File
 **
@@ -40,7 +40,7 @@
 
 using namespace std;
 //using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -58,7 +58,7 @@ using namespace studio;
 CellRenderer_Time::CellRenderer_Time():
        Glib::ObjectBase        (typeid(CellRenderer_Time)),
        Gtk::CellRendererText   (),
-       property_time_(*this,"time",sinfg::Time(0)),
+       property_time_(*this,"time",synfig::Time(0)),
        property_fps_(*this,"fps", float(0))
 {
        CellRendererText::signal_edited().connect(sigc::mem_fun(*this,&studio::CellRenderer_Time::string_edited_));
@@ -66,7 +66,7 @@ CellRenderer_Time::CellRenderer_Time():
 
 CellRenderer_Time::~CellRenderer_Time()
 {
-       sinfg::info("CellRenderer_Time::~CellRenderer_Time(): deleted");
+       synfig::info("CellRenderer_Time::~CellRenderer_Time(): deleted");
 }
 
 void
index c024723..f672719 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file cellrenderer_time.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_CELLRENDERER_TIME_H
-#define __SINFG_STUDIO_CELLRENDERER_TIME_H
+#ifndef __SYNFIG_STUDIO_CELLRENDERER_TIME_H
+#define __SYNFIG_STUDIO_CELLRENDERER_TIME_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -32,7 +32,7 @@
 #include <sigc++/signal.h>
 #include <sigc++/slot.h>
 
-#include <sinfg/time.h>
+#include <synfig/time.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -47,21 +47,21 @@ namespace studio {
 class CellRenderer_Time : public Gtk::CellRendererText
 {
        sigc::signal<void, const Glib::ustring&> signal_secondary_click_;
-       sigc::signal<void, const Glib::ustring&, sinfg::Time> signal_edited_;
+       sigc::signal<void, const Glib::ustring&, synfig::Time> signal_edited_;
 
-       Glib::Property<sinfg::Time> property_time_;
-       Glib::Property<sinfg::Time> property_fps_;
+       Glib::Property<synfig::Time> property_time_;
+       Glib::Property<synfig::Time> property_fps_;
 
        void string_edited_(const Glib::ustring&,const Glib::ustring&);
 
        void on_value_editing_done();
 
 public:
-       sigc::signal<void, const Glib::ustring&, sinfg::Time> &signal_edited()
+       sigc::signal<void, const Glib::ustring&, synfig::Time> &signal_edited()
        {return signal_edited_; }
 
-       Glib::PropertyProxy<sinfg::Time> property_time() { return property_time_.get_proxy();}
-       Glib::PropertyProxy<sinfg::Time> property_fps() { return property_fps_.get_proxy();}
+       Glib::PropertyProxy<synfig::Time> property_time() { return property_time_.get_proxy();}
+       Glib::PropertyProxy<synfig::Time> property_fps() { return property_fps_.get_proxy();}
        
        CellRenderer_Time();
        ~CellRenderer_Time();
index b3c9a66..947952d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file cellrenderer_timetrack.cpp
 **     \brief Template Header
 **
 #include "widget_time.h"
 #include "widget_timeslider.h"
 
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 #include "instance.h"
 
-#include <sinfg/timepointcollect.h>
+#include <synfig/timepointcollect.h>
 
 #endif
 
-using namespace sinfg;
+using namespace synfig;
 using namespace std;
 using namespace etl;
 using namespace studio;
@@ -77,8 +77,8 @@ CellRenderer_TimeTrack::CellRenderer_TimeTrack():
        Gtk::CellRenderer       (),
        adjustment_                     (10,10,20,0,0,0),
        
-       property_valuedesc_     (*this,"value_desc",sinfgapp::ValueDesc()),
-       property_canvas_        (*this,"canvas",sinfg::Canvas::Handle()),
+       property_valuedesc_     (*this,"value_desc",synfigapp::ValueDesc()),
+       property_canvas_        (*this,"canvas",synfig::Canvas::Handle()),
        property_adjustment_(*this,"adjustment",&adjustment_),
        property_enable_timing_info_(*this,"enable-timing-info", false)
 {
@@ -88,7 +88,7 @@ CellRenderer_TimeTrack::CellRenderer_TimeTrack():
 
 CellRenderer_TimeTrack::~CellRenderer_TimeTrack()
 {
-       sinfg::info("CellRenderer_TimeTrack::~CellRenderer_TimeTrack(): deleted");
+       synfig::info("CellRenderer_TimeTrack::~CellRenderer_TimeTrack(): deleted");
 }
 
 void
@@ -98,7 +98,7 @@ CellRenderer_TimeTrack::set_adjustment(Gtk::Adjustment &x)
 //     x.signal_value_changed().connect(sigc::mem_fun(*this,&Gtk::Widget::queue_draw));
 }
 
-sinfg::Canvas::Handle
+synfig::Canvas::Handle
 CellRenderer_TimeTrack::get_canvas()const
 {
        return const_cast<CellRenderer_TimeTrack*>(this)->property_canvas().get_value();
@@ -123,11 +123,11 @@ CellRenderer_TimeTrack::is_selected(const Waypoint& waypoint)const
 }
 
 //kind of a hack... pointer is ugly
-const sinfg::Node::time_set *get_times_from_vdesc(const sinfgapp::ValueDesc &v)
+const synfig::Node::time_set *get_times_from_vdesc(const synfigapp::ValueDesc &v)
 {
-       if(v.get_value_type() == sinfg::ValueBase::TYPE_CANVAS)
+       if(v.get_value_type() == synfig::ValueBase::TYPE_CANVAS)
        {
-               sinfg::Canvas::Handle canvasparam = v.get_value().get(Canvas::Handle());
+               synfig::Canvas::Handle canvasparam = v.get_value().get(Canvas::Handle());
        
                if(canvasparam)
                {
@@ -153,7 +153,7 @@ const sinfg::Node::time_set *get_times_from_vdesc(const sinfgapp::ValueDesc &v)
        return 0;
 }
 
-bool get_closest_time(const sinfg::Node::time_set &tset, const Time &t, const Time &range, Time &out)
+bool get_closest_time(const synfig::Node::time_set &tset, const Time &t, const Time &range, Time &out)
 {
        Node::time_set::const_iterator  i,j,end = tset.end();
        
@@ -217,21 +217,21 @@ CellRenderer_TimeTrack::render_vfunc(
        inactive_gc->set_stipple(Gdk::Bitmap::create(stipple_xpm,2,2));
        inactive_gc->set_fill(Gdk::STIPPLED);
        
-       sinfg::Canvas::Handle canvas(property_canvas().get_value());
+       synfig::Canvas::Handle canvas(property_canvas().get_value());
        
-       sinfgapp::ValueDesc value_desc = property_value_desc().get_value();
-       sinfg::ValueNode *base_value = value_desc.get_value_node().get();
-       sinfg::ValueNode_Animated *value_node=dynamic_cast<sinfg::ValueNode_Animated*>(base_value);
+       synfigapp::ValueDesc value_desc = property_value_desc().get_value();
+       synfig::ValueNode *base_value = value_desc.get_value_node().get();
+       synfig::ValueNode_Animated *value_node=dynamic_cast<synfig::ValueNode_Animated*>(base_value);
 
-       sinfg::ValueNode_DynamicList *parent_value_node(0);
+       synfig::ValueNode_DynamicList *parent_value_node(0);
        if(property_value_desc().get_value().parent_is_value_node())
-               parent_value_node=dynamic_cast<sinfg::ValueNode_DynamicList*>(property_value_desc().get_value().get_parent_value_node().get());
+               parent_value_node=dynamic_cast<synfig::ValueNode_DynamicList*>(property_value_desc().get_value().get_parent_value_node().get());
 
        // If the canvas is defined, then load up the keyframes
        if(canvas)
        {
-               const sinfg::KeyframeList& keyframe_list(canvas->keyframe_list());
-               sinfg::KeyframeList::const_iterator iter;
+               const synfig::KeyframeList& keyframe_list(canvas->keyframe_list());
+               synfig::KeyframeList::const_iterator iter;
                
                for(iter=keyframe_list.begin();iter!=keyframe_list.end();++iter)
                {
@@ -249,11 +249,11 @@ CellRenderer_TimeTrack::render_vfunc(
        
        //render all the time points that exist
        {
-               const sinfg::Node::time_set *tset = get_times_from_vdesc(value_desc);
+               const synfig::Node::time_set *tset = get_times_from_vdesc(value_desc);
                
                if(tset)
                {
-                       sinfg::Node::time_set::const_iterator   i = tset->begin(), end = tset->end();
+                       synfig::Node::time_set::const_iterator  i = tset->begin(), end = tset->end();
                        
                        float   lower = adjustment->get_lower(),
                                        upper = adjustment->get_upper();
@@ -314,7 +314,7 @@ CellRenderer_TimeTrack::render_vfunc(
                                        gc->set_rgb_fg_color(Gdk::Color("#00EEEE"));
                                }
                                
-                               //sinfg::info("Displaying time: %.3f s",(float)t);
+                               //synfig::info("Displaying time: %.3f s",(float)t);
                                const int x = (int)((t-lower)*area.get_width()/(upper-lower));
                                
                                //should draw me a grey filled circle...
@@ -349,7 +349,7 @@ CellRenderer_TimeTrack::render_vfunc(
                                        if(!t.is_valid())
                                                continue;
                                                                                                                
-                                       //sinfg::info("Displaying time: %.3f s",(float)t);
+                                       //synfig::info("Displaying time: %.3f s",(float)t);
                                        const int x = (int)((t-lower)*area.get_width()/(upper-lower));
                                        
                                        //should draw me a grey filled circle...
@@ -383,7 +383,7 @@ CellRenderer_TimeTrack::render_vfunc(
        if(value_node)
        {                               
                //now render the actual waypoints
-               sinfg::ValueNode_Animated::WaypointList::iterator iter;
+               synfig::ValueNode_Animated::WaypointList::iterator iter;
                for(
                        iter=value_node->waypoint_list().begin();
                        iter!=value_node->waypoint_list().end();
@@ -435,9 +435,9 @@ CellRenderer_TimeTrack::render_vfunc(
        if(parent_value_node)
        {
                const int index(property_value_desc().get_value().get_index());
-               const sinfg::ValueNode_DynamicList::ListEntry& list_entry(parent_value_node->list[index]);
-               const sinfg::ValueNode_DynamicList::ListEntry::ActivepointList& activepoint_list(list_entry.timing_info);
-               sinfg::ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator iter,next;
+               const synfig::ValueNode_DynamicList::ListEntry& list_entry(parent_value_node->list[index]);
+               const synfig::ValueNode_DynamicList::ListEntry::ActivepointList& activepoint_list(list_entry.timing_info);
+               synfig::ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator iter,next;
 
                bool is_off(false);
                if(!activepoint_list.empty())
@@ -519,14 +519,14 @@ CellRenderer_TimeTrack::render_vfunc(
        }
 }
 
-sinfg::ValueNode_Animated::WaypointList::iterator
-CellRenderer_TimeTrack::find_waypoint(const sinfg::Time& t,const sinfg::Time& scope)
+synfig::ValueNode_Animated::WaypointList::iterator
+CellRenderer_TimeTrack::find_waypoint(const synfig::Time& t,const synfig::Time& scope)
 {
-       sinfg::ValueNode_Animated *value_node=dynamic_cast<sinfg::ValueNode_Animated*>(property_value_desc().get_value().get_value_node().get());
+       synfig::ValueNode_Animated *value_node=dynamic_cast<synfig::ValueNode_Animated*>(property_value_desc().get_value().get_value_node().get());
 
     Time nearest(Time::end());
 
-       sinfg::ValueNode_Animated::WaypointList::iterator iter,ret;
+       synfig::ValueNode_Animated::WaypointList::iterator iter,ret;
 
        if(value_node)
        {
@@ -562,17 +562,17 @@ CellRenderer_TimeTrack::activate_vfunc(
        Gtk::CellRendererState flags)
 {
        path=treepath;
-       sinfg::ValueNode_Animated::WaypointList::iterator iter;
+       synfig::ValueNode_Animated::WaypointList::iterator iter;
     Time nearest=1000000000;
        Gtk::Adjustment *adjustment=get_adjustment();
 
-       sinfg::ValueNode_Animated *value_node=dynamic_cast<sinfg::ValueNode_Animated*>(property_value_desc().get_value().get_value_node().get());
+       synfig::ValueNode_Animated *value_node=dynamic_cast<synfig::ValueNode_Animated*>(property_value_desc().get_value().get_value_node().get());
 
-       sinfg::Canvas::Handle canvas(get_canvas());
+       synfig::Canvas::Handle canvas(get_canvas());
 
-       sinfg::ValueNode_DynamicList *parent_value_node(0);
+       synfig::ValueNode_DynamicList *parent_value_node(0);
        if(property_value_desc().get_value().parent_is_value_node())
-               parent_value_node=dynamic_cast<sinfg::ValueNode_DynamicList*>(property_value_desc().get_value().get_parent_value_node().get());
+               parent_value_node=dynamic_cast<synfig::ValueNode_DynamicList*>(property_value_desc().get_value().get_parent_value_node().get());
 
        Time deltatime = 0;
        Time curr_time;
@@ -629,7 +629,7 @@ CellRenderer_TimeTrack::activate_vfunc(
                                        will remove it from the the set if it is included.
                        */
                                                
-                       sinfgapp::ValueDesc valdesc = property_value_desc().get_value();
+                       synfigapp::ValueDesc valdesc = property_value_desc().get_value();
                        const Node::time_set *tset = get_times_from_vdesc(valdesc);
                        
                        bool clickfound = tset && get_closest_time(*tset,actual_time,pixel_width*cell_area.get_height(),stime);
@@ -676,7 +676,7 @@ CellRenderer_TimeTrack::activate_vfunc(
                catch(int)
                {
                        selection=false;
-                       selected=sinfg::UniqueID::nil();
+                       selected=synfig::UniqueID::nil();
                }
                
                if((!sel_times.empty() || selection) && event->button.button==1)
@@ -692,8 +692,8 @@ CellRenderer_TimeTrack::activate_vfunc(
                if(parent_value_node)
                {
                        const int index(property_value_desc().get_value().get_index());
-                       const sinfg::ValueNode_DynamicList::ListEntry::ActivepointList& activepoint_list(parent_value_node->list[index].timing_info);
-                       sinfg::ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator iter;
+                       const synfig::ValueNode_DynamicList::ListEntry::ActivepointList& activepoint_list(parent_value_node->list[index].timing_info);
+                       synfig::ValueNode_DynamicList::ListEntry::ActivepointList::const_iterator iter;
        
                        for(iter=activepoint_list.begin();iter!=activepoint_list.end();++iter)
                        {
@@ -711,12 +711,12 @@ CellRenderer_TimeTrack::activate_vfunc(
                        if(event->button.button==3)
                        {
                                Time stime;
-                               sinfgapp::ValueDesc valdesc = property_value_desc().get_value();
+                               synfigapp::ValueDesc valdesc = property_value_desc().get_value();
                                const Node::time_set *tset = get_times_from_vdesc(valdesc);
                                
                                bool clickfound = tset && get_closest_time(*tset,actual_time,pixel_width*cell_area.get_height(),stime);
                                
-                               etl::handle<sinfg::Node> node;
+                               etl::handle<synfig::Node> node;
                                if(valdesc.get_value(stime).get_type()==ValueBase::TYPE_CANVAS)
                                {
                                        node=Canvas::Handle(valdesc.get_value(stime).get(Canvas::Handle()));
@@ -761,11 +761,11 @@ CellRenderer_TimeTrack::activate_vfunc(
                                deltatime = actual_time - actual_dragtime;
                                if(sel_times.size() != 0 && (delmode || !deltatime.is_equal(Time(0))))
                                {
-                                       sinfgapp::Action::ParamList param_list;
+                                       synfigapp::Action::ParamList param_list;
                                        param_list.add("canvas",canvas_interface()->get_canvas());
                                        param_list.add("canvas_interface",canvas_interface());
                                        
-                                       if(sel_value.get_value_type() == sinfg::ValueBase::TYPE_CANVAS)
+                                       if(sel_value.get_value_type() == synfig::ValueBase::TYPE_CANVAS)
                                        {
                                                param_list.add("addcanvas",sel_value.get_value().get(Canvas::Handle()));
                                        }else
@@ -774,7 +774,7 @@ CellRenderer_TimeTrack::activate_vfunc(
                                        }
                                        
                                        set<Time>       newset;
-                                       std::set<sinfg::Time>::iterator i = sel_times.begin(), end = sel_times.end();
+                                       std::set<synfig::Time>::iterator i = sel_times.begin(), end = sel_times.end();
                                        for(; i != end; ++i)
                                        {
                                                param_list.add("addtime",*i);
@@ -814,7 +814,7 @@ CellRenderer_TimeTrack::activate_vfunc(
                                else
                                if(event->button.button==1)
                                {
-                                       sinfg::Waypoint waypoint(*selected_waypoint);
+                                       synfig::Waypoint waypoint(*selected_waypoint);
                                        Time newtime((waypoint.get_time()+(selected_time-drag_time)).round(canvas->rend_desc().get_frame_rate()));
                                        if(waypoint.get_time()!=newtime)
                                        {
@@ -842,16 +842,16 @@ CellRenderer_TimeTrack::activate_vfunc(
 
 
 
-Glib::PropertyProxy<sinfgapp::ValueDesc>
+Glib::PropertyProxy<synfigapp::ValueDesc>
 CellRenderer_TimeTrack::property_value_desc()
 {
-       return Glib::PropertyProxy<sinfgapp::ValueDesc>(this,"value_desc");
+       return Glib::PropertyProxy<synfigapp::ValueDesc>(this,"value_desc");
 }
 
-Glib::PropertyProxy<sinfg::Canvas::Handle>
+Glib::PropertyProxy<synfig::Canvas::Handle>
 CellRenderer_TimeTrack::property_canvas()
 {
-       return Glib::PropertyProxy<sinfg::Canvas::Handle>(this,"canvas");
+       return Glib::PropertyProxy<synfig::Canvas::Handle>(this,"canvas");
 }
 
 Glib::PropertyProxy<Gtk::Adjustment* >
@@ -861,24 +861,24 @@ CellRenderer_TimeTrack::property_adjustment()
 }
 
 void
-CellRenderer_TimeTrack::set_canvas_interface(etl::loose_handle<sinfgapp::CanvasInterface>      h)
+CellRenderer_TimeTrack::set_canvas_interface(etl::loose_handle<synfigapp::CanvasInterface>     h)
 {
        canvas_interface_ = h;
 }
 
 static void
-set_waypoint_model(std::set<sinfg::Waypoint, std::less<UniqueID> > waypoints, Waypoint::Model model, etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface)
+set_waypoint_model(std::set<synfig::Waypoint, std::less<UniqueID> > waypoints, Waypoint::Model model, etl::loose_handle<synfigapp::CanvasInterface> canvas_interface)
 {
        // Create the action group
-       sinfgapp::Action::PassiveGrouper group(canvas_interface->get_instance().get(),_("Change Waypoint Group"));
+       synfigapp::Action::PassiveGrouper group(canvas_interface->get_instance().get(),_("Change Waypoint Group"));
 
-       std::set<sinfg::Waypoint, std::less<UniqueID> >::const_iterator iter;
+       std::set<synfig::Waypoint, std::less<UniqueID> >::const_iterator iter;
        for(iter=waypoints.begin();iter!=waypoints.end();++iter)
        {
                Waypoint waypoint(*iter);
                waypoint.apply_model(model);
                
-               sinfgapp::Action::Handle action(sinfgapp::Action::create("waypoint_set"));
+               synfigapp::Action::Handle action(synfigapp::Action::create("waypoint_set"));
                
                assert(action);
                
@@ -897,11 +897,11 @@ set_waypoint_model(std::set<sinfg::Waypoint, std::less<UniqueID> > waypoints, Wa
 }
 
 void
-CellRenderer_TimeTrack::show_timepoint_menu(const etl::handle<sinfg::Node>& node, const sinfg::Time& time, Side side)
+CellRenderer_TimeTrack::show_timepoint_menu(const etl::handle<synfig::Node>& node, const synfig::Time& time, Side side)
 {
-       std::set<sinfg::Waypoint, std::less<UniqueID> > waypoint_set;
+       std::set<synfig::Waypoint, std::less<UniqueID> > waypoint_set;
        int n;
-       n=sinfg::waypoint_collect(waypoint_set,time,node);
+       n=synfig::waypoint_collect(waypoint_set,time,node);
 
        Gtk::Menu* menu(manage(new Gtk::Menu()));
 
@@ -968,7 +968,7 @@ CellRenderer_TimeTrack::show_timepoint_menu(const etl::handle<sinfg::Node>& node
                sigc::bind(
                        sigc::mem_fun(
                                *canvas_interface(),
-                               &sinfgapp::CanvasInterface::set_time
+                               &synfigapp::CanvasInterface::set_time
                        ),
                        time
                )
@@ -984,10 +984,10 @@ CellRenderer_TimeTrack::show_timepoint_menu(const etl::handle<sinfg::Node>& node
                        return;
                }
                else
-                       sinfg::info("Too many waypoints under me");
+                       synfig::info("Too many waypoints under me");
        }
        else
-               sinfg::info("ZERO waypoints under me");
+               synfig::info("ZERO waypoints under me");
 
        if(menu)menu->popup(3,gtk_get_current_event_time());
 }
index 37c0a07..bbff8b4 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file cellrenderer_timetrack.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_CELLRENDERER_TIMETRACK_H
-#define __SINFG_GTKMM_CELLRENDERER_TIMETRACK_H
+#ifndef __SYNFIG_GTKMM_CELLRENDERER_TIMETRACK_H
+#define __SYNFIG_GTKMM_CELLRENDERER_TIMETRACK_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/menu.h>
 
 
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/valuenode_animated.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/string.h>
-#include <sinfg/time.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -90,25 +90,25 @@ private:
        Gtk::Adjustment adjustment_;
        
        //! Signal for when the user clicks on a waypoint
-       sigc::signal<void, const Glib::ustring&,sinfg::Waypoint, int> signal_waypoint_clicked_;
+       sigc::signal<void, const Glib::ustring&,synfig::Waypoint, int> signal_waypoint_clicked_;
 
-       sigc::signal<void, sinfg::Waypoint, sinfg::ValueNode::Handle> signal_waypoint_changed_;
+       sigc::signal<void, synfig::Waypoint, synfig::ValueNode::Handle> signal_waypoint_changed_;
 
        //! Iterator for selected waypoint. (Should this be an UniqueID instead?)
-       sinfg::ValueNode_Animated::WaypointList::iterator selected_waypoint;
+       synfig::ValueNode_Animated::WaypointList::iterator selected_waypoint;
        
-       sinfg::UniqueID selected;
+       synfig::UniqueID selected;
 
        //! selected information for time... (will work for way points etc...)
        //TODO: make multiple... on both time and value select...
-       std::set<sinfg::Time>   sel_times;
-       sinfgapp::ValueDesc             sel_value;
-       sinfg::Time                             actual_time;
-       sinfg::Time                             actual_dragtime;
+       std::set<synfig::Time>  sel_times;
+       synfigapp::ValueDesc            sel_value;
+       synfig::Time                            actual_time;
+       synfig::Time                            actual_dragtime;
        int                                             mode;
 
        //! ???
-       sinfg::Time selected_time;
+       synfig::Time selected_time;
     
        //! The path to the current item in the tree model
        Glib::ustring path;
@@ -118,9 +118,9 @@ private:
 
        bool dragging;
 
-       sinfg::Time drag_time;
+       synfig::Time drag_time;
        
-       etl::loose_handle<sinfgapp::CanvasInterface>    canvas_interface_;
+       etl::loose_handle<synfigapp::CanvasInterface>   canvas_interface_;
 
        /*
  --    ** -- P R O P E R T I E S -------------------------------------------------
@@ -129,10 +129,10 @@ private:
 private:
        
        //! ValueBase Desc
-       Glib::Property<sinfgapp::ValueDesc> property_valuedesc_;
+       Glib::Property<synfigapp::ValueDesc> property_valuedesc_;
 
        //! Canvas
-       Glib::Property<sinfg::Canvas::Handle> property_canvas_;
+       Glib::Property<synfig::Canvas::Handle> property_canvas_;
 
        //! ??? \see adjustment_
        Glib::Property<Gtk::Adjustment* > property_adjustment_;
@@ -146,9 +146,9 @@ private:
 
 public:
 
-       Glib::PropertyProxy<sinfgapp::ValueDesc> property_value_desc();
+       Glib::PropertyProxy<synfigapp::ValueDesc> property_value_desc();
 
-       Glib::PropertyProxy<sinfg::Canvas::Handle> property_canvas();
+       Glib::PropertyProxy<synfig::Canvas::Handle> property_canvas();
 
        Glib::PropertyProxy<Gtk::Adjustment* > property_adjustment();
 
@@ -158,10 +158,10 @@ public:
 
 public:
 
-       sigc::signal<void, const Glib::ustring&,sinfg::Waypoint,int> &signal_waypoint_clicked()
+       sigc::signal<void, const Glib::ustring&,synfig::Waypoint,int> &signal_waypoint_clicked()
        {return signal_waypoint_clicked_; }
 
-       sigc::signal<void, sinfg::Waypoint, sinfg::ValueNode::Handle> &signal_waypoint_changed()
+       sigc::signal<void, synfig::Waypoint, synfig::ValueNode::Handle> &signal_waypoint_changed()
        {return signal_waypoint_changed_; }
 
        /*
@@ -173,20 +173,20 @@ public:
        CellRenderer_TimeTrack();
     ~CellRenderer_TimeTrack();
        
-       void show_timepoint_menu(const etl::handle<sinfg::Node>& node, const sinfg::Time& time, Side side=SIDE_RIGHT);
+       void show_timepoint_menu(const etl::handle<synfig::Node>& node, const synfig::Time& time, Side side=SIDE_RIGHT);
 
        void set_adjustment(Gtk::Adjustment &x);
        Gtk::Adjustment *get_adjustment();
        const Gtk::Adjustment *get_adjustment()const;
 
-       etl::loose_handle<sinfgapp::CanvasInterface>    canvas_interface()const {return canvas_interface_;}
-       void set_canvas_interface(etl::loose_handle<sinfgapp::CanvasInterface> h); //this should only be called by smart people
+       etl::loose_handle<synfigapp::CanvasInterface>   canvas_interface()const {return canvas_interface_;}
+       void set_canvas_interface(etl::loose_handle<synfigapp::CanvasInterface> h); //this should only be called by smart people
        
-       sinfg::Canvas::Handle get_canvas()const;
+       synfig::Canvas::Handle get_canvas()const;
        
-       bool is_selected(const sinfg::Waypoint& waypoint)const;
+       bool is_selected(const synfig::Waypoint& waypoint)const;
 
-       sinfg::ValueNode_Animated::WaypointList::iterator find_waypoint(const sinfg::Time& t, const sinfg::Time& scope=sinfg::Time::end());
+       synfig::ValueNode_Animated::WaypointList::iterator find_waypoint(const synfig::Time& t, const synfig::Time& scope=synfig::Time::end());
 
        virtual void
        render_vfunc(
index 9803c56..8a52ff7 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file cellrenderer_value.cpp
 **     \brief Template File
 **
@@ -55,7 +55,7 @@
 
 #endif
 
-using namespace sinfg;
+using namespace synfig;
 using namespace etl;
 using namespace std;
 using namespace studio;
@@ -142,7 +142,7 @@ public:
                }
                else
                {
-                       sinfg::error("on_editing_done(): Called twice!");
+                       synfig::error("on_editing_done(): Called twice!");
                }
        }
        void set_parent(Gtk::Widget*x) { parent=x; }
@@ -181,29 +181,29 @@ public:
        {
                path=p;
        }
-       void set_value(const sinfg::ValueBase &data)
+       void set_value(const synfig::ValueBase &data)
        {
                if(valuewidget)
                        valuewidget->set_value(data);
                //valuewidget->grab_focus();
        }
-       void set_canvas(const etl::handle<sinfg::Canvas> &data)
+       void set_canvas(const etl::handle<synfig::Canvas> &data)
        {
                assert(data);
                if(valuewidget)
                        valuewidget->set_canvas(data);
        }
-       void set_param_desc(const sinfg::ParamDesc &data)
+       void set_param_desc(const synfig::ParamDesc &data)
        {
                if(valuewidget)
                        valuewidget->set_param_desc(data);
        }
        
-       const sinfg::ValueBase &get_value()
+       const synfig::ValueBase &get_value()
        {
                if(valuewidget)
                        return valuewidget->get_value();
-               return sinfg::ValueBase();
+               return synfig::ValueBase();
        }
        const Glib::ustring &get_path()
        {
@@ -214,7 +214,7 @@ public:
 
 /* === P R O C E D U R E S ================================================= */
 
-bool get_paragraph(sinfg::String& text)
+bool get_paragraph(synfig::String& text)
 {
        Gtk::Dialog dialog(
                _("Paragraph"),         // Title
@@ -262,9 +262,9 @@ bool get_paragraph(sinfg::String& text)
 CellRenderer_ValueBase::CellRenderer_ValueBase():
        Glib::ObjectBase        (typeid(CellRenderer_ValueBase)),
        Gtk::CellRendererText   (),
-       property_value_ (*this,"value",sinfg::ValueBase()),
-       property_canvas_(*this,"canvas",etl::handle<sinfg::Canvas>()),
-       property_param_desc_(*this,"param_desc",sinfg::ParamDesc())
+       property_value_ (*this,"value",synfig::ValueBase()),
+       property_canvas_(*this,"canvas",etl::handle<synfig::Canvas>()),
+       property_param_desc_(*this,"param_desc",synfig::ParamDesc())
 {
        CellRendererText::signal_edited().connect(sigc::mem_fun(*this,&CellRenderer_ValueBase::string_edited_));
        value_entry=new ValueBase_Entry();
@@ -285,7 +285,7 @@ CellRenderer_ValueBase::CellRenderer_ValueBase():
 
 CellRenderer_ValueBase::~CellRenderer_ValueBase()
 {
-//     sinfg::info("CellRenderer_ValueBase::~CellRenderer_ValueBase(): deleted");
+//     synfig::info("CellRenderer_ValueBase::~CellRenderer_ValueBase(): deleted");
 }
 
 void
@@ -341,7 +341,7 @@ CellRenderer_ValueBase::render_vfunc(
        switch(data.get_type())
        {
        case ValueBase::TYPE_REAL:
-               if(((sinfg::ParamDesc)property_param_desc_).get_is_distance())
+               if(((synfig::ParamDesc)property_param_desc_).get_is_distance())
                {
                        Distance x(data.get(Real()),Distance::SYSTEM_UNITS);
                        x.convert(App::distance_system,get_canvas()->rend_desc());
@@ -357,15 +357,15 @@ CellRenderer_ValueBase::render_vfunc(
                property_text()=(Glib::ustring)strprintf("%.2f DEG",(Real)Angle::deg(data.get(Angle())).get());
                break;
        case ValueBase::TYPE_INTEGER:
-               if(((sinfg::ParamDesc)property_param_desc_).get_hint()!="enum")
+               if(((synfig::ParamDesc)property_param_desc_).get_hint()!="enum")
                {
                        property_text()=(Glib::ustring)strprintf("%i",data.get(int()));
                }
                else
                {
                        property_text()=(Glib::ustring)strprintf("(%i)",data.get(int()));
-                       std::list<sinfg::ParamDesc::EnumData> enum_list=((sinfg::ParamDesc)property_param_desc_).get_enum_list();
-                       std::list<sinfg::ParamDesc::EnumData>::iterator iter;
+                       std::list<synfig::ParamDesc::EnumData> enum_list=((synfig::ParamDesc)property_param_desc_).get_enum_list();
+                       std::list<synfig::ParamDesc::EnumData>::iterator iter;
                                                
                        for(iter=enum_list.begin();iter!=enum_list.end();iter++)
                                if(iter->value==data.get(int()))
@@ -390,19 +390,19 @@ CellRenderer_ValueBase::render_vfunc(
        
                if(data.get_type()==ValueBase::TYPE_STRING)
                {
-                       if(!data.get(sinfg::String()).empty())
-                               property_text()=static_cast<Glib::ustring>(data.get(sinfg::String()));
+                       if(!data.get(synfig::String()).empty())
+                               property_text()=static_cast<Glib::ustring>(data.get(synfig::String()));
                        else
                                property_text()=Glib::ustring("<empty>");
                }
                break;
        case ValueBase::TYPE_CANVAS:
-               if(data.get(etl::handle<sinfg::Canvas>()))
+               if(data.get(etl::handle<synfig::Canvas>()))
                {
-                       if(data.get(etl::handle<sinfg::Canvas>())->is_inline())
+                       if(data.get(etl::handle<synfig::Canvas>())->is_inline())
                                property_text()="<Inline Canvas>";
                        else
-                               property_text()=(Glib::ustring)data.get(etl::handle<sinfg::Canvas>())->get_id();
+                               property_text()=(Glib::ustring)data.get(etl::handle<synfig::Canvas>())->get_id();
                }
                else
                        property_text()="<No Image Selected>";
@@ -475,7 +475,7 @@ CellRenderer_ValueBase::activate_vfunc(     GdkEvent* event,
 */
 
 void
-CellRenderer_ValueBase::gradient_edited(sinfg::Gradient gradient, Glib::ustring path)
+CellRenderer_ValueBase::gradient_edited(synfig::Gradient gradient, Glib::ustring path)
 {
        ValueBase old_value(property_value_.get_value());
        ValueBase value(gradient);
@@ -484,7 +484,7 @@ CellRenderer_ValueBase::gradient_edited(sinfg::Gradient gradient, Glib::ustring
 }
 
 void
-CellRenderer_ValueBase::color_edited(sinfg::Color color, Glib::ustring path)
+CellRenderer_ValueBase::color_edited(synfig::Color color, Glib::ustring path)
 {
        ValueBase old_value(property_value_.get_value());
        ValueBase value(color);
@@ -544,7 +544,7 @@ CellRenderer_ValueBase::start_editing_vfunc(
        case ValueBase::TYPE_STRING:
                if(get_param_desc().get_hint()=="paragraph")
                {
-                       sinfg::String string;
+                       synfig::String string;
                        string=data.get(string);
                        if(get_paragraph(string))
                        {
index 90bcb79..45cc6b7 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file cellrenderer_value.cpp
 **     \brief Template File
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_CELLRENDERER_VALUE_H
-#define __SINFG_GTKMM_CELLRENDERER_VALUE_H
+#ifndef __SYNFIG_GTKMM_CELLRENDERER_VALUE_H
+#define __SYNFIG_GTKMM_CELLRENDERER_VALUE_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -51,9 +51,9 @@
 #include <gtkmm/colorselection.h>
 #include <gtkmm/optionmenu.h>
 
-//#include <sinfg/sinfg.h>
-#include <sinfg/paramdesc.h>
-#include <sinfg/value.h>
+//#include <synfig/synfig.h>
+#include <synfig/paramdesc.h>
+#include <synfig/value.h>
 
 
 /* === M A C R O S ========================================================= */
@@ -76,31 +76,31 @@ class ValueBase_Entry;
 class CellRenderer_ValueBase : public Gtk::CellRendererText
 {
        sigc::signal<void, const Glib::ustring&> signal_secondary_click_;
-       sigc::signal<void, const Glib::ustring&, sinfg::ValueBase> signal_edited_;
+       sigc::signal<void, const Glib::ustring&, synfig::ValueBase> signal_edited_;
 
-       Glib::Property<sinfg::ValueBase> property_value_;
-       Glib::Property<etl::handle<sinfg::Canvas> > property_canvas_;
-       Glib::Property<sinfg::ParamDesc> property_param_desc_;
+       Glib::Property<synfig::ValueBase> property_value_;
+       Glib::Property<etl::handle<synfig::Canvas> > property_canvas_;
+       Glib::Property<synfig::ParamDesc> property_param_desc_;
 
        void string_edited_(const Glib::ustring&,const Glib::ustring&);
 
-       void gradient_edited(sinfg::Gradient gradient, Glib::ustring path);
-       void color_edited(sinfg::Color color, Glib::ustring path);
+       void gradient_edited(synfig::Gradient gradient, Glib::ustring path);
+       void color_edited(synfig::Color color, Glib::ustring path);
        
 public:
        sigc::signal<void, const Glib::ustring&> &signal_secondary_click()
        {return signal_secondary_click_; }
 
-       sigc::signal<void, const Glib::ustring&, sinfg::ValueBase> &signal_edited()
+       sigc::signal<void, const Glib::ustring&, synfig::ValueBase> &signal_edited()
        {return signal_edited_; }
 
-       Glib::PropertyProxy<sinfg::ValueBase> property_value() { return property_value_.get_proxy();}
-       Glib::PropertyProxy<etl::handle<sinfg::Canvas> > property_canvas() { return property_canvas_.get_proxy();}
-       Glib::PropertyProxy<sinfg::ParamDesc> property_param_desc() { return property_param_desc_.get_proxy(); }
+       Glib::PropertyProxy<synfig::ValueBase> property_value() { return property_value_.get_proxy();}
+       Glib::PropertyProxy<etl::handle<synfig::Canvas> > property_canvas() { return property_canvas_.get_proxy();}
+       Glib::PropertyProxy<synfig::ParamDesc> property_param_desc() { return property_param_desc_.get_proxy(); }
        Glib::PropertyProxy<bool> property_inconsistant() { return property_foreground_set(); }
 
-       etl::handle<sinfg::Canvas> get_canvas()const { return property_canvas_; }
-       sinfg::ParamDesc get_param_desc()const { return property_param_desc_; }
+       etl::handle<synfig::Canvas> get_canvas()const { return property_canvas_; }
+       synfig::ParamDesc get_param_desc()const { return property_param_desc_; }
        
        CellRenderer_ValueBase();
        ~CellRenderer_ValueBase();
index 82a675c..797fe6a 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file childrentree.cpp
 **     \brief Template File
 **
@@ -31,8 +31,8 @@
 #include "childrentree.h"
 #include "cellrenderer_value.h"
 #include "cellrenderer_timetrack.h"
-#include <sinfgapp/action.h>
-#include <sinfgapp/instance.h>
+#include <synfigapp/action.h>
+#include <synfigapp/instance.h>
 #include <gtkmm/scrolledwindow.h>
 
 #endif
@@ -41,7 +41,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -121,7 +121,7 @@ ChildrenTree::ChildrenTree()
                // Set up the value cell-renderer
                cellrenderer_value=ChildrenTreeStore::add_cell_renderer_value(column);
                cellrenderer_value->signal_edited().connect(sigc::mem_fun(*this, &studio::ChildrenTree::on_edited_value));
-               cellrenderer_value->property_value()=sinfg::ValueBase();
+               cellrenderer_value->property_value()=synfig::ValueBase();
 
                // Finish setting up the column
                tree_view.append_column(*column);
@@ -180,12 +180,12 @@ ChildrenTree::ChildrenTree()
        
 /*
        Gtk::Image *icon;
-       //Gtk::IconSize iconsize(Gtk::IconSize::from_name("sinfg-small_icon"));
+       //Gtk::IconSize iconsize(Gtk::IconSize::from_name("synfig-small_icon"));
        Gtk::IconSize iconsize(Gtk::ICON_SIZE_SMALL_TOOLBAR);
 
        SMALL_BUTTON(button_raise,"gtk-go-up","Raise");
        SMALL_BUTTON(button_lower,"gtk-go-down","Lower");
-       SMALL_BUTTON(button_duplicate,"sinfg-duplicate","Duplicate");
+       SMALL_BUTTON(button_duplicate,"synfig-duplicate","Duplicate");
        SMALL_BUTTON(button_delete,"gtk-delete","Delete");
        
        hbox->pack_start(*button_raise,Gtk::PACK_SHRINK);
@@ -264,7 +264,7 @@ ChildrenTree::on_selection_changed()
 
 
 void
-ChildrenTree::on_edited_value(const Glib::ustring&path_string,sinfg::ValueBase value)
+ChildrenTree::on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value)
 {
        Gtk::TreePath path(path_string);
        
@@ -275,13 +275,13 @@ ChildrenTree::on_edited_value(const Glib::ustring&path_string,sinfg::ValueBase v
 }
 
 void
-ChildrenTree::on_waypoint_clicked(const Glib::ustring &path_string, sinfg::Waypoint waypoint,int button)
+ChildrenTree::on_waypoint_clicked(const Glib::ustring &path_string, synfig::Waypoint waypoint,int button)
 {
        Gtk::TreePath path(path_string);
        
        const Gtk::TreeRow row = *(tree_view.get_model()->get_iter(path));
        
-       signal_waypoint_clicked()(static_cast<sinfgapp::ValueDesc>(row[model.value_desc]),waypoint,button);
+       signal_waypoint_clicked()(static_cast<synfigapp::ValueDesc>(row[model.value_desc]),waypoint,button);
 }
 
 bool
index 40d68d1..f344228 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file childrentree.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_CHILDRENTREE_H
-#define __SINFG_STUDIO_CHILDRENTREE_H
+#ifndef __SYNFIG_STUDIO_CHILDRENTREE_H
+#define __SYNFIG_STUDIO_CHILDRENTREE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/scale.h>
 #include <gtkmm/button.h>
 
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/value_desc.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/value_desc.h>
 #include "childrentreestore.h"
-#include <sinfg/valuenode_animated.h>
+#include <synfig/valuenode_animated.h>
 
 #include "widget_value.h"
 
@@ -93,11 +93,11 @@ private:
 
        CellRenderer_ValueBase *cellrenderer_value;
 
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::ValueBase> signal_edited_value_;
+       sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase> signal_edited_value_;
 
        sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_user_click_;
 
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::Waypoint, int> signal_waypoint_clicked_;
+       sigc::signal<void,synfigapp::ValueDesc,synfig::Waypoint, int> signal_waypoint_clicked_;
 
        Gtk::Button *button_raise;
        Gtk::Button *button_lower;
@@ -118,9 +118,9 @@ private:
 
 private:
 
-       void on_edited_value(const Glib::ustring&path_string,sinfg::ValueBase value);
+       void on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value);
 
-       void on_waypoint_clicked(const Glib::ustring &, sinfg::Waypoint,int button);
+       void on_waypoint_clicked(const Glib::ustring &, synfig::Waypoint,int button);
 
        bool on_tree_event(GdkEvent *event);
 
@@ -159,13 +159,13 @@ public:
        void set_show_timetrack(bool x=true);
 
        //! Signal called with a value has been edited.
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::ValueBase>& signal_edited_value() { return signal_edited_value_; }
+       sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase>& signal_edited_value() { return signal_edited_value_; }
 
        sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_user_click() { return signal_user_click_; }
 
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::Waypoint, int>& signal_waypoint_clicked() { return signal_waypoint_clicked_; }
+       sigc::signal<void,synfigapp::ValueDesc,synfig::Waypoint, int>& signal_waypoint_clicked() { return signal_waypoint_clicked_; }
 
-       etl::handle<sinfgapp::SelectionManager> get_selection_manager() { return children_tree_store_->canvas_interface()->get_selection_manager(); }
+       etl::handle<synfigapp::SelectionManager> get_selection_manager() { return children_tree_store_->canvas_interface()->get_selection_manager(); }
 
 }; // END of ChildrenTree
 
index 73378fe..5505bfe 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file childrentreestore.cpp
 **     \brief Template File
 **
@@ -31,7 +31,7 @@
 #include "childrentreestore.h"
 #include "iconcontroler.h"
 #include <gtkmm/button.h>
-#include <sinfg/paramdesc.h>
+#include <synfig/paramdesc.h>
 #include <ETL/clock>
 
 class Profiler : private etl::clock
@@ -39,7 +39,7 @@ class Profiler : private etl::clock
        const std::string name;
 public:
        Profiler(const std::string& name):name(name) { reset(); }
-       ~Profiler() { float time(operator()()); sinfg::info("%s: took %f msec",name.c_str(),time*1000); }
+       ~Profiler() { float time(operator()()); synfig::info("%s: took %f msec",name.c_str(),time*1000); }
 };
 
 #endif
@@ -48,7 +48,7 @@ public:
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -66,7 +66,7 @@ static ChildrenTreeStore::Model& ModelHack()
        return *model;
 }
 
-ChildrenTreeStore::ChildrenTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_):
+ChildrenTreeStore::ChildrenTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_):
        Gtk::TreeStore                  (ModelHack()),
        CanvasTreeStore                 (canvas_interface_)
 {
@@ -96,7 +96,7 @@ ChildrenTreeStore::~ChildrenTreeStore()
 }
 
 Glib::RefPtr<ChildrenTreeStore>
-ChildrenTreeStore::create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_)
+ChildrenTreeStore::create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_)
 {
        return Glib::RefPtr<ChildrenTreeStore>(new ChildrenTreeStore(canvas_interface_));
 }
@@ -184,7 +184,7 @@ ChildrenTreeStore::on_canvas_added(Canvas::Handle canvas)
 {
        Gtk::TreeRow row = *(prepend(canvas_row.children()));
 
-       row[model.icon] = Gtk::Button().render_icon(Gtk::StockID("sinfg-canvas"),Gtk::ICON_SIZE_SMALL_TOOLBAR); 
+       row[model.icon] = Gtk::Button().render_icon(Gtk::StockID("synfig-canvas"),Gtk::ICON_SIZE_SMALL_TOOLBAR);        
        row[model.id] = canvas->get_id();
        row[model.name] = canvas->get_name();
        
@@ -216,7 +216,7 @@ ChildrenTreeStore::on_value_node_added(ValueNode::Handle value_node)
 
        Gtk::TreeRow row = *prepend(value_node_row.children());
        
-       set_row(row,sinfgapp::ValueDesc(canvas_interface()->get_canvas(),value_node->get_id()),false);
+       set_row(row,synfigapp::ValueDesc(canvas_interface()->get_canvas(),value_node->get_id()),false);
 }
 
 void
@@ -328,7 +328,7 @@ ChildrenTreeStore::on_value_node_changed(etl::handle<ValueNode> value_node)
 }
 
 void
-ChildrenTreeStore::on_value_node_replaced(sinfg::ValueNode::Handle replaced_value_node,sinfg::ValueNode::Handle new_value_node)
+ChildrenTreeStore::on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node)
 {
        changed_connection.disconnect();
        //if(!execute_changed_queued())
@@ -357,11 +357,11 @@ ChildrenTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int colu
        {
                if(column==model.value.index())
                {
-                       Glib::Value<sinfg::ValueBase> x;
+                       Glib::Value<synfig::ValueBase> x;
                        g_value_init(x.gobj(),model.value.type());
                        g_value_copy(value.gobj(),x.gobj());
 
-                       sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+                       synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
                        if(value_desc)
                        {
                                canvas_interface()->change_value(value_desc,x.get());
index bae0667..66aca3d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file childrentreestore.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_CHILDRENTREESTORE_H
-#define __SINFG_STUDIO_CHILDRENTREESTORE_H
+#ifndef __SYNFIG_STUDIO_CHILDRENTREESTORE_H
+#define __SYNFIG_STUDIO_CHILDRENTREESTORE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 #include "canvastreestore.h"
-#include <sinfg/value.h>
-#include <sinfg/valuenode.h>
+#include <synfig/value.h>
+#include <synfig/valuenode.h>
 #include <set>
 
 /* === M A C R O S ========================================================= */
@@ -67,9 +67,9 @@ private:
        Gtk::TreeModel::Row value_node_row;
        Gtk::TreeModel::Row canvas_row;
        
-       std::set<sinfg::ValueNode::Handle> changed_set_;
+       std::set<synfig::ValueNode::Handle> changed_set_;
 
-       std::set<sinfg::ValueNode::Handle> replaced_set_;
+       std::set<synfig::ValueNode::Handle> replaced_set_;
        
        /*
  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
@@ -88,12 +88,12 @@ private:
 
 private:
 
-       void on_value_node_added(sinfg::ValueNode::Handle value_node);
-       void on_value_node_deleted(sinfg::ValueNode::Handle value_node);
-       void on_value_node_changed(sinfg::ValueNode::Handle value_node);
-       void on_value_node_replaced(sinfg::ValueNode::Handle replaced_value_node,sinfg::ValueNode::Handle new_value_node);
-       void on_canvas_added(sinfg::Canvas::Handle canvas);
-       void on_canvas_removed(sinfg::Canvas::Handle canvas);
+       void on_value_node_added(synfig::ValueNode::Handle value_node);
+       void on_value_node_deleted(synfig::ValueNode::Handle value_node);
+       void on_value_node_changed(synfig::ValueNode::Handle value_node);
+       void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
+       void on_canvas_added(synfig::Canvas::Handle canvas);
+       void on_canvas_removed(synfig::Canvas::Handle canvas);
 
        void set_value_impl(const Gtk::TreeModel::iterator& iter, int column, const Glib::ValueBase& value);
 
@@ -103,7 +103,7 @@ private:
 
 public:
        
-       ChildrenTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       ChildrenTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
        ~ChildrenTreeStore();
 
        void rebuild();
@@ -130,7 +130,7 @@ public:
 
 public:
        
-       static Glib::RefPtr<ChildrenTreeStore> create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       static Glib::RefPtr<ChildrenTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
 }; // END of class ChildrenTreeStore
 
 }; // END of namespace studio
index 58dd236..0d86cc0 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template File
 ** $Id: compview.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
 **
@@ -37,7 +37,7 @@
 #include <sigc++/hide.h>
 #include <sigc++/slot.h>
 #include "canvasview.h"
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 
 #endif
 
@@ -51,7 +51,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 #define COLUMNID_JUMP          (787584)
@@ -341,15 +341,15 @@ void
 CompView::init_menu()
 {
        menu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
-       menu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-canvas_new"),
+       menu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-canvas_new"),
                sigc::mem_fun(*this,&CompView::menu_new_canvas)));
        menu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-delete"),
                sigc::mem_fun(*this,&CompView::menu_delete)));
-       menu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-rename"),
+       menu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-rename"),
                sigc::mem_fun(*this,&CompView::menu_rename)));
 }
 
-etl::loose_handle<sinfg::Canvas>
+etl::loose_handle<synfig::Canvas>
 CompView::get_selected_canvas()
 {
        Glib::RefPtr<Gtk::TreeSelection> selection=canvas_tree->get_selection();
@@ -359,7 +359,7 @@ CompView::get_selected_canvas()
 
        studio::Instance::CanvasTreeModel canvas_tree_model;
 
-       return static_cast<etl::handle<sinfg::Canvas> >((*selection->get_selected())[canvas_tree_model.canvas]);
+       return static_cast<etl::handle<synfig::Canvas> >((*selection->get_selected())[canvas_tree_model.canvas]);
 }
 
 void
@@ -449,8 +449,8 @@ CompView::new_instance(etl::handle<studio::Instance> instance)
        
        etl::loose_handle<studio::Instance> loose_instance(instance);
        
-       instance->sinfgapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&CompView::refresh_instances));
-       instance->sinfgapp::Instance::signal_filename_changed().connect(
+       instance->synfigapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&CompView::refresh_instances));
+       instance->synfigapp::Instance::signal_filename_changed().connect(
                sigc::bind<etl::loose_handle<studio::Instance> >(
                        sigc::mem_fun(*this,&CompView::set_selected_instance),
                        loose_instance
@@ -536,7 +536,7 @@ CompView::on_action_event(GdkEvent *event)
                        //signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id());
                        if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP)
                        {
-                               etl::handle<sinfgapp::Action::Undoable> action(row[model.action]);
+                               etl::handle<synfigapp::Action::Undoable> action(row[model.action]);
                                if((bool)row[model.is_undo])
                                {
                                        while(get_selected_instance()->undo_action_stack().size() && get_selected_instance()->undo_action_stack().front()!=action)
@@ -571,10 +571,10 @@ CompView::on_tree_event(GdkEvent *event)
                {
                        menu.items().clear();
 
-                       sinfgapp::Action::ParamList param_list;
-                       param_list.add("canvas",sinfg::Canvas::Handle(get_selected_canvas()));
+                       synfigapp::Action::ParamList param_list;
+                       param_list.add("canvas",synfig::Canvas::Handle(get_selected_canvas()));
                        param_list.add("canvas_interface",get_selected_instance()->find_canvas_interface(get_selected_canvas()));
-                       get_selected_instance()->find_canvas_view(get_selected_canvas())->add_actions_to_menu(&menu, param_list,sinfgapp::Action::CATEGORY_CANVAS);                                     
+                       get_selected_instance()->find_canvas_view(get_selected_canvas())->add_actions_to_menu(&menu, param_list,synfigapp::Action::CATEGORY_CANVAS);                                    
                        menu.popup(0,0);
                        menu.show();
                        break;
@@ -602,7 +602,7 @@ CompView::on_action_toggle(const Glib::ustring& path_string)
        
        const Gtk::TreeRow row = *(selected_instance->history_tree_store()->get_iter(path));
 
-       handle<sinfgapp::Action::Undoable> action=row[history_tree_model.action];
+       handle<synfigapp::Action::Undoable> action=row[history_tree_model.action];
        
-       selected_instance->sinfgapp::Instance::set_action_status(action,!action->is_active());
+       selected_instance->synfigapp::Instance::set_action_status(action,!action->is_active());
 }
index 0fef090..6029bb7 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template Header File
 ** $Id: compview.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
 **
@@ -20,8 +20,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_COMPVIEW_H
-#define __SINFG_COMPVIEW_H
+#ifndef __SYNFIG_COMPVIEW_H
+#define __SYNFIG_COMPVIEW_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -46,7 +46,7 @@
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfg { class Canvas; };
+namespace synfig { class Canvas; };
 
 namespace studio {
 
@@ -81,7 +81,7 @@ public:
 
        etl::loose_handle<studio::Instance> get_selected_instance() { return selected_instance; }
 
-       etl::loose_handle<sinfg::Canvas> get_selected_canvas();
+       etl::loose_handle<synfig::Canvas> get_selected_canvas();
 
        etl::loose_handle<studio::CanvasView> get_selected_canvas_view();
 
index 6723e8f..65a99d1 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file devicetracker.cpp
 **     \brief Template File
 **
@@ -30,7 +30,7 @@
 
 #include "devicetracker.h"
 #include <gdkmm/device.h>
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -63,10 +63,10 @@ DeviceTracker::DeviceTracker()
                        GdkDevice* device=reinterpret_cast<GdkDevice*>(iter->data);
                        gdk_device_set_mode(device,GDK_MODE_SCREEN);
                        
-                       sinfgapp::InputDevice::Handle input_device;
-                       input_device=sinfgapp::Main::add_input_device(device->name,sinfgapp::InputDevice::Type(device->source));
-                       if(input_device->get_type()==sinfgapp::InputDevice::TYPE_MOUSE)
-                               sinfgapp::Main::select_input_device(input_device);
+                       synfigapp::InputDevice::Handle input_device;
+                       input_device=synfigapp::Main::add_input_device(device->name,synfigapp::InputDevice::Type(device->source));
+                       if(input_device->get_type()==synfigapp::InputDevice::TYPE_MOUSE)
+                               synfigapp::Main::select_input_device(input_device);
                }               
        }
 }
index cc25c04..9df8196 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file devicetracker.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_DEVICETRACKER_H
-#define __SINFG_DEVICETRACKER_H
+#ifndef __SYNFIG_DEVICETRACKER_H
+#define __SYNFIG_DEVICETRACKER_H
 
 /* === H E A D E R S ======================================================= */
 
index 5abb515..fdb93eb 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_gradient.cpp
 **     \brief Template File
 **
 #include <gtkmm/frame.h>
 #include <gtkmm/table.h>
 #include <gtkmm/label.h>
-#include <sinfg/general.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/value_desc.h>
+#include <synfig/general.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/value_desc.h>
 #include "widget_color.h"
 #include <gtkmm/spinbutton.h>
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 #include <sigc++/retype_return.h>
 #include <sigc++/retype.h>
 #include <sigc++/hide.h>
@@ -50,7 +50,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
index 4795a38..15de007 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_color.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DIALOG_COLOR_H
-#define __SINFG_STUDIO_DIALOG_COLOR_H
+#ifndef __SYNFIG_STUDIO_DIALOG_COLOR_H
+#define __SYNFIG_STUDIO_DIALOG_COLOR_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/optionmenu.h>
 #include <gtkmm/checkbutton.h>
 
-#include <sinfg/gamma.h>
-#include <sinfg/time.h>
+#include <synfig/gamma.h>
+#include <synfig/time.h>
 
 #include "widget_coloredit.h"
 
-#include <sinfgapp/value_desc.h>
-#include <sinfg/time.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/time.h>
 
 #include "dialogsettings.h"
 
@@ -53,7 +53,7 @@
 
 namespace Gtk { class Menu; class SpinButton; class Adjustment; };
 
-namespace sinfgapp {
+namespace synfigapp {
 class CanvasInterface;
 };
 
@@ -65,8 +65,8 @@ class Dialog_Color : public Gtk::Dialog
 {
        DialogSettings dialog_settings;
        
-       sigc::signal<void,sinfg::Color> signal_edited_;
-       //sigc::signal<void,sinfg::Color> signal_apply_;
+       sigc::signal<void,synfig::Color> signal_edited_;
+       //sigc::signal<void,synfig::Color> signal_apply_;
 
        bool on_close_pressed();
        void on_apply_pressed();
@@ -79,13 +79,13 @@ class Dialog_Color : public Gtk::Dialog
 public:
        bool busy()const { return busy_; }
        
-       sigc::signal<void,sinfg::Color>& signal_edited() { return signal_edited_; }
+       sigc::signal<void,synfig::Color>& signal_edited() { return signal_edited_; }
        
-       //sigc::signal<void,sinfg::Color>& signal_apply() { return signal_apply_; }
+       //sigc::signal<void,synfig::Color>& signal_apply() { return signal_apply_; }
        
-       void set_color(const sinfg::Color& x) { widget_color->set_value(x); }
+       void set_color(const synfig::Color& x) { widget_color->set_value(x); }
 
-       sinfg::Color get_color()const { return widget_color->get_value(); }
+       synfig::Color get_color()const { return widget_color->get_value(); }
                
        void reset();
 
@@ -93,7 +93,7 @@ public:
        Dialog_Color();
        ~Dialog_Color();
 
-//     void edit(const sinfgapp::ValueDesc &x, etl::handle<sinfgapp::CanvasInterface> canvas_interface, sinfg::Time x=0);
+//     void edit(const synfigapp::ValueDesc &x, etl::handle<synfigapp::CanvasInterface> canvas_interface, synfig::Time x=0);
 }; // END of Dialog_Color
 
 }; // END of namespace studio
index 5a3b0a7..fff92e0 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_gradient.cpp
 **     \brief Template File
 **
 #include <gtkmm/frame.h>
 #include <gtkmm/table.h>
 #include <gtkmm/label.h>
-#include <sinfg/general.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfgapp/main.h>
+#include <synfig/general.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/value_desc.h>
+#include <synfigapp/main.h>
 #include "widget_color.h"
 #include <gtkmm/spinbutton.h>
 #include "app.h"
@@ -47,7 +47,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -121,7 +121,7 @@ Dialog_Gradient::~Dialog_Gradient()
 }
 
 void
-Dialog_Gradient::set_gradient(const sinfg::Gradient& x)
+Dialog_Gradient::set_gradient(const synfig::Gradient& x)
 {
        widget_gradient->set_value(x);
 }
@@ -136,7 +136,7 @@ Dialog_Gradient::reset()
 void
 Dialog_Gradient::on_grab_pressed()
 {
-       sinfgapp::Main::set_gradient(get_gradient());
+       synfigapp::Main::set_gradient(get_gradient());
 //     signal_edited_(get_gradient());
 //     reset();
 //     hide();
@@ -155,7 +155,7 @@ Dialog_Gradient::on_changed()
 }
 
 void
-Dialog_Gradient::on_cpoint_selected(sinfg::Gradient::CPoint x)
+Dialog_Gradient::on_cpoint_selected(synfig::Gradient::CPoint x)
 {
        widget_color->set_value(x.color);
        adjustment_pos.set_value(x.pos);
@@ -164,20 +164,20 @@ Dialog_Gradient::on_cpoint_selected(sinfg::Gradient::CPoint x)
 void
 Dialog_Gradient::on_values_adjusted()
 {
-       sinfg::Gradient::CPoint x(widget_gradient->get_selected_cpoint());
+       synfig::Gradient::CPoint x(widget_gradient->get_selected_cpoint());
        x.color=widget_color->get_value();
        x.pos=adjustment_pos.get_value();
        widget_gradient->update_cpoint(x);
 }
 
 static void
-dialog_gradient_value_desc_edit(sinfg::Gradient g,sinfgapp::ValueDesc x,handle<sinfgapp::CanvasInterface> canvas_interface)
+dialog_gradient_value_desc_edit(synfig::Gradient g,synfigapp::ValueDesc x,handle<synfigapp::CanvasInterface> canvas_interface)
 {
 //     canvas_interface->connect_value(x,ValueBase(g));
 }
 
 void
-Dialog_Gradient::edit(const sinfgapp::ValueDesc &x, etl::handle<sinfgapp::CanvasInterface> canvas_interface, sinfg::Time time)
+Dialog_Gradient::edit(const synfigapp::ValueDesc &x, etl::handle<synfigapp::CanvasInterface> canvas_interface, synfig::Time time)
 {
        reset();
        if(x.is_const())
index 1c79609..2023a73 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_gradient.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DIALOG_GRADIENT_H
-#define __SINFG_STUDIO_DIALOG_GRADIENT_H
+#ifndef __SYNFIG_STUDIO_DIALOG_GRADIENT_H
+#define __SYNFIG_STUDIO_DIALOG_GRADIENT_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/optionmenu.h>
 #include <gtkmm/checkbutton.h>
 
-#include <sinfg/gamma.h>
-#include <sinfg/time.h>
+#include <synfig/gamma.h>
+#include <synfig/time.h>
 
 #include "widget_gradient.h"
 #include "widget_coloredit.h"
 
-#include <sinfgapp/value_desc.h>
-#include <sinfg/time.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/time.h>
 
 #include "dialogsettings.h"
 
@@ -54,7 +54,7 @@
 
 namespace Gtk { class Menu; class SpinButton; class Adjustment; };
 
-namespace sinfgapp {
+namespace synfigapp {
 class CanvasInterface;
 };
 
@@ -72,7 +72,7 @@ class Dialog_Gradient : public Gtk::Dialog
        Gtk::Adjustment adjustment_pos;
 
 
-       sigc::signal<void,sinfg::Gradient> signal_edited_;
+       sigc::signal<void,synfig::Gradient> signal_edited_;
 
        sigc::connection value_changed_connection;
        
@@ -80,7 +80,7 @@ class Dialog_Gradient : public Gtk::Dialog
        void on_apply_pressed();
        void on_grab_pressed();
        
-       void on_cpoint_selected(sinfg::Gradient::CPoint x);
+       void on_cpoint_selected(synfig::Gradient::CPoint x);
        void on_values_adjusted();
 
        Widget_Gradient* widget_gradient;
@@ -90,11 +90,11 @@ class Dialog_Gradient : public Gtk::Dialog
        
 public:
 
-       sigc::signal<void,sinfg::Gradient>& signal_edited() { return signal_edited_; }
+       sigc::signal<void,synfig::Gradient>& signal_edited() { return signal_edited_; }
        
-       void set_gradient(const sinfg::Gradient& x);
+       void set_gradient(const synfig::Gradient& x);
 
-       const sinfg::Gradient& get_gradient()const { return widget_gradient->get_value(); }
+       const synfig::Gradient& get_gradient()const { return widget_gradient->get_value(); }
                
        void reset();
 
@@ -102,7 +102,7 @@ public:
        Dialog_Gradient();
        ~Dialog_Gradient();
 
-       void edit(const sinfgapp::ValueDesc &x, etl::handle<sinfgapp::CanvasInterface> canvas_interface, sinfg::Time x=0);
+       void edit(const synfigapp::ValueDesc &x, etl::handle<synfigapp::CanvasInterface> canvas_interface, synfig::Time x=0);
 }; // END of Dialog_Gradient
 
 }; // END of namespace studio
index 6f2196b..7886e7a 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_keyframe.cpp
 **     \brief Template File
 **
@@ -32,8 +32,8 @@
 #include <gtkmm/scrolledwindow.h>
 #include <gtkmm/button.h>
 #include "widget_waypointmodel.h"
-#include <sinfgapp/action.h>
-#include <sinfgapp/instance.h>
+#include <synfigapp/action.h>
+#include <synfigapp/instance.h>
 
 #endif
 
@@ -41,7 +41,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -52,7 +52,7 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-Dialog_Keyframe::Dialog_Keyframe(Gtk::Window& parent,handle<sinfgapp::CanvasInterface> canvas_interface):
+Dialog_Keyframe::Dialog_Keyframe(Gtk::Window& parent,handle<synfigapp::CanvasInterface> canvas_interface):
        Gtk::Dialog(_("Keyframe Dialog"),parent,false,true),
        canvas_interface(canvas_interface)
 {
@@ -100,14 +100,14 @@ Dialog_Keyframe::~Dialog_Keyframe()
 {
 }
 
-const sinfg::Keyframe&
+const synfig::Keyframe&
 Dialog_Keyframe::get_keyframe()const
 {
        return keyframe_;
 }
 
 void
-Dialog_Keyframe::set_keyframe(const sinfg::Keyframe& x)
+Dialog_Keyframe::set_keyframe(const synfig::Keyframe& x)
 {
        keyframe_=x;
 }
@@ -118,7 +118,7 @@ Dialog_Keyframe::on_ok_pressed()
        if(widget_waypoint_model->get_waypoint_model().is_trivial())
                return;
        
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_waypoint_set"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_waypoint_set"));
        
        assert(action);
        
index 4d17a8d..3f3216b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_keyframe.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DIALOG_KEYFRAME_H
-#define __SINFG_STUDIO_DIALOG_KEYFRAME_H
+#ifndef __SYNFIG_STUDIO_DIALOG_KEYFRAME_H
+#define __SYNFIG_STUDIO_DIALOG_KEYFRAME_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -32,7 +32,7 @@
 #include <gtkmm/table.h>
 #include <gtkmm/entry.h>
 
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -48,9 +48,9 @@ class Widget_WaypointModel;
 class Dialog_Keyframe : public Gtk::Dialog
 {
        Gtk::Tooltips tooltips_;
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface;
+       etl::handle<synfigapp::CanvasInterface> canvas_interface;
        
-       sinfg::Keyframe keyframe_;
+       synfig::Keyframe keyframe_;
 
        Gtk::Entry entry_description;
        
@@ -61,11 +61,11 @@ class Dialog_Keyframe : public Gtk::Dialog
        void on_delete_pressed();
 
 public:
-       Dialog_Keyframe(Gtk::Window& parent,etl::handle<sinfgapp::CanvasInterface> canvas_interface);
+       Dialog_Keyframe(Gtk::Window& parent,etl::handle<synfigapp::CanvasInterface> canvas_interface);
        ~Dialog_Keyframe();
 
-       const sinfg::Keyframe& get_keyframe()const;
-       void set_keyframe(const sinfg::Keyframe& x);
+       const synfig::Keyframe& get_keyframe()const;
+       void set_keyframe(const synfig::Keyframe& x);
 
 private:
 
index da045fd..559932a 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_preview.cpp
 **     \brief Preview dialog File
 **
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 using namespace Gtk;
 
index 14417ea..3bccf8b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_preview.h
 **     \brief Preview dialog Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_DIALOG_PREVIEW_H
-#define __SINFG_GTKMM_DIALOG_PREVIEW_H
+#ifndef __SYNFIG_GTKMM_DIALOG_PREVIEW_H
+#define __SYNFIG_GTKMM_DIALOG_PREVIEW_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -55,7 +55,7 @@ class Dialog_Preview : public Gtk::Dialog
        Widget_Preview  preview;
        DialogSettings  settings;
        
-       //etl::handle<sinfg::Canvas> canvas;
+       //etl::handle<synfig::Canvas> canvas;
                        
 public:
        Dialog_Preview();
@@ -108,11 +108,11 @@ public:
        float get_global_fps() const { return globalfps; }
        void set_global_fps(float f);
        
-       sinfg::Time get_begintime() const { return time_begin.get_value(); }
-       void set_begintime(const sinfg::Time &t) { time_begin.set_value(t); }
+       synfig::Time get_begintime() const { return time_begin.get_value(); }
+       void set_begintime(const synfig::Time &t) { time_begin.set_value(t); }
        
-       sinfg::Time get_endtime() const { return time_end.get_value(); }
-       void set_endtime(const sinfg::Time &t) { time_end.set_value(t); }
+       synfig::Time get_endtime() const { return time_end.get_value(); }
+       void set_endtime(const synfig::Time &t) { time_end.set_value(t); }
        
        bool get_begin_override() const { return check_overbegin.get_active(); }
        void set_begin_override(bool o) { check_overbegin.set_active(o); }
index 2788dd6..1c36891 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_setup.cpp
 **     \brief Template File
 **
@@ -45,7 +45,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -57,7 +57,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dialog_Setup::Dialog_Setup():
-       Dialog(_("SINFG Studio Setup"),false,true),
+       Dialog(_("SYNFIG Studio Setup"),false,true),
        adj_gamma_r(2.2,0.1,3.0,0.025,0.025,0.025),
        adj_gamma_g(2.2,0.1,3.0,0.025,0.025,0.025),
        adj_gamma_b(2.2,0.1,3.0,0.025,0.025,0.025),
index 672b6c4..bf9d628 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_setup.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DIALOG_SETUP_H
-#define __SINFG_STUDIO_DIALOG_SETUP_H
+#ifndef __SYNFIG_STUDIO_DIALOG_SETUP_H
+#define __SYNFIG_STUDIO_DIALOG_SETUP_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -35,8 +35,8 @@
 #include <gtkmm/optionmenu.h>
 #include <gtkmm/checkbutton.h>
 
-#include <sinfg/gamma.h>
-#include <sinfg/time.h>
+#include <synfig/gamma.h>
+#include <synfig/time.h>
 #include <algorithm>
 
 /* === M A C R O S ========================================================= */
@@ -162,15 +162,15 @@ class Dialog_Setup : public Gtk::Dialog
 
        Gtk::CheckButton toggle_use_colorspace_gamma;
 
-       sinfg::Time::Format time_format;
+       synfig::Time::Format time_format;
        
        Gtk::Menu *timestamp_menu;
        Widget_Enum *widget_enum;
 public:
 
-       void set_time_format(sinfg::Time::Format time_format);
+       void set_time_format(synfig::Time::Format time_format);
 
-       const sinfg::Time::Format& get_time_format()const { return time_format; }
+       const synfig::Time::Format& get_time_format()const { return time_format; }
        
        Dialog_Setup();
        ~Dialog_Setup();
index a207ba6..d26df58 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -37,7 +37,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 
 /* === M A C R O S ========================================================= */
 
@@ -49,7 +49,7 @@ using namespace sinfg;
 
 /* === E N T R Y P O I N T ================================================= */
 
-studio::Dialog_SoundSelect::Dialog_SoundSelect(Gtk::Window &parent, etl::handle<sinfgapp::CanvasInterface> ci)
+studio::Dialog_SoundSelect::Dialog_SoundSelect(Gtk::Window &parent, etl::handle<synfigapp::CanvasInterface> ci)
 :Dialog(_("Sound Select")),
 okbutton(_("Ok")),
 canvas_interface(ci)
index 9897bff..248c7e2 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_soundselect.h
 **     \brief Sound Select Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_DIALOG_SOUNDSELECT_H
-#define __SINFG_DIALOG_SOUNDSELECT_H
+#ifndef __SYNFIG_DIALOG_SOUNDSELECT_H
+#define __SYNFIG_DIALOG_SOUNDSELECT_H
 
 /* === H E A D E R S ======================================================= */
 #include "dockdialog.h"
 #include "widget_filename.h"
 #include "widget_time.h"
 
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -42,7 +42,7 @@ namespace studio {
 struct AudioBaseInfo
 {
        std::string             file;
-       sinfg::Time             offset;
+       synfig::Time            offset;
 };
        
 class Dialog_SoundSelect : public Gtk::Dialog
@@ -51,30 +51,30 @@ class Dialog_SoundSelect : public Gtk::Dialog
        Widget_Time                     offset;
        Gtk::Button                     okbutton;
        
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface;
+       etl::handle<synfigapp::CanvasInterface> canvas_interface;
        
        sigc::signal<void,const std::string &>  signal_file_changed_;
-       sigc::signal<void,const sinfg::Time &>  signal_offset_changed_;
+       sigc::signal<void,const synfig::Time &> signal_offset_changed_;
        
        void on_file();
        void on_offset();
        void on_ok();
        
 public:
-       Dialog_SoundSelect(Gtk::Window &parent,etl::handle<sinfgapp::CanvasInterface> ci );
+       Dialog_SoundSelect(Gtk::Window &parent,etl::handle<synfigapp::CanvasInterface> ci );
        ~Dialog_SoundSelect();
 
        //float get_global_fps() const { return globalfps; }
        void set_global_fps(float f);
 
-       sinfg::Time get_offset() const { return offset.get_value(); }
-       void set_offset(const sinfg::Time &t) {offset.set_value(t); }
+       synfig::Time get_offset() const { return offset.get_value(); }
+       void set_offset(const synfig::Time &t) {offset.set_value(t); }
        
        std::string get_file() const { return soundfile.get_value(); }
        void set_file(const std::string &f) {soundfile.set_value(f); }
        
        sigc::signal<void,const std::string &> &signal_file_changed() { return signal_file_changed_; }
-       sigc::signal<void,const sinfg::Time &> &signal_offset_changed() { return signal_offset_changed_; }
+       sigc::signal<void,const synfig::Time &> &signal_offset_changed() { return signal_offset_changed_; }
 };
        
 }; // END of namespace studio
index 30bb55d..3ee93e1 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_tooloptions.cpp
 **     \brief Template File
 **
@@ -30,7 +30,7 @@
 
 #include <gtkmm/label.h>
 #include <gtkmm/scrolledwindow.h>
-#include <sinfg/general.h>
+#include <synfig/general.h>
 #include "dialog_tooloptions.h"
 #endif
 
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -50,7 +50,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dialog_ToolOptions::Dialog_ToolOptions():
-       Dockable("tool_options",_("Tool Options"),Gtk::StockID("sinfg-normal")),
+       Dockable("tool_options",_("Tool Options"),Gtk::StockID("synfig-normal")),
        empty_label(_("This tool has no options"))
 {
        //scrolled_.add(sub_vbox_);
@@ -77,7 +77,7 @@ Dialog_ToolOptions::clear()
        set_widget(empty_label);
        empty_label.show();
 
-       set_stock_id(Gtk::StockID("sinfg-normal"));
+       set_stock_id(Gtk::StockID("synfig-normal"));
 }
 
 void
@@ -92,7 +92,7 @@ Dialog_ToolOptions::set_widget(Gtk::Widget&x)
 }
 
 void
-Dialog_ToolOptions::set_name(const sinfg::String& name)
+Dialog_ToolOptions::set_name(const synfig::String& name)
 {
-       set_stock_id(Gtk::StockID("sinfg-"+name));
+       set_stock_id(Gtk::StockID("synfig-"+name));
 }
index 9358a5a..115cfff 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_tooloptions.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DIALOG_TOOLOPTIONS_H
-#define __SINFG_STUDIO_DIALOG_TOOLOPTIONS_H
+#ifndef __SYNFIG_STUDIO_DIALOG_TOOLOPTIONS_H
+#define __SYNFIG_STUDIO_DIALOG_TOOLOPTIONS_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -49,7 +49,7 @@ public:
                
        void clear();
        void set_widget(Gtk::Widget&);
-       void set_name(const sinfg::String& name);
+       void set_name(const synfig::String& name);
 
        Dialog_ToolOptions();
        ~Dialog_ToolOptions();
index 4d2da18..a55cc26 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_waypoint.cpp
 **     \brief Template Header
 **
@@ -43,7 +43,7 @@
 
 #endif
 
-using namespace sinfg;
+using namespace synfig;
 using namespace std;
 using namespace etl;
 using namespace studio;
@@ -56,7 +56,7 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-Dialog_Waypoint::Dialog_Waypoint(Gtk::Window& parent,etl::handle<sinfg::Canvas> canvas):
+Dialog_Waypoint::Dialog_Waypoint(Gtk::Window& parent,etl::handle<synfig::Canvas> canvas):
        Dialog(_("Waypoint Editor"),parent,false,true),
        canvas(canvas)
 {
@@ -113,19 +113,19 @@ Dialog_Waypoint::on_delete_pressed()
 }
 
 void
-Dialog_Waypoint::set_waypoint(sinfg::ValueNode_Animated::Waypoint x)
+Dialog_Waypoint::set_waypoint(synfig::ValueNode_Animated::Waypoint x)
 {
        waypointwidget->set_waypoint(x);
 }
 
-const sinfg::ValueNode_Animated::Waypoint &
+const synfig::ValueNode_Animated::Waypoint &
 Dialog_Waypoint::get_waypoint()const
 {
        return waypointwidget->get_waypoint();
 }
 
 void
-Dialog_Waypoint::set_value_desc(sinfgapp::ValueDesc value_desc)
+Dialog_Waypoint::set_value_desc(synfigapp::ValueDesc value_desc)
 {
        value_desc_=value_desc;
        if(value_desc.get_value_node() && value_desc.get_value_node()->get_parent_canvas())
index f8ea8e7..52a132d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_waypoint.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_DIALOG_WAYPOINT_H
-#define __SINFG_GTKMM_DIALOG_WAYPOINT_H
+#ifndef __SYNFIG_GTKMM_DIALOG_WAYPOINT_H
+#define __SYNFIG_GTKMM_DIALOG_WAYPOINT_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/menu.h>
 
 
-#include <sinfgapp/value_desc.h>
-#include <sinfg/valuenode_animated.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/string.h>
-#include <sinfg/time.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -72,9 +72,9 @@ class Widget_Waypoint;
 class Dialog_Waypoint : public Gtk::Dialog
 {
        Widget_Waypoint *waypointwidget;
-       etl::handle<sinfg::Canvas> canvas;
-       sinfg::ValueNode_Animated::WaypointList::iterator waypoint;
-       sinfgapp::ValueDesc value_desc_;
+       etl::handle<synfig::Canvas> canvas;
+       synfig::ValueNode_Animated::WaypointList::iterator waypoint;
+       synfigapp::ValueDesc value_desc_;
                
        sigc::signal<void> signal_changed_;
 
@@ -84,16 +84,16 @@ class Dialog_Waypoint : public Gtk::Dialog
        void on_delete_pressed();
 
 public:
-       Dialog_Waypoint(Gtk::Window& parent,etl::handle<sinfg::Canvas> canvas);
+       Dialog_Waypoint(Gtk::Window& parent,etl::handle<synfig::Canvas> canvas);
        ~Dialog_Waypoint();
 
     void reset();
 
-       void set_value_desc(sinfgapp::ValueDesc value_desc);
-       sinfgapp::ValueDesc get_value_desc()const { return value_desc_; }
+       void set_value_desc(synfigapp::ValueDesc value_desc);
+       synfigapp::ValueDesc get_value_desc()const { return value_desc_; }
 
-       void set_waypoint(sinfg::ValueNode_Animated::Waypoint x);
-       const sinfg::ValueNode_Animated::Waypoint &get_waypoint()const;
+       void set_waypoint(synfig::ValueNode_Animated::Waypoint x);
+       const synfig::ValueNode_Animated::Waypoint &get_waypoint()const;
 
        sigc::signal<void> &signal_changed()
        {return signal_changed_; }
index 260b750..f28c030 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialogsettings.cpp
 **     \brief Template File
 **
@@ -29,7 +29,7 @@
 #endif
 
 #include "dialogsettings.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -37,7 +37,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -48,20 +48,20 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-DialogSettings::DialogSettings(Gtk::Window* window,const sinfg::String& name):
+DialogSettings::DialogSettings(Gtk::Window* window,const synfig::String& name):
        window(window),
        name(name)
 {
-       sinfgapp::Main::settings().add_domain(this,"window."+name);
+       synfigapp::Main::settings().add_domain(this,"window."+name);
 }
 
 DialogSettings::~DialogSettings()
 {
-       sinfgapp::Main::settings().remove_domain("window."+name);
+       synfigapp::Main::settings().remove_domain("window."+name);
 }
 
 bool
-DialogSettings::get_value(const sinfg::String& key, sinfg::String& value)const
+DialogSettings::get_value(const synfig::String& key, synfig::String& value)const
 {
        if(key=="pos")
        {
@@ -107,11 +107,11 @@ DialogSettings::get_value(const sinfg::String& key, sinfg::String& value)const
                return true;
        }
 
-       return sinfgapp::Settings::get_value(key,value);
+       return synfigapp::Settings::get_value(key,value);
 }
 
 bool
-DialogSettings::set_value(const sinfg::String& key,const sinfg::String& value)
+DialogSettings::set_value(const synfig::String& key,const synfig::String& value)
 {
        if(value.empty())
                return false;
@@ -169,13 +169,13 @@ DialogSettings::set_value(const sinfg::String& key,const sinfg::String& value)
                return true;
        }
 
-       return sinfgapp::Settings::set_value(key,value);
+       return synfigapp::Settings::set_value(key,value);
 }
 
-sinfgapp::Settings::KeyList
+synfigapp::Settings::KeyList
 DialogSettings::get_key_list()const
 {
-       sinfgapp::Settings::KeyList ret(sinfgapp::Settings::get_key_list());
+       synfigapp::Settings::KeyList ret(synfigapp::Settings::get_key_list());
        
        ret.push_back("size");
        ret.push_back("pos");
index e32f385..8cd68d2 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialogsettings.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_DIALOGSETTINGS_H
-#define __SINFG_DIALOGSETTINGS_H
+#ifndef __SYNFIG_DIALOGSETTINGS_H
+#define __SYNFIG_DIALOGSETTINGS_H
 
 /* === H E A D E R S ======================================================= */
 
-#include <sinfgapp/settings.h>
+#include <synfigapp/settings.h>
 #include <gtkmm/window.h>
 
 /* === M A C R O S ========================================================= */
 
 namespace studio {
 
-class DialogSettings : public sinfgapp::Settings
+class DialogSettings : public synfigapp::Settings
 {
        Gtk::Window* window;
-       sinfg::String name;
+       synfig::String name;
 public:
-       DialogSettings(Gtk::Window* window,const sinfg::String& name);
+       DialogSettings(Gtk::Window* window,const synfig::String& name);
        virtual ~DialogSettings();
 
-       virtual bool get_value(const sinfg::String& key, sinfg::String& value)const;
-       virtual bool set_value(const sinfg::String& key,const sinfg::String& value);
+       virtual bool get_value(const synfig::String& key, synfig::String& value)const;
+       virtual bool set_value(const synfig::String& key,const synfig::String& value);
        virtual KeyList get_key_list()const;
 };
 
index e6c8d01..733ea12 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_history.cpp
 **     \brief Template File
 **
@@ -37,7 +37,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -49,7 +49,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dock_Canvases::Dock_Canvases():
-       Dockable("canvases",_("Canvas Browser"),Gtk::StockID("sinfg-canvas"))
+       Dockable("canvases",_("Canvas Browser"),Gtk::StockID("synfig-canvas"))
 {
 
        App::signal_instance_created().connect(sigc::mem_fun(*this,&studio::Dock_Canvases::new_instance));
@@ -61,7 +61,7 @@ Dock_Canvases::Dock_Canvases():
 
 /*
        add_button(
-               Gtk::StockID("sinfg-canvas_new"),
+               Gtk::StockID("synfig-canvas_new"),
                _("Insert a new canvas")
        )->signal_clicked().connect(
                sigc::mem_fun(
@@ -81,7 +81,7 @@ Dock_Canvases::Dock_Canvases():
        );
 
        add_button(
-               Gtk::StockID("sinfg-rename"),
+               Gtk::StockID("synfig-rename"),
                _("Rename selected canvas")
        )->signal_clicked().connect(
                sigc::mem_fun(
@@ -139,7 +139,7 @@ Dock_Canvases::get_selected_canvas_view()
        return get_selected_instance()->find_canvas_view(get_selected_canvas());
 }
 
-etl::loose_handle<sinfg::Canvas>
+etl::loose_handle<synfig::Canvas>
 Dock_Canvases::get_selected_canvas()
 {
        Glib::RefPtr<Gtk::TreeSelection> selection=canvas_tree->get_selection();
@@ -149,7 +149,7 @@ Dock_Canvases::get_selected_canvas()
 
        studio::Instance::CanvasTreeModel canvas_tree_model;
 
-       return static_cast<etl::handle<sinfg::Canvas> >((*selection->get_selected())[canvas_tree_model.canvas]);
+       return static_cast<etl::handle<synfig::Canvas> >((*selection->get_selected())[canvas_tree_model.canvas]);
 }
 
 
@@ -202,8 +202,8 @@ Dock_Canvases::new_instance(etl::handle<studio::Instance> instance)
        
        etl::loose_handle<studio::Instance> loose_instance(instance);
        
-       instance->sinfgapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&Dock_Canvases::refresh_instances));
-       instance->sinfgapp::Instance::signal_filename_changed().connect(
+       instance->synfigapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&Dock_Canvases::refresh_instances));
+       instance->synfigapp::Instance::signal_filename_changed().connect(
                sigc::bind<etl::loose_handle<studio::Instance> >(
                        sigc::mem_fun(*this,&Dock_Canvases::set_selected_instance),
                        loose_instance
index 1380167..a5fe1d5 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_canvases.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DIALOG_CANVASES_H
-#define __SINFG_STUDIO_DIALOG_CANVASES_H
+#ifndef __SYNFIG_STUDIO_DIALOG_CANVASES_H
+#define __SYNFIG_STUDIO_DIALOG_CANVASES_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -50,7 +50,7 @@ private:
 
        etl::loose_handle<studio::Instance> get_selected_instance() { return selected_instance; }
 
-       etl::loose_handle<sinfg::Canvas> get_selected_canvas();
+       etl::loose_handle<synfig::Canvas> get_selected_canvas();
 
        etl::loose_handle<studio::CanvasView> get_selected_canvas_view();
 
index e22501d..4bcf921 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_canvasspecific.cpp
 **     \brief Template File
 **
@@ -48,7 +48,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -59,7 +59,7 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-Dock_CanvasSpecific::Dock_CanvasSpecific(const sinfg::String& name,const sinfg::String& local_name,Gtk::StockID stock_id_):
+Dock_CanvasSpecific::Dock_CanvasSpecific(const synfig::String& name,const synfig::String& local_name,Gtk::StockID stock_id_):
        Dockable(name,local_name,stock_id_)
 {
        App::signal_instance_created().connect(sigc::mem_fun(*this,&Dock_CanvasSpecific::init_instance));
@@ -75,7 +75,7 @@ Dock_CanvasSpecific::get_canvas_view()
        return App::get_selected_canvas_view();
 }
 
-etl::loose_handle<sinfgapp::CanvasInterface>
+etl::loose_handle<synfigapp::CanvasInterface>
 Dock_CanvasSpecific::get_canvas_interface()
 {
        if(get_canvas_view())
@@ -104,7 +104,7 @@ Dock_CanvasSpecific::init_instance(etl::handle<Instance> instance)
        etl::clock timer;timer.reset();
        instance->signal_canvas_view_created().connect(sigc::mem_fun(*this,&Dock_CanvasSpecific::init_canvas_view));
        init_instance_vfunc(instance);
-       sinfg::info("%s init_instance() took %f seconds",get_local_name().c_str(),float(timer()));
+       synfig::info("%s init_instance() took %f seconds",get_local_name().c_str(),float(timer()));
 }
 
 void
@@ -129,7 +129,7 @@ Dock_CanvasSpecific::init_canvas_view(CanvasView* canvas_view)
                )       
        );
        */
-       sinfg::info("%s init_canvas_view() Starting init...",get_local_name().c_str());
+       synfig::info("%s init_canvas_view() Starting init...",get_local_name().c_str());
        etl::clock timer;timer.reset();
        App::signal_canvas_view_focus().connect(
                sigc::hide(
@@ -140,7 +140,7 @@ Dock_CanvasSpecific::init_canvas_view(CanvasView* canvas_view)
                )
        );
        init_canvas_view_vfunc(canvas_view);
-       sinfg::info("%s init_canvas_view() took %f seconds",get_local_name().c_str(),float(timer()));
+       synfig::info("%s init_canvas_view() took %f seconds",get_local_name().c_str(),float(timer()));
 }
 
 void
@@ -163,10 +163,10 @@ Dock_CanvasSpecific::canvas_view_changed()
 */
        
 #ifdef _DEBUG
-       sinfg::info("%s canvas_view_changed: start",get_local_name().c_str());
+       synfig::info("%s canvas_view_changed: start",get_local_name().c_str());
 #endif
        changed_canvas_view_vfunc(canvas_view);
 #ifdef _DEBUG
-       sinfg::info("%s canvas_view_changed: end",get_local_name().c_str());
+       synfig::info("%s canvas_view_changed: end",get_local_name().c_str());
 #endif
 }
index 542ac28..d22e29b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_canvasspecific.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_CANVASSPECIFIC_H
-#define __SINFG_STUDIO_DOCK_CANVASSPECIFIC_H
+#ifndef __SYNFIG_STUDIO_DOCK_CANVASSPECIFIC_H
+#define __SYNFIG_STUDIO_DOCK_CANVASSPECIFIC_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -59,9 +59,9 @@ private:
 public:
 
        etl::loose_handle<studio::CanvasView> get_canvas_view();
-       etl::loose_handle<sinfgapp::CanvasInterface> get_canvas_interface();
+       etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface();
 
-       Dock_CanvasSpecific(const sinfg::String& name,const sinfg::String& local_name,Gtk::StockID stock_id_=Gtk::StockID(" "));
+       Dock_CanvasSpecific(const synfig::String& name,const synfig::String& local_name,Gtk::StockID stock_id_=Gtk::StockID(" "));
        virtual ~Dock_CanvasSpecific();
 }; // END of Dock_CanvasSpecific
 
index 2f1fc1c..65d36c1 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_children.cpp
 **     \brief Template File
 **
@@ -48,7 +48,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -60,14 +60,14 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dock_Children::Dock_Children():
-       Dock_CanvasSpecific("children",_("Children"),Gtk::StockID("sinfg-children"))
+       Dock_CanvasSpecific("children",_("Children"),Gtk::StockID("synfig-children"))
 {
        set_use_scrolled(false);
 /*
        add(*create_action_tree());
 
        add_button(
-               Gtk::StockID("sinfg-clear_redo"),
+               Gtk::StockID("synfig-clear_redo"),
                _("Clear the REDO Stack")
        )->signal_clicked().connect(
                sigc::mem_fun(
index 5402900..6ff391b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_children.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_CHILDREN_H
-#define __SINFG_STUDIO_DOCK_CHILDREN_H
+#ifndef __SYNFIG_STUDIO_DOCK_CHILDREN_H
+#define __SYNFIG_STUDIO_DOCK_CHILDREN_H
 
 /* === H E A D E R S ======================================================= */
 
index bdd17e6..12832ab 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_params.cpp
 **     \brief Template File
 **
@@ -52,7 +52,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -64,7 +64,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dock_Curves::Dock_Curves():
-       Dock_CanvasSpecific("curves",_("Curves"),Gtk::StockID("sinfg-curves"))
+       Dock_CanvasSpecific("curves",_("Curves"),Gtk::StockID("synfig-curves"))
 {
        last_widget_curves_=0;
        table_=0;
@@ -93,7 +93,7 @@ _curve_selection_changed(Gtk::TreeView* param_tree_view,Widget_Curves* curves)
                return;
        }
        
-       std::list<sinfgapp::ValueDesc> value_descs;
+       std::list<synfigapp::ValueDesc> value_descs;
 
        //std::list<Gtk::TreePath> path_list(
        //param_tree_view->get_selection()->selected_foreach_iter(tmp);
@@ -140,7 +140,7 @@ Dock_Curves::refresh_selected_param()
        {
                LayerParamTreeStore::Model model;
                get_canvas_view()->work_area->set_selected_value_node(
-                       (sinfg::ValueNode::Handle)(*iter)[model.value_node]
+                       (synfig::ValueNode::Handle)(*iter)[model.value_node]
                );
        }
        else
index 234747b..8a61db3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_curves.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_CURVES_H
-#define __SINFG_STUDIO_DOCK_CURVES_H
+#ifndef __SYNFIG_STUDIO_DOCK_CURVES_H
+#define __SYNFIG_STUDIO_DOCK_CURVES_H
 
 /* === H E A D E R S ======================================================= */
 
index dde2718..c4e66e8 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_history.cpp
 **     \brief Template File
 **
@@ -39,7 +39,7 @@
 #include <sigc++/signal.h>
 #include <sigc++/hide.h>
 #include <sigc++/slot.h>
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "historytreestore.h"
 
 #endif
@@ -48,7 +48,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -70,7 +70,7 @@ Dock_History::Dock_History():
        
        action_group->add(Gtk::Action::create(
                "clear-undo",
-               Gtk::StockID("sinfg-clear_undo"),
+               Gtk::StockID("synfig-clear_undo"),
                _("Clear the UNDO Stack"),
                _("Clear the UNDO Stack")
        ),
@@ -81,7 +81,7 @@ Dock_History::Dock_History():
        );
        action_group->add(Gtk::Action::create(
                "clear-redo",
-               Gtk::StockID("sinfg-clear_redo"),
+               Gtk::StockID("synfig-clear_redo"),
                _("Clear the REDO Stack"),
                _("Clear the REDO Stack")
        ),
@@ -130,7 +130,7 @@ Dock_History::Dock_History():
        
        /*
        add_button(
-               Gtk::StockID("sinfg-clear_undo"),
+               Gtk::StockID("synfig-clear_undo"),
                _("Clear the UNDO Stack")
        )->signal_clicked().connect(
                sigc::mem_fun(
@@ -139,7 +139,7 @@ Dock_History::Dock_History():
                )
        );
        add_button(
-               Gtk::StockID("sinfg-clear_redo"),
+               Gtk::StockID("synfig-clear_redo"),
                _("Clear the REDO Stack")
        )->signal_clicked().connect(
                sigc::mem_fun(
@@ -360,7 +360,7 @@ Dock_History::on_action_event(GdkEvent *event)
                        //signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id());
                        if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP)
                        {
-                               etl::handle<sinfgapp::Action::Undoable> action(row[model.action]);
+                               etl::handle<synfigapp::Action::Undoable> action(row[model.action]);
                                try{
                                if((bool)row[model.is_undo])
                                {
@@ -399,7 +399,7 @@ Dock_History::on_action_toggle(const Glib::ustring& path_string)
        
        const Gtk::TreeRow row = *(selected_instance->history_tree_store()->get_iter(path));
 
-       handle<sinfgapp::Action::Undoable> action=row[history_tree_model.action];
+       handle<synfigapp::Action::Undoable> action=row[history_tree_model.action];
        
-       selected_instance->sinfgapp::Instance::set_action_status(action,!action->is_active());
+       selected_instance->synfigapp::Instance::set_action_status(action,!action->is_active());
 }
index 495dd59..e85faa7 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_history.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DIALOG_HISTORY_H
-#define __SINFG_STUDIO_DIALOG_HISTORY_H
+#ifndef __SYNFIG_STUDIO_DIALOG_HISTORY_H
+#define __SYNFIG_STUDIO_DIALOG_HISTORY_H
 
 /* === H E A D E R S ======================================================= */
 
index d5b8063..2686bc4 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_info.cpp
 **     \brief Dock Info File
 **
@@ -32,8 +32,8 @@
 #include "canvasview.h"
 #include "workarea.h"
 
-#include <sinfg/canvas.h>
-#include <sinfg/context.h>
+#include <synfig/canvas.h>
+#include <synfig/context.h>
 
 #include <gtkmm/separator.h>
 #include <gtkmm/invisible.h>
@@ -44,7 +44,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 
 /* === M A C R O S ========================================================= */
 #define use_colorspace_gamma() App::use_colorspace_gamma
@@ -92,7 +92,7 @@ void studio::Dock_Info::on_mouse_move()
 }
 
 studio::Dock_Info::Dock_Info()
-:Dock_CanvasSpecific("info",_("Info"),Gtk::StockID("sinfg-info"))
+:Dock_CanvasSpecific("info",_("Info"),Gtk::StockID("synfig-info"))
 {
        set_use_scrolled(false);
        
index 2d2cc5b..a0ba0fb 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_info.h
 **     \brief Info Dock Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_DOCK_INFO_H
-#define __SINFG_DOCK_INFO_H
+#ifndef __SYNFIG_DOCK_INFO_H
+#define __SYNFIG_DOCK_INFO_H
 
 /* === H E A D E R S ======================================================= */
 #include "dock_canvasspecific.h"
@@ -41,7 +41,7 @@ namespace studio {
 class Dock_Info : public Dock_CanvasSpecific
 {
        //bool                  valid;
-       //sinfg::Point  pos;
+       //synfig::Point pos;
        
        Gtk::Label  r,g,b,a;
        Gtk::Label      x,y;
index 2733c04..43073c7 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_keyframes.cpp
 **     \brief Template File
 **
@@ -48,7 +48,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -60,7 +60,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dock_Keyframes::Dock_Keyframes():
-       Dock_CanvasSpecific("keyframes",_("Keyframes"),Gtk::StockID("sinfg-keyframes")),
+       Dock_CanvasSpecific("keyframes",_("Keyframes"),Gtk::StockID("synfig-keyframes")),
        action_group(Gtk::ActionGroup::create()),
        keyframe_action_manager(new KeyframeActionManager)
 {
@@ -79,7 +79,7 @@ Dock_Keyframes::Dock_Keyframes():
        );
 
        add_button(
-               Gtk::StockID("sinfg-duplicate"),
+               Gtk::StockID("synfig-duplicate"),
                _("Duplicates the selected keyframe at the current time")
        )->signal_clicked().connect(
                sigc::mem_fun(
index 30ac815..f49b7e4 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_keyframes.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_KEYFRAMES_H
-#define __SINFG_STUDIO_DOCK_KEYFRAMES_H
+#ifndef __SYNFIG_STUDIO_DOCK_KEYFRAMES_H
+#define __SYNFIG_STUDIO_DOCK_KEYFRAMES_H
 
 /* === H E A D E R S ======================================================= */
 
index ec12b7f..227d765 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_layergroups.cpp
 **     \brief Template File
 **
@@ -50,7 +50,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -62,7 +62,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dock_LayerGroups::Dock_LayerGroups():
-       Dock_CanvasSpecific("groups",_("Groups"),Gtk::StockID("sinfg-group")),
+       Dock_CanvasSpecific("groups",_("Groups"),Gtk::StockID("synfig-group")),
        action_group_group_ops(Gtk::ActionGroup::create()),
        group_action_manager(new GroupActionManager)
 {      
index af6be44..c6d4e4d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_layergroups.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_LAYERGROUPS_H
-#define __SINFG_STUDIO_DOCK_LAYERGROUPS_H
+#ifndef __SYNFIG_STUDIO_DOCK_LAYERGROUPS_H
+#define __SYNFIG_STUDIO_DOCK_LAYERGROUPS_H
 
 /* === H E A D E R S ======================================================= */
 
index 3cfa166..0c596b2 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_layers.cpp
 **     \brief Template File
 **
@@ -50,7 +50,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -61,13 +61,13 @@ using namespace studio;
 
 /*static void do_nothing(reference_counter x)
 {
-       sinfg::info(__FILE__":%d:ref_count.count()=%d",__LINE__,x.count());
+       synfig::info(__FILE__":%d:ref_count.count()=%d",__LINE__,x.count());
 }*/
 
 /* === M E T H O D S ======================================================= */
 
 Dock_Layers::Dock_Layers():
-       Dock_CanvasSpecific("layers",_("Layers"),Gtk::StockID("sinfg-layer")),
+       Dock_CanvasSpecific("layers",_("Layers"),Gtk::StockID("synfig-layer")),
 //     layer_action_manager(0)
        layer_action_manager(new LayerActionManager)
 {
@@ -76,13 +76,13 @@ Dock_Layers::Dock_Layers():
        action_group_new_layers=Gtk::ActionGroup::create();
        action_group_layer_ops=Gtk::ActionGroup::create();
        
-       std::map<sinfg::String,sinfg::String> category_map;
+       std::map<synfig::String,synfig::String> category_map;
 
        // Build layer creation actions
-       sinfg::Layer::Book::iterator iter;
-       for(iter=sinfg::Layer::book().begin();iter!=sinfg::Layer::book().end();++iter)
+       synfig::Layer::Book::iterator iter;
+       for(iter=synfig::Layer::book().begin();iter!=synfig::Layer::book().end();++iter)
        {
-               sinfg::Layer::Book::value_type lyr(*iter);
+               synfig::Layer::Book::value_type lyr(*iter);
                
                if(lyr.second.category==_("Do Not Use"))
                        continue;
@@ -108,11 +108,11 @@ Dock_Layers::Dock_Layers():
        
        {
                Glib::RefPtr<Gtk::ActionGroup> action_group_categories(Gtk::ActionGroup::create("layer-category"));
-               sinfg::String layer_ui_info;
+               synfig::String layer_ui_info;
                
                layer_ui_info+="<ui><menubar action='menu-main'><menu action='menu-layer'><menu action='menu-layer-new'>";
 
-               std::map<sinfg::String,sinfg::String>::iterator iter;
+               std::map<synfig::String,synfig::String>::iterator iter;
                for(iter=category_map.begin();iter!=category_map.end();++iter)
                {
                        layer_ui_info+=strprintf("<menu action='%s'>%s</menu>",iter->first.c_str(),iter->second.c_str());
@@ -157,7 +157,7 @@ Dock_Layers::Dock_Layers():
 
        /*
        reference_counter ref_count;
-       sinfg::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
+       synfig::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
 
        {
                sigc::signal<void> tmp_signal;
@@ -169,24 +169,24 @@ Dock_Layers::Dock_Layers():
                        )
                );
                
-       sinfg::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
+       synfig::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
                tmp_signal();
-       sinfg::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
+       synfig::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
                
                tmp_signal.clear();
-       sinfg::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
+       synfig::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
                
                tmp_signal();
-       sinfg::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
+       synfig::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
                tmp_signal.connect(
                        sigc::bind(
                                sigc::ptr_fun(do_nothing),
                                ref_count
                        )
                );
-       sinfg::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
+       synfig::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
        }
-       sinfg::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
+       synfig::info(__FILE__":%d:ref_count.count()=%d",__LINE__,ref_count.count());
        assert(ref_count.count()==1);   
        */
 }
@@ -211,7 +211,7 @@ Dock_Layers::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
 
        layer_tree->signal_edited_value().connect(
                sigc::hide_return(
-                       sigc::mem_fun(*canvas_view->canvas_interface(), &sinfgapp::CanvasInterface::change_value)
+                       sigc::mem_fun(*canvas_view->canvas_interface(), &synfigapp::CanvasInterface::change_value)
                )
        );
 
@@ -265,7 +265,7 @@ Dock_Layers::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view
 }
 
 void
-Dock_Layers::add_layer(sinfg::String id)
+Dock_Layers::add_layer(synfig::String id)
 {
        etl::loose_handle<CanvasView> canvas_view(get_canvas_view());
        if(canvas_view)
index c0c2332..f7a40ca 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_layers.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_LAYERS_H
-#define __SINFG_STUDIO_DOCK_LAYERS_H
+#ifndef __SYNFIG_STUDIO_DOCK_LAYERS_H
+#define __SYNFIG_STUDIO_DOCK_LAYERS_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -60,7 +60,7 @@ protected:
 
 private:
 
-       void add_layer(sinfg::String id);
+       void add_layer(synfig::String id);
        void increase_amount();
        void decrease_amount();
 
index 5700a01..289e6ae 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_metadata.cpp
 **     \brief Template File
 **
@@ -46,7 +46,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -58,7 +58,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dock_MetaData::Dock_MetaData():
-       Dock_CanvasSpecific("meta_data",_("Canvas MetaData"),Gtk::StockID("sinfg-meta_data")),
+       Dock_CanvasSpecific("meta_data",_("Canvas MetaData"),Gtk::StockID("synfig-meta_data")),
        tree_view(manage(new Gtk::TreeView()))
 {
        MetaDataTreeStore::Model model;
@@ -127,7 +127,7 @@ Dock_MetaData::on_add_pressed()
 {
        if(get_canvas_interface())
        {
-               sinfg::String key;
+               synfig::String key;
                if(App::dialog_entry("New MetaData Entry", "Please enter the name of the key",key) && !key.empty())
                {
                        get_canvas_interface()->set_meta_data(key," ");
index f2036c2..f620d6c 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_metadata.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_METADATA_H
-#define __SINFG_STUDIO_DOCK_METADATA_H
+#ifndef __SYNFIG_STUDIO_DOCK_METADATA_H
+#define __SYNFIG_STUDIO_DOCK_METADATA_H
 
 /* === H E A D E R S ======================================================= */
 
index 022e6e3..4ea58a3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_navigator.cpp
 **     \brief Dock Nagivator File
 **
 #include "workarea.h"
 
 #include <cassert>
-#include <sinfg/canvas.h>
-#include <sinfg/context.h>
-#include <sinfg/target_scanline.h>
-#include <sinfg/surface.h>
+#include <synfig/canvas.h>
+#include <synfig/context.h>
+#include <synfig/target_scanline.h>
+#include <synfig/surface.h>
 
 #include <gtkmm/separator.h>
 
@@ -48,7 +48,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 
 /* === M A C R O S ========================================================= */
 
@@ -64,7 +64,7 @@ const double log_10_2 = log(2.0);
 studio::Widget_NavView::Widget_NavView(CanvasView::LooseHandle cv)
 :canvview(cv),
 adj_zoom(0,-4,4,1,2),
-surface(new sinfg::Surface)
+surface(new synfig::Surface)
 {
        attach(drawto,0,4,0,1);
        
@@ -123,15 +123,15 @@ void studio::Widget_NavView::on_start_render()
 {
        if(dirty)
        {
-               //sinfg::warning("Nav: Starting render");
-               //sinfg::warning("Nav: Rendering canvas");
+               //synfig::warning("Nav: Starting render");
+               //synfig::warning("Nav: Rendering canvas");
                etl::handle<Target_Scanline>    targ = surface_target(surface.get());
                
                targ->set_canvas(get_canvas_view()->get_canvas());
                targ->set_remove_alpha();
                targ->set_avoid_time_sync();
                targ->set_quality(get_canvas_view()->get_work_area()->get_quality());
-               //sinfg::info("Set the quality level to: %d", get_canvas_view()->get_work_area()->get_quality());
+               //synfig::info("Set the quality level to: %d", get_canvas_view()->get_work_area()->get_quality());
                
                //this should set it to render a single frame
                RendDesc        r = get_canvas_view()->get_canvas()->rend_desc();
@@ -140,13 +140,13 @@ void studio::Widget_NavView::on_start_render()
                //this changes the size of the canvas to the closest thing we can find
                int sw = r.get_w(), sh = r.get_h();
                
-               //sinfg::warning("Nav: source image is %d x %d", sw,sh);
+               //synfig::warning("Nav: source image is %d x %d", sw,sh);
                
                //resize so largest dimension is 128
                int dw = sw > sh ? 128 : sw*128/sh,
                        dh = sh > sw ? 128 : sh*128/sw;
                
-               //sinfg::warning("Nav: dest image is %d x %d", dw,dh);
+               //synfig::warning("Nav: dest image is %d x %d", dw,dh);
                
                r.set_w(dw);
                r.set_h(dh);
@@ -155,12 +155,12 @@ void studio::Widget_NavView::on_start_render()
                //float pw = r.get_pw();
                //float ph = r.get_ph();
                
-               //sinfg::warning("Nav: pixel size is %f x %f", pw,ph);
+               //synfig::warning("Nav: pixel size is %f x %f", pw,ph);
                
                //this renders that single frame
                targ->set_rend_desc(&r);
                
-               //sinfg::warning("Nav: Building async renderer and starting it...");
+               //synfig::warning("Nav: Building async renderer and starting it...");
                
                renderer = new AsyncRenderer(targ);
                renderer->signal_success().connect(sigc::mem_fun(*this,&Widget_NavView::on_finish_render));
@@ -174,14 +174,14 @@ void studio::Widget_NavView::on_finish_render()
        //convert it into our pixmap
        PixelFormat pf(PF_RGB);
        
-       //sinfg::warning("Nav: It hath succeeded!!!");
+       //synfig::warning("Nav: It hath succeeded!!!");
        
        //assert(renderer && renderer->has_success());
        DEBUGPOINT();
-       //sinfg::warning("Nav: now we know it really succeeded");
+       //synfig::warning("Nav: now we know it really succeeded");
        if(!*surface)
        {
-               sinfg::warning("dock_navigator: Bad surface");
+               synfig::warning("dock_navigator: Bad surface");
                return;
        }
        
@@ -197,15 +197,15 @@ void studio::Widget_NavView::on_finish_render()
        
        if(w != dw || h != dh || !prev)
        {
-               const int total_bytes(dw*dh*sinfg::channels(pf));
+               const int total_bytes(dw*dh*synfig::channels(pf));
                
-               //sinfg::warning("Nav: Updating the pixbuf to be the right size, etc. (%d bytes)", total_bytes);
+               //synfig::warning("Nav: Updating the pixbuf to be the right size, etc. (%d bytes)", total_bytes);
                
                prev.clear();
                guint8 *bytes = new guint8[total_bytes]; //24 bits per pixel
                
                //convert into our buffered dataS
-               //sinfg::warning("Nav: converting color format into buffer");
+               //synfig::warning("Nav: converting color format into buffer");
                convert_color_format((unsigned char *)bytes, (*surface)[0], dw*dh, pf, App::gamma);
                
                prev = 
@@ -216,15 +216,15 @@ void studio::Widget_NavView::on_finish_render()
                        8, // bits per sample
                        dw,     // width
                        dh,     // height
-                       dw*sinfg::channels(pf), // stride (pitch)
+                       dw*synfig::channels(pf), // stride (pitch)
                        SigC::slot(freegu8)
                );
        }
        else
        {
-               //sinfg::warning("Nav: Don't need to resize");
+               //synfig::warning("Nav: Don't need to resize");
                //convert into our buffered dataS
-               //sinfg::warning("Nav: converting color format into buffer");
+               //synfig::warning("Nav: converting color format into buffer");
                if(prev) //just in case we're stupid
                {
                        convert_color_format((unsigned char *)prev->get_pixels(), (*surface)[0], dw*dh, pf, App::gamma);
@@ -287,7 +287,7 @@ bool studio::Widget_NavView::on_expose_draw(GdkEventExpose *exp)
                sx = drawto.get_width() / (float)w;
                sy = drawto.get_height() / (float)h;
                
-               //sinfg::warning("Nav redraw: now to scale the bitmap: %.3f x %.3f",sx,sy);
+               //synfig::warning("Nav redraw: now to scale the bitmap: %.3f x %.3f",sx,sy);
                
                //round to smallest scale (fit entire thing in window without distortion)
                if(sx > sy) sx = sy;
@@ -315,10 +315,10 @@ bool studio::Widget_NavView::on_expose_draw(GdkEventExpose *exp)
                //draw to drawing area
                Glib::RefPtr<Gdk::GC>   gc = Gdk::GC::create(drawto.get_window());
                
-               //sinfg::warning("Nav: Scaling pixmap to off (%d,%d) with size (%d,%d)", offx,offy,nw, nh);
+               //synfig::warning("Nav: Scaling pixmap to off (%d,%d) with size (%d,%d)", offx,offy,nw, nh);
                Glib::RefPtr<Gdk::Pixbuf> scalepx = prev->scale_simple(nw,nh,Gdk::INTERP_NEAREST);
                
-               //sinfg::warning("Nav: Drawing scaled bitmap");
+               //synfig::warning("Nav: Drawing scaled bitmap");
                drawto.get_window()->draw_pixbuf(
                        gc, //GC
                        scalepx, //pixbuf
@@ -351,9 +351,9 @@ bool studio::Widget_NavView::on_expose_draw(GdkEventExpose *exp)
                //coord system:
                // tl : (offx,offy)
                // axis multipliers = xaxis,yaxis
-               //sinfg::warning("Nav: tl (%f,%f), br (%f,%f)", wtl[0],wtl[1],wbr[0],wbr[1]);
-               //sinfg::warning("Nav: tl (%f,%f), br (%f,%f)", wtl[0],wtl[1],wbr[0],wbr[1]);
-               //sinfg::warning("Nav: Drawing Rectangle (%d,%d) with dim (%d,%d)", l,t,rw,rh);
+               //synfig::warning("Nav: tl (%f,%f), br (%f,%f)", wtl[0],wtl[1],wbr[0],wbr[1]);
+               //synfig::warning("Nav: tl (%f,%f), br (%f,%f)", wtl[0],wtl[1],wbr[0],wbr[1]);
+               //synfig::warning("Nav: Drawing Rectangle (%d,%d) with dim (%d,%d)", l,t,rw,rh);
                drawto.get_window()->draw_rectangle(gc,false,l,t,rw,rh);
        }
        
@@ -408,7 +408,7 @@ void studio::Widget_NavView::on_number_modify()
 {
        double z = unit_to_zoom(adj_zoom.get_value());
        zoom_print.set_text(strprintf("%.1f%%",z*100.0));       
-       //sinfg::warning("Updating zoom to %f",adj_zoom.get_value());
+       //synfig::warning("Updating zoom to %f",adj_zoom.get_value());
        
        if(get_canvas_view() && z != get_canvas_view()->get_work_area()->get_zoom())
        {
@@ -423,7 +423,7 @@ void studio::Widget_NavView::on_workarea_view_change()
        double wz = get_canvas_view()->get_work_area()->get_zoom();
        double z = zoom_to_unit(wz);
 
-       //sinfg::warning("Updating zoom to %f -> %f",wz,z);
+       //synfig::warning("Updating zoom to %f -> %f",wz,z);
        if(!scrolling && z != adj_zoom.get_value())
        {
                adj_zoom.set_value(z);
@@ -482,7 +482,7 @@ bool studio::Widget_NavView::on_mouse_event(GdkEvent * e)
 //Navigator Dock Definitions
 
 studio::Dock_Navigator::Dock_Navigator()
-:Dock_CanvasSpecific("navigator",_("Navigator"),Gtk::StockID("sinfg-navigator"))
+:Dock_CanvasSpecific("navigator",_("Navigator"),Gtk::StockID("synfig-navigator"))
 {
        add(dummy);
 }
index 94c145c..1306b1d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_navigator.h
 **     \brief Navigator Dock Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_DOCK_NAVIGATOR_H
-#define __SINFG_DOCK_NAVIGATOR_H
+#ifndef __SYNFIG_DOCK_NAVIGATOR_H
+#define __SYNFIG_DOCK_NAVIGATOR_H
 
 /* === H E A D E R S ======================================================= */
 #include "sigc++/signal.h"
@@ -32,7 +32,7 @@
 #include <gtkmm/adjustment.h>
 #include <gtkmm/label.h>
 
-#include <sinfg/renddesc.h>
+#include <synfig/renddesc.h>
 
 #include "canvasview.h"
 #include "dock_canvasspecific.h"
@@ -69,7 +69,7 @@ class Widget_NavView : public Gtk::Table
        
        //asyncronous rendering stuff
        etl::handle<AsyncRenderer>      renderer;
-       etl::smart_ptr<sinfg::Surface> surface;
+       etl::smart_ptr<synfig::Surface> surface;
        bool                                            rendering;
        
        //drawing functionality
index e51e92c..16b5d5a 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_params.cpp
 **     \brief Template File
 **
@@ -47,7 +47,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -59,7 +59,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dock_Params::Dock_Params():
-       Dock_CanvasSpecific("params",_("Params"),Gtk::Stock::INDEX/*Gtk::StockID("sinfg-params")*/),
+       Dock_CanvasSpecific("params",_("Params"),Gtk::Stock::INDEX/*Gtk::StockID("synfig-params")*/),
        action_group(Gtk::ActionGroup::create())
 {
 /*
@@ -114,7 +114,7 @@ Dock_Params::refresh_selected_param()
        {
                LayerParamTreeStore::Model model;
                get_canvas_view()->work_area->set_selected_value_node(
-                       (sinfg::ValueNode::Handle)(*iter)[model.value_node]
+                       (synfig::ValueNode::Handle)(*iter)[model.value_node]
                );
        }
        else
index 1f3dbf5..466874f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_params.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_PARAMS_H
-#define __SINFG_STUDIO_DOCK_PARAMS_H
+#ifndef __SYNFIG_STUDIO_DOCK_PARAMS_H
+#define __SYNFIG_STUDIO_DOCK_PARAMS_H
 
 /* === H E A D E R S ======================================================= */
 
index c81a6cd..2a67f8d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_timetrack.cpp
 **     \brief Template File
 **
@@ -48,7 +48,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -64,7 +64,7 @@ class TimeTrackView : public Gtk::TreeView
        Gtk::TreeView *mimic_tree_view; 
 public:
 
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::Waypoint,int> signal_waypoint_clicked;
+       sigc::signal<void,synfigapp::ValueDesc,synfig::Waypoint,int> signal_waypoint_clicked;
 
        LayerParamTreeStore::Model model;
 
@@ -173,17 +173,17 @@ public:
                                                LayerList layer_list(get_selected_layers());
                                                if(layer_list.size()<=1)
                                                {
-                                                       sinfgapp::ValueDesc value_desc(row[model.value_desc]);
+                                                       synfigapp::ValueDesc value_desc(row[model.value_desc]);
                                                        Gtk::Menu* menu(manage(new Gtk::Menu()));                                       
                                                        App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc,0.5f);
                                                        menu->popup(event->button.button,gtk_get_current_event_time());
                                                        return true;
                                                }
                                                Gtk::Menu* menu(manage(new Gtk::Menu()));                                       
-                                               std::list<sinfgapp::ValueDesc> value_desc_list;
+                                               std::list<synfigapp::ValueDesc> value_desc_list;
                                                ParamDesc param_desc(row[model.param_desc]);
                                                for(;!layer_list.empty();layer_list.pop_back())
-                                                       value_desc_list.push_back(sinfgapp::ValueDesc(layer_list.back(),param_desc.get_name()));
+                                                       value_desc_list.push_back(synfigapp::ValueDesc(layer_list.back(),param_desc.get_name()));
                                                App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc_list);
                                                menu->popup(event->button.button,gtk_get_current_event_time());
                                                return true;
@@ -286,7 +286,7 @@ public:
        void
        queue_draw_msg()
        {
-               sinfg::info("*************QUEUE_DRAW***************** (time track view)");
+               synfig::info("*************QUEUE_DRAW***************** (time track view)");
                Widget::queue_draw();
        }
        void set_model(Glib::RefPtr<LayerParamTreeStore> store)
@@ -298,9 +298,9 @@ public:
        }
        
        void
-       on_waypoint_changed( sinfg::Waypoint waypoint , sinfg::ValueNode::Handle value_node)
+       on_waypoint_changed( synfig::Waypoint waypoint , synfig::ValueNode::Handle value_node)
        {
-               sinfgapp::Action::ParamList param_list;
+               synfigapp::Action::ParamList param_list;
                param_list.add("canvas",param_tree_store_->canvas_interface()->get_canvas());
                param_list.add("canvas_interface",param_tree_store_->canvas_interface());
                param_list.add("value_node",value_node);
@@ -353,7 +353,7 @@ public:
        }
        
        void
-       on_waypoint_clicked(const Glib::ustring &path_string, sinfg::Waypoint waypoint,int button)
+       on_waypoint_clicked(const Glib::ustring &path_string, synfig::Waypoint waypoint,int button)
        {
 /*
                Gtk::TreePath path(path_string);
@@ -369,14 +369,14 @@ public:
                Gtk::TreeRow row;
                if(!param_tree_store_->find_first_value_node(value_node, row))
                {
-                       sinfg::error(__FILE__":%d: Unable to find the valuenode",__LINE__);
+                       synfig::error(__FILE__":%d: Unable to find the valuenode",__LINE__);
                        return;
                }
                
                if(!row)
                        return;
                
-               sinfgapp::ValueDesc value_desc(static_cast<sinfgapp::ValueDesc>(row[model.value_desc]));
+               synfigapp::ValueDesc value_desc(static_cast<synfigapp::ValueDesc>(row[model.value_desc]));
 
                signal_waypoint_clicked(value_desc,waypoint,button);
        }
@@ -389,7 +389,7 @@ public:
 /* === M E T H O D S ======================================================= */
 
 Dock_Timetrack::Dock_Timetrack():
-       Dock_CanvasSpecific("timetrack",_("Timetrack"),Gtk::StockID("sinfg-timetrack"))
+       Dock_CanvasSpecific("timetrack",_("Timetrack"),Gtk::StockID("synfig-timetrack"))
 {
        table_=0;
        widget_timeslider_= new Widget_Timeslider();
@@ -444,7 +444,7 @@ Dock_Timetrack::refresh_selected_param()
        {
                LayerParamTreeStore::Model model;
                get_canvas_view()->work_area->set_selected_value_node(
-                       (sinfg::ValueNode::Handle)(*iter)[model.value_node]
+                       (synfig::ValueNode::Handle)(*iter)[model.value_node]
                );
        }
        else
index 76e0e23..eba186f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dock_timetrack.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_TIMETRACK_H
-#define __SINFG_STUDIO_DOCK_TIMETRACK_H
+#ifndef __SYNFIG_STUDIO_DOCK_TIMETRACK_H
+#define __SYNFIG_STUDIO_DOCK_TIMETRACK_H
 
 /* === H E A D E R S ======================================================= */
 
index b3fb489..d3c4aa8 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dockable.cpp
 **     \brief Template File
 **
@@ -35,7 +35,7 @@
 #include "dockmanager.h"
 #include "dockbook.h"
 #include "dockdialog.h"
-#include <sinfg/general.h>
+#include <synfig/general.h>
 #include <gtkmm/table.h>
 #include <gtk/gtk.h>
 
@@ -45,7 +45,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -71,7 +71,7 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-Dockable::Dockable(const sinfg::String& name,const sinfg::String& local_name,Gtk::StockID stock_id_):
+Dockable::Dockable(const synfig::String& name,const synfig::String& local_name,Gtk::StockID stock_id_):
 //     Gtk::Window(Gtk::WINDOW_TOPLEVEL),
        name_(name),
        local_name_(local_name),
@@ -225,7 +225,7 @@ Dockable::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, Gtk::Selection
 }
 
 void
-Dockable::set_local_name(const sinfg::String& local_name)
+Dockable::set_local_name(const synfig::String& local_name)
 {
        //set_title(local_name);
        title_label_.set_text(local_name);
@@ -311,13 +311,13 @@ Dockable::add(Gtk::Widget& x)
 }
 
 Gtk::ToolButton*
-Dockable::add_button(const Gtk::StockID& stock_id, const sinfg::String& tooltip)
+Dockable::add_button(const Gtk::StockID& stock_id, const synfig::String& tooltip)
 {
        if(!toolbar_)
                set_toolbar(*manage(new Gtk::Toolbar));
 
        //Gtk::IconSize iconsize(4);
-       //Gtk::IconSize iconsize(Gtk::IconSize::from_name("sinfg-small_icon"));
+       //Gtk::IconSize iconsize(Gtk::IconSize::from_name("synfig-small_icon"));
 
        Gtk::ToolButton* ret(manage(new Gtk::ToolButton(stock_id)));
        //Gtk::Image* icon(manage(new Gtk::Image(stock_id,iconsize)));
index 940fe54..4218bf9 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dockable.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCKABLE_H
-#define __SINFG_STUDIO_DOCKABLE_H
+#ifndef __SYNFIG_STUDIO_DOCKABLE_H
+#define __SYNFIG_STUDIO_DOCKABLE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/stockid.h>
 #include <gtkmm/button.h>
 #include "dialogsettings.h"
-#include <sinfg/string.h>
+#include <synfig/string.h>
 #include <gtkmm/table.h>
 #include <gtkmm/tooltips.h>
 #include <gtkmm/label.h>
@@ -68,8 +68,8 @@ private:
 
        Gtk::Toolbar *toolbar_;
 
-       sinfg::String name_;
-       sinfg::String local_name_;
+       synfig::String name_;
+       synfig::String local_name_;
        Gtk::Tooltips tooltips_;
        Gtk::Frame frame_;
        Gtk::Label title_label_;
@@ -96,18 +96,18 @@ public:
 
        void set_use_scrolled(bool x) { use_scrolled_=x; }
        
-       Dockable(const sinfg::String& name,const sinfg::String& local_name,Gtk::StockID stock_id_=Gtk::StockID(" "));
+       Dockable(const synfig::String& name,const synfig::String& local_name,Gtk::StockID stock_id_=Gtk::StockID(" "));
        ~Dockable();
 
        sigc::signal<void>& signal_stock_id_changed() { return signal_stock_id_changed_; }
 
-       const sinfg::String& get_name()const { return name_; }
-       const sinfg::String& get_local_name()const { return local_name_; }
+       const synfig::String& get_name()const { return name_; }
+       const synfig::String& get_local_name()const { return local_name_; }
 
        const Gtk::StockID& get_stock_id()const { return stock_id_; }
        void set_stock_id(Gtk::StockID x) { stock_id_=x; signal_stock_id_changed()(); }
        
-       void set_local_name(const sinfg::String&);
+       void set_local_name(const synfig::String&);
 
        void clear();
        
@@ -118,7 +118,7 @@ public:
        
        void add(Gtk::Widget& x);
        
-       Gtk::ToolButton* add_button(const Gtk::StockID& stock_id, const sinfg::String& tooltip=sinfg::String());        
+       Gtk::ToolButton* add_button(const Gtk::StockID& stock_id, const synfig::String& tooltip=synfig::String());      
        
        void detach();
 
index f9660ec..10ac98e 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dockbook.cpp
 **     \brief Template File
 **
@@ -43,7 +43,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -172,10 +172,10 @@ DockBook::present()
        show();
 }
 
-sinfg::String
+synfig::String
 DockBook::get_local_contents()const
 {
-       sinfg::String ret;
+       synfig::String ret;
        
        for(int i(0);i!=const_cast<DockBook*>(this)->get_n_pages();i++)
        {
@@ -189,10 +189,10 @@ DockBook::get_local_contents()const
        return ret;
 }
 
-sinfg::String
+synfig::String
 DockBook::get_contents()const
 {
-       sinfg::String ret;
+       synfig::String ret;
        
        for(int i(0);i!=const_cast<DockBook*>(this)->get_n_pages();i++)
        {
@@ -207,14 +207,14 @@ DockBook::get_contents()const
 }
 
 void
-DockBook::set_contents(const sinfg::String& x)
+DockBook::set_contents(const synfig::String& x)
 {
-       sinfg::String str(x);
+       synfig::String str(x);
        while(!str.empty())
        {
                unsigned int separator=str.find_first_of(' ');
-               sinfg::String dock;
-               if(separator==sinfg::String::npos)
+               synfig::String dock;
+               if(separator==synfig::String::npos)
                {
                        dock=str;
                        str.clear();
index 6ef7478..4851c4b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dockbook.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCKBOOK_H
-#define __SINFG_STUDIO_DOCKBOOK_H
+#ifndef __SYNFIG_STUDIO_DOCKBOOK_H
+#define __SYNFIG_STUDIO_DOCKBOOK_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/notebook.h>
-#include <sinfg/string.h>
+#include <synfig/string.h>
 #include <gtkmm/tooltips.h>
 
 /* === M A C R O S ========================================================= */
@@ -68,10 +68,10 @@ public:
 
        void clear();
 
-       sinfg::String get_local_contents()const;
+       synfig::String get_local_contents()const;
        
-       sinfg::String get_contents()const;
-       void set_contents(const sinfg::String& x);
+       synfig::String get_contents()const;
+       void set_contents(const synfig::String& x);
 
        void refresh_tabs_headers();
        
index 62ff671..5f72be0 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dockdialog.cpp
 **     \brief Template File
 **
@@ -35,8 +35,8 @@
 #include "dockbook.h"
 #include "dockmanager.h"
 #include "widget_compselect.h"
-#include <sinfg/general.h>
-#include <sinfg/uniqueid.h>
+#include <synfig/general.h>
+#include <synfig/uniqueid.h>
 #include <gtkmm/table.h>
 #include <sigc++/hide.h>
 #include <sigc++/slot.h>
@@ -45,7 +45,7 @@
 #include "canvasview.h"
 #include <gtkmm/paned.h>
 #include <gtkmm/box.h>
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
 
 #define GRAB_HINT_DATA(y,default)      { \
                String x; \
-               if(sinfgapp::Main::settings().get_value(String("pref.")+y+"_hints",x)) \
+               if(synfigapp::Main::settings().get_value(String("pref.")+y+"_hints",x)) \
                { \
                        set_type_hint((Gdk::WindowTypeHint)atoi(x.c_str()));    \
                } else {\
@@ -86,7 +86,7 @@ DockDialog::DockDialog():
        widget_comp_select=new Widget_CompSelect();
        
        // Give ourselves an ID that is most likely unique
-       set_id(sinfg::UniqueID().get_uid()^reinterpret_cast<int>(this));
+       set_id(synfig::UniqueID().get_uid()^reinterpret_cast<int>(this));
        
        set_role(strprintf("dock_dialog_%d",get_id()));
        GRAB_HINT_DATA(
@@ -169,7 +169,7 @@ DockDialog::~DockDialog()
        }
        catch(...)
        {
-               sinfg::warning("DockDialog::~DockDialog(): Exception thrown when trying to remove from dock manager...?");
+               synfig::warning("DockDialog::~DockDialog(): Exception thrown when trying to remove from dock manager...?");
        }
 
        delete widget_comp_select;
@@ -292,7 +292,7 @@ DockDialog::erase_dock_book(DockBook* dock_book)
 void
 DockDialog::refresh()
 {
-       sinfg::info("dock_book_list.size()=%d",dock_book_list.size());
+       synfig::info("dock_book_list.size()=%d",dock_book_list.size());
        //remove();
 
        if(dock_book_list.empty())
@@ -432,7 +432,7 @@ DockDialog::refresh_accel_group()
 bool
 DockDialog::close()
 {
-       sinfg::info("DockDialog::close(): DELETED!");
+       synfig::info("DockDialog::close(): DELETED!");
        empty_sig.disconnect();
        //get_dock_book().clear();
        delete this;    
@@ -454,10 +454,10 @@ DockDialog::get_dock_book()const
 }
 
 
-sinfg::String
+synfig::String
 DockDialog::get_contents()const
 {
-       sinfg::String ret;
+       synfig::String ret;
 
        std::list<DockBook*>::const_iterator iter;
        for(iter=dock_book_list.begin();iter!=dock_book_list.end();++iter)
@@ -472,20 +472,20 @@ DockDialog::get_contents()const
 }
 
 void
-DockDialog::set_contents(const sinfg::String& z)
+DockDialog::set_contents(const synfig::String& z)
 {
        int x,y;
        get_size(x,y);
 
-       sinfg::String str(z);
+       synfig::String str(z);
        while(!str.empty())
        {
                unsigned int separator=str.find_first_of('-');
                {
                        unsigned int sep2=str.find_first_of('|');
-                       if(separator!=sinfg::String::npos || sep2!=sinfg::String::npos)
+                       if(separator!=synfig::String::npos || sep2!=synfig::String::npos)
                        {
-                               if((separator==sinfg::String::npos || sep2<separator) && sep2!=sinfg::String::npos)
+                               if((separator==synfig::String::npos || sep2<separator) && sep2!=synfig::String::npos)
                                {
                                        separator=sep2;
                                        is_horizontal=true;
@@ -495,8 +495,8 @@ DockDialog::set_contents(const sinfg::String& z)
                        }
                }
                
-               sinfg::String book_contents;
-               if(separator==sinfg::String::npos)
+               synfig::String book_contents;
+               if(separator==synfig::String::npos)
                {
                        book_contents=str;
                        str.clear();
@@ -534,7 +534,7 @@ DockDialog::refresh_title()
        if(is_deleting)return;
        if(dock_book_list.size())
        {
-               sinfg::String title;
+               synfig::String title;
 
                std::list<DockBook*>::const_iterator iter;
                for(iter=dock_book_list.begin();iter!=dock_book_list.end();++iter)
index 52abc55..512c026 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dockdialog.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_DIALOG_H
-#define __SINFG_STUDIO_DOCK_DIALOG_H
+#ifndef __SYNFIG_STUDIO_DOCK_DIALOG_H
+#define __SYNFIG_STUDIO_DOCK_DIALOG_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/stockid.h>
 #include <gtkmm/button.h>
 #include "dialogsettings.h"
-#include <sinfg/string.h>
+#include <synfig/string.h>
 #include <gtkmm/dialog.h>
 #include <gtkmm/tooltips.h>
 #include <gtkmm/label.h>
@@ -116,8 +116,8 @@ public:
        DockBook& get_dock_book();
        const DockBook& get_dock_book()const;
 
-       sinfg::String get_contents()const;
-       void set_contents(const sinfg::String& x);
+       synfig::String get_contents()const;
+       void set_contents(const synfig::String& x);
 }; // END of studio::DockDialog
 
 }; // END of namespace studio
index 503aba2..92aef31 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dockmanager.cpp
 **     \brief Template File
 **
@@ -32,8 +32,8 @@
 #include <stdexcept>
 #include "dockable.h"
 #include "dockdialog.h"
-#include <sinfgapp/settings.h>
-#include <sinfgapp/main.h>
+#include <synfigapp/settings.h>
+#include <synfigapp/main.h>
 #include <gdkmm/general.h>
 
 #endif
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
 
 /* === P R O C E D U R E S ================================================= */
 
-class studio::DockSettings : public sinfgapp::Settings
+class studio::DockSettings : public synfigapp::Settings
 {
        DockManager* dock_manager;
        
 public:
        DockSettings(DockManager* dock_manager):dock_manager(dock_manager)
        {
-               sinfgapp::Main::settings().add_domain(this,"dock");
+               synfigapp::Main::settings().add_domain(this,"dock");
        }
        
        virtual ~DockSettings()
        {
-               sinfgapp::Main::settings().remove_domain("dock");
+               synfigapp::Main::settings().remove_domain("dock");
        }
 #define SCALE_FACTOR   (1280)
-       virtual bool get_value(const sinfg::String& key_, sinfg::String& value)const
+       virtual bool get_value(const synfig::String& key_, synfig::String& value)const
        {
                int screen_w(Gdk::screen_width());
                int screen_h(Gdk::screen_height());
                
                if(key_.size()>6 && String(key_.begin(),key_.begin()+6)=="dialog")try
                {
-                       sinfg::String key(key_.begin()+7,key_.end());
+                       synfig::String key(key_.begin()+7,key_.end());
                        int separator=key.find_first_of('.');
-                       int id(atoi(sinfg::String(key.begin(),key.begin()+separator).c_str()));
-                       key=sinfg::String(key.begin()+separator+1,key.end());
+                       int id(atoi(synfig::String(key.begin(),key.begin()+separator).c_str()));
+                       key=synfig::String(key.begin()+separator+1,key.end());
                        
                        DockDialog& dock_dialog(dock_manager->find_dock_dialog(id));
                        
@@ -111,20 +111,20 @@ public:
                                return true;
                        }
                }catch (...) { return false; }
-               return sinfgapp::Settings::get_value(key_,value);
+               return synfigapp::Settings::get_value(key_,value);
        }
 
-       virtual bool set_value(const sinfg::String& key_,const sinfg::String& value)
+       virtual bool set_value(const synfig::String& key_,const synfig::String& value)
        {
                int screen_w(Gdk::screen_width());
                int screen_h(Gdk::screen_height());
 
                if(key_.size()>6 && String(key_.begin(),key_.begin()+6)=="dialog")
                {
-                       sinfg::String key(key_.begin()+7,key_.end());
+                       synfig::String key(key_.begin()+7,key_.end());
                        int separator=key.find_first_of('.');
-                       int id(atoi(sinfg::String(key.begin(),key.begin()+separator).c_str()));
-                       key=sinfg::String(key.begin()+separator+1,key.end());
+                       int id(atoi(synfig::String(key.begin(),key.begin()+separator).c_str()));
+                       key=synfig::String(key.begin()+separator+1,key.end());
                        
                        DockDialog& dock_dialog(dock_manager->find_dock_dialog(id));
 
@@ -152,7 +152,7 @@ public:
                                }
                                catch(...)
                                {
-                                       sinfg::error("Exception caught!!!");
+                                       synfig::error("Exception caught!!!");
                                        return false;
                                }
                                return true;
@@ -192,12 +192,12 @@ public:
                                return true;
                        }
                }
-               return sinfgapp::Settings::set_value(key_,value);
+               return synfigapp::Settings::set_value(key_,value);
        }
        
        virtual KeyList get_key_list()const
        {
-               sinfgapp::Settings::KeyList ret(sinfgapp::Settings::get_key_list());
+               synfigapp::Settings::KeyList ret(synfigapp::Settings::get_key_list());
 
                std::list<DockDialog*>::const_iterator iter;
                for(iter=dock_manager->dock_dialog_list_.begin();iter!=dock_manager->dock_dialog_list_.end();++iter)
@@ -228,7 +228,7 @@ DockManager::~DockManager()
        while(!dockable_list_.empty())
        {
                Dockable* dockable(dockable_list_.back());
-               sinfg::info("DockManager::~DockManager(): Deleting dockable \"%s\"",dockable->get_name().c_str());
+               synfig::info("DockManager::~DockManager(): Deleting dockable \"%s\"",dockable->get_name().c_str());
                dockable_list_.pop_back();              
                delete dockable;
        }
@@ -238,7 +238,7 @@ void
 DockManager::register_dockable(Dockable& x)
 {
        dockable_list_.push_back(&x);
-       sinfg::info("DockManager::register_dockable(): Registered dockable \"%s\"",dockable_list_.back()->get_name().c_str());
+       synfig::info("DockManager::register_dockable(): Registered dockable \"%s\"",dockable_list_.back()->get_name().c_str());
        signal_dockable_registered()(&x);
 }
 
@@ -252,7 +252,7 @@ DockManager::unregister_dockable(Dockable& x)
                {
                        x.detach();
                        dockable_list_.erase(iter);
-                       sinfg::info("DockManager::unregister_dockable(): \"%s\" has been Unregistered",x.get_name().c_str());
+                       synfig::info("DockManager::unregister_dockable(): \"%s\" has been Unregistered",x.get_name().c_str());
                        return true;
                }
        }
@@ -260,7 +260,7 @@ DockManager::unregister_dockable(Dockable& x)
 }
 
 Dockable&
-DockManager::find_dockable(const sinfg::String& x)
+DockManager::find_dockable(const synfig::String& x)
 {
        std::list<Dockable*>::iterator iter;
        for(iter=dockable_list_.begin();iter!=dockable_list_.end();++iter)
@@ -271,7 +271,7 @@ DockManager::find_dockable(const sinfg::String& x)
 }
 
 void
-DockManager::present(sinfg::String x)
+DockManager::present(synfig::String x)
 {
        try
        {
index 6a6765a..cfc6f29 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dockmanager.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_DOCKMANAGER_H
-#define __SINFG_DOCKMANAGER_H
+#ifndef __SYNFIG_DOCKMANAGER_H
+#define __SYNFIG_DOCKMANAGER_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <vector>
 #include <list>
-#include <sinfg/string.h>
+#include <synfig/string.h>
 #include <sigc++/signal.h>
 #include <sigc++/object.h>
 #include <ETL/smart_ptr>
@@ -69,8 +69,8 @@ public:
 
        void register_dockable(Dockable& x);
        bool unregister_dockable(Dockable& x);
-       Dockable& find_dockable(const sinfg::String& x);
-       void present(sinfg::String x);
+       Dockable& find_dockable(const synfig::String& x);
+       void present(synfig::String x);
        
 }; // END of class DockManager
 
index f540c3d..fed3826 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file duck.cpp
 **     \brief Template File
 **
@@ -36,7 +36,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -51,7 +51,7 @@ struct _DuckCounter
        ~_DuckCounter()
        {
                if(counter)
-                       sinfg::error("%d ducks not yet deleted!",counter);
+                       synfig::error("%d ducks not yet deleted!",counter);
        }
 } _duck_counter;
 
@@ -70,7 +70,7 @@ Duck::Duck():
        tangent_(false)
 { duck_count++; _DuckCounter::counter++; }
 
-Duck::Duck(const sinfg::Point &point):
+Duck::Duck(const synfig::Point &point):
        type_(TYPE_NONE),
        point(point),
        origin(0,0),
@@ -81,7 +81,7 @@ Duck::Duck(const sinfg::Point &point):
        tangent_(false)
 { duck_count++; _DuckCounter::counter++;}
 
-Duck::Duck(const sinfg::Point &point,const sinfg::Point &origin):
+Duck::Duck(const synfig::Point &point,const synfig::Point &origin):
        point(point),
        origin(origin),
        scalar(1),
@@ -93,7 +93,7 @@ Duck::Duck(const sinfg::Point &point,const sinfg::Point &origin):
 
 Duck::~Duck() { duck_count--; _DuckCounter::counter--;}
 
-sinfg::GUID
+synfig::GUID
 Duck::get_data_guid()const
 {
        if(value_desc_.is_value_node())
@@ -102,7 +102,7 @@ Duck::get_data_guid()const
 }
 
 void
-Duck::set_name(const sinfg::String &x)
+Duck::set_name(const synfig::String &x)
 {
        name=x;
        if(guid_==GUID::zero())
@@ -127,21 +127,21 @@ Duck::operator==(const Duck &rhs)const
                //(shared_point?*shared_point==*rhs.shared_point:point==rhs.point) ;
 }
 
-sinfg::Point
+synfig::Point
 Duck::get_trans_point()const
 {
        return transform_stack_.perform(get_sub_trans_point());
 }
        
 void
-Duck::set_trans_point(const sinfg::Point &x)
+Duck::set_trans_point(const synfig::Point &x)
 {
        set_sub_trans_point(transform_stack_.unperform(x));
 }
 
 //! Sets the origin point.
 void
-Duck::set_origin(const sinfg::Point &x)
+Duck::set_origin(const synfig::Point &x)
 {
        origin=x; origin_duck=0;
 }
@@ -154,7 +154,7 @@ Duck::set_origin(const etl::handle<Duck> &x)
 }
 
 //! Retrieves the origin location
-sinfg::Point
+synfig::Point
 Duck::get_origin()const
 {
        return origin_duck?origin_duck->get_point():origin;
@@ -168,25 +168,25 @@ Duck::get_origin_duck() const
 }
 
 //! Retrieves the origin location
-sinfg::Point
+synfig::Point
 Duck::get_trans_origin()const
 {
        return transform_stack_.perform(get_sub_trans_origin());
 }
 
-sinfg::Point
+synfig::Point
 Duck::get_sub_trans_point()const
 {
        return get_point()*get_scalar()+get_sub_trans_origin();
 }
 
 void
-Duck::set_sub_trans_point(const sinfg::Point &x)
+Duck::set_sub_trans_point(const synfig::Point &x)
 {
        set_point((x-get_sub_trans_origin())/get_scalar());
 }
 
-sinfg::Point
+synfig::Point
 Duck::get_sub_trans_origin()const
 {
        return origin_duck?origin_duck->get_sub_trans_point():origin;
index a8fb4fa..1b8ff64 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file duck.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_DUCKMATIC_DUCK_H
-#define __SINFG_DUCKMATIC_DUCK_H
+#ifndef __SYNFIG_DUCKMATIC_DUCK_H
+#define __SYNFIG_DUCKMATIC_DUCK_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <ETL/smart_ptr>
 #include <ETL/handle>
 
-#include <sinfg/vector.h>
-#include <sinfg/string.h>
-#include <sinfg/real.h>
+#include <synfig/vector.h>
+#include <synfig/string.h>
+#include <synfig/real.h>
 #include <sigc++/signal.h>
 #include <sigc++/object.h>
-#include <sinfg/time.h>
+#include <synfig/time.h>
 #include <ETL/smart_ptr>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/transform.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/transform.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -54,7 +54,7 @@ class StringHash
 {
        __gnu_cxx::hash<const char*> hasher_;
 public:
-       size_t operator()(const sinfg::String& x)const
+       size_t operator()(const synfig::String& x)const
        {
                return hasher_(x.c_str());
        }
@@ -100,49 +100,49 @@ public:
        
 private:
 
-       sigc::signal<bool,const sinfg::Point &> signal_edited_;
+       sigc::signal<bool,const synfig::Point &> signal_edited_;
        sigc::signal<void> signal_user_click_[5];
        
        Type type_;
 
-       sinfg::Point point;
+       synfig::Point point;
 
-       etl::smart_ptr<sinfg::Point> shared_point;
+       etl::smart_ptr<synfig::Point> shared_point;
        
-       sinfg::Point origin;
-       sinfg::String name;
-       sinfg::Real scalar;
+       synfig::Point origin;
+       synfig::String name;
+       synfig::Real scalar;
 
        etl::handle<Duck> origin_duck;
 
        etl::handle<Duck> connect_duck;
        etl::handle<Duck> box_duck;
 
-       sinfg::GUID guid_;      
+       synfig::GUID guid_;     
 
        // Flags
        bool editable;
        bool radius_;
        bool tangent_;
        
-       sinfg::TransformStack transform_stack_;
+       synfig::TransformStack transform_stack_;
 
-       sinfgapp::ValueDesc value_desc_;
+       synfigapp::ValueDesc value_desc_;
 
        static int duck_count;
 public:
        Duck();
-       Duck(const sinfg::Point &point);
-       Duck(const sinfg::Point &point,const sinfg::Point &origin);
+       Duck(const synfig::Point &point);
+       Duck(const synfig::Point &point,const synfig::Point &origin);
        ~Duck();
                
-       sigc::signal<bool,const sinfg::Point &> &signal_edited() { return signal_edited_; }
+       sigc::signal<bool,const synfig::Point &> &signal_edited() { return signal_edited_; }
        sigc::signal<void> &signal_user_click(int i=0) { assert(i>=0); assert(i<5); return signal_user_click_[i]; }
 
-       void set_guid(const sinfg::GUID& x) { guid_=x; }
-       const sinfg::GUID& get_guid()const { return guid_; }
+       void set_guid(const synfig::GUID& x) { guid_=x; }
+       const synfig::GUID& get_guid()const { return guid_; }
 
-       sinfg::GUID get_data_guid()const;
+       synfig::GUID get_data_guid()const;
 
        //! Changes the editable flag. If set, the duck will not be able to be moved.
        void set_editable(bool x) { editable=x; }
@@ -162,13 +162,13 @@ public:
        const etl::handle<Duck>& get_connect_duck()const { return connect_duck; }
        const etl::handle<Duck>& get_box_duck()const { return box_duck; }
 
-       void set_value_desc(sinfgapp::ValueDesc x) { value_desc_=x; }
+       void set_value_desc(synfigapp::ValueDesc x) { value_desc_=x; }
 
-       sinfgapp::ValueDesc& get_value_desc() { return value_desc_; }
+       synfigapp::ValueDesc& get_value_desc() { return value_desc_; }
 
-       void set_transform_stack(const sinfg::TransformStack& x) { transform_stack_=x; }
+       void set_transform_stack(const synfig::TransformStack& x) { transform_stack_=x; }
 
-       const sinfg::TransformStack& get_transform_stack()const { return transform_stack_; }
+       const synfig::TransformStack& get_transform_stack()const { return transform_stack_; }
        
        //! \writeme
        void set_type(Type x) { type_=x; }
@@ -177,50 +177,50 @@ public:
        Type get_type()const { return type_; }
 
        //! Sets the scalar multiplier for the duck with respect to the origin
-       void set_scalar(sinfg::Vector::value_type n) { scalar=n; }
+       void set_scalar(synfig::Vector::value_type n) { scalar=n; }
 
        //! Retrieves the scalar value
-       sinfg::Vector::value_type get_scalar()const { return scalar; }
+       synfig::Vector::value_type get_scalar()const { return scalar; }
 
-       void set_shared_point(const etl::smart_ptr<sinfg::Point>&x) { shared_point=x; }
+       void set_shared_point(const etl::smart_ptr<synfig::Point>&x) { shared_point=x; }
 
        //! Sets the location of the duck with respect to the origin
-       void set_point(const sinfg::Point &x) { (shared_point?*shared_point:point)=x; }
+       void set_point(const synfig::Point &x) { (shared_point?*shared_point:point)=x; }
                
        //! Returns the location of the duck
-       sinfg::Point get_point()const { return shared_point?*shared_point:point; }
+       synfig::Point get_point()const { return shared_point?*shared_point:point; }
        
-       sinfg::Point get_trans_point()const;
+       synfig::Point get_trans_point()const;
        
-       void set_trans_point(const sinfg::Point &x);
+       void set_trans_point(const synfig::Point &x);
 
-       sinfg::Point get_sub_trans_point()const;
-       void set_sub_trans_point(const sinfg::Point &x);
-       sinfg::Point get_sub_trans_origin()const;
+       synfig::Point get_sub_trans_point()const;
+       void set_sub_trans_point(const synfig::Point &x);
+       synfig::Point get_sub_trans_origin()const;
 
        //! Sets the origin point.
-       void set_origin(const sinfg::Point &x);
+       void set_origin(const synfig::Point &x);
 
        //! Sets the origin point as another duck
        void set_origin(const etl::handle<Duck> &x);
 
        //! Retrieves the origin location
-       sinfg::Point get_origin()const;
+       synfig::Point get_origin()const;
        
        //! Retrieves the origin duck
        const etl::handle<Duck> & get_origin_duck() const;      
 
        //! Retrieves the origin location
-       sinfg::Point get_trans_origin()const;
+       synfig::Point get_trans_origin()const;
 
        void set_radius(bool r) { radius_=r; }
        bool is_radius()const { return radius_; }
        
        //! Sets the name of the duck
-       void set_name(const sinfg::String &x);
+       void set_name(const synfig::String &x);
 
        //! Retrieves the name of the duck
-       sinfg::String get_name()const { return name; }
+       synfig::String get_name()const { return name; }
        
        bool operator==(const Duck &rhs)const;
 }; // END of class Duck
@@ -245,13 +245,13 @@ operator&(const Duck::Type lhs, const Duck::Type rhs)
 
 class DuckMap : public
 #ifdef HASH_MAP_H
-__gnu_cxx::hash_map<sinfg::GUID,etl::handle<studio::Duck>,sinfg::GUIDHash>
+__gnu_cxx::hash_map<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash>
 {
-       typedef __gnu_cxx::hash_map<sinfg::GUID,etl::handle<studio::Duck>,sinfg::GUIDHash> PARENT_TYPE;
+       typedef __gnu_cxx::hash_map<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash> PARENT_TYPE;
 #else
-std::map<sinfg::GUID,etl::handle<studio::Duck> >
+std::map<synfig::GUID,etl::handle<studio::Duck> >
 {
-       typedef std::map<sinfg::GUID,etl::handle<studio::Duck> > PARENT_TYPE;
+       typedef std::map<synfig::GUID,etl::handle<studio::Duck> > PARENT_TYPE;
 #endif
 public:
        void insert(const Duck::Handle& x) { operator[](x->get_guid())=x;  }
index a8b2751..20d0745 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file duckmatic.cpp
 **     \brief Template File
 **
 #include <ETL/hermite>
 
 #include "duckmatic.h"
-#include <sinfgapp/value_desc.h>
-#include <sinfg/general.h>
-#include <sinfg/paramdesc.h>
-#include <sinfg/valuenode_timedswap.h>
-#include <sinfg/valuenode_animated.h>
-#include <sinfg/valuenode_composite.h>
-#include <sinfg/valuenode_scale.h>
-#include <sinfg/valuenode_bline.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/general.h>
+#include <synfig/paramdesc.h>
+#include <synfig/valuenode_timedswap.h>
+#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_composite.h>
+#include <synfig/valuenode_scale.h>
+#include <synfig/valuenode_bline.h>
 
-#include <sinfg/curve_helper.h>
+#include <synfig/curve_helper.h>
 
 #include <sigc++/retype_return.h>
 #include <sigc++/retype.h>
@@ -60,7 +60,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -88,7 +88,7 @@ Duckmatic::Duckmatic():
 Duckmatic::~Duckmatic()
 {
        clear_ducks();
-       //sinfg::info("Duckmatic::~Duckmatic(): Deleted. Duck Count=%d",Duck::duck_count);
+       //synfig::info("Duckmatic::~Duckmatic(): Deleted. Duck Count=%d",Duck::duck_count);
 }
 
 void
@@ -113,7 +113,7 @@ Duckmatic::duck_is_selected(const etl::handle<Duck> &duck)const
 }
 
 void
-Duckmatic::set_grid_size(const sinfg::Vector &s)
+Duckmatic::set_grid_size(const synfig::Vector &s)
 {
        if(grid_size!=s)
        {
@@ -145,7 +145,7 @@ Duckmatic::set_guide_snap(bool x)
 
 
 Duckmatic::GuideList::iterator
-Duckmatic::find_guide_x(sinfg::Point pos, float radius)
+Duckmatic::find_guide_x(synfig::Point pos, float radius)
 {
        GuideList::iterator iter,best(guide_list_x_.end());
        float dist(radius);
@@ -162,7 +162,7 @@ Duckmatic::find_guide_x(sinfg::Point pos, float radius)
 }
 
 Duckmatic::GuideList::iterator
-Duckmatic::find_guide_y(sinfg::Point pos, float radius)
+Duckmatic::find_guide_y(synfig::Point pos, float radius)
 {
        GuideList::iterator iter,best(guide_list_y_.end());
        float dist(radius);
@@ -268,7 +268,7 @@ Duckmatic::select_all_ducks()
 }
 
 void
-Duckmatic::select_ducks_in_box(const sinfg::Vector& tl,const sinfg::Vector& br)
+Duckmatic::select_ducks_in_box(const synfig::Vector& tl,const synfig::Vector& br)
 {
        Vector vmin, vmax;
        vmin[0]=std::min(tl[0],br[0]);
@@ -359,14 +359,14 @@ Duckmatic::toggle_select_duck(const etl::handle<Duck> &duck)
 
 
 void
-Duckmatic::translate_selected_ducks(const sinfg::Vector& vector)
+Duckmatic::translate_selected_ducks(const synfig::Vector& vector)
 {
        if(duck_dragger_)
                duck_dragger_->duck_drag(this,vector);
 }
 
 void
-Duckmatic::start_duck_drag(const sinfg::Vector& offset)
+Duckmatic::start_duck_drag(const synfig::Vector& offset)
 {
        if(duck_dragger_)
                duck_dragger_->begin_duck_drag(this,offset);
@@ -434,7 +434,7 @@ Duckmatic::snap_point_to_grid(const Point& x, float radius)const
 }
 
 void
-DuckDrag_Translate::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offset)
+DuckDrag_Translate::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
 {
        last_translate_=Vector(0,0);
        {
@@ -470,12 +470,12 @@ DuckDrag_Translate::end_duck_drag(Duckmatic* duckmatic)
 }
 
 void
-DuckDrag_Translate::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)
+DuckDrag_Translate::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
 {
        const DuckList selected_ducks(duckmatic->get_selected_ducks());
        DuckList::const_iterator iter;
 
-       sinfg::Vector vect(duckmatic->snap_point_to_grid(vector)-drag_offset_);
+       synfig::Vector vect(duckmatic->snap_point_to_grid(vector)-drag_offset_);
        int i;
        
        for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
@@ -506,7 +506,7 @@ Duckmatic::signal_edited_selected_ducks()
        const DuckList ducks(get_selected_ducks());
        DuckList::const_iterator iter;
 
-       sinfg::GUIDSet old_set(selected_ducks);
+       synfig::GUIDSet old_set(selected_ducks);
        
        // If we have more than 20 things to move, then display
        // something to explain that it may take a moment
@@ -551,7 +551,7 @@ Duckmatic::add_duck(const etl::handle<Duck> &duck)
                }
                else
                {
-                       etl::smart_ptr<sinfg::Point> point(new Point(duck->get_point()));
+                       etl::smart_ptr<synfig::Point> point(new Point(duck->get_point()));
                        duck->set_shared_point(point);
                        duck_data_share_map[duck->get_data_guid()]=point;
                }
@@ -569,7 +569,7 @@ Duckmatic::add_bezier(const etl::handle<Bezier> &bezier)
 }
 
 void
-Duckmatic::add_stroke(etl::smart_ptr<std::list<sinfg::Point> > stroke_point_list, const sinfg::Color& color)
+Duckmatic::add_stroke(etl::smart_ptr<std::list<synfig::Point> > stroke_point_list, const synfig::Color& color)
 {
        assert(stroke_point_list);
 
@@ -590,7 +590,7 @@ Duckmatic::add_stroke(etl::smart_ptr<std::list<sinfg::Point> > stroke_point_list
 }
 
 void
-Duckmatic::add_persistant_stroke(etl::smart_ptr<std::list<sinfg::Point> > stroke_point_list, const sinfg::Color& color)
+Duckmatic::add_persistant_stroke(etl::smart_ptr<std::list<synfig::Point> > stroke_point_list, const synfig::Color& color)
 {
        add_stroke(stroke_point_list,color);
        persistant_stroke_list_.push_back(stroke_list_.back());
@@ -635,7 +635,7 @@ Duckmatic::find_similar_duck(etl::handle<Duck> duck)
        {
                if(*iter!=duck && **iter==*duck)
                {
-                       //sinfg::info("Found similar duck! (iter:%08x vs. duck:%08x)",iter->get(), duck.get());
+                       //synfig::info("Found similar duck! (iter:%08x vs. duck:%08x)",iter->get(), duck.get());
                        return *iter;
                }
        }
@@ -668,7 +668,7 @@ Duckmatic::erase_bezier(const etl::handle<Bezier> &bezier)
                        return;
                }
        }
-       sinfg::warning("Unable to find bezier to erase!");
+       synfig::warning("Unable to find bezier to erase!");
 }
 
 etl::handle<Duckmatic::Duck>
@@ -688,7 +688,7 @@ Duckmatic::last_bezier()const
 
 
 etl::handle<Duckmatic::Duck>
-Duckmatic::find_duck(sinfg::Point point, sinfg::Real radius, Duck::Type type)
+Duckmatic::find_duck(synfig::Point point, synfig::Real radius, Duck::Type type)
 {
        if(radius==0)radius=10000000;
        
@@ -727,13 +727,13 @@ Duckmatic::find_duck(sinfg::Point point, sinfg::Real radius, Duck::Type type)
 }
 
 etl::handle<Duckmatic::Bezier>
-Duckmatic::find_bezier(sinfg::Point point, sinfg::Real radius,float* location)
+Duckmatic::find_bezier(synfig::Point point, synfig::Real radius,float* location)
 {
        return find_bezier(point,radius,radius,location);       
 }
 
 etl::handle<Duckmatic::Bezier> 
-Duckmatic::find_bezier(sinfg::Point pos, sinfg::Real scale, sinfg::Real radius, float* location)
+Duckmatic::find_bezier(synfig::Point pos, synfig::Real scale, synfig::Real radius, float* location)
 {
        if(radius==0)radius=10000000;
        Real closest(10000000);
@@ -792,7 +792,7 @@ Duckmatic::find_bezier(sinfg::Point pos, sinfg::Real scale, sinfg::Real radius,
 
 
 bool
-Duckmatic::save_sketch(const sinfg::String& filename)const
+Duckmatic::save_sketch(const synfig::String& filename)const
 {
        std::ofstream file(filename.c_str());
 
@@ -809,7 +809,7 @@ Duckmatic::save_sketch(const sinfg::String& filename)const
                        <<(*iter)->color.get_g()<<' '
                        <<(*iter)->color.get_b()
                <<endl;
-               std::list<sinfg::Point>::const_iterator viter;
+               std::list<synfig::Point>::const_iterator viter;
                for(viter=(*iter)->stroke_data->begin();viter!=(*iter)->stroke_data->end();++viter)
                {
                        file<<"V "
@@ -825,7 +825,7 @@ Duckmatic::save_sketch(const sinfg::String& filename)const
 }
 
 bool
-Duckmatic::load_sketch(const sinfg::String& filename)
+Duckmatic::load_sketch(const synfig::String& filename)
 {
        std::ifstream file(filename.c_str());
                        
@@ -837,12 +837,12 @@ Duckmatic::load_sketch(const sinfg::String& filename)
 
        if(line!="SKETCH")
        {
-               sinfg::error("Not a sketch");
+               synfig::error("Not a sketch");
                return false;
        }
 
 
-       etl::smart_ptr<std::list<sinfg::Point> > stroke_data;
+       etl::smart_ptr<std::list<synfig::Point> > stroke_data;
        
        while(file)
        {
@@ -860,10 +860,10 @@ Duckmatic::load_sketch(const sinfg::String& filename)
                                float r,g,b;
                                if(!strscanf(line,"C %f %f %f",&r, &g, &b))
                                {
-                                       sinfg::warning("Bad color line \"%s\"",line.c_str());
+                                       synfig::warning("Bad color line \"%s\"",line.c_str());
                                        r=0;g=0;b=0;
                                }
-                               add_persistant_stroke(stroke_data, sinfg::Color(r,g,b));
+                               add_persistant_stroke(stroke_data, synfig::Color(r,g,b));
                        }
                        break;
                case 'V':
@@ -871,16 +871,16 @@ Duckmatic::load_sketch(const sinfg::String& filename)
                        if(!stroke_data)
                        {
                                stroke_data.spawn();
-                               add_persistant_stroke(stroke_data, sinfg::Color(0,0,0));
+                               add_persistant_stroke(stroke_data, synfig::Color(0,0,0));
                        }
                        float x,y;
                        if(!strscanf(line,"V %f %f",&x, &y))
-                               sinfg::warning("Bad vertex \"%s\"",line.c_str());
+                               synfig::warning("Bad vertex \"%s\"",line.c_str());
                        else
-                               stroke_data->push_back(sinfg::Vector(x,y));
+                               stroke_data->push_back(synfig::Vector(x,y));
                        break;
                default:
-                       sinfg::warning("Unexpected sketch token '%c'",line[0]);
+                       synfig::warning("Unexpected sketch token '%c'",line[0]);
                        break;
                }
        }
@@ -932,7 +932,7 @@ Duckmatic::Push::restore()
 
 
 
-inline String guid_string(const sinfgapp::ValueDesc& x)
+inline String guid_string(const synfigapp::ValueDesc& x)
 {
        if(x.parent_is_layer_param())
                return strprintf("%s",x.get_layer()->get_guid().get_string().c_str())+x.get_param_name();               
@@ -940,7 +940,7 @@ inline String guid_string(const sinfgapp::ValueDesc& x)
                return strprintf("%s",x.get_value_node()->get_guid().get_string().c_str());
 }
 
-inline GUID calc_duck_guid(const sinfgapp::ValueDesc& x,const sinfg::TransformStack& transform_stack)
+inline GUID calc_duck_guid(const synfigapp::ValueDesc& x,const synfig::TransformStack& transform_stack)
 {
        GUID ret(0);
        
@@ -959,7 +959,7 @@ inline GUID calc_duck_guid(const sinfgapp::ValueDesc& x,const sinfg::TransformSt
 
 /*
 Duck::Handle
-Duckmatic::create_duck_from(const sinfgapp::ValueDesc& value_desc,etl::handle<CanvasView> canvas_view, const sinfg::TransformStack& transform_stack, int modifier, sinfg::ParamDesc *param_desc)
+Duckmatic::create_duck_from(const synfigapp::ValueDesc& value_desc,etl::handle<CanvasView> canvas_view, const synfig::TransformStack& transform_stack, int modifier, synfig::ParamDesc *param_desc)
 {
        GUID duck_guid(calc_duck_guid(value_desc,transform_stack)^GUID::hasher(modifier));
        etl::handle<Duck> duck=new Duck();
@@ -969,10 +969,10 @@ Duckmatic::create_duck_from(const sinfgapp::ValueDesc& value_desc,etl::handle<Ca
 */
 
 bool
-Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<CanvasView> canvas_view, const sinfg::TransformStack& transform_stack, sinfg::ParamDesc *param_desc, int multiple)
+Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handle<CanvasView> canvas_view, const synfig::TransformStack& transform_stack, synfig::ParamDesc *param_desc, int multiple)
 {
        ValueBase::Type type=value_desc.get_value_type();
-#define REAL_COOKIE            reinterpret_cast<sinfg::ParamDesc*>(28)         
+#define REAL_COOKIE            reinterpret_cast<synfig::ParamDesc*>(28)                
        switch(type)
        {
        case ValueBase::TYPE_REAL:
@@ -990,7 +990,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        {
                                // If the ValueNode can be directly manipulated,
                                // then set it as so.
-                               duck->set_editable(sinfgapp::is_editable(value_desc.get_value_node()));
+                               duck->set_editable(synfigapp::is_editable(value_desc.get_value_node()));
                        }
                        else
                        {
@@ -1001,9 +1001,9 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        {
                                if(!param_desc->get_origin().empty())
                                {
-                                       sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
+                                       synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
                                        /*
-                                       duck->set_origin(value_desc_origin.get_value(get_time()).get(sinfg::Point()));
+                                       duck->set_origin(value_desc_origin.get_value(get_time()).get(synfig::Point()));
                                        */
                                        add_to_ducks(value_desc_origin,canvas_view, transform_stack);
                                        duck->set_origin(last_duck());
@@ -1051,7 +1051,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        etl::handle<Duck> duck=new Duck();
                        duck->set_type(Duck::TYPE_ANGLE);
                        duck->set_transform_stack(transform_stack);
-                       sinfg::Angle angle;
+                       synfig::Angle angle;
                        
                        angle=value_desc.get_value(get_time()).get(Angle());
                        duck->set_point(Point(Angle::cos(angle).get(),Angle::sin(angle).get()));
@@ -1063,7 +1063,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                
                                // If the ValueNode can be directly manipulated,
                                // then set it as so.
-                               duck->set_editable(sinfgapp::is_editable(value_desc.get_value_node()));
+                               duck->set_editable(synfigapp::is_editable(value_desc.get_value_node()));
                        }
                        else
                        {
@@ -1077,9 +1077,9 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        {
                                if(!param_desc->get_origin().empty())
                                {
-                                       sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
+                                       synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
                                        /*
-                                       duck->set_origin(value_desc_origin.get_value(get_time()).get(sinfg::Point()));
+                                       duck->set_origin(value_desc_origin.get_value(get_time()).get(synfig::Point()));
                                        */
                                        add_to_ducks(value_desc_origin,canvas_view, transform_stack);
                                        duck->set_origin(last_duck());
@@ -1132,7 +1132,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                
                                // If the ValueNode can be directly manipulated,
                                // then set it as so.
-                               duck->set_editable(sinfgapp::is_editable(value_desc.get_value_node()));
+                               duck->set_editable(synfigapp::is_editable(value_desc.get_value_node()));
                        }
                        else
                        {
@@ -1146,7 +1146,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        {
                                if(!param_desc->get_connect().empty())
                                {
-                                       sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_connect());
+                                       synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_connect());
                                        Duck::Handle connect_duck;
                                        if(duck_map.find(calc_duck_guid(value_desc_origin,transform_stack)^GUID::hasher(0))!=duck_map.end())
                                        {
@@ -1161,7 +1161,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                }
                                if(!param_desc->get_box().empty())
                                {
-                                       sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_box());
+                                       synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_box());
                                        add_to_ducks(value_desc_origin,canvas_view, transform_stack);
                                        duck->set_box_duck(last_duck());
                                }
@@ -1169,9 +1169,9 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                // If we have an origin
                                if(!param_desc->get_origin().empty())
                                {
-                                       sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
+                                       synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
                                        /*
-                                       duck->set_origin(value_desc_origin.get_value(get_time()).get(sinfg::Point()));
+                                       duck->set_origin(value_desc_origin.get_value(get_time()).get(synfig::Point()));
                                        */
                                        add_to_ducks(value_desc_origin,canvas_view, transform_stack);
                                        duck->set_origin(last_duck());
@@ -1225,11 +1225,11 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                (value_node=ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()))
                        )
                        {
-                               if(!add_to_ducks(sinfgapp::ValueDesc(value_node,0),canvas_view,transform_stack))
+                               if(!add_to_ducks(synfigapp::ValueDesc(value_node,0),canvas_view,transform_stack))
                                        return false;
                                bezier->p1=last_duck();
                                bezier->p1->set_type(Duck::TYPE_VERTEX);
-                               if(!add_to_ducks(sinfgapp::ValueDesc(value_node,1),canvas_view,transform_stack))
+                               if(!add_to_ducks(synfigapp::ValueDesc(value_node,1),canvas_view,transform_stack))
                                        return false;
                                bezier->c1=last_duck();                         
                                bezier->c1->set_type(Duck::TYPE_TANGENT);
@@ -1238,11 +1238,11 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                bezier->c1->set_tangent(true);
 
                                
-                               if(!add_to_ducks(sinfgapp::ValueDesc(value_node,2),canvas_view,transform_stack))
+                               if(!add_to_ducks(synfigapp::ValueDesc(value_node,2),canvas_view,transform_stack))
                                        return false;
                                bezier->p2=last_duck();
                                bezier->p2->set_type(Duck::TYPE_VERTEX);
-                               if(!add_to_ducks(sinfgapp::ValueDesc(value_node,3),canvas_view,transform_stack))
+                               if(!add_to_ducks(synfigapp::ValueDesc(value_node,3),canvas_view,transform_stack))
                                        return false;
                                bezier->c2=last_duck();                         
                                bezier->c2->set_type(Duck::TYPE_TANGENT);
@@ -1266,7 +1266,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        {
                                Segment segment=value_desc.get_value();
                                etl::handle<Duck> duck_p,duck_c;
-                               sinfg::String name;
+                               synfig::String name;
                                if(param_desc)
                                {
                                        name=param_desc->get_local_name();
@@ -1325,11 +1325,11 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        value_node=ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node());
 
                        
-                       if(!add_to_ducks(sinfgapp::ValueDesc(value_node,0),canvas_view,transform_stack))
+                       if(!add_to_ducks(synfigapp::ValueDesc(value_node,0),canvas_view,transform_stack))
                                return false;
                        etl::handle<Duck> vertex_duck(last_duck());
                        vertex_duck->set_type(Duck::TYPE_VERTEX);
-                       if(!add_to_ducks(sinfgapp::ValueDesc(value_node,4),canvas_view,transform_stack))
+                       if(!add_to_ducks(synfigapp::ValueDesc(value_node,4),canvas_view,transform_stack))
                                return false;
                        etl::handle<Duck> t1_duck(last_duck());
                        
@@ -1342,7 +1342,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        // If the tangents are split
                        if((*value_node->get_link("split"))(get_time()).get(bool()))
                        {
-                               if(!add_to_ducks(sinfgapp::ValueDesc(value_node,5),canvas_view,transform_stack))
+                               if(!add_to_ducks(synfigapp::ValueDesc(value_node,5),canvas_view,transform_stack))
                                        return false;
                                t2_duck=last_duck();
                                t2_duck->set_origin(vertex_duck);
@@ -1351,7 +1351,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                        }
                        else
                        {
-                               if(!add_to_ducks(sinfgapp::ValueDesc(value_node,4),canvas_view,transform_stack))
+                               if(!add_to_ducks(synfigapp::ValueDesc(value_node,4),canvas_view,transform_stack))
                                        return false;
                                t2_duck=last_duck();
                                t2_duck->set_origin(vertex_duck);
@@ -1397,7 +1397,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                // Add the vertex duck
                                if(vertex_value_node)
                                {
-                                       if(add_to_ducks(sinfgapp::ValueDesc(vertex_value_node,0),canvas_view,transform_stack))
+                                       if(add_to_ducks(synfigapp::ValueDesc(vertex_value_node,0),canvas_view,transform_stack))
                                        {
                                                duck=last_duck();
                                                if(i==first)
@@ -1414,22 +1414,22 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                                        ),
                                                                        1.0f
                                                                ),
-                                                               sinfgapp::ValueDesc(value_node,i)
+                                                               synfigapp::ValueDesc(value_node,i)
                                                        )
                                                );
-                                               duck->set_value_desc(sinfgapp::ValueDesc(value_node,i));
+                                               duck->set_value_desc(synfigapp::ValueDesc(value_node,i));
                        
                                                if(param_desc)
                                                {
                                                        if(!param_desc->get_origin().empty())
                                                        {
-                                                               sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
+                                                               synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
                                                                add_to_ducks(value_desc_origin,canvas_view, transform_stack);
                                                                duck->set_origin(last_duck());
 /*
-                                                               ValueBase value(sinfgapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()));
-                                                               if(value.same_as(sinfg::Point()))
-                                                                       duck->set_origin(value.get(sinfg::Point()));
+                                                               ValueBase value(synfigapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()));
+                                                               if(value.same_as(synfig::Point()))
+                                                                       duck->set_origin(value.get(synfig::Point()));
 */
                                                        }
                                                }
@@ -1445,24 +1445,24 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                        duck->set_transform_stack(transform_stack);
                                        duck->set_editable(false);
                                        //duck->set_name(strprintf("%x-vertex",value_node->get_link(i).get()));                 
-                                       duck->set_name(guid_string(sinfgapp::ValueDesc(value_node,i))+".v");
+                                       duck->set_name(guid_string(synfigapp::ValueDesc(value_node,i))+".v");
 
                                        duck->set_type(Duck::TYPE_VERTEX);
                                        if(param_desc)
                                        {
                                                if(!param_desc->get_origin().empty())
                                                {
-                                                               sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
+                                                               synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
                                                                add_to_ducks(value_desc_origin,canvas_view, transform_stack);
                                                                duck->set_origin(last_duck());
 /*
-                                                               ValueBase value(sinfgapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()));
-                                                               if(value.same_as(sinfg::Point()))
-                                                                       duck->set_origin(value.get(sinfg::Point()));
+                                                               ValueBase value(synfigapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()));
+                                                               if(value.same_as(synfig::Point()))
+                                                                       duck->set_origin(value.get(synfig::Point()));
 */
                                                }
                                        }
-                                       duck->set_guid(calc_duck_guid(sinfgapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".v"));
+                                       duck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".v"));
                                        duck=add_similar_duck(duck);
 //                                     add_duck(duck);                 
                                }
@@ -1471,20 +1471,20 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                if(param_desc && !param_desc->get_hint().empty())
                                {
                                        etl::handle<Duck> width;
-                                       if(add_to_ducks(sinfgapp::ValueDesc(vertex_value_node,1),canvas_view,transform_stack,REAL_COOKIE))
+                                       if(add_to_ducks(synfigapp::ValueDesc(vertex_value_node,1),canvas_view,transform_stack,REAL_COOKIE))
                                        {
                                                width=last_duck();
                                                width->set_origin(duck);
                                                width->set_type(Duck::TYPE_WIDTH);
-                                               width->set_name(guid_string(sinfgapp::ValueDesc(value_node,i))+".w");
+                                               width->set_name(guid_string(synfigapp::ValueDesc(value_node,i))+".w");
                                                {
-                                                       ValueBase value(sinfgapp::ValueDesc(value_desc.get_layer(),param_desc->get_hint()).get_value(get_time()));
-                                                       if(value.same_as(sinfg::Real()))
-                                                               width->set_scalar(value.get(sinfg::Real())*0.5f);
+                                                       ValueBase value(synfigapp::ValueDesc(value_desc.get_layer(),param_desc->get_hint()).get_value(get_time()));
+                                                       if(value.same_as(synfig::Real()))
+                                                               width->set_scalar(value.get(synfig::Real())*0.5f);
                                                }
                                        }
                                        else
-                                               sinfg::error("Unable to add width duck!");
+                                               synfig::error("Unable to add width duck!");
                                }
                                
                                if(bezier)
@@ -1492,7 +1492,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                        // Add the tangent1 duck
                                        if(vertex_value_node)
                                        {
-                                               if(!add_to_ducks(sinfgapp::ValueDesc(vertex_value_node,4),canvas_view,transform_stack))
+                                               if(!add_to_ducks(synfigapp::ValueDesc(vertex_value_node,4),canvas_view,transform_stack))
                                                        return false;
                                                tduck=last_duck();
                                        }
@@ -1501,9 +1501,9 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                tduck=new Duck(bline_point.get_tangent1());
                                                tduck->set_transform_stack(transform_stack);
                                                tduck->set_editable(false);
-                                               tduck->set_name(guid_string(sinfgapp::ValueDesc(value_node,i))+".t1");
+                                               tduck->set_name(guid_string(synfigapp::ValueDesc(value_node,i))+".t1");
 //                                             tduck->set_name(strprintf("%x-tangent1",value_node->get_link(i).get()));                        
-                                               tduck->set_guid(calc_duck_guid(sinfgapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t1"));
+                                               tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t1"));
                                                tduck=add_similar_duck(tduck);
 //                                             add_duck(duck);
                                        }
@@ -1521,7 +1521,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                                *canvas_view,
                                                                &studio::CanvasView::popup_param_menu_bezier
                                                        ),
-                                                       sinfgapp::ValueDesc(value_node,i)
+                                                       synfigapp::ValueDesc(value_node,i)
                                                )
                                        );
 
@@ -1535,10 +1535,10 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                                ),
                                                                1.0f
                                                        ),
-                                                       sinfgapp::ValueDesc(value_node,i)
+                                                       synfigapp::ValueDesc(value_node,i)
                                                )
                                        );
-                                       duck->set_value_desc(sinfgapp::ValueDesc(value_node,i));
+                                       duck->set_value_desc(synfigapp::ValueDesc(value_node,i));
 
                                        add_bezier(bezier);
                                        bezier=0;
@@ -1553,7 +1553,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                if(vertex_value_node)
                                {
                                        int i=bline_point.get_split_tangent_flag()?5:4;
-                                       if(!add_to_ducks(sinfgapp::ValueDesc(vertex_value_node,i),canvas_view,transform_stack,0,2))
+                                       if(!add_to_ducks(synfigapp::ValueDesc(vertex_value_node,i),canvas_view,transform_stack,0,2))
                                                return false;
                                        tduck=last_duck();
                                }
@@ -1564,32 +1564,32 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                tduck=new Duck(bline_point.get_tangent2());
                                                tduck->set_transform_stack(transform_stack);
                                                //tduck->set_name(strprintf("%x-tangent2",value_node->get_link(i).get()));                      
-                                               tduck->set_name(guid_string(sinfgapp::ValueDesc(value_node,i))+".t2");
-                                               tduck->set_guid(calc_duck_guid(sinfgapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t2"));
+                                               tduck->set_name(guid_string(synfigapp::ValueDesc(value_node,i))+".t2");
+                                               tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t2"));
                                        }
                                        else
                                        {
                                                tduck=new Duck(bline_point.get_tangent1());
                                                tduck->set_transform_stack(transform_stack);
                                                //tduck->set_name(strprintf("%x-tangent1",value_node->get_link(i).get()));                      
-                                               tduck->set_name(guid_string(sinfgapp::ValueDesc(value_node,i))+".t1");
-                                               tduck->set_guid(calc_duck_guid(sinfgapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t1"));
+                                               tduck->set_name(guid_string(synfigapp::ValueDesc(value_node,i))+".t1");
+                                               tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t1"));
                                        }
                                        tduck->set_editable(false);
                                        tduck=add_similar_duck(tduck);
 //                                     add_duck(duck);
                                        if(param_desc)
                                        {
-                                                               sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
+                                                               synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
                                                                add_to_ducks(value_desc_origin,canvas_view, transform_stack);
                                                                duck->set_origin(last_duck());
 /*
-                                                               ValueBase value(sinfgapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()));
-                                                               if(value.same_as(sinfg::Point()))
-                                                                       duck->set_origin(value.get(sinfg::Point()));
+                                                               ValueBase value(synfigapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()));
+                                                               if(value.same_as(synfig::Point()))
+                                                                       duck->set_origin(value.get(synfig::Point()));
 */
 //                                             if(!param_desc->get_origin().empty())
-//                                                     duck->set_origin(sinfgapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()).get(sinfg::Point()));
+//                                                     duck->set_origin(synfigapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()).get(synfig::Point()));
                                        }
                                        duck->signal_user_click(2).clear();
                                        duck->signal_user_click(2).connect(
@@ -1601,10 +1601,10 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                                ),
                                                                1.0f
                                                        ),
-                                                       sinfgapp::ValueDesc(value_node,0)
+                                                       synfigapp::ValueDesc(value_node,0)
                                                )
                                        );
-                                       duck->set_value_desc(sinfgapp::ValueDesc(value_node,0));
+                                       duck->set_value_desc(synfigapp::ValueDesc(value_node,0));
 
                                }
 
@@ -1632,13 +1632,13 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                /*
                                if(vertex_value_node)
                                {
-                                       if(!add_to_ducks(sinfgapp::ValueDesc(vertex_value_node,0),canvas_view,transform_stack))
+                                       if(!add_to_ducks(synfigapp::ValueDesc(vertex_value_node,0),canvas_view,transform_stack))
                                                return false;
                                        duck=last_duck();
                                        if(param_desc)
                                        {
                                                if(!param_desc->get_origin().empty())
-                                                       duck->set_origin(value_desc.get_layer()->get_param(param_desc->get_origin()).get(sinfg::Point()));
+                                                       duck->set_origin(value_desc.get_layer()->get_param(param_desc->get_origin()).get(synfig::Point()));
                                        }
                                        duck->set_type(Duck::TYPE_VERTEX);
                                }
@@ -1649,7 +1649,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                        if(param_desc)
                                        {
                                                if(!param_desc->get_origin().empty())
-                                                       duck->set_origin(value_desc.get_layer()->get_param(param_desc->get_origin()).get(sinfg::Point()));
+                                                       duck->set_origin(value_desc.get_layer()->get_param(param_desc->get_origin()).get(synfig::Point()));
                                        }
                                        duck->set_editable(false);
                                        duck->set_name(strprintf("%x-vertex",value_node->get_link(first).get()));                       
@@ -1661,7 +1661,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                        // Add the tangent1 duck
                                        if(vertex_value_node)
                                        {
-                                               if(!add_to_ducks(sinfgapp::ValueDesc(vertex_value_node,4),canvas_view,transform_stack))
+                                               if(!add_to_ducks(synfigapp::ValueDesc(vertex_value_node,4),canvas_view,transform_stack))
                                                        return false;
                                                tduck=last_duck();
                                        }
@@ -1670,10 +1670,10 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                tduck=new Duck(bline_point.get_tangent1());
                                                tduck->set_transform_stack(transform_stack);
                                                tduck->set_editable(false);
-                                               tduck->set_name(guid_string(sinfgapp::ValueDesc(value_node,first))+".t1");
+                                               tduck->set_name(guid_string(synfigapp::ValueDesc(value_node,first))+".t1");
                                                //tduck->set_name(strprintf("%x-tangent1",value_node->get_link(first).get()));                  
                                                tduck=add_similar_duck(tduck);
-                                               tduck->set_guid(calc_duck_guid(sinfgapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t1"));
+                                               tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t1"));
                                                //add_duck(duck);
                                        }
 
@@ -1689,7 +1689,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                                *canvas_view,
                                                                &studio::CanvasView::popup_param_menu_bezier
                                                        ),
-                                                       sinfgapp::ValueDesc(value_node,first)
+                                                       synfigapp::ValueDesc(value_node,first)
                                                )
                                        );
                                        duck->signal_user_click(2).clear();
@@ -1702,10 +1702,10 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                                ),
                                                                1.0f
                                                        ),
-                                                       sinfgapp::ValueDesc(value_node,first)
+                                                       synfigapp::ValueDesc(value_node,first)
                                                )
                                        );
-                                       duck->set_value_desc(sinfgapp::ValueDesc(value_node,first));
+                                       duck->set_value_desc(synfigapp::ValueDesc(value_node,first));
 
                                        add_bezier(bezier);
                                        bezier=0;
@@ -1729,22 +1729,22 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                {                                       
                                        if(!value_node->list[i].status_at_time(get_time()))
                                                continue;
-                                       if(!add_to_ducks(sinfgapp::ValueDesc(value_node,i),canvas_view,transform_stack))
+                                       if(!add_to_ducks(synfigapp::ValueDesc(value_node,i),canvas_view,transform_stack))
                                                return false;
                                        etl::handle<Duck> duck(last_duck());
                                        
                                        if(param_desc)
                                        {
-                                                               sinfgapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
+                                                               synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
                                                                add_to_ducks(value_desc_origin,canvas_view, transform_stack);
                                                                duck->set_origin(last_duck());
 /*
-                                                               ValueBase value(sinfgapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()));
-                                                               if(value.same_as(sinfg::Point()))
-                                                                       duck->set_origin(value.get(sinfg::Point()));
+                                                               ValueBase value(synfigapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()));
+                                                               if(value.same_as(synfig::Point()))
+                                                                       duck->set_origin(value.get(synfig::Point()));
 */
 //                                             if(!param_desc->get_origin().empty())
-//                                                     last_duck()->set_origin(sinfgapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()).get(sinfg::Point()));
+//                                                     last_duck()->set_origin(synfigapp::ValueDesc(value_desc.get_layer(),param_desc->get_origin()).get_value(get_time()).get(synfig::Point()));
                                        }
                                        duck->set_type(Duck::TYPE_VERTEX);
                                        bezier.p1=bezier.p2;bezier.c1=bezier.c2;
@@ -1764,7 +1764,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                                                        *canvas_view,
                                                                        &studio::CanvasView::popup_param_menu_bezier
                                                                ),
-                                                               sinfgapp::ValueDesc(value_node,i)
+                                                               synfigapp::ValueDesc(value_node,i)
                                                        )
                                                );
                                        }
@@ -1776,7 +1776,7 @@ Duckmatic::add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<Canvas
                                {
                                        if(!value_node->list[i].status_at_time(get_time()))
                                                continue;
-                                       if(!add_to_ducks(sinfgapp::ValueDesc(value_node,i),canvas_view,transform_stack))
+                                       if(!add_to_ducks(synfigapp::ValueDesc(value_node,i),canvas_view,transform_stack))
                                                return false;
                                }
                        }
index 3ed164e..d7680db 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file duckmatic.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DUCKMATIC_H
-#define __SINFG_STUDIO_DUCKMATIC_H
+#ifndef __SYNFIG_STUDIO_DUCKMATIC_H
+#define __SYNFIG_STUDIO_DUCKMATIC_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <ETL/smart_ptr>
 #include <ETL/handle>
 
-#include <sinfg/vector.h>
-#include <sinfg/string.h>
-#include <sinfg/real.h>
+#include <synfig/vector.h>
+#include <synfig/string.h>
+#include <synfig/real.h>
 #include <sigc++/signal.h>
 #include <sigc++/object.h>
-#include <sinfg/time.h>
-#include <sinfg/color.h>
+#include <synfig/time.h>
+#include <synfig/color.h>
 #include <ETL/smart_ptr>
 
 #include "duck.h"
-#include <sinfg/color.h>
-#include <sinfg/guidset.h>
+#include <synfig/color.h>
+#include <synfig/guidset.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -58,7 +58,7 @@ class StringHash
 {
        __gnu_cxx::hash<const char*> hasher_;
 public:
-       size_t operator()(const sinfg::String& x)const
+       size_t operator()(const synfig::String& x)const
        {
                return hasher_(x.c_str());
        }
@@ -72,8 +72,8 @@ public:
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfgapp { class ValueDesc; }
-namespace sinfg { class ParamDesc; }
+namespace synfigapp { class ValueDesc; }
+namespace synfig { class ParamDesc; }
 
 namespace studio
 {
@@ -84,22 +84,22 @@ class Duckmatic;
 class DuckDrag_Base : public etl::shared_object
 {
 public:
-       virtual void begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& begin)=0;
+       virtual void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin)=0;
        virtual bool end_duck_drag(Duckmatic* duckmatic)=0;
-       virtual void duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)=0;
+       virtual void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)=0;
 };
 
 class DuckDrag_Translate : public DuckDrag_Base
 {
-       sinfg::Vector last_translate_;
-       sinfg::Vector drag_offset_;
-       sinfg::Vector snap;
-       std::vector<sinfg::Vector> positions;
+       synfig::Vector last_translate_;
+       synfig::Vector drag_offset_;
+       synfig::Vector snap;
+       std::vector<synfig::Vector> positions;
 
 public:
-       void begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& begin);
+       void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
        bool end_duck_drag(Duckmatic* duckmatic);
-       void duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector);
+       void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
 };
 
 /*! \class Duckmatic
@@ -122,9 +122,9 @@ class Duckmatic
 public:
 
 #ifdef HASH_MAP_H
-typedef __gnu_cxx::hash_map<sinfg::GUID,etl::smart_ptr<sinfg::Point>,sinfg::GUIDHash> DuckDataMap;
+typedef __gnu_cxx::hash_map<synfig::GUID,etl::smart_ptr<synfig::Point>,synfig::GUIDHash> DuckDataMap;
 #else
-typedef std::map<sinfg::GUID,etl::smart_ptr<sinfg::Point> > DuckDataMap;
+typedef std::map<synfig::GUID,etl::smart_ptr<synfig::Point> > DuckDataMap;
 #endif
 
        typedef studio::DuckMap DuckMap;
@@ -159,14 +159,14 @@ private:
 
        std::list<etl::handle<Stroke> > persistant_stroke_list_;
 
-       sinfg::GUIDSet selected_ducks;
+       synfig::GUIDSet selected_ducks;
 
-       sinfg::GUID last_duck_guid;
+       synfig::GUID last_duck_guid;
 
        std::list<etl::handle<Bezier> > bezier_list_;   
 
        //! I cannot recall what this is for
-       //sinfg::Vector snap;
+       //synfig::Vector snap;
 
        etl::handle<DuckDrag_Base> duck_dragger_;
 
@@ -181,7 +181,7 @@ private:
        GuideList guide_list_x_;
        GuideList guide_list_y_;
 
-       mutable sinfg::String sketch_filename_;
+       mutable synfig::String sketch_filename_;
        
        /*
  -- ** -- P R O T E C T E D   D A T A -----------------------------------------
@@ -191,7 +191,7 @@ protected:
 
        etl::handle<Bezier> selected_bezier;
 
-       sinfg::Time cur_time;
+       synfig::Time cur_time;
 
        //! This flag is set if operations should snap to the grid
        /*! \todo perhaps there should be two of these flags, one for each axis?
@@ -202,7 +202,7 @@ protected:
 
        //! This vector describes the grid size.
        /*! \see grid_snap, show_grid */
-       sinfg::Vector grid_size;
+       synfig::Vector grid_size;
 
        bool show_persistant_strokes;
 
@@ -214,8 +214,8 @@ protected:
 
 private:
        
-       sinfg::Vector last_translate_;
-       sinfg::Vector drag_offset_;
+       synfig::Vector last_translate_;
+       synfig::Vector drag_offset_;
        
        //etl::handle<Duck> selected_duck;
 
@@ -255,24 +255,24 @@ public:
 
        void toggle_grid_snap() { set_grid_snap(!grid_snap); }
 
-       sinfg::Point snap_point_to_grid(const sinfg::Point& x, float radius=0.1)const;
+       synfig::Point snap_point_to_grid(const synfig::Point& x, float radius=0.1)const;
        
        bool get_show_persistant_strokes()const { return show_persistant_strokes; }
        void set_show_persistant_strokes(bool x);
 
        //! Sets the size of the grid
-       void set_grid_size(const sinfg::Vector &s);
+       void set_grid_size(const synfig::Vector &s);
        
        //! Returns the size of the grid
-       const sinfg::Vector &get_grid_size()const { return grid_size; }
+       const synfig::Vector &get_grid_size()const { return grid_size; }
        
        
-       const sinfg::Time &get_time()const { return cur_time; }
+       const synfig::Time &get_time()const { return cur_time; }
 
        bool get_axis_lock()const { return axis_lock; }
        void set_axis_lock(bool x) { axis_lock=x; }
        
-       void set_time(sinfg::Time x) { cur_time=x; }
+       void set_time(synfig::Time x) { cur_time=x; }
 
        bool is_duck_group_selectable(const etl::handle<Duck>& x)const;
        
@@ -306,12 +306,12 @@ public:
 
        void select_duck(const etl::handle<Duck> &duck);
        
-       void select_ducks_in_box(const sinfg::Vector& tl,const sinfg::Vector& br);
+       void select_ducks_in_box(const synfig::Vector& tl,const synfig::Vector& br);
 
        void unselect_duck(const etl::handle<Duck> &duck);
 
-       void start_duck_drag(const sinfg::Vector& offset);
-       void translate_selected_ducks(const sinfg::Vector& vector);     
+       void start_duck_drag(const synfig::Vector& offset);
+       void translate_selected_ducks(const synfig::Vector& vector);    
        bool end_duck_drag();
 
        void signal_edited_selected_ducks();    
@@ -322,9 +322,9 @@ public:
        etl::handle<Duck> find_similar_duck(etl::handle<Duck> duck);
        etl::handle<Duck> add_similar_duck(etl::handle<Duck> duck);
        
-       void add_stroke(etl::smart_ptr<std::list<sinfg::Point> > stroke_point_list, const sinfg::Color& color=sinfg::Color(0,0,0));
+       void add_stroke(etl::smart_ptr<std::list<synfig::Point> > stroke_point_list, const synfig::Color& color=synfig::Color(0,0,0));
 
-       void add_persistant_stroke(etl::smart_ptr<std::list<sinfg::Point> > stroke_point_list, const sinfg::Color& color=sinfg::Color(0,0,0));
+       void add_persistant_stroke(etl::smart_ptr<std::list<synfig::Point> > stroke_point_list, const synfig::Color& color=synfig::Color(0,0,0));
 
        void clear_persistant_strokes();
 
@@ -343,24 +343,24 @@ public:
        
        //! \note parameter is in canvas coordinates
        /*!     A radius of "zero" will have an unlimited radius */
-       etl::handle<Duck> find_duck(sinfg::Point pos, sinfg::Real radius=0, Duck::Type type=Duck::TYPE_DEFAULT);
+       etl::handle<Duck> find_duck(synfig::Point pos, synfig::Real radius=0, Duck::Type type=Duck::TYPE_DEFAULT);
 
-       GuideList::iterator find_guide_x(sinfg::Point pos, float radius=0.1);
-       GuideList::iterator find_guide_y(sinfg::Point pos, float radius=0.1);
-       GuideList::const_iterator find_guide_x(sinfg::Point pos, float radius=0.1)const { return const_cast<Duckmatic*>(this)->find_guide_x(pos,radius); }
-       GuideList::const_iterator find_guide_y(sinfg::Point pos, float radius=0.1)const { return const_cast<Duckmatic*>(this)->find_guide_y(pos,radius); }
+       GuideList::iterator find_guide_x(synfig::Point pos, float radius=0.1);
+       GuideList::iterator find_guide_y(synfig::Point pos, float radius=0.1);
+       GuideList::const_iterator find_guide_x(synfig::Point pos, float radius=0.1)const { return const_cast<Duckmatic*>(this)->find_guide_x(pos,radius); }
+       GuideList::const_iterator find_guide_y(synfig::Point pos, float radius=0.1)const { return const_cast<Duckmatic*>(this)->find_guide_y(pos,radius); }
        
        //! \note parameter is in canvas coordinates
        /*!     A radius of "zero" will have an unlimited radius */
-       //etl::handle<Bezier> find_bezier(sinfg::Point pos, sinfg::Real radius=0);
+       //etl::handle<Bezier> find_bezier(synfig::Point pos, synfig::Real radius=0);
 
        //! \note parameter is in canvas coordinates
        /*!     A radius of "zero" will have an unlimited radius */
-       etl::handle<Bezier> find_bezier(sinfg::Point pos, sinfg::Real radius=0, float* location=0);
+       etl::handle<Bezier> find_bezier(synfig::Point pos, synfig::Real radius=0, float* location=0);
        
-       etl::handle<Bezier> find_bezier(sinfg::Point pos, sinfg::Real scale, sinfg::Real radius, float* location=0);
+       etl::handle<Bezier> find_bezier(synfig::Point pos, synfig::Real scale, synfig::Real radius, float* location=0);
        
-       bool add_to_ducks(const sinfgapp::ValueDesc& value_desc,etl::handle<CanvasView> canvas_view, const sinfg::TransformStack& transform_stack_, sinfg::ParamDesc *param_desc=0, int multiple=0);
+       bool add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handle<CanvasView> canvas_view, const synfig::TransformStack& transform_stack_, synfig::ParamDesc *param_desc=0, int multiple=0);
 
        //! \writeme
        void set_type_mask(Type x) { type_mask=x; }
@@ -372,9 +372,9 @@ public:
 
        void clear_ducks();
        
-       bool save_sketch(const sinfg::String& filename)const;
-       bool load_sketch(const sinfg::String& filename);
-       const sinfg::String& get_sketch_filename()const { return sketch_filename_; }
+       bool save_sketch(const synfig::String& filename)const;
+       bool load_sketch(const synfig::String& filename);
+       const synfig::String& get_sketch_filename()const { return sketch_filename_; }
 
        void set_duck_dragger(etl::handle<DuckDrag_Base> x) { duck_dragger_=x; }
        etl::handle<DuckDrag_Base> get_duck_dragger()const { return duck_dragger_; }
@@ -423,9 +423,9 @@ private:
        sigc::signal<void,float> signal_user_click_[5];
 public:
        
-       etl::smart_ptr<std::list<sinfg::Point> > stroke_data;
+       etl::smart_ptr<std::list<synfig::Point> > stroke_data;
 
-       sinfg::Color color;
+       synfig::Color color;
 
        bool is_valid()const { return (bool)stroke_data; }
 
index 8821c82..22206c9 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DUCK_TRANSFORM_ROTATE_H
-#define __SINFG_STUDIO_DUCK_TRANSFORM_ROTATE_H
+#ifndef __SYNFIG_STUDIO_DUCK_TRANSFORM_ROTATE_H
+#define __SYNFIG_STUDIO_DUCK_TRANSFORM_ROTATE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include "duckmatic.h"
-#include <sinfg/angle.h>
+#include <synfig/angle.h>
 
 /* === M A C R O S ========================================================= */
 
 
 namespace studio {
 
-class Transform_Rotate : public sinfg::Transform
+class Transform_Rotate : public synfig::Transform
 {
 private:
-       sinfg::Angle angle;
-       sinfg::Vector origin;
-       sinfg::Real sin_val;
-       sinfg::Real cos_val;
+       synfig::Angle angle;
+       synfig::Vector origin;
+       synfig::Real sin_val;
+       synfig::Real cos_val;
 
 public:
-       Transform_Rotate(const sinfg::Angle& angle,const sinfg::Vector& origin=sinfg::Vector(0,0)):
+       Transform_Rotate(const synfig::Angle& angle,const synfig::Vector& origin=synfig::Vector(0,0)):
                angle(angle),
                origin(origin),
-               sin_val(sinfg::Angle::sin(angle).get()),
-               cos_val(sinfg::Angle::cos(angle).get())
+               sin_val(synfig::Angle::sin(angle).get()),
+               cos_val(synfig::Angle::cos(angle).get())
        {
        }
        
-       sinfg::Vector perform(const sinfg::Vector& x)const
+       synfig::Vector perform(const synfig::Vector& x)const
        {
-               sinfg::Point pos(x-origin);
-               return sinfg::Point(cos_val*pos[0]-sin_val*pos[1],sin_val*pos[0]+cos_val*pos[1])+origin;
+               synfig::Point pos(x-origin);
+               return synfig::Point(cos_val*pos[0]-sin_val*pos[1],sin_val*pos[0]+cos_val*pos[1])+origin;
        }
-       sinfg::Vector unperform(const sinfg::Vector& x)const
+       synfig::Vector unperform(const synfig::Vector& x)const
        {
-               sinfg::Point pos(x-origin);
-               return sinfg::Point(cos_val*pos[0]+sin_val*pos[1],-sin_val*pos[0]+cos_val*pos[1])+origin;
+               synfig::Point pos(x-origin);
+               return synfig::Point(cos_val*pos[0]+sin_val*pos[1],-sin_val*pos[0]+cos_val*pos[1])+origin;
        }
 };
 
index c91f99d..99b4a84 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DUCK_TRANSFORM_SCALE_H
-#define __SINFG_STUDIO_DUCK_TRANSFORM_SCALE_H
+#ifndef __SYNFIG_STUDIO_DUCK_TRANSFORM_SCALE_H
+#define __SYNFIG_STUDIO_DUCK_TRANSFORM_SCALE_H
 
 /* === H E A D E R S ======================================================= */
 
 
 namespace studio {
 
-class Transform_Scale : public sinfg::Transform
+class Transform_Scale : public synfig::Transform
 {
 private:
-       sinfg::Vector scale;
-       sinfg::Vector origin;
+       synfig::Vector scale;
+       synfig::Vector origin;
 public:
-       Transform_Scale(const sinfg::Vector& scale,const sinfg::Vector& origin=sinfg::Vector(0,0)):scale(scale),origin(origin) { }
-       sinfg::Vector perform(const sinfg::Vector& x)const { return sinfg::Vector((x[0]-origin[0])*scale[0]+origin[0],(x[1]-origin[1])*scale[1]+origin[1]); }
-       sinfg::Vector unperform(const sinfg::Vector& x)const { return sinfg::Vector((x[0]-origin[0])/scale[0]+origin[0],(x[1]-origin[1])/scale[1]+origin[1]); }
+       Transform_Scale(const synfig::Vector& scale,const synfig::Vector& origin=synfig::Vector(0,0)):scale(scale),origin(origin) { }
+       synfig::Vector perform(const synfig::Vector& x)const { return synfig::Vector((x[0]-origin[0])*scale[0]+origin[0],(x[1]-origin[1])*scale[1]+origin[1]); }
+       synfig::Vector unperform(const synfig::Vector& x)const { return synfig::Vector((x[0]-origin[0])/scale[0]+origin[0],(x[1]-origin[1])/scale[1]+origin[1]); }
 };
 
 };
index 0f17e99..2cf52e7 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DUCK_TRANSFORM_TRANSLATE_H
-#define __SINFG_STUDIO_DUCK_TRANSFORM_TRANSLATE_H
+#ifndef __SYNFIG_STUDIO_DUCK_TRANSFORM_TRANSLATE_H
+#define __SYNFIG_STUDIO_DUCK_TRANSFORM_TRANSLATE_H
 
 /* === H E A D E R S ======================================================= */
 
 
 namespace studio {
        
-class Transform_Translate : public sinfg::Transform
+class Transform_Translate : public synfig::Transform
 {
 private:
-       sinfg::Vector origin;
-       std::vector<sinfg::Vector> positions;
+       synfig::Vector origin;
+       std::vector<synfig::Vector> positions;
 
 public:
-       Transform_Translate(const sinfg::Vector& origin): origin(origin) { }
-       sinfg::Vector perform(const sinfg::Vector& x)const { return x+origin; }
-       sinfg::Vector unperform(const sinfg::Vector& x)const { return x-origin; }
-}; // END of class sinfg::Transform_Translate
+       Transform_Translate(const synfig::Vector& origin): origin(origin) { }
+       synfig::Vector perform(const synfig::Vector& x)const { return x+origin; }
+       synfig::Vector unperform(const synfig::Vector& x)const { return x-origin; }
+}; // END of class synfig::Transform_Translate
 
 }; // END of namespace studio
 /* === E N D =============================================================== */
index 55b7f83..13f427f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file event_layerclick.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_EVENT_LAYERCLICK_H
-#define __SINFG_EVENT_LAYERCLICK_H
+#ifndef __SYNFIG_EVENT_LAYERCLICK_H
+#define __SYNFIG_EVENT_LAYERCLICK_H
 
 /* === H E A D E R S ======================================================= */
 
-#include <sinfg/vector.h>
+#include <synfig/vector.h>
 #include "event_mouse.h"
-#include <sinfg/layer.h>
+#include <synfig/layer.h>
 #include "smach.h"
 #include <gdkmm/types.h>
 
@@ -42,12 +42,12 @@ namespace studio {
        
 struct EventLayerClick : public Smach::event
 {
-       sinfg::Point pos;
+       synfig::Point pos;
        MouseButton button;
-       etl::loose_handle<sinfg::Layer> layer;
+       etl::loose_handle<synfig::Layer> layer;
        Gdk::ModifierType modifier;
        
-       EventLayerClick(etl::loose_handle<sinfg::Layer> layer, MouseButton button, const sinfg::Point& pos, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
+       EventLayerClick(etl::loose_handle<synfig::Layer> layer, MouseButton button, const synfig::Point& pos, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
                Smach::event(EVENT_WORKAREA_LAYER_CLICKED),
                pos(pos),
                button(button),
index ac35d30..00c5359 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file event_mouse.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_EVENT_MOUSE_H
-#define __SINFG_EVENT_MOUSE_H
+#ifndef __SYNFIG_EVENT_MOUSE_H
+#define __SYNFIG_EVENT_MOUSE_H
 
 /* === H E A D E R S ======================================================= */
 
-#include <sinfg/vector.h>
+#include <synfig/vector.h>
 #include "smach.h"
 #include <gdkmm/types.h>
 
@@ -52,12 +52,12 @@ enum MouseButton
 
 struct EventMouse : public Smach::event
 {
-       sinfg::Point pos;
+       synfig::Point pos;
        MouseButton button;
        float pressure;
        Gdk::ModifierType modifier;
        
-       EventMouse(EventKey id, MouseButton button, const sinfg::Point& pos, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
+       EventMouse(EventKey id, MouseButton button, const synfig::Point& pos, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
                Smach::event(id),
                pos(pos),
                button(button),
@@ -65,7 +65,7 @@ struct EventMouse : public Smach::event
                modifier(modifier)
        { }
 
-       EventMouse(EventKey id, MouseButton button, const sinfg::Point& pos, float pressure, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
+       EventMouse(EventKey id, MouseButton button, const synfig::Point& pos, float pressure, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
                Smach::event(id),
                pos(pos),
                button(button),
@@ -76,11 +76,11 @@ struct EventMouse : public Smach::event
 
 struct EventBox : public Smach::event
 {
-       sinfg::Point p1,p2;
+       synfig::Point p1,p2;
        MouseButton button;
        Gdk::ModifierType modifier;
        
-       EventBox(EventKey id, const sinfg::Point& p1,const sinfg::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
+       EventBox(EventKey id, const synfig::Point& p1,const synfig::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
                Smach::event(id),
                p1(p1),
                p2(p2),
@@ -88,7 +88,7 @@ struct EventBox : public Smach::event
                modifier(modifier)
        { }
 
-       EventBox(const sinfg::Point& p1,const sinfg::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
+       EventBox(const synfig::Point& p1,const synfig::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
                Smach::event(EVENT_WORKAREA_BOX),
                p1(p1),
                p2(p2),
index 2e8f69e..731c52c 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file eventkey.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_EVENTKEY_H
-#define __SINFG_STUDIO_EVENTKEY_H
+#ifndef __SYNFIG_STUDIO_EVENTKEY_H
+#define __SYNFIG_STUDIO_EVENTKEY_H
 
 /* === H E A D E R S ======================================================= */
 
index ab2727c..081677f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -30,7 +30,7 @@
 
 #include "groupactionmanager.h"
 #include "layergrouptree.h"
-#include <sinfgapp/action_param.h>
+#include <synfigapp/action_param.h>
 #include "instance.h"
 #include <gtkmm/stock.h>
 
@@ -40,7 +40,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 static const guint no_prev_popup((guint)-1);
@@ -94,7 +94,7 @@ GroupActionManager::set_group_tree(LayerGroupTree* x)
 }
 
 void
-GroupActionManager::set_canvas_interface(const etl::handle<sinfgapp::CanvasInterface> &x)
+GroupActionManager::set_canvas_interface(const etl::handle<synfigapp::CanvasInterface> &x)
 {
        canvas_interface_=x;
 }
@@ -154,7 +154,7 @@ GroupActionManager::refresh()
        // Make sure we are ready
        if(!ui_manager_ || !group_tree_ || !canvas_interface_)
        {
-               sinfg::error("GroupActionManager::refresh(): Not ready!");
+               synfig::error("GroupActionManager::refresh(): Not ready!");
                return;
        }
        
@@ -182,14 +182,14 @@ GroupActionManager::refresh()
 
 //             bool multiple_selected(group_tree_->get_selection()->count_selected_rows()>1);
                LayerGroupTree::LayerList selected_layers(group_tree_->get_selected_layers());
-               std::list<sinfg::String> selected_groups(group_tree_->get_selected_groups());
+               std::list<synfig::String> selected_groups(group_tree_->get_selected_groups());
                
-               sinfg::info("selected_layers.size()=%d",selected_layers.size());
-               sinfg::info("selected_groups.size()=%d",selected_groups.size());
+               synfig::info("selected_layers.size()=%d",selected_layers.size());
+               synfig::info("selected_groups.size()=%d",selected_groups.size());
                
                {
                        bool canvas_set(false);
-                       sinfgapp::Action::ParamList param_list;
+                       synfigapp::Action::ParamList param_list;
                        param_list.add("time",get_canvas_interface()->get_time());
                        param_list.add("canvas_interface",get_canvas_interface());
                        
@@ -208,11 +208,11 @@ GroupActionManager::refresh()
                        }
 
                        {
-                               std::list<sinfg::String>::iterator iter;
+                               std::list<synfig::String>::iterator iter;
                        
                                for(iter=selected_groups.begin();iter!=selected_groups.end();++iter)
                                {
-                                       param_list.add("group",(sinfg::String)*iter);
+                                       param_list.add("group",(synfig::String)*iter);
                                }
                        }
 
@@ -223,7 +223,7 @@ GroupActionManager::refresh()
                        }
                        
                        handle<studio::Instance>::cast_static(get_canvas_interface()->get_instance())->
-                               add_actions_to_group(action_group_, ui_info,   param_list, sinfgapp::Action::CATEGORY_GROUP);
+                               add_actions_to_group(action_group_, ui_info,   param_list, synfigapp::Action::CATEGORY_GROUP);
                        }
        }
        
index f7c368b..99290e3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GROUP_ACTION_MANAGER_H
-#define __SINFG_GROUP_ACTION_MANAGER_H
+#ifndef __SYNFIG_GROUP_ACTION_MANAGER_H
+#define __SYNFIG_GROUP_ACTION_MANAGER_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/uimanager.h>
 #include <gtkmm/treeview.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -44,7 +44,7 @@ class GroupActionManager
 {
        Glib::RefPtr<Gtk::UIManager> ui_manager_;
        LayerGroupTree* group_tree_;
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::handle<synfigapp::CanvasInterface> canvas_interface_;
 
        Glib::RefPtr<Gtk::ActionGroup>  action_group_;
        Gtk::UIManager::ui_merge_id     popup_id_;
@@ -70,8 +70,8 @@ public:
        void set_group_tree(LayerGroupTree* x);
        LayerGroupTree* get_group_tree()const { return group_tree_; }
 
-       void set_canvas_interface(const etl::handle<sinfgapp::CanvasInterface> &x);
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+       void set_canvas_interface(const etl::handle<synfigapp::CanvasInterface> &x);
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
 
        void refresh();
        void clear();
index a0e0844..1ec068d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file historytreestore.cpp
 **     \brief Template File
 **
 #endif
 
 #include "historytreestore.h"
-#include <sinfg/valuenode.h>
+#include <synfig/valuenode.h>
 #include "iconcontroler.h"
-#include <sinfg/valuenode_timedswap.h>
+#include <synfig/valuenode_timedswap.h>
 #include <gtkmm/button.h>
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "instance.h"
 
 #endif
@@ -42,7 +42,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -74,7 +74,7 @@ HistoryTreeStore::HistoryTreeStore(etl::loose_handle<studio::Instance> instance_
 
 HistoryTreeStore::~HistoryTreeStore()
 {
-       sinfg::info("HistoryTreeStore::~HistoryTreeStore(): Deleted");
+       synfig::info("HistoryTreeStore::~HistoryTreeStore(): Deleted");
 }
 
 Glib::RefPtr<HistoryTreeStore>
@@ -86,7 +86,7 @@ HistoryTreeStore::create(etl::loose_handle<studio::Instance> instance_)
 void
 HistoryTreeStore::rebuild()
 {
-       sinfgapp::Action::Stack::const_iterator iter;
+       synfigapp::Action::Stack::const_iterator iter;
        
        clear();
        
@@ -102,7 +102,7 @@ HistoryTreeStore::rebuild()
 }
 
 void
-HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handle<sinfgapp::Action::Undoable> action, bool is_active, bool is_undo, bool is_redo)
+HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handle<synfigapp::Action::Undoable> action, bool is_active, bool is_undo, bool is_redo)
 {
        assert(action);
 
@@ -112,19 +112,19 @@ HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handle<sinfgapp::Action::U
        row[model.is_undo] = is_undo;
        row[model.is_redo] = is_redo;
        
-       sinfgapp::Action::CanvasSpecific *specific_action;
-       specific_action=dynamic_cast<sinfgapp::Action::CanvasSpecific*>(action.get());
+       synfigapp::Action::CanvasSpecific *specific_action;
+       specific_action=dynamic_cast<synfigapp::Action::CanvasSpecific*>(action.get());
        if(specific_action)
        {
                row[model.canvas] = specific_action->get_canvas();
                row[model.canvas_id] = specific_action->get_canvas()->get_id();         
        }
 
-       etl::handle<sinfgapp::Action::Group> group;
-       group=etl::handle<sinfgapp::Action::Group>::cast_dynamic(action);
+       etl::handle<synfigapp::Action::Group> group;
+       group=etl::handle<synfigapp::Action::Group>::cast_dynamic(action);
        if(group)
        {
-               sinfgapp::Action::ActionList::const_iterator iter;
+               synfigapp::Action::ActionList::const_iterator iter;
                for(iter=group->action_list().begin();iter!=group->action_list().end();++iter)
                {
                        Gtk::TreeRow child_row = *(append(row.children()));
@@ -132,7 +132,7 @@ HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handle<sinfgapp::Action::U
                }
        }
        
-       //row[model.icon] = Gtk::Button().render_icon(Gtk::StockID("sinfg-canvas"),Gtk::ICON_SIZE_SMALL_TOOLBAR);       
+       //row[model.icon] = Gtk::Button().render_icon(Gtk::StockID("synfig-canvas"),Gtk::ICON_SIZE_SMALL_TOOLBAR);      
 }
 
 
@@ -177,7 +177,7 @@ HistoryTreeStore::on_redo_stack_cleared()
 }
 
 void
-HistoryTreeStore::on_new_action(etl::handle<sinfgapp::Action::Undoable> action)
+HistoryTreeStore::on_new_action(etl::handle<synfigapp::Action::Undoable> action)
 {
 //     Gtk::TreeRow row = *(append());
        Gtk::TreeRow row;
@@ -197,7 +197,7 @@ HistoryTreeStore::on_new_action(etl::handle<sinfgapp::Action::Undoable> action)
 }
 
 void
-HistoryTreeStore::on_action_status_changed(etl::handle<sinfgapp::Action::Undoable> action)
+HistoryTreeStore::on_action_status_changed(etl::handle<synfigapp::Action::Undoable> action)
 {
        Gtk::TreeModel::Children::iterator iter;
        Gtk::TreeModel::Children children_(children());
@@ -205,7 +205,7 @@ HistoryTreeStore::on_action_status_changed(etl::handle<sinfgapp::Action::Undoabl
        for(iter=children_.begin(); iter != children_.end(); ++iter)
        {
                Gtk::TreeModel::Row row = *iter;
-               if(action == (etl::handle<sinfgapp::Action::Undoable>)row[model.action])
+               if(action == (etl::handle<synfigapp::Action::Undoable>)row[model.action])
                {
                        row[model.is_active]=action->is_active();
                        return;
index 46fb28d..0cd1942 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file historytreestore.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_HISTORYTREESTORE_H
-#define __SINFG_STUDIO_HISTORYTREESTORE_H
+#ifndef __SYNFIG_STUDIO_HISTORYTREESTORE_H
+#define __SYNFIG_STUDIO_HISTORYTREESTORE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 #include <gdkmm/pixbuf.h>
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -53,7 +53,7 @@ public:
        {
        public:
        public:
-               Gtk::TreeModelColumn<etl::handle<sinfgapp::Action::Undoable> > action;
+               Gtk::TreeModelColumn<etl::handle<synfigapp::Action::Undoable> > action;
                Gtk::TreeModelColumn<Glib::ustring> name;
                Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > icon;
                Gtk::TreeModelColumn<bool> is_active;
@@ -61,7 +61,7 @@ public:
                Gtk::TreeModelColumn<bool> is_redo;
 
                Gtk::TreeModelColumn<Glib::ustring> canvas_id;
-               Gtk::TreeModelColumn<sinfg::Canvas::Handle> canvas;
+               Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
 
                Model()
                {
@@ -113,9 +113,9 @@ private:
        
        void on_redo_stack_cleared();
        
-       void on_new_action(etl::handle<sinfgapp::Action::Undoable> action);
+       void on_new_action(etl::handle<synfigapp::Action::Undoable> action);
 
-       void on_action_status_changed(etl::handle<sinfgapp::Action::Undoable> action);
+       void on_action_status_changed(etl::handle<synfigapp::Action::Undoable> action);
 
        /*
  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
@@ -133,7 +133,7 @@ public:
 
        void refresh() { rebuild(); }
 
-       void insert_action(Gtk::TreeRow row,etl::handle<sinfgapp::Action::Undoable> action, bool is_active=true, bool is_undo=true, bool is_redo=false);
+       void insert_action(Gtk::TreeRow row,etl::handle<synfigapp::Action::Undoable> action, bool is_active=true, bool is_undo=true, bool is_redo=false);
 
        /*
  -- ** -- P R O T E C T E D   M E T H O D S -----------------------------------
index cae7756..36adb8b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
 #endif
 
 #include "iconcontroler.h"
-#include <sinfg/valuenode_const.h>
+#include <synfig/valuenode_const.h>
 #include <gtkmm/button.h>
 #include <gtkmm/window.h>
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 
 #endif
 
@@ -41,7 +41,7 @@
 using namespace etl;
 using namespace std;
 using namespace studio;
-using namespace sinfg;
+using namespace synfig;
 
 /* === M A C R O S ========================================================= */
 
@@ -69,9 +69,9 @@ using namespace sinfg;
 
 /* === M E T H O D S ======================================================= */
 
-static Glib::RefPtr<Gdk::Pixbuf> _tree_pixbuf_table_value_type[(int)sinfg::ValueBase::TYPE_END];
+static Glib::RefPtr<Gdk::Pixbuf> _tree_pixbuf_table_value_type[(int)synfig::ValueBase::TYPE_END];
 
-IconControler::IconControler(const sinfg::String& basepath)
+IconControler::IconControler(const synfig::String& basepath)
 {
        Gtk::IconSource icon_source;
        icon_source.set_direction_wildcarded();
@@ -88,22 +88,22 @@ IconControler::IconControler(const sinfg::String& basepath)
        path_to_icons+=ETL_DIRECTORY_SEPERATOR;
 
        try{
-       Gtk::Window::set_default_icon_from_file(path_to_icons+"sinfg_icon."+IMAGE_EXT);
+       Gtk::Window::set_default_icon_from_file(path_to_icons+"synfig_icon."+IMAGE_EXT);
        } catch(...)
        {
-               sinfg::warning("Unable to open "+path_to_icons+"sinfg_icon."+IMAGE_EXT);
+               synfig::warning("Unable to open "+path_to_icons+"synfig_icon."+IMAGE_EXT);
        }
        
 /*
 #define INIT_STOCK_ICON(name,iconfile,desc)                                                    \
-       stock_##name=Gtk::StockItem(Gtk::StockID("sinfg-" #name),desc);                         \
+       stock_##name=Gtk::StockItem(Gtk::StockID("synfig-" #name),desc);                        \
        Gtk::Stock::add(stock_##name);                                                          \
        icon_source.set_filename(path_to_icons+iconfile);                                                       \
        icon_##name.add_source(icon_source);                                            \
        icon_factory->add(stock_##name.get_stock_id(),icon_##name)
 */
 #define INIT_STOCK_ICON(name,iconfile,desc){                                                   \
-       Gtk::StockItem stockitem(Gtk::StockID("sinfg-" #name),desc); \
+       Gtk::StockItem stockitem(Gtk::StockID("synfig-" #name),desc); \
        Gtk::Stock::add(stockitem);                                                             \
        Gtk::IconSet icon_set;                                                                  \
        icon_source.set_filename(path_to_icons+iconfile);                                                       \
@@ -112,7 +112,7 @@ IconControler::IconControler(const sinfg::String& basepath)
        }
 
 #define INIT_STOCK_ICON_CLONE(name,stockid,desc){                                                      \
-       Gtk::StockItem stockitem(Gtk::StockID("sinfg-" #name),desc); \
+       Gtk::StockItem stockitem(Gtk::StockID("synfig-" #name),desc); \
        Gtk::Stock::add(stockitem);                                                             \
        Gtk::IconSet icon_set;                                                                  \
        if(Gtk::Stock::lookup(stockitem.get_stock_id(),icon_set))       \
@@ -120,7 +120,7 @@ IconControler::IconControler(const sinfg::String& basepath)
        }
 
 #define INIT_STOCK_ITEM(name,desc)                                                     \
-       stock_##name=Gtk::StockItem(Gtk::StockID("sinfg-" #name),desc);                         \
+       stock_##name=Gtk::StockItem(Gtk::StockID("synfig-" #name),desc);                        \
        Gtk::Stock::add(stock_##name);                                                          
 
        INIT_STOCK_ICON(swap_colors,"swap_colors_icon."IMAGE_EXT,_("Swap Colors"));
@@ -190,7 +190,7 @@ IconControler::IconControler(const sinfg::String& basepath)
 
        icon_factory->add_default();
        
-       Gtk::IconSize::register_new("sinfg-small_icon",12,12);
+       Gtk::IconSize::register_new("synfig-small_icon",12,12);
        for(int i(0);i<(int)ValueBase::TYPE_END;i++)
                _tree_pixbuf_table_value_type[i]=Gtk::Button().render_icon(value_icon(ValueBase::Type(i)),Gtk::ICON_SIZE_SMALL_TOOLBAR);
 
@@ -222,7 +222,7 @@ IconControler::get_tool_cursor(const Glib::ustring& name,const Glib::RefPtr<Gdk:
        DEBUGPOINT();
        Glib::RefPtr<Gdk::Pixbuf> pixbuf;
        DEBUGPOINT();
-       pixbuf=Gtk::Button().render_icon(Gtk::StockID("sinfg-"+name),Gtk::ICON_SIZE_SMALL_TOOLBAR);
+       pixbuf=Gtk::Button().render_icon(Gtk::StockID("synfig-"+name),Gtk::ICON_SIZE_SMALL_TOOLBAR);
        DEBUGPOINT();
 
        pixbuf->render_to_drawable_alpha(
@@ -256,55 +256,55 @@ IconControler::get_tool_cursor(const Glib::ustring& name,const Glib::RefPtr<Gdk:
 }
 
 Gtk::StockID
-studio::value_icon(sinfg::ValueBase::Type type)
+studio::value_icon(synfig::ValueBase::Type type)
 {
                switch(type)
                {
                case ValueBase::TYPE_REAL:
-                       return Gtk::StockID("sinfg-real");
+                       return Gtk::StockID("synfig-real");
                        break;
                case ValueBase::TYPE_INTEGER:
-                       return Gtk::StockID("sinfg-integer");
+                       return Gtk::StockID("synfig-integer");
                        break;
                case ValueBase::TYPE_BOOL:
-                       return Gtk::StockID("sinfg-bool");
+                       return Gtk::StockID("synfig-bool");
                        break;
                case ValueBase::TYPE_ANGLE:
-                       return Gtk::StockID("sinfg-angle");
+                       return Gtk::StockID("synfig-angle");
                        break;
                case ValueBase::TYPE_VECTOR:
-                       return Gtk::StockID("sinfg-vector");
+                       return Gtk::StockID("synfig-vector");
                        break;
                case ValueBase::TYPE_COLOR:
-                       return Gtk::StockID("sinfg-color");
+                       return Gtk::StockID("synfig-color");
                        break;
                case ValueBase::TYPE_STRING:
-                       return Gtk::StockID("sinfg-string");
+                       return Gtk::StockID("synfig-string");
                        break;
                case ValueBase::TYPE_CANVAS:
-                       return Gtk::StockID("sinfg-canvas_pointer");
+                       return Gtk::StockID("synfig-canvas_pointer");
                        break;
                case ValueBase::TYPE_LIST:
-                       return Gtk::StockID("sinfg-list");
+                       return Gtk::StockID("synfig-list");
                        break;
                case ValueBase::TYPE_SEGMENT:
-                       return Gtk::StockID("sinfg-segment");
+                       return Gtk::StockID("synfig-segment");
                        break;
                case ValueBase::TYPE_GRADIENT:
-                       return Gtk::StockID("sinfg-gradient");
+                       return Gtk::StockID("synfig-gradient");
                        break;
                case ValueBase::TYPE_BLINEPOINT:
-                       return Gtk::StockID("sinfg-blinepoint");
+                       return Gtk::StockID("synfig-blinepoint");
                        break;
                case ValueBase::TYPE_NIL:
                default:
-                       return Gtk::StockID("sinfg-unknown");
+                       return Gtk::StockID("synfig-unknown");
                        break;
                }
 }
 
 Gtk::StockID
-studio::valuenode_icon(etl::handle<sinfg::ValueNode> value_node)
+studio::valuenode_icon(etl::handle<synfig::ValueNode> value_node)
 {
        if(handle<ValueNode_Const>::cast_dynamic(value_node))
        {
@@ -312,19 +312,19 @@ studio::valuenode_icon(etl::handle<sinfg::ValueNode> value_node)
        }
        else
        {
-               return Gtk::StockID("sinfg-value_node");                
+               return Gtk::StockID("synfig-value_node");               
        }
 }
 
 Glib::RefPtr<Gdk::Pixbuf>
-studio::get_tree_pixbuf(sinfg::ValueBase::Type type)
+studio::get_tree_pixbuf(synfig::ValueBase::Type type)
 {
        //return Gtk::Button().render_icon(value_icon(type),Gtk::ICON_SIZE_SMALL_TOOLBAR);
        return _tree_pixbuf_table_value_type[int(type)];
 }
 
 Gtk::StockID
-studio::get_action_stock_id(const sinfgapp::Action::BookEntry& action)
+studio::get_action_stock_id(const synfigapp::Action::BookEntry& action)
 {
        Gtk::StockID stock_id;
        if(action.task=="raise")                        stock_id=Gtk::Stock::GO_UP;
@@ -337,38 +337,38 @@ studio::get_action_stock_id(const sinfgapp::Action::BookEntry& action)
        else if(action.task=="set_on")          stock_id=Gtk::Stock::YES;
        else if(action.task=="set_off")         stock_id=Gtk::Stock::NO;
        else if(action.task=="remove")          stock_id=Gtk::Stock::DELETE;
-       else                                                            stock_id=Gtk::StockID("sinfg-"+action.task);
+       else                                                            stock_id=Gtk::StockID("synfig-"+action.task);
        
        return stock_id;
 }
 
 Gtk::StockID
-studio::layer_icon(const sinfg::String &layer)
+studio::layer_icon(const synfig::String &layer)
 {
        if(layer=="PasteCanvas" || layer=="pastecanvas")
-               return Gtk::StockID("sinfg-layer_pastecanvas");
+               return Gtk::StockID("synfig-layer_pastecanvas");
        else if(layer=="rotate")
-               return Gtk::StockID("sinfg-rotate");
+               return Gtk::StockID("synfig-rotate");
        else if(layer=="zoom")
-               return Gtk::StockID("sinfg-zoom");
+               return Gtk::StockID("synfig-zoom");
        else if(layer=="region")
-               return Gtk::StockID("sinfg-bline");
+               return Gtk::StockID("synfig-bline");
        else if(layer=="polygon")
-               return Gtk::StockID("sinfg-polygon");
+               return Gtk::StockID("synfig-polygon");
        else if(layer=="outline")
-               return Gtk::StockID("sinfg-width");
+               return Gtk::StockID("synfig-width");
        else if(layer=="circle")
-               return Gtk::StockID("sinfg-circle");
+               return Gtk::StockID("synfig-circle");
        else if(layer=="rectangle")
-               return Gtk::StockID("sinfg-rectangle");
+               return Gtk::StockID("synfig-rectangle");
        else if(layer.find("gradient")!=String::npos)
-               return Gtk::StockID("sinfg-gradient");
+               return Gtk::StockID("synfig-gradient");
        else
-               return Gtk::StockID("sinfg-layer");
+               return Gtk::StockID("synfig-layer");
 }
 
 Glib::RefPtr<Gdk::Pixbuf>
-studio::get_tree_pixbuf_layer(const sinfg::String &layer)
+studio::get_tree_pixbuf_layer(const synfig::String &layer)
 {
        return Gtk::Button().render_icon(layer_icon(layer),Gtk::ICON_SIZE_SMALL_TOOLBAR);
 }
index ff578df..b955499 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_ICONCONTROLER_H
-#define __SINFG_STUDIO_ICONCONTROLER_H
+#ifndef __SYNFIG_STUDIO_ICONCONTROLER_H
+#define __SYNFIG_STUDIO_ICONCONTROLER_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -31,7 +31,7 @@
 #include <gtkmm/iconset.h>
 #include <gdkmm/cursor.h>
 
-#include <sinfg/value.h>
+#include <synfig/value.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -39,9 +39,9 @@
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfg { class ValueNode; class Layer; }
+namespace synfig { class ValueNode; class Layer; }
 
-namespace sinfgapp { namespace Action { class BookEntry; };};
+namespace synfigapp { namespace Action { class BookEntry; };};
 
 namespace studio {
 
@@ -50,20 +50,20 @@ class IconControler
 {
        Glib::RefPtr<Gtk::IconFactory> icon_factory;
 public:
-       IconControler(const sinfg::String& basepath);
+       IconControler(const synfig::String& basepath);
        ~IconControler();
 
        static Gdk::Cursor get_normal_cursor();
        static Gdk::Cursor get_tool_cursor(const Glib::ustring& name,const Glib::RefPtr<Gdk::Window>& window);
 };
 
-Gtk::StockID layer_icon(const sinfg::String &layer);
-Glib::RefPtr<Gdk::Pixbuf> get_tree_pixbuf_layer(const sinfg::String &layer);
+Gtk::StockID layer_icon(const synfig::String &layer);
+Glib::RefPtr<Gdk::Pixbuf> get_tree_pixbuf_layer(const synfig::String &layer);
 
-Gtk::StockID value_icon(sinfg::ValueBase::Type type);
-Gtk::StockID valuenode_icon(etl::handle<sinfg::ValueNode> value_node);
-Glib::RefPtr<Gdk::Pixbuf> get_tree_pixbuf(sinfg::ValueBase::Type type);
-Gtk::StockID get_action_stock_id(const sinfgapp::Action::BookEntry& action);
+Gtk::StockID value_icon(synfig::ValueBase::Type type);
+Gtk::StockID valuenode_icon(etl::handle<synfig::ValueNode> value_node);
+Glib::RefPtr<Gdk::Pixbuf> get_tree_pixbuf(synfig::ValueBase::Type type);
+Gtk::StockID get_action_stock_id(const synfigapp::Action::BookEntry& action);
 
 }; // END of namespace studio
 
index a70d474..769545b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file instance.cpp
 **     \brief writeme
 **
@@ -45,7 +45,7 @@
 #include <sigc++/retype_return.h>
 #include <sigc++/retype.h>
 //#include <sigc++/hide.h>
-#include <sinfg/valuenode_composite.h>
+#include <synfig/valuenode_composite.h>
 #include "widget_waypointmodel.h"
 #include <gtkmm/actiongroup.h>
 #include "iconcontroler.h"
@@ -54,7 +54,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 using namespace SigC;
 
@@ -69,7 +69,7 @@ int studio::Instance::instance_count_=0;
 /* === M E T H O D S ======================================================= */
 
 Instance::Instance(Canvas::Handle canvas):
-       sinfgapp::Instance              (canvas),
+       synfigapp::Instance             (canvas),
 //     canvas_tree_store_              (Gtk::TreeStore::create(CanvasTreeModel())),
 //     canvas_tree_store_              (Gtk::TreeStore::create()),
        history_tree_store_             (HistoryTreeStore::create(this)),
@@ -125,7 +125,7 @@ Instance::create(Canvas::Handle canvas)
        App::instance_list.push_back(instance);
        
        // Set up the instance with the default UI manager
-       instance->sinfgapp::Instance::set_ui_interface(App::get_ui_interface());
+       instance->synfigapp::Instance::set_ui_interface(App::get_ui_interface());
        
        // Signal the new instance
        App::signal_instance_created()(instance);
@@ -182,9 +182,9 @@ Instance::set_redo_status(bool x)
 }
 
 bool
-studio::Instance::save_as(const sinfg::String &file_name)const
+studio::Instance::save_as(const synfig::String &file_name)const
 {
-       if(sinfgapp::Instance::save_as(file_name))
+       if(synfigapp::Instance::save_as(file_name))
        {
                App::add_recent_file(file_name);
                return true;
@@ -193,9 +193,9 @@ studio::Instance::save_as(const sinfg::String &file_name)const
 }
 
 bool
-studio::Instance::save_as(const sinfg::String &file_name)
+studio::Instance::save_as(const synfig::String &file_name)
 {
-       if(sinfgapp::Instance::save_as(file_name))
+       if(synfigapp::Instance::save_as(file_name))
        {
                App::add_recent_file(file_name);
                return true;
@@ -212,7 +212,7 @@ studio::Instance::save()
                return true;
        }
 
-       return sinfgapp::Instance::save();
+       return synfigapp::Instance::save();
        
 }
 
@@ -228,7 +228,7 @@ studio::Instance::dialog_save_as()
                std::set<Node*>::iterator iter;
                for(iter=canvas->parent_set.begin();iter!=canvas->parent_set.end();++iter)
                {
-                       sinfg::Node* node(*iter);
+                       synfig::Node* node(*iter);
                        for(;!node->parent_set.empty();node=*node->parent_set.begin())
                        {
                                Layer::Handle parent_layer(dynamic_cast<Layer*>(node));
@@ -342,7 +342,7 @@ Instance::insert_canvas(Gtk::TreeRow row,Canvas::Handle canvas)
        CanvasTreeModel canvas_tree_model;
        assert(canvas);
 
-       row[canvas_tree_model.icon] = Gtk::Button().render_icon(Gtk::StockID("sinfg-canvas"),Gtk::ICON_SIZE_SMALL_TOOLBAR);     
+       row[canvas_tree_model.icon] = Gtk::Button().render_icon(Gtk::StockID("synfig-canvas"),Gtk::ICON_SIZE_SMALL_TOOLBAR);    
        row[canvas_tree_model.id] = canvas->get_id();
        row[canvas_tree_model.name] = canvas->get_name();
        if(canvas->is_root())
@@ -361,8 +361,8 @@ Instance::insert_canvas(Gtk::TreeRow row,Canvas::Handle canvas)
        row[canvas_tree_model.is_value_node] = false;
 
        {
-               sinfg::Canvas::Children::iterator iter;
-               sinfg::Canvas::Children &children(canvas->children());
+               synfig::Canvas::Children::iterator iter;
+               synfig::Canvas::Children &children(canvas->children());
        
                for(iter=children.begin();iter!=children.end();iter++)
                        insert_canvas(*(canvas_tree_store()->append(row.children())),*iter);
@@ -378,8 +378,8 @@ Instance::insert_canvas(Gtk::TreeRow row,Canvas::Handle canvas)
                valuenode_row[canvas_tree_model.is_canvas] = false;
                valuenode_row[canvas_tree_model.is_value_node] = false;
 
-               sinfg::ValueNodeList::iterator iter;
-               sinfg::ValueNodeList &value_node_list(canvas->value_node_list());
+               synfig::ValueNodeList::iterator iter;
+               synfig::ValueNodeList &value_node_list(canvas->value_node_list());
 
                for(iter=value_node_list.begin();iter!=value_node_list.end();iter++)
                        insert_value_node(*(canvas_tree_store()->append(valuenode_row.children())),canvas,*iter);
@@ -390,7 +390,7 @@ Instance::insert_canvas(Gtk::TreeRow row,Canvas::Handle canvas)
 
 /*
 void
-Instance::insert_value_node(Gtk::TreeRow row,Canvas::Handle canvas,etl::handle<sinfg::ValueNode> value_node)
+Instance::insert_value_node(Gtk::TreeRow row,Canvas::Handle canvas,etl::handle<synfig::ValueNode> value_node)
 {
        CanvasTreeModel canvas_tree_model;
        assert(value_node);
@@ -428,7 +428,7 @@ Instance::dialog_cvs_commit()
        {
                string message;
 
-               if(sinfgapp::Instance::get_action_count())
+               if(synfigapp::Instance::get_action_count())
                {
                        if(!App::dialog_yes_no(_("CVS Commit"), _("This will save any changes you have made. Are you sure?")))
                                return;
@@ -497,7 +497,7 @@ Instance::dialog_cvs_update()
        try
        {
                String filename(get_file_name());
-               if(sinfgapp::Instance::get_action_count())
+               if(synfigapp::Instance::get_action_count())
                {
                        if(!App::dialog_yes_no(_("CVS Update"), _("This will save any changes you have made. Are you sure?")))
                                return;
@@ -570,7 +570,7 @@ Instance::_revert(Instance *instance)
        if(canvas->count()!=1)
        {
                one_moment.hide();
-               App::dialog_error_blocking(_("Error: Revert Failed"),_("The revert operation has failed. This can be due to it being\nreferenced by another composition that is already open, or\nbecause of an internal error in SINFG Studio. Try closing any\ncompositions that might reference this composition and try\nagain, or restart SINFG studio."));
+               App::dialog_error_blocking(_("Error: Revert Failed"),_("The revert operation has failed. This can be due to it being\nreferenced by another composition that is already open, or\nbecause of an internal error in SYNFIG Studio. Try closing any\ncompositions that might reference this composition and try\nagain, or restart SYNFIG studio."));
                one_moment.show();
        }
        canvas=0;
@@ -597,7 +597,7 @@ Instance::revert()
 bool
 Instance::safe_revert()
 {
-       if(sinfgapp::Instance::get_action_count())
+       if(synfigapp::Instance::get_action_count())
                if(!App::dialog_yes_no(_("Revert to saved"), _("You will loose any changes you have made since your last save.\nAre you sure?")))
                        return false;
        revert();
@@ -607,27 +607,27 @@ Instance::safe_revert()
 bool
 Instance::safe_close()
 {
-       handle<sinfgapp::UIInterface> uim;
+       handle<synfigapp::UIInterface> uim;
        uim=find_canvas_view(get_canvas())->get_ui_interface();
 
        if(get_action_count())
        {
                string str=strprintf(_("Would you like to save your changes to %s?"),basename(get_file_name()).c_str() );
-               int answer=uim->yes_no_cancel(get_canvas()->get_name(),str,sinfgapp::UIInterface::RESPONSE_YES);
-               if(answer==sinfgapp::UIInterface::RESPONSE_YES)
+               int answer=uim->yes_no_cancel(get_canvas()->get_name(),str,synfigapp::UIInterface::RESPONSE_YES);
+               if(answer==synfigapp::UIInterface::RESPONSE_YES)
                        save();
-               if(answer==sinfgapp::UIInterface::RESPONSE_CANCEL)
+               if(answer==synfigapp::UIInterface::RESPONSE_CANCEL)
                        return false;
        }
 
        if(is_modified())
        {
                string str=strprintf(_("%s has changes not yet on the CVS repository.\nWould you like to commit these changes?"),basename(get_file_name()).c_str());
-               int answer=uim->yes_no_cancel(get_canvas()->get_name(),str,sinfgapp::UIInterface::RESPONSE_YES);
+               int answer=uim->yes_no_cancel(get_canvas()->get_name(),str,synfigapp::UIInterface::RESPONSE_YES);
 
-               if(answer==sinfgapp::UIInterface::RESPONSE_YES)
+               if(answer==synfigapp::UIInterface::RESPONSE_YES)
                        dialog_cvs_commit();
-               if(answer==sinfgapp::UIInterface::RESPONSE_CANCEL)
+               if(answer==synfigapp::UIInterface::RESPONSE_CANCEL)
                        return false;
        }
        
@@ -640,23 +640,23 @@ Instance::safe_close()
 
 
 void
-Instance::add_actions_to_group(const Glib::RefPtr<Gtk::ActionGroup>& action_group, sinfg::String& ui_info,   const sinfgapp::Action::ParamList &param_list, sinfgapp::Action::Category category)const
+Instance::add_actions_to_group(const Glib::RefPtr<Gtk::ActionGroup>& action_group, synfig::String& ui_info,   const synfigapp::Action::ParamList &param_list, synfigapp::Action::Category category)const
 {
-       sinfgapp::Action::CanidateList canidate_list;
-       sinfgapp::Action::CanidateList::iterator iter;
+       synfigapp::Action::CanidateList canidate_list;
+       synfigapp::Action::CanidateList::iterator iter;
        
        canidate_list=compile_canidate_list(param_list,category);
        
        canidate_list.sort();
 
        if(canidate_list.empty())
-               sinfg::warning("Action CanidateList is empty!");
+               synfig::warning("Action CanidateList is empty!");
        
        for(iter=canidate_list.begin();iter!=canidate_list.end();++iter)
        {
                Gtk::StockID stock_id(get_action_stock_id(*iter));
                
-               if(!(iter->category&sinfgapp::Action::CATEGORY_HIDDEN))
+               if(!(iter->category&synfigapp::Action::CATEGORY_HIDDEN))
                {
                        action_group->add(Gtk::Action::create(
                                "action-"+iter->name,
@@ -680,21 +680,21 @@ Instance::add_actions_to_group(const Glib::RefPtr<Gtk::ActionGroup>& action_grou
 }
 
 void
-Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList &param_list,sinfgapp::Action::Category category)const
+Instance::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamList &param_list,synfigapp::Action::Category category)const
 {
-       sinfgapp::Action::CanidateList canidate_list;
-       sinfgapp::Action::CanidateList::iterator iter;
+       synfigapp::Action::CanidateList canidate_list;
+       synfigapp::Action::CanidateList::iterator iter;
        
        canidate_list=compile_canidate_list(param_list,category);
        
        canidate_list.sort();
 
        if(canidate_list.empty())
-               sinfg::warning("Action CanidateList is empty!");
+               synfig::warning("Action CanidateList is empty!");
        
        for(iter=canidate_list.begin();iter!=canidate_list.end();++iter)
        {
-               if(!(iter->category&sinfgapp::Action::CATEGORY_HIDDEN))
+               if(!(iter->category&synfigapp::Action::CATEGORY_HIDDEN))
                {
                        Gtk::Image* image(manage(new Gtk::Image()));
                        Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
@@ -720,9 +720,9 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList
                                Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
                        else
                        {
-                               Gtk::Stock::lookup(Gtk::StockID("sinfg-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
+                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
                                Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("sinfg-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
+                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
                        }
                        */
                        menu->items().push_back(
@@ -746,12 +746,12 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList
 }
 
 void
-Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList &param_list,const sinfgapp::Action::ParamList &param_list2,sinfgapp::Action::Category category)const
+Instance::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamList &param_list,const synfigapp::Action::ParamList &param_list2,synfigapp::Action::Category category)const
 {
-       sinfgapp::Action::CanidateList canidate_list;
-       sinfgapp::Action::CanidateList canidate_list2;
+       synfigapp::Action::CanidateList canidate_list;
+       synfigapp::Action::CanidateList canidate_list2;
        
-       sinfgapp::Action::CanidateList::iterator iter;
+       synfigapp::Action::CanidateList::iterator iter;
        
        canidate_list=compile_canidate_list(param_list,category);
        canidate_list2=compile_canidate_list(param_list2,category);
@@ -759,21 +759,21 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList
        canidate_list.sort();
 
        if(canidate_list.empty())
-               sinfg::warning("Action CanidateList is empty!");
+               synfig::warning("Action CanidateList is empty!");
        if(canidate_list2.empty())
-               sinfg::warning("Action CanidateList2 is empty!");
+               synfig::warning("Action CanidateList2 is empty!");
 
        // Seperate out the canidate lists so that there are no conflicts
        for(iter=canidate_list.begin();iter!=canidate_list.end();++iter)
        {
-               sinfgapp::Action::CanidateList::iterator iter2(canidate_list2.find(iter->name));
+               synfigapp::Action::CanidateList::iterator iter2(canidate_list2.find(iter->name));
                if(iter2!=canidate_list2.end())
                        canidate_list2.erase(iter2);
        }
                
        for(iter=canidate_list2.begin();iter!=canidate_list2.end();++iter)
        {
-               if(!(iter->category&sinfgapp::Action::CATEGORY_HIDDEN))
+               if(!(iter->category&synfigapp::Action::CATEGORY_HIDDEN))
                {
                        Gtk::Image* image(manage(new Gtk::Image()));
                        Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
@@ -798,9 +798,9 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList
                                Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
                        else
                        {
-                               Gtk::Stock::lookup(Gtk::StockID("sinfg-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
+                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
                                Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("sinfg-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
+                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
                        }
 */
                        menu->items().push_back(
@@ -824,7 +824,7 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList
 
        for(iter=canidate_list.begin();iter!=canidate_list.end();++iter)
        {
-               if(!(iter->category&sinfgapp::Action::CATEGORY_HIDDEN))
+               if(!(iter->category&synfigapp::Action::CATEGORY_HIDDEN))
                {
                        Gtk::Image* image(manage(new Gtk::Image()));
                        Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
@@ -848,9 +848,9 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList
                                Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
                        else
                        {
-                               Gtk::Stock::lookup(Gtk::StockID("sinfg-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
+                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
                                Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
-                               Gtk::Stock::lookup(Gtk::StockID("sinfg-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
+                               Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
                        }
 */
                        menu->items().push_back(
@@ -874,24 +874,24 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList
 }
 
 void
-Instance::process_action(String name, sinfgapp::Action::ParamList param_list)
+Instance::process_action(String name, synfigapp::Action::ParamList param_list)
 {
-       assert(sinfgapp::Action::book().count(name));
+       assert(synfigapp::Action::book().count(name));
 
-       sinfgapp::Action::BookEntry entry(sinfgapp::Action::book().find(name)->second);
+       synfigapp::Action::BookEntry entry(synfigapp::Action::book().find(name)->second);
        
-       sinfgapp::Action::Handle action(entry.factory());
+       synfigapp::Action::Handle action(entry.factory());
 
        if(!action)
        {
-               sinfg::error("Bad Action");
+               synfig::error("Bad Action");
                return;
        }
        
        action->set_param_list(param_list);
 
-       sinfgapp::Action::ParamVocab param_vocab(entry.get_param_vocab());
-       sinfgapp::Action::ParamVocab::const_iterator iter;
+       synfigapp::Action::ParamVocab param_vocab(entry.get_param_vocab());
+       synfigapp::Action::ParamVocab::const_iterator iter;
        
        for(iter=param_vocab.begin();iter!=param_vocab.end();++iter)
        {
@@ -906,7 +906,7 @@ Instance::process_action(String name, sinfgapp::Action::ParamList param_list)
                {
                        switch(iter->get_type())
                        {
-                       case sinfgapp::Action::Param::TYPE_STRING:
+                       case synfigapp::Action::Param::TYPE_STRING:
                        {
                                String str;
                                if(!studio::App::dialog_entry(entry.local_name, iter->get_local_name()+":"+iter->get_desc(),str))
@@ -915,7 +915,7 @@ Instance::process_action(String name, sinfgapp::Action::ParamList param_list)
                                break;
                        }
                        default:
-                               sinfg::error("Unsupported user-supplied action parameter");
+                               synfig::error("Unsupported user-supplied action parameter");
                                return;
                                break;
                        }
@@ -924,7 +924,7 @@ Instance::process_action(String name, sinfgapp::Action::ParamList param_list)
                
        if(!action->is_ready())
        {
-               sinfg::error("Action not ready");
+               synfig::error("Action not ready");
                return;
        }
 
@@ -932,23 +932,23 @@ Instance::process_action(String name, sinfgapp::Action::ParamList param_list)
 }
 
 void
-Instance::make_param_menu(Gtk::Menu *menu,sinfg::Canvas::Handle canvas, sinfgapp::ValueDesc value_desc, float location)
+Instance::make_param_menu(Gtk::Menu *menu,synfig::Canvas::Handle canvas, synfigapp::ValueDesc value_desc, float location)
 {
        Gtk::Menu& parammenu(*menu);
        
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface(find_canvas_interface(canvas));
+       etl::handle<synfigapp::CanvasInterface> canvas_interface(find_canvas_interface(canvas));
        
        if(!canvas_interface)
                return;
        
-       sinfgapp::Action::ParamList param_list,param_list2;
+       synfigapp::Action::ParamList param_list,param_list2;
        param_list=canvas_interface->generate_param_list(value_desc);
        param_list.add("origin",location);
 
        if(value_desc.get_value_type()==ValueBase::TYPE_BLINEPOINT && value_desc.is_value_node() && ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()))
        {
                param_list2=canvas_interface->generate_param_list(
-                       sinfgapp::ValueDesc(
+                       synfigapp::ValueDesc(
                                ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node())
                                ,0
                        )
@@ -971,7 +971,7 @@ Instance::make_param_menu(Gtk::Menu *menu,sinfg::Canvas::Handle canvas, sinfgapp
                                        sigc::hide_return(
                                                sigc::bind(
                                                        sigc::bind(
-                                                               sigc::mem_fun(*canvas_interface.get(),&sinfgapp::CanvasInterface::convert),
+                                                               sigc::mem_fun(*canvas_interface.get(),&synfigapp::CanvasInterface::convert),
                                                                iter->first
                                                        ),
                                                        value_desc
@@ -985,13 +985,13 @@ Instance::make_param_menu(Gtk::Menu *menu,sinfg::Canvas::Handle canvas, sinfgapp
        }
 
        if(param_list2.empty())
-               add_actions_to_menu(&parammenu, param_list,sinfgapp::Action::CATEGORY_VALUEDESC|sinfgapp::Action::CATEGORY_VALUENODE);
+               add_actions_to_menu(&parammenu, param_list,synfigapp::Action::CATEGORY_VALUEDESC|synfigapp::Action::CATEGORY_VALUENODE);
        else
-               add_actions_to_menu(&parammenu, param_list2,param_list,sinfgapp::Action::CATEGORY_VALUEDESC|sinfgapp::Action::CATEGORY_VALUENODE);
+               add_actions_to_menu(&parammenu, param_list2,param_list,synfigapp::Action::CATEGORY_VALUEDESC|synfigapp::Action::CATEGORY_VALUENODE);
 
        if(value_desc.get_value_type()==ValueBase::TYPE_BLINEPOINT && value_desc.is_value_node() && ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()))
        {
-               value_desc=sinfgapp::ValueDesc(ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()),0);
+               value_desc=synfigapp::ValueDesc(ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()),0);
        }
 
        if(value_desc.is_value_node() && ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node()))
@@ -1021,9 +1021,9 @@ Instance::make_param_menu(Gtk::Menu *menu,sinfg::Canvas::Handle canvas, sinfgapp
 }
 
 void
-edit_several_waypoints(etl::handle<CanvasView> canvas_view, std::list<sinfgapp::ValueDesc> value_desc_list)
+edit_several_waypoints(etl::handle<CanvasView> canvas_view, std::list<synfigapp::ValueDesc> value_desc_list)
 {
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface(canvas_view->canvas_interface());
+       etl::handle<synfigapp::CanvasInterface> canvas_interface(canvas_view->canvas_interface());
 
        Gtk::Dialog dialog(
                "Edit Multiple Waypoints",              // Title
@@ -1045,12 +1045,12 @@ edit_several_waypoints(etl::handle<CanvasView> canvas_view, std::list<sinfgapp::
        if(dialog.run()==0 || widget_waypoint_model.get_waypoint_model().is_trivial())
                return;
        DEBUGPOINT();
-       sinfgapp::Action::PassiveGrouper group(canvas_interface->get_instance().get(),_("Set Waypoints"));
+       synfigapp::Action::PassiveGrouper group(canvas_interface->get_instance().get(),_("Set Waypoints"));
 
-       std::list<sinfgapp::ValueDesc>::iterator iter;
+       std::list<synfigapp::ValueDesc>::iterator iter;
        for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
        {
-               sinfgapp::ValueDesc value_desc(*iter);
+               synfigapp::ValueDesc value_desc(*iter);
                
                if(!value_desc.is_valid())
                        continue;
@@ -1070,17 +1070,17 @@ edit_several_waypoints(etl::handle<CanvasView> canvas_view, std::list<sinfgapp::
                        
                        value_node=ValueNode_Animated::create(value,canvas_interface->get_time());
                        
-                       sinfgapp::Action::Handle action;
+                       synfigapp::Action::Handle action;
                        
                        if(!value_desc.is_value_node())
                        {
-                               action=sinfgapp::Action::create("value_desc_connect");
+                               action=synfigapp::Action::create("value_desc_connect");
                                action->set_param("dest",value_desc);
                                action->set_param("src",ValueNode::Handle(value_node));
                        }
                        else
                        {
-                               action=sinfgapp::Action::create("value_node_replace");
+                               action=synfigapp::Action::create("value_node_replace");
                                action->set_param("dest",value_desc.get_value_node());
                                action->set_param("src",ValueNode::Handle(value_node));
                        }
@@ -1106,7 +1106,7 @@ edit_several_waypoints(etl::handle<CanvasView> canvas_view, std::list<sinfgapp::
                if(value_node)
                {
                        
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("waypoint_set_smart"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("waypoint_set_smart"));
 
                        if(!action)
                        {
@@ -1140,14 +1140,14 @@ edit_several_waypoints(etl::handle<CanvasView> canvas_view, std::list<sinfgapp::
 }
 
 void
-Instance::make_param_menu(Gtk::Menu *menu,sinfg::Canvas::Handle canvas,const std::list<sinfgapp::ValueDesc>& value_desc_list)
+Instance::make_param_menu(Gtk::Menu *menu,synfig::Canvas::Handle canvas,const std::list<synfigapp::ValueDesc>& value_desc_list)
 {
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface(find_canvas_interface(canvas));
+       etl::handle<synfigapp::CanvasInterface> canvas_interface(find_canvas_interface(canvas));
 
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list=canvas_interface->generate_param_list(value_desc_list);
 
-       add_actions_to_menu(menu, param_list,sinfgapp::Action::CATEGORY_VALUEDESC|sinfgapp::Action::CATEGORY_VALUENODE);
+       add_actions_to_menu(menu, param_list,synfigapp::Action::CATEGORY_VALUEDESC|synfigapp::Action::CATEGORY_VALUENODE);
 
        // Add the edit waypoints option if that might be useful
        if(canvas->rend_desc().get_time_end()-Time::epsilon()>canvas->rend_desc().get_time_start())
index bd68918..374c7e4 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file instance.h
 **     \brief writeme
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_INSTANCE_H
-#define __SINFG_STUDIO_INSTANCE_H
+#ifndef __SYNFIG_STUDIO_INSTANCE_H
+#define __SYNFIG_STUDIO_INSTANCE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <ETL/handle>
 #include <gtkmm/treeview.h>
 #include <gtkmm/treestore.h>
-#include <sinfgapp/instance.h>
+#include <synfigapp/instance.h>
 #include <sigc++/object.h>
-#include <sinfgapp/value_desc.h>
+#include <synfigapp/value_desc.h>
 #include "historytreestore.h"
-#include <sinfg/canvas.h>
+#include <synfig/canvas.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -48,7 +48,7 @@ namespace studio {
 class CanvasView;
        
 
-class Instance : public sinfgapp::Instance
+class Instance : public synfigapp::Instance
 {
 public:
        typedef std::list< etl::handle<CanvasView> > CanvasViewList;
@@ -61,19 +61,19 @@ public:
                Gtk::TreeModelColumn<Glib::ustring> name;
                Gtk::TreeModelColumn<Glib::ustring> id;
 
-               Gtk::TreeModelColumn<sinfg::Canvas::Handle> canvas;
+               Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
                Gtk::TreeModelColumn<bool> is_canvas;
 
-               Gtk::TreeModelColumn<sinfg::ValueNode::Handle> value_node;
+               Gtk::TreeModelColumn<synfig::ValueNode::Handle> value_node;
                Gtk::TreeModelColumn<bool> is_value_node;
-               Gtk::TreeModelColumn<sinfg::ValueBase> value;
+               Gtk::TreeModelColumn<synfig::ValueBase> value;
                Gtk::TreeModelColumn<Glib::ustring> type;
                Gtk::TreeModelColumn<int> link_id;
                Gtk::TreeModelColumn<int> link_count;
 
                Gtk::TreeModelColumn<bool> is_editable;
 
-               Gtk::TreeModelColumn<sinfgapp::ValueDesc> value_desc;
+               Gtk::TreeModelColumn<synfigapp::ValueDesc> value_desc;
        
                CanvasTreeModel()
                {
@@ -127,7 +127,7 @@ private:
 
 protected:
 
-       Instance(sinfg::Canvas::Handle);
+       Instance(synfig::Canvas::Handle);
 
 public:
 
@@ -155,20 +155,20 @@ public:
        //! Returns the number of instances that are currently open in the program
        static int get_count() { return instance_count_; }
 
-       //etl::handle<sinfg::Canvas> get_canvas()const { return sinfgapp::Instance::get_canvas(); }
+       //etl::handle<synfig::Canvas> get_canvas()const { return synfigapp::Instance::get_canvas(); }
        
-       etl::handle<CanvasView> find_canvas_view(etl::handle<sinfg::Canvas> canvas);
+       etl::handle<CanvasView> find_canvas_view(etl::handle<synfig::Canvas> canvas);
 
        //! Sets the focus to a specific canvas
-       void focus(etl::handle<sinfg::Canvas> canvas);
+       void focus(etl::handle<synfig::Canvas> canvas);
 
        CanvasViewList & canvas_view_list() { return canvas_view_list_; }
        
        const CanvasViewList & canvas_view_list()const { return canvas_view_list_; }
 
-       bool save_as(const sinfg::String &filename)const;
+       bool save_as(const synfig::String &filename)const;
 
-       bool save_as(const sinfg::String &filename);
+       bool save_as(const synfig::String &filename);
 
        //! Opens a "Save As" dialog, and then saves the composition to that file
        void dialog_save_as();
@@ -195,25 +195,25 @@ public:
        bool safe_revert();
        bool safe_close();
 
-       void add_actions_to_menu(Gtk::Menu *menu,   const sinfgapp::Action::ParamList &param_list, sinfgapp::Action::Category category=sinfgapp::Action::CATEGORY_ALL)const;
-       void add_actions_to_menu(Gtk::Menu *menu, const sinfgapp::Action::ParamList &param_list1,const sinfgapp::Action::ParamList &param_list2, sinfgapp::Action::Category category=sinfgapp::Action::CATEGORY_ALL)const;
+       void add_actions_to_menu(Gtk::Menu *menu,   const synfigapp::Action::ParamList &param_list, synfigapp::Action::Category category=synfigapp::Action::CATEGORY_ALL)const;
+       void add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamList &param_list1,const synfigapp::Action::ParamList &param_list2, synfigapp::Action::Category category=synfigapp::Action::CATEGORY_ALL)const;
 
-       void add_actions_to_group(const Glib::RefPtr<Gtk::ActionGroup>& action_group, sinfg::String& ui_info,   const sinfgapp::Action::ParamList &param_list, sinfgapp::Action::Category category=sinfgapp::Action::CATEGORY_ALL)const;
+       void add_actions_to_group(const Glib::RefPtr<Gtk::ActionGroup>& action_group, synfig::String& ui_info,   const synfigapp::Action::ParamList &param_list, synfigapp::Action::Category category=synfigapp::Action::CATEGORY_ALL)const;
 
-       void process_action(sinfg::String name, sinfgapp::Action::ParamList param_list);
+       void process_action(synfig::String name, synfigapp::Action::ParamList param_list);
 
-       void make_param_menu(Gtk::Menu *menu,sinfg::Canvas::Handle canvas, sinfgapp::ValueDesc value_desc, float location=0.5f);
+       void make_param_menu(Gtk::Menu *menu,synfig::Canvas::Handle canvas, synfigapp::ValueDesc value_desc, float location=0.5f);
 
-       void make_param_menu(Gtk::Menu *menu,sinfg::Canvas::Handle canvas,const std::list<sinfgapp::ValueDesc>& value_desc_list);
+       void make_param_menu(Gtk::Menu *menu,synfig::Canvas::Handle canvas,const std::list<synfigapp::ValueDesc>& value_desc_list);
 
 
-       static void edit_waypoint(sinfgapp::ValueDesc value_desc,sinfg::Waypoint waypoint);
+       static void edit_waypoint(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint);
 
 private:
-       void insert_canvas(Gtk::TreeRow row,sinfg::Canvas::Handle canvas);
+       void insert_canvas(Gtk::TreeRow row,synfig::Canvas::Handle canvas);
 
 public:
-       static etl::handle<Instance> create(sinfg::Canvas::Handle canvas);
+       static etl::handle<Instance> create(synfig::Canvas::Handle canvas);
 }; // END class Instance
 
 }; // END namespace studio
index 630063c..a8ae83d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file ipc.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 #include <sys/stat.h>
 #endif
 
-#include <sinfg/main.h>
+#include <synfig/main.h>
 #include "app.h"
 
 #ifdef HAVE_UNISTD_H
@@ -57,8 +57,8 @@
 
 #include "toolbox.h"
 #include <glibmm/dispatcher.h>
-#include <sinfg/mutex.h>
-#include <sinfg/string.h>
+#include <synfig/mutex.h>
+#include <synfig/string.h>
 #include <glibmm/thread.h>
 
 #endif
@@ -67,7 +67,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -76,8 +76,8 @@ using namespace studio;
 
 #ifdef _WIN32
 #define WIN32_PIPE_PATH "\\\\.\\pipe\\SynfigStudio.Cmd"
-static sinfg::Mutex cmd_mutex;
-static std::list<sinfg::String> cmd_queue;
+static synfig::Mutex cmd_mutex;
+static std::list<synfig::String> cmd_queue;
 static Glib::Dispatcher* cmd_dispatcher;
 static void
 pipe_listen_thread()
@@ -97,7 +97,7 @@ pipe_listen_thread()
                );
                if(pipe_handle==INVALID_HANDLE_VALUE)
                {
-                       sinfg::error("IPC(): Call to CreateNamedPipe failed. Ignore next error. GetLastError=%d",GetLastError());
+                       synfig::error("IPC(): Call to CreateNamedPipe failed. Ignore next error. GetLastError=%d",GetLastError());
                        return;
                }
                
@@ -124,7 +124,7 @@ pipe_listen_thread()
                                if(success && read_bytes==1 && c!='\n')
                                        data+=c;
                        }while(c!='\n');
-                       sinfg::Mutex::Lock lock(cmd_mutex);
+                       synfig::Mutex::Lock lock(cmd_mutex);
                        cmd_queue.push_back(data);
                        cmd_dispatcher->emit();
                } while(success && read_bytes);
@@ -136,7 +136,7 @@ pipe_listen_thread()
 static void
 empty_cmd_queue()
 {
-       sinfg::Mutex::Lock lock(cmd_mutex);
+       synfig::Mutex::Lock lock(cmd_mutex);
        while(!cmd_queue.empty())
        {
                IPC::process_command(cmd_queue.front());
@@ -169,7 +169,7 @@ IPC::IPC()
        
        if(mkfifo(fifo_path().c_str(), S_IRWXU)!=0)
        {
-               sinfg::error("IPC(): mkfifo failed for "+fifo_path());
+               synfig::error("IPC(): mkfifo failed for "+fifo_path());
        }
        
        {
@@ -178,7 +178,7 @@ IPC::IPC()
 
                if(fd<0)
                {
-                       sinfg::error("IPC(): Failed to open fifo \"%s\". (errno=%d)",fifo_path().c_str(),errno);
+                       synfig::error("IPC(): Failed to open fifo \"%s\". (errno=%d)",fifo_path().c_str(),errno);
                }
                else
                {
@@ -205,7 +205,7 @@ IPC::~IPC()
        //      close(fd);
 }
 
-sinfg::String
+synfig::String
 IPC::fifo_path()
 {
 #ifdef _WIN32
@@ -218,19 +218,19 @@ IPC::fifo_path()
 bool
 IPC::fifo_activity(Glib::IOCondition cond)
 {
-       sinfg::info(__FILE__":%d: fifo activity",__LINE__);
+       synfig::info(__FILE__":%d: fifo activity",__LINE__);
        
        if(cond&(Glib::IO_ERR|Glib::IO_HUP|Glib::IO_NVAL))
        {
                if(cond&(Glib::IO_ERR))
-                       sinfg::error("IPC::fifo_activity(): IO_ERR");
+                       synfig::error("IPC::fifo_activity(): IO_ERR");
                if(cond&(Glib::IO_HUP))
-                       sinfg::error("IPC::fifo_activity(): IO_HUP");
+                       synfig::error("IPC::fifo_activity(): IO_HUP");
                if(cond&(Glib::IO_NVAL))
-                       sinfg::error("IPC::fifo_activity(): IO_NVAL");
+                       synfig::error("IPC::fifo_activity(): IO_NVAL");
                return false;
        }
-       sinfg::info(__FILE__":%d: fifo activity",__LINE__);
+       synfig::info(__FILE__":%d: fifo activity",__LINE__);
 
        String command;
        {
@@ -248,7 +248,7 @@ IPC::fifo_activity(Glib::IOCondition cond)
 }
 
 bool
-IPC::process_command(const sinfg::String& command_line)
+IPC::process_command(const synfig::String& command_line)
 {
        if(command_line.empty())
                return false;
@@ -277,14 +277,14 @@ IPC::process_command(const sinfg::String& command_line)
                        App::quit();
                        break;
                default:
-                       sinfg::warning("Received unknown command '%c' with arg '%s'",cmd,args.c_str());
+                       synfig::warning("Received unknown command '%c' with arg '%s'",cmd,args.c_str());
                        break;
        }
        
        return true;
 }
 
-sinfg::SmartFILE
+synfig::SmartFILE
 IPC::make_connection()
 {
        SmartFILE ret;
@@ -301,7 +301,7 @@ IPC::make_connection()
        );
        if(pipe_handle==INVALID_HANDLE_VALUE)
        {
-               sinfg::warning("IPC::make_connection(): Unable to connect to previous instance. GetLastError=%d",GetLastError());
+               synfig::warning("IPC::make_connection(): Unable to connect to previous instance. GetLastError=%d",GetLastError());
        }
        int fd=_open_osfhandle(reinterpret_cast<long int>(pipe_handle),_O_APPEND|O_WRONLY);
 #else
@@ -318,7 +318,7 @@ IPC::make_connection()
        if(fd>=0)
                ret=SmartFILE(fdopen(fd,"w"));
 
-       sinfg::info("uplink fd=%d",fd);
+       synfig::info("uplink fd=%d",fd);
 
        return ret;
 }
index b38e033..f56f8bb 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file ipc.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_IPC_H
-#define __SINFG_IPC_H
+#ifndef __SYNFIG_IPC_H
+#define __SYNFIG_IPC_H
 
 /* === H E A D E R S ======================================================= */
 
-#include <sinfg/smartfile.h>
+#include <synfig/smartfile.h>
 #include <glibmm/main.h>
-#include <sinfg/string.h>
+#include <synfig/string.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -43,7 +43,7 @@ class IPC
 private:
 
        int fd;
-       sinfg::SmartFILE file;
+       synfig::SmartFILE file;
 
        bool fifo_activity(Glib::IOCondition cond);
 
@@ -51,10 +51,10 @@ public:
        IPC();
        ~IPC();
 
-       static sinfg::String fifo_path();
-       static sinfg::SmartFILE make_connection();
+       static synfig::String fifo_path();
+       static synfig::SmartFILE make_connection();
 
-       static bool process_command(const sinfg::String& cmd);
+       static bool process_command(const synfig::String& cmd);
 }; // END of class IPC
        
 }; // END of namespace studio
index 2d44451..de3a8dc 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file keyframeactionmanager.cpp
 **     \brief Template File
 **
@@ -30,7 +30,7 @@
 
 #include "keyframeactionmanager.h"
 #include "keyframetree.h"
-#include <sinfgapp/action_param.h>
+#include <synfigapp/action_param.h>
 #include "instance.h"
 
 #endif
@@ -39,7 +39,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 static const guint no_prev_popup((guint)-1);
@@ -93,7 +93,7 @@ KeyframeActionManager::set_keyframe_tree(KeyframeTree* x)
 }
 
 void
-KeyframeActionManager::set_canvas_interface(const etl::handle<sinfgapp::CanvasInterface> &x)
+KeyframeActionManager::set_canvas_interface(const etl::handle<synfigapp::CanvasInterface> &x)
 {
        time_changed_connection.disconnect();
        canvas_interface_=x;
@@ -151,7 +151,7 @@ KeyframeActionManager::on_keyframe_properties()
 void
 KeyframeActionManager::on_add_keyframe()
 {
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_add"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_add"));
 
        if(!action)
                return;
@@ -180,14 +180,14 @@ KeyframeActionManager::refresh()
        // Make sure we are ready
        if(!ui_manager_ || !keyframe_tree_ || !canvas_interface_)
        {
-               sinfg::error("KeyframeActionManager::refresh(): Not ready!");
+               synfig::error("KeyframeActionManager::refresh(): Not ready!");
                return;
        }
                
        String ui_info;
        
        {
-               sinfgapp::Action::ParamList param_list;
+               synfigapp::Action::ParamList param_list;
                param_list.add("time",get_canvas_interface()->get_time());
                param_list.add("canvas",get_canvas_interface()->get_canvas());
                param_list.add("canvas_interface",get_canvas_interface());
@@ -203,7 +203,7 @@ KeyframeActionManager::refresh()
                        action_group_,
                        ui_info,
                        param_list,
-                       sinfgapp::Action::CATEGORY_KEYFRAME
+                       synfigapp::Action::CATEGORY_KEYFRAME
                );
        }
        if(action_group_->get_action("action-keyframe_add"))
index f3f072c..f88f35c 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file keyframeactionmanager.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_KEYFRAME_ACTION_MANAGER_H
-#define __SINFG_KEYFRAME_ACTION_MANAGER_H
+#ifndef __SYNFIG_KEYFRAME_ACTION_MANAGER_H
+#define __SYNFIG_KEYFRAME_ACTION_MANAGER_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/uimanager.h>
 #include <gtkmm/treeview.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -47,7 +47,7 @@ class KeyframeActionManager
        Glib::RefPtr<Gtk::UIManager> ui_manager_;
        //Glib::RefPtr<Gtk::TreeSelection> tree_selection_;
        KeyframeTree* keyframe_tree_;
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::handle<synfigapp::CanvasInterface> canvas_interface_;
 
        Glib::RefPtr<Gtk::ActionGroup>  action_group_;
        Gtk::UIManager::ui_merge_id     popup_id_;
@@ -76,8 +76,8 @@ public:
        void set_keyframe_tree(KeyframeTree* x);
        KeyframeTree* get_keyframe_tree()const { return keyframe_tree_; }
 
-       void set_canvas_interface(const etl::handle<sinfgapp::CanvasInterface> &x);
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+       void set_canvas_interface(const etl::handle<synfigapp::CanvasInterface> &x);
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
 
        void refresh();
        void clear();
index 6d6222b..0c45e80 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file keyframetree.cpp
 **     \brief Template File
 **
@@ -39,7 +39,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -140,7 +140,7 @@ KeyframeTree::KeyframeTree()
 
 KeyframeTree::~KeyframeTree()
 {
-       sinfg::info("KeyframeTree::~KeyframeTree(): deleted");
+       synfig::info("KeyframeTree::~KeyframeTree(): deleted");
 }
 
 void
@@ -197,13 +197,13 @@ KeyframeTree::set_editable(bool x)
 }
 
 void
-KeyframeTree::on_edited_time(const Glib::ustring&path_string,sinfg::Time time)
+KeyframeTree::on_edited_time(const Glib::ustring&path_string,synfig::Time time)
 {
        Gtk::TreePath path(path_string);
        
        const Gtk::TreeRow row(*(get_model()->get_iter(path)));
        
-       sinfg::Keyframe keyframe(row[model.keyframe]);
+       synfig::Keyframe keyframe(row[model.keyframe]);
        if(time!=keyframe.get_time())
        {
                row[model.time]=time;
@@ -214,7 +214,7 @@ KeyframeTree::on_edited_time(const Glib::ustring&path_string,sinfg::Time time)
 }
 
 void
-KeyframeTree::on_edited_time_delta(const Glib::ustring&path_string,sinfg::Time time)
+KeyframeTree::on_edited_time_delta(const Glib::ustring&path_string,synfig::Time time)
 {
        Gtk::TreePath path(path_string);
        
@@ -230,8 +230,8 @@ KeyframeTree::on_edited_description(const Glib::ustring&path_string,const Glib::
        
        const Gtk::TreeRow row = *(get_model()->get_iter(path));
        
-       const sinfg::String description(desc);
-       sinfg::Keyframe keyframe(row[model.keyframe]);
+       const synfig::String description(desc);
+       synfig::Keyframe keyframe(row[model.keyframe]);
        if(description!=keyframe.get_description())
        {
                row[model.description]=desc;
index 24c8f39..1480ae7 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file keyframetree.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_KEYFRAMETREE_H
-#define __SINFG_STUDIO_KEYFRAMETREE_H
+#ifndef __SYNFIG_STUDIO_KEYFRAMETREE_H
+#define __SYNFIG_STUDIO_KEYFRAMETREE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treeview.h>
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/value_desc.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/value_desc.h>
 #include "keyframetreestore.h"
-#include <sinfg/keyframe.h>
+#include <synfig/keyframe.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -82,11 +82,11 @@ private:
 
        Gtk::CellRendererText *cell_renderer_description;
 
-       sigc::signal<void,sinfg::Keyframe> signal_edited_;
+       sigc::signal<void,synfig::Keyframe> signal_edited_;
 
-       sigc::signal<void,sinfg::Keyframe,sinfg::Time> signal_edited_time_;
+       sigc::signal<void,synfig::Keyframe,synfig::Time> signal_edited_time_;
 
-       sigc::signal<void,sinfg::Keyframe,sinfg::String> signal_edited_description_;
+       sigc::signal<void,synfig::Keyframe,synfig::String> signal_edited_description_;
 
        sigc::signal<void, int, Gtk::TreeRow, ColumnID> signal_user_click_;
 
@@ -104,9 +104,9 @@ private:
 
 private:
 
-       void on_edited_time(const Glib::ustring&path_string,sinfg::Time time);
+       void on_edited_time(const Glib::ustring&path_string,synfig::Time time);
 
-       void on_edited_time_delta(const Glib::ustring&path_string,sinfg::Time time);
+       void on_edited_time_delta(const Glib::ustring&path_string,synfig::Time time);
 
        void on_edited_description(const Glib::ustring&path_string,const Glib::ustring &description);
 
@@ -130,13 +130,13 @@ public:
        bool get_editable()const { return editable_; }
 
        //! Signal called when a keyframe has been edited in any way
-       sigc::signal<void,sinfg::Keyframe>& signal_edited() { return signal_edited_; }
+       sigc::signal<void,synfig::Keyframe>& signal_edited() { return signal_edited_; }
        
        //! Signal called when a time has been edited.
-       sigc::signal<void,sinfg::Keyframe,sinfg::Time>& signal_edited_time() { return signal_edited_time_; }
+       sigc::signal<void,synfig::Keyframe,synfig::Time>& signal_edited_time() { return signal_edited_time_; }
 
        //! Signal called when a description has been edited.
-       sigc::signal<void,sinfg::Keyframe,sinfg::String>& signal_edited_description() { return signal_edited_description_; }
+       sigc::signal<void,synfig::Keyframe,synfig::String>& signal_edited_description() { return signal_edited_description_; }
 
        sigc::signal<void,int, Gtk::TreeRow, ColumnID>& signal_user_click() { return signal_user_click_; }
 }; // END of KeyframeTree
index 346aa9f..4e17af4 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file keyframetreestore.cpp
 **     \brief Template File
 **
 #endif
 
 #include "keyframetreestore.h"
-#include <sinfg/valuenode.h>
+#include <synfig/valuenode.h>
 #include "iconcontroler.h"
-#include <sinfg/valuenode_timedswap.h>
+#include <synfig/valuenode_timedswap.h>
 #include <gtkmm/button.h>
 #include <gtkmm/treerowreference.h>
-#include <sinfg/canvas.h>
-#include <sinfg/keyframe.h>
+#include <synfig/canvas.h>
+#include <synfig/keyframe.h>
 #include <time.h>
 #include <cstdlib>
 #include <ETL/smart_ptr>
-#include <sinfgapp/action.h>
-#include <sinfgapp/instance.h>
+#include <synfigapp/action.h>
+#include <synfigapp/instance.h>
 #include "onemoment.h"
-#include <sinfg/exception.h>
+#include <synfig/exception.h>
 
 #endif
 
@@ -50,7 +50,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -63,13 +63,13 @@ KeyframeTreeStore_Class KeyframeTreeStore::keyframe_tree_store_class_;
 
 struct _keyframe_iterator
 {
-       sinfg::KeyframeList::iterator iter;
+       synfig::KeyframeList::iterator iter;
        int ref_count;
        int index;
 };
 
 /*
-Gtk::TreeModel::iterator keyframe_iter_2_model_iter(sinfg::KeyframeList::iterator iter,int index)
+Gtk::TreeModel::iterator keyframe_iter_2_model_iter(synfig::KeyframeList::iterator iter,int index)
 {
        Gtk::TreeModel::iterator ret;
        
@@ -83,7 +83,7 @@ Gtk::TreeModel::iterator keyframe_iter_2_model_iter(sinfg::KeyframeList::iterato
 }
 */
 
-sinfg::KeyframeList::iterator model_iter_2_keyframe_iter(Gtk::TreeModel::iterator iter)
+synfig::KeyframeList::iterator model_iter_2_keyframe_iter(Gtk::TreeModel::iterator iter)
 {
        _keyframe_iterator* data(static_cast<_keyframe_iterator*>(iter->gobj()->user_data));
        if(!data)
@@ -192,7 +192,7 @@ KeyframeTreeStore_Class::class_init_function(gpointer g_class, gpointer class_da
        // ???
 }
 
-KeyframeTreeStore::KeyframeTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_):
+KeyframeTreeStore::KeyframeTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_):
        Glib::ObjectBase        ("KeyframeTreeStore"),
        Glib::Object            (Glib::ConstructParams(keyframe_tree_store_class_.init(), (char*) 0)),
        canvas_interface_       (canvas_interface_)
@@ -207,11 +207,11 @@ KeyframeTreeStore::KeyframeTreeStore(etl::loose_handle<sinfgapp::CanvasInterface
 
 KeyframeTreeStore::~KeyframeTreeStore()
 {
-       sinfg::info("KeyframeTreeStore::~KeyframeTreeStore(): Deleted");
+       synfig::info("KeyframeTreeStore::~KeyframeTreeStore(): Deleted");
 }
 
 Glib::RefPtr<KeyframeTreeStore>
-KeyframeTreeStore::create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_)
+KeyframeTreeStore::create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_)
 {
        KeyframeTreeStore *store(new KeyframeTreeStore(canvas_interface_));
        Glib::RefPtr<KeyframeTreeStore> ret(store);
@@ -327,7 +327,7 @@ KeyframeTreeStore::set_value_impl(const Gtk::TreeModel::iterator& row, int colum
        {
                if(column==model.time_delta.index())
                {                       
-                       Glib::Value<sinfg::Time> x;
+                       Glib::Value<synfig::Time> x;
                        g_value_init(x.gobj(),model.time.type());
                        g_value_copy(value.gobj(),x.gobj());
                        
@@ -359,7 +359,7 @@ KeyframeTreeStore::set_value_impl(const Gtk::TreeModel::iterator& row, int colum
                        // New Method
                        {
                                Keyframe keyframe((*row)[model.keyframe]);
-                               sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_set_delta"));
+                               synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_set_delta"));
        
                                if(!action)return;
                                
@@ -377,24 +377,24 @@ KeyframeTreeStore::set_value_impl(const Gtk::TreeModel::iterator& row, int colum
                                OneMoment one_moment;
                                
                                // Create the action group
-                               sinfgapp::Action::PassiveGrouper group(canvas_interface()->get_instance().get(),_("Adjust Time"));
-                               sinfgapp::PushMode push_mode(canvas_interface(), sinfgapp::MODE_NORMAL);
+                               synfigapp::Action::PassiveGrouper group(canvas_interface()->get_instance().get(),_("Adjust Time"));
+                               synfigapp::PushMode push_mode(canvas_interface(), synfigapp::MODE_NORMAL);
                                
                                Gtk::TreeModel::iterator iter(row);
                                if(change_delta<0)
                                {
                                        //DEBUGPOINT();
                                        KeyframeList keyframe_list(get_canvas()->keyframe_list());
-                                       sinfg::KeyframeList::iterator iter(keyframe_list.find((*row)[model.keyframe]));
+                                       synfig::KeyframeList::iterator iter(keyframe_list.find((*row)[model.keyframe]));
                                        //DEBUGPOINT();
                                        for(;iter!=keyframe_list.end();++iter)
                                        {
                                        //DEBUGPOINT();
-                                               sinfg::Keyframe keyframe(*iter);
+                                               synfig::Keyframe keyframe(*iter);
 
                                                keyframe.set_time(keyframe.get_time()+change_delta);
                        
-                                               sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_set"));
+                                               synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_set"));
                        
                                                if(!action)return;
                                                
@@ -409,18 +409,18 @@ KeyframeTreeStore::set_value_impl(const Gtk::TreeModel::iterator& row, int colum
                                {
                                        //DEBUGPOINT();
                                        KeyframeList keyframe_list(get_canvas()->keyframe_list());
-                                       sinfg::KeyframeList::reverse_iterator end(keyframe_list.find((*row)[model.keyframe]));
-                                       sinfg::KeyframeList::reverse_iterator iter(keyframe_list.rbegin());
+                                       synfig::KeyframeList::reverse_iterator end(keyframe_list.find((*row)[model.keyframe]));
+                                       synfig::KeyframeList::reverse_iterator iter(keyframe_list.rbegin());
                                        //end++;
                                        //DEBUGPOINT();
                                        for(;iter!=end;++iter)
                                        {
                                        //DEBUGPOINT();
-                                               sinfg::Keyframe keyframe(*iter);
+                                               synfig::Keyframe keyframe(*iter);
 
                                                keyframe.set_time(keyframe.get_time()+change_delta);
                        
-                                               sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_set"));
+                                               synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_set"));
                        
                                                if(!action)return;
                                                
@@ -440,16 +440,16 @@ KeyframeTreeStore::set_value_impl(const Gtk::TreeModel::iterator& row, int colum
                {
                        OneMoment one_moment;
 
-                       Glib::Value<sinfg::Time> x;
+                       Glib::Value<synfig::Time> x;
                        g_value_init(x.gobj(),model.time.type());
                        g_value_copy(value.gobj(),x.gobj());
-                       sinfg::Keyframe keyframe(*iter->iter);
+                       synfig::Keyframe keyframe(*iter->iter);
 
-                       sinfg::info("KeyframeTreeStore::set_value_impl():old_time=%s",keyframe.get_time().get_string().c_str());
+                       synfig::info("KeyframeTreeStore::set_value_impl():old_time=%s",keyframe.get_time().get_string().c_str());
                        keyframe.set_time(x.get());
-                       sinfg::info("KeyframeTreeStore::set_value_impl():new_time=%s",keyframe.get_time().get_string().c_str());
+                       synfig::info("KeyframeTreeStore::set_value_impl():new_time=%s",keyframe.get_time().get_string().c_str());
                        
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_set"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_set"));
                        
                        if(!action)
                                return;
@@ -465,10 +465,10 @@ KeyframeTreeStore::set_value_impl(const Gtk::TreeModel::iterator& row, int colum
                        Glib::Value<Glib::ustring> x;
                        g_value_init(x.gobj(),model.description.type());
                        g_value_copy(value.gobj(),x.gobj());
-                       sinfg::Keyframe keyframe(*iter->iter);
+                       synfig::Keyframe keyframe(*iter->iter);
                        keyframe.set_description(x.get());
 
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("keyframe_set"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_set"));
                        
                        if(!action)
                                return;
@@ -771,7 +771,7 @@ KeyframeTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& gtk_iter, in
        {
        case 0:         // Time
        {
-               Glib::Value<sinfg::Time> x;
+               Glib::Value<synfig::Time> x;
                g_value_init(x.gobj(),x.value_type());
                x.set(iter->iter->get_time());
                g_value_init(value.gobj(),x.value_type());
@@ -780,11 +780,11 @@ KeyframeTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& gtk_iter, in
        }
        case 3:         // Time Delta
        {
-               Glib::Value<sinfg::Time> x;
+               Glib::Value<synfig::Time> x;
                g_value_init(x.gobj(),x.value_type());
                
-               sinfg::Keyframe prev_keyframe(*iter->iter);
-               sinfg::Keyframe keyframe;
+               synfig::Keyframe prev_keyframe(*iter->iter);
+               synfig::Keyframe keyframe;
                {
                        KeyframeList::iterator tmp(iter->iter);
                        tmp++;
@@ -815,7 +815,7 @@ KeyframeTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& gtk_iter, in
        }
        case 2:         // Keyframe
        {
-               Glib::Value<sinfg::Keyframe> x;
+               Glib::Value<synfig::Keyframe> x;
                g_value_init(x.gobj(),x.value_type());
                x.set(*iter->iter);
                g_value_init(value.gobj(),x.value_type());
@@ -828,7 +828,7 @@ KeyframeTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& gtk_iter, in
 }
 
 Gtk::TreeModel::Row
-KeyframeTreeStore::find_row(const sinfg::Keyframe &keyframe)
+KeyframeTreeStore::find_row(const synfig::Keyframe &keyframe)
 {
        Gtk::TreeModel::Row row(*(children().begin()));
        dump_iterator(row,"find_row,begin");
@@ -838,7 +838,7 @@ KeyframeTreeStore::find_row(const sinfg::Keyframe &keyframe)
                
        _keyframe_iterator *iter(static_cast<_keyframe_iterator*>(gtk_iter->user_data));
        
-       sinfg::KeyframeList &keyframe_list(canvas_interface()->get_canvas()->keyframe_list());
+       synfig::KeyframeList &keyframe_list(canvas_interface()->get_canvas()->keyframe_list());
        if(keyframe_list.empty())
                throw std::runtime_error(_("There are no keyframes n this canvas"));
 
@@ -909,7 +909,7 @@ KeyframeTreeStore::change_keyframe(Keyframe keyframe)
 
                unsigned int new_index(get_index_from_model_iter(row));
                unsigned int old_index(0);
-               sinfg::KeyframeList::iterator iter;
+               synfig::KeyframeList::iterator iter;
                for(old_index=0,iter=old_keyframe_list.begin();iter!=old_keyframe_list.end() && (UniqueID)*iter!=(UniqueID)keyframe;++iter,old_index++);
                
                if(iter!=old_keyframe_list.end() && new_index!=old_index)
index b0b9754..758c8d5 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file keyframetreestore.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_KEYFRAMETREESTORE_H
-#define __SINFG_STUDIO_KEYFRAMETREESTORE_H
+#ifndef __SYNFIG_STUDIO_KEYFRAMETREESTORE_H
+#define __SYNFIG_STUDIO_KEYFRAMETREESTORE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/liststore.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 #include <gdkmm/pixbuf.h>
-#include <sinfg/keyframe.h>
+#include <synfig/keyframe.h>
 #include <map>
 
 /* === M A C R O S ========================================================= */
@@ -60,10 +60,10 @@ public:
        class Model : public Gtk::TreeModel::ColumnRecord
        {
        public:
-               Gtk::TreeModelColumn<sinfg::Time> time;
+               Gtk::TreeModelColumn<synfig::Time> time;
                Gtk::TreeModelColumn<Glib::ustring> description;
-               Gtk::TreeModelColumn<sinfg::Keyframe> keyframe;
-               Gtk::TreeModelColumn<sinfg::Time> time_delta;
+               Gtk::TreeModelColumn<synfig::Keyframe> keyframe;
+               Gtk::TreeModelColumn<synfig::Time> time_delta;
        
                Model()
                {
@@ -88,16 +88,16 @@ public:
 
 private:
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
 
        //! Unique stamp for this TreeModel.
        int stamp_;
        
        static KeyframeTreeStore_Class keyframe_tree_store_class_;
 
-       //std::map<sinfg::Keyframe,TreeRowReferenceHack> path_table_;
+       //std::map<synfig::Keyframe,TreeRowReferenceHack> path_table_;
 
-       sinfg::KeyframeList old_keyframe_list;
+       synfig::KeyframeList old_keyframe_list;
 
        /*
  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
@@ -105,11 +105,11 @@ private:
 
 private:
 
-       void add_keyframe(sinfg::Keyframe);
+       void add_keyframe(synfig::Keyframe);
 
-       void remove_keyframe(sinfg::Keyframe);
+       void remove_keyframe(synfig::Keyframe);
 
-       void change_keyframe(sinfg::Keyframe);
+       void change_keyframe(synfig::Keyframe);
 
        static int sorter(const Gtk::TreeModel::iterator &,const Gtk::TreeModel::iterator &);
 
@@ -175,16 +175,16 @@ private:
 
 public:
        
-       KeyframeTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       KeyframeTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
        ~KeyframeTreeStore();
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
-       etl::loose_handle<const sinfgapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
+       etl::loose_handle<const synfigapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
        
-       sinfg::Canvas::Handle get_canvas() { return canvas_interface()->get_canvas(); }
-       sinfg::Canvas::Handle get_canvas()const { return canvas_interface()->get_canvas(); }
+       synfig::Canvas::Handle get_canvas() { return canvas_interface()->get_canvas(); }
+       synfig::Canvas::Handle get_canvas()const { return canvas_interface()->get_canvas(); }
 
-       Gtk::TreeModel::Row find_row(const sinfg::Keyframe &keyframe);
+       Gtk::TreeModel::Row find_row(const synfig::Keyframe &keyframe);
 
        /*
  -- ** -- S T A T I C  M E T H O D S ------------------------------------------
@@ -192,7 +192,7 @@ public:
 
 public:
 
-       static Glib::RefPtr<KeyframeTreeStore> create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       static Glib::RefPtr<KeyframeTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
 
        static int time_sorter(const Gtk::TreeModel::iterator &rhs,const Gtk::TreeModel::iterator &lhs);
 
index 0260580..8c93fb3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file keymapsettings.cpp
 **     \brief Contains Info for Key Map settings
 **
@@ -40,7 +40,7 @@
 
 using namespace std;
 //using namespace etl;
-//using namespace sinfg;
+//using namespace synfig;
 using namespace studio;
 
 using namespace Gtk;
index 5dba3fb..749cb9f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file keymapsettings.h
 **     \brief Defines the structures for managing key map settings
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_KEYMAPSETTINGS_H
-#define __SINFG_KEYMAPSETTINGS_H
+#ifndef __SYNFIG_KEYMAPSETTINGS_H
+#define __SYNFIG_KEYMAPSETTINGS_H
 
 /* === H E A D E R S ======================================================= */
 #include <gtkmm/dialog.h>
index 5f1c5da..83486d3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -30,9 +30,9 @@
 
 #include "layeractionmanager.h"
 #include "layertree.h"
-#include <sinfgapp/action_param.h>
+#include <synfigapp/action_param.h>
 #include "instance.h"
-#include <sinfgapp/selectionmanager.h>
+#include <synfigapp/selectionmanager.h>
 
 #endif
 
@@ -40,7 +40,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 static const guint no_prev_popup((guint)-1);
@@ -158,7 +158,7 @@ LayerActionManager::set_layer_tree(LayerTree* x)
 }
 
 void
-LayerActionManager::set_canvas_interface(const etl::handle<sinfgapp::CanvasInterface> &x)
+LayerActionManager::set_canvas_interface(const etl::handle<synfigapp::CanvasInterface> &x)
 {
        canvas_interface_=x;
 }
@@ -222,7 +222,7 @@ LayerActionManager::refresh()
        // Make sure we are ready
        if(!ui_manager_ || !layer_tree_ || !canvas_interface_)
        {
-               sinfg::error("LayerActionManager::refresh(): Not ready!");
+               synfig::error("LayerActionManager::refresh(): Not ready!");
                return;
        }
        
@@ -239,12 +239,12 @@ LayerActionManager::refresh()
                
                {
                        bool canvas_set(false);
-                       sinfgapp::Action::ParamList param_list;
+                       synfigapp::Action::ParamList param_list;
                        param_list.add("time",get_canvas_interface()->get_time());
                        param_list.add("canvas_interface",get_canvas_interface());
                        {
-                               sinfgapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
-                               sinfgapp::SelectionManager::LayerList::iterator iter;
+                               synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
+                               synfigapp::SelectionManager::LayerList::iterator iter;
                                action_copy_->set_sensitive(!layer_list.empty());
                                action_cut_->set_sensitive(!layer_list.empty());
                                action_group_->add(action_copy_);
@@ -296,7 +296,7 @@ LayerActionManager::refresh()
                                ui_info+="<menuitem action='select-all-child-layers'/>";
                        }
                        handle<studio::Instance>::cast_static(get_canvas_interface()->get_instance())->
-                               add_actions_to_group(action_group_, ui_info,   param_list, sinfgapp::Action::CATEGORY_LAYER);
+                               add_actions_to_group(action_group_, ui_info,   param_list, synfigapp::Action::CATEGORY_LAYER);
                }
        }
        
@@ -320,9 +320,9 @@ LayerActionManager::cut()
 void
 LayerActionManager::copy()
 {
-       sinfgapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
        clipboard_.clear();
-       sinfg::GUID guid;
+       synfig::GUID guid;
        
        while(!layer_list.empty())
        {
@@ -338,10 +338,10 @@ LayerActionManager::copy()
 void
 LayerActionManager::paste()
 {
-       sinfg::GUID guid;
+       synfig::GUID guid;
 
        // Create the action group
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Paste"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Paste"));
 
        Canvas::Handle canvas(get_canvas_interface()->get_canvas());
        int depth(0);
@@ -354,20 +354,20 @@ LayerActionManager::paste()
                canvas=layer->get_canvas();
        }
        
-       sinfgapp::SelectionManager::LayerList layer_selection;
+       synfigapp::SelectionManager::LayerList layer_selection;
        
-       for(std::list<sinfg::Layer::Handle>::iterator iter=clipboard_.begin();iter!=clipboard_.end();++iter)
+       for(std::list<synfig::Layer::Handle>::iterator iter=clipboard_.begin();iter!=clipboard_.end();++iter)
        {
                layer=(*iter)->clone(guid);
                layer_selection.push_back(layer);
-               sinfgapp::Action::Handle        action(sinfgapp::Action::create("layer_add"));
+               synfigapp::Action::Handle       action(synfigapp::Action::create("layer_add"));
        
                assert(action);
                if(!action)
                        return;
                
                action->set_param("canvas",canvas);
-               action->set_param("canvas_interface",etl::loose_handle<sinfgapp::CanvasInterface>(get_canvas_interface()));
+               action->set_param("canvas_interface",etl::loose_handle<synfigapp::CanvasInterface>(get_canvas_interface()));
                action->set_param("new",layer);
                
                if(!action->is_ready())
@@ -380,18 +380,18 @@ LayerActionManager::paste()
                        return;
                }
        
-               sinfg::info("DEPTH=%d",depth);
+               synfig::info("DEPTH=%d",depth);
                // Action to move the layer (if necessary)
                if(depth>0)
                {
-                       sinfgapp::Action::Handle        action(sinfgapp::Action::create("layer_move"));
+                       synfigapp::Action::Handle       action(synfigapp::Action::create("layer_move"));
                
                        assert(action);
                        if(!action)
                                return;
                        
                        action->set_param("canvas",canvas);
-                       action->set_param("canvas_interface",etl::loose_handle<sinfgapp::CanvasInterface>(get_canvas_interface()));
+                       action->set_param("canvas_interface",etl::loose_handle<synfigapp::CanvasInterface>(get_canvas_interface()));
                        action->set_param("layer",layer);
                        action->set_param("new_index",depth);
                        
@@ -421,19 +421,19 @@ LayerActionManager::amount_inc()
        float adjust(0.1);
        
        // Create the action group
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount"));
        
        if(adjust>0)
                group.set_name(_("Increase Amount"));
 
-       sinfgapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
 
        while(!layer_list.empty())
        {
                ValueBase value(layer_list.front()->get_param("amount"));
                if(value.same_as(Real()))
                {
-                       get_canvas_interface()->change_value(sinfgapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust);
+                       get_canvas_interface()->change_value(synfigapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust);
                }
                layer_list.pop_front();
        }
@@ -445,19 +445,19 @@ LayerActionManager::amount_dec()
        float adjust(-0.1);
        
        // Create the action group
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount"));
        
        if(adjust>0)
                group.set_name(_("Increase Amount"));
 
-       sinfgapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
 
        while(!layer_list.empty())
        {
                ValueBase value(layer_list.front()->get_param("amount"));
                if(value.same_as(Real()))
                {
-                       get_canvas_interface()->change_value(sinfgapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust);
+                       get_canvas_interface()->change_value(synfigapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust);
                }
                layer_list.pop_front();
        }
index 4e6a1ee..54d6767 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_LAYER_ACTION_MANAGER_H
-#define __SINFG_LAYER_ACTION_MANAGER_H
+#ifndef __SYNFIG_LAYER_ACTION_MANAGER_H
+#define __SYNFIG_LAYER_ACTION_MANAGER_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/uimanager.h>
 #include <gtkmm/treeview.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -45,7 +45,7 @@ class LayerActionManager
        Glib::RefPtr<Gtk::UIManager> ui_manager_;
        //Glib::RefPtr<Gtk::TreeSelection> tree_selection_;
        LayerTree* layer_tree_;
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::handle<synfigapp::CanvasInterface> canvas_interface_;
 
        Glib::RefPtr<Gtk::ActionGroup>  action_group_;
        Gtk::UIManager::ui_merge_id     popup_id_;
@@ -62,7 +62,7 @@ class LayerActionManager
        Glib::RefPtr<Gtk::Action>       action_amount_;
 
 
-       std::list<sinfg::Layer::Handle> clipboard_;
+       std::list<synfig::Layer::Handle> clipboard_;
 
        
        sigc::connection selection_changed_connection;
@@ -91,10 +91,10 @@ public:
        void set_layer_tree(LayerTree* x);
        LayerTree* get_layer_tree()const { return layer_tree_; }
 
-       void set_canvas_interface(const etl::handle<sinfgapp::CanvasInterface> &x);
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+       void set_canvas_interface(const etl::handle<synfigapp::CanvasInterface> &x);
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
 
-       etl::loose_handle<sinfgapp::Instance> get_instance()const { return canvas_interface_->get_instance(); }
+       etl::loose_handle<synfigapp::Instance> get_instance()const { return canvas_interface_->get_instance(); }
 
        void refresh();
        void clear();
index 88dc5fe..8ae13b6 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layergrouptree.cpp
 **     \brief Template File
 **
@@ -28,7 +28,7 @@
 #      include <config.h>
 #endif
 
-#include <sinfg/layer.h>
+#include <synfig/layer.h>
 #include "layergrouptree.h"
 #include <gtkmm/treemodelsort.h>
 #include <ETL/misc>
@@ -39,7 +39,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -107,7 +107,7 @@ LayerGroupTree::LayerGroupTree()
 
 LayerGroupTree::~LayerGroupTree()
 {
-       sinfg::info("LayerGroupTree::~LayerGroupTree(): deleted");
+       synfig::info("LayerGroupTree::~LayerGroupTree(): deleted");
 }
 
 void
@@ -150,13 +150,13 @@ LayerGroupTree::set_editable(bool x)
 }
 /*
 void
-LayerGroupTree::on_edited_time(const Glib::ustring&path_string,sinfg::Time time)
+LayerGroupTree::on_edited_time(const Glib::ustring&path_string,synfig::Time time)
 {
        Gtk::TreePath path(path_string);
        
        const Gtk::TreeRow row(*(get_model()->get_iter(path)));
        
-       sinfg::Keyframe keyframe(row[model.keyframe]);
+       synfig::Keyframe keyframe(row[model.keyframe]);
        if(time!=keyframe.get_time())
        {
                row[model.time]=time;
@@ -167,7 +167,7 @@ LayerGroupTree::on_edited_time(const Glib::ustring&path_string,sinfg::Time time)
 }
 
 void
-LayerGroupTree::on_edited_time_delta(const Glib::ustring&path_string,sinfg::Time time)
+LayerGroupTree::on_edited_time_delta(const Glib::ustring&path_string,synfig::Time time)
 {
        Gtk::TreePath path(path_string);
        
@@ -183,8 +183,8 @@ LayerGroupTree::on_edited_description(const Glib::ustring&path_string,const Glib
        
        const Gtk::TreeRow row = *(get_model()->get_iter(path));
        
-       const sinfg::String description(desc);
-       sinfg::Keyframe keyframe(row[model.keyframe]);
+       const synfig::String description(desc);
+       synfig::Keyframe keyframe(row[model.keyframe]);
        if(description!=keyframe.get_description())
        {
                row[model.description]=desc;
@@ -264,22 +264,22 @@ LayerGroupTree::on_event(GdkEvent *event)
        //return false;
 }
 
-static inline void __group_grabber(const Gtk::TreeModel::iterator& iter, std::list<sinfg::String>* ret)
+static inline void __group_grabber(const Gtk::TreeModel::iterator& iter, std::list<synfig::String>* ret)
 {
        const LayerGroupTreeStore::Model model;
        if((bool)(*iter)[model.is_group])
                ret->push_back((Glib::ustring)(*iter)[model.group_name]);
 }
 
-std::list<sinfg::String>
+std::list<synfig::String>
 LayerGroupTree::get_selected_groups()const
 {
        Glib::RefPtr<Gtk::TreeSelection> selection=const_cast<LayerGroupTree&>(*this).get_selection();
 
        if(!selection)
-               return std::list<sinfg::String>();
+               return std::list<synfig::String>();
 
-       std::list<sinfg::String> ret;
+       std::list<synfig::String> ret;
 
        selection->selected_foreach_iter(
                sigc::bind(
index 7e76a62..d0fd026 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layergrouptree.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_LAYERGROUPTREE_H
-#define __SINFG_STUDIO_LAYERGROUPTREE_H
+#ifndef __SYNFIG_STUDIO_LAYERGROUPTREE_H
+#define __SYNFIG_STUDIO_LAYERGROUPTREE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treeview.h>
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/value_desc.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/value_desc.h>
 #include "layergrouptreestore.h"
 
 /* === M A C R O S ========================================================= */
@@ -38,7 +38,7 @@
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfg { class Layer; }
+namespace synfig { class Layer; }
 
 namespace studio {
 
@@ -50,7 +50,7 @@ class LayerGroupTree : public Gtk::TreeView
 
 public:
 
-       typedef std::list<sinfg::Layer::Handle> LayerList;
+       typedef std::list<synfig::Layer::Handle> LayerList;
 
        /*
  -- ** -- P U B L I C  D A T A ------------------------------------------------
@@ -73,7 +73,7 @@ private:
        bool editable_;
 
 
-       sigc::signal<void,etl::handle<sinfg::Layer> > signal_popup_layer_menu_;
+       sigc::signal<void,etl::handle<synfig::Layer> > signal_popup_layer_menu_;
 
 //     sigc::signal<void,LayerList> signal_select_layers_;
        Gtk::TreeView::Column* label_column;
@@ -104,7 +104,7 @@ public:
 
        Glib::RefPtr<LayerGroupTreeStore> get_model() { return layer_group_tree_store_; }
 
-       sigc::signal<void,etl::handle<sinfg::Layer> >& signal_popup_layer_menu() { return signal_popup_layer_menu_; }
+       sigc::signal<void,etl::handle<synfig::Layer> >& signal_popup_layer_menu() { return signal_popup_layer_menu_; }
 
 //     sigc::signal<void,LayerList>& signal_select_layers() { return signal_select_layers_; }
 
@@ -114,7 +114,7 @@ public:
        
        bool get_editable()const { return editable_; }
        
-       std::list<sinfg::String> get_selected_groups()const;
+       std::list<synfig::String> get_selected_groups()const;
 
        LayerList get_selected_layers()const;   
 }; // END of LayerGroupTree
index 061f3f4..46888da 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layertreestore.cpp
 **     \brief Template File
 **
 #include "layergrouptreestore.h"
 #include "iconcontroler.h"
 #include <gtkmm/button.h>
-#include <sinfg/paramdesc.h>
-#include <sinfgapp/action.h>
-#include <sinfgapp/instance.h>
+#include <synfig/paramdesc.h>
+#include <synfigapp/action.h>
+#include <synfigapp/instance.h>
 #include "app.h"
 #include "instance.h"
-#include <sinfgapp/action_system.h>
+#include <synfigapp/action_system.h>
 #include "dockmanager.h"
 #include "dockable.h"
 #include "iconcontroler.h"
@@ -49,7 +49,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -69,12 +69,12 @@ static LayerGroupTreeStore::Model& ModelHack()
        return *model;
 }
 
-LayerGroupTreeStore::LayerGroupTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_):
+LayerGroupTreeStore::LayerGroupTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_):
        Gtk::TreeStore                  (ModelHack()),
        canvas_interface_               (canvas_interface_)
 {
-       layer_icon=Gtk::Button().render_icon(Gtk::StockID("sinfg-layer"),Gtk::ICON_SIZE_SMALL_TOOLBAR);
-       group_icon=Gtk::Button().render_icon(Gtk::StockID("sinfg-group"),Gtk::ICON_SIZE_SMALL_TOOLBAR);
+       layer_icon=Gtk::Button().render_icon(Gtk::StockID("synfig-layer"),Gtk::ICON_SIZE_SMALL_TOOLBAR);
+       group_icon=Gtk::Button().render_icon(Gtk::StockID("synfig-group"),Gtk::ICON_SIZE_SMALL_TOOLBAR);
 
        // Connect Signals to Terminals
        canvas_interface()->signal_layer_status_changed().connect(sigc::mem_fun(*this,&studio::LayerGroupTreeStore::on_layer_status_changed));
@@ -93,7 +93,7 @@ LayerGroupTreeStore::LayerGroupTreeStore(etl::loose_handle<sinfgapp::CanvasInter
 LayerGroupTreeStore::~LayerGroupTreeStore()
 {
        //clear();
-       sinfg::info("LayerGroupTreeStore::~LayerGroupTreeStore(): Deleted");
+       synfig::info("LayerGroupTreeStore::~LayerGroupTreeStore(): Deleted");
 }
 
 bool
@@ -110,7 +110,7 @@ LayerGroupTreeStore::search_func(const Glib::RefPtr<TreeModel>&,int,const Glib::
 
 
 Glib::RefPtr<LayerGroupTreeStore>
-LayerGroupTreeStore::create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_)
+LayerGroupTreeStore::create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_)
 {
        return Glib::RefPtr<LayerGroupTreeStore>(new LayerGroupTreeStore(canvas_interface_));
 }
@@ -203,7 +203,7 @@ LayerGroupTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int
                }
                else if((bool)(*iter)[model.is_layer])
                {
-                       sinfg::Layer::Handle layer((*iter)[model.layer]);
+                       synfig::Layer::Handle layer((*iter)[model.layer]);
        
                        if(!layer)return;
        
@@ -224,7 +224,7 @@ LayerGroupTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int
        else
        if(column==model.tooltip.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -241,7 +241,7 @@ LayerGroupTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int
        else
        if(column==model.canvas.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -263,7 +263,7 @@ LayerGroupTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int
 
                if((bool)(*iter)[model.is_layer])
                {
-                       sinfg::Layer::Handle layer((*iter)[model.layer]);
+                       synfig::Layer::Handle layer((*iter)[model.layer]);
                        x.set(layer->active());
                }
                else if((bool)(*iter)[model.is_group])
@@ -292,7 +292,7 @@ LayerGroupTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int
 
                if((bool)(*iter)[model.is_layer])
                {
-                       sinfg::Layer::Handle layer((*iter)[model.layer]);
+                       synfig::Layer::Handle layer((*iter)[model.layer]);
                        if(!layer)return;
                        //x.set(layer_icon);
                        x.set(get_tree_pixbuf_layer(layer->get_name()));
@@ -335,18 +335,18 @@ LayerGroupTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
                        
                        if((bool)(*iter)[model.is_layer])
                        {
-                               sinfg::Layer::Handle layer((*iter)[model.layer]);
+                               synfig::Layer::Handle layer((*iter)[model.layer]);
                                if(!layer)
                                        return;
-                               sinfg::String new_desc(x.get());
+                               synfig::String new_desc(x.get());
                                
                                if(new_desc==layer->get_local_name())
-                                       new_desc=sinfg::String();
+                                       new_desc=synfig::String();
        
                                if(new_desc==layer->get_description())
                                        return;
                                
-                               sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_set_desc"));
+                               synfigapp::Action::Handle action(synfigapp::Action::create("layer_set_desc"));
                                
                                if(!action)
                                        return;
@@ -354,15 +354,15 @@ LayerGroupTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
                                action->set_param("canvas",canvas_interface()->get_canvas());
                                action->set_param("canvas_interface",canvas_interface());
                                action->set_param("layer",layer);
-                               action->set_param("new_description",sinfg::String(x.get()));
+                               action->set_param("new_description",synfig::String(x.get()));
                                
                                canvas_interface()->get_instance()->perform_action(action);
                                return;
                        }
                        else if((bool)(*iter)[model.is_group])
                        {
-                               sinfg::String group((Glib::ustring)(*iter)[model.label]);
-                               sinfg::String new_group(x.get());
+                               synfig::String group((Glib::ustring)(*iter)[model.label]);
+                               synfig::String new_group(x.get());
                                
                                if(x.get()==group)
                                        return;
@@ -379,7 +379,7 @@ LayerGroupTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
                                }
                                new_group+=x.get();
                                
-                               sinfg::info("Renaming group \"%s\" to \"%s\"...",group.c_str(),new_group.c_str());
+                               synfig::info("Renaming group \"%s\" to \"%s\"...",group.c_str(),new_group.c_str());
                                
                                // Check to see if this group is real or not.
                                // If it isn't real, then renaming it is a cinch.
@@ -391,7 +391,7 @@ LayerGroupTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
                                }
                                else
                                {
-                                       sinfgapp::Action::Handle action(sinfgapp::Action::create("group_rename"));
+                                       synfigapp::Action::Handle action(synfigapp::Action::create("group_rename"));
                                        
                                        if(!action)
                                                return;
@@ -416,10 +416,10 @@ LayerGroupTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
                        
                        if((bool)(*iter)[model.is_layer])
                        {                       
-                               sinfg::Layer::Handle layer((*iter)[model.layer]);
+                               synfig::Layer::Handle layer((*iter)[model.layer]);
                                if(!layer)return;
                                        
-                               sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_activate"));
+                               synfigapp::Action::Handle action(synfigapp::Action::create("layer_activate"));
                                
                                if(!action)
                                        return;
@@ -435,7 +435,7 @@ LayerGroupTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
                        }
                        else if(!iter->children().empty())
                        {
-                               sinfgapp::Action::PassiveGrouper group(
+                               synfigapp::Action::PassiveGrouper group(
                                        get_canvas_interface()->get_instance().get(),
                                        String(
                                                x.get()?_("Activate "):_("Deactivate ")
@@ -477,9 +477,9 @@ bool
 LayerGroupTreeStore::drag_data_get_vfunc (const TreeModel::Path& path, Gtk::SelectionData& selection_data)const
 {
        if(!const_cast<LayerGroupTreeStore*>(this)->get_iter(path)) return false;
-       //sinfg::info("Dragged data of type \"%s\"",selection_data.get_data_type());
-       //sinfg::info("Dragged data of target \"%s\"",gdk_atom_name(selection_data->target));
-       //sinfg::info("Dragged selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       //synfig::info("Dragged data of type \"%s\"",selection_data.get_data_type());
+       //synfig::info("Dragged data of target \"%s\"",gdk_atom_name(selection_data->target));
+       //synfig::info("Dragged selection=\"%s\"",gdk_atom_name(selection_data->selection));
 
        Gtk::TreeModel::Row row(*const_cast<LayerGroupTreeStore*>(this)->get_iter(path));
 
@@ -498,7 +498,7 @@ LayerGroupTreeStore::drag_data_get_vfunc (const TreeModel::Path& path, Gtk::Sele
        }
        else if((bool)row[model.is_group])
        {
-               sinfg::String group((Glib::ustring)row[model.group_name]);
+               synfig::String group((Glib::ustring)row[model.group_name]);
                if(group.empty())
                        return false;
                
@@ -522,14 +522,14 @@ LayerGroupTreeStore::row_drop_possible_vfunc (const TreeModel::Path& dest, const
        Gtk::TreeIter iter(const_cast<LayerGroupTreeStore*>(this)->get_iter(dest));
        if(!iter) return false;
 
-       if(sinfg::String(selection_data.get_data_type())=="LAYER")
+       if(synfig::String(selection_data.get_data_type())=="LAYER")
                return true;
 
-       if(sinfg::String(selection_data.get_data_type())=="GROUP")
+       if(synfig::String(selection_data.get_data_type())=="GROUP")
        {
-               sinfg::String dest_group((Glib::ustring)(*iter)[model.group_name]);
-               sinfg::String src_group(reinterpret_cast<const gchar*>(selection_data.get_data()));
-               //sinfg::String src_group(const_cast<gchar*>(selection_data.get_data()));
+               synfig::String dest_group((Glib::ustring)(*iter)[model.group_name]);
+               synfig::String src_group(reinterpret_cast<const gchar*>(selection_data.get_data()));
+               //synfig::String src_group(const_cast<gchar*>(selection_data.get_data()));
                
                // Avoid putting a group inside of itself
                if(dest_group.size()>src_group.size() && src_group==String(dest_group,0,src_group.size()))
@@ -538,13 +538,13 @@ LayerGroupTreeStore::row_drop_possible_vfunc (const TreeModel::Path& dest, const
        }
        
        return false;
-       //sinfg::info("possible_drop -- data of type \"%s\"",selection_data.get_data_type());
-       //sinfg::info("possible_drop -- data of target \"%s\"",gdk_atom_name(selection_data->target));
-       //sinfg::info("possible_drop -- selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       //synfig::info("possible_drop -- data of type \"%s\"",selection_data.get_data_type());
+       //synfig::info("possible_drop -- data of target \"%s\"",gdk_atom_name(selection_data->target));
+       //synfig::info("possible_drop -- selection=\"%s\"",gdk_atom_name(selection_data->selection));
        
        //Gtk::TreeModel::Row row(*get_iter(dest));
 
-/*     if(sinfg::String(selection_data.get_data_type())=="LAYER" && (bool)true)
+/*     if(synfig::String(selection_data.get_data_type())=="LAYER" && (bool)true)
                return true;
 */
        return false;
@@ -559,23 +559,23 @@ LayerGroupTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, cons
        
        Gtk::TreeModel::Row row(*get_iter(dest));
 
-       //sinfg::info("Dropped data of type \"%s\"",selection_data.get_data_type());
-       //sinfg::info("Dropped data of target \"%s\"",gdk_atom_name(selection_data->target));
-       //sinfg::info("Dropped selection=\"%s\"",gdk_atom_name(selection_data->selection));
-       sinfgapp::Action::PassiveGrouper passive_grouper(canvas_interface()->get_instance().get(),_("Regroup"));
+       //synfig::info("Dropped data of type \"%s\"",selection_data.get_data_type());
+       //synfig::info("Dropped data of target \"%s\"",gdk_atom_name(selection_data->target));
+       //synfig::info("Dropped selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       synfigapp::Action::PassiveGrouper passive_grouper(canvas_interface()->get_instance().get(),_("Regroup"));
 
        if ((selection_data.get_length() >= 0) && (selection_data.get_format() == 8))
        {
-               sinfg::String dest_group;
+               synfig::String dest_group;
                
                dest_group=(Glib::ustring)row[model.group_name];
                
                if(dest_group.empty())
                        return false;
 
-               if(sinfg::String(selection_data.get_data_type())=="LAYER")
+               if(synfig::String(selection_data.get_data_type())=="LAYER")
                {
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("group_add_layers"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("group_add_layers"));
                        
                        if(!action)
                                return false;
@@ -598,10 +598,10 @@ LayerGroupTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, cons
                        }
                        return true;
                }
-               if(sinfg::String(selection_data.get_data_type())=="GROUP")
+               if(synfig::String(selection_data.get_data_type())=="GROUP")
                {
-                       sinfg::String src_group(reinterpret_cast<const gchar*>(selection_data.get_data()));
-                       sinfg::String group(src_group);
+                       synfig::String src_group(reinterpret_cast<const gchar*>(selection_data.get_data()));
+                       synfig::String group(src_group);
                        
                        // Get rid of any parent group crap
                        while(group.find(GROUP_NEST_CHAR)!=Glib::ustring::npos)
@@ -609,7 +609,7 @@ LayerGroupTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, cons
                        
                        group=dest_group+GROUP_NEST_CHAR+group;
                        
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("group_rename"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("group_rename"));
                        
                        if(!action)
                                return false;
@@ -628,7 +628,7 @@ LayerGroupTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, cons
                }
        }
 /*     // Save the selection data
-       sinfgapp::SelectionManager::LayerList selected_layer_list=canvas_interface()->get_selection_manager()->get_selected_layers();
+       synfigapp::SelectionManager::LayerList selected_layer_list=canvas_interface()->get_selection_manager()->get_selected_layers();
 
        if ((selection_data.get_length() >= 0) && (selection_data.get_format() == 8))
        {
@@ -644,9 +644,9 @@ LayerGroupTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, cons
 
                int dest_layer_depth=dest_layer->get_depth();
                
-               if(sinfg::String(selection_data.get_data_type())=="LAYER")for(i=0;i<selection_data.get_length()/sizeof(void*);i++)
+               if(synfig::String(selection_data.get_data_type())=="LAYER")for(i=0;i<selection_data.get_length()/sizeof(void*);i++)
                {
-                       //sinfg::info("dest_layer_depth=%d",dest_layer_depth);
+                       //synfig::info("dest_layer_depth=%d",dest_layer_depth);
                        
                        Layer::Handle src(reinterpret_cast<Layer**>(const_cast<guint8*>(selection_data.get_data()))[i]);
                        assert(src);
@@ -661,7 +661,7 @@ LayerGroupTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, cons
                                if(dest_canvas==src->get_canvas() && dest_layer_depth==src->get_depth())
                                        continue;
                                
-                               sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_move"));
+                               synfigapp::Action::Handle action(synfigapp::Action::create("layer_move"));
                                action->set_param("canvas",dest_canvas);
                                action->set_param("canvas_interface",canvas_interface());
                                action->set_param("layer",src);
@@ -682,7 +682,7 @@ LayerGroupTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, cons
                        }
                }
        }
-       sinfg::info("I suposidly moved %d layers",i);
+       synfig::info("I suposidly moved %d layers",i);
 
        // Reselect the previously selected layers
        canvas_interface()->get_selection_manager()->set_selected_layers(selected_layer_list);
@@ -735,7 +735,7 @@ LayerGroupTreeStore::rebuild()
                throw;
        }
        rebuilding=false;
-       sinfg::info("LayerGroupTreeStore::rebuild() took %f seconds",float(timer()));
+       synfig::info("LayerGroupTreeStore::rebuild() took %f seconds",float(timer()));
 }
 
 void
@@ -769,7 +769,7 @@ LayerGroupTreeStore::refresh_row(Gtk::TreeModel::Row &row)
 
 
 void
-LayerGroupTreeStore::set_row_layer(Gtk::TreeRow &row,sinfg::Layer::Handle &handle)
+LayerGroupTreeStore::set_row_layer(Gtk::TreeRow &row,synfig::Layer::Handle &handle)
 {
        row[model.is_layer] = true;
        row[model.is_group] = false;
@@ -777,7 +777,7 @@ LayerGroupTreeStore::set_row_layer(Gtk::TreeRow &row,sinfg::Layer::Handle &handl
 }
 
 Gtk::TreeRow
-LayerGroupTreeStore::on_group_added(sinfg::String group)
+LayerGroupTreeStore::on_group_added(synfig::String group)
 {
        // Check to see if this group perhaps already
        // exists
@@ -827,7 +827,7 @@ LayerGroupTreeStore::on_group_added(sinfg::String group)
 }
 
 bool
-LayerGroupTreeStore::on_group_removed(sinfg::String group)
+LayerGroupTreeStore::on_group_removed(synfig::String group)
 {
        //DEBUGPOINT();
        
@@ -841,7 +841,7 @@ LayerGroupTreeStore::on_group_removed(sinfg::String group)
 }
 
 bool
-LayerGroupTreeStore::on_group_changed(sinfg::String group)
+LayerGroupTreeStore::on_group_changed(synfig::String group)
 {
        //DEBUGPOINT();
        return true;
@@ -897,21 +897,21 @@ LayerGroupTreeStore::on_activity()
 }
 
 void
-LayerGroupTreeStore::on_layer_status_changed(sinfg::Layer::Handle handle,bool x)
+LayerGroupTreeStore::on_layer_status_changed(synfig::Layer::Handle handle,bool x)
 {
        Gtk::TreeModel::Children::iterator iter;
        if(find_layer_row(handle,iter))
                (*iter)[model.layer]=handle;
        else
        {
-               sinfg::warning("Couldn't find layer to be activated in layer list. Rebuilding index...");
+               synfig::warning("Couldn't find layer to be activated in layer list. Rebuilding index...");
                rebuild();
        }
 }
 
 
 void
-LayerGroupTreeStore::on_layer_new_description(sinfg::Layer::Handle handle,sinfg::String desc)
+LayerGroupTreeStore::on_layer_new_description(synfig::Layer::Handle handle,synfig::String desc)
 {
        Gtk::TreeModel::Children::iterator iter;
        if(find_layer_row(handle,iter))
@@ -936,7 +936,7 @@ LayerGroupTreeStore::on_layer_new_description(sinfg::Layer::Handle handle,sinfg:
 }
 
 bool
-LayerGroupTreeStore::find_layer_row_(const sinfg::Layer::Handle &layer, sinfg::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev)
+LayerGroupTreeStore::find_layer_row_(const synfig::Layer::Handle &layer, synfig::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev)
 {
        assert(layer);
        
@@ -945,7 +945,7 @@ LayerGroupTreeStore::find_layer_row_(const sinfg::Layer::Handle &layer, sinfg::C
                for(iter=prev=layers.begin(); iter && iter != layers.end(); prev=iter++)
                {
                        Gtk::TreeModel::Row row = *iter;
-                       if((bool)row[model.is_layer] && layer==(sinfg::Layer::Handle)row[model.layer])
+                       if((bool)row[model.is_layer] && layer==(synfig::Layer::Handle)row[model.layer])
                                return true;
                }
                
@@ -978,7 +978,7 @@ LayerGroupTreeStore::find_layer_row_(const sinfg::Layer::Handle &layer, sinfg::C
 }
 
 bool
-LayerGroupTreeStore::find_layer_row(const sinfg::Layer::Handle &layer, Gtk::TreeModel::Children::iterator &iter)
+LayerGroupTreeStore::find_layer_row(const synfig::Layer::Handle &layer, Gtk::TreeModel::Children::iterator &iter)
 {
        Gtk::TreeModel::Children::iterator prev;
        return find_layer_row_(layer,canvas_interface()->get_canvas(),children(),iter,prev);
@@ -992,7 +992,7 @@ LayerGroupTreeStore::find_group_row(const String &group, Gtk::TreeModel::Childre
 }
 
 bool
-LayerGroupTreeStore::find_group_row_(const sinfg::String &group, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev)
+LayerGroupTreeStore::find_group_row_(const synfig::String &group, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev)
 {
        //if(layer->get_canvas()==canvas)
        {
@@ -1027,7 +1027,7 @@ LayerGroupTreeStore::find_group_row_(const sinfg::String &group, Gtk::TreeModel:
 }
 
 bool
-LayerGroupTreeStore::find_prev_layer_row(const sinfg::Layer::Handle &layer, Gtk::TreeModel::Children::iterator &prev)
+LayerGroupTreeStore::find_prev_layer_row(const synfig::Layer::Handle &layer, Gtk::TreeModel::Children::iterator &prev)
 {
        Gtk::TreeModel::Children::iterator iter;
        if(!find_layer_row_(layer,canvas_interface()->get_canvas(),children(),iter,prev))
index dfd83a7..855c0f7 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layertreestore.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_LAYERGROUPTREESTORE_H
-#define __SINFG_STUDIO_LAYERGROUPTREESTORE_H
+#ifndef __SYNFIG_STUDIO_LAYERGROUPTREESTORE_H
+#define __SYNFIG_STUDIO_LAYERGROUPTREESTORE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/value.h>
-#include <sinfg/valuenode.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfig/value.h>
+#include <synfig/valuenode.h>
 #include <gtkmm/treeview.h>
 
 /* === M A C R O S ========================================================= */
@@ -47,7 +47,7 @@ class LayerGroupTreeStore :  public Gtk::TreeStore
        */
 
 public:
-       typedef std::list<sinfg::Layer::Handle> LayerList;
+       typedef std::list<synfig::Layer::Handle> LayerList;
 
        class Model : public Gtk::TreeModel::ColumnRecord
        {
@@ -59,12 +59,12 @@ public:
                Gtk::TreeModelColumn<Glib::ustring> group_name;
                Gtk::TreeModelColumn<Glib::ustring> parent_group_name;
 
-               Gtk::TreeModelColumn<sinfg::Canvas::Handle> canvas;
+               Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
 
                Gtk::TreeModelColumn<bool>                                              active;
                Gtk::TreeModelColumn<bool>                                              is_layer;
                Gtk::TreeModelColumn<bool>                                              is_group;
-               Gtk::TreeModelColumn<sinfg::Layer::Handle>              layer;
+               Gtk::TreeModelColumn<synfig::Layer::Handle>             layer;
                
                Gtk::TreeModelColumn<LayerList>         all_layers;
                Gtk::TreeModelColumn<LayerList>         child_layers;
@@ -103,7 +103,7 @@ public:
 
 private:
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
 
        Glib::RefPtr<Gdk::Pixbuf> layer_icon;
        Glib::RefPtr<Gdk::Pixbuf> group_icon;
@@ -130,8 +130,8 @@ private:
        virtual bool  row_drop_possible_vfunc (const TreeModel::Path& dest, const Gtk::SelectionData& selection_data)const;
 
 
-       void on_group_pair_added(sinfg::String group, etl::handle<sinfg::Layer> layer);
-       void on_group_pair_removed(sinfg::String group, etl::handle<sinfg::Layer> layer);
+       void on_group_pair_added(synfig::String group, etl::handle<synfig::Layer> layer);
+       void on_group_pair_removed(synfig::String group, etl::handle<synfig::Layer> layer);
 
        void on_activity();
 
@@ -143,16 +143,16 @@ private:
 
        bool on_layer_tree_event(GdkEvent *event);
 
-       void on_layer_new_description(sinfg::Layer::Handle handle,sinfg::String desc);
+       void on_layer_new_description(synfig::Layer::Handle handle,synfig::String desc);
 
-       void on_layer_status_changed(sinfg::Layer::Handle handle,bool);
+       void on_layer_status_changed(synfig::Layer::Handle handle,bool);
 
-       bool find_layer_row_(const sinfg::Layer::Handle &handle, sinfg::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev);
+       bool find_layer_row_(const synfig::Layer::Handle &handle, synfig::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev);
 
-       bool find_group_row_(const sinfg::String &group, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev);
+       bool find_group_row_(const synfig::String &group, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev);
 
-       bool on_group_removed(sinfg::String group);
-       bool on_group_changed(sinfg::String group);
+       bool on_group_removed(synfig::String group);
+       bool on_group_changed(synfig::String group);
 
        /*
  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
@@ -160,19 +160,19 @@ private:
 
 public:
        
-       LayerGroupTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       LayerGroupTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
        ~LayerGroupTreeStore();
 
-       Gtk::TreeRow on_group_added(sinfg::String group);
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
-       etl::loose_handle<const sinfgapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
-       etl::loose_handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+       Gtk::TreeRow on_group_added(synfig::String group);
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
+       etl::loose_handle<const synfigapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
+       etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
 
-       bool find_layer_row(const sinfg::Layer::Handle &handle, Gtk::TreeModel::Children::iterator &iter);
+       bool find_layer_row(const synfig::Layer::Handle &handle, Gtk::TreeModel::Children::iterator &iter);
 
-       bool find_group_row(const sinfg::String &group, Gtk::TreeModel::Children::iterator &iter);
+       bool find_group_row(const synfig::String &group, Gtk::TreeModel::Children::iterator &iter);
 
-       bool find_prev_layer_row(const sinfg::Layer::Handle &handle, Gtk::TreeModel::Children::iterator &iter);
+       bool find_prev_layer_row(const synfig::Layer::Handle &handle, Gtk::TreeModel::Children::iterator &iter);
 
        void rebuild();
 
@@ -180,7 +180,7 @@ public:
 
        void refresh_row(Gtk::TreeModel::Row &row);
 
-       void set_row_layer(Gtk::TreeRow &row,sinfg::Layer::Handle &handle);
+       void set_row_layer(Gtk::TreeRow &row,synfig::Layer::Handle &handle);
 
        static bool search_func(const Glib::RefPtr<TreeModel>&,int,const Glib::ustring&,const TreeModel::iterator&);
 
@@ -190,7 +190,7 @@ public:
 
 public:
        
-       static Glib::RefPtr<LayerGroupTreeStore> create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       static Glib::RefPtr<LayerGroupTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
 
 }; // END of class LayerGroupTreeStore
 
index c36abad..7d0a42b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file childrentreestore.cpp
 **     \brief Template File
 **
 #include "layerparamtreestore.h"
 #include "iconcontroler.h"
 #include <gtkmm/button.h>
-#include <sinfg/paramdesc.h>
+#include <synfig/paramdesc.h>
 #include "layertree.h"
-#include <sinfgapp/action_system.h>
-#include <sinfgapp/instance.h>
+#include <synfigapp/action_system.h>
+#include <synfigapp/instance.h>
 #include "app.h"
 #include <ETL/clock>
 
@@ -44,7 +44,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -54,7 +54,7 @@ class Profiler : private etl::clock
        const std::string name;
 public:
        Profiler(const std::string& name):name(name) { reset(); }
-       ~Profiler() { float time(operator()()); sinfg::info("%s: took %f msec",name.c_str(),time*1000); }
+       ~Profiler() { float time(operator()()); synfig::info("%s: took %f msec",name.c_str(),time*1000); }
 };
 
 /* === G L O B A L S ======================================================= */
@@ -70,7 +70,7 @@ static LayerParamTreeStore::Model& ModelHack()
        return *model;
 }
 
-LayerParamTreeStore::LayerParamTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_,LayerTree* layer_tree):
+LayerParamTreeStore::LayerParamTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_,LayerTree* layer_tree):
        Gtk::TreeStore                  (ModelHack()),
        CanvasTreeStore                 (canvas_interface_),
        layer_tree                              (layer_tree)
@@ -100,11 +100,11 @@ LayerParamTreeStore::~LayerParamTreeStore()
                changed_connection_list.back().disconnect();
                changed_connection_list.pop_back();
        }
-       sinfg::info("LayerParamTreeStore::~LayerParamTreeStore(): Deleted");
+       synfig::info("LayerParamTreeStore::~LayerParamTreeStore(): Deleted");
 }
 
 Glib::RefPtr<LayerParamTreeStore>
-LayerParamTreeStore::create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_, LayerTree*layer_tree)
+LayerParamTreeStore::create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_, LayerTree*layer_tree)
 {
        return Glib::RefPtr<LayerParamTreeStore>(new LayerParamTreeStore(canvas_interface_,layer_tree));
 }
@@ -116,13 +116,13 @@ LayerParamTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int
 {
        if(column<0)
        {
-               sinfg::error("LayerParamTreeStore::get_value_vfunc(): Bad column!");
+               synfig::error("LayerParamTreeStore::get_value_vfunc(): Bad column!");
                return;
        }
        
 /*     if(column==model.label.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -142,12 +142,12 @@ LayerParamTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int
 */
        if(column==model.label.index())
        {
-               sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]);
+               synfigapp::ValueDesc value_desc((*iter)[model.value_desc]);
                Glib::ustring label;
                
                if(!(*iter)[model.is_toplevel])
                        return CanvasTreeStore::get_value_vfunc(iter,column,value);
-               sinfg::ParamDesc param_desc((*iter)[model.param_desc]);
+               synfig::ParamDesc param_desc((*iter)[model.param_desc]);
                label=param_desc.get_local_name();
                
                if(!(*iter)[model.is_inconsistent])
@@ -222,21 +222,21 @@ LayerParamTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
        {
                if(column==model.value.index())
                {
-                       Glib::Value<sinfg::ValueBase> x;
+                       Glib::Value<synfig::ValueBase> x;
                        g_value_init(x.gobj(),model.value.type());
                        g_value_copy(value.gobj(),x.gobj());
                        
                        if((bool)(*iter)[model.is_toplevel])
                        {
-                               sinfgapp::Action::PassiveGrouper group(canvas_interface()->get_instance().get(),_("Set Layer Params"));
+                               synfigapp::Action::PassiveGrouper group(canvas_interface()->get_instance().get(),_("Set Layer Params"));
 
-                               sinfg::ParamDesc param_desc((*iter)[model.param_desc]);
+                               synfig::ParamDesc param_desc((*iter)[model.param_desc]);
 
                                LayerList::iterator iter2(layer_list.begin());
                                
                                for(;iter2!=layer_list.end();++iter2)
                                {
-                                       if(!canvas_interface()->change_value(sinfgapp::ValueDesc(*iter2,param_desc.get_name()),x.get()))
+                                       if(!canvas_interface()->change_value(synfigapp::ValueDesc(*iter2,param_desc.get_name()),x.get()))
                                        {
                                                // ERROR!
                                                group.cancel();
@@ -256,7 +256,7 @@ LayerParamTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
 /*
                if(column==model.active.index())
                {
-                       sinfg::Layer::Handle layer((*iter)[model.layer]);
+                       synfig::Layer::Handle layer((*iter)[model.layer]);
                        
                        if(!layer)return;
 
@@ -264,7 +264,7 @@ LayerParamTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co
                        g_value_init(x.gobj(),model.active.type());
                        g_value_copy(value.gobj(),x.gobj());
                        
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_activate"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("layer_activate"));
                        
                        if(!action)
                                return;
@@ -320,7 +320,7 @@ LayerParamTreeStore::rebuild()
        {
                ParamVocab vocab;
 
-               static ParamVocab::iterator find_param_desc(ParamVocab& vocab, const sinfg::String& x)
+               static ParamVocab::iterator find_param_desc(ParamVocab& vocab, const synfig::String& x)
                {
                        ParamVocab::iterator iter;
        
@@ -384,7 +384,7 @@ LayerParamTreeStore::rebuild()
                }
                */
                Gtk::TreeRow row(*(append()));
-               sinfgapp::ValueDesc value_desc(layer_list.front(),iter->get_name());
+               synfigapp::ValueDesc value_desc(layer_list.front(),iter->get_name());
                CanvasTreeStore::set_row(row,value_desc);
                if(value_desc.is_value_node())
                {
@@ -508,7 +508,7 @@ LayerParamTreeStore::refresh_row(Gtk::TreeModel::Row &row)
 }
 
 void
-LayerParamTreeStore::set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc)
+LayerParamTreeStore::set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc)
 {
        Gtk::TreeModel::Children children = row.children();
        while(!children.empty() && erase(children.begin()));
@@ -529,13 +529,13 @@ LayerParamTreeStore::on_value_node_deleted(etl::handle<ValueNode> value_node)
 }
 
 void
-LayerParamTreeStore::on_value_node_child_added(sinfg::ValueNode::Handle value_node,sinfg::ValueNode::Handle child)
+LayerParamTreeStore::on_value_node_child_added(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child)
 {
        queue_rebuild();
 }
 
 void
-LayerParamTreeStore::on_value_node_child_removed(sinfg::ValueNode::Handle value_node,sinfg::ValueNode::Handle child)
+LayerParamTreeStore::on_value_node_child_removed(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child)
 {
        queue_rebuild();
 }
@@ -547,13 +547,13 @@ LayerParamTreeStore::on_value_node_changed(etl::handle<ValueNode> value_node)
 }
 
 void
-LayerParamTreeStore::on_value_node_replaced(sinfg::ValueNode::Handle replaced_value_node,sinfg::ValueNode::Handle new_value_node)
+LayerParamTreeStore::on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node)
 {
        queue_rebuild();
 }
 
 void
-LayerParamTreeStore::on_layer_param_changed(sinfg::Layer::Handle handle,sinfg::String param_name)
+LayerParamTreeStore::on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name)
 {
        queue_refresh();
 }
index 24d338d..6b151d8 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layerparamtreestore.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_LAYERPARAMTREESTORE_H
-#define __SINFG_STUDIO_LAYERPARAMTREESTORE_H
+#ifndef __SYNFIG_STUDIO_LAYERPARAMTREESTORE_H
+#define __SYNFIG_STUDIO_LAYERPARAMTREESTORE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 #include "canvastreestore.h"
-#include <sinfg/value.h>
-#include <sinfg/valuenode.h>
-#include <sinfg/paramdesc.h>
+#include <synfig/value.h>
+#include <synfig/valuenode.h>
+#include <synfig/paramdesc.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -50,7 +50,7 @@ class LayerParamTreeStore : public CanvasTreeStore
        */
 
 public:
-       typedef std::list<sinfg::Layer::Handle> LayerList;
+       typedef std::list<synfig::Layer::Handle> LayerList;
 
        /*
  -- ** -- P U B L I C  D A T A ------------------------------------------------
@@ -63,7 +63,7 @@ public:
        {
        public:
 
-               Gtk::TreeModelColumn<sinfg::ParamDesc>  param_desc;
+               Gtk::TreeModelColumn<synfig::ParamDesc> param_desc;
 
                Gtk::TreeModelColumn<bool>      is_inconsistent;
                Gtk::TreeModelColumn<bool>      is_toplevel;
@@ -106,7 +106,7 @@ private:
 protected:
        virtual void  get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
        virtual void set_value_impl (const Gtk::TreeModel::iterator& row, int column, const Glib::ValueBase& value);
-       virtual void set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc);
+       virtual void set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc);
 
        /*
  -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
@@ -114,14 +114,14 @@ protected:
 
 private:
 
-       void on_value_node_child_added(sinfg::ValueNode::Handle value_node,sinfg::ValueNode::Handle child);
-       void on_value_node_child_removed(sinfg::ValueNode::Handle value_node,sinfg::ValueNode::Handle child);
+       void on_value_node_child_added(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child);
+       void on_value_node_child_removed(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child);
 
-       void on_value_node_added(sinfg::ValueNode::Handle value_node);
-       void on_value_node_deleted(sinfg::ValueNode::Handle value_node);
-       virtual void on_value_node_changed(sinfg::ValueNode::Handle value_node);
-       void on_value_node_replaced(sinfg::ValueNode::Handle replaced_value_node,sinfg::ValueNode::Handle new_value_node);
-       void on_layer_param_changed(sinfg::Layer::Handle handle,sinfg::String param_name);
+       void on_value_node_added(synfig::ValueNode::Handle value_node);
+       void on_value_node_deleted(synfig::ValueNode::Handle value_node);
+       virtual void on_value_node_changed(synfig::ValueNode::Handle value_node);
+       void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
+       void on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name);
 
        /*
  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
@@ -129,7 +129,7 @@ private:
 
 public:
        
-       LayerParamTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_,
+       LayerParamTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_,
                LayerTree* layer_tree);
        ~LayerParamTreeStore();
 
@@ -153,7 +153,7 @@ public:
 
 public:
        
-       static Glib::RefPtr<LayerParamTreeStore> create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_, LayerTree*layer_tree);
+       static Glib::RefPtr<LayerParamTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_, LayerTree*layer_tree);
 }; // END of class LayerParamTreeStore
 
 }; // END of namespace studio
index 6e1c05c..a480cf8 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layertree.cpp
 **     \brief Template File
 **
@@ -32,8 +32,8 @@
 #include "layerparamtreestore.h"
 #include "cellrenderer_value.h"
 #include "cellrenderer_timetrack.h"
-#include <sinfgapp/action.h>
-#include <sinfgapp/instance.h>
+#include <synfigapp/action.h>
+#include <synfigapp/instance.h>
 #include <gtkmm/scrolledwindow.h>
 #include <gtkmm/paned.h>
 #include "app.h"
@@ -46,7 +46,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -119,12 +119,12 @@ LayerTree::LayerTree():
        
        
        Gtk::Image *icon;
-       //Gtk::IconSize iconsize(Gtk::IconSize::from_name("sinfg-small_icon"));
+       //Gtk::IconSize iconsize(Gtk::IconSize::from_name("synfig-small_icon"));
        Gtk::IconSize iconsize(Gtk::ICON_SIZE_SMALL_TOOLBAR);
 
        SMALL_BUTTON(button_raise,"gtk-go-up","Raise");
        SMALL_BUTTON(button_lower,"gtk-go-down","Lower");
-       SMALL_BUTTON(button_duplicate,"sinfg-duplicate","Duplicate");
+       SMALL_BUTTON(button_duplicate,"synfig-duplicate","Duplicate");
        SMALL_BUTTON(button_delete,"gtk-delete","Delete");
        
        hbox->pack_start(*button_raise,Gtk::PACK_SHRINK);
@@ -177,7 +177,7 @@ LayerTree::LayerTree():
 
 LayerTree::~LayerTree()
 {
-       sinfg::info("LayerTree::~LayerTree(): Deleted");
+       synfig::info("LayerTree::~LayerTree(): Deleted");
 }
 
 Gtk::Widget*
@@ -344,7 +344,7 @@ LayerTree::create_param_tree()
                // Set up the value-node icon cell-renderer to be on the far right
                Gtk::CellRendererPixbuf* valuenode_icon_cellrenderer = Gtk::manage( new Gtk::CellRendererPixbuf() );
                column->pack_end(*valuenode_icon_cellrenderer,false);
-               valuenode_icon_cellrenderer->property_pixbuf()=Gtk::Button().render_icon(Gtk::StockID("sinfg-value_node"),icon_size);
+               valuenode_icon_cellrenderer->property_pixbuf()=Gtk::Button().render_icon(Gtk::StockID("synfig-value_node"),icon_size);
                column->add_attribute(valuenode_icon_cellrenderer->property_visible(), param_model.is_shared);
 
                // Finish setting up the column         
@@ -360,7 +360,7 @@ LayerTree::create_param_tree()
                // Set up the value cell-renderer
                cellrenderer_value=LayerParamTreeStore::add_cell_renderer_value(column);
                cellrenderer_value->signal_edited().connect(sigc::mem_fun(*this, &studio::LayerTree::on_edited_value));
-               cellrenderer_value->property_value()=sinfg::ValueBase();
+               cellrenderer_value->property_value()=synfig::ValueBase();
                column->add_attribute(cellrenderer_value->property_param_desc(), param_model.param_desc);
                column->add_attribute(cellrenderer_value->property_inconsistant(),param_model.is_inconsistent);
                //cellrenderer_value->property_canvas()=canvas_interface->get_canvas(); // Is this line necessary?
@@ -420,9 +420,9 @@ LayerTree::create_param_tree()
 }
 
 void
-LayerTree::on_waypoint_changed( sinfg::Waypoint waypoint , sinfg::ValueNode::Handle value_node)
+LayerTree::on_waypoint_changed( synfig::Waypoint waypoint , synfig::ValueNode::Handle value_node)
 {
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list.add("canvas",layer_tree_store_->canvas_interface()->get_canvas());
        param_list.add("canvas_interface",layer_tree_store_->canvas_interface());
        param_list.add("value_node",value_node);
@@ -468,7 +468,7 @@ LayerTree::select_all_children(Gtk::TreeModel::Children::iterator iter)
 }
 
 void
-LayerTree::select_all_children_layers(sinfg::Layer::Handle layer)
+LayerTree::select_all_children_layers(synfig::Layer::Handle layer)
 {
        Gtk::TreeModel::Children::iterator iter;
        if(layer_tree_store_->find_layer_row(layer,iter))
@@ -511,7 +511,7 @@ LayerTree::get_selected_layers()const
        return ret;
 }
 
-sinfg::Layer::Handle
+synfig::Layer::Handle
 LayerTree::get_selected_layer()const
 {
        LayerList layers(get_selected_layers());
@@ -623,7 +623,7 @@ LayerTree::on_dirty_preview()
 void
 LayerTree::on_selection_changed()
 {
-       sinfgapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
        
        Gtk::TreeIter iter;
        if(last_top_selected_layer && !layer_tree_store_->find_layer_row(last_top_selected_layer,iter))
@@ -708,7 +708,7 @@ LayerTree::on_blend_method_changed()
        if(quick_layer->get_param("blend_method").is_valid())
        {
                disable_amount_changed_signal=true;
-               signal_edited_value()(sinfgapp::ValueDesc(quick_layer,"blend_method"),blend_method_widget.get_value());
+               signal_edited_value()(synfigapp::ValueDesc(quick_layer,"blend_method"),blend_method_widget.get_value());
                disable_amount_changed_signal=false;
        }
 }
@@ -722,13 +722,13 @@ LayerTree::on_amount_value_changed()
                return;
        
        disable_amount_changed_signal=true;
-       signal_edited_value()(sinfgapp::ValueDesc(quick_layer,"amount"),sinfg::ValueBase(layer_amount_adjustment_.get_value()));
+       signal_edited_value()(synfigapp::ValueDesc(quick_layer,"amount"),synfig::ValueBase(layer_amount_adjustment_.get_value()));
        disable_amount_changed_signal=false;
 }
 
 
 void
-LayerTree::on_edited_value(const Glib::ustring&path_string,sinfg::ValueBase value)
+LayerTree::on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value)
 {
        Gtk::TreePath path(path_string);
        
@@ -752,7 +752,7 @@ LayerTree::on_layer_toggle(const Glib::ustring& path_string)
 */
 
 void
-LayerTree::on_waypoint_clicked(const Glib::ustring &path_string, sinfg::Waypoint waypoint,int button)
+LayerTree::on_waypoint_clicked(const Glib::ustring &path_string, synfig::Waypoint waypoint,int button)
 {
        Gtk::TreePath path(path_string);
        
@@ -760,7 +760,7 @@ LayerTree::on_waypoint_clicked(const Glib::ustring &path_string, sinfg::Waypoint
        if(!row)
                return;
        
-       signal_waypoint_clicked()(static_cast<sinfgapp::ValueDesc>(row[param_model.value_desc]),waypoint,button);
+       signal_waypoint_clicked()(static_cast<synfigapp::ValueDesc>(row[param_model.value_desc]),waypoint,button);
 }
 
 bool
@@ -878,17 +878,17 @@ LayerTree::on_param_tree_event(GdkEvent *event)
                                        LayerList layer_list(get_selected_layers());
                                        if(layer_list.size()<=1)
                                        {
-                                               sinfgapp::ValueDesc value_desc(row[param_model.value_desc]);
+                                               synfigapp::ValueDesc value_desc(row[param_model.value_desc]);
                                                Gtk::Menu* menu(manage(new Gtk::Menu()));                                       
                                                App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc,0.5f);
                                                menu->popup(event->button.button,gtk_get_current_event_time());
                                                return true;
                                        }
                                        Gtk::Menu* menu(manage(new Gtk::Menu()));                                       
-                                       std::list<sinfgapp::ValueDesc> value_desc_list;
+                                       std::list<synfigapp::ValueDesc> value_desc_list;
                                        ParamDesc param_desc(row[param_model.param_desc]);
                                        for(;!layer_list.empty();layer_list.pop_back())
-                                               value_desc_list.push_back(sinfgapp::ValueDesc(layer_list.back(),param_desc.get_name()));
+                                               value_desc_list.push_back(synfigapp::ValueDesc(layer_list.back(),param_desc.get_name()));
                                        App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc_list);
                                        menu->popup(event->button.button,gtk_get_current_event_time());
                                        return true;
@@ -989,19 +989,19 @@ LayerTree::on_param_tree_event(GdkEvent *event)
 void
 LayerTree::on_raise_pressed()
 {
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list.add("time",layer_tree_store_->canvas_interface()->get_time());
        param_list.add("canvas",layer_tree_store_->canvas_interface()->get_canvas());
        param_list.add("canvas_interface",layer_tree_store_->canvas_interface());
        
        {
-               sinfgapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
-               sinfgapp::SelectionManager::LayerList::iterator iter;
+               synfigapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
+               synfigapp::SelectionManager::LayerList::iterator iter;
        
                for(iter=layer_list.begin();iter!=layer_list.end();++iter)
                        param_list.add("layer",Layer::Handle(*iter));
        }
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_raise"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("layer_raise"));
        action->set_param_list(param_list);
        layer_tree_store_->canvas_interface()->get_instance()->perform_action(action);
 }
@@ -1009,20 +1009,20 @@ LayerTree::on_raise_pressed()
 void
 LayerTree::on_lower_pressed()
 {
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list.add("time",layer_tree_store_->canvas_interface()->get_time());
        param_list.add("canvas",layer_tree_store_->canvas_interface()->get_canvas());
        param_list.add("canvas_interface",layer_tree_store_->canvas_interface());
        
        {
-               sinfgapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
-               sinfgapp::SelectionManager::LayerList::iterator iter;
+               synfigapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
+               synfigapp::SelectionManager::LayerList::iterator iter;
        
                for(iter=layer_list.begin();iter!=layer_list.end();++iter)
                        param_list.add("layer",Layer::Handle(*iter));
        }
        
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_lower"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("layer_lower"));
        action->set_param_list(param_list);
        layer_tree_store_->canvas_interface()->get_instance()->perform_action(action);
 }
@@ -1030,20 +1030,20 @@ LayerTree::on_lower_pressed()
 void
 LayerTree::on_duplicate_pressed()
 {
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list.add("time",layer_tree_store_->canvas_interface()->get_time());
        param_list.add("canvas",layer_tree_store_->canvas_interface()->get_canvas());
        param_list.add("canvas_interface",layer_tree_store_->canvas_interface());
        
        {
-               sinfgapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
-               sinfgapp::SelectionManager::LayerList::iterator iter;
+               synfigapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
+               synfigapp::SelectionManager::LayerList::iterator iter;
        
                for(iter=layer_list.begin();iter!=layer_list.end();++iter)
                        param_list.add("layer",Layer::Handle(*iter));
        }
        
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_duplicate"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("layer_duplicate"));
        action->set_param_list(param_list);
        layer_tree_store_->canvas_interface()->get_instance()->perform_action(action);
 }
@@ -1051,20 +1051,20 @@ LayerTree::on_duplicate_pressed()
 void
 LayerTree::on_delete_pressed()
 {
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list.add("time",layer_tree_store_->canvas_interface()->get_time());
        param_list.add("canvas",layer_tree_store_->canvas_interface()->get_canvas());
        param_list.add("canvas_interface",layer_tree_store_->canvas_interface());
        
        {
-               sinfgapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
-               sinfgapp::SelectionManager::LayerList::iterator iter;
+               synfigapp::SelectionManager::LayerList layer_list(get_selection_manager()->get_selected_layers());
+               synfigapp::SelectionManager::LayerList::iterator iter;
        
                for(iter=layer_list.begin();iter!=layer_list.end();++iter)
                        param_list.add("layer",Layer::Handle(*iter));
        }
        
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_remove"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("layer_remove"));
        action->set_param_list(param_list);
        layer_tree_store_->canvas_interface()->get_instance()->perform_action(action);
 }
@@ -1092,9 +1092,9 @@ LayerTree::on_delete_pressed()
 void
 LayerTree::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&context, Gtk::SelectionData& selection_data, guint info, guint time)
 {
-       sinfg::info("Dragged data of type \"%s\"",selection_data.get_data_type());
-       sinfg::info("Dragged data of target \"%s\"",gdk_atom_name(selection_data->target));
-       sinfg::info("Dragged selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       synfig::info("Dragged data of type \"%s\"",selection_data.get_data_type());
+       synfig::info("Dragged data of target \"%s\"",gdk_atom_name(selection_data->target));
+       synfig::info("Dragged selection=\"%s\"",gdk_atom_name(selection_data->selection));
 
        DEBUGPOINT();
 
@@ -1105,7 +1105,7 @@ LayerTree::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&context, Gtk::S
        Gtk::TreeRow row = *(get_selection()->get_selected());
        DEBUGPOINT();
 
-       if(sinfg::String(gdk_atom_name(selection_data->target))=="LAYER" && (bool)row[model.is_layer])
+       if(synfig::String(gdk_atom_name(selection_data->target))=="LAYER" && (bool)row[model.is_layer])
        {
                DEBUGPOINT();
                Layer* layer(((Layer::Handle)row[model.layer]).get());
@@ -1119,10 +1119,10 @@ LayerTree::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&context, Gtk::S
 void
 LayerTree::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, Gtk::SelectionData& selection_data, guint info, guint time)
 {
-       sinfg::info("Dropped data of type \"%s\"",selection_data.get_data_type());
-       sinfg::info("Dropped data of target \"%s\"",gdk_atom_name(selection_data->target));
-       sinfg::info("Dropped selection=\"%s\"",gdk_atom_name(selection_data->selection));
-       sinfg::info("Dropped x=%d, y=%d",x,y);
+       synfig::info("Dropped data of type \"%s\"",selection_data.get_data_type());
+       synfig::info("Dropped data of target \"%s\"",gdk_atom_name(selection_data->target));
+       synfig::info("Dropped selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       synfig::info("Dropped x=%d, y=%d",x,y);
        bool success=false;
        bool dropped_on_specific_row=false;
        
@@ -1147,7 +1147,7 @@ LayerTree::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& cont
        
        if ((selection_data.get_length() >= 0) && (selection_data.get_format() == 8))
        {
-               if(sinfg::String(selection_data.get_data_type())=="LAYER")do
+               if(synfig::String(selection_data.get_data_type())=="LAYER")do
                {
                        Layer::Handle src(*reinterpret_cast<Layer**>(selection_data.get_data()));
                        assert(src);
@@ -1170,7 +1170,7 @@ LayerTree::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& cont
                                if(!dest_layer || dest_layer==src)
                                        break;
                                
-                               sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_move"));
+                               synfigapp::Action::Handle action(synfigapp::Action::create("layer_move"));
                                action->set_param("canvas",dest_canvas);
                                action->set_param("canvas_interface",layer_tree_store_->canvas_interface());
                                action->set_param("layer",src);
index b0e0f98..efb1488 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layertree.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_LAYERTREE_H
-#define __SINFG_STUDIO_LAYERTREE_H
+#ifndef __SYNFIG_STUDIO_LAYERTREE_H
+#define __SYNFIG_STUDIO_LAYERTREE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/scale.h>
 #include <gtkmm/button.h>
 
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/value_desc.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/value_desc.h>
 #include "layertreestore.h"
 #include "layerparamtreestore.h"
-#include <sinfg/valuenode_animated.h>
+#include <synfig/valuenode_animated.h>
 
 #include "widget_value.h"
 
@@ -74,7 +74,7 @@ public:
                COLUMNID_END                    //!< \internal
        };
 */
-       typedef std::list<sinfg::Layer::Handle> LayerList;
+       typedef std::list<synfig::Layer::Handle> LayerList;
        
        /*
  -- ** -- P U B L I C  D A T A ------------------------------------------------
@@ -87,7 +87,7 @@ public:
        LayerTreeStore::Model layer_model;
        LayerParamTreeStore::Model param_model;
 
-       sinfg::Layer::Handle last_top_selected_layer;
+       synfig::Layer::Handle last_top_selected_layer;
        Gtk::TreePath last_top_selected_path;
 
        /*
@@ -113,7 +113,7 @@ private:
 
        Gtk::HScale *layer_amount_hscale;
 
-       sinfg::Layer::Handle quick_layer;
+       synfig::Layer::Handle quick_layer;
 
        Glib::RefPtr<LayerTreeStore> layer_tree_store_;
 
@@ -129,15 +129,15 @@ private:
 
        CellRenderer_ValueBase *cellrenderer_value;
 
-       sigc::signal<void,sinfg::Layer::Handle> signal_layer_toggle_;
+       sigc::signal<void,synfig::Layer::Handle> signal_layer_toggle_;
 
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::ValueBase> signal_edited_value_;
+       sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase> signal_edited_value_;
 
        sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_layer_user_click_;
 
        sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_param_user_click_;
 
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::Waypoint,int> signal_waypoint_clicked_;
+       sigc::signal<void,synfigapp::ValueDesc,synfig::Waypoint,int> signal_waypoint_clicked_;
 
        bool disable_amount_changed_signal;
 
@@ -163,13 +163,13 @@ private:
 
 private:
 
-       void on_edited_value(const Glib::ustring&path_string,sinfg::ValueBase value);
+       void on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value);
 
        void on_layer_toggle(const Glib::ustring& path_string);
 
-       void on_waypoint_clicked(const Glib::ustring &, sinfg::Waypoint, int button);
+       void on_waypoint_clicked(const Glib::ustring &, synfig::Waypoint, int button);
 
-       void on_waypoint_changed( sinfg::Waypoint waypoint , sinfg::ValueNode::Handle value_node);
+       void on_waypoint_changed( synfig::Waypoint waypoint , synfig::ValueNode::Handle value_node);
 
        bool on_layer_tree_event(GdkEvent *event);
 
@@ -222,27 +222,27 @@ public:
        void set_show_timetrack(bool x=true);
 
        //! Signal called when layer is toggled.
-       sigc::signal<void,sinfg::Layer::Handle>& signal_layer_toggle() { return signal_layer_toggle_; }
+       sigc::signal<void,synfig::Layer::Handle>& signal_layer_toggle() { return signal_layer_toggle_; }
 
        //! Signal called with a value has been edited.
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::ValueBase>& signal_edited_value() { return signal_edited_value_; }
+       sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase>& signal_edited_value() { return signal_edited_value_; }
 
        sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_layer_user_click() { return signal_layer_user_click_; }
 
        sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_param_user_click() { return signal_param_user_click_; }
 
-       sigc::signal<void,sinfgapp::ValueDesc,sinfg::Waypoint,int>& signal_waypoint_clicked() { return signal_waypoint_clicked_; }
+       sigc::signal<void,synfigapp::ValueDesc,synfig::Waypoint,int>& signal_waypoint_clicked() { return signal_waypoint_clicked_; }
 
-       etl::handle<sinfgapp::SelectionManager> get_selection_manager() { return layer_tree_store_->canvas_interface()->get_selection_manager(); }
+       etl::handle<synfigapp::SelectionManager> get_selection_manager() { return layer_tree_store_->canvas_interface()->get_selection_manager(); }
        
        
        
-       void select_layer(sinfg::Layer::Handle layer);
+       void select_layer(synfig::Layer::Handle layer);
        void select_layers(const LayerList& layer_list);
-       void select_all_children_layers(sinfg::Layer::Handle layer);
+       void select_all_children_layers(synfig::Layer::Handle layer);
        void select_all_children(Gtk::TreeModel::Children::iterator iter);
        LayerList get_selected_layers()const;
-       sinfg::Layer::Handle get_selected_layer()const;
+       synfig::Layer::Handle get_selected_layer()const;
        void clear_selected_layers();
 
 }; // END of LayerTree
index 4aac862..151cfc0 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layertreestore.cpp
 **     \brief Template File
 **
 #include "layertreestore.h"
 #include "iconcontroler.h"
 #include <gtkmm/button.h>
-#include <sinfg/paramdesc.h>
-#include <sinfgapp/action.h>
-#include <sinfgapp/instance.h>
+#include <synfig/paramdesc.h>
+#include <synfigapp/action.h>
+#include <synfigapp/instance.h>
 #include "app.h"
 #include "instance.h"
 #include "iconcontroler.h"
-#include <sinfgapp/action_system.h>
+#include <synfigapp/action_system.h>
 
 #include <gtk/gtkversion.h>
 #include <ETL/clock>
@@ -47,7 +47,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -65,11 +65,11 @@ static LayerTreeStore::Model& ModelHack()
        return *model;
 }
 
-LayerTreeStore::LayerTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_):
+LayerTreeStore::LayerTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_):
        Gtk::TreeStore                  (ModelHack()),
        canvas_interface_               (canvas_interface_)
 {
-       layer_icon=Gtk::Button().render_icon(Gtk::StockID("sinfg-layer"),Gtk::ICON_SIZE_SMALL_TOOLBAR);
+       layer_icon=Gtk::Button().render_icon(Gtk::StockID("synfig-layer"),Gtk::ICON_SIZE_SMALL_TOOLBAR);
 
        // Connect Signals to Terminals
        canvas_interface()->signal_layer_status_changed().connect(sigc::mem_fun(*this,&studio::LayerTreeStore::on_layer_status_changed));
@@ -95,7 +95,7 @@ LayerTreeStore::LayerTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canv
 
 LayerTreeStore::~LayerTreeStore()
 {
-       sinfg::info("LayerTreeStore::~LayerTreeStore()q: Deleted");
+       synfig::info("LayerTreeStore::~LayerTreeStore()q: Deleted");
 
 }
 
@@ -135,7 +135,7 @@ LayerTreeStore::search_func(const Glib::RefPtr<TreeModel>&,int,const Glib::ustri
 
 
 Glib::RefPtr<LayerTreeStore>
-LayerTreeStore::create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_)
+LayerTreeStore::create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_)
 {
        return Glib::RefPtr<LayerTreeStore>(new LayerTreeStore(canvas_interface_));
 }
@@ -145,7 +145,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum
 {
        if(column==model.index.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -160,7 +160,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum
        else
        if(column==model.z_depth.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -175,7 +175,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum
        else
        if(column==model.children_lock.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -193,7 +193,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum
        else
        if(column==model.label.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -213,7 +213,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum
        else
        if(column==model.tooltip.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -230,7 +230,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum
        else
        if(column==model.canvas.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -247,7 +247,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum
        else
        if(column==model.active.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
 
                if(!layer)return;
 
@@ -262,7 +262,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum
        else
        if(column==model.icon.index())
        {
-               sinfg::Layer::Handle layer((*iter)[model.layer]);
+               synfig::Layer::Handle layer((*iter)[model.layer]);
                if(!layer)return;
 
                Glib::Value<Glib::RefPtr<Gdk::Pixbuf> > x;
@@ -304,18 +304,18 @@ LayerTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int column,
                        g_value_init(x.gobj(),model.label.type());
                        g_value_copy(value.gobj(),x.gobj());
                        
-                       sinfg::Layer::Handle layer((*iter)[model.layer]);
+                       synfig::Layer::Handle layer((*iter)[model.layer]);
                        if(!layer)
                                return;
-                       sinfg::String new_desc(x.get());
+                       synfig::String new_desc(x.get());
                        
                        if(new_desc==layer->get_local_name())
-                               new_desc=sinfg::String();
+                               new_desc=synfig::String();
 
                        if(new_desc==layer->get_description())
                                return;
                        
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_set_desc"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("layer_set_desc"));
                        
                        if(!action)
                                return;
@@ -323,7 +323,7 @@ LayerTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int column,
                        action->set_param("canvas",canvas_interface()->get_canvas());
                        action->set_param("canvas_interface",canvas_interface());
                        action->set_param("layer",layer);
-                       action->set_param("new_description",sinfg::String(x.get()));
+                       action->set_param("new_description",synfig::String(x.get()));
                        
                        canvas_interface()->get_instance()->perform_action(action);
                        return;
@@ -331,7 +331,7 @@ LayerTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int column,
                else
                if(column==model.active.index())
                {
-                       sinfg::Layer::Handle layer((*iter)[model.layer]);
+                       synfig::Layer::Handle layer((*iter)[model.layer]);
                        
                        if(!layer)return;
 
@@ -339,7 +339,7 @@ LayerTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int column,
                        g_value_init(x.gobj(),model.active.type());
                        g_value_copy(value.gobj(),x.gobj());
                        
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_activate"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("layer_activate"));
                        
                        if(!action)
                                return;
@@ -379,9 +379,9 @@ bool
 LayerTreeStore::drag_data_get_vfunc (const TreeModel::Path& path, Gtk::SelectionData& selection_data)const
 {
        if(!const_cast<LayerTreeStore*>(this)->get_iter(path)) return false;
-       //sinfg::info("Dragged data of type \"%s\"",selection_data.get_data_type());
-       //sinfg::info("Dragged data of target \"%s\"",gdk_atom_name(selection_data->target));
-       //sinfg::info("Dragged selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       //synfig::info("Dragged data of type \"%s\"",selection_data.get_data_type());
+       //synfig::info("Dragged data of target \"%s\"",gdk_atom_name(selection_data->target));
+       //synfig::info("Dragged selection=\"%s\"",gdk_atom_name(selection_data->selection));
 
        Gtk::TreeModel::Row row(*const_cast<LayerTreeStore*>(this)->get_iter(path));
 
@@ -396,7 +396,7 @@ LayerTreeStore::drag_data_get_vfunc (const TreeModel::Path& path, Gtk::Selection
                std::vector<Layer*> layers;
                // The following is a hack for multiple row DND
                {
-                       sinfgapp::SelectionManager::LayerList bleh(get_canvas_interface()->get_selection_manager()->get_selected_layers());
+                       synfigapp::SelectionManager::LayerList bleh(get_canvas_interface()->get_selection_manager()->get_selected_layers());
                        if(bleh.empty())
                        {
                                selection_data.set("LAYER", 8, reinterpret_cast<const guchar*>(&layer), sizeof(layer));
@@ -430,13 +430,13 @@ LayerTreeStore::row_drop_possible_vfunc (const TreeModel::Path& dest, const Gtk:
 {
        //if(!const_cast<LayerTreeStore*>(this)->get_iter(dest)) return false;
 
-       //sinfg::info("possible_drop -- data of type \"%s\"",selection_data.get_data_type());
-       //sinfg::info("possible_drop -- data of target \"%s\"",gdk_atom_name(selection_data->target));
-       //sinfg::info("possible_drop -- selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       //synfig::info("possible_drop -- data of type \"%s\"",selection_data.get_data_type());
+       //synfig::info("possible_drop -- data of target \"%s\"",gdk_atom_name(selection_data->target));
+       //synfig::info("possible_drop -- selection=\"%s\"",gdk_atom_name(selection_data->selection));
        
        //Gtk::TreeModel::Row row(*get_iter(dest));
 
-       if(sinfg::String(selection_data.get_data_type())=="LAYER" && (bool)true)
+       if(synfig::String(selection_data.get_data_type())=="LAYER" && (bool)true)
        {
                //Layer::Handle src(reinterpret_cast<Layer**>(const_cast<guint8*>(selection_data.get_data()))[i]);
                //assert(src);
@@ -470,13 +470,13 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk
        int i(0);
        
 
-       //sinfg::info("Dropped data of type \"%s\"",selection_data.get_data_type());
-       //sinfg::info("Dropped data of target \"%s\"",gdk_atom_name(selection_data->target));
-       //sinfg::info("Dropped selection=\"%s\"",gdk_atom_name(selection_data->selection));
-       sinfgapp::Action::PassiveGrouper passive_grouper(canvas_interface()->get_instance().get(),_("Move Layers"));
+       //synfig::info("Dropped data of type \"%s\"",selection_data.get_data_type());
+       //synfig::info("Dropped data of target \"%s\"",gdk_atom_name(selection_data->target));
+       //synfig::info("Dropped selection=\"%s\"",gdk_atom_name(selection_data->selection));
+       synfigapp::Action::PassiveGrouper passive_grouper(canvas_interface()->get_instance().get(),_("Move Layers"));
        
        // Save the selection data
-       sinfgapp::SelectionManager::LayerList selected_layer_list=canvas_interface()->get_selection_manager()->get_selected_layers();
+       synfigapp::SelectionManager::LayerList selected_layer_list=canvas_interface()->get_selection_manager()->get_selected_layers();
 
        if ((selection_data.get_length() >= 0) && (selection_data.get_format() == 8))
        {
@@ -510,9 +510,9 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk
                
                Layer::Handle dest_layer(row[model.layer]);
 
-               if(sinfg::String(selection_data.get_data_type())=="LAYER")for(unsigned int i=0;i<selection_data.get_length()/sizeof(void*);i++)
+               if(synfig::String(selection_data.get_data_type())=="LAYER")for(unsigned int i=0;i<selection_data.get_length()/sizeof(void*);i++)
                {
-                       //sinfg::info("dest_layer_depth=%d",dest_layer_depth);
+                       //synfig::info("dest_layer_depth=%d",dest_layer_depth);
                        
                        Layer::Handle src(reinterpret_cast<Layer**>(const_cast<guint8*>(selection_data.get_data()))[i]);
                        assert(src);
@@ -532,7 +532,7 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk
                                if(dest_canvas==src->get_canvas() && dest_layer_depth==src->get_depth())
                                        continue;
                                
-                               sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_move"));
+                               synfigapp::Action::Handle action(synfigapp::Action::create("layer_move"));
                                action->set_param("canvas",dest_canvas);
                                action->set_param("canvas_interface",canvas_interface());
                                action->set_param("layer",src);
@@ -554,8 +554,8 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk
                        /*else // In this case we need to remove and then add
                        {                               
                                
-                               sinfgapp::Action::Handle action;
-                               action=sinfgapp::Action::create("layer_remove");
+                               synfigapp::Action::Handle action;
+                               action=synfigapp::Action::create("layer_remove");
                                action->set_param("canvas",Canvas::Handle(src->get_canvas()));
                                if(!action->set_param("canvas_interface",App::get_instance(src->get_canvas())->find_canvas_interface(src->get_canvas())))
                                        action->set_param("canvas_interface",canvas_interface());
@@ -567,7 +567,7 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk
                                        return false;
                                }
 
-                               action=sinfgapp::Action::create("layer_add");
+                               action=synfigapp::Action::create("layer_add");
                                action->set_param("canvas",dest_canvas);
                                action->set_param("canvas_interface",canvas_interface());
                                action->set_param("new",src);
@@ -580,7 +580,7 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk
 
                                if(dest_layer_depth!=0)
                                {
-                                       action=sinfgapp::Action::create("layer_move");
+                                       action=synfigapp::Action::create("layer_move");
                                        action->set_param("canvas",dest_canvas);
                                        action->set_param("canvas_interface",canvas_interface());
                                        action->set_param("layer",src);
@@ -597,7 +597,7 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk
                        */
                }
        }
-       sinfg::info("I suposidly moved %d layers",i);
+       synfig::info("I suposidly moved %d layers",i);
 
        // Reselect the previously selected layers
        canvas_interface()->get_selection_manager()->set_selected_layers(selected_layer_list);
@@ -616,9 +616,9 @@ LayerTreeStore::rebuild()
 {
        //etl::clock timer;timer.reset();
 
-       //sinfg::warning("---------rebuilding layer table---------");
+       //synfig::warning("---------rebuilding layer table---------");
        // Save the selection data
-       sinfgapp::SelectionManager::LayerList layer_list=canvas_interface()->get_selection_manager()->get_selected_layers();
+       synfigapp::SelectionManager::LayerList layer_list=canvas_interface()->get_selection_manager()->get_selected_layers();
 
        // Clear out the current list
        clear();
@@ -633,7 +633,7 @@ LayerTreeStore::rebuild()
        if(!layer_list.empty())
                canvas_interface()->get_selection_manager()->set_selected_layers(layer_list);
 
-       //sinfg::info("LayerTreeStore::rebuild() took %f seconds",float(timer()));
+       //synfig::info("LayerTreeStore::rebuild() took %f seconds",float(timer()));
 }
 
 void
@@ -651,7 +651,7 @@ LayerTreeStore::refresh()
                        Gtk::TreeRow row=*iter;
                        refresh_row(row);
                }
-       //sinfg::info("LayerTreeStore::refresh() took %f seconds",float(timer()));
+       //synfig::info("LayerTreeStore::refresh() took %f seconds",float(timer()));
 }
 
 void
@@ -691,7 +691,7 @@ LayerTreeStore::refresh_row(Gtk::TreeModel::Row &row)
 
 
 void
-LayerTreeStore::set_row_layer(Gtk::TreeRow &row,sinfg::Layer::Handle &handle)
+LayerTreeStore::set_row_layer(Gtk::TreeRow &row,synfig::Layer::Handle &handle)
 {
        //row[model.id] = handle->get_name();
        //row[model.name] = handle->get_local_name();   
@@ -711,10 +711,10 @@ LayerTreeStore::set_row_layer(Gtk::TreeRow &row,sinfg::Layer::Handle &handle)
        //row[model.canvas] = handle->get_canvas();
        //row[model.icon] = layer_icon; 
 
-       sinfg::Layer::ParamList paramlist=handle->get_param_list();
+       synfig::Layer::ParamList paramlist=handle->get_param_list();
 
-       sinfg::Layer::Vocab vocab=handle->get_param_vocab();
-       sinfg::Layer::Vocab::iterator iter;
+       synfig::Layer::Vocab vocab=handle->get_param_vocab();
+       synfig::Layer::Vocab::iterator iter;
        
        for(iter=vocab.begin();iter!=vocab.end();++iter)
        {
@@ -761,7 +761,7 @@ LayerTreeStore::set_row_layer(Gtk::TreeRow &row,sinfg::Layer::Handle &handle)
 }
 
 void
-LayerTreeStore::on_layer_added(sinfg::Layer::Handle layer)
+LayerTreeStore::on_layer_added(synfig::Layer::Handle layer)
 {
        assert(layer);
        Gtk::TreeRow row;
@@ -783,20 +783,20 @@ LayerTreeStore::on_layer_added(sinfg::Layer::Handle layer)
 }
 
 void
-LayerTreeStore::on_layer_removed(sinfg::Layer::Handle handle)
+LayerTreeStore::on_layer_removed(synfig::Layer::Handle handle)
 {
        Gtk::TreeModel::Children::iterator iter;
        if(find_layer_row(handle,iter))
                erase(iter);
        else
        {
-               sinfg::error("LayerTreeStore::on_layer_removed():Unable to find layer to be removed, forced to rebuild...");
+               synfig::error("LayerTreeStore::on_layer_removed():Unable to find layer to be removed, forced to rebuild...");
                rebuild();
        }
 }
 
 void
-LayerTreeStore::on_layer_inserted(sinfg::Layer::Handle handle,int depth)
+LayerTreeStore::on_layer_inserted(synfig::Layer::Handle handle,int depth)
 {              
        if(depth==0)
        {
@@ -811,7 +811,7 @@ LayerTreeStore::on_layer_inserted(sinfg::Layer::Handle handle,int depth)
                Gtk::TreeModel::Children::iterator iter;
                if(!find_canvas_row(handle->get_canvas(),iter))
                {
-                       sinfg::error("LayerTreeStore::on_layer_inserted():Unable to find canvas row, forced to rebuild...");
+                       synfig::error("LayerTreeStore::on_layer_inserted():Unable to find canvas row, forced to rebuild...");
                        rebuild();
                        return;
                }
@@ -824,7 +824,7 @@ LayerTreeStore::on_layer_inserted(sinfg::Layer::Handle handle,int depth)
                ++iter;
                if(!iter || iter==children_.end())
                {
-                       sinfg::error("LayerTreeStore::on_layer_inserted():Unable to achieve desired depth, forced to rebuild...");
+                       synfig::error("LayerTreeStore::on_layer_inserted():Unable to achieve desired depth, forced to rebuild...");
                        rebuild();
                        return;
                }
@@ -836,26 +836,26 @@ LayerTreeStore::on_layer_inserted(sinfg::Layer::Handle handle,int depth)
 }
 
 void
-LayerTreeStore::on_layer_status_changed(sinfg::Layer::Handle handle,bool x)
+LayerTreeStore::on_layer_status_changed(synfig::Layer::Handle handle,bool x)
 {
        Gtk::TreeModel::Children::iterator iter;
        if(find_layer_row(handle,iter))
                (*iter)[model.layer]=handle;
        else
        {
-               sinfg::warning("Couldn't find layer to be activated in layer list. Rebuilding index...");
+               synfig::warning("Couldn't find layer to be activated in layer list. Rebuilding index...");
                rebuild();
        }
 }
 
 void
-LayerTreeStore::on_layer_lowered(sinfg::Layer::Handle layer)
+LayerTreeStore::on_layer_lowered(synfig::Layer::Handle layer)
 {      
        Gtk::TreeModel::Children::iterator iter, iter2;
        if(find_layer_row(layer,iter))
        {
                // Save the selection data
-               //sinfgapp::SelectionManager::LayerList layer_list=canvas_interface()->get_selection_manager()->get_selected_layers();
+               //synfigapp::SelectionManager::LayerList layer_list=canvas_interface()->get_selection_manager()->get_selected_layers();
                iter2=iter;
                iter2++;
                if(!iter2)
@@ -866,7 +866,7 @@ LayerTreeStore::on_layer_lowered(sinfg::Layer::Handle layer)
                
                //Gtk::TreeModel::Row row(*iter);
                Gtk::TreeModel::Row row2 = *iter2;
-               sinfg::Layer::Handle layer2=row2[model.layer];
+               synfig::Layer::Handle layer2=row2[model.layer];
                
                erase(iter2);
                row2=*insert(iter);
@@ -878,7 +878,7 @@ LayerTreeStore::on_layer_lowered(sinfg::Layer::Handle layer)
 }
 
 void
-LayerTreeStore::on_layer_raised(sinfg::Layer::Handle layer)
+LayerTreeStore::on_layer_raised(synfig::Layer::Handle layer)
 {
        Gtk::TreeModel::Children::iterator iter, iter2;
 
@@ -890,7 +890,7 @@ LayerTreeStore::on_layer_raised(sinfg::Layer::Handle layer)
                {       
                        //Gtk::TreeModel::Row row = *iter;
                        Gtk::TreeModel::Row row2 = *iter2;
-                       sinfg::Layer::Handle layer2=row2[model.layer];
+                       synfig::Layer::Handle layer2=row2[model.layer];
                
                        erase(iter2);
                        iter++;
@@ -905,14 +905,14 @@ LayerTreeStore::on_layer_raised(sinfg::Layer::Handle layer)
 }
 
 void
-LayerTreeStore::on_layer_moved(sinfg::Layer::Handle layer,int depth, sinfg::Canvas::Handle canvas)
+LayerTreeStore::on_layer_moved(synfig::Layer::Handle layer,int depth, synfig::Canvas::Handle canvas)
 {
        on_layer_removed(layer);
        on_layer_inserted(layer,depth);
 }
 
 void
-LayerTreeStore::on_layer_param_changed(sinfg::Layer::Handle handle,sinfg::String param_name)
+LayerTreeStore::on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name)
 {
        if(param_name=="z_depth")
        {
@@ -948,7 +948,7 @@ LayerTreeStore::on_layer_param_changed(sinfg::Layer::Handle handle,sinfg::String
 }
 
 void
-LayerTreeStore::on_layer_new_description(sinfg::Layer::Handle handle,sinfg::String desc)
+LayerTreeStore::on_layer_new_description(synfig::Layer::Handle handle,synfig::String desc)
 {
        Gtk::TreeModel::Children::iterator iter;
        if(find_layer_row(handle,iter))
@@ -973,7 +973,7 @@ LayerTreeStore::on_layer_new_description(sinfg::Layer::Handle handle,sinfg::Stri
 }
 
 bool
-LayerTreeStore::find_canvas_row_(sinfg::Canvas::Handle canvas, sinfg::Canvas::Handle parent, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter)
+LayerTreeStore::find_canvas_row_(synfig::Canvas::Handle canvas, synfig::Canvas::Handle parent, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter)
 {      
        if(canvas==parent)
                return false;
@@ -982,7 +982,7 @@ LayerTreeStore::find_canvas_row_(sinfg::Canvas::Handle canvas, sinfg::Canvas::Ha
                for(iter=layers.begin(); iter && iter != layers.end(); ++iter)
                {
                        Gtk::TreeModel::Row row = *iter;
-                       if(canvas==(sinfg::Canvas::Handle)row[model.contained_canvas])
+                       if(canvas==(synfig::Canvas::Handle)row[model.contained_canvas])
                                return true;
                }
                
@@ -1014,14 +1014,14 @@ LayerTreeStore::find_canvas_row_(sinfg::Canvas::Handle canvas, sinfg::Canvas::Ha
 }
 
 bool
-LayerTreeStore::find_canvas_row(sinfg::Canvas::Handle canvas, Gtk::TreeModel::Children::iterator &iter)
+LayerTreeStore::find_canvas_row(synfig::Canvas::Handle canvas, Gtk::TreeModel::Children::iterator &iter)
 {
        return find_canvas_row_(canvas,canvas_interface()->get_canvas(),children(),iter);
 }
 
 
 bool
-LayerTreeStore::find_layer_row_(const sinfg::Layer::Handle &layer, sinfg::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev)
+LayerTreeStore::find_layer_row_(const synfig::Layer::Handle &layer, synfig::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev)
 {
        assert(layer);
        
@@ -1030,7 +1030,7 @@ LayerTreeStore::find_layer_row_(const sinfg::Layer::Handle &layer, sinfg::Canvas
                for(iter=prev=layers.begin(); iter && iter != layers.end(); prev=iter++)
                {
                        Gtk::TreeModel::Row row = *iter;
-                       if(layer==(sinfg::Layer::Handle)row[model.layer])
+                       if(layer==(synfig::Layer::Handle)row[model.layer])
                                return true;
                }
                
@@ -1062,14 +1062,14 @@ LayerTreeStore::find_layer_row_(const sinfg::Layer::Handle &layer, sinfg::Canvas
 }
 
 bool
-LayerTreeStore::find_layer_row(const sinfg::Layer::Handle &layer, Gtk::TreeModel::Children::iterator &iter)
+LayerTreeStore::find_layer_row(const synfig::Layer::Handle &layer, Gtk::TreeModel::Children::iterator &iter)
 {
        Gtk::TreeModel::Children::iterator prev;
        return find_layer_row_(layer,canvas_interface()->get_canvas(),children(),iter,prev);
 }
 
 bool
-LayerTreeStore::find_prev_layer_row(const sinfg::Layer::Handle &layer, Gtk::TreeModel::Children::iterator &prev)
+LayerTreeStore::find_prev_layer_row(const synfig::Layer::Handle &layer, Gtk::TreeModel::Children::iterator &prev)
 {
        Gtk::TreeModel::Children::iterator iter;
        if(!find_layer_row_(layer,canvas_interface()->get_canvas(),children(),iter,prev))
index 555caf1..d1394a5 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layertreestore.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_LAYERTREESTORE_H
-#define __SINFG_STUDIO_LAYERTREESTORE_H
+#ifndef __SYNFIG_STUDIO_LAYERTREESTORE_H
+#define __SYNFIG_STUDIO_LAYERTREESTORE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/value.h>
-#include <sinfg/valuenode.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfig/value.h>
+#include <synfig/valuenode.h>
 #include <gtkmm/treeview.h>
 
 /* === M A C R O S ========================================================= */
@@ -56,14 +56,14 @@ public:
                Gtk::TreeModelColumn<Glib::ustring> name;
                Gtk::TreeModelColumn<Glib::ustring> id;
 
-               Gtk::TreeModelColumn<sinfg::Canvas::Handle> canvas;
+               Gtk::TreeModelColumn<synfig::Canvas::Handle> canvas;
 
                Gtk::TreeModelColumn<Glib::ustring> tooltip;
 
 
                Gtk::TreeModelColumn<bool>                                              active;
-               Gtk::TreeModelColumn<sinfg::Layer::Handle>              layer;
-               Gtk::TreeModelColumn<sinfg::Canvas::Handle>                     contained_canvas;
+               Gtk::TreeModelColumn<synfig::Layer::Handle>             layer;
+               Gtk::TreeModelColumn<synfig::Canvas::Handle>                    contained_canvas;
 
                Gtk::TreeModelColumn<bool>                                              children_lock;
 
@@ -102,7 +102,7 @@ public:
 
 private:
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
 
        Glib::RefPtr<Gdk::Pixbuf> layer_icon;
 
@@ -135,35 +135,35 @@ private:
 
        bool on_layer_tree_event(GdkEvent *event);
 
-       void on_layer_new_description(sinfg::Layer::Handle handle,sinfg::String desc);
+       void on_layer_new_description(synfig::Layer::Handle handle,synfig::String desc);
 
-       void on_layer_added(sinfg::Layer::Handle handle);
+       void on_layer_added(synfig::Layer::Handle handle);
 
-       void on_layer_removed(sinfg::Layer::Handle handle);
+       void on_layer_removed(synfig::Layer::Handle handle);
 
-       void on_layer_inserted(sinfg::Layer::Handle handle,int depth);
+       void on_layer_inserted(synfig::Layer::Handle handle,int depth);
 
-       void on_layer_moved(sinfg::Layer::Handle handle,int depth, sinfg::Canvas::Handle canvas);
+       void on_layer_moved(synfig::Layer::Handle handle,int depth, synfig::Canvas::Handle canvas);
 
-       void on_layer_status_changed(sinfg::Layer::Handle handle,bool);
+       void on_layer_status_changed(synfig::Layer::Handle handle,bool);
 
-       void on_layer_lowered(sinfg::Layer::Handle handle);
+       void on_layer_lowered(synfig::Layer::Handle handle);
 
-       void on_layer_raised(sinfg::Layer::Handle handle);
+       void on_layer_raised(synfig::Layer::Handle handle);
 
-       void on_layer_param_changed(sinfg::Layer::Handle handle,sinfg::String param_name);
+       void on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name);
 
-       //void on_value_node_added(sinfg::ValueNode::Handle value_node);
+       //void on_value_node_added(synfig::ValueNode::Handle value_node);
 
-       //void on_value_node_deleted(sinfg::ValueNode::Handle value_node);
+       //void on_value_node_deleted(synfig::ValueNode::Handle value_node);
 
-       //void on_value_node_changed(sinfg::ValueNode::Handle value_node);
+       //void on_value_node_changed(synfig::ValueNode::Handle value_node);
 
-       //void on_value_node_replaced(sinfg::ValueNode::Handle replaced_value_node,sinfg::ValueNode::Handle new_value_node);
+       //void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
 
-       bool find_layer_row_(const sinfg::Layer::Handle &handle, sinfg::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev);
+       bool find_layer_row_(const synfig::Layer::Handle &handle, synfig::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev);
 
-       bool find_canvas_row_(sinfg::Canvas::Handle canvas, sinfg::Canvas::Handle parent, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter);
+       bool find_canvas_row_(synfig::Canvas::Handle canvas, synfig::Canvas::Handle parent, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter);
 
        /*
  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
@@ -171,18 +171,18 @@ private:
 
 public:
        
-       LayerTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       LayerTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
        ~LayerTreeStore();
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
-       etl::loose_handle<const sinfgapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
-       etl::loose_handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
+       etl::loose_handle<const synfigapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
+       etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
 
-       bool find_canvas_row(sinfg::Canvas::Handle canvas, Gtk::TreeModel::Children::iterator &iter);
+       bool find_canvas_row(synfig::Canvas::Handle canvas, Gtk::TreeModel::Children::iterator &iter);
 
-       bool find_layer_row(const sinfg::Layer::Handle &handle, Gtk::TreeModel::Children::iterator &iter);
+       bool find_layer_row(const synfig::Layer::Handle &handle, Gtk::TreeModel::Children::iterator &iter);
 
-       bool find_prev_layer_row(const sinfg::Layer::Handle &handle, Gtk::TreeModel::Children::iterator &iter);
+       bool find_prev_layer_row(const synfig::Layer::Handle &handle, Gtk::TreeModel::Children::iterator &iter);
 
        void rebuild();
 
@@ -190,14 +190,14 @@ public:
 
        void refresh_row(Gtk::TreeModel::Row &row);
 
-       void set_row_layer(Gtk::TreeRow &row,sinfg::Layer::Handle &handle);
+       void set_row_layer(Gtk::TreeRow &row,synfig::Layer::Handle &handle);
 
        static int z_sorter(const Gtk::TreeModel::iterator &rhs,const Gtk::TreeModel::iterator &lhs);
        static int index_sorter(const Gtk::TreeModel::iterator &rhs,const Gtk::TreeModel::iterator &lhs);
 
-       //void set_row_param(Gtk::TreeRow &row,sinfg::Layer::Handle &handle,const std::string& name, const std::string& local_name, const sinfg::ValueBase &value, etl::handle<sinfg::ValueNode> value_node,sinfg::ParamDesc *param_desc);
+       //void set_row_param(Gtk::TreeRow &row,synfig::Layer::Handle &handle,const std::string& name, const std::string& local_name, const synfig::ValueBase &value, etl::handle<synfig::ValueNode> value_node,synfig::ParamDesc *param_desc);
 
-       //virtual void set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc);
+       //virtual void set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc);
        static bool search_func(const Glib::RefPtr<TreeModel>&,int,const Glib::ustring&,const TreeModel::iterator&);
 
        /*
@@ -206,7 +206,7 @@ public:
 
 public:
        
-       static Glib::RefPtr<LayerTreeStore> create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_);
+       static Glib::RefPtr<LayerTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_);
 
 
 }; // END of class LayerTreeStore
index c7a312c..6a77699 100644 (file)
@@ -1,6 +1,6 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file main.cpp
-**     \brief Sinfg Studio Entrypoint
+**     \brief Synfig Studio Entrypoint
 **
 **     $Id: main.cpp,v 1.2 2005/01/13 18:37:30 darco Exp $
 **
@@ -39,7 +39,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
 
                app.run();
        }
-       catch(sinfg::SoftwareExpired)
+       catch(synfig::SoftwareExpired)
        {
                cerr<<"FATAL: Software Expired"<<endl;
                return 39;
index 3f737ea..6f46e48 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file metadatatreestore.cpp
 **     \brief Template File
 **
@@ -29,7 +29,7 @@
 #endif
 
 #include "metadatatreestore.h"
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 
 #endif
 
@@ -37,7 +37,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -55,7 +55,7 @@ static MetaDataTreeStore::Model& ModelHack()
        return *model;
 }
 
-MetaDataTreeStore::MetaDataTreeStore(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_):
+MetaDataTreeStore::MetaDataTreeStore(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_):
        Gtk::TreeStore  (ModelHack()),
        canvas_interface_               (canvas_interface_)
 {
@@ -67,18 +67,18 @@ MetaDataTreeStore::MetaDataTreeStore(etl::loose_handle<sinfgapp::CanvasInterface
 
 MetaDataTreeStore::~MetaDataTreeStore()
 {
-       sinfg::info("MetaDataTreeStore::~MetaDataTreeStore(): Deleted");
+       synfig::info("MetaDataTreeStore::~MetaDataTreeStore(): Deleted");
 
 }
 
 Glib::RefPtr<MetaDataTreeStore>
-MetaDataTreeStore::create(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_)
+MetaDataTreeStore::create(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_)
 {
        return Glib::RefPtr<MetaDataTreeStore>(new MetaDataTreeStore(canvas_interface_));
 }
 
 void
-MetaDataTreeStore::meta_data_changed(sinfg::String key)
+MetaDataTreeStore::meta_data_changed(synfig::String key)
 {
        rebuild();
 }
@@ -108,7 +108,7 @@ MetaDataTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int co
 
        if(column==model.data.index())
        {
-               sinfg::String key((Glib::ustring)(*iter)[model.key]);
+               synfig::String key((Glib::ustring)(*iter)[model.key]);
                g_value_init(value.gobj(),G_TYPE_STRING);
                g_value_set_string(value.gobj(),get_canvas()->get_meta_data(key).c_str());
                return;
@@ -138,8 +138,8 @@ MetaDataTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int colu
                g_value_init(x.gobj(),model.data.type());
                g_value_copy(value.gobj(),x.gobj());
                
-               sinfg::String key((Glib::ustring)(*iter)[model.key]);
-               sinfg::String new_data(x.get());
+               synfig::String key((Glib::ustring)(*iter)[model.key]);
+               synfig::String new_data(x.get());
                
                get_canvas_interface()->set_meta_data(key,new_data);
        }
index f783d3d..7d79c1c 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file metadatatreestore.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_METADATATREESTORE_H
-#define __SINFG_STUDIO_METADATATREESTORE_H
+#ifndef __SYNFIG_STUDIO_METADATATREESTORE_H
+#define __SYNFIG_STUDIO_METADATATREESTORE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/treestore.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 #include <gdkmm/pixbuf.h>
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -37,7 +37,7 @@
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfgapp { class CanvasInterface; }
+namespace synfigapp { class CanvasInterface; }
 
 namespace studio {
        
@@ -77,7 +77,7 @@ public:
 
 private:
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
 
        /*
  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
@@ -91,7 +91,7 @@ private:
 
 private:
 
-       void meta_data_changed(sinfg::String key);
+       void meta_data_changed(synfig::String key);
 
        /*
  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
@@ -101,10 +101,10 @@ public:
        
        ~MetaDataTreeStore();
 
-       etl::loose_handle<sinfgapp::CanvasInterface> get_canvas_interface() { return canvas_interface_; }
-       etl::loose_handle<const sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
-       sinfg::Canvas::Handle get_canvas()const { return canvas_interface_->get_canvas(); }
-       sinfg::Canvas::Handle get_canvas() { return canvas_interface_->get_canvas(); }
+       etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface() { return canvas_interface_; }
+       etl::loose_handle<const synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+       synfig::Canvas::Handle get_canvas()const { return canvas_interface_->get_canvas(); }
+       synfig::Canvas::Handle get_canvas() { return canvas_interface_->get_canvas(); }
 
        void rebuild();
 
@@ -115,13 +115,13 @@ public:
        */
 
 protected:
-       MetaDataTreeStore(etl::loose_handle<sinfgapp::CanvasInterface>);
+       MetaDataTreeStore(etl::loose_handle<synfigapp::CanvasInterface>);
        void get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
        void set_value_impl(const Gtk::TreeModel::iterator& iter, int column, const Glib::ValueBase& value);
 
 public:
 
-       static Glib::RefPtr<MetaDataTreeStore> create(etl::loose_handle<sinfgapp::CanvasInterface>);
+       static Glib::RefPtr<MetaDataTreeStore> create(etl::loose_handle<synfigapp::CanvasInterface>);
        
 }; // END of class MetaDataTreeStore
 
index 7d9042c..e1e4fea 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file mod_mirror.cpp
 **     \brief Template File
 **
@@ -40,7 +40,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
index f9bebfe..c5b8176 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file mod_mirror.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_MOD_MIRROR_H
-#define __SINFG_MOD_MIRROR_H
+#ifndef __SYNFIG_MOD_MIRROR_H
+#define __SYNFIG_MOD_MIRROR_H
 
 /* === H E A D E R S ======================================================= */
 
index 3d709f4..c5a67c2 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_mirror.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_mirror.h"
 #include "../canvasview.h"
 #include "../workarea.h"
 #include "../app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "../event_mouse.h"
 #include "../event_layerclick.h"
 #include "../toolbox.h"
 #include "../dialog_tooloptions.h"
 #include <gtkmm/optionmenu.h>
 #include "../duck.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -54,7 +54,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -72,18 +72,18 @@ StateMirror studio::state_mirror;
 
 class DuckDrag_Mirror : public DuckDrag_Base
 {
-       sinfg::Vector center;
+       synfig::Vector center;
 
-       std::vector<sinfg::Vector> positions;
+       std::vector<synfig::Vector> positions;
        
        
 public:
        Axis axis;
 
        DuckDrag_Mirror();
-       void begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& begin);
+       void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
        bool end_duck_drag(Duckmatic* duckmatic);
-       void duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector);
+       void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
 };
 
 
@@ -91,7 +91,7 @@ class studio::StateMirror_Context : public sigc::trackable
 {
        etl::handle<CanvasView> canvas_view_;
                
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
 
        etl::handle<DuckDrag_Mirror> duck_dragger_;
 
@@ -139,8 +139,8 @@ public:
        ~StateMirror_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        void load_settings();
@@ -176,7 +176,7 @@ StateMirror_Context::save_settings()
 
 StateMirror_Context::StateMirror_Context(CanvasView* canvas_view):
        canvas_view_(canvas_view),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        duck_dragger_(new DuckDrag_Mirror()),
        checkbutton_axis_x(_("Horizontal")),
        checkbutton_axis_y(_("Vertical"))
@@ -246,7 +246,7 @@ DuckDrag_Mirror::DuckDrag_Mirror():
 #endif
 
 void
-DuckDrag_Mirror::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offset)
+DuckDrag_Mirror::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
 {
 
 
@@ -265,7 +265,7 @@ DuckDrag_Mirror::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offs
 
 
 void
-DuckDrag_Mirror::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)
+DuckDrag_Mirror::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
 {
        center=vector;
        int i;
index 424d298..9e80919 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_mirror.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_MIRROR_H
-#define __SINFG_STUDIO_STATE_MIRROR_H
+#ifndef __SYNFIG_STUDIO_STATE_MIRROR_H
+#define __SYNFIG_STUDIO_STATE_MIRROR_H
 
 /* === H E A D E R S ======================================================= */
 
index ee5b11b..2be6b27 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_palette.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
index b5736a3..5464597 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_palette.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_PAL_BROWSE_H
-#define __SINFG_STUDIO_DOCK_PAL_BROWSE_H
+#ifndef __SYNFIG_STUDIO_DOCK_PAL_BROWSE_H
+#define __SYNFIG_STUDIO_DOCK_PAL_BROWSE_H
 
 /* === H E A D E R S ======================================================= */
 
 #include "../dockable.h"
-#include <sinfg/palette.h>
+#include <synfig/palette.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -35,7 +35,7 @@
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfgapp {
+namespace synfigapp {
 class CanvasInterface;
 };
 
index 6b5e0a0..a7167db 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_palette.cpp
 **     \brief Template File
 **
 #include <gtkmm/frame.h>
 #include <gtkmm/table.h>
 #include <gtkmm/label.h>
-#include <sinfg/general.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/value_desc.h>
+#include <synfig/general.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/value_desc.h>
 #include "../widget_color.h"
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/menu.h>
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 #include "../app.h"
 #include "../dialog_color.h"
 
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
 
 /* === G L O B A L S ======================================================= */
 /*
-class studio::PaletteSettings : public sinfgapp::Settings
+class studio::PaletteSettings : public synfigapp::Settings
 {
        Dock_PalEdit* dialog_palette;
-       sinfg::String name;
+       synfig::String name;
 public:
-       PaletteSettings(Dock_PalEdit* window,const sinfg::String& name):
+       PaletteSettings(Dock_PalEdit* window,const synfig::String& name):
                dialog_palette(window),
                name(name)
        {
@@ -73,7 +73,7 @@ public:
                dialog_palette->dialog_settings.remove_domain(name);
        }
 
-       virtual bool get_value(const sinfg::String& key, sinfg::String& value)const
+       virtual bool get_value(const synfig::String& key, synfig::String& value)const
        {
                int i(atoi(key.c_str()));
                if(i<0 || i>=dialog_palette->size())
@@ -83,7 +83,7 @@ public:
                return true;
        }
        
-       virtual bool set_value(const sinfg::String& key,const sinfg::String& value)
+       virtual bool set_value(const synfig::String& key,const synfig::String& value)
        {
                int i(atoi(key.c_str()));
                if(i<0)
@@ -99,7 +99,7 @@ public:
        
        virtual KeyList get_key_list()const
        {
-               sinfgapp::Settings::KeyList ret(sinfgapp::Settings::get_key_list());
+               synfigapp::Settings::KeyList ret(synfigapp::Settings::get_key_list());
        
                int i;
                for(i=0;i<dialog_palette->size();i++)
@@ -171,7 +171,7 @@ Dock_PalEdit::~Dock_PalEdit()
 }
 
 void
-Dock_PalEdit::set_palette(const sinfg::Palette& x)
+Dock_PalEdit::set_palette(const synfig::Palette& x)
 {
        palette_=x;
        refresh();
@@ -180,7 +180,7 @@ Dock_PalEdit::set_palette(const sinfg::Palette& x)
 void
 Dock_PalEdit::on_add_pressed()
 {
-       add_color(sinfgapp::Main::get_foreground_color());
+       add_color(synfigapp::Main::get_foreground_color());
 }
 
 void
@@ -212,7 +212,7 @@ Dock_PalEdit::show_menu(int i)
 }
 
 int
-Dock_PalEdit::add_color(const sinfg::Color& x)
+Dock_PalEdit::add_color(const synfig::Color& x)
 {
        palette_.push_back(x);
        signal_changed()();
@@ -221,7 +221,7 @@ Dock_PalEdit::add_color(const sinfg::Color& x)
 }
 
 void
-Dock_PalEdit::set_color(sinfg::Color x, int i)
+Dock_PalEdit::set_color(synfig::Color x, int i)
 {
        palette_[i].color=x;
        signal_changed()();
@@ -292,7 +292,7 @@ Dock_PalEdit::edit_color(int i)
 void
 Dock_PalEdit::select_color(int i)
 {
-       sinfgapp::Main::set_foreground_color(get_color(i));
+       synfigapp::Main::set_foreground_color(get_color(i));
 }
                
 void
index 9ae505a..779cfd9 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_palette.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_DOCK_PAL_EDIT_H
-#define __SINFG_STUDIO_DOCK_PAL_EDIT_H
+#ifndef __SYNFIG_STUDIO_DOCK_PAL_EDIT_H
+#define __SYNFIG_STUDIO_DOCK_PAL_EDIT_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/optionmenu.h>
 #include <gtkmm/checkbutton.h>
 
-#include <sinfg/gamma.h>
-#include <sinfg/time.h>
+#include <synfig/gamma.h>
+#include <synfig/time.h>
 
 #include "../widget_coloredit.h"
 
-#include <sinfgapp/value_desc.h>
-#include <sinfg/time.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/time.h>
 
 #include "../dockable.h"
 #include <vector>
 #include <gtkmm/actiongroup.h>
 
-#include <sinfg/palette.h>
+#include <synfig/palette.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -55,7 +55,7 @@
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfgapp {
+namespace synfigapp {
 class CanvasInterface;
 };
 
@@ -70,7 +70,7 @@ class Dock_PalEdit : public Dockable
 
        Glib::RefPtr<Gtk::ActionGroup> action_group;
 
-       sinfg::Palette palette_;
+       synfig::Palette palette_;
        
        Gtk::Table table;
        
@@ -82,16 +82,16 @@ class Dock_PalEdit : public Dockable
 
 
 private:
-       int add_color(const sinfg::Color& x);
-       void set_color(sinfg::Color x, int i);
+       int add_color(const synfig::Color& x);
+       void set_color(synfig::Color x, int i);
        void erase_color(int i);
 
        void select_color(int i);
-       sinfg::Color get_color(int i)const;
+       synfig::Color get_color(int i)const;
        void edit_color(int i);
 public:
-       void set_palette(const sinfg::Palette& x);
-       const sinfg::Palette& get_palette()const { return palette_; }
+       void set_palette(const synfig::Palette& x);
+       const synfig::Palette& get_palette()const { return palette_; }
 
        int size()const;
 
index fbb509c..f26927a 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file mod_palette.cpp
 **     \brief Template File
 **
@@ -41,7 +41,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
index 7be196c..2580df6 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file mod_palette.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_MOD_PALETTE_H
-#define __SINFG_MOD_PALETTE_H
+#ifndef __SYNFIG_MOD_PALETTE_H
+#define __SYNFIG_MOD_PALETTE_H
 
 /* === H E A D E R S ======================================================= */
 
index 8902303..b3325cf 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -36,7 +36,7 @@
 
 using namespace std;
 using namespace etl;
-//using namespace sinfg;
+//using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
index 77d5de3..92be86f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file module.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_MODULE_H
-#define __SINFG_MODULE_H
+#ifndef __SYNFIG_MODULE_H
+#define __SYNFIG_MODULE_H
 
 /* === H E A D E R S ======================================================= */
 
index c1d245f..88f0a7f 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template File
 ** $Id: onemoment.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
 **
@@ -38,7 +38,7 @@
 #include <gtkmm/label.h>
 #include <gtkmm/fixed.h>
 
-#include <sinfg/general.h>
+#include <synfig/general.h>
 
 #include "onemoment.h"
 #include "app.h"
@@ -53,7 +53,7 @@ using namespace studio;
 
 #ifndef VERSION
 #define VERSION        "unknown"
-#define PACKAGE        "sinfgstudio"
+#define PACKAGE        "synfigstudio"
 #endif
 
 #ifdef WIN32
index 2fbf2d8..33e15e0 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template Header File
 ** $Id: onemoment.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
 **
@@ -20,8 +20,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_ONEMOMENT_H
-#define __SINFG_GTKMM_ONEMOMENT_H
+#ifndef __SYNFIG_GTKMM_ONEMOMENT_H
+#define __SYNFIG_GTKMM_ONEMOMENT_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -33,7 +33,7 @@
 
 /* === C L A S S E S & S T R U C T S ======================================= */
 
-namespace sinfg { class ProgressCallback; };
+namespace synfig { class ProgressCallback; };
 
 namespace studio {
 
index 944a111..23d3d23 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file preview.cpp
 **     \brief Preview implementation file
 **
@@ -34,8 +34,8 @@
 #include <gtkmm/stock.h>
 #include <gtkmm/separator.h>
 
-#include <sinfg/target_scanline.h>
-#include <sinfg/surface.h>
+#include <synfig/target_scanline.h>
+#include <synfig/surface.h>
 
 #include <algorithm>
 #include "asyncrenderer.h"
@@ -45,7 +45,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -86,7 +86,7 @@ public:
        {
                if(Target_Scanline::set_rend_desc(r))
                {
-                       /*sinfg::warning("Succeeded in setting the desc to new one: %d x %d, %.2f fps [%.2f,%.2f]",
+                       /*synfig::warning("Succeeded in setting the desc to new one: %d x %d, %.2f fps [%.2f,%.2f]",
                                                        desc.get_w(),desc.get_h(),desc.get_frame_rate(),
                                        (float)desc.get_time_start(),(float)desc.get_time_end());*/
                        
@@ -113,7 +113,7 @@ public:
                //ok... notify our subscribers...
                signal_frame_done_(this);
                curframe += 1;
-               //sinfg::warning("Finished the frame stuff, and changed time to %.3f",t);
+               //synfig::warning("Finished the frame stuff, and changed time to %.3f",t);
        }
        
        virtual Color * start_scanline(int scanline)
@@ -172,11 +172,11 @@ void studio::Preview::render()
                etl::handle<Preview_Target>     target = new Preview_Target;
                
                //connect our information to his...
-               //sinfg::warning("Connecting to the end frame function...");
+               //synfig::warning("Connecting to the end frame function...");
                target->signal_frame_done().connect(sigc::mem_fun(*this,&Preview::frame_finish));
                
                //set the options
-               //sinfg::warning("Setting Canvas");
+               //synfig::warning("Setting Canvas");
                target->set_canvas(get_canvas());
                target->set_quality(quality);
                
@@ -192,7 +192,7 @@ void studio::Preview::render()
                        newh = (int)floor(desc.get_h()*zoom+0.5);
                float newfps = fps;
                
-               /*sinfg::warning("Setting the render description: %d x %d, %f fps, [%f,%f]",
+               /*synfig::warning("Setting the render description: %d x %d, %f fps, [%f,%f]",
                                                neww,newh,newfps, overbegin?begintime:(float)desc.get_time_start(),
                                                overend?endtime:(float)desc.get_time_end());*/
                
@@ -203,12 +203,12 @@ void studio::Preview::render()
                if(overbegin)
                {
                        desc.set_time_start(std::max(begintime,(float)desc.get_time_start()));
-                       //sinfg::warning("Set start time to %.2f...",(float)desc.get_time_start());
+                       //synfig::warning("Set start time to %.2f...",(float)desc.get_time_start());
                }
                if(overend)
                {
                        desc.set_time_end(std::min(endtime,(float)desc.get_time_end()));
-                       //sinfg::warning("Set end time to %.2f...",(float)desc.get_time_end());
+                       //synfig::warning("Set end time to %.2f...",(float)desc.get_time_end());
                }
                        
                //setting the description
@@ -222,7 +222,7 @@ void studio::Preview::render()
                frames.resize(0);
                
                //now tell it to go... with inherited prog. reporting...
-               //sinfg::info("Rendering Asynchronously...");
+               //synfig::info("Rendering Asynchronously...");
                if(renderer) renderer->stop();
                renderer = new AsyncRenderer(target);
                renderer->start();
@@ -242,26 +242,26 @@ void studio::Preview::frame_finish(const Preview_Target *targ)
        const Surface &surf = targ->get_surface();
        const RendDesc& r = targ->get_rend_desc();
        
-       //sinfg::warning("Finished a frame at %f s",time);
+       //synfig::warning("Finished a frame at %f s",time);
        
        //copy EVERYTHING!
        PixelFormat pf(PF_RGB);
-       const int total_bytes(r.get_w()*r.get_h()*sinfg::channels(pf));
+       const int total_bytes(r.get_w()*r.get_h()*synfig::channels(pf));
        
-       //sinfg::warning("Creating a buffer");
+       //synfig::warning("Creating a buffer");
        unsigned char *buffer((unsigned char*)malloc(total_bytes));
 
        if(!buffer)
                return;
 
        //convert all the pixles to the pixbuf... buffer... thing...
-       //sinfg::warning("Converting...");      
+       //synfig::warning("Converting...");     
        convert_color_format(buffer, surf[0], surf.get_w()*surf.get_h(), pf, App::gamma);
        
        //load time
        fe.t = time;    
        //uses and manages the memory for the buffer...
-       //sinfg::warning("Create a pixmap...");
+       //synfig::warning("Create a pixmap...");
        fe.buf = 
        Gdk::Pixbuf::create_from_data(
                buffer, // pointer to the data
@@ -270,12 +270,12 @@ void studio::Preview::frame_finish(const Preview_Target *targ)
                8, // bits per sample
                surf.get_w(),   // width
                surf.get_h(),   // height
-               surf.get_w()*sinfg::channels(pf), // stride (pitch)
+               surf.get_w()*synfig::channels(pf), // stride (pitch)
                sigc::ptr_fun(free_guint8)
        );
        
        //add the flipbook element to the list (assume time is correct)
-       //sinfg::info("Prev: Adding %f s to the list", time);
+       //synfig::info("Prev: Adding %f s to the list", time);
        frames.push_back(fe);
        
        signal_changed()();
@@ -420,7 +420,7 @@ void studio::Widget_Preview::update()
        //find the frame and display it...
        if(preview)
        {
-               //sinfg::warning("Updating at %.3f s",time);            
+               //synfig::warning("Updating at %.3f s",time);           
                
                //use time to find closest frame...
                studio::Preview::FlipBook::const_iterator       beg = preview->begin(),end = preview->end();
@@ -439,15 +439,15 @@ void studio::Widget_Preview::update()
                {                       
                        //don't bother with binary search it will just be slower...
                        
-                       //sinfg::info("Search for time %f",time);
+                       //synfig::info("Search for time %f",time);
                        
                        //incrementally go in either direction 
                        //(bias downward towards beg, because that's what we want)
                        for(;i != end;++i)
                        {
-                               //sinfg::info("Look at %f",i->t);
+                               //synfig::info("Look at %f",i->t);
                                if(i->t > time) break;
-                               //sinfg::info("Go past...");
+                               //synfig::info("Go past...");
                        }
                        
                        //if(i!=beg)--i; 
@@ -456,9 +456,9 @@ void studio::Widget_Preview::update()
                        for(;i != beg;)
                        {
                                --i;
-                               //sinfg::info("Look at %f",i->t);
+                               //synfig::info("Look at %f",i->t);
                                if(i->t <= time) break;
-                               //sinfg::info("Go past...");
+                               //synfig::info("Go past...");
                        }
                        
                        /*i = preview->begin(); end = preview->end();
@@ -475,7 +475,7 @@ void studio::Widget_Preview::update()
                        //don't get the closest, round down... (if we can)
                        if(i == end)
                        {
-                               sinfg::error("i == end....");
+                               synfig::error("i == end....");
                                //assert(0);
                                currentbuf.clear();
                                currentindex = 0;
@@ -487,9 +487,9 @@ void studio::Widget_Preview::update()
                                if(timedisp != i->t)
                                {
                                        timedisp = i->t;
-                                       //sinfg::warning("Update at: %f seconds (%f s)",time,timedisp);
+                                       //synfig::warning("Update at: %f seconds (%f s)",time,timedisp);
                                        preview_draw();
-                                       //sinfg::warning("success!");                   
+                                       //synfig::warning("success!");                  
                                }
                        }
                }
@@ -526,7 +526,7 @@ bool studio::Widget_Preview::redraw(GdkEventExpose *heh)
        sx = draw_area.get_width() / (float)px->get_width();
        sy = draw_area.get_height() / (float)px->get_height();
        
-       //sinfg::info("widget_preview redraw: now to scale the bitmap: %.3f x %.3f",sx,sy);
+       //synfig::info("widget_preview redraw: now to scale the bitmap: %.3f x %.3f",sx,sy);
        
        //round to smallest scale (fit entire thing in window without distortion)
        if(sx > sy) sx = sy;
@@ -540,7 +540,7 @@ bool studio::Widget_Preview::redraw(GdkEventExpose *heh)
                
        pxnew = px->scale_simple(nw,nh,Gdk::INTERP_NEAREST);
                
-       //sinfg::info("Now to draw to the window...");
+       //synfig::info("Now to draw to the window...");
        //copy to window
        Glib::RefPtr<Gdk::Window>       wind = draw_area.get_window();
        Glib::RefPtr<Gdk::Drawable> surf = Glib::RefPtr<Gdk::Drawable>::cast_static(wind);
@@ -551,8 +551,8 @@ bool studio::Widget_Preview::redraw(GdkEventExpose *heh)
                draw_area.get_window()->begin_paint_rect(r);
        }
 
-       if(!wind) sinfg::warning("The destination window is broken...");
-       if(!surf) sinfg::warning("The destination is not drawable...");
+       if(!wind) synfig::warning("The destination window is broken...");
+       if(!surf) synfig::warning("The destination is not drawable...");
        
        if(surf)
        {
@@ -583,7 +583,7 @@ bool studio::Widget_Preview::redraw(GdkEventExpose *heh)
                        Glib::ustring timecode(Time((double)timedisp).round(preview->get_global_fps())
                                                                                                                        .get_string(preview->get_global_fps(),
                                                                                                                                                        App::get_time_format()));
-                       //sinfg::info("Time for preview draw is: %s for time %g", timecode.c_str(), adj_time_scrub.get_value());
+                       //synfig::info("Time for preview draw is: %s for time %g", timecode.c_str(), adj_time_scrub.get_value());
                                                                                                                                                
                        gc->set_rgb_fg_color(Gdk::Color("#FF0000"));
                        layout->set_text(timecode);
@@ -593,7 +593,7 @@ bool studio::Widget_Preview::redraw(GdkEventExpose *heh)
 
        draw_area.get_window()->end_paint();
        
-       //sinfg::warning("Refresh the draw area");
+       //synfig::warning("Refresh the draw area");
        //make sure the widget refreshes
        
        return false;
@@ -602,7 +602,7 @@ bool studio::Widget_Preview::redraw(GdkEventExpose *heh)
 bool studio::Widget_Preview::play_update()
 {
        float diff = timer.pop_time();
-       //sinfg::info("Play update: diff = %.2f",diff);
+       //synfig::info("Play update: diff = %.2f",diff);
        
        if(playing)
        {
@@ -616,7 +616,7 @@ bool studio::Widget_Preview::play_update()
                                
                        if(newtime != audiotime)
                        {
-                               //sinfg::info("Adjusted time from %.3lf to %.3lf", time,newtime);
+                               //synfig::info("Adjusted time from %.3lf to %.3lf", time,newtime);
                                time = audiotime = newtime;
                        }
                }
@@ -635,7 +635,7 @@ bool studio::Widget_Preview::play_update()
                                play_stop();
                                update();
                                
-                               //sinfg::info("Play Stopped: time set to %f",adj_time_scrub.get_value());
+                               //synfig::info("Play Stopped: time set to %f",adj_time_scrub.get_value());
                                return false;
                        }
                }
@@ -646,7 +646,7 @@ bool studio::Widget_Preview::play_update()
                
                //update the window to the correct image we might want to do this later...
                //update();
-               //sinfg::warning("Did update pu");
+               //synfig::warning("Did update pu");
        }
        return true;
 }
@@ -656,7 +656,7 @@ void studio::Widget_Preview::slider_move()
        //if(!playing)
        {
                update();
-               //sinfg::warning("Did update sm");
+               //synfig::warning("Did update sm");
        }
 }
 
@@ -675,7 +675,7 @@ void studio::Widget_Preview::scrub_updated(double t)
                }
        }
        
-       //sinfg::info("Scrubbing to %.3f, setting adj to %.3f",oldt,t);
+       //synfig::info("Scrubbing to %.3f, setting adj to %.3f",oldt,t);
                        
        if(adj_time_scrub.get_value() != t)
        {
@@ -697,7 +697,7 @@ void studio::Widget_Preview::set_preview(handle<Preview>    prev)
 {
        preview = prev;
        
-       sinfg::info("Setting preview");
+       synfig::info("Setting preview");
        
        //stop playing the mini animation...
        stop();
@@ -706,7 +706,7 @@ void studio::Widget_Preview::set_preview(handle<Preview>    prev)
        {
                //set the internal values
                float rate = preview->get_fps();
-               sinfg::info("   FPS = %f",rate);
+               synfig::info("  FPS = %f",rate);
                if(rate)
                {
                        float start = preview->get_begintime();
@@ -736,7 +736,7 @@ void studio::Widget_Preview::set_preview(handle<Preview>    prev)
                prevchanged = prev->signal_changed().connect(sigc::mem_fun(*this,&Widget_Preview::whenupdated));
                prev->signal_destroyed().connect(sigc::mem_fun(*this,&Widget_Preview::disconnect_preview));
                update();
-               //sinfg::warning("Did update sp");
+               //synfig::warning("Did update sp");
                queue_draw();
        }
 }
@@ -759,19 +759,19 @@ void studio::Widget_Preview::play()
 {
        if(preview && !playing)
        {
-               //sinfg::info("Playing at %lf",adj_time_scrub.get_value());
+               //synfig::info("Playing at %lf",adj_time_scrub.get_value());
                //audiotime = adj_time_scrub.get_value();
                playing = true;
 
                //adj_time_scrub.set_value(adj_time_scrub.get_lower());         
                update(); //we don't want to call play update because that will try to advance the timer
-               //sinfg::warning("Did update p");
+               //synfig::warning("Did update p");
                
                //approximate length of time in seconds, right?
                double rate = /*std::min(*/adj_time_scrub.get_step_increment()/*,1/30.0)*/;
                int timeout = (int)floor(1000*rate);
                
-               //sinfg::info(" rate = %.3lfs = %d ms",rate,timeout);
+               //synfig::info("        rate = %.3lfs = %d ms",rate,timeout);
                
                signal_play_(adj_time_scrub.get_value());
                
@@ -789,12 +789,12 @@ void studio::Widget_Preview::play_stop()
        playing = false;
        signal_stop()();
        if(audio) audio->stop(); //!< stop the audio
-       //sinfg::info("Stopping...");
+       //synfig::info("Stopping...");
 }
 
 void studio::Widget_Preview::stop()
 {
-       //sinfg::warning("stopping");
+       //synfig::warning("stopping");
        play_stop();
        timecon.disconnect();
 }
index 780f689..63ee0a4 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file preview.h
 **     \brief Previews an animation
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_PREVIEW_H
-#define __SINFG_PREVIEW_H
+#ifndef __SYNFIG_PREVIEW_H
+#define __SYNFIG_PREVIEW_H
 
 /* === H E A D E R S ======================================================= */
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/checkbutton.h>
 #include <gtkmm/canvasview.h>
 
-#include <sinfg/time.h>
-#include <sinfg/vector.h>
-#include <sinfg/general.h>
-#include <sinfg/renddesc.h>
-#include <sinfg/canvas.h>
+#include <synfig/time.h>
+#include <synfig/vector.h>
+#include <synfig/general.h>
+#include <synfig/renddesc.h>
+#include <synfig/canvas.h>
 
 #include "widget_sound.h"
 
@@ -77,7 +77,7 @@ private:
        
        studio::CanvasView::LooseHandle canvasview;
 
-       //sinfg::RendDesc               description; //for rendering the preview...
+       //synfig::RendDesc              description; //for rendering the preview...
        float   zoom,fps;
        float   begintime,endtime;
        bool    overbegin,overend;
@@ -136,14 +136,14 @@ public:
        int             get_quality() const {return quality;}
        void    set_quality(int i)      {quality = i;}
        
-       sinfg::Canvas::Handle   get_canvas() const {return canvasview->get_canvas();}
+       synfig::Canvas::Handle  get_canvas() const {return canvasview->get_canvas();}
        studio::CanvasView::Handle      get_canvasview() const {return canvasview;}
        
        void set_canvasview(const studio::CanvasView::LooseHandle &h);
        
        //signal interface
        sigc::signal<void, Preview *> & signal_destroyed() { return signal_destroyed_; }
-       //sigc::signal<void, const sinfg::RendDesc &>   &signal_desc_change() {return signal_desc_change_;}
+       //sigc::signal<void, const synfig::RendDesc &>  &signal_desc_change() {return signal_desc_change_;}
        
        //functions for exposing iterators through the preview
        FlipBook::iterator      begin()         {return frames.begin();}
index 8a709d7..82f104b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file renddesc.cpp
 **     \brief Template File
 **
@@ -32,7 +32,7 @@
 #include <gtkmm/label.h>
 #include <gtkmm/frame.h>
 #include <ETL/misc>
-#include <sinfg/general.h>
+#include <synfig/general.h>
 //#include <gtkmm/seperator.h>
 
 #endif
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
 
-#ifndef SINFG_MAX_PIXEL_WIDTH
-#define SINFG_MAX_PIXEL_WIDTH  (~(1<<31))
+#ifndef SYNFIG_MAX_PIXEL_WIDTH
+#define SYNFIG_MAX_PIXEL_WIDTH (~(1<<31))
 #endif
 
-#ifndef SINFG_MAX_PIXEL_HEIGHT
-#define SINFG_MAX_PIXEL_HEIGHT (~(1<<31))
+#ifndef SYNFIG_MAX_PIXEL_HEIGHT
+#define SYNFIG_MAX_PIXEL_HEIGHT        (~(1<<31))
 #endif
 
 #if ! defined(_)
@@ -76,8 +76,8 @@ using namespace studio;
 
 Widget_RendDesc::Widget_RendDesc():
        Gtk::Table(1,2,false),
-       adjustment_width(1,1,SINFG_MAX_PIXEL_WIDTH),
-       adjustment_height(1,1,SINFG_MAX_PIXEL_HEIGHT),
+       adjustment_width(1,1,SYNFIG_MAX_PIXEL_WIDTH),
+       adjustment_height(1,1,SYNFIG_MAX_PIXEL_HEIGHT),
        adjustment_xres(0,0,10000000),
        adjustment_yres(0,0,10000000),
        adjustment_phy_width(0,0,10000000),
@@ -221,7 +221,7 @@ Widget_RendDesc::~Widget_RendDesc()
 {
 }
 
-void Widget_RendDesc::set_rend_desc(const sinfg::RendDesc &rend_desc)
+void Widget_RendDesc::set_rend_desc(const synfig::RendDesc &rend_desc)
 {
        if(update_lock)return;
        
@@ -260,12 +260,12 @@ Widget_RendDesc::refresh()
        toggle_im_span->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_SPAN));   
 }
 
-void Widget_RendDesc::apply_rend_desc(const sinfg::RendDesc &rend_desc)
+void Widget_RendDesc::apply_rend_desc(const synfig::RendDesc &rend_desc)
 {
        set_rend_desc(rend_desc);
 }
 
-const sinfg::RendDesc &
+const synfig::RendDesc &
 Widget_RendDesc::get_rend_desc()
 {
        return rend_desc_;
index 5c0a4bd..e8e1416 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template Header File
 ** $Id: renddesc.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_RENDDESC_H
-#define __SINFG_GTKMM_RENDDESC_H
+#ifndef __SYNFIG_GTKMM_RENDDESC_H
+#define __SYNFIG_GTKMM_RENDDESC_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/table.h>
 #include <gtkmm/frame.h>
-#include <sinfg/renddesc.h>
+#include <synfig/renddesc.h>
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/adjustment.h>
 #include <gtkmm/checkbutton.h>
@@ -44,7 +44,7 @@ namespace studio {
 
 class Widget_RendDesc : public Gtk::Table
 {
-       sinfg::RendDesc rend_desc_;
+       synfig::RendDesc rend_desc_;
        sigc::signal<void> signal_changed_;
 
        Gtk::Adjustment adjustment_width;
@@ -110,13 +110,13 @@ public:
        ~Widget_RendDesc();
        
        //! Sets the RendDesc
-       void set_rend_desc(const sinfg::RendDesc &rend_desc);
+       void set_rend_desc(const synfig::RendDesc &rend_desc);
 
        //! Applies the given RendDesc to the current RendDesc
-       void apply_rend_desc(const sinfg::RendDesc &rend_desc);
+       void apply_rend_desc(const synfig::RendDesc &rend_desc);
 
        //! Retrieves the current RendDesc
-       const sinfg::RendDesc &get_rend_desc();
+       const synfig::RendDesc &get_rend_desc();
 
        void disable_time_section();
        
index 9328b2b..cb75d55 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file render.cpp
 **     \brief Template File
 **
@@ -31,8 +31,8 @@
 #include "render.h"
 #include "app.h"
 #include <gtkmm/frame.h>
-#include <sinfg/target_scanline.h>
-#include <sinfg/canvas.h>
+#include <synfig/target_scanline.h>
+#include <synfig/canvas.h>
 #include "asyncrenderer.h"
 
 #endif
@@ -41,7 +41,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -52,7 +52,7 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-RenderSettings::RenderSettings(Gtk::Window& parent,handle<sinfgapp::CanvasInterface> canvas_interface):
+RenderSettings::RenderSettings(Gtk::Window& parent,handle<synfigapp::CanvasInterface> canvas_interface):
        Gtk::Dialog(_("Render Settings"),parent,false,true),
        canvas_interface_(canvas_interface),
        adjustment_quality(3,0,9),
@@ -73,8 +73,8 @@ RenderSettings::RenderSettings(Gtk::Window& parent,handle<sinfgapp::CanvasInterf
                        sigc::bind(sigc::mem_fun(*this,&RenderSettings::set_target),String())
                ));
 
-       sinfg::Target::Book::iterator iter;
-       sinfg::Target::Book book(sinfg::Target::book());
+       synfig::Target::Book::iterator iter;
+       synfig::Target::Book book(synfig::Target::book());
        
        for(iter=book.begin();iter!=book.end();iter++)
        {
@@ -148,7 +148,7 @@ RenderSettings::RenderSettings(Gtk::Window& parent,handle<sinfgapp::CanvasInterf
        }
        catch(...)
        {
-               sinfg::warning("Averted crash!");
+               synfig::warning("Averted crash!");
                entry_filename.set_text("output.png");
        }
        
@@ -166,7 +166,7 @@ RenderSettings::on_rend_desc_changed()
 }
 
 void
-RenderSettings::set_target(sinfg::String name)
+RenderSettings::set_target(synfig::String name)
 {
        target_name=name;
 }
index aec2a2c..1d89e9c 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file render.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_GTKMM_RENDER_H
-#define __SINFG_STUDIO_GTKMM_RENDER_H
+#ifndef __SYNFIG_STUDIO_GTKMM_RENDER_H
+#define __SYNFIG_STUDIO_GTKMM_RENDER_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -36,9 +36,9 @@
 #include <gtkmm/tooltips.h>
 #include <gtkmm/optionmenu.h>
 
-#include <sinfg/string.h>
+#include <synfig/string.h>
 
-#include <sinfgapp/canvasinterface.h>
+#include <synfigapp/canvasinterface.h>
 
 #include "renddesc.h"
 
@@ -56,7 +56,7 @@ class RenderSettings : public Gtk::Dialog
 {
        Gtk::Tooltips tooltips;
 
-       etl::handle<sinfgapp::CanvasInterface> canvas_interface_;
+       etl::handle<synfigapp::CanvasInterface> canvas_interface_;
        Widget_RendDesc widget_rend_desc;
 
        Gtk::Entry entry_filename;
@@ -72,14 +72,14 @@ class RenderSettings : public Gtk::Dialog
        Gtk::OptionMenu optionmenu_target;
        Gtk::Menu *menu_target;
 
-       sinfg::String target_name;
+       synfig::String target_name;
        
-       void set_target(sinfg::String name);
+       void set_target(synfig::String name);
 
        etl::handle<AsyncRenderer> async_renderer;
 
 public:
-       RenderSettings(Gtk::Window& parent,etl::handle<sinfgapp::CanvasInterface> canvas_interface);
+       RenderSettings(Gtk::Window& parent,etl::handle<synfigapp::CanvasInterface> canvas_interface);
        ~RenderSettings();
 
 private:
index b28d50a..fb1cc9e 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -37,7 +37,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -56,7 +56,7 @@ Renderer_BBox::~Renderer_BBox()
 {
 }
 
-const sinfg::Rect&
+const synfig::Rect&
 Renderer_BBox::get_bbox()
 {
        return get_work_area()->get_canvas_view()->get_bbox();
@@ -72,9 +72,9 @@ Renderer_BBox::render_vfunc(
        if(!get_work_area())
                return;
        
-//     const sinfg::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
+//     const synfig::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
        
-       const sinfg::Vector focus_point(get_work_area()->get_focus_point());
+       const synfig::Vector focus_point(get_work_area()->get_focus_point());
 
 //     std::vector< std::pair<Glib::RefPtr<Gdk::Pixbuf>,int> >& tile_book(get_tile_book());
        
@@ -83,14 +83,14 @@ Renderer_BBox::render_vfunc(
        
        // Calculate the window coordinates of the top-left
        // corner of the canvas.
-//     const sinfg::Vector::value_type
+//     const synfig::Vector::value_type
 //             x(focus_point[0]/get_pw()+drawable_w/2-get_w()/2),
 //             y(focus_point[1]/get_ph()+drawable_h/2-get_h()/2);
 
-       /*const sinfg::Vector::value_type window_startx(window_tl[0]);
-       const sinfg::Vector::value_type window_endx(window_br[0]);
-       const sinfg::Vector::value_type window_starty(window_tl[1]);
-       const sinfg::Vector::value_type window_endy(window_br[1]);
+       /*const synfig::Vector::value_type window_startx(window_tl[0]);
+       const synfig::Vector::value_type window_endx(window_br[0]);
+       const synfig::Vector::value_type window_starty(window_tl[1]);
+       const synfig::Vector::value_type window_endy(window_br[1]);
        */
 //     const int
 //             tile_w(get_work_area()->get_tile_w()),
@@ -102,16 +102,16 @@ Renderer_BBox::render_vfunc(
        
        Glib::RefPtr<Gdk::GC> gc(Gdk::GC::create(drawable));
        
-       //const sinfg::Vector grid_size(get_grid_size());
+       //const synfig::Vector grid_size(get_grid_size());
 
-       const sinfg::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
-//     const sinfg::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
-       const sinfg::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
-//     const sinfg::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
+       const synfig::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
+//     const synfig::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
+       const synfig::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
+//     const synfig::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
        const float pw(get_pw()),ph(get_ph());
        
-       const sinfg::Point curr_point(get_bbox().get_min());
-       const sinfg::Point drag_point(get_bbox().get_max());
+       const synfig::Point curr_point(get_bbox().get_min());
+       const synfig::Point drag_point(get_bbox().get_max());
        if(get_bbox().area()<10000000000000000.0)
        {
                gc->set_function(Gdk::INVERT);
index 7b39d77..aba7b15 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file renderer_bbox.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_RENDERER_BBOX_H
-#define __SINFG_RENDERER_BBOX_H
+#ifndef __SYNFIG_RENDERER_BBOX_H
+#define __SYNFIG_RENDERER_BBOX_H
 
 /* === H E A D E R S ======================================================= */
 
 #include "workarearenderer.h"
 #include <vector>
-#include <sinfg/vector.h>
-#include <sinfg/rect.h>
+#include <synfig/vector.h>
+#include <synfig/rect.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -41,13 +41,13 @@ namespace studio {
 
 class Renderer_BBox : public studio::WorkAreaRenderer
 {
-       sinfg::Rect bbox;
+       synfig::Rect bbox;
        
 public:
        Renderer_BBox();
        ~Renderer_BBox();
 
-       const sinfg::Rect& get_bbox();
+       const synfig::Rect& get_bbox();
 
        void render_vfunc(const Glib::RefPtr<Gdk::Drawable>& drawable,const Gdk::Rectangle& expose_area );
 
index 1f73c4a..cea12b3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -97,9 +97,9 @@ Renderer_Canvas::render_vfunc(
        if(!get_work_area())
                return;
        
-//     const sinfg::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
+//     const synfig::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
        
-       const sinfg::Vector focus_point(get_work_area()->get_focus_point());
+       const synfig::Vector focus_point(get_work_area()->get_focus_point());
 
        std::vector< std::pair<Glib::RefPtr<Gdk::Pixbuf>,int> >& tile_book(get_tile_book());
        
@@ -108,14 +108,14 @@ Renderer_Canvas::render_vfunc(
        
        // Calculate the window coordinates of the top-left
        // corner of the canvas.
-       const sinfg::Vector::value_type
+       const synfig::Vector::value_type
                x(focus_point[0]/get_pw()+drawable_w/2-get_w()/2),
                y(focus_point[1]/get_ph()+drawable_h/2-get_h()/2);
 
-       /*const sinfg::Vector::value_type window_startx(window_tl[0]);
-       const sinfg::Vector::value_type window_endx(window_br[0]);
-       const sinfg::Vector::value_type window_starty(window_tl[1]);
-       const sinfg::Vector::value_type window_endy(window_br[1]);
+       /*const synfig::Vector::value_type window_startx(window_tl[0]);
+       const synfig::Vector::value_type window_endx(window_br[0]);
+       const synfig::Vector::value_type window_starty(window_tl[1]);
+       const synfig::Vector::value_type window_endy(window_br[1]);
        */
        const int
                tile_w(get_work_area()->get_tile_w()),
index d923343..a98c853 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_RENDERER_CANVAS_H
-#define __SINFG_RENDERER_CANVAS_H
+#ifndef __SYNFIG_RENDERER_CANVAS_H
+#define __SYNFIG_RENDERER_CANVAS_H
 
 /* === H E A D E R S ======================================================= */
 
index c077dfc..9786851 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -53,13 +53,13 @@ Renderer_Dragbox::~Renderer_Dragbox()
 {
 }
 
-const sinfg::Point&
+const synfig::Point&
 Renderer_Dragbox::get_drag_point()const
 {
        return get_work_area()->get_drag_point();
 }
 
-const sinfg::Point&
+const synfig::Point&
 Renderer_Dragbox::get_curr_point()const
 {
        return get_work_area()->get_cursor_pos();
@@ -82,9 +82,9 @@ Renderer_Dragbox::render_vfunc(
        if(!get_work_area())
                return;
        
-       const sinfg::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
+       const synfig::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
        
-       const sinfg::Vector focus_point(get_work_area()->get_focus_point());
+       const synfig::Vector focus_point(get_work_area()->get_focus_point());
 
 //     std::vector< std::pair<Glib::RefPtr<Gdk::Pixbuf>,int> >& tile_book(get_tile_book());
        
@@ -93,14 +93,14 @@ Renderer_Dragbox::render_vfunc(
        
        // Calculate the window coordinates of the top-left
        // corner of the canvas.
-       const sinfg::Vector::value_type
+       const synfig::Vector::value_type
                x(focus_point[0]/get_pw()+drawable_w/2-get_w()/2),
                y(focus_point[1]/get_ph()+drawable_h/2-get_h()/2);
 
-       /*const sinfg::Vector::value_type window_startx(window_tl[0]);
-       const sinfg::Vector::value_type window_endx(window_br[0]);
-       const sinfg::Vector::value_type window_starty(window_tl[1]);
-       const sinfg::Vector::value_type window_endy(window_br[1]);
+       /*const synfig::Vector::value_type window_startx(window_tl[0]);
+       const synfig::Vector::value_type window_endx(window_br[0]);
+       const synfig::Vector::value_type window_starty(window_tl[1]);
+       const synfig::Vector::value_type window_endy(window_br[1]);
        */
        const int
                tile_w(get_work_area()->get_tile_w()),
@@ -112,16 +112,16 @@ Renderer_Dragbox::render_vfunc(
        
        Glib::RefPtr<Gdk::GC> gc(Gdk::GC::create(drawable));
        
-       //const sinfg::Vector grid_size(get_grid_size());
+       //const synfig::Vector grid_size(get_grid_size());
 
-       const sinfg::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
-       const sinfg::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
-       const sinfg::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
-       const sinfg::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
+       const synfig::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
+       const synfig::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
+       const synfig::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
+       const synfig::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
        const float pw(get_pw()),ph(get_ph());
        
-       const sinfg::Point& curr_point(get_curr_point());
-       const sinfg::Point& drag_point(get_drag_point());
+       const synfig::Point& curr_point(get_curr_point());
+       const synfig::Point& drag_point(get_drag_point());
        
        {
                gc->set_function(Gdk::COPY);
index 0da3aa0..44c1766 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_RENDERER_DRAGBOX_H
-#define __SINFG_RENDERER_DRAGBOX_H
+#ifndef __SYNFIG_RENDERER_DRAGBOX_H
+#define __SYNFIG_RENDERER_DRAGBOX_H
 
 /* === H E A D E R S ======================================================= */
 
 #include "workarearenderer.h"
 #include <vector>
-#include <sinfg/vector.h>
+#include <synfig/vector.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -46,8 +46,8 @@ public:
        
        void render_vfunc(const Glib::RefPtr<Gdk::Drawable>& drawable,const Gdk::Rectangle& expose_area );
 
-       const sinfg::Point& get_drag_point()const;
-       const sinfg::Point& get_curr_point()const;
+       const synfig::Point& get_drag_point()const;
+       const synfig::Point& get_curr_point()const;
 
 protected:
        bool get_enabled_vfunc()const;
index 90cf842..2304a3b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -34,7 +34,7 @@
 #include <ETL/bezier>
 #include <ETL/misc>
 #include "widget_color.h"
-#include <sinfg/distance.h>
+#include <synfig/distance.h>
 #include "app.h"
 
 #endif
@@ -43,7 +43,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -68,7 +68,7 @@ Renderer_Ducks::get_enabled_vfunc()const
 
 struct ScreenDuck
 {
-       sinfg::Point pos;
+       synfig::Point pos;
        Gdk::Color color;
        bool selected;
        bool hover;
@@ -87,7 +87,7 @@ Renderer_Ducks::render_vfunc(
        if(!get_work_area())
                return;
        
-       const sinfg::Vector focus_point(get_work_area()->get_focus_point());
+       const synfig::Vector focus_point(get_work_area()->get_focus_point());
 
        
        int drawable_w,drawable_h;
@@ -96,8 +96,8 @@ Renderer_Ducks::render_vfunc(
        Glib::RefPtr<Gdk::GC> gc(Gdk::GC::create(drawable));
        
 
-       const sinfg::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
-       const sinfg::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
+       const synfig::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
+       const synfig::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
 
        const float pw(get_pw()),ph(get_ph());
 
@@ -113,7 +113,7 @@ Renderer_Ducks::render_vfunc(
        {
                Point window_start(window_startx,window_starty);
                vector<Gdk::Point> points;
-               std::list<sinfg::Point>::iterator iter2;
+               std::list<synfig::Point>::iterator iter2;
                Point holder;
                
                for(iter2=(*iter)->stroke_data->begin();iter2!=(*iter)->stroke_data->end();++iter2)
@@ -123,7 +123,7 @@ Renderer_Ducks::render_vfunc(
                        points.push_back(Gdk::Point(round_to_int(holder[0]),round_to_int(holder[1])));
                }
                
-               gc->set_rgb_fg_color(colorconv_sinfg2gdk((*iter)->color));
+               gc->set_rgb_fg_color(colorconv_synfig2gdk((*iter)->color));
                gc->set_function(Gdk::COPY);
                gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
 
@@ -233,7 +233,7 @@ Renderer_Ducks::render_vfunc(
                                                
                if(get_work_area()->get_selected_value_node())
                {
-                       sinfgapp::ValueDesc value_desc((*iter)->get_value_desc());
+                       synfigapp::ValueDesc value_desc((*iter)->get_value_desc());
                        if(value_desc.is_valid() && value_desc.is_value_node() && get_work_area()->get_selected_value_node()==value_desc.get_value_node())
                        {
                                gc->set_function(Gdk::COPY);
index a4be796..4e1800d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_RENDERER_DUCKS_H
-#define __SINFG_RENDERER_DUCKS_H
+#ifndef __SYNFIG_RENDERER_DUCKS_H
+#define __SYNFIG_RENDERER_DUCKS_H
 
 /* === H E A D E R S ======================================================= */
 
index d648f93..e6e53d9 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -59,7 +59,7 @@ Renderer_Grid::get_enabled_vfunc()const
        return get_work_area()->grid_status();
 }
 
-sinfg::Vector
+synfig::Vector
 Renderer_Grid::get_grid_size()const
 {
        return get_work_area()->get_grid_size();
@@ -75,9 +75,9 @@ Renderer_Grid::render_vfunc(
        if(!get_work_area())
                return;
        
-//     const sinfg::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
+//     const synfig::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
        
-       const sinfg::Vector focus_point(get_work_area()->get_focus_point());
+       const synfig::Vector focus_point(get_work_area()->get_focus_point());
 
 //     std::vector< std::pair<Glib::RefPtr<Gdk::Pixbuf>,int> >& tile_book(get_tile_book());
        
@@ -86,14 +86,14 @@ Renderer_Grid::render_vfunc(
        
        // Calculate the window coordinates of the top-left
        // corner of the canvas.
-//     const sinfg::Vector::value_type
+//     const synfig::Vector::value_type
 //             x(focus_point[0]/get_pw()+drawable_w/2-get_w()/2),
 //             y(focus_point[1]/get_ph()+drawable_h/2-get_h()/2);
 
-       /*const sinfg::Vector::value_type window_startx(window_tl[0]);
-       const sinfg::Vector::value_type window_endx(window_br[0]);
-       const sinfg::Vector::value_type window_starty(window_tl[1]);
-       const sinfg::Vector::value_type window_endy(window_br[1]);
+       /*const synfig::Vector::value_type window_startx(window_tl[0]);
+       const synfig::Vector::value_type window_endx(window_br[0]);
+       const synfig::Vector::value_type window_starty(window_tl[1]);
+       const synfig::Vector::value_type window_endy(window_br[1]);
        */
 //     const int
 //             tile_w(get_work_area()->get_tile_w()),
@@ -105,18 +105,18 @@ Renderer_Grid::render_vfunc(
        
        Glib::RefPtr<Gdk::GC> gc(Gdk::GC::create(drawable));
        
-       const sinfg::Vector grid_size(get_grid_size());
+       const synfig::Vector grid_size(get_grid_size());
 
-       const sinfg::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
-       const sinfg::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
-       const sinfg::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
-       const sinfg::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
+       const synfig::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
+       const synfig::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
+       const synfig::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
+       const synfig::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
        const float pw(get_pw()),ph(get_ph());
        
        // Draw out the grid
        if(grid_size[0]>pw*3.5 && grid_size[1]>ph*3.5)
        {
-               sinfg::Vector::value_type x,y;
+               synfig::Vector::value_type x,y;
 
                x=floor(window_startx/grid_size[0])*grid_size[0];
                y=floor(window_starty/grid_size[1])*grid_size[1];
index 2789727..d5c1d05 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_RENDERER_GRID_H
-#define __SINFG_RENDERER_GRID_H
+#ifndef __SYNFIG_RENDERER_GRID_H
+#define __SYNFIG_RENDERER_GRID_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -43,7 +43,7 @@ class Renderer_Grid : public studio::WorkAreaRenderer
 public:
        ~Renderer_Grid();
        
-       sinfg::Vector get_grid_size()const;
+       synfig::Vector get_grid_size()const;
 
        void render_vfunc(const Glib::RefPtr<Gdk::Drawable>& drawable,const Gdk::Rectangle& expose_area );
 
index f13746b..4394ff6 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -80,7 +80,7 @@ Renderer_Guides::get_guide_list_y()
 bool
 Renderer_Guides::event_vfunc(GdkEvent* event)
 {
-       sinfg::Point mouse_pos;
+       synfig::Point mouse_pos;
     float bezier_click_pos;
        const float radius((abs(get_pw())+abs(get_ph()))*4);
        int button_pressed(0);
@@ -132,7 +132,7 @@ Renderer_Guides::event_vfunc(GdkEvent* event)
                // and the buttons
                if(!event->button.axes)
                {
-                       mouse_pos=sinfg::Point(screen_to_comp_coords(sinfg::Point(event->button.x,event->button.y)));
+                       mouse_pos=synfig::Point(screen_to_comp_coords(synfig::Point(event->button.x,event->button.y)));
                        button_pressed=event->button.button;
                        pressure=1.0f;
                        is_mouse=true;
@@ -147,14 +147,14 @@ Renderer_Guides::event_vfunc(GdkEvent* event)
                                return false;
 
                        pressure=event->button.axes[2];
-                       //sinfg::info("pressure=%f",pressure);
+                       //synfig::info("pressure=%f",pressure);
                        pressure-=0.04f;
                        pressure/=1.0f-0.04f;
                        
                        
                        assert(!isnan(pressure));
                        
-                       mouse_pos=sinfg::Point(screen_to_comp_coords(sinfg::Point(x,y)));
+                       mouse_pos=synfig::Point(screen_to_comp_coords(synfig::Point(x,y)));
                        
                        button_pressed=event->button.button;
                        
@@ -164,7 +164,7 @@ Renderer_Guides::event_vfunc(GdkEvent* event)
                                pressure=0;
 
                        //if(event->any.type==GDK_BUTTON_PRESS && button_pressed)
-                       //      sinfg::info("Button pressed on input device = %d",event->button.button);
+                       //      synfig::info("Button pressed on input device = %d",event->button.button);
                        
                        //if(event->button.axes[2]>0.1)
                        //      button_pressed=1;
@@ -197,9 +197,9 @@ Renderer_Guides::render_vfunc(
        if(!get_work_area())
                return;
        
-       const sinfg::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
+       const synfig::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
        
-       const sinfg::Vector focus_point(get_work_area()->get_focus_point());
+       const synfig::Vector focus_point(get_work_area()->get_focus_point());
 
        //std::vector< std::pair<Glib::RefPtr<Gdk::Pixbuf>,int> >& tile_book(get_tile_book());
        
@@ -208,14 +208,14 @@ Renderer_Guides::render_vfunc(
        
        // Calculate the window coordinates of the top-left
        // corner of the canvas.
-       const sinfg::Vector::value_type
+       const synfig::Vector::value_type
                x(focus_point[0]/get_pw()+drawable_w/2-get_w()/2),
                y(focus_point[1]/get_ph()+drawable_h/2-get_h()/2);
 
-       /*const sinfg::Vector::value_type window_startx(window_tl[0]);
-       const sinfg::Vector::value_type window_endx(window_br[0]);
-       const sinfg::Vector::value_type window_starty(window_tl[1]);
-       const sinfg::Vector::value_type window_endy(window_br[1]);
+       /*const synfig::Vector::value_type window_startx(window_tl[0]);
+       const synfig::Vector::value_type window_endx(window_br[0]);
+       const synfig::Vector::value_type window_starty(window_tl[1]);
+       const synfig::Vector::value_type window_endy(window_br[1]);
        */
        const int
                tile_w(get_work_area()->get_tile_w()),
@@ -227,12 +227,12 @@ Renderer_Guides::render_vfunc(
        
        Glib::RefPtr<Gdk::GC> gc(Gdk::GC::create(drawable));
        
-       //const sinfg::Vector grid_size(get_grid_size());
+       //const synfig::Vector grid_size(get_grid_size());
 
-       const sinfg::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
-       const sinfg::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
-       const sinfg::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
-       const sinfg::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
+       const synfig::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
+       const synfig::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
+       const synfig::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
+       const synfig::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
        const float pw(get_pw()),ph(get_ph());
 
        // Draw out the guides
index ac98b66..06cd8b0 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_RENDERER_GUIDES_H
-#define __SINFG_RENDERER_GUIDES_H
+#ifndef __SYNFIG_RENDERER_GUIDES_H
+#define __SYNFIG_RENDERER_GUIDES_H
 
 /* === H E A D E R S ======================================================= */
 
index 4c4d62a..b9ddc2e 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -41,7 +41,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -64,7 +64,7 @@ Renderer_Timecode::get_enabled_vfunc()const
                canvas->get_time()!=canvas->rend_desc().get_time_start());
 }
 
-sinfg::Vector
+synfig::Vector
 Renderer_Timecode::get_grid_size()const
 {
        return get_work_area()->get_grid_size();
@@ -80,9 +80,9 @@ Renderer_Timecode::render_vfunc(
        if(!get_work_area())
                return;
        
-       //const sinfg::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
+       //const synfig::RendDesc &rend_desc(get_work_area()->get_canvas()->rend_desc());
        
-       const sinfg::Vector focus_point(get_work_area()->get_focus_point());
+       const synfig::Vector focus_point(get_work_area()->get_focus_point());
 
        //std::vector< std::pair<Glib::RefPtr<Gdk::Pixbuf>,int> >& tile_book(get_tile_book());
        
@@ -91,14 +91,14 @@ Renderer_Timecode::render_vfunc(
        
        // Calculate the window coordinates of the top-left
        // corner of the canvas.
-//     const sinfg::Vector::value_type
+//     const synfig::Vector::value_type
 //             x(focus_point[0]/get_pw()+drawable_w/2-get_w()/2),
 //             y(focus_point[1]/get_ph()+drawable_h/2-get_h()/2);
 
-       /*const sinfg::Vector::value_type window_startx(window_tl[0]);
-       const sinfg::Vector::value_type window_endx(window_br[0]);
-       const sinfg::Vector::value_type window_starty(window_tl[1]);
-       const sinfg::Vector::value_type window_endy(window_br[1]);
+       /*const synfig::Vector::value_type window_startx(window_tl[0]);
+       const synfig::Vector::value_type window_endx(window_br[0]);
+       const synfig::Vector::value_type window_starty(window_tl[1]);
+       const synfig::Vector::value_type window_endy(window_br[1]);
        */
 //     const int
 //             tile_w(get_work_area()->get_tile_w()),
@@ -110,16 +110,16 @@ Renderer_Timecode::render_vfunc(
        
        Glib::RefPtr<Gdk::GC> gc(Gdk::GC::create(drawable));
        
-       //const sinfg::Vector grid_size(get_grid_size());
+       //const synfig::Vector grid_size(get_grid_size());
 
-//     const sinfg::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
-//     const sinfg::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
-//     const sinfg::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
-//     const sinfg::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
+//     const synfig::Vector::value_type window_startx(get_work_area()->get_window_tl()[0]);
+//     const synfig::Vector::value_type window_endx(get_work_area()->get_window_br()[0]);
+//     const synfig::Vector::value_type window_starty(get_work_area()->get_window_tl()[1]);
+//     const synfig::Vector::value_type window_endy(get_work_area()->get_window_br()[1]);
 //     const float pw(get_pw()),ph(get_ph());
 
        Canvas::Handle canvas(get_work_area()->get_canvas());
-       sinfg::Time cur_time(canvas->get_time());
+       synfig::Time cur_time(canvas->get_time());
        
        // Print out the timecode
        {
@@ -132,7 +132,7 @@ Renderer_Timecode::render_vfunc(
                        timecode+="\n"+canvas->keyframe_list().find(cur_time)->get_description();
                        gc->set_rgb_fg_color(Gdk::Color("#FF0000"));
                }
-               catch(sinfg::Exception::NotFound)
+               catch(synfig::Exception::NotFound)
                {
                        return;
                        gc->set_rgb_fg_color(Gdk::Color("#000000"));
@@ -146,7 +146,7 @@ Renderer_Timecode::render_vfunc(
                {
                        layout->set_text(canvas->keyframe_list().find(cur_time)->get_description());            
                }
-               catch(sinfg::Exception::NotFound)
+               catch(synfig::Exception::NotFound)
                {
                        return;
                }
index 068aa10..58b3eeb 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_RENDERER_TIMECODE_H
-#define __SINFG_RENDERER_TIMECODE_H
+#ifndef __SYNFIG_RENDERER_TIMECODE_H
+#define __SYNFIG_RENDERER_TIMECODE_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -43,7 +43,7 @@ class Renderer_Timecode : public studio::WorkAreaRenderer
 public:
        ~Renderer_Timecode();
        
-       sinfg::Vector get_grid_size()const;
+       synfig::Vector get_grid_size()const;
 
        void render_vfunc(const Glib::RefPtr<Gdk::Drawable>& drawable,const Gdk::Rectangle& expose_area );
 
index e4cdf18..0478f86 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_SMACH_H
-#define __SINFG_SMACH_H
+#ifndef __SYNFIG_SMACH_H
+#define __SYNFIG_SMACH_H
 
 /* === H E A D E R S ======================================================= */
 
index 0def107..f2ba41b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file rotoscope_bline.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
+#include <synfig/valuenode_dynamiclist.h>
 
 #include "state_bline.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
-#include <sinfg/valuenode_bline.h>
+#include <synfig/valuenode_bline.h>
 #include <ETL/hermite>
 #include <ETL/calculus>
 #include <utility>
@@ -46,8 +46,8 @@
 #include "toolbox.h"
 #include "dialog_tooloptions.h"
 #include <gtkmm/spinbutton.h>
-#include <sinfg/transform.h>
-#include <sinfgapp/main.h>
+#include <synfig/transform.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -55,7 +55,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -86,22 +86,22 @@ class studio::StateBLine_Context : public sigc::trackable
 
        etl::handle<Duck> next_duck;
        
-       std::list<sinfg::ValueNode_Const::Handle> bline_point_list;
-       sinfgapp::Settings& settings;
+       std::list<synfig::ValueNode_Const::Handle> bline_point_list;
+       synfigapp::Settings& settings;
        
-       bool on_vertex_change(const sinfg::Point &point, sinfg::ValueNode_Const::Handle value_node);
-       bool on_tangent1_change(const sinfg::Point &point, sinfg::ValueNode_Const::Handle value_node);
-       bool on_tangent2_change(const sinfg::Point &point, sinfg::ValueNode_Const::Handle value_node);
+       bool on_vertex_change(const synfig::Point &point, synfig::ValueNode_Const::Handle value_node);
+       bool on_tangent1_change(const synfig::Point &point, synfig::ValueNode_Const::Handle value_node);
+       bool on_tangent2_change(const synfig::Point &point, synfig::ValueNode_Const::Handle value_node);
 
 
-       void popup_handle_menu(sinfg::ValueNode_Const::Handle value_node);
-       void popup_vertex_menu(sinfg::ValueNode_Const::Handle value_node);
-       void popup_bezier_menu(float location, sinfg::ValueNode_Const::Handle value_node);
+       void popup_handle_menu(synfig::ValueNode_Const::Handle value_node);
+       void popup_vertex_menu(synfig::ValueNode_Const::Handle value_node);
+       void popup_bezier_menu(float location, synfig::ValueNode_Const::Handle value_node);
 
-       void bline_detach_handle(sinfg::ValueNode_Const::Handle value_node);
-       void bline_attach_handle(sinfg::ValueNode_Const::Handle value_node);
-       void bline_delete_vertex(sinfg::ValueNode_Const::Handle value_node);
-       void bline_insert_vertex(sinfg::ValueNode_Const::Handle value_node,float origin=0.5);
+       void bline_detach_handle(synfig::ValueNode_Const::Handle value_node);
+       void bline_attach_handle(synfig::ValueNode_Const::Handle value_node);
+       void bline_delete_vertex(synfig::ValueNode_Const::Handle value_node);
+       void bline_insert_vertex(synfig::ValueNode_Const::Handle value_node,float origin=0.5);
        void loop_bline();
 
        void refresh_ducks(bool x=true);
@@ -149,8 +149,8 @@ public:
 
        Real get_feather() const { return adj_feather.get_value(); }
        void set_feather(Real x) { return adj_feather.set_value(x); }
-       sinfg::String get_id()const { return entry_id.get_text(); }
-       void set_id(const sinfg::String& x) { return entry_id.set_text(x); }
+       synfig::String get_id()const { return entry_id.get_text(); }
+       void set_id(const synfig::String& x) { return entry_id.set_text(x); }
 
        Smach::event_result event_stop_handler(const Smach::event& x);
 
@@ -170,16 +170,16 @@ public:
        ~StateBLine_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
-       const sinfg::TransformStack& get_transform_stack()const { return canvas_view_->get_curr_transform_stack(); }
+       const synfig::TransformStack& get_transform_stack()const { return canvas_view_->get_curr_transform_stack(); }
        
        void load_settings();
        void save_settings();
        void reset();
        void increment_id();
-       //void on_user_click(sinfg::Point point);
+       //void on_user_click(synfig::Point point);
 
        bool run_();
        bool run();
@@ -295,7 +295,7 @@ StateBLine_Context::increment_id()
                String str_number;
                str_number=String(id,id.size()-digits,id.size());
                id=String(id,0,id.size()-digits);
-               sinfg::info("---------------- \"%s\"",str_number.c_str());
+               synfig::info("---------------- \"%s\"",str_number.c_str());
                
                number=atoi(str_number.c_str());
        }
@@ -324,7 +324,7 @@ StateBLine_Context::StateBLine_Context(CanvasView* canvas_view):
        loop_(false),
        prev_workarea_layer_status_(get_work_area()->allow_layer_clicks),
        duckmatic_push(get_work_area()),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        entry_id(),
        checkbutton_layer_region(_("Fill")),
        checkbutton_layer_bline(_("Outline")),
@@ -443,7 +443,7 @@ StateBLine_Context::~StateBLine_Context()
 Smach::event_result
 StateBLine_Context::event_stop_handler(const Smach::event& x)
 {
-       sinfg::info("STATE RotoBLine: Received Stop Event");
+       synfig::info("STATE RotoBLine: Received Stop Event");
 //     run();
        reset();
 //     throw Smach::egress_exception();
@@ -454,7 +454,7 @@ StateBLine_Context::event_stop_handler(const Smach::event& x)
 Smach::event_result
 StateBLine_Context::event_refresh_handler(const Smach::event& x)
 {
-       sinfg::info("STATE RotoBLine: Received Refresh Event");
+       synfig::info("STATE RotoBLine: Received Refresh Event");
        refresh_ducks();
        return Smach::RESULT_ACCEPT;
 }
@@ -503,11 +503,11 @@ StateBLine_Context::run_()
        {                       
                
                // Create the action group
-               sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New BLine"));
+               synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New BLine"));
 
                std::vector<BLinePoint> new_list;
-               std::list<sinfg::ValueNode_Const::Handle>::iterator iter;
-               const sinfg::TransformStack& transform(get_transform_stack());
+               std::list<synfig::ValueNode_Const::Handle>::iterator iter;
+               const synfig::TransformStack& transform(get_transform_stack());
                
                for(iter=bline_point_list.begin();iter!=bline_point_list.end();++iter)
                {
@@ -566,12 +566,12 @@ StateBLine_Context::run_()
                if(!canvas)
                        canvas=get_canvas_view()->get_canvas();
 
-               sinfgapp::SelectionManager::LayerList layer_selection;
+               synfigapp::SelectionManager::LayerList layer_selection;
                
                // If we were asked to create a region layer, go ahead and do so
                if(get_layer_region_flag())
                {
-                       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+                       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
 
                        Layer::Handle layer(get_canvas_interface()->add_layer_to("region",canvas,depth));
                        layer_selection.push_back(layer);
@@ -586,9 +586,9 @@ StateBLine_Context::run_()
                        }
                        
                        if(get_layer_bline_flag())
-                               layer->set_param("color",sinfgapp::Main::get_background_color());
+                               layer->set_param("color",synfigapp::Main::get_background_color());
                        
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_param_connect"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
                        
                        assert(action);
                        
@@ -596,9 +596,9 @@ StateBLine_Context::run_()
                        action->set_param("canvas_interface",get_canvas_interface());                   
                        action->set_param("layer",layer);
                        if(!action->set_param("param",String("bline")))
-                               sinfg::error("LayerParamConnect didn't like \"param\"");
+                               synfig::error("LayerParamConnect didn't like \"param\"");
                        if(!action->set_param("value_node",ValueNode::Handle(value_node_bline)))
-                               sinfg::error("LayerParamConnect didn't like \"value_node\"");
+                               synfig::error("LayerParamConnect didn't like \"value_node\"");
 
                        if(!get_canvas_interface()->get_instance()->perform_action(action))
                        {
@@ -612,7 +612,7 @@ StateBLine_Context::run_()
                // If we were asked to create a BLine layer, go ahead and do so
                if(get_layer_bline_flag())
                {
-                       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+                       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
 
                        Layer::Handle layer(get_canvas_interface()->add_layer_to("outline",canvas,depth));
                        layer_selection.push_back(layer);
@@ -627,7 +627,7 @@ StateBLine_Context::run_()
                        assert(layer);
 
 
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_param_connect"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
 
                        assert(action);
                        
@@ -635,9 +635,9 @@ StateBLine_Context::run_()
                        action->set_param("canvas_interface",get_canvas_interface());                   
                        action->set_param("layer",layer);                       
                        if(!action->set_param("param",String("bline")))
-                               sinfg::error("LayerParamConnect didn't like \"param\"");
+                               synfig::error("LayerParamConnect didn't like \"param\"");
                        if(!action->set_param("value_node",ValueNode::Handle(value_node_bline)))
-                               sinfg::error("LayerParamConnect didn't like \"value_node\"");
+                               synfig::error("LayerParamConnect didn't like \"value_node\"");
 
                        if(!get_canvas_interface()->get_instance()->perform_action(action))
                        {
@@ -649,7 +649,7 @@ StateBLine_Context::run_()
 
                        /*if(get_layer_region_flag() && !get_auto_export_flag())
                        {
-                               get_canvas_interface()->auto_export(sinfgapp::ValueDesc(layer,"bline"));
+                               get_canvas_interface()->auto_export(synfigapp::ValueDesc(layer,"bline"));
                        }*/
                }
 
@@ -658,7 +658,7 @@ StateBLine_Context::run_()
                // If we were asked to create a CurveGradient layer, go ahead and do so
                if(get_layer_curve_gradient_flag())
                {
-                       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+                       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
 
                        Layer::Handle layer(get_canvas_interface()->add_layer_to("curve_gradient",canvas,depth));
                        layer_selection.push_back(layer);
@@ -668,7 +668,7 @@ StateBLine_Context::run_()
                        assert(layer);
 
 
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_param_connect"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
 
                        assert(action);
                        
@@ -676,9 +676,9 @@ StateBLine_Context::run_()
                        action->set_param("canvas_interface",get_canvas_interface());                   
                        action->set_param("layer",layer);                       
                        if(!action->set_param("param",String("bline")))
-                               sinfg::error("LayerParamConnect didn't like \"param\"");
+                               synfig::error("LayerParamConnect didn't like \"param\"");
                        if(!action->set_param("value_node",ValueNode::Handle(value_node_bline)))
-                               sinfg::error("LayerParamConnect didn't like \"value_node\"");
+                               synfig::error("LayerParamConnect didn't like \"value_node\"");
 
                        if(!get_canvas_interface()->get_instance()->perform_action(action))
                        {
@@ -690,7 +690,7 @@ StateBLine_Context::run_()
 
                        /*if(get_layer_region_flag() && !get_auto_export_flag())
                        {
-                               get_canvas_interface()->auto_export(sinfgapp::ValueDesc(layer,"bline"));
+                               get_canvas_interface()->auto_export(synfigapp::ValueDesc(layer,"bline"));
                        }*/
                }
 
@@ -716,7 +716,7 @@ StateBLine_Context::event_mouse_motion_handler(const Smach::event& x)
        
        if(curr_duck)
        {
-               //sinfg::info("Moved Duck");
+               //synfig::info("Moved Duck");
                Point p(get_work_area()->snap_point_to_grid(event.pos));
                curr_duck->set_trans_point(p);
                if(next_duck)
@@ -733,11 +733,11 @@ StateBLine_Context::event_mouse_release_handler(const Smach::event& x)
 {
        if(curr_duck)
        {
-               //sinfg::info("Released current duck");
+               //synfig::info("Released current duck");
                curr_duck->signal_edited()(curr_duck->get_point());
                if(next_duck)
                {
-                       //sinfg::info("grabbing next duck");
+                       //synfig::info("grabbing next duck");
                        curr_duck=next_duck;
                        next_duck=0;
                }
@@ -749,7 +749,7 @@ StateBLine_Context::event_mouse_release_handler(const Smach::event& x)
 Smach::event_result
 StateBLine_Context::event_mouse_click_handler(const Smach::event& x)
 {
-       sinfg::info("STATE BLINE: Received mouse button down Event");
+       synfig::info("STATE BLINE: Received mouse button down Event");
        const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
        switch(event.button)
        {
@@ -762,7 +762,7 @@ StateBLine_Context::event_mouse_click_handler(const Smach::event& x)
                        BLinePoint bline_point;
                        
                        bline_point.set_vertex(get_work_area()->snap_point_to_grid(event.pos));
-                       //bline_point.set_width(sinfgapp::Main::get_bline_width());
+                       //bline_point.set_width(synfigapp::Main::get_bline_width());
                        bline_point.set_width(1.0f);
                        bline_point.set_origin(0.5f);
                        bline_point.set_split_tangent_flag(false);
@@ -782,7 +782,7 @@ StateBLine_Context::event_mouse_click_handler(const Smach::event& x)
                        
                        if(bline_point_list.size()>1)
                        {
-                               std::list<sinfg::ValueNode_Const::Handle>::iterator iter;
+                               std::list<synfig::ValueNode_Const::Handle>::iterator iter;
                                iter=bline_point_list.end();
                                iter--;iter--;
                                BLinePoint prev(bline_point_list.back()->get_value().get(BLinePoint()));
@@ -1016,7 +1016,7 @@ StateBLine_Context::refresh_ducks(bool button_down)
 
 
 bool
-StateBLine_Context::on_vertex_change(const sinfg::Point &point, sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::on_vertex_change(const synfig::Point &point, synfig::ValueNode_Const::Handle value_node)
 {
        BLinePoint bline_point(value_node->get_value().get(BLinePoint()));
        bline_point.set_vertex(point);
@@ -1026,7 +1026,7 @@ StateBLine_Context::on_vertex_change(const sinfg::Point &point, sinfg::ValueNode
 }
 
 bool
-StateBLine_Context::on_tangent1_change(const sinfg::Point &point, sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::on_tangent1_change(const synfig::Point &point, synfig::ValueNode_Const::Handle value_node)
 {
        BLinePoint bline_point(value_node->get_value().get(BLinePoint()));
        bline_point.set_tangent1(point);
@@ -1036,7 +1036,7 @@ StateBLine_Context::on_tangent1_change(const sinfg::Point &point, sinfg::ValueNo
 }
 
 bool
-StateBLine_Context::on_tangent2_change(const sinfg::Point &point, sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::on_tangent2_change(const synfig::Point &point, synfig::ValueNode_Const::Handle value_node)
 {
        BLinePoint bline_point(value_node->get_value().get(BLinePoint()));
        bline_point.set_tangent2(point);
@@ -1054,7 +1054,7 @@ StateBLine_Context::loop_bline()
 }
 
 void
-StateBLine_Context::popup_vertex_menu(sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::popup_vertex_menu(synfig::ValueNode_Const::Handle value_node)
 {
        menu.items().clear();
 
@@ -1076,7 +1076,7 @@ StateBLine_Context::popup_vertex_menu(sinfg::ValueNode_Const::Handle value_node)
 }
 
 void
-StateBLine_Context::popup_bezier_menu(float location, sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::popup_bezier_menu(float location, synfig::ValueNode_Const::Handle value_node)
 {
        menu.items().clear();
 
@@ -1094,7 +1094,7 @@ StateBLine_Context::popup_bezier_menu(float location, sinfg::ValueNode_Const::Ha
 }
 
 void
-StateBLine_Context::bline_insert_vertex(sinfg::ValueNode_Const::Handle value_node, float origin)
+StateBLine_Context::bline_insert_vertex(synfig::ValueNode_Const::Handle value_node, float origin)
 {
        list<ValueNode_Const::Handle>::iterator iter;
        
@@ -1156,7 +1156,7 @@ StateBLine_Context::bline_insert_vertex(sinfg::ValueNode_Const::Handle value_nod
 }
 
 void
-StateBLine_Context::bline_delete_vertex(sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::bline_delete_vertex(synfig::ValueNode_Const::Handle value_node)
 {
        list<ValueNode_Const::Handle>::iterator iter;
        
@@ -1175,7 +1175,7 @@ StateBLine_Context::bline_delete_vertex(sinfg::ValueNode_Const::Handle value_nod
 }
 
 void
-StateBLine_Context::popup_handle_menu(sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::popup_handle_menu(synfig::ValueNode_Const::Handle value_node)
 {
        menu.items().clear();
 
@@ -1200,7 +1200,7 @@ StateBLine_Context::popup_handle_menu(sinfg::ValueNode_Const::Handle value_node)
 }
 
 void
-StateBLine_Context::bline_detach_handle(sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::bline_detach_handle(synfig::ValueNode_Const::Handle value_node)
 {
        BLinePoint bline_point(value_node->get_value().get(BLinePoint()));
        bline_point.set_split_tangent_flag(true);
@@ -1210,7 +1210,7 @@ StateBLine_Context::bline_detach_handle(sinfg::ValueNode_Const::Handle value_nod
 }
 
 void
-StateBLine_Context::bline_attach_handle(sinfg::ValueNode_Const::Handle value_node)
+StateBLine_Context::bline_attach_handle(synfig::ValueNode_Const::Handle value_node)
 {
        BLinePoint bline_point(value_node->get_value().get(BLinePoint()));
        bline_point.set_tangent1((bline_point.get_tangent1()+bline_point.get_tangent2())*0.5);
index 03b0b39..a86d95f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file rotoscope_bline.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_ROTOSCOPE_BLINE_H
-#define __SINFG_STUDIO_ROTOSCOPE_BLINE_H
+#ifndef __SYNFIG_STUDIO_ROTOSCOPE_BLINE_H
+#define __SYNFIG_STUDIO_ROTOSCOPE_BLINE_H
 
 /* === H E A D E R S ======================================================= */
 
index 3969a6f..0bf4e62 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_circle.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_circle.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
@@ -47,7 +47,7 @@
 #include <gtkmm/optionmenu.h>
 #include "duck.h"
 #include "widget_enum.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -55,7 +55,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -91,7 +91,7 @@ class studio::StateCircle_Context : public sigc::trackable
        bool prev_workarea_layer_status_;
                
        //Toolbox settings
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
        
        //Toolbox display
        Gtk::Table options_table;
@@ -108,8 +108,8 @@ class studio::StateCircle_Context : public sigc::trackable
        
 public:
 
-       sinfg::String get_id()const { return entry_id.get_text(); }
-       void set_id(const sinfg::String& x) { return entry_id.set_text(x); }
+       synfig::String get_id()const { return entry_id.get_text(); }
+       void set_id(const synfig::String& x) { return entry_id.set_text(x); }
 
        int get_falloff()const { return enum_falloff.get_value(); }
        void set_falloff(int x) { return enum_falloff.set_value(x); }
@@ -137,8 +137,8 @@ public:
 
        //Canvas interaction
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        //Modifying settings etc.
@@ -272,7 +272,7 @@ StateCircle_Context::StateCircle_Context(CanvasView* canvas_view):
        is_working(*canvas_view),
        duckmatic_push(get_work_area()),
        prev_workarea_layer_status_(get_work_area()->allow_layer_clicks),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        entry_id(),
        adj_feather(0,0,1,0.01,0.1),
        spin_feather(adj_feather,0.1,3),
@@ -391,8 +391,8 @@ StateCircle_Context::event_refresh_handler(const Smach::event& x)
 void
 StateCircle_Context::make_circle(const Point& _p1, const Point& _p2)
 {
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Circle"));
-       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Circle"));
+       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
 
        Layer::Handle layer;
        
@@ -407,7 +407,7 @@ StateCircle_Context::make_circle(const Point& _p1, const Point& _p2)
                canvas=layer->get_canvas();
        }
 
-       const sinfg::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
+       const synfig::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
        const Point p1(transform.unperform(_p1));
        const Point p2(transform.unperform(_p2));
        
index a794300..05add28 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_circle.h
 **     \brief Circle creation state
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_CIRCLE_H
-#define __SINFG_STUDIO_STATE_CIRCLE_H
+#ifndef __SYNFIG_STUDIO_STATE_CIRCLE_H
+#define __SYNFIG_STUDIO_STATE_CIRCLE_H
 
 /* === H E A D E R S ======================================================= */
 
index 6e5d7d6..2c772b6 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file rotoscope_bline.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
+#include <synfig/valuenode_dynamiclist.h>
 
 #include "state_draw.h"
 #include "state_stroke.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
-#include <sinfg/valuenode_bline.h>
-#include <sinfg/valuenode_composite.h>
+#include <synfig/valuenode_bline.h>
+#include <synfig/valuenode_composite.h>
 #include <ETL/hermite>
 #include <ETL/calculus>
 #include <utility>
@@ -47,8 +47,8 @@
 #include "event_layerclick.h"
 #include "toolbox.h"
 
-#include <sinfgapp/blineconvert.h>
-#include <sinfgapp/main.h>
+#include <synfigapp/blineconvert.h>
+#include <synfigapp/main.h>
 
 #include <ETL/gaussian>
 #include "dialog_tooloptions.h"
@@ -66,7 +66,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -79,8 +79,8 @@ StateDraw studio::state_draw;
 
 class studio::StateDraw_Context : public sigc::trackable
 {
-       typedef etl::smart_ptr<std::list<sinfg::Point> > StrokeData;
-       typedef etl::smart_ptr<std::list<sinfg::Real> > WidthData;
+       typedef etl::smart_ptr<std::list<synfig::Point> > StrokeData;
+       typedef etl::smart_ptr<std::list<synfig::Real> > WidthData;
        
        typedef list< pair<StrokeData,WidthData> > StrokeQueue;
        
@@ -103,7 +103,7 @@ class studio::StateDraw_Context : public sigc::trackable
 
        //Duckmatic::Push duckmatic_push;
        
-       std::list< etl::smart_ptr<std::list<sinfg::Point> > > stroke_list;
+       std::list< etl::smart_ptr<std::list<synfig::Point> > > stroke_list;
 
        void refresh_ducks();
        
@@ -111,15 +111,15 @@ class studio::StateDraw_Context : public sigc::trackable
 
        void fill_last_stroke();
        
-       Smach::event_result new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_flag,float radius);
+       Smach::event_result new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline_flag,float radius);
 
-       Smach::event_result new_region(std::list<sinfg::BLinePoint> bline,sinfg::Real radius);
+       Smach::event_result new_region(std::list<synfig::BLinePoint> bline,synfig::Real radius);
 
-       Smach::event_result extend_bline_from_begin(ValueNode_BLine::Handle value_node,std::list<sinfg::BLinePoint> bline);
-       Smach::event_result extend_bline_from_end(ValueNode_BLine::Handle value_node,std::list<sinfg::BLinePoint> bline);
-       void reverse_bline(std::list<sinfg::BLinePoint> &bline);
+       Smach::event_result extend_bline_from_begin(ValueNode_BLine::Handle value_node,std::list<synfig::BLinePoint> bline);
+       Smach::event_result extend_bline_from_end(ValueNode_BLine::Handle value_node,std::list<synfig::BLinePoint> bline);
+       void reverse_bline(std::list<synfig::BLinePoint> &bline);
 
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
 
        Gtk::Table options_table;
        Gtk::CheckButton checkbutton_pressure_width;
@@ -145,7 +145,7 @@ class studio::StateDraw_Context : public sigc::trackable
        void UpdateErrorBox();  //switches the stuff if need be :)
 
        //Added by Adrian - data drive HOOOOO
-       sinfgapp::BLineConverter blineconv;
+       synfigapp::BLineConverter blineconv;
 
 public:
        bool get_pressure_width_flag()const { return checkbutton_pressure_width.get_active(); }
@@ -201,12 +201,12 @@ public:
        ~StateDraw_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Time get_time()const { return get_canvas_interface()->get_time(); }
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Time get_time()const { return get_canvas_interface()->get_time(); }
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
-       //void on_user_click(sinfg::Point point);
+       //void on_user_click(synfig::Point point);
 
 //     bool run();
 };     // END of class StateDraw_Context
@@ -311,7 +311,7 @@ StateDraw_Context::StateDraw_Context(CanvasView* canvas_view):
        is_working(*canvas_view),
        loop_(false),
        prev_workarea_layer_status_(get_work_area()->allow_layer_clicks),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        checkbutton_pressure_width(_("Pressure Width")),
        checkbutton_auto_loop(_("Auto Loop")),
        checkbutton_auto_connect(_("Auto Connect")),
@@ -328,7 +328,7 @@ StateDraw_Context::StateDraw_Context(CanvasView* canvas_view):
        check_localerror(_("LocalError"))
        
 {
-       sinfg::info("STATE SKETCH: entering state");
+       synfig::info("STATE SKETCH: entering state");
 
        nested=0;
        load_settings();
@@ -421,7 +421,7 @@ StateDraw_Context::refresh_tool_options()
        App::dialog_tool_options->set_name("draw");
        
        App::dialog_tool_options->add_button(
-               Gtk::StockID("sinfg-fill"),
+               Gtk::StockID("synfig-fill"),
                _("Fill Last Stroke")
        )->signal_clicked().connect(
                sigc::mem_fun(
@@ -506,14 +506,14 @@ StateDraw_Context::event_mouse_down_handler(const Smach::event& x)
 
 struct debugclass
 {
-       sinfg::String x;
-       debugclass(const sinfg::String &x):x(x)
+       synfig::String x;
+       debugclass(const synfig::String &x):x(x)
        {
-//             sinfg::warning(">>>>>>>>>>>>>>>>>>> "+x);
+//             synfig::warning(">>>>>>>>>>>>>>>>>>> "+x);
        }
        ~debugclass()
        {
-//             sinfg::warning("<<<<<<<<<<<<<<<<<<< "+x);
+//             synfig::warning("<<<<<<<<<<<<<<<<<<< "+x);
        }
 };
 
@@ -533,7 +533,7 @@ StateDraw_Context::event_stroke(const Smach::event& x)
 
        assert(event.stroke_data);
 
-       get_work_area()->add_stroke(event.stroke_data,sinfgapp::Main::get_foreground_color());
+       get_work_area()->add_stroke(event.stroke_data,synfigapp::Main::get_foreground_color());
        
        if(nested==0)
        {
@@ -571,30 +571,30 @@ StateDraw_Context::process_stroke(StrokeData stroke_data, WidthData width_data,
 //     debugclass debugger("StateDraw_Context::process_stroke");
        DepthCounter depth_counter(nested);
        
-       const float radius(sinfgapp::Main::get_bline_width().units(get_canvas()->rend_desc())+(abs(get_work_area()->get_pw())+abs(get_work_area()->get_ph()))*5);
+       const float radius(synfigapp::Main::get_bline_width().units(get_canvas()->rend_desc())+(abs(get_work_area()->get_pw())+abs(get_work_area()->get_ph()))*5);
 
 
        // If we aren't using pressure width,
        // then set all the width to 1
        if(!get_pressure_width_flag())
        {
-               std::list<sinfg::Real>::iterator iter;
+               std::list<synfig::Real>::iterator iter;
                for(iter=width_data->begin();iter!=width_data->end();++iter)
                {
                        *iter=1.0;
                }
        }
        
-       //get_work_area()->add_stroke(event.stroke_data,sinfgapp::Main::get_foreground_color());
+       //get_work_area()->add_stroke(event.stroke_data,synfigapp::Main::get_foreground_color());
        //stroke_list.push_back(event.stroke_data);
        //refresh_ducks();
                
-       std::list<sinfg::BLinePoint> bline;
+       std::list<synfig::BLinePoint> bline;
        bool loop_bline_flag(false);
        
        //Changed by Adrian - use resident class :)
-       //sinfgapp::convert_stroke_to_bline(bline, *event.stroke_data,*event.width_data, sinfgapp::Main::get_bline_width());
-       blineconv.width = sinfgapp::Main::get_bline_width().units(get_canvas()->rend_desc());
+       //synfigapp::convert_stroke_to_bline(bline, *event.stroke_data,*event.width_data, synfigapp::Main::get_bline_width());
+       blineconv.width = synfigapp::Main::get_bline_width().units(get_canvas()->rend_desc());
        
        if(get_local_error_flag())
        {
@@ -614,7 +614,7 @@ StateDraw_Context::process_stroke(StrokeData stroke_data, WidthData width_data,
        //Postprocess to require minimum pressure
        if(get_min_pressure_flag())
        {
-               sinfgapp::BLineConverter::EnforceMinWidth(bline,get_min_pressure());
+               synfigapp::BLineConverter::EnforceMinWidth(bline,get_min_pressure());
        }
        
        // If the start and end points are similar, then make then the same point
@@ -665,18 +665,18 @@ StateDraw_Context::process_stroke(StrokeData stroke_data, WidthData width_data,
 }
 
 Smach::event_result
-StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_flag,float radius)
+StateDraw_Context::new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline_flag,float radius)
 {
        // Create the action group
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Sketch BLine"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Sketch BLine"));
 
-       //ValueNode_BLine::Handle value_node(ValueNode_BLine::create(sinfg::ValueBase(bline,loop_bline_flag)));
+       //ValueNode_BLine::Handle value_node(ValueNode_BLine::create(synfig::ValueBase(bline,loop_bline_flag)));
        ValueNode_BLine::Handle value_node;
 
        {
-               std::list<sinfg::BLinePoint> trans_bline;
-               std::list<sinfg::BLinePoint>::iterator iter;
-               const sinfg::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
+               std::list<synfig::BLinePoint> trans_bline;
+               std::list<synfig::BLinePoint>::iterator iter;
+               const synfig::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
                
                for(iter=bline.begin();iter!=bline.end();++iter)
                {
@@ -699,7 +699,7 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
                        
                        trans_bline.push_back(bline_point);
                }
-               value_node=ValueNode_BLine::create(sinfg::ValueBase(trans_bline,loop_bline_flag));
+               value_node=ValueNode_BLine::create(synfig::ValueBase(trans_bline,loop_bline_flag));
        }
 
        // Find any ducks at the start or end that we might attach to
@@ -712,7 +712,7 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
                
                if(start_duck)do
                {
-                       sinfgapp::ValueDesc value_desc(start_duck->get_value_desc());
+                       synfigapp::ValueDesc value_desc(start_duck->get_value_desc());
                        if(!value_desc)
                        {
                                break;
@@ -744,13 +744,13 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
 
                        switch(value_desc.get_value_type())
                        {
-                       case sinfg::ValueBase::TYPE_BLINEPOINT:
+                       case synfig::ValueBase::TYPE_BLINEPOINT:
                                //get_canvas_interface()->auto_export(value_desc);
                                //value_node->list.front().value_node=value_desc.get_value_node();
                                
-                               value_desc=sinfgapp::ValueDesc(LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node()),0);
+                               value_desc=synfigapp::ValueDesc(LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node()),0);
                                //break;
-                       case sinfg::ValueBase::TYPE_VECTOR:
+                       case synfig::ValueBase::TYPE_VECTOR:
                                get_canvas_interface()->auto_export(value_desc);
                                LinkableValueNode::Handle::cast_dynamic(value_node->list.front().value_node)->set_link(0,value_desc.get_value_node());
                                break;
@@ -761,7 +761,7 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
                
                if(finish_duck)do
                {
-                       sinfgapp::ValueDesc value_desc(finish_duck->get_value_desc());
+                       synfigapp::ValueDesc value_desc(finish_duck->get_value_desc());
                        if(!value_desc)
                        {
                                break;
@@ -791,13 +791,13 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
 
                        switch(value_desc.get_value_type())
                        {
-                       case sinfg::ValueBase::TYPE_BLINEPOINT:
+                       case synfig::ValueBase::TYPE_BLINEPOINT:
                                //get_canvas_interface()->auto_export(value_desc);
                                //value_node->list.back().value_node=value_desc.get_value_node();
 
-                               value_desc=sinfgapp::ValueDesc(LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node()),0);
+                               value_desc=synfigapp::ValueDesc(LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node()),0);
                                //break;
-                       case sinfg::ValueBase::TYPE_VECTOR:
+                       case synfig::ValueBase::TYPE_VECTOR:
                                get_canvas_interface()->auto_export(value_desc);
                                LinkableValueNode::Handle::cast_dynamic(value_node->list.back().value_node)->set_link(0,value_desc.get_value_node());
                                break;
@@ -822,9 +822,9 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
                        canvas=layer->get_canvas();
                }
                
-               //int number(sinfg::UniqueID().get_uid());
+               //int number(synfig::UniqueID().get_uid());
                
-               sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+               synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
                
                if(get_region_only_flag())
                        layer=get_canvas_interface()->add_layer_to("region",canvas,depth);
@@ -842,7 +842,7 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
                
                
                
-               sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_param_connect"));
+               synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
                
                assert(action);
                
@@ -850,9 +850,9 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
                action->set_param("canvas_interface",get_canvas_interface());                   
                action->set_param("layer",layer);                       
                if(!action->set_param("param",String("bline")))
-                       sinfg::error("LayerParamConnect didn't like \"param\"");
+                       synfig::error("LayerParamConnect didn't like \"param\"");
                if(!action->set_param("value_node",ValueNode::Handle(value_node)))
-                       sinfg::error("LayerParamConnect didn't like \"value_node\"");
+                       synfig::error("LayerParamConnect didn't like \"value_node\"");
                
                if(!get_canvas_interface()->get_instance()->perform_action(action))
                {
@@ -870,42 +870,42 @@ StateDraw_Context::new_bline(std::list<sinfg::BLinePoint> bline,bool loop_bline_
 }
 
 Smach::event_result
-StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real radius)
+StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real radius)
 {
        // Create the action group
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Define Region"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Define Region"));
        
-       std::list<sinfgapp::ValueDesc> vertex_list;
+       std::list<synfigapp::ValueDesc> vertex_list;
        
        // First we need to come up with a rough list of
        // BLinePoints that we are going to be using to
        // define our region. 
        {
-               std::list<sinfg::BLinePoint>::iterator iter;
+               std::list<synfig::BLinePoint>::iterator iter;
                for(iter=bline.begin();iter!=bline.end();++iter)
                {
                        etl::handle<Duck> duck(get_work_area()->find_duck(iter->get_vertex(),0,Duck::TYPE_VERTEX));
                        
                        if(!duck)
                        {
-                               sinfg::info(__FILE__":%d: Nothing to enclose!",__LINE__);                               
+                               synfig::info(__FILE__":%d: Nothing to enclose!",__LINE__);                              
                                return Smach::RESULT_OK;                
                        }
                        
                        
                        assert(duck->get_type()==Duck::TYPE_VERTEX);
                        
-                       sinfgapp::ValueDesc value_desc(duck->get_value_desc());
+                       synfigapp::ValueDesc value_desc(duck->get_value_desc());
                        
                        if(!value_desc)
                        {
-                               sinfg::info(__FILE__":%d: Got a hit, but no ValueDesc on this duck",__LINE__);                          
+                               synfig::info(__FILE__":%d: Got a hit, but no ValueDesc on this duck",__LINE__);                         
                                continue;
                        }
                        
                        switch(value_desc.get_value_type())
                        {
-                       case sinfg::ValueBase::TYPE_BLINEPOINT:
+                       case synfig::ValueBase::TYPE_BLINEPOINT:
                                //if(vertex_list.empty() || value_desc!=vertex_list.back())
                                vertex_list.push_back(value_desc);
                                assert(vertex_list.back().is_valid());
@@ -919,7 +919,7 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
        
        if(vertex_list.size()<=2)
        {
-               sinfg::info(__FILE__":%d: Vertex list too small to make region.",__LINE__);
+               synfig::info(__FILE__":%d: Vertex list too small to make region.",__LINE__);
                return Smach::RESULT_OK;                
        }
 
@@ -941,25 +941,25 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                // change it back to false.
                done=true;
                
-               std::list<sinfgapp::ValueDesc>::iterator prev,iter,next;
+               std::list<synfigapp::ValueDesc>::iterator prev,iter,next;
                prev=vertex_list.end();prev--;  // Set prev to the last ValueDesc
                next=vertex_list.begin();
                iter=next++; // Set iter to the first value desc, and next to the second
                
                for(;iter!=vertex_list.end();prev=iter,iter=next++)
                {
-                       sinfgapp::ValueDesc value_prev(*prev);
-                       sinfgapp::ValueDesc value_desc(*iter);
-                       sinfgapp::ValueDesc value_next((next==vertex_list.end())?vertex_list.front():*next);
+                       synfigapp::ValueDesc value_prev(*prev);
+                       synfigapp::ValueDesc value_desc(*iter);
+                       synfigapp::ValueDesc value_next((next==vertex_list.end())?vertex_list.front():*next);
                        
                        assert(value_desc.is_valid());
                        assert(value_next.is_valid());
                        assert(value_prev.is_valid());
                        
-                       //sinfg::info("-------");
-                       //sinfg::info(__FILE__":%d: value_prev 0x%08X:%d",__LINE__,value_prev.get_parent_value_node().get(),value_prev.get_index());
-                       //sinfg::info(__FILE__":%d: value_desc 0x%08X:%d",__LINE__,value_desc.get_parent_value_node().get(),value_desc.get_index());
-                       //sinfg::info(__FILE__":%d: value_next 0x%08X:%d",__LINE__,value_next.get_parent_value_node().get(),value_next.get_index());
+                       //synfig::info("-------");
+                       //synfig::info(__FILE__":%d: value_prev 0x%08X:%d",__LINE__,value_prev.get_parent_value_node().get(),value_prev.get_index());
+                       //synfig::info(__FILE__":%d: value_desc 0x%08X:%d",__LINE__,value_desc.get_parent_value_node().get(),value_desc.get_index());
+                       //synfig::info(__FILE__":%d: value_next 0x%08X:%d",__LINE__,value_next.get_parent_value_node().get(),value_next.get_index());
 
                        /*
                        if(value_prev.parent_is_value_node() && value_desc.parent_is_value_node() && value_next.parent_is_value_node())
@@ -1000,14 +1000,14 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                                if(value_desc.get_index()<value_next.get_index()-1)
                                {
                                        DEBUGPOINT();
-                                       vertex_list.insert(next,sinfgapp::ValueDesc(value_desc.get_parent_value_node(),value_desc.get_index()+1));
+                                       vertex_list.insert(next,synfigapp::ValueDesc(value_desc.get_parent_value_node(),value_desc.get_index()+1));
                                        done=false;
                                        break;
                                }
                                if(value_next.get_index()<value_desc.get_index()-1)
                                {
                                        DEBUGPOINT();
-                                       vertex_list.insert(next,sinfgapp::ValueDesc(value_desc.get_parent_value_node(),value_next.get_index()+1));
+                                       vertex_list.insert(next,synfigapp::ValueDesc(value_desc.get_parent_value_node(),value_next.get_index()+1));
                                        done=false;
                                        break;
                                }
@@ -1023,9 +1023,9 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                                BLinePoint vertex(value_desc.get_value(get_time()).get(BLinePoint()));
                                BLinePoint vertex_next(value_next.get_value(get_time()).get(BLinePoint()));
 
-                               //sinfg::info("--------");
-                               //sinfg::info(__FILE__":%d: vertex: [%f, %f]",__LINE__,vertex.get_vertex()[0],vertex.get_vertex()[1]);
-                               //sinfg::info(__FILE__":%d: vertex_next: [%f, %f]",__LINE__,vertex_next.get_vertex()[0],vertex_next.get_vertex()[1]);
+                               //synfig::info("--------");
+                               //synfig::info(__FILE__":%d: vertex: [%f, %f]",__LINE__,vertex.get_vertex()[0],vertex.get_vertex()[1]);
+                               //synfig::info(__FILE__":%d: vertex_next: [%f, %f]",__LINE__,vertex_next.get_vertex()[0],vertex_next.get_vertex()[1]);
                                
                                if((vertex.get_vertex()-vertex_next.get_vertex()).mag_squared()<radius*radius)
                                {
@@ -1036,7 +1036,7 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                                        value_node_next=ValueNode_Composite::Handle::cast_dynamic(value_next.get_value_node().clone());
                                        if(!value_node || !value_node_next)
                                        {
-                                               sinfg::info(__FILE__":%d: Unable to properly connect blines.",__LINE__);
+                                               synfig::info(__FILE__":%d: Unable to properly connect blines.",__LINE__);
                                                continue;
                                        }
                                        DEBUGPOINT();
@@ -1045,7 +1045,7 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
 
                                        get_canvas_interface()->auto_export(value_node);
                                        assert(value_node->is_exported());
-                                       *iter=sinfgapp::ValueDesc(get_canvas(),value_node->get_id());
+                                       *iter=synfigapp::ValueDesc(get_canvas(),value_node->get_id());
                                        vertex_list.erase(next);
                                        done=false;
                                        break;                                  
@@ -1058,14 +1058,14 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                                        if(!positive_trend && value_desc.get_index()>0)
                                        {
                                                DEBUGPOINT();
-                                               vertex_list.insert(next,sinfgapp::ValueDesc(value_desc.get_parent_value_node(),value_desc.get_index()-1));
+                                               vertex_list.insert(next,synfigapp::ValueDesc(value_desc.get_parent_value_node(),value_desc.get_index()-1));
                                                done=false;
                                                break;                                  
                                        }
                                        if(positive_trend && value_desc.get_index()<LinkableValueNode::Handle::cast_static(value_desc.get_value_node())->link_count()-1)
                                        {
                                                DEBUGPOINT();
-                                               vertex_list.insert(next,sinfgapp::ValueDesc(value_desc.get_parent_value_node(),value_desc.get_index()+1));
+                                               vertex_list.insert(next,synfigapp::ValueDesc(value_desc.get_parent_value_node(),value_desc.get_index()+1));
                                                done=false;
                                                break;                                  
                                        }
@@ -1077,7 +1077,7 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
 
        if(vertex_list.size()<=2)
        {
-               sinfg::info(__FILE__":%d: Vertex list too small to make region.",__LINE__);
+               synfig::info(__FILE__":%d: Vertex list too small to make region.",__LINE__);
                return Smach::RESULT_OK;                
        }
        
@@ -1093,7 +1093,7 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                
                trivial_case_value_node=vertex_list.front().get_parent_value_node();
                
-               std::list<sinfgapp::ValueDesc>::iterator iter;
+               std::list<synfigapp::ValueDesc>::iterator iter;
                for(iter=vertex_list.begin();iter!=vertex_list.end();++iter)
                {
                        if(trivial_case_value_node!=iter->get_parent_value_node())
@@ -1113,7 +1113,7 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
        {
                value_node_bline=ValueNode_BLine::create();
 
-               std::list<sinfgapp::ValueDesc>::iterator iter;          
+               std::list<synfigapp::ValueDesc>::iterator iter;         
                for(iter=vertex_list.begin();iter!=vertex_list.end();++iter)
                {
                        // Ensure that the vertex is exported.
@@ -1143,11 +1143,11 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                        canvas=layer->get_canvas();
                }
                
-               sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+               synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
                
                layer=get_canvas_interface()->add_layer_to("region",canvas,depth);
                assert(layer);
-               layer->set_param("color",sinfgapp::Main::get_background_color());
+               layer->set_param("color",synfigapp::Main::get_background_color());
                if(get_feather())
                {
                        layer->set_param("feather",get_feather());
@@ -1155,7 +1155,7 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                }
                get_canvas_interface()->signal_layer_param_changed()(layer,"color");
 
-               sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_param_connect"));
+               synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
                
                assert(action);
                
@@ -1163,9 +1163,9 @@ StateDraw_Context::new_region(std::list<sinfg::BLinePoint> bline, sinfg::Real ra
                action->set_param("canvas_interface",get_canvas_interface());                   
                action->set_param("layer",layer);                       
                if(!action->set_param("param",String("bline")))
-                       sinfg::error("LayerParamConnect didn't like \"param\"");
+                       synfig::error("LayerParamConnect didn't like \"param\"");
                if(!action->set_param("value_node",ValueNode::Handle(value_node_bline)))
-                       sinfg::error("LayerParamConnect didn't like \"value_node\"");
+                       synfig::error("LayerParamConnect didn't like \"value_node\"");
                
                if(!get_canvas_interface()->get_instance()->perform_action(action))
                {
@@ -1187,7 +1187,7 @@ StateDraw_Context::refresh_ducks()
        get_work_area()->clear_ducks();
        
        
-       std::list< etl::smart_ptr<std::list<sinfg::Point> > >::iterator iter;
+       std::list< etl::smart_ptr<std::list<synfig::Point> > >::iterator iter;
        
        for(iter=stroke_list.begin();iter!=stroke_list.end();++iter)
        {
@@ -1200,28 +1200,28 @@ StateDraw_Context::refresh_ducks()
 
 
 Smach::event_result
-StateDraw_Context::extend_bline_from_begin(ValueNode_BLine::Handle value_node,std::list<sinfg::BLinePoint> bline)
+StateDraw_Context::extend_bline_from_begin(ValueNode_BLine::Handle value_node,std::list<synfig::BLinePoint> bline)
 {
        // Create the action group
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Extend BLine"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Extend BLine"));
        
-       std::list<sinfg::BLinePoint>::reverse_iterator iter;
+       std::list<synfig::BLinePoint>::reverse_iterator iter;
        iter=bline.rbegin();
        for(;!(iter==bline.rend());++iter)
        {
                //iter->reverse();
                ValueNode_Composite::Handle composite(ValueNode_Composite::create(*iter));
 
-               sinfgapp::Action::Handle action(sinfgapp::Action::create("value_node_dynamic_list_insert"));
+               synfigapp::Action::Handle action(synfigapp::Action::create("value_node_dynamic_list_insert"));
                
                assert(action);
-               sinfgapp::ValueDesc value_desc(value_node,0);
+               synfigapp::ValueDesc value_desc(value_node,0);
                
                action->set_param("canvas",get_canvas());                       
                action->set_param("canvas_interface",get_canvas_interface());                   
                action->set_param("value_desc",value_desc);
                if(!action->set_param("item",ValueNode::Handle(composite)))
-                       sinfg::error("ACTION didn't like \"item\"");
+                       synfig::error("ACTION didn't like \"item\"");
                
                if(!get_canvas_interface()->get_instance()->perform_action(action))
                {
@@ -1236,27 +1236,27 @@ StateDraw_Context::extend_bline_from_begin(ValueNode_BLine::Handle value_node,st
 }
 
 Smach::event_result
-StateDraw_Context::extend_bline_from_end(ValueNode_BLine::Handle value_node,std::list<sinfg::BLinePoint> bline)
+StateDraw_Context::extend_bline_from_end(ValueNode_BLine::Handle value_node,std::list<synfig::BLinePoint> bline)
 {
        // Create the action group
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Extend BLine"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Extend BLine"));
 
-       std::list<sinfg::BLinePoint>::iterator iter;
+       std::list<synfig::BLinePoint>::iterator iter;
        iter=bline.begin();
        for(;iter!=bline.end();++iter)
        {
                ValueNode_Composite::Handle composite(ValueNode_Composite::create(*iter));
 
-               sinfgapp::Action::Handle action(sinfgapp::Action::create("value_node_dynamic_list_insert"));
+               synfigapp::Action::Handle action(synfigapp::Action::create("value_node_dynamic_list_insert"));
                
                assert(action);
-               sinfgapp::ValueDesc value_desc(value_node,value_node->link_count());
+               synfigapp::ValueDesc value_desc(value_node,value_node->link_count());
                
                action->set_param("canvas",get_canvas());                       
                action->set_param("canvas_interface",get_canvas_interface());                   
                action->set_param("value_desc",value_desc);
                if(!action->set_param("item",ValueNode::Handle(composite)))
-                       sinfg::error("ACTION didn't like \"item\"");
+                       synfig::error("ACTION didn't like \"item\"");
                
                if(!get_canvas_interface()->get_instance()->perform_action(action))
                {
@@ -1271,11 +1271,11 @@ StateDraw_Context::extend_bline_from_end(ValueNode_BLine::Handle value_node,std:
 }
 
 void
-StateDraw_Context::reverse_bline(std::list<sinfg::BLinePoint> &bline)
+StateDraw_Context::reverse_bline(std::list<synfig::BLinePoint> &bline)
 {
        int i;
        
-       std::list<sinfg::BLinePoint>::iterator iter,eiter;
+       std::list<synfig::BLinePoint>::iterator iter,eiter;
        iter=bline.begin();
        eiter=bline.end();
        eiter--;
@@ -1293,19 +1293,19 @@ StateDraw_Context::fill_last_stroke()
        if(!last_stroke)
                return;
        
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Fill Stroke"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Fill Stroke"));
 
        Layer::Handle layer;
        
        get_canvas_interface()->auto_export(last_stroke);                       
 
-       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
        
        layer=get_canvas_interface()->add_layer("region");
        assert(layer);
-       layer->set_param("color",sinfgapp::Main::get_background_color());
+       layer->set_param("color",synfigapp::Main::get_background_color());
 
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_param_connect"));
+       synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
        
        assert(action);
        
@@ -1313,9 +1313,9 @@ StateDraw_Context::fill_last_stroke()
        action->set_param("canvas_interface",get_canvas_interface());                   
        action->set_param("layer",layer);                       
        if(!action->set_param("param",String("segment_list")))
-               sinfg::error("LayerParamConnect didn't like \"param\"");
+               synfig::error("LayerParamConnect didn't like \"param\"");
        if(!action->set_param("value_node",ValueNode::Handle(last_stroke)))
-               sinfg::error("LayerParamConnect didn't like \"value_node\"");
+               synfig::error("LayerParamConnect didn't like \"value_node\"");
        
        if(!get_canvas_interface()->get_instance()->perform_action(action))
        {
index b84319b..7b49359 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_roto.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_ROTOSCOPE_H
-#define __SINFG_STUDIO_STATE_ROTOSCOPE_H
+#ifndef __SYNFIG_STUDIO_STATE_ROTOSCOPE_H
+#define __SYNFIG_STUDIO_STATE_ROTOSCOPE_H
 
 /* === H E A D E R S ======================================================= */
 
index f6f106a..bf56d1b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_eyedrop.cpp
 **     \brief Template File
 **
 
 #include "state_eyedrop.h"
 #include "workarea.h"
-#include <sinfg/context.h>
+#include <synfig/context.h>
 #include "app.h"
 #include "dialog_color.h"
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "canvasview.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -45,7 +45,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -94,7 +94,7 @@ StateEyedrop_Context::StateEyedrop_Context(CanvasView *canvas_view):
        canvas_view(canvas_view),
        is_working(*canvas_view)
 {
-       sinfg::info("Enterted Eyedrop State");
+       synfig::info("Enterted Eyedrop State");
        canvas_view->work_area->set_cursor(Gdk::Cursor(Gdk::CROSSHAIR));
        
        App::toolbox->refresh();
@@ -102,7 +102,7 @@ StateEyedrop_Context::StateEyedrop_Context(CanvasView *canvas_view):
 
 StateEyedrop_Context::~StateEyedrop_Context()
 {
-       sinfg::info("Left Eyedrop State");
+       synfig::info("Left Eyedrop State");
        canvas_view->work_area->reset_cursor();
        App::toolbox->refresh();
 }
@@ -110,7 +110,7 @@ StateEyedrop_Context::~StateEyedrop_Context()
 Smach::event_result
 StateEyedrop_Context::event_stop_handler(const Smach::event& x)
 {
-       sinfg::info("STATE EYEDROP: Received Stop Event");
+       synfig::info("STATE EYEDROP: Received Stop Event");
        throw Smach::egress_exception();
 //     canvas_view->get_smach().pop_state();
 //     return Smach::RESULT_ACCEPT;
@@ -119,7 +119,7 @@ StateEyedrop_Context::event_stop_handler(const Smach::event& x)
 Smach::event_result
 StateEyedrop_Context::event_refresh_handler(const Smach::event& x)
 {
-       sinfg::info("STATE EYEDROP: Received Refresh Event");
+       synfig::info("STATE EYEDROP: Received Refresh Event");
        canvas_view->work_area->queue_render_preview();
        return Smach::RESULT_ACCEPT;
 }
@@ -127,12 +127,12 @@ StateEyedrop_Context::event_refresh_handler(const Smach::event& x)
 Smach::event_result
 StateEyedrop_Context::event_workarea_mouse_button_down_handler(const Smach::event& x)
 {
-       sinfg::info("STATE EYEDROP: Received mouse button down Event");
+       synfig::info("STATE EYEDROP: Received mouse button down Event");
        const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
        if(event.button==BUTTON_LEFT)
        {
                Color color(canvas_view->get_canvas()->get_context().get_color(event.pos));
-               sinfgapp::Main::set_foreground_color(color);
+               synfigapp::Main::set_foreground_color(color);
                studio::App::dialog_color->set_color(color);
                return Smach::RESULT_ACCEPT;
        }
index 0ceea46..74dd035 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_eyedrop.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STATE_EYEDROP_H
-#define __SINFG_STATE_EYEDROP_H
+#ifndef __SYNFIG_STATE_EYEDROP_H
+#define __SYNFIG_STATE_EYEDROP_H
 
 /* === H E A D E R S ======================================================= */
 
index 07d2aad..062d716 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_fill.cpp
 **     \brief Template File
 **
 
 #include "state_fill.h"
 #include "workarea.h"
-#include <sinfg/context.h>
+#include <synfig/context.h>
 #include "app.h"
 #include "dialog_color.h"
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "canvasview.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -45,7 +45,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -69,8 +69,8 @@ public:
 
 
        etl::handle<CanvasView> get_canvas_view()const{return canvas_view;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view->get_work_area();}
 
 
@@ -101,7 +101,7 @@ StateFill_Context::StateFill_Context(CanvasView *canvas_view):
        canvas_view(canvas_view),
        is_working(*canvas_view)
 {
-       sinfg::info("Enterted Fill State");
+       synfig::info("Enterted Fill State");
        canvas_view->work_area->set_cursor(Gdk::CROSSHAIR);
        
        App::toolbox->refresh();
@@ -109,7 +109,7 @@ StateFill_Context::StateFill_Context(CanvasView *canvas_view):
 
 StateFill_Context::~StateFill_Context()
 {
-       sinfg::info("Left Fill State");
+       synfig::info("Left Fill State");
        canvas_view->work_area->reset_cursor();
        App::toolbox->refresh();
 }
@@ -117,7 +117,7 @@ StateFill_Context::~StateFill_Context()
 Smach::event_result
 StateFill_Context::event_stop_handler(const Smach::event& x)
 {
-       sinfg::info("STATE FILL: Received Stop Event");
+       synfig::info("STATE FILL: Received Stop Event");
        throw Smach::egress_exception();
 //     canvas_view->get_smach().pop_state();
 //     return Smach::RESULT_ACCEPT;
@@ -126,7 +126,7 @@ StateFill_Context::event_stop_handler(const Smach::event& x)
 Smach::event_result
 StateFill_Context::event_refresh_handler(const Smach::event& x)
 {
-       sinfg::info("STATE FILL: Received Refresh Event");
+       synfig::info("STATE FILL: Received Refresh Event");
        canvas_view->work_area->queue_render_preview();
        return Smach::RESULT_ACCEPT;
 }
@@ -134,7 +134,7 @@ StateFill_Context::event_refresh_handler(const Smach::event& x)
 Smach::event_result
 StateFill_Context::event_workarea_layer_clicked_handler(const Smach::event& x)
 {
-       sinfg::info("STATE FILL: Received layer clicked Event");
+       synfig::info("STATE FILL: Received layer clicked Event");
        const EventLayerClick& event(*reinterpret_cast<const EventLayerClick*>(&x));
 
        if(!event.layer)
@@ -144,10 +144,10 @@ StateFill_Context::event_workarea_layer_clicked_handler(const Smach::event& x)
        }
 
        
-       //sinfgapp::Action::Handle action(sinfgapp::Action::create("value_desc_set"));
-       sinfgapp::ValueDesc value_desc(event.layer,"color");
+       //synfigapp::Action::Handle action(synfigapp::Action::create("value_desc_set"));
+       synfigapp::ValueDesc value_desc(event.layer,"color");
 
-       if(!get_canvas_interface()->change_value(value_desc,ValueBase(sinfgapp::Main::get_foreground_color())))
+       if(!get_canvas_interface()->change_value(value_desc,ValueBase(synfigapp::Main::get_foreground_color())))
        {
                get_canvas_view()->get_ui_interface()->warning(_("Unable to set layer color"));
                return Smach::RESULT_ERROR;
@@ -161,9 +161,9 @@ StateFill_Context::event_workarea_layer_clicked_handler(const Smach::event& x)
        action->set_param("time",get_canvas_interface()->get_time());
        //action->set_param("layer",event.layer);                       
        //if(!action->set_param("param",String("color")))
-       //      sinfg::error("LayerParamConnect didn't like \"param\"");
-       if(!action->set_param("new_value",ValueBase(sinfgapp::Main::get_foreground_color())))
-               sinfg::error("LayerParamConnect didn't like \"foreground_color\"");
+       //      synfig::error("LayerParamConnect didn't like \"param\"");
+       if(!action->set_param("new_value",ValueBase(synfigapp::Main::get_foreground_color())))
+               synfig::error("LayerParamConnect didn't like \"foreground_color\"");
        
        if(!get_canvas_interface()->get_instance()->perform_action(action))
        {
index 8de778d..c5f3226 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_fill.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STATE_FILL_H
-#define __SINFG_STATE_FILL_H
+#ifndef __SYNFIG_STATE_FILL_H
+#define __SYNFIG_STATE_FILL_H
 
 /* === H E A D E R S ======================================================= */
 
index b34f222..7759a24 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_gradient.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_gradient.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
@@ -48,7 +48,7 @@
 #include "duck.h"
 
 #include "widget_enum.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -56,7 +56,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -82,7 +82,7 @@ class studio::StateGradient_Context : public sigc::trackable
        
        Duckmatic::Push duckmatic_push;
        
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
 
        Point point_holder;
        
@@ -98,8 +98,8 @@ class studio::StateGradient_Context : public sigc::trackable
        Widget_Enum     enum_blend;
        
 public:
-       sinfg::String get_id()const { return entry_id.get_text(); }
-       void set_id(const sinfg::String& x) { return entry_id.set_text(x); }
+       synfig::String get_id()const { return entry_id.get_text(); }
+       void set_id(const synfig::String& x) { return entry_id.set_text(x); }
 
        int get_type()const { return enum_type.get_value(); }
        void set_type(int x) { return enum_type.set_value(x); }
@@ -121,11 +121,11 @@ public:
        ~StateGradient_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
-       //void on_user_click(sinfg::Point point);
+       //void on_user_click(synfig::Point point);
        void load_settings();
        void save_settings();
        void reset();
@@ -243,7 +243,7 @@ StateGradient_Context::StateGradient_Context(CanvasView* canvas_view):
        canvas_view_(canvas_view),
        is_working(*canvas_view),
        duckmatic_push(get_work_area()),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        prev_workarea_layer_status_(get_work_area()->allow_layer_clicks),
        entry_id()
 {
@@ -360,8 +360,8 @@ StateGradient_Context::event_refresh_handler(const Smach::event& x)
 void
 StateGradient_Context::make_gradient(const Point& _p1, const Point& _p2)
 {
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Gradient"));
-       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Gradient"));
+       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
 
        Layer::Handle layer;
        
@@ -375,7 +375,7 @@ StateGradient_Context::make_gradient(const Point& _p1, const Point& _p2)
                depth=layer->get_depth();
                canvas=layer->get_canvas();
        }
-       const sinfg::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
+       const synfig::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
        const Point p1(transform.unperform(_p1));
        const Point p2(transform.unperform(_p2));
 
index 97abee6..106cd76 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_gradient.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_GRADIENT_H
-#define __SINFG_STUDIO_STATE_GRADIENT_H
+#ifndef __SYNFIG_STUDIO_STATE_GRADIENT_H
+#define __SYNFIG_STUDIO_STATE_GRADIENT_H
 
 /* === H E A D E R S ======================================================= */
 
index 00d0cdb..e9ee361 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -36,9 +36,9 @@
 #include "dialog_tooloptions.h"
 #include <gtkmm/dialog.h>
 #include "widget_waypointmodel.h"
-#include <sinfg/valuenode_animated.h>
-#include <sinfg/valuenode_composite.h>
-#include <sinfg/valuenode_const.h>
+#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_composite.h>
+#include <synfig/valuenode_const.h>
 #include "canvasview.h"
 #endif
 
@@ -46,7 +46,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -60,7 +60,7 @@ class studio::StateNormal_Context : public sigc::trackable
        CanvasView* get_canvas_view() { return canvas_view; }
        Canvas::Handle get_canvas() { return canvas_view->get_canvas(); }
        WorkArea* get_work_area() { return canvas_view->get_work_area(); }
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface() { return canvas_view->canvas_interface(); }
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface() { return canvas_view->canvas_interface(); }
        
 public:
        StateNormal_Context(CanvasView *canvas_view);
@@ -84,7 +84,7 @@ public:
 
        Smach::event_result event_layer_click(const Smach::event& x);
 
-       void edit_several_waypoints(std::list<sinfgapp::ValueDesc> value_desc_list);
+       void edit_several_waypoints(std::list<synfigapp::ValueDesc> value_desc_list);
 
        void refresh_tool_options();
 }; // END of class StateNormal_Context
@@ -118,12 +118,12 @@ StateNormal::~StateNormal()
 StateNormal_Context::StateNormal_Context(CanvasView *canvas_view):
        canvas_view(canvas_view)
 {
-       sinfg::info("Enterted Normal State");
+       synfig::info("Enterted Normal State");
 }
 
 StateNormal_Context::~StateNormal_Context()
 {
-       sinfg::info("Left Normal State");
+       synfig::info("Left Normal State");
 }
 
 void
@@ -143,7 +143,7 @@ StateNormal_Context::event_refresh_tool_options(const Smach::event& x)
 Smach::event_result
 StateNormal_Context::event_stop_handler(const Smach::event& x)
 {
-       sinfg::info("STATE NORMAL: Received Stop Event");
+       synfig::info("STATE NORMAL: Received Stop Event");
        canvas_view->stop();
        return Smach::RESULT_ACCEPT;
 }
@@ -151,7 +151,7 @@ StateNormal_Context::event_stop_handler(const Smach::event& x)
 Smach::event_result
 StateNormal_Context::event_refresh_handler(const Smach::event& x)
 {
-       sinfg::info("STATE NORMAL: Received Refresh Event");
+       synfig::info("STATE NORMAL: Received Refresh Event");
        canvas_view->rebuild_tables();
        canvas_view->work_area->queue_render_preview();
        return Smach::RESULT_ACCEPT;
@@ -160,7 +160,7 @@ StateNormal_Context::event_refresh_handler(const Smach::event& x)
 Smach::event_result
 StateNormal_Context::event_refresh_ducks_handler(const Smach::event& x)
 {
-       sinfg::info("STATE NORMAL: Received Refresh Ducks");
+       synfig::info("STATE NORMAL: Received Refresh Ducks");
        canvas_view->queue_rebuild_ducks();
        return Smach::RESULT_ACCEPT;
 }
@@ -168,7 +168,7 @@ StateNormal_Context::event_refresh_ducks_handler(const Smach::event& x)
 Smach::event_result
 StateNormal_Context::event_undo_handler(const Smach::event& x)
 {
-       sinfg::info("STATE NORMAL: Received Undo Event");
+       synfig::info("STATE NORMAL: Received Undo Event");
        canvas_view->get_instance()->undo();
        return Smach::RESULT_ACCEPT;
 }
@@ -176,7 +176,7 @@ StateNormal_Context::event_undo_handler(const Smach::event& x)
 Smach::event_result
 StateNormal_Context::event_redo_handler(const Smach::event& x)
 {
-       sinfg::info("STATE NORMAL: Received Redo Event");
+       synfig::info("STATE NORMAL: Received Redo Event");
        canvas_view->get_instance()->redo();
        return Smach::RESULT_ACCEPT;
 }
@@ -184,7 +184,7 @@ StateNormal_Context::event_redo_handler(const Smach::event& x)
 Smach::event_result
 StateNormal_Context::event_mouse_button_down_handler(const Smach::event& x)
 {
-       sinfg::info("STATE NORMAL: Received mouse button down Event");
+       synfig::info("STATE NORMAL: Received mouse button down Event");
 
        const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
 
@@ -205,11 +205,11 @@ StateNormal_Context::event_layer_click(const Smach::event& x)
        
        if(event.layer)
        {
-               sinfg::info("STATE NORMAL: Received layer click Event, \"%s\"",event.layer->get_name().c_str());
+               synfig::info("STATE NORMAL: Received layer click Event, \"%s\"",event.layer->get_name().c_str());
        }
        else
        {
-               sinfg::info("STATE NORMAL: Received layer click Event with an empty layer.");
+               synfig::info("STATE NORMAL: Received layer click Event with an empty layer.");
        }
        
        switch(event.button)
@@ -244,7 +244,7 @@ StateNormal_Context::event_layer_click(const Smach::event& x)
 
 /*
 void
-StateNormal_Context::edit_several_waypoints(std::list<sinfgapp::ValueDesc> value_desc_list)
+StateNormal_Context::edit_several_waypoints(std::list<synfigapp::ValueDesc> value_desc_list)
 {
        Gtk::Dialog dialog(
                "Edit Multiple Waypoints",              // Title
@@ -266,12 +266,12 @@ StateNormal_Context::edit_several_waypoints(std::list<sinfgapp::ValueDesc> value
        if(dialog.run()==0)
                return;
        DEBUGPOINT();
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Set Waypoints"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Set Waypoints"));
 
-       std::list<sinfgapp::ValueDesc>::iterator iter;
+       std::list<synfigapp::ValueDesc>::iterator iter;
        for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
        {
-               sinfgapp::ValueDesc value_desc(*iter);
+               synfigapp::ValueDesc value_desc(*iter);
                
                if(!value_desc.is_valid())
                        continue;
@@ -291,17 +291,17 @@ StateNormal_Context::edit_several_waypoints(std::list<sinfgapp::ValueDesc> value
                        
                        value_node=ValueNode_Animated::create(value,get_canvas()->get_time());
                        
-                       sinfgapp::Action::Handle action;
+                       synfigapp::Action::Handle action;
                        
                        if(!value_desc.is_value_node())
                        {
-                               action=sinfgapp::Action::create("value_desc_connect");
+                               action=synfigapp::Action::create("value_desc_connect");
                                action->set_param("dest",value_desc);
                                action->set_param("src",ValueNode::Handle(value_node));
                        }
                        else
                        {
-                               action=sinfgapp::Action::create("value_node_replace");
+                               action=synfigapp::Action::create("value_node_replace");
                                action->set_param("dest",value_desc.get_value_node());
                                action->set_param("src",ValueNode::Handle(value_node));
                        }
@@ -327,7 +327,7 @@ StateNormal_Context::edit_several_waypoints(std::list<sinfgapp::ValueDesc> value
                if(value_node)
                {
                        
-                       sinfgapp::Action::Handle action(sinfgapp::Action::create("waypoint_set_smart"));
+                       synfigapp::Action::Handle action(synfigapp::Action::create("waypoint_set_smart"));
 
                        if(!action)
                        {
@@ -364,18 +364,18 @@ StateNormal_Context::edit_several_waypoints(std::list<sinfgapp::ValueDesc> value
 Smach::event_result
 StateNormal_Context::event_multiple_ducks_clicked_handler(const Smach::event& x)
 {
-       sinfg::info("STATE NORMAL: Received multiple duck click event");
+       synfig::info("STATE NORMAL: Received multiple duck click event");
 
        //const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
 
-       std::list<sinfgapp::ValueDesc> value_desc_list;
+       std::list<synfigapp::ValueDesc> value_desc_list;
        
        // Create a list of value_descs associated with selection
        const DuckList selected_ducks(get_work_area()->get_selected_ducks());
        DuckList::const_iterator iter;
        for(iter=selected_ducks.begin();iter!=selected_ducks.end();++iter)
        {
-               sinfgapp::ValueDesc value_desc((*iter)->get_value_desc());
+               synfigapp::ValueDesc value_desc((*iter)->get_value_desc());
                
                if(!value_desc.is_valid())
                        continue;
@@ -383,7 +383,7 @@ StateNormal_Context::event_multiple_ducks_clicked_handler(const Smach::event& x)
                if(value_desc.get_value_type()==ValueBase::TYPE_BLINEPOINT && value_desc.is_value_node() && ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()))
                {
                        value_desc_list.push_back(
-                               sinfgapp::ValueDesc(
+                               synfigapp::ValueDesc(
                                        ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node())
                                        ,0
                                )
@@ -398,10 +398,10 @@ StateNormal_Context::event_multiple_ducks_clicked_handler(const Smach::event& x)
        canvas_view->get_instance()->make_param_menu(menu,canvas_view->get_canvas(),value_desc_list);
        
        /*
-       sinfgapp::Action::ParamList param_list;
+       synfigapp::Action::ParamList param_list;
        param_list=get_canvas_interface()->generate_param_list(value_desc_list);
 
-       canvas_view->add_actions_to_menu(menu, param_list,sinfgapp::Action::CATEGORY_VALUEDESC|sinfgapp::Action::CATEGORY_VALUENODE);
+       canvas_view->add_actions_to_menu(menu, param_list,synfigapp::Action::CATEGORY_VALUEDESC|synfigapp::Action::CATEGORY_VALUENODE);
 
        menu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Edit Waypoints"),
                sigc::bind(
index 68938e7..2917a6d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_normal.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STATE_NORMAL_H
-#define __SINFG_STATE_NORMAL_H
+#ifndef __SYNFIG_STATE_NORMAL_H
+#define __SYNFIG_STATE_NORMAL_H
 
 /* === H E A D E R S ======================================================= */
 
index cd185fc..8936386 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file rotoscope_polygon.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_polygon.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "dialog_tooloptions.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -52,7 +52,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -75,14 +75,14 @@ class studio::StatePolygon_Context : public sigc::trackable
 
        Duckmatic::Push duckmatic_push;
        
-       std::list<sinfg::Point> polygon_point_list;
-       sinfgapp::Settings& settings;
+       std::list<synfig::Point> polygon_point_list;
+       synfigapp::Settings& settings;
 
        
-       bool on_polygon_duck_change(const sinfg::Point &point, std::list<sinfg::Point>::iterator iter);
+       bool on_polygon_duck_change(const synfig::Point &point, std::list<synfig::Point>::iterator iter);
 
 
-       void popup_handle_menu(sinfgapp::ValueDesc value_desc);
+       void popup_handle_menu(synfigapp::ValueDesc value_desc);
 
 
        void refresh_ducks();
@@ -92,8 +92,8 @@ class studio::StatePolygon_Context : public sigc::trackable
        Gtk::Button button_make;
 
 public:
-       sinfg::String get_id()const { return entry_id.get_text(); }
-       void set_id(const sinfg::String& x) { return entry_id.set_text(x); }
+       synfig::String get_id()const { return entry_id.get_text(); }
+       void set_id(const synfig::String& x) { return entry_id.set_text(x); }
 
        Smach::event_result event_stop_handler(const Smach::event& x);
 
@@ -108,11 +108,11 @@ public:
        ~StatePolygon_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
-       //void on_user_click(sinfg::Point point);
+       //void on_user_click(synfig::Point point);
        void load_settings();
        void save_settings();
        void reset();
@@ -216,7 +216,7 @@ StatePolygon_Context::StatePolygon_Context(CanvasView* canvas_view):
        is_working(*canvas_view),
        prev_workarea_layer_status_(get_work_area()->allow_layer_clicks),
        duckmatic_push(get_work_area()),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        entry_id(),
        button_make(_("Make"))
 {
@@ -322,7 +322,7 @@ StatePolygon_Context::~StatePolygon_Context()
 Smach::event_result
 StatePolygon_Context::event_stop_handler(const Smach::event& x)
 {
-       sinfg::info("STATE RotoPolygon: Received Stop Event");
+       synfig::info("STATE RotoPolygon: Received Stop Event");
        //throw Smach::egress_exception();
        reset();
        return Smach::RESULT_ACCEPT;
@@ -332,7 +332,7 @@ StatePolygon_Context::event_stop_handler(const Smach::event& x)
 Smach::event_result
 StatePolygon_Context::event_refresh_handler(const Smach::event& x)
 {
-       sinfg::info("STATE RotoPolygon: Received Refresh Event");
+       synfig::info("STATE RotoPolygon: Received Refresh Event");
        refresh_ducks();
        return Smach::RESULT_ACCEPT;
 }
@@ -361,8 +361,8 @@ StatePolygon_Context::run()
                }
 
                {
-                       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Polygon"));
-                       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+                       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Polygon"));
+                       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
        
                        Layer::Handle layer(get_canvas_interface()->add_layer_to("polygon",canvas,depth));
                        layer->set_description(get_id());
@@ -377,8 +377,8 @@ StatePolygon_Context::run()
                        }
                        
                        {
-                               sinfgapp::Action::Handle action(sinfgapp::Action::create("value_desc_convert"));
-                               sinfgapp::ValueDesc value_desc(layer,"vector_list");
+                               synfigapp::Action::Handle action(synfigapp::Action::create("value_desc_convert"));
+                               synfigapp::ValueDesc value_desc(layer,"vector_list");
                                action->set_param("canvas",get_canvas());                       
                                action->set_param("canvas_interface",get_canvas_interface());                   
                                action->set_param("value_desc",value_desc);                     
@@ -413,7 +413,7 @@ StatePolygon_Context::run()
 Smach::event_result
 StatePolygon_Context::event_mouse_click_handler(const Smach::event& x)
 {
-       sinfg::info("STATE ROTOPOLYGON: Received mouse button down Event");
+       synfig::info("STATE ROTOPOLYGON: Received mouse button down Event");
        const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
        switch(event.button)
        {
@@ -438,7 +438,7 @@ StatePolygon_Context::refresh_ducks()
        
        if(polygon_point_list.empty()) return;
 
-       std::list<sinfg::Point>::iterator iter=polygon_point_list.begin();
+       std::list<synfig::Point>::iterator iter=polygon_point_list.begin();
        
        etl::handle<WorkArea::Duck> duck;
        duck=new WorkArea::Duck(*iter);
@@ -472,7 +472,7 @@ StatePolygon_Context::refresh_ducks()
 
 
 bool
-StatePolygon_Context::on_polygon_duck_change(const sinfg::Point &point, std::list<sinfg::Point>::iterator iter)
+StatePolygon_Context::on_polygon_duck_change(const synfig::Point &point, std::list<synfig::Point>::iterator iter)
 {
        *iter=point;
        return true;
index 7879ec2..ba7d838 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file rotoscope_polygon.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_ROTOSCOPE_POLYGON_H
-#define __SINFG_STUDIO_ROTOSCOPE_POLYGON_H
+#ifndef __SYNFIG_STUDIO_ROTOSCOPE_POLYGON_H
+#define __SYNFIG_STUDIO_ROTOSCOPE_POLYGON_H
 
 /* === H E A D E R S ======================================================= */
 
index 297b477..e871643 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_gradient.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_rectangle.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "dialog_tooloptions.h"
 #include <gtkmm/optionmenu.h>
 #include "duck.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -54,7 +54,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -81,7 +81,7 @@ class studio::StateRectangle_Context : public sigc::trackable
        bool prev_workarea_layer_status_;
                
        //Toolbox settings
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
        
        //Toolbox display
        Gtk::Table options_table;
@@ -95,8 +95,8 @@ class studio::StateRectangle_Context : public sigc::trackable
        
 public:
 
-       sinfg::String get_id()const { return entry_id.get_text(); }
-       void set_id(const sinfg::String& x) { return entry_id.set_text(x); }
+       synfig::String get_id()const { return entry_id.get_text(); }
+       void set_id(const synfig::String& x) { return entry_id.set_text(x); }
 
        Real get_expand()const { return adj_expand.get_value(); }
        void set_expand(Real f) { adj_expand.set_value(f); }
@@ -118,8 +118,8 @@ public:
 
        //Canvas interaction
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        //Modifying settings etc.
@@ -241,7 +241,7 @@ StateRectangle_Context::StateRectangle_Context(CanvasView* canvas_view):
        is_working(*canvas_view),
        duckmatic_push(get_work_area()),
        prev_workarea_layer_status_(get_work_area()->allow_layer_clicks),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        entry_id(),
        adj_expand(0,0,1,0.01,0.1),
        spin_expand(adj_expand,0.1,3),
@@ -347,8 +347,8 @@ StateRectangle_Context::event_refresh_handler(const Smach::event& x)
 void
 StateRectangle_Context::make_rectangle(const Point& _p1, const Point& _p2)
 {
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Rectangle"));
-       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Rectangle"));
+       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
 
        Layer::Handle layer;
        
@@ -366,7 +366,7 @@ StateRectangle_Context::make_rectangle(const Point& _p1, const Point& _p2)
        //create the layer
        layer=get_canvas_interface()->add_layer_to("rectangle",canvas,depth);
 
-       const sinfg::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
+       const synfig::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
        const Point p1(transform.unperform(_p1));
        const Point p2(transform.unperform(_p2));
        
index 96ec24d..17f0e7b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_rectangle.h
 **     \brief Rectangle creation state
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_RECTANGLE_H
-#define __SINFG_STUDIO_STATE_RECTANGLE_H
+#ifndef __SYNFIG_STUDIO_STATE_RECTANGLE_H
+#define __SYNFIG_STUDIO_STATE_RECTANGLE_H
 
 /* === H E A D E R S ======================================================= */
 
index 6761482..df76994 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_rotate.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_rotate.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "dialog_tooloptions.h"
 #include <gtkmm/optionmenu.h>
 #include "duck.h"
-#include <sinfg/angle.h>
-#include <sinfgapp/main.h>
+#include <synfig/angle.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -55,7 +55,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -73,15 +73,15 @@ StateRotate studio::state_rotate;
 class DuckDrag_Rotate : public DuckDrag_Base
 {
 
-       sinfg::Vector last_rotate;
-       sinfg::Vector drag_offset;
-       sinfg::Vector center;
-       sinfg::Vector snap;
+       synfig::Vector last_rotate;
+       synfig::Vector drag_offset;
+       synfig::Vector center;
+       synfig::Vector snap;
 
        Angle original_angle;
        Real original_mag;
 
-       std::vector<sinfg::Vector> positions;
+       std::vector<synfig::Vector> positions;
        
        
        bool bad_drag;
@@ -91,11 +91,11 @@ public:
        etl::handle<CanvasView> canvas_view_;
        bool use_magnitude;
        DuckDrag_Rotate();
-       void begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& begin);
+       void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
        bool end_duck_drag(Duckmatic* duckmatic);
-       void duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector);
+       void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
 
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
 };
 
 
@@ -103,7 +103,7 @@ class studio::StateRotate_Context : public sigc::trackable
 {
        etl::handle<CanvasView> canvas_view_;
                
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
 
        etl::handle<DuckDrag_Rotate> duck_dragger_;
 
@@ -128,8 +128,8 @@ public:
        ~StateRotate_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        void load_settings();
@@ -167,7 +167,7 @@ StateRotate_Context::save_settings()
 
 StateRotate_Context::StateRotate_Context(CanvasView* canvas_view):
        canvas_view_(canvas_view),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        duck_dragger_(new DuckDrag_Rotate()),
        checkbutton_scale(_("Allow Scale"))
 {      
@@ -233,7 +233,7 @@ DuckDrag_Rotate::DuckDrag_Rotate()
 }
 
 void
-DuckDrag_Rotate::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offset)
+DuckDrag_Rotate::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
 {
        last_rotate=Vector(1,1);
 
@@ -277,20 +277,20 @@ DuckDrag_Rotate::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offs
                move_only=false;
 
        
-       sinfg::Vector vect(offset-center);
+       synfig::Vector vect(offset-center);
        original_angle=Angle::tan(vect[1],vect[0]);
        original_mag=vect.mag();
 }
 
 
 void
-DuckDrag_Rotate::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)
+DuckDrag_Rotate::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
 {
        if(bad_drag)
                return;
        
        //std::set<etl::handle<Duck> >::iterator iter;
-       sinfg::Vector vect(duckmatic->snap_point_to_grid(vector)-center+snap);
+       synfig::Vector vect(duckmatic->snap_point_to_grid(vector)-center+snap);
 
        const DuckList selected_ducks(duckmatic->get_selected_ducks());
        DuckList::const_iterator iter;
@@ -363,12 +363,12 @@ DuckDrag_Rotate::end_duck_drag(Duckmatic* duckmatic)
        if(bad_drag)return false;
        if(move_only)
        {
-               sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Move Duck"));
+               synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Move Duck"));
                duckmatic->signal_edited_selected_ducks();
                return true;
        }
        
-       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Rotate Ducks"));
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Rotate Ducks"));
                
        if((last_rotate-Vector(1,1)).mag()>0.0001)
        {
index 8bce187..ce8adf1 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_rotate.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_ROTATE_H
-#define __SINFG_STUDIO_STATE_ROTATE_H
+#ifndef __SYNFIG_STUDIO_STATE_ROTATE_H
+#define __SYNFIG_STUDIO_STATE_ROTATE_H
 
 /* === H E A D E R S ======================================================= */
 
index 94525b3..f3dade5 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_scale.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_scale.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "dialog_tooloptions.h"
 #include <gtkmm/optionmenu.h>
 #include "duck.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -54,7 +54,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -68,12 +68,12 @@ StateScale studio::state_scale;
 class DuckDrag_Scale : public DuckDrag_Base
 {
 
-       sinfg::Vector last_scale;
-       sinfg::Vector drag_offset;
-       sinfg::Vector center;
-       sinfg::Vector snap;
+       synfig::Vector last_scale;
+       synfig::Vector drag_offset;
+       synfig::Vector center;
+       synfig::Vector snap;
 
-       std::vector<sinfg::Vector> positions;
+       std::vector<synfig::Vector> positions;
 
        bool move_only;
        
@@ -81,9 +81,9 @@ class DuckDrag_Scale : public DuckDrag_Base
 public:
        bool lock_aspect;
        DuckDrag_Scale();
-       void begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& begin);
+       void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
        bool end_duck_drag(Duckmatic* duckmatic);
-       void duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector);
+       void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
 };
 
 
@@ -91,7 +91,7 @@ class studio::StateScale_Context : public sigc::trackable
 {
        etl::handle<CanvasView> canvas_view_;
                
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
 
        etl::handle<DuckDrag_Scale> duck_dragger_;
 
@@ -116,8 +116,8 @@ public:
        ~StateScale_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        void load_settings();
@@ -155,7 +155,7 @@ StateScale_Context::save_settings()
 
 StateScale_Context::StateScale_Context(CanvasView* canvas_view):
        canvas_view_(canvas_view),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        duck_dragger_(new DuckDrag_Scale()),
        checkbutton_aspect_lock(_("Lock Aspect Ratio"))
 {      
@@ -222,7 +222,7 @@ DuckDrag_Scale::DuckDrag_Scale():
 #endif
 
 void
-DuckDrag_Scale::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offset)
+DuckDrag_Scale::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
 {
        last_scale=Vector(1,1);
        const DuckList selected_ducks(duckmatic->get_selected_ducks());
@@ -266,7 +266,7 @@ DuckDrag_Scale::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offse
 
 
 void
-DuckDrag_Scale::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)
+DuckDrag_Scale::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
 {
        const DuckList selected_ducks(duckmatic->get_selected_ducks());
        DuckList::const_iterator iter;
@@ -275,7 +275,7 @@ DuckDrag_Scale::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)
                return;
        
        //std::set<etl::handle<Duck> >::iterator iter;
-       sinfg::Vector vect(duckmatic->snap_point_to_grid(vector)-center);
+       synfig::Vector vect(duckmatic->snap_point_to_grid(vector)-center);
        last_scale=vect;
 
        if(move_only)
index bc715b0..1db58b6 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_scale.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_SCALE_H
-#define __SINFG_STUDIO_STATE_SCALE_H
+#ifndef __SYNFIG_STUDIO_STATE_SCALE_H
+#define __SYNFIG_STUDIO_STATE_SCALE_H
 
 /* === H E A D E R S ======================================================= */
 
index 743953b..f96e4c4 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_sketch.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
+#include <synfig/valuenode_dynamiclist.h>
 
 #include "state_sketch.h"
 #include "state_stroke.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
-#include <sinfg/valuenode_bline.h>
+#include <synfig/valuenode_bline.h>
 #include <ETL/hermite>
 #include <ETL/calculus>
 #include <utility>
@@ -46,8 +46,8 @@
 #include "event_layerclick.h"
 #include "toolbox.h"
 
-#include <sinfgapp/blineconvert.h>
-#include <sinfgapp/main.h>
+#include <synfigapp/blineconvert.h>
+#include <synfigapp/main.h>
 
 #include <ETL/gaussian>
 
@@ -65,7 +65,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -120,9 +120,9 @@ public:
        ~StateSketch_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Time get_time()const { return get_canvas_interface()->get_time(); }
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Time get_time()const { return get_canvas_interface()->get_time(); }
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
 };     // END of class StateSketch_Context
@@ -149,7 +149,7 @@ StateSketch::~StateSketch()
 void
 StateSketch_Context::save_sketch()
 {
-       sinfg::String filename(basename(get_canvas()->get_file_name())+".sketch");
+       synfig::String filename(basename(get_canvas()->get_file_name())+".sketch");
        
        while(App::dialog_save_file(_("Save Sketch"), filename))
        {
@@ -168,7 +168,7 @@ StateSketch_Context::save_sketch()
 void
 StateSketch_Context::load_sketch()
 {
-       sinfg::String filename(basename(get_canvas()->get_file_name())+".sketch");
+       synfig::String filename(basename(get_canvas()->get_file_name())+".sketch");
        
        while(App::dialog_open_file(_("Load Sketch"), filename))
        {
@@ -485,7 +485,7 @@ StateSketch_Context::event_stroke(const Smach::event& x)
 
        assert(event.stroke_data);
                
-       get_work_area()->add_persistant_stroke(event.stroke_data,sinfgapp::Main::get_foreground_color());
+       get_work_area()->add_persistant_stroke(event.stroke_data,synfigapp::Main::get_foreground_color());
 
        return Smach::RESULT_ACCEPT;
 }
index 820528e..ea2e13f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_sketch.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_SKETCH_H
-#define __SINFG_STUDIO_STATE_SKETCH_H
+#ifndef __SYNFIG_STUDIO_STATE_SKETCH_H
+#define __SYNFIG_STUDIO_STATE_SKETCH_H
 
 /* === H E A D E R S ======================================================= */
 
index 3cda4f8..01aeb7d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_smooth_move.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_smoothmove.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
@@ -47,7 +47,7 @@
 #include <gtkmm/optionmenu.h>
 #include "duck.h"
 #include "onemoment.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -55,7 +55,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -70,18 +70,18 @@ class DuckDrag_SmoothMove : public DuckDrag_Base
 {
        float radius;
 
-       sinfg::Vector last_translate_;
-       sinfg::Vector drag_offset_;
-       sinfg::Vector snap;
+       synfig::Vector last_translate_;
+       synfig::Vector drag_offset_;
+       synfig::Vector snap;
        
-       std::vector<sinfg::Vector> last_;
-       std::vector<sinfg::Vector> positions;
+       std::vector<synfig::Vector> last_;
+       std::vector<synfig::Vector> positions;
        
 public:
        DuckDrag_SmoothMove();
-       void begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& begin);
+       void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
        bool end_duck_drag(Duckmatic* duckmatic);
-       void duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector);
+       void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
 
        void set_radius(float x) { radius=x; }
        float get_radius()const { return radius; }      
@@ -94,7 +94,7 @@ class studio::StateSmoothMove_Context : public sigc::trackable
        
        //Duckmatic::Push duckmatic_push;
        
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
 
        etl::handle<DuckDrag_SmoothMove> duck_dragger_;
 
@@ -122,8 +122,8 @@ public:
        ~StateSmoothMove_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        void load_settings();
@@ -162,7 +162,7 @@ StateSmoothMove_Context::save_settings()
 StateSmoothMove_Context::StateSmoothMove_Context(CanvasView* canvas_view):
        canvas_view_(canvas_view),
 //     duckmatic_push(get_work_area()),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        duck_dragger_(new DuckDrag_SmoothMove()),
        adj_radius(1,0,100000,0.01,0.1),
        spin_radius(adj_radius,0.1,3)
@@ -229,7 +229,7 @@ DuckDrag_SmoothMove::DuckDrag_SmoothMove():radius(1.0f)
 }
 
 void
-DuckDrag_SmoothMove::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offset)
+DuckDrag_SmoothMove::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
 {
        last_translate_=Vector(0,0);
                drag_offset_=duckmatic->find_duck(offset)->get_trans_point();
@@ -251,11 +251,11 @@ DuckDrag_SmoothMove::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector&
 }
 
 void
-DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)
+DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
 {
        const DuckList selected_ducks(duckmatic->get_selected_ducks());
        DuckList::const_iterator iter;
-       sinfg::Vector vect(duckmatic->snap_point_to_grid(vector)-drag_offset_+snap);
+       synfig::Vector vect(duckmatic->snap_point_to_grid(vector)-drag_offset_+snap);
        
        int i;
        
@@ -292,7 +292,7 @@ DuckDrag_SmoothMove::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector
 bool
 DuckDrag_SmoothMove::end_duck_drag(Duckmatic* duckmatic)
 {
-       //sinfg::info("end_duck_drag(): Diff= %f",last_translate_.mag());
+       //synfig::info("end_duck_drag(): Diff= %f",last_translate_.mag());
        if(last_translate_.mag()>0.0001)
        {
                const DuckList selected_ducks(duckmatic->get_selected_ducks());
index 038b9d4..9b04b15 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_smoothmove.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_SMOOTHMOVE_H
-#define __SINFG_STUDIO_STATE_SMOOTHMOVE_H
+#ifndef __SYNFIG_STUDIO_STATE_SMOOTHMOVE_H
+#define __SYNFIG_STUDIO_STATE_SMOOTHMOVE_H
 
 /* === H E A D E R S ======================================================= */
 
index f4e91a9..0d3d6d5 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_stroke.cpp
 **     \brief Template File
 **
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
+#include <synfig/valuenode_dynamiclist.h>
 
 #include "state_stroke.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
-#include <sinfg/valuenode_bline.h>
+#include <synfig/valuenode_bline.h>
 #include <ETL/hermite>
 #include <ETL/calculus>
 #include <utility>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -52,7 +52,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -70,9 +70,9 @@ class studio::StateStroke_Context : public sigc::trackable
        
        Duckmatic::Push duckmatic_push;
        
-       etl::smart_ptr<std::list<sinfg::Point> > stroke_data;
+       etl::smart_ptr<std::list<synfig::Point> > stroke_data;
 
-       etl::smart_ptr<std::list<sinfg::Real> > width_data;
+       etl::smart_ptr<std::list<synfig::Real> > width_data;
 
        Gdk::ModifierType modifier;
 
@@ -92,8 +92,8 @@ public:
        ~StateStroke_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
 };     // END of class StateStroke_Context
@@ -125,9 +125,9 @@ StateStroke_Context::StateStroke_Context(CanvasView* canvas_view):
        width_data.spawn();
        stroke_data.spawn();
 
-       get_work_area()->add_stroke(stroke_data, sinfgapp::Main::get_foreground_color());
+       get_work_area()->add_stroke(stroke_data, synfigapp::Main::get_foreground_color());
 
-       sinfg::info("Now Scribbling...");       
+       synfig::info("Now Scribbling...");      
 }
 
 StateStroke_Context::~StateStroke_Context()
@@ -135,7 +135,7 @@ StateStroke_Context::~StateStroke_Context()
        duckmatic_push.restore();
        
        App::toolbox->refresh();
-       sinfg::info("No longer scribbling");    
+       synfig::info("No longer scribbling");   
 
        // Send the stroke data to whatever previously called this state.
        if(stroke_data->size()>=2)
index 481ebd7..df3ac08 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_stroke.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_STROKE_H
-#define __SINFG_STUDIO_STATE_STROKE_H
+#ifndef __SYNFIG_STUDIO_STATE_STROKE_H
+#define __SYNFIG_STUDIO_STATE_STROKE_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -30,7 +30,7 @@
 #include "workarea.h"
 #include <sigc++/object.h>
 #include "duckmatic.h"
-#include <sinfg/blinepoint.h>
+#include <synfig/blinepoint.h>
 #include <list>
 #include <ETL/smart_ptr>
 #include "eventkey.h"
@@ -57,12 +57,12 @@ extern StateStroke state_stroke;
 
 struct EventStroke : public Smach::event
 {
-       etl::smart_ptr<std::list<sinfg::Point> > stroke_data;
-       etl::smart_ptr<std::list<sinfg::Real> > width_data;
+       etl::smart_ptr<std::list<synfig::Point> > stroke_data;
+       etl::smart_ptr<std::list<synfig::Real> > width_data;
        Gdk::ModifierType modifier;
        
-       EventStroke(etl::smart_ptr<std::list<sinfg::Point> > stroke_data,
-                       etl::smart_ptr<std::list<sinfg::Real> > width_data,
+       EventStroke(etl::smart_ptr<std::list<synfig::Point> > stroke_data,
+                       etl::smart_ptr<std::list<synfig::Real> > width_data,
                        Gdk::ModifierType modifier=Gdk::ModifierType(0)
        ):
                Smach::event(EVENT_WORKAREA_STROKE),
index fcf20e1..52c0e67 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_gradient.cpp
 **     \brief Template File
 **
 
 #include <ETL/bezier>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_width.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
@@ -49,8 +49,8 @@
 #include <gtkmm/optionmenu.h>
 #include "duck.h"
 
-//#include <sinfgapp/value_desc.h>
-#include <sinfgapp/main.h>
+//#include <synfigapp/value_desc.h>
+#include <synfigapp/main.h>
 
 #include <ETL/clock>
 
@@ -60,8 +60,8 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
+using namespace synfig;
+using namespace synfigapp;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -97,7 +97,7 @@ class studio::StateWidth_Context : public sigc::trackable
        Duckmatic::Type old_duckmask;
                
        //Toolbox settings
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
        
        //Toolbox display
        Gtk::Table options_table;
@@ -139,8 +139,8 @@ public:
 
        //Canvas interaction
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        //Modifying settings etc.
@@ -211,7 +211,7 @@ StateWidth_Context::StateWidth_Context(CanvasView* canvas_view):
        prev_workarea_duck_clicking(get_work_area()->allow_duck_clicks),
        old_duckmask(get_work_area()->get_type_mask()),
 
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        
        adj_delta(6,0,1,0.001,0.01),
        spin_delta(adj_delta,0.01,3),
@@ -557,7 +557,7 @@ StateWidth_Context::event_mouse_handler(const Smach::event& x)
                //Affect the width changes here...
                map<handle<Duck>,Real>::iterator i = changetable.begin();
 
-               sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Sketch Width")); 
+               synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Sketch Width")); 
                for(; i != changetable.end(); ++i)
                {
                        //for each duck modify IT!!!
@@ -578,7 +578,7 @@ StateWidth_Context::event_mouse_handler(const Smach::event& x)
                                if(!action->is_ready() || !get_canvas_view()->get_instance()->perform_action(action))
                                {
                                        group.cancel();
-                                       sinfg::warning("Changing the width action has failed");
+                                       synfig::warning("Changing the width action has failed");
                                        return Smach::RESULT_ERROR;
                                }
                        }
index db0d202..260b555 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_width.h
 **     \brief Width creation state
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_STATE_WIDTH_H
-#define __SINFG_STUDIO_STATE_WIDTH_H
+#ifndef __SYNFIG_STUDIO_STATE_WIDTH_H
+#define __SYNFIG_STUDIO_STATE_WIDTH_H
 
 /* === H E A D E R S ======================================================= */
 
index 35ee61e..e7d2707 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_zoom.cpp
 **     \brief Zoom Toole Implementation File
 **
@@ -32,7 +32,7 @@
 #include <sigc++/object.h>
 
 #include <ETL/handle>
-#include <sinfg/vector.h>
+#include <synfig/vector.h>
 
 
 #include "state_zoom.h"
@@ -42,7 +42,7 @@
 #include "app.h"
 #include "dialog_tooloptions.h"
 #include "toolbox.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -50,7 +50,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -72,7 +72,7 @@ class studio::StateZoom_Context : public sigc::trackable
        bool prev_workarea_layer_status_;
                
        //Toolbox settings
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
        
        //Toolbox display
        Gtk::Table options_table;
@@ -93,8 +93,8 @@ public:
 
        //Canvas interaction
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        //Modifying settings etc.
@@ -153,7 +153,7 @@ StateZoom_Context::StateZoom_Context(CanvasView* canvas_view):
        canvas_view_(canvas_view),
        is_working(*canvas_view),
        prev_workarea_layer_status_(get_work_area()->allow_layer_clicks),
-       settings(sinfgapp::Main::get_selected_input_device()->settings())
+       settings(synfigapp::Main::get_selected_input_device()->settings())
 {
        // Set up the tool options dialog
        //options_table.attach(*manage(new Gtk::Label(_("Zoom Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);        
index fd1b5de..1d54dfd 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_zoom.h
 **     \brief Zoom tool Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STATE_ZOOM_H
-#define __SINFG_STATE_ZOOM_H
+#ifndef __SYNFIG_STATE_ZOOM_H
+#define __SYNFIG_STATE_ZOOM_H
 
 /* === H E A D E R S ======================================================= */
 #include "smach.h"
index ae88390..0c7f72e 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -31,7 +31,7 @@
 #include "statemanager.h"
 #include <gtkmm/actiongroup.h>
 #include <gtkmm/action.h>
-#include <sinfg/string.h>
+#include <synfig/string.h>
 #include "app.h"
 #include "toolbox.h"
 
@@ -41,7 +41,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -81,7 +81,7 @@ StateManager::add_state(const Smach::state_base *state)
        Glib::RefPtr<Gtk::Action> action(
                Gtk::Action::create(
                        "state-"+name,
-                       Gtk::StockID("sinfg-"+name),
+                       Gtk::StockID("synfig-"+name),
                        name,
                        name
                )
index a255e02..23a7cb0 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STATEMANAGER_H
-#define __SINFG_STATEMANAGER_H
+#ifndef __SYNFIG_STATEMANAGER_H
+#define __SYNFIG_STATEMANAGER_H
 
 /* === H E A D E R S ======================================================= */
 
index 2aea790..7fef232 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template File
 ** $Id: toolbox.cpp,v 1.3 2005/01/13 20:23:01 darco Exp $
 **
 
 #include "widget_defaults.h"
 
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 using namespace SigC;
 
@@ -86,7 +86,7 @@ using namespace SigC;
 
 #define GRAB_HINT_DATA(y,default)      { \
                String x; \
-               if(sinfgapp::Main::settings().get_value(String("pref.")+y+"_hints",x)) \
+               if(synfigapp::Main::settings().get_value(String("pref.")+y+"_hints",x)) \
                { \
                        set_type_hint((Gdk::WindowTypeHint)atoi(x.c_str()));    \
                } else {\
@@ -222,7 +222,7 @@ Toolbox::Toolbox():
 
        filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Open Recent"),*recent_files_menu));
        
-       filemenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-saveall"),
+       filemenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-saveall"),
                sigc::ptr_fun(&studio::App::dialog_not_implemented)));
        filemenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::Stock::CLOSE,
                sigc::ptr_fun(close_selected_instance)));
@@ -252,7 +252,7 @@ Toolbox::Toolbox():
        helpmenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::Stock::HELP,
                sigc::ptr_fun(studio::App::dialog_not_implemented)));   
        helpmenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem());        
-       helpmenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("sinfg-about"),
+       helpmenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-about"),
                sigc::ptr_fun(studio::App::dialog_about)));     
        
        Gtk::MenuBar *menubar1 = manage(new class Gtk::MenuBar());
@@ -268,16 +268,16 @@ Toolbox::Toolbox():
        ADD_TOOLBOX_BUTTON(button_open,"gtk-open","Open");
        ADD_TOOLBOX_BUTTON(button_save,"gtk-save","Save");
        ADD_TOOLBOX_BUTTON(button_saveas,"gtk-save-as","SaveAs");
-       ADD_TOOLBOX_BUTTON(button_save_all,"sinfg-saveall","Save All");
+       ADD_TOOLBOX_BUTTON(button_save_all,"synfig-saveall","Save All");
        TOOLBOX_BUTTON(button_undo,"gtk-undo","Undo");
        TOOLBOX_BUTTON(button_redo,"gtk-redo","Redo");
-       ADD_TOOLBOX_BUTTON(button_about,"sinfg-about","About Sinfg Studio");
-       ADD_TOOLBOX_BUTTON(button_color,"sinfg-color","Color Dialog");
+       ADD_TOOLBOX_BUTTON(button_about,"synfig-about","About Synfig Studio");
+       ADD_TOOLBOX_BUTTON(button_color,"synfig-color","Color Dialog");
        
-       TOOLBOX_BUTTON(button_rotoscope_bline,"sinfg-rotoscope_bline",_("Old Rotoscope BLine"));
-       TOOLBOX_BUTTON(button_rotoscope_polygon,"sinfg-rotoscope_polygon",_("Rotoscope Polygon"));
-       TOOLBOX_BUTTON(button_eyedrop,"sinfg-eyedrop",_("Eyedrop Tool"));
-       TOOLBOX_BUTTON(button_rotoscope,"sinfg-rotoscope_bline",_("Rotoscope 2"));
+       TOOLBOX_BUTTON(button_rotoscope_bline,"synfig-rotoscope_bline",_("Old Rotoscope BLine"));
+       TOOLBOX_BUTTON(button_rotoscope_polygon,"synfig-rotoscope_polygon",_("Rotoscope Polygon"));
+       TOOLBOX_BUTTON(button_eyedrop,"synfig-eyedrop",_("Eyedrop Tool"));
+       TOOLBOX_BUTTON(button_rotoscope,"synfig-rotoscope_bline",_("Rotoscope 2"));
        
 
 
@@ -393,11 +393,11 @@ Toolbox::~Toolbox()
 void
 Toolbox::set_active_state(const String& statename)
 {
-       std::map<sinfg::String,Gtk::ToggleButton *>::iterator iter;
+       std::map<synfig::String,Gtk::ToggleButton *>::iterator iter;
 
        changing_state_=true;
        
-       sinfgapp::Main::set_state(statename);
+       synfigapp::Main::set_state(statename);
        
        try
        {
@@ -425,7 +425,7 @@ Toolbox::set_active_state(const String& statename)
 }
 
 void
-Toolbox::change_state(const sinfg::String& statename)
+Toolbox::change_state(const synfig::String& statename)
 {
        etl::handle<studio::CanvasView> canvas_view(studio::App::get_selected_canvas_view());
        if(canvas_view)
@@ -441,7 +441,7 @@ Toolbox::change_state(const sinfg::String& statename)
                }
                else
                {
-                       sinfg::error("Unknown state \"%s\"",statename.c_str());
+                       synfig::error("Unknown state \"%s\"",statename.c_str());
                }
        }
 }
@@ -491,7 +491,7 @@ Toolbox::add_state(const Smach::state_base *state)
        Gtk::ToggleButton* button;
        button=manage(new class Gtk::ToggleButton());
 
-       icon=manage(new Gtk::Image(Gtk::StockID("sinfg-"+name),Gtk::IconSize(4)));
+       icon=manage(new Gtk::Image(Gtk::StockID("synfig-"+name),Gtk::IconSize(4)));
        button->add(*icon);
        tooltips.set_tip(*button,name);
        icon->show();
@@ -535,14 +535,14 @@ Toolbox::update_undo_redo()
        // so that they are only clickable when they should be.
        if(instance && App::get_selected_canvas_view())
        {
-               std::map<sinfg::String,Gtk::ToggleButton *>::iterator iter;
+               std::map<synfig::String,Gtk::ToggleButton *>::iterator iter;
                
                for(iter=state_button_map.begin();iter!=state_button_map.end();++iter)
                        iter->second->set_sensitive(true);
        }
        else
        {
-               std::map<sinfg::String,Gtk::ToggleButton *>::iterator iter;
+               std::map<synfig::String,Gtk::ToggleButton *>::iterator iter;
                
                for(iter=state_button_map.begin();iter!=state_button_map.end();++iter)
                        iter->second->set_sensitive(false);
@@ -584,19 +584,19 @@ Toolbox::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& contex
        
        if ((selection_data_.get_length() >= 0) && (selection_data_.get_format() == 8))
        {
-               sinfg::String selection_data((gchar *)(selection_data_.get_data()));
+               synfig::String selection_data((gchar *)(selection_data_.get_data()));
 
                // For some reason, GTK hands us a list of URL's seperated
                // by not only Carrage-Returns, but also Line-Feeds.
                // Line-Feeds will mess us up. Remove all the line-feeds.
-               while(selection_data.find_first_of('\r')!=sinfg::String::npos)
+               while(selection_data.find_first_of('\r')!=synfig::String::npos)
                        selection_data.erase(selection_data.begin()+selection_data.find_first_of('\r'));
 
                std::stringstream stream(selection_data);
 
                while(stream)
                {
-                       sinfg::String filename,URI;
+                       synfig::String filename,URI;
                        getline(stream,filename);
                        
                        // If we don't have a filename, move on.
@@ -607,22 +607,22 @@ Toolbox::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& contex
                        URI=String(filename.begin(),filename.begin()+sizeof("file://")-1);
                        if(URI!="file://")
                        {
-                               sinfg::warning("Unknown URI (%s) in \"%s\"",URI.c_str(),filename.c_str());
+                               synfig::warning("Unknown URI (%s) in \"%s\"",URI.c_str(),filename.c_str());
                                continue;
                        }
                        
                        // Strip the "file://" part from the filename
-                       filename=sinfg::String(filename.begin()+sizeof("file://")-1,filename.end());
+                       filename=synfig::String(filename.begin()+sizeof("file://")-1,filename.end());
                
-                       sinfg::info("Attempting to open "+filename);            
+                       synfig::info("Attempting to open "+filename);           
                        if(App::open(filename))
                                success=true;
                        else
-                               sinfg::error("Drop failed: Unable to open "+filename);
+                               synfig::error("Drop failed: Unable to open "+filename);
                }
        }
        else
-               sinfg::error("Drop failed: bad selection data");
+               synfig::error("Drop failed: bad selection data");
 
        // Finish the drag
        context->drag_finish(success, false, time);
index d45829e..dd26c5c 100644 (file)
@@ -1,5 +1,5 @@
 /*! ========================================================================
-** Sinfg
+** Synfig
 ** Template Header File
 ** $Id: toolbox.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
 **
@@ -20,8 +20,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_TOOLBOX_H
-#define __SINFG_GTKMM_TOOLBOX_H
+#ifndef __SYNFIG_GTKMM_TOOLBOX_H
+#define __SYNFIG_GTKMM_TOOLBOX_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -31,7 +31,7 @@
 #include <gtkmm/togglebutton.h>
 #include <gtkmm/menu.h>
 #include <gtkmm/table.h>
-#include <sinfg/string.h>
+#include <synfig/string.h>
 #include "smach.h"
 #include <map>
 #include "dialogsettings.h"
@@ -64,7 +64,7 @@ class Toolbox : public Gtk::Window
        
        Gtk::Table *tool_table;
 
-       std::map<sinfg::String,Gtk::ToggleButton *> state_button_map;
+       std::map<synfig::String,Gtk::ToggleButton *> state_button_map;
        
        Gtk::Menu       *recent_files_menu;
 
@@ -79,13 +79,13 @@ class Toolbox : public Gtk::Window
        
 public:
 
-       void change_state(const sinfg::String& statename);
+       void change_state(const synfig::String& statename);
 
        void update_undo_redo();
 
        void refresh() { update_undo_redo(); }
 
-       void set_active_state(const sinfg::String& statename);
+       void set_active_state(const synfig::String& statename);
 
        void add_state(const Smach::state_base *state);
 
index c4e64b4..53e5026 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file valuelink.cpp
 **     \brief ValueBase Link Implementation File
 **
@@ -36,7 +36,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 
 using studio::ValueBaseLink;
 
index c270831..85e305d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file valuelink.h
 **     \brief ValueBase Link Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_VALUELINK_H
-#define __SINFG_VALUELINK_H
+#ifndef __SYNFIG_VALUELINK_H
+#define __SYNFIG_VALUELINK_H
 
 /* === H E A D E R S ======================================================= */
-#include <sinfg/valuenode.h>
+#include <synfig/valuenode.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -37,40 +37,40 @@ namespace studio {
 
 /* NOTE: DO NOT USE THE INDEX BASED INTERFACE... THINGS WILL CHANGE
 */
-class ValueBaseLink : public sinfg::LinkableValueNode
+class ValueBaseLink : public synfig::LinkableValueNode
 {
        typedef std::vector<ValueNode::Handle> list_type;
        list_type       list;
 
 protected:
        //stuff I don't want
-       virtual bool set_link_vfunc(int i,sinfg::ValueNode::Handle x) {return false;}
+       virtual bool set_link_vfunc(int i,synfig::ValueNode::Handle x) {return false;}
        virtual LinkableValueNode* create_new()const {return 0;}
        
        //new stuff I need
-       list_type::const_iterator findlink(sinfg::ValueNode::Handle x) const;
-       list_type::iterator findlink(sinfg::ValueNode::Handle x);
+       list_type::const_iterator findlink(synfig::ValueNode::Handle x) const;
+       list_type::iterator findlink(synfig::ValueNode::Handle x);
        
 public: //linkable interface
        
        //stuff I do want       
-       virtual sinfg::ValueNode::LooseHandle get_link_vfunc(int i)const;
+       virtual synfig::ValueNode::LooseHandle get_link_vfunc(int i)const;
        virtual int link_count()const;
        
        //I have to support the thing because it's too much work otherwise
-       virtual sinfg::String link_local_name(int i)const;
-       virtual sinfg::String link_name(int i)const;
+       virtual synfig::String link_local_name(int i)const;
+       virtual synfig::String link_name(int i)const;
 
 public:
        ValueBaseLink();
        virtual ~ValueBaseLink();
 
        //don't want
-       virtual int get_link_index_from_name(const sinfg::String &name)const;
+       virtual int get_link_index_from_name(const synfig::String &name)const;
 
        //new add and subtract stuff
-       virtual void add(sinfg::ValueNode::Handle v);
-       virtual void remove(sinfg::ValueNode::Handle v);
+       virtual void add(synfig::ValueNode::Handle v);
+       virtual void remove(synfig::ValueNode::Handle v);
 
 };
        
index 85bb392..8bf3001 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_canvaschooser.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -58,29 +58,29 @@ Widget_CanvasChooser::~Widget_CanvasChooser()
 }
 
 void
-Widget_CanvasChooser::set_parent_canvas(etl::handle<sinfg::Canvas> x)
+Widget_CanvasChooser::set_parent_canvas(etl::handle<synfig::Canvas> x)
 {
        assert(x);
        parent_canvas=x;
 }
 
 void
-Widget_CanvasChooser::set_value_(etl::handle<sinfg::Canvas> data)
+Widget_CanvasChooser::set_value_(etl::handle<synfig::Canvas> data)
 {
        set_value(data);
        activate();
 }
 
 void
-Widget_CanvasChooser::set_value(etl::handle<sinfg::Canvas> data)
+Widget_CanvasChooser::set_value(etl::handle<synfig::Canvas> data)
 {
        assert(parent_canvas);
        canvas=data;
 
        canvas_menu=manage(new class Gtk::Menu());
 
-       sinfg::Canvas::Children::iterator iter;
-       sinfg::Canvas::Children &children(parent_canvas->children());
+       synfig::Canvas::Children::iterator iter;
+       synfig::Canvas::Children &children(parent_canvas->children());
        String label;
        
        if(canvas)
@@ -118,7 +118,7 @@ Widget_CanvasChooser::set_value(etl::handle<sinfg::Canvas> data)
                set_history(0);
 }
 
-const etl::handle<sinfg::Canvas> &
+const etl::handle<synfig::Canvas> &
 Widget_CanvasChooser::get_value()
 {
        return canvas;
index 575f56f..3bf081e 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_canvaschooser.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_CANVASCHOOSER_H
-#define __SINFG_STUDIO_WIDGET_CANVASCHOOSER_H
+#ifndef __SYNFIG_STUDIO_WIDGET_CANVASCHOOSER_H
+#define __SYNFIG_STUDIO_WIDGET_CANVASCHOOSER_H
 
 /* === H E A D E R S ======================================================= */
 
-#include <sinfg/canvas.h>
+#include <synfig/canvas.h>
 #include <gtkmm/optionmenu.h>
 
 
@@ -43,18 +43,18 @@ namespace studio {
 class Widget_CanvasChooser : public Gtk::OptionMenu
 {
        Gtk::Menu *canvas_menu;
-       sinfg::Canvas::Handle parent_canvas;
+       synfig::Canvas::Handle parent_canvas;
 
-       sinfg::Canvas::Handle canvas;
-       void set_value_(sinfg::Canvas::Handle data);
+       synfig::Canvas::Handle canvas;
+       void set_value_(synfig::Canvas::Handle data);
 public:
 
        Widget_CanvasChooser();
        ~Widget_CanvasChooser();
        
-       void set_parent_canvas(sinfg::Canvas::Handle x);
-       void set_value(sinfg::Canvas::Handle data);
-       const sinfg::Canvas::Handle &get_value();
+       void set_parent_canvas(synfig::Canvas::Handle x);
+       void set_value(synfig::Canvas::Handle data);
+       const synfig::Canvas::Handle &get_value();
 private:
        void chooser_menu();
 }; // END of class Widget_CanvasChooser
index a016fe9..bda96d3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_color.cpp
 **     \brief Template File
 **
@@ -39,7 +39,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -54,9 +54,9 @@ using namespace studio;
 /* === P R O C E D U R E S ================================================= */
 
 Gdk::Color
-studio::colorconv_sinfg2gdk(const sinfg::Color &c_)
+studio::colorconv_synfig2gdk(const synfig::Color &c_)
 {
-       const sinfg::Color c(c_.clamped());
+       const synfig::Color c(c_.clamped());
        Gdk::Color ret;
        ret.set_rgb(
                        256*App::gamma.r_F32_to_U8(c.get_r()),
@@ -67,7 +67,7 @@ studio::colorconv_sinfg2gdk(const sinfg::Color &c_)
 }
 
 void
-studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const sinfg::Color &color)
+studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const synfig::Color &color)
 {
        const int height(ca.get_height());
        const int width(ca.get_width());
@@ -83,8 +83,8 @@ studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const G
                const Color bg1(Color::blend(color,Color(0.75, 0.75, 0.75),1.0).clamped());
                const Color bg2(Color::blend(color,Color(0.5, 0.5, 0.5),1.0).clamped());
        
-               Gdk::Color gdk_c1(colorconv_sinfg2gdk(bg1));
-               Gdk::Color gdk_c2(colorconv_sinfg2gdk(bg2));
+               Gdk::Color gdk_c1(colorconv_synfig2gdk(bg1));
+               Gdk::Color gdk_c2(colorconv_synfig2gdk(bg2));
 
                bool toggle(false);
                for(int i=0;i<width;i+=square_size)
@@ -114,7 +114,7 @@ studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const G
        else
        {
                // In this case we have a solid color to use
-               Gdk::Color gdk_c1(colorconv_sinfg2gdk(color));
+               Gdk::Color gdk_c1(colorconv_synfig2gdk(color));
 
                gc->set_rgb_fg_color(gdk_c1);   
                window->draw_rectangle(gc, true, ca.get_x(), ca.get_y(), width-1, height-1);
@@ -145,14 +145,14 @@ Widget_Color::~Widget_Color()
 }
 
 void
-Widget_Color::set_value(const sinfg::Color &data)
+Widget_Color::set_value(const synfig::Color &data)
 {
        assert(data.is_valid());
        color=data;
        queue_draw();
 }
 
-const sinfg::Color &
+const synfig::Color &
 Widget_Color::get_value()
 {
        assert(color.is_valid());
index 14d52ce..f3e8d42 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_color.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_COLOR_H
-#define __SINFG_STUDIO_WIDGET_COLOR_H
+#ifndef __SYNFIG_STUDIO_WIDGET_COLOR_H
+#define __SYNFIG_STUDIO_WIDGET_COLOR_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -31,7 +31,7 @@
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/adjustment.h>
 #include <gtkmm/drawingarea.h>
-#include <sinfg/color.h>
+#include <synfig/color.h>
 
 /* === M A C R O S ========================================================= */
 
 namespace studio {
 
 
-Gdk::Color colorconv_sinfg2gdk(const sinfg::Color &c);
+Gdk::Color colorconv_synfig2gdk(const synfig::Color &c);
        
-void render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const sinfg::Color &color);
+void render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const synfig::Color &color);
 
 class Widget_Color : public Gtk::DrawingArea
 {
-       sinfg::Color color;
+       synfig::Color color;
        
        sigc::signal<void> signal_activate_;
        sigc::signal<void> signal_secondary_;
@@ -60,8 +60,8 @@ public:
        sigc::signal<void>& signal_clicked() { return signal_activate_; }
        sigc::signal<void>& signal_secondary() { return signal_secondary_; }
        
-       void set_value(const sinfg::Color &data);
-       const sinfg::Color &get_value();
+       void set_value(const synfig::Color &data);
+       const synfig::Color &get_value();
        Widget_Color();
        ~Widget_Color();
 private:
index 61dcec2..4867e5b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_coloredit.cpp
 **     \brief Template File
 **
@@ -44,7 +44,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -456,7 +456,7 @@ Widget_ColorEdit::set_digits(int x)
 }
 
 void
-Widget_ColorEdit::set_value(const sinfg::Color &data)
+Widget_ColorEdit::set_value(const synfig::Color &data)
 {
        assert(data.is_valid());
        hold_signals=true;
@@ -492,7 +492,7 @@ Widget_ColorEdit::set_value(const sinfg::Color &data)
        hold_signals=false;
 }
 
-sinfg::Color
+synfig::Color
 Widget_ColorEdit::get_value_raw()
 {
        Color color;
@@ -516,7 +516,7 @@ Widget_ColorEdit::get_value_raw()
        return color;
 }
 
-const sinfg::Color &
+const synfig::Color &
 Widget_ColorEdit::get_value()
 {
        if(use_colorspace_gamma())
index 77342ae..2689638 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_coloredit.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_COLOREDIT_H
-#define __SINFG_STUDIO_WIDGET_COLOREDIT_H
+#ifndef __SYNFIG_STUDIO_WIDGET_COLOREDIT_H
+#define __SYNFIG_STUDIO_WIDGET_COLOREDIT_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -31,7 +31,7 @@
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/adjustment.h>
 #include <gtkmm/drawingarea.h>
-#include <sinfg/color.h>
+#include <synfig/color.h>
 #include "widget_color.h"
 
 /* === M A C R O S ========================================================= */
@@ -70,7 +70,7 @@ private:
        sigc::signal<void> signal_activated_;
 
        Type type;
-       sinfg::Color color_;
+       synfig::Color color_;
 
 public:
 
@@ -80,7 +80,7 @@ public:
        Type
        get_type()const { return type; }
 
-       const sinfg::Color&
+       const synfig::Color&
        get_color()const { return color_; }
 
 
@@ -90,22 +90,22 @@ public:
        set_type(Type x);
 
        void
-       set_color(sinfg::Color x);
+       set_color(synfig::Color x);
 
-       static void adjust_color(Type type, sinfg::Color &color, float amount);
+       static void adjust_color(Type type, synfig::Color &color, float amount);
 
 private:
-       typedef void (*slider_color_func)(sinfg::Color &,float);
-
-       static void slider_color_TYPE_R(sinfg::Color &color, float amount);
-       static void slider_color_TYPE_G(sinfg::Color &color, float amount);
-       static void slider_color_TYPE_B(sinfg::Color &color, float amount);
-       static void slider_color_TYPE_Y(sinfg::Color &color, float amount);
-       static void slider_color_TYPE_U(sinfg::Color &color, float amount);
-       static void slider_color_TYPE_V(sinfg::Color &color, float amount);
-       static void slider_color_TYPE_HUE(sinfg::Color &color, float amount);
-       static void slider_color_TYPE_SAT(sinfg::Color &color, float amount);
-       static void slider_color_TYPE_A(sinfg::Color &color, float amount);
+       typedef void (*slider_color_func)(synfig::Color &,float);
+
+       static void slider_color_TYPE_R(synfig::Color &color, float amount);
+       static void slider_color_TYPE_G(synfig::Color &color, float amount);
+       static void slider_color_TYPE_B(synfig::Color &color, float amount);
+       static void slider_color_TYPE_Y(synfig::Color &color, float amount);
+       static void slider_color_TYPE_U(synfig::Color &color, float amount);
+       static void slider_color_TYPE_V(synfig::Color &color, float amount);
+       static void slider_color_TYPE_HUE(synfig::Color &color, float amount);
+       static void slider_color_TYPE_SAT(synfig::Color &color, float amount);
+       static void slider_color_TYPE_A(synfig::Color &color, float amount);
        
 
        bool
@@ -145,7 +145,7 @@ class Widget_ColorEdit : public Gtk::Table
        Gtk::Adjustment B_adjustment;
        Gtk::Adjustment A_adjustment;
        
-       sinfg::Color color;
+       synfig::Color color;
 
        Gtk::Notebook* notebook;
 
@@ -167,9 +167,9 @@ public:
        
        void activated() { signal_activated_(); }
        void activate() { signal_activated_(); }
-       void set_value(const sinfg::Color &data);
-       const sinfg::Color &get_value();
-       sinfg::Color get_value_raw();
+       void set_value(const synfig::Color &data);
+       const synfig::Color &get_value();
+       synfig::Color get_value_raw();
        void set_has_frame(bool x);
        void set_digits(int x);
        Widget_ColorEdit();
index 9b342f5..31a12c1 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_compselect.cpp
 **     \brief Template File
 **
@@ -31,7 +31,7 @@
 #include <gtkmm/menu.h>
 #include "widget_compselect.h"
 #include <ETL/stringf>
-#include <sinfg/valuenode.h>
+#include <synfig/valuenode.h>
 #include "instance.h"
 
 #endif
@@ -40,7 +40,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -117,8 +117,8 @@ Widget_CompSelect::new_instance(etl::handle<studio::Instance> instance)
        
        etl::loose_handle<studio::Instance> loose_instance(instance);
        
-       instance->sinfgapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&Widget_CompSelect::refresh));
-       instance->sinfgapp::Instance::signal_filename_changed().connect(
+       instance->synfigapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&Widget_CompSelect::refresh));
+       instance->synfigapp::Instance::signal_filename_changed().connect(
                sigc::bind<etl::loose_handle<studio::Instance> >(
                        sigc::mem_fun(*this,&Widget_CompSelect::set_selected_instance),
                        loose_instance
index c21eb08..043a925 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_compselect.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_COMPSELECT_H
-#define __SINFG_STUDIO_WIDGET_COMPSELECT_H
+#ifndef __SYNFIG_STUDIO_WIDGET_COMPSELECT_H
+#define __SYNFIG_STUDIO_WIDGET_COMPSELECT_H
 
 /* === H E A D E R S ======================================================= */
 
index 45f68cf..46b5258 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_curves.cpp
 **     \brief Template File
 **
@@ -43,7 +43,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -54,7 +54,7 @@ using namespace studio;
 
 /*
 void
-studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const sinfg::Color &color)
+studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const synfig::Color &color)
 {
        const int height(ca.get_height());
        const int width(ca.get_width());
@@ -70,8 +70,8 @@ studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const G
                const Color bg1(Color::blend(color,Color(0.75, 0.75, 0.75),1.0).clamped());
                const Color bg2(Color::blend(color,Color(0.5, 0.5, 0.5),1.0).clamped());
        
-               Gdk::Color gdk_c1(colorconv_sinfg2gdk(bg1));
-               Gdk::Color gdk_c2(colorconv_sinfg2gdk(bg2));
+               Gdk::Color gdk_c1(colorconv_synfig2gdk(bg1));
+               Gdk::Color gdk_c2(colorconv_synfig2gdk(bg2));
 
                bool toggle(false);
                for(int i=0;i<width;i+=square_size)
@@ -101,7 +101,7 @@ studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const G
        else
        {
                // In this case we have a solid color to use
-               Gdk::Color gdk_c1(colorconv_sinfg2gdk(color));
+               Gdk::Color gdk_c1(colorconv_synfig2gdk(color));
 
                gc->set_rgb_fg_color(gdk_c1);   
                window->draw_rectangle(gc, true, ca.get_x(), ca.get_y(), width-1, height-1);
@@ -119,17 +119,17 @@ studio::render_color_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const G
 
 struct studio::Widget_Curves::Channel
 {
-       sinfg::String name;
+       synfig::String name;
        Gdk::Color color;
-       std::map<sinfg::Real,sinfg::Real> values;
+       std::map<synfig::Real,synfig::Real> values;
 };
 
 struct studio::Widget_Curves::CurveStruct : sigc::trackable
 {
-       sinfgapp::ValueDesc value_desc;
+       synfigapp::ValueDesc value_desc;
        std::vector<Channel> channels;
 
-       CurveStruct(const sinfgapp::ValueDesc& x):
+       CurveStruct(const synfigapp::ValueDesc& x):
                value_desc(x)
        {
                switch(value_desc.get_value_type())
@@ -216,7 +216,7 @@ struct studio::Widget_Curves::CurveStruct : sigc::trackable
                                channels.back().color=Gdk::Color("#7f7f00");
                                break;
                        default:
-                               throw sinfg::Exception::BadType("Bad type for curves");
+                               throw synfig::Exception::BadType("Bad type for curves");
                }
        }
        
@@ -228,9 +228,9 @@ struct studio::Widget_Curves::CurveStruct : sigc::trackable
                        iter->values.clear();
        }
        
-       sinfg::Real get_value(int chan, sinfg::Real time, sinfg::Real tolerance)
+       synfig::Real get_value(int chan, synfig::Real time, synfig::Real tolerance)
        {
-               std::map<sinfg::Real,sinfg::Real>::iterator iter;
+               std::map<synfig::Real,synfig::Real>::iterator iter;
                
                // First check to see if we have a value
                // that is "close enough" to the time
@@ -356,11 +356,11 @@ Widget_Curves::refresh()
 }
 
 void
-Widget_Curves::set_value_descs(std::list<sinfgapp::ValueDesc> value_descs)
+Widget_Curves::set_value_descs(std::list<synfigapp::ValueDesc> value_descs)
 {
        curve_list_.clear();
        
-       std::list<sinfgapp::ValueDesc>::iterator iter;
+       std::list<synfigapp::ValueDesc>::iterator iter;
        for(iter=value_descs.begin();iter!=value_descs.end();++iter)
        {
                try {
@@ -395,7 +395,7 @@ Widget_Curves::set_value_descs(std::list<sinfgapp::ValueDesc> value_descs)
                                        )
                                );
                        }
-               }catch(sinfg::Exception::BadType)
+               }catch(synfig::Exception::BadType)
                {
                        continue;
                }
index ffdd4ac..a408952 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_curves.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_CURVES_H
-#define __SINFG_STUDIO_WIDGET_CURVES_H
+#ifndef __SYNFIG_STUDIO_WIDGET_CURVES_H
+#define __SYNFIG_STUDIO_WIDGET_CURVES_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -32,8 +32,8 @@
 #include <gtkmm/adjustment.h>
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/layout.h>
-#include <sinfg/color.h>
-#include <sinfgapp/value_desc.h>
+#include <synfig/color.h>
+#include <synfigapp/value_desc.h>
 #include <list>
 
 /* === M A C R O S ========================================================= */
@@ -59,7 +59,7 @@ public:
        Widget_Curves();
        ~Widget_Curves();
 
-       void set_value_descs(std::list<sinfgapp::ValueDesc> value_descs);
+       void set_value_descs(std::list<synfigapp::ValueDesc> value_descs);
        void clear();
        void refresh();
 
index 13b6552..f735732 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_defaults.cpp
 **     \brief Template File
 **
@@ -36,8 +36,8 @@
 #include "app.h"
 #include <gtkmm/menu.h>
 #include <gtkmm/scale.h>
-#include <sinfg/exception.h>
-#include <sinfgapp/main.h>
+#include <synfig/exception.h>
+#include <synfigapp/main.h>
 #include "canvasview.h"
 #include "widget_distance.h"
 #include "widget_enum.h"
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
 
 #define GRADIENT_HEIGHT                16
 #define DEFAULT_INCREMENT      (0.25)
-#define DEFAULT_WIDTH          (sinfg::Distance(3,sinfg::Distance::SYSTEM_POINTS))
+#define DEFAULT_WIDTH          (synfig::Distance(3,synfig::Distance::SYSTEM_POINTS))
 
 /* === G L O B A L S ======================================================= */
 
@@ -70,9 +70,9 @@ public:
                add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
                add_events(Gdk::BUTTON1_MOTION_MASK);
 
-               sinfgapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
-               sinfgapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
-               sinfgapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
+               synfigapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
+               synfigapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
+               synfigapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
                studio::App::signal_instance_selected().connect(sigc::hide(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw)));
        }
        
@@ -88,18 +88,18 @@ public:
                if(App::get_selected_canvas_view())
                {
                        const RendDesc& rend_desc(App::get_selected_canvas_view()->get_canvas()->rend_desc());
-                       pixelsize=sinfgapp::Main::get_bline_width().get(Distance::SYSTEM_PIXELS,rend_desc);
+                       pixelsize=synfigapp::Main::get_bline_width().get(Distance::SYSTEM_PIXELS,rend_desc);
                }
                else 
                {
                        RendDesc rend_desc;
-                       pixelsize=sinfgapp::Main::get_bline_width().get(Distance::SYSTEM_PIXELS,rend_desc);
+                       pixelsize=synfigapp::Main::get_bline_width().get(Distance::SYSTEM_PIXELS,rend_desc);
                }
                // Fill in the background color
-               render_color_to_window(get_window(),Gdk::Rectangle(0,0,w,h),sinfgapp::Main::get_background_color());
+               render_color_to_window(get_window(),Gdk::Rectangle(0,0,w,h),synfigapp::Main::get_background_color());
 
 /*
-               gc->set_rgb_fg_color(colorconv_sinfg2gdk(sinfgapp::Main::get_background_color()));
+               gc->set_rgb_fg_color(colorconv_synfig2gdk(synfigapp::Main::get_background_color()));
                gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);       
                get_window()->draw_rectangle(
                        gc,
@@ -110,7 +110,7 @@ public:
 */
                
                // Draw in the circle
-               gc->set_rgb_fg_color(colorconv_sinfg2gdk(sinfgapp::Main::get_foreground_color()));
+               gc->set_rgb_fg_color(colorconv_synfig2gdk(synfigapp::Main::get_foreground_color()));
                gc->set_function(Gdk::COPY);
                gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
                get_window()->draw_arc(
@@ -143,7 +143,7 @@ public:
                        case GDK_BUTTON_RELEASE:
                                if(event->button.button==1) // Left click
                                {
-                                       Distance dist(sinfgapp::Main::get_bline_width());
+                                       Distance dist(synfigapp::Main::get_bline_width());
                                        
                                        if(y<h/2) // increase BLine size
                                        {
@@ -153,19 +153,19 @@ public:
                                        {
                                                dist-=DEFAULT_INCREMENT;
                                        }
-                                       sinfgapp::Main::set_bline_width(dist);
+                                       synfigapp::Main::set_bline_width(dist);
                                        return true;
                                }
                                if(event->button.button==3)
                                {
                                        // right click on bline width
-                                       sinfgapp::Main::set_bline_width(DEFAULT_WIDTH);
+                                       synfigapp::Main::set_bline_width(DEFAULT_WIDTH);
                                        return true;
                                }
                                break;
                        case GDK_SCROLL:
                                {
-                                       Distance dist(sinfgapp::Main::get_bline_width());
+                                       Distance dist(synfigapp::Main::get_bline_width());
                                        
                                        if(event->scroll.direction==GDK_SCROLL_UP)
                                        {
@@ -175,7 +175,7 @@ public:
                                        {
                                                dist-=DEFAULT_INCREMENT;
                                        }
-                                       sinfgapp::Main::set_bline_width(dist);
+                                       synfigapp::Main::set_bline_width(dist);
                                        return true;
                                }
                        default:
@@ -222,7 +222,7 @@ Widget_Defaults::Widget_Defaults()
                button_swap->show();
                button_swap->set_relief(Gtk::RELIEF_NONE);
                button_swap->set_border_width(0);
-               icon=manage(new Gtk::Image(Gtk::StockID("sinfg-swap_colors"),Gtk::IconSize(1)));
+               icon=manage(new Gtk::Image(Gtk::StockID("synfig-swap_colors"),Gtk::IconSize(1)));
                icon->show();
                button_swap->add(*icon);
                //button_swap->get_child()->set_size_request(16/3,16/3);
@@ -302,13 +302,13 @@ Widget_Defaults::Widget_Defaults()
 
 
        // Signals
-       sinfgapp::Main::signal_opacity_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::opacity_refresh));
-       sinfgapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::bline_width_refresh));
-       sinfgapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::fg_color_refresh));
-       sinfgapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::bg_color_refresh));
-       sinfgapp::Main::signal_gradient_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::gradient_refresh));
-       sinfgapp::Main::signal_blend_method_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::blend_method_refresh));
-       sinfgapp::Main::signal_interpolation_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::interpolation_refresh));
+       synfigapp::Main::signal_opacity_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::opacity_refresh));
+       synfigapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::bline_width_refresh));
+       synfigapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::fg_color_refresh));
+       synfigapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::bg_color_refresh));
+       synfigapp::Main::signal_gradient_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::gradient_refresh));
+       synfigapp::Main::signal_blend_method_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::blend_method_refresh));
+       synfigapp::Main::signal_interpolation_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::interpolation_refresh));
 
        fg_color_refresh();
        bg_color_refresh();
@@ -323,23 +323,23 @@ Widget_Defaults::Widget_Defaults()
        add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
        add_events(Gdk::BUTTON1_MOTION_MASK);
 
-       sinfgapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
-       sinfgapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
-       sinfgapp::Main::signal_gradient_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
-       sinfgapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
+       synfigapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
+       synfigapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
+       synfigapp::Main::signal_gradient_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
+       synfigapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
 
        if(App::dialog_gradient)
        {
-               App::dialog_gradient->set_gradient(sinfgapp::Main::get_gradient());
+               App::dialog_gradient->set_gradient(synfigapp::Main::get_gradient());
                App::dialog_gradient->reset();
-               App::dialog_gradient->signal_edited().connect(sigc::mem_fun(sinfgapp::Main::set_gradient));
+               App::dialog_gradient->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_gradient));
        }
        
        if(App::dialog_color)
        {
-               App::dialog_color->set_color(sinfgapp::Main::get_foreground_color());
+               App::dialog_color->set_color(synfigapp::Main::get_foreground_color());
                App::dialog_color->reset();
-               App::dialog_color->signal_edited().connect(sigc::mem_fun(sinfgapp::Main::set_foreground_color));
+               App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_foreground_color));
        }
 */
 }
@@ -351,76 +351,76 @@ Widget_Defaults::~Widget_Defaults()
 void
 Widget_Defaults::fg_color_refresh()
 {
-       widget_fg_color->set_value(sinfgapp::Main::get_foreground_color());
+       widget_fg_color->set_value(synfigapp::Main::get_foreground_color());
 }
 
 void
 Widget_Defaults::bg_color_refresh()
 {
-       widget_bg_color->set_value(sinfgapp::Main::get_background_color());
+       widget_bg_color->set_value(synfigapp::Main::get_background_color());
 }
 
 void
 Widget_Defaults::gradient_refresh()
 {
-       widget_gradient->set_value(sinfgapp::Main::get_gradient());
+       widget_gradient->set_value(synfigapp::Main::get_gradient());
 }
 
 void
 Widget_Defaults::bline_width_refresh()
 {
-       widget_bline_width->set_value(sinfgapp::Main::get_bline_width());
+       widget_bline_width->set_value(synfigapp::Main::get_bline_width());
 }
 
 void
 Widget_Defaults::blend_method_refresh()
 {
-       widget_blend_method->set_value(sinfgapp::Main::get_blend_method());
+       widget_blend_method->set_value(synfigapp::Main::get_blend_method());
 }
 
 void
 Widget_Defaults::interpolation_refresh()
 {
-       widget_interpolation->set_value(sinfgapp::Main::get_interpolation());
+       widget_interpolation->set_value(synfigapp::Main::get_interpolation());
 }
 
 void
 Widget_Defaults::opacity_refresh()
 {
-       widget_opacity->set_value(sinfgapp::Main::get_opacity());
+       widget_opacity->set_value(synfigapp::Main::get_opacity());
 }
 
 void
 Widget_Defaults::on_opacity_changed()
 {
-       sinfgapp::Main::set_opacity(widget_opacity->get_value());
+       synfigapp::Main::set_opacity(widget_opacity->get_value());
 }
 
 void
 Widget_Defaults::on_blend_method_changed()
 {
-       sinfgapp::Main::set_blend_method(Color::BlendMethod(widget_blend_method->get_value()));
+       synfigapp::Main::set_blend_method(Color::BlendMethod(widget_blend_method->get_value()));
 }
 
 void
 Widget_Defaults::on_interpolation_changed()
 {
-       sinfgapp::Main::set_interpolation(Waypoint::Interpolation(widget_interpolation->get_value()));
+       synfigapp::Main::set_interpolation(Waypoint::Interpolation(widget_interpolation->get_value()));
 }
 
 void
 Widget_Defaults::on_bline_width_changed()
 {
-       sinfgapp::Main::set_bline_width(widget_bline_width->get_value());
+       synfigapp::Main::set_bline_width(widget_bline_width->get_value());
 }
 
 void
 Widget_Defaults::on_fg_color_clicked()
 {
        // Left click on foreground
-       App::dialog_color->set_color(sinfgapp::Main::get_foreground_color());
+       App::dialog_color->set_color(synfigapp::Main::get_foreground_color());
        App::dialog_color->reset();
-       App::dialog_color->signal_edited().connect(sigc::ptr_fun(sinfgapp::Main::set_foreground_color));
+       App::dialog_color->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_foreground_color));
        App::dialog_color->present();
 }
 
@@ -428,31 +428,31 @@ void
 Widget_Defaults::on_bg_color_clicked()
 {
        // Left click on background
-       App::dialog_color->set_color(sinfgapp::Main::get_background_color());
+       App::dialog_color->set_color(synfigapp::Main::get_background_color());
        App::dialog_color->reset();
-       App::dialog_color->signal_edited().connect(sigc::ptr_fun(sinfgapp::Main::set_background_color));
+       App::dialog_color->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_background_color));
        App::dialog_color->present();
 }
 
 void
 Widget_Defaults::on_swap_color_clicked()
 {
-       sinfgapp::Main::color_swap();
+       synfigapp::Main::color_swap();
 }
 
 void
 Widget_Defaults::on_reset_color_clicked()
 {
-       sinfgapp::Main::set_background_color(Color::white());
-       sinfgapp::Main::set_foreground_color(Color::black());
+       synfigapp::Main::set_background_color(Color::white());
+       synfigapp::Main::set_foreground_color(Color::black());
 }
 
 void
 Widget_Defaults::on_gradient_clicked()
 {
-       App::dialog_gradient->set_gradient(sinfgapp::Main::get_gradient());
+       App::dialog_gradient->set_gradient(synfigapp::Main::get_gradient());
        App::dialog_gradient->reset();
-       App::dialog_gradient->signal_edited().connect(sigc::ptr_fun(sinfgapp::Main::set_gradient));
+       App::dialog_gradient->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_gradient));
        App::dialog_gradient->present();
 }
 
@@ -466,9 +466,9 @@ Widget_Defaults::redraw(GdkEventExpose*bleh)
        const int w(get_width());       
        const int size=std::min(h-GRADIENT_HEIGHT,w);
        
-       render_color_to_window(get_window(),Gdk::Rectangle(size/4,size/4,size/4*3-1,size/4*3-1),sinfgapp::Main::get_background_color());
-       render_color_to_window(get_window(),Gdk::Rectangle(0,0,size/4*3-1,size/4*3-1),sinfgapp::Main::get_foreground_color());
-       render_gradient_to_window(get_window(),Gdk::Rectangle(0,h-GRADIENT_HEIGHT,w,GRADIENT_HEIGHT-1),sinfgapp::Main::get_gradient());
+       render_color_to_window(get_window(),Gdk::Rectangle(size/4,size/4,size/4*3-1,size/4*3-1),synfigapp::Main::get_background_color());
+       render_color_to_window(get_window(),Gdk::Rectangle(0,0,size/4*3-1,size/4*3-1),synfigapp::Main::get_foreground_color());
+       render_gradient_to_window(get_window(),Gdk::Rectangle(0,h-GRADIENT_HEIGHT,w,GRADIENT_HEIGHT-1),synfigapp::Main::get_gradient());
 
        
 
@@ -477,7 +477,7 @@ Widget_Defaults::redraw(GdkEventExpose*bleh)
        Glib::RefPtr<Pango::Layout> layout(Pango::Layout::create(get_pango_context()));
        
        gc->set_rgb_fg_color(Gdk::Color("#FF0000"));
-       layout->set_text(sinfgapp::Main::get_bline_width().get_string(2));              
+       layout->set_text(synfigapp::Main::get_bline_width().get_string(2));             
        layout->set_alignment(Pango::ALIGN_CENTER);
        layout->set_width(w/2);
        get_window()->draw_layout(gc, w*3/4, (h-GRADIENT_HEIGHT)-16, layout);
@@ -508,9 +508,9 @@ Widget_Defaults::on_event(GdkEvent *event)
                        if(y>size)
                        {
                                // Left click on gradient
-                               App::dialog_gradient->set_gradient(sinfgapp::Main::get_gradient());
+                               App::dialog_gradient->set_gradient(synfigapp::Main::get_gradient());
                                App::dialog_gradient->reset();
-                               App::dialog_gradient->signal_edited().connect(sigc::mem_fun(sinfgapp::Main::set_gradient));
+                               App::dialog_gradient->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_gradient));
                                App::dialog_gradient->present();
                                return true;
                        }
@@ -519,25 +519,25 @@ Widget_Defaults::on_event(GdkEvent *event)
                                if(x<size*3/4 && y<size*3/4)
                                {
                                        // Left click on foreground
-                                       App::dialog_color->set_color(sinfgapp::Main::get_foreground_color());
+                                       App::dialog_color->set_color(synfigapp::Main::get_foreground_color());
                                        App::dialog_color->reset();
-                                       App::dialog_color->signal_edited().connect(sigc::mem_fun(sinfgapp::Main::set_foreground_color));
+                                       App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_foreground_color));
                                        App::dialog_color->present();
                                        return true;
                                }
                                if(x>size*3/4 && y>size/4)
                                {
                                        // Left click on background
-                                       App::dialog_color->set_color(sinfgapp::Main::get_background_color());
+                                       App::dialog_color->set_color(synfigapp::Main::get_background_color());
                                        App::dialog_color->reset();
-                                       App::dialog_color->signal_edited().connect(sigc::mem_fun(sinfgapp::Main::set_background_color));
+                                       App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_background_color));
                                        App::dialog_color->present();
                                        return true;
                                }
                        }
                        if(x>size) // Left click on BLine Width
                        {
-                               Distance dist(sinfgapp::Main::get_bline_width());
+                               Distance dist(synfigapp::Main::get_bline_width());
                                
                                if(y<size/2) // increase BLine size
                                {
@@ -547,7 +547,7 @@ Widget_Defaults::on_event(GdkEvent *event)
                                {
                                        dist-=DEFAULT_INCREMENT;
                                }
-                               sinfgapp::Main::set_bline_width(dist);
+                               synfigapp::Main::set_bline_width(dist);
                        }
                }
                if(event->button.button==3)
@@ -555,7 +555,7 @@ Widget_Defaults::on_event(GdkEvent *event)
                        if(y>size)
                        {
                                // right click on gradient
-                               sinfgapp::Main::set_gradient_default_colors();
+                               synfigapp::Main::set_gradient_default_colors();
                                return true;
                        }
                        else
@@ -563,14 +563,14 @@ Widget_Defaults::on_event(GdkEvent *event)
                                if(x<size)
                                {
                                        // right click on colors
-                                       sinfgapp::Main::color_swap();
+                                       synfigapp::Main::color_swap();
                                        return true;
                                }
                                
                                if(x>w/2)
                                {
                                        // right click on bline width
-                                       sinfgapp::Main::set_bline_width(DEFAULT_WIDTH);
+                                       synfigapp::Main::set_bline_width(DEFAULT_WIDTH);
                                }
                                
                        }
@@ -578,7 +578,7 @@ Widget_Defaults::on_event(GdkEvent *event)
                break;
        case GDK_SCROLL:
                {
-                       Distance dist(sinfgapp::Main::get_bline_width());
+                       Distance dist(synfigapp::Main::get_bline_width());
                        
                        if(event->scroll.direction==GDK_SCROLL_UP)
                        {
@@ -588,7 +588,7 @@ Widget_Defaults::on_event(GdkEvent *event)
                        {
                                dist-=DEFAULT_INCREMENT;
                        }
-                       sinfgapp::Main::set_bline_width(dist);
+                       synfigapp::Main::set_bline_width(dist);
                }
        default:
                break;
index 6bd54b4..c4ec006 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_defaults.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_DEFAULTS_H
-#define __SINFG_STUDIO_WIDGET_DEFAULTS_H
+#ifndef __SYNFIG_STUDIO_WIDGET_DEFAULTS_H
+#define __SYNFIG_STUDIO_WIDGET_DEFAULTS_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/table.h>
-#include <sinfg/gradient.h>
+#include <synfig/gradient.h>
 #include "widget_gradient.h"
 #include <gtkmm/tooltips.h>
 
index 0e81829..f6cc100 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_time.cpp
 **     \brief Template File
 **
@@ -39,7 +39,7 @@
 
 using namespace std;
 //using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -70,7 +70,7 @@ Widget_Distance::~Widget_Distance()
 int
 Widget_Distance::on_input(double* new_value)
 {
-       distance_=sinfg::String(get_text());
+       distance_=synfig::String(get_text());
        *new_value=distance_.get();
        return 1;
 }
@@ -81,18 +81,18 @@ Widget_Distance::on_output()
        try{
        distance_=get_adjustment()->get_value();
        set_text(distance_.get_string(get_digits()));
-       } catch (...) { /* sinfg::error("Widget_Distance::on_output(): Caught something..."); */ }
+       } catch (...) { /* synfig::error("Widget_Distance::on_output(): Caught something..."); */ }
        return true;
 }
 
 void
-Widget_Distance::set_value(const sinfg::Distance &data)
+Widget_Distance::set_value(const synfig::Distance &data)
 {
        distance_=data;
        get_adjustment()->set_value(distance_.get());
 }
 
-sinfg::Distance
+synfig::Distance
 Widget_Distance::get_value() const
 {
        distance_=get_adjustment()->get_value();
index 61d6c82..14617c8 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_distance.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_DISTANCE_H
-#define __SINFG_STUDIO_WIDGET_DISTANCE_H
+#ifndef __SYNFIG_STUDIO_WIDGET_DISTANCE_H
+#define __SYNFIG_STUDIO_WIDGET_DISTANCE_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -30,7 +30,7 @@
 #include <sigc++/slot.h>
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/adjustment.h>
-#include <sinfg/distance.h>
+#include <synfig/distance.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -46,7 +46,7 @@ class Widget_Distance : public Gtk::SpinButton
 {
        //sigc::signal<void> signal_value_changed_;
        
-       mutable sinfg::Distance distance_;
+       mutable synfig::Distance distance_;
 
        Gtk::Adjustment adjustment;
        
@@ -58,8 +58,8 @@ protected:
 public:
        //sigc::signal<void> &signal_value_changed() { return signal_value_changed_; }
        
-       void set_value(const sinfg::Distance &data);
-       sinfg::Distance get_value()const;
+       void set_value(const synfig::Distance &data);
+       synfig::Distance get_value()const;
        Widget_Distance();
        ~Widget_Distance();
 }; // END of class Widget_Distance
index 9d346fd..0b37b99 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_enum.cpp
 **     \brief Template File
 **
@@ -31,7 +31,7 @@
 #include <gtkmm/menu.h>
 #include "widget_enum.h"
 #include <ETL/stringf>
-#include <sinfg/valuenode.h>
+#include <synfig/valuenode.h>
 
 #endif
 
@@ -39,7 +39,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -59,7 +59,7 @@ Widget_Enum::~Widget_Enum()
 }
 
 void
-Widget_Enum::set_param_desc(const sinfg::ParamDesc &x)
+Widget_Enum::set_param_desc(const synfig::ParamDesc &x)
 {
        param_desc=x;
        //refresh();
@@ -77,8 +77,8 @@ Widget_Enum::refresh()
 {
        enum_menu = manage(new class Gtk::Menu());
 
-       std::list<sinfg::ParamDesc::EnumData> enum_list=param_desc.get_enum_list();
-       std::list<sinfg::ParamDesc::EnumData>::iterator iter;
+       std::list<synfig::ParamDesc::EnumData> enum_list=param_desc.get_enum_list();
+       std::list<synfig::ParamDesc::EnumData>::iterator iter;
        
        String name=strprintf("(%d)",value);
        
index 17576e9..b70c3ab 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_enum.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_ENUM_H
-#define __SINFG_STUDIO_WIDGET_ENUM_H
+#ifndef __SYNFIG_STUDIO_WIDGET_ENUM_H
+#define __SYNFIG_STUDIO_WIDGET_ENUM_H
 
 /* === H E A D E R S ======================================================= */
 
-#include <sinfg/layer.h>
+#include <synfig/layer.h>
 #include <gtkmm/optionmenu.h>
-#include <sinfg/paramdesc.h>
+#include <synfig/paramdesc.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -43,7 +43,7 @@ namespace studio {
 class Widget_Enum : public Gtk::OptionMenu
 {
        Gtk::Menu *enum_menu;
-       sinfg::ParamDesc param_desc;
+       synfig::ParamDesc param_desc;
        
        int value;
        void set_value_(int data);
@@ -52,7 +52,7 @@ public:
        Widget_Enum();
        ~Widget_Enum();
        
-       void set_param_desc(const sinfg::ParamDesc &x);
+       void set_param_desc(const synfig::ParamDesc &x);
        void refresh();
 
        void set_value(int data);
index 25da8a3..24743c5 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_filename.cpp
 **     \brief Template File
 **
@@ -39,7 +39,7 @@
 
 using namespace std;
 //using namespace etl;
-//using namespace sinfg;
+//using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
index cb906cf..51a1480 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_filename.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_FILENAME_H
-#define __SINFG_STUDIO_WIDGET_FILENAME_H
+#ifndef __SYNFIG_STUDIO_WIDGET_FILENAME_H
+#define __SYNFIG_STUDIO_WIDGET_FILENAME_H
 
 /* === H E A D E R S ======================================================= */
 
index da07589..8086b52 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_gradient.cpp
 **     \brief Template File
 **
@@ -31,7 +31,7 @@
 #include "widget_gradient.h"
 #include "app.h"
 #include <gtkmm/menu.h>
-#include <sinfg/exception.h>
+#include <synfig/exception.h>
 #include <ETL/misc>
 
 #endif
@@ -40,7 +40,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -50,7 +50,7 @@ using namespace studio;
 /* === P R O C E D U R E S ================================================= */
 
 void
-studio::render_gradient_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const sinfg::Gradient &gradient)
+studio::render_gradient_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const synfig::Gradient &gradient)
 {
        int     height = ca.get_height();
        int     width = ca.get_width()-4;
@@ -239,7 +239,7 @@ Widget_Gradient::popup_menu(float x)
 }
 
 void
-Widget_Gradient::set_value(const sinfg::Gradient& x)
+Widget_Gradient::set_value(const synfig::Gradient& x)
 {
        gradient_=x;
        if(gradient_.size())
@@ -248,7 +248,7 @@ Widget_Gradient::set_value(const sinfg::Gradient& x)
 }
 
 void
-Widget_Gradient::set_selected_cpoint(const sinfg::Gradient::CPoint &x)
+Widget_Gradient::set_selected_cpoint(const synfig::Gradient::CPoint &x)
 {
        selected_cpoint=x;
        signal_cpoint_selected_(selected_cpoint);
@@ -256,7 +256,7 @@ Widget_Gradient::set_selected_cpoint(const sinfg::Gradient::CPoint &x)
 }
 
 void
-Widget_Gradient::update_cpoint(const sinfg::Gradient::CPoint &x)
+Widget_Gradient::update_cpoint(const synfig::Gradient::CPoint &x)
 {
        try
        {
@@ -266,7 +266,7 @@ Widget_Gradient::update_cpoint(const sinfg::Gradient::CPoint &x)
                gradient_.sort();
                queue_draw();
        }
-       catch(sinfg::Exception::NotFound)
+       catch(synfig::Exception::NotFound)
        {
                // Yotta...
        }
index baea381..549ee5d 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_gradient.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_GRADIENT_H
-#define __SINFG_STUDIO_WIDGET_GRADIENT_H
+#ifndef __SYNFIG_STUDIO_WIDGET_GRADIENT_H
+#define __SYNFIG_STUDIO_WIDGET_GRADIENT_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/drawingarea.h>
-#include <sinfg/gradient.h>
+#include <synfig/gradient.h>
 
 /* === M A C R O S ========================================================= */
 
 
 namespace studio {
 
-void render_gradient_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const sinfg::Gradient &gradient);
+void render_gradient_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const synfig::Gradient &gradient);
 
 class Widget_Gradient : public Gtk::DrawingArea
 {
        sigc::signal<void> signal_value_changed_;
        sigc::signal<void> signal_clicked_;
 
-       sigc::signal<void,sinfg::Gradient::CPoint> signal_cpoint_selected_;
+       sigc::signal<void,synfig::Gradient::CPoint> signal_cpoint_selected_;
 
-       sinfg::Gradient gradient_;
+       synfig::Gradient gradient_;
        
        bool editable_;
        
        bool changed_;
        
-       sinfg::Gradient::CPoint selected_cpoint;
+       synfig::Gradient::CPoint        selected_cpoint;
 
        void popup_menu(float x);       
 
@@ -69,11 +69,11 @@ public:
        sigc::signal<void>& signal_value_changed() { return signal_value_changed_; }
        sigc::signal<void>& signal_clicked() { return signal_clicked_; }
 
-       sigc::signal<void,sinfg::Gradient::CPoint>& signal_cpoint_selected() { return signal_cpoint_selected_; }
+       sigc::signal<void,synfig::Gradient::CPoint>& signal_cpoint_selected() { return signal_cpoint_selected_; }
        
-       void set_value(const sinfg::Gradient& x);
+       void set_value(const synfig::Gradient& x);
 
-       const sinfg::Gradient& get_value()const { return gradient_; }   
+       const synfig::Gradient& get_value()const { return gradient_; }  
        
        void set_editable(bool x=true) { editable_=x; }
        
@@ -81,11 +81,11 @@ public:
 
 
        
-       void set_selected_cpoint(const sinfg::Gradient::CPoint &x);
+       void set_selected_cpoint(const synfig::Gradient::CPoint &x);
 
-       const sinfg::Gradient::CPoint& get_selected_cpoint() { return selected_cpoint; }
+       const synfig::Gradient::CPoint& get_selected_cpoint() { return selected_cpoint; }
 
-       void update_cpoint(const sinfg::Gradient::CPoint &x);
+       void update_cpoint(const synfig::Gradient::CPoint &x);
        
 
 
index c19780d..ab50e8f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_sound.cpp
 **     \brief Widget Sound Implementation File
 **
@@ -30,7 +30,7 @@
 
 #include <gtkmm/adjustment.h>
 
-#include <sinfg/general.h>
+#include <synfig/general.h>
 #include <ETL/clock>
 
 #include "widget_sound.h"
@@ -42,7 +42,7 @@
 
 using namespace std;
 using namespace etl;
-//using namespace sinfg;
+//using namespace synfig;
 
 using studio::AudioProfile;
 
@@ -66,7 +66,7 @@ studio::Widget_Sound::~Widget_Sound()
 
 void studio::Widget_Sound::set_position(double t)
 {
-       //sinfg::info("Setting position to %.2lf s", t);
+       //synfig::info("Setting position to %.2lf s", t);
        if(adj_timescale && t != adj_timescale->get_value())
        {
                float upper = adj_timescale->get_upper();
@@ -166,7 +166,7 @@ bool studio::Widget_Sound::on_expose_event(GdkEventExpose *heh)
        
        //redraw all the samples from begin to end, but only if we have samples to draw (or there is no space to draw)
        
-       //sinfg::warning("Ok rendered everything, now must render actual sound wave");
+       //synfig::warning("Ok rendered everything, now must render actual sound wave");
        if(!audioprof || !adj_timescale || !w) 
        {
                get_window()->end_paint();
@@ -210,7 +210,7 @@ bool studio::Widget_Sound::on_expose_event(GdkEventExpose *heh)
                
                delta = (end - begin)/(float)w; //samples per pixel
                
-               /*sinfg::warning("Rendering a framesize of %f secs from [%d,%d) samples to %d samples, took %f sec", 
+               /*synfig::warning("Rendering a framesize of %f secs from [%d,%d) samples to %d samples, took %f sec", 
                                                framesize, begin, end, w, check());*/
                
                cur = begin;
@@ -237,7 +237,7 @@ bool studio::Widget_Sound::on_expose_event(GdkEventExpose *heh)
                        }
                }
                
-               //sinfg::warning("Drawing audio line");
+               //synfig::warning("Drawing audio line");
                c.set_rgb_p(1,0,0);
                gc->set_rgb_fg_color(c);
                get_window()->draw_line(gc,posi,0,posi,get_height());
index dbaa9c9..836aca1 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_sound.h
 **     \brief Widget Sound Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_WIDGET_SOUND_H
-#define __SINFG_WIDGET_SOUND_H
+#ifndef __SYNFIG_WIDGET_SOUND_H
+#define __SYNFIG_WIDGET_SOUND_H
 
 /* === H E A D E R S ======================================================= */
 #include <ETL/handle>
index 634d880..ded69b8 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_time.cpp
 **     \brief Template File
 **
@@ -39,7 +39,7 @@
 
 using namespace std;
 //using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -74,13 +74,13 @@ Widget_Time::refresh_text()
 
 
 void
-Widget_Time::set_value(const sinfg::Time &data)
+Widget_Time::set_value(const synfig::Time &data)
 {
        time_=data;
        refresh_text();
 }
 
-sinfg::Time
+synfig::Time
 Widget_Time::get_value() const
 {
        return time_;
index 1cb0bc2..4b52ff0 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_time.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_TIME_H
-#define __SINFG_STUDIO_WIDGET_TIME_H
+#ifndef __SYNFIG_STUDIO_WIDGET_TIME_H
+#define __SYNFIG_STUDIO_WIDGET_TIME_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <sigc++/signal.h>
 #include <sigc++/slot.h>
 #include <gtkmm/entry.h>
-#include <sinfg/time.h>
+#include <synfig/time.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -49,7 +49,7 @@ class Widget_Time : public Gtk::Entry
        
        float fps_;
        
-       sinfg::Time time_;
+       synfig::Time time_;
        
 protected:
        bool on_focus_out_event(GdkEventFocus* event);
@@ -69,8 +69,8 @@ public:
 
 
        
-       void set_value(const sinfg::Time &data);
-       sinfg::Time get_value()const;
+       void set_value(const synfig::Time &data);
+       synfig::Time get_value()const;
        void set_fps(float x);
        Widget_Time();
        ~Widget_Time();
index 8e7e860..f04c62f 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_timeslider.cpp
 **     \brief Time Slider Widget Implementation File
 **
@@ -40,7 +40,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 
 using studio::Widget_Timeslider;
 
@@ -52,7 +52,7 @@ const double zoomoutfactor = 1/zoominfactor;
 
 /* === P R O C E D U R E S ================================================= */
 
-Gdk::Color get_interp_color(sinfg::Interpolation x)
+Gdk::Color get_interp_color(synfig::Interpolation x)
 {
        switch(x)
        {
@@ -98,7 +98,7 @@ void
 studio::render_time_point_to_window(
        const Glib::RefPtr<Gdk::Drawable>& window,
        const Gdk::Rectangle& area,
-       const sinfg::TimePoint &tp,
+       const synfig::TimePoint &tp,
        bool selected
 )
 {
@@ -406,7 +406,7 @@ bool Widget_Timeslider::redraw(bool doublebuffer)
        Glib::RefPtr<Gdk::GC>   gc = Gdk::GC::create(window);   
        if(!gc) return false;
        
-       //sinfg::info("Drawing Timeslider");
+       //synfig::info("Drawing Timeslider");
        //clear and update to current values
        //invalidated = false;
        //update_times();       
@@ -431,7 +431,7 @@ bool Widget_Timeslider::redraw(bool doublebuffer)
        
        if(end-start < EPSILON) return true;
        
-       //sinfg::info("Drawing Lines");
+       //synfig::info("Drawing Lines");
        
        //draw all the time stuff
        double dtdp = (end - start)/get_width();
@@ -484,7 +484,7 @@ bool Widget_Timeslider::redraw(bool doublebuffer)
                        scale = *after;
        }
                
-       //sinfg::info("Range found: (l %.2lf,u %.2lf - m %.2lf) -> %.2lf",lowerrange,upperrange,midrange,scale);        
+       //synfig::info("Range found: (l %.2lf,u %.2lf - m %.2lf) -> %.2lf",lowerrange,upperrange,midrange,scale);       
        
        //search around this area to get the right one          
        
@@ -509,10 +509,10 @@ bool Widget_Timeslider::redraw(bool doublebuffer)
                //sdindex = (int)floor(t + 0.5); //get how far through the range it is...
                sdindex = round_to_int(t); //get how far through the range it is...
                
-               //sinfg::info("Extracted fr %.2lf -> %d", t, sdindex);
+               //synfig::info("Extracted fr %.2lf -> %d", t, sdindex);
        }
        
-       //sinfg::info("Initial values: %.4lf t, %.1lf pixels, %d i", time,pixel,sdindex);
+       //synfig::info("Initial values: %.4lf t, %.1lf pixels, %d i", time,pixel,sdindex);
        
        //loop to draw
        const int heightbig = 12;
@@ -618,7 +618,7 @@ bool Widget_Timeslider::on_motion_notify_event(GdkEventMotion* event) //for drag
                                }
                        }               
                        
-                       //sinfg::info("Scrolling timerange to (%.4f,%.4f)",start,end);
+                       //synfig::info("Scrolling timerange to (%.4f,%.4f)",start,end);
                        
                        adj_timescale->set_lower(start);
                        adj_timescale->set_upper(end);
@@ -721,7 +721,7 @@ void Widget_Timeslider::zoom_in(bool centerontime)
        end = focuspoint + (end-focuspoint)*zoominfactor;
        start = focuspoint + (start-focuspoint)*zoominfactor;
        
-       //sinfg::info("Zooming in timerange to (%.4f,%.4f)",start,end);
+       //synfig::info("Zooming in timerange to (%.4f,%.4f)",start,end);
        if(adj_bounds)
        {
                if(start < adj_bounds->get_lower())
@@ -757,7 +757,7 @@ void Widget_Timeslider::zoom_out(bool centerontime)
        end = focuspoint + (end-focuspoint)*zoomoutfactor;
        start = focuspoint + (start-focuspoint)*zoomoutfactor;
        
-       //sinfg::info("Zooming out timerange to (%.4f,%.4f)",start,end);
+       //synfig::info("Zooming out timerange to (%.4f,%.4f)",start,end);
        if(adj_bounds)
        {
                if(start < adj_bounds->get_lower())
@@ -795,7 +795,7 @@ bool Widget_Timeslider::on_button_press_event(GdkEventButton *event) //for click
                        
                        t = floor(t*fps + 0.5)/fps;
                        
-                       /*sinfg::info("Clicking time from %.3lf to %.3lf [(%.2lf,%.2lf) %.2lf / %.2lf ... %.2lf", 
+                       /*synfig::info("Clicking time from %.3lf to %.3lf [(%.2lf,%.2lf) %.2lf / %.2lf ... %.2lf", 
                                                current, vt, start, end, event->x, w, fps);*/
                        
                        if(t != current)
index 0138bcf..820a649 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_timeslider.h
 **     \brief Time Slider Widget Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_WIDGET_TIMESLIDER_H
-#define __SINFG_WIDGET_TIMESLIDER_H
+#ifndef __SYNFIG_WIDGET_TIMESLIDER_H
+#define __SYNFIG_WIDGET_TIMESLIDER_H
 
 /* === H E A D E R S ======================================================= */
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/adjustment.h>
 
-#include <sinfg/time.h>
+#include <synfig/time.h>
 #include "canvasview.h"
 
 /* === M A C R O S ========================================================= */
@@ -39,7 +39,7 @@
 
 namespace studio {
 
-void render_time_point_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const sinfg::TimePoint &tp,bool selected=false);
+void render_time_point_to_window(const Glib::RefPtr<Gdk::Drawable>& window,const Gdk::Rectangle& ca,const synfig::TimePoint &tp,bool selected=false);
 
        
 /* Design for the timeslider...
index ddf28fa..5d35a52 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_value.cpp
 **     \brief Template File
 **
@@ -50,7 +50,7 @@
 
 #endif
 
-using namespace sinfg;
+using namespace synfig;
 using namespace etl;
 using namespace std;
 using namespace studio;
@@ -193,7 +193,7 @@ Widget_ValueBase::set_sensitive(bool x)
 }
 
 void
-Widget_ValueBase::set_value(const sinfg::ValueBase &data)
+Widget_ValueBase::set_value(const synfig::ValueBase &data)
 {
        label->hide();
        vector_widget->hide();
@@ -257,7 +257,7 @@ Widget_ValueBase::set_value(const sinfg::ValueBase &data)
        case ValueBase::TYPE_CANVAS:
                assert(canvas);
                canvas_widget->set_parent_canvas(canvas);
-               canvas_widget->set_value(value.get(etl::loose_handle<sinfg::Canvas>()));
+               canvas_widget->set_value(value.get(etl::loose_handle<synfig::Canvas>()));
                canvas_widget->show();
                break;
        case ValueBase::TYPE_BOOL:
@@ -278,11 +278,11 @@ Widget_ValueBase::set_value(const sinfg::ValueBase &data)
                break;
        case ValueBase::TYPE_COLOR:
         {
-               color_widget->set_value(value.get(sinfg::Color()));
+               color_widget->set_value(value.get(synfig::Color()));
                color_widget->show();
 /*
                        Gdk::Color gdkcolor;
-                       sinfg::Color color=value.get(sinfg::Color());
+                       synfig::Color color=value.get(synfig::Color());
                        gdkcolor.set_rgb_p(color.get_r(),color.get_g(),color.get_b());
                        color_widget->set_current_color(gdkcolor);
                        color_widget->set_has_opacity_control(true);
@@ -295,10 +295,10 @@ Widget_ValueBase::set_value(const sinfg::ValueBase &data)
                label->show();
                break;
        }
-       }catch(...) { sinfg::error(__FILE__":%d: Caught something that was thrown",__LINE__); }
+       }catch(...) { synfig::error(__FILE__":%d: Caught something that was thrown",__LINE__); }
 }
 
-const sinfg::ValueBase &
+const synfig::ValueBase &
 Widget_ValueBase::get_value()
 {
        switch(value.get_type())
@@ -350,7 +350,7 @@ Widget_ValueBase::get_value()
                        value=color_widget->get_value();
 /*
                        Gdk::Color gdkcolor;
-                       sinfg::Color color;
+                       synfig::Color color;
                        gdkcolor=color_widget->get_current_color();
                        color.set_r(gdkcolor.get_red_p());
             color.set_g(gdkcolor.get_green_p());
index fa812b7..c77ad6b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_value.cpp
 **     \brief Template File
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_VALUE_H
-#define __SINFG_GTKMM_VALUE_H
+#ifndef __SYNFIG_GTKMM_VALUE_H
+#define __SYNFIG_GTKMM_VALUE_H
 
 /* === H E A D E R S ======================================================= */
 
 //#include <gtkmm/colorselection.h>
 #include <gtkmm/optionmenu.h>
 
-//#include <sinfg/sinfg.h>
-#include <sinfg/paramdesc.h>
-#include <sinfg/value.h>
-#include <sinfg/canvas.h>
+//#include <synfig/synfig.h>
+#include <synfig/paramdesc.h>
+#include <synfig/value.h>
+#include <synfig/canvas.h>
 
 
 /* === M A C R O S ========================================================= */
@@ -76,7 +76,7 @@ class Widget_Distance;
 class Widget_ValueBase : public Gtk::HBox
 {
        Gtk::Label *label;
-       sinfg::ValueBase value;
+       synfig::ValueBase value;
 
        Widget_Vector *vector_widget;
        Gtk::SpinButton *real_widget;
@@ -98,8 +98,8 @@ class Widget_ValueBase : public Gtk::HBox
        
 //     std::string hint;
        
-       sinfg::ParamDesc param_desc;
-       etl::handle<sinfg::Canvas> canvas;
+       synfig::ParamDesc param_desc;
+       etl::handle<synfig::Canvas> canvas;
        sigc::signal<void> signal_value_changed_;
        sigc::signal<void> signal_activate_;
 
@@ -110,20 +110,20 @@ public:
        
        sigc::signal<void>& signal_activate() { return signal_activate_; }
 
-       void set_value(const sinfg::ValueBase &data);
-       const sinfg::ValueBase &get_value();
+       void set_value(const synfig::ValueBase &data);
+       const synfig::ValueBase &get_value();
 
        void on_grab_focus();
        
-       void set_param_desc(const sinfg::ParamDesc &x) { param_desc=x; }
-       const sinfg::ParamDesc &get_param_desc() { return param_desc; }
+       void set_param_desc(const synfig::ParamDesc &x) { param_desc=x; }
+       const synfig::ParamDesc &get_param_desc() { return param_desc; }
 
        void set_sensitive(bool x);
        
        //void set_hint(std::string x) { hint=x; }
 //     std::string get_hint() { return hint; }
 
-       void set_canvas(etl::handle<sinfg::Canvas> x) { canvas=x; assert(canvas); }
+       void set_canvas(etl::handle<synfig::Canvas> x) { canvas=x; assert(canvas); }
        void inside_cellrenderer();
        Widget_ValueBase();
        ~Widget_ValueBase();
index 4b9b6bb..9b74e51 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_vector.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 /* === U S I N G =========================================================== */
 
 using namespace std;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -144,7 +144,7 @@ Widget_Vector::set_digits(int x)
 }
 
 void
-Widget_Vector::set_value(const sinfg::Vector &data)
+Widget_Vector::set_value(const synfig::Vector &data)
 {
        vector=data;
 
@@ -157,7 +157,7 @@ Widget_Vector::set_value(const sinfg::Vector &data)
                distance_y->set_value(disty);
                spinbutton_x->hide();
                spinbutton_y->hide();
-       }catch(...) { sinfg::error("Widget_Vector::set_value(): Caught something that was thrown"); }}
+       }catch(...) { synfig::error("Widget_Vector::set_value(): Caught something that was thrown"); }}
        else
        {
                spinbutton_x->set_value(vector[0]);
@@ -167,7 +167,7 @@ Widget_Vector::set_value(const sinfg::Vector &data)
        }
 }
 
-const sinfg::Vector &
+const synfig::Vector &
 Widget_Vector::get_value()
 {
        if(!canvas_ && spinbutton_x)
@@ -183,7 +183,7 @@ Widget_Vector::get_value()
                vector[1]=distance_y->get_value().units(canvas_->rend_desc());
                spinbutton_x->hide();
                spinbutton_y->hide();
-       }catch(...) { sinfg::error("Widget_Vector::set_value(): Caught something that was thrown"); }
+       }catch(...) { synfig::error("Widget_Vector::set_value(): Caught something that was thrown"); }
        return vector;
 }
 
index 7a2911a..eda458b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file widget_vector.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_WIDGET_VECTOR_H
-#define __SINFG_STUDIO_WIDGET_VECTOR_H
+#ifndef __SYNFIG_STUDIO_WIDGET_VECTOR_H
+#define __SYNFIG_STUDIO_WIDGET_VECTOR_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/box.h>
 #include <gtkmm/adjustment.h>
-#include <sinfg/vector.h>
-#include <sinfg/distance.h>
-#include <sinfg/canvas.h>
+#include <synfig/vector.h>
+#include <synfig/distance.h>
+#include <synfig/canvas.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -55,20 +55,20 @@ class Widget_Vector : public Gtk::HBox
        Gtk::Adjustment x_adjustment;
        Gtk::Adjustment y_adjustment;
 
-       sinfg::Vector vector;
+       synfig::Vector vector;
 
        sigc::signal<void> signal_value_changed_;
 
        sigc::signal<void> signal_activate_;
        
-       sinfg::Canvas::LooseHandle canvas_;
+       synfig::Canvas::LooseHandle canvas_;
 
 public:
        
        void activate() { signal_activate_(); }
        
-       void set_canvas(sinfg::Canvas::LooseHandle);
-       sinfg::Canvas::LooseHandle get_canvas()const { return canvas_; }
+       void set_canvas(synfig::Canvas::LooseHandle);
+       synfig::Canvas::LooseHandle get_canvas()const { return canvas_; }
        
        sigc::signal<void>& signal_value_changed() { return signal_value_changed_; }
 
@@ -77,8 +77,8 @@ public:
        void on_value_changed();
        void on_grab_focus();
 
-       void set_value(const sinfg::Vector &data);
-       const sinfg::Vector &get_value();
+       void set_value(const synfig::Vector &data);
+       const synfig::Vector &get_value();
        void set_has_frame(bool x);
        void set_digits(int x);
        Widget_Vector();
index f8fae32..f851513 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_waypoint.cpp
 **     \brief Template Header
 **
@@ -42,7 +42,7 @@
 #include "widget_waypoint.h"
 #endif
 
-using namespace sinfg;
+using namespace synfig;
 using namespace std;
 using namespace etl;
 using namespace studio;
@@ -55,9 +55,9 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-Widget_Waypoint::Widget_Waypoint(etl::handle<sinfg::Canvas> canvas):
+Widget_Waypoint::Widget_Waypoint(etl::handle<synfig::Canvas> canvas):
        Gtk::Table(4,3,false),
-       waypoint(sinfg::ValueBase(),0),
+       waypoint(synfig::ValueBase(),0),
        adj_tension(0.0,-20,20,0.1,1),
        adj_continuity(0.0,-20,20,0.1,1),
        adj_bias(0.0,-20,20,0.1,1),
@@ -139,7 +139,7 @@ Widget_Waypoint::Widget_Waypoint(etl::handle<sinfg::Canvas> canvas):
 }
 
 void
-Widget_Waypoint::set_canvas(sinfg::Canvas::Handle x)
+Widget_Waypoint::set_canvas(synfig::Canvas::Handle x)
 {
        canvas=x;
        assert(canvas);
@@ -149,7 +149,7 @@ Widget_Waypoint::set_canvas(sinfg::Canvas::Handle x)
 }
 
 void
-Widget_Waypoint::set_waypoint(sinfg::Waypoint &x)
+Widget_Waypoint::set_waypoint(synfig::Waypoint &x)
 {
        time_widget->set_fps(canvas->rend_desc().get_frame_rate());
 
@@ -179,7 +179,7 @@ Widget_Waypoint::set_waypoint(sinfg::Waypoint &x)
        adj_temporal_tension.set_value(waypoint.get_temporal_tension());
        
 }
-const sinfg::Waypoint &
+const synfig::Waypoint &
 Widget_Waypoint::get_waypoint()const
 {
 #warning This too!
@@ -187,8 +187,8 @@ Widget_Waypoint::get_waypoint()const
        waypoint.set_value(value_widget->get_value());
        //int i;
 
-       waypoint.set_before((sinfg::Waypoint::Interpolation)before->get_history());
-       waypoint.set_after((sinfg::Waypoint::Interpolation)after->get_history());
+       waypoint.set_before((synfig::Waypoint::Interpolation)before->get_history());
+       waypoint.set_after((synfig::Waypoint::Interpolation)after->get_history());
 
        waypoint.set_tension(adj_tension.get_value());
        waypoint.set_continuity(adj_continuity.get_value());
index 5a45f3e..9f1197e 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_waypoint.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_WIDGET_WAYPOINT_H
-#define __SINFG_GTKMM_WIDGET_WAYPOINT_H
+#ifndef __SYNFIG_GTKMM_WIDGET_WAYPOINT_H
+#define __SYNFIG_GTKMM_WIDGET_WAYPOINT_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gtkmm/spinbutton.h>
 
 
-#include <sinfgapp/value_desc.h>
-#include <sinfg/waypoint.h>
-//#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/string.h>
-#include <sinfg/time.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/waypoint.h>
+//#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -70,8 +70,8 @@ class Widget_Waypoint : public Gtk::Table
        Gtk::Label *value_node_label;
        Gtk::Label *label;
        Widget_Time *time_widget;
-       mutable sinfg::Waypoint waypoint;
-       sinfg::Canvas::Handle canvas;
+       mutable synfig::Waypoint waypoint;
+       synfig::Canvas::Handle canvas;
        //Gtk::Adjustment time_adjustment;
 
        Gtk::Combo *in,*out;
@@ -83,10 +83,10 @@ class Widget_Waypoint : public Gtk::Table
 //     Gtk::ComboDropDownItem item;
 
 public:
-       Widget_Waypoint(etl::handle<sinfg::Canvas> canvas);
-       void set_canvas(sinfg::Canvas::Handle x);
-       void set_waypoint(sinfg::Waypoint &x);
-       const sinfg::Waypoint &get_waypoint()const;
+       Widget_Waypoint(etl::handle<synfig::Canvas> canvas);
+       void set_canvas(synfig::Canvas::Handle x);
+       void set_waypoint(synfig::Waypoint &x);
+       const synfig::Waypoint &get_waypoint()const;
 }; // END of class Widget_Waypoint
 
 }; // END of namespace studio
index 20584f1..f430235 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_waypointmodel.cpp
 **     \brief Template Header
 **
@@ -39,7 +39,7 @@
 #include "widget_waypointmodel.h"
 #endif
 
-using namespace sinfg;
+using namespace synfig;
 using namespace std;
 using namespace etl;
 using namespace studio;
@@ -161,7 +161,7 @@ Widget_WaypointModel::on_change()
 }
 
 void
-Widget_WaypointModel::set_waypoint_model(sinfg::Waypoint::Model &x)
+Widget_WaypointModel::set_waypoint_model(synfig::Waypoint::Model &x)
 {
        waypoint_model=x;
        updating=true;
index 8d5a9b4..ebae1aa 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file dialog_waypointmodel.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_WIDGET_WAYPOINTMODEL_H
-#define __SINFG_GTKMM_WIDGET_WAYPOINTMODEL_H
+#ifndef __SYNFIG_GTKMM_WIDGET_WAYPOINTMODEL_H
+#define __SYNFIG_GTKMM_WIDGET_WAYPOINTMODEL_H
 
 /* === H E A D E R S ======================================================= */
 
@@ -44,9 +44,9 @@
 #include <gtkmm/checkbutton.h>
 
 
-#include <sinfg/waypoint.h>
-#include <sinfg/string.h>
-#include <sinfg/time.h>
+#include <synfig/waypoint.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
 
 /* === M A C R O S ========================================================= */
 
@@ -62,7 +62,7 @@ class Widget_WaypointModel;
 
 class Widget_WaypointModel : public Gtk::Table
 {      
-       sinfg::Waypoint::Model waypoint_model;
+       synfig::Waypoint::Model waypoint_model;
        
        bool updating;
        
@@ -84,8 +84,8 @@ class Widget_WaypointModel : public Gtk::Table
        
 public:
        Widget_WaypointModel();
-       void set_waypoint_model(sinfg::Waypoint::Model &x);
-       const sinfg::Waypoint::Model &get_waypoint_model()const { return waypoint_model; }
+       void set_waypoint_model(synfig::Waypoint::Model &x);
+       const synfig::Waypoint::Model &get_waypoint_model()const { return waypoint_model; }
 }; // END of class Widget_WaypointModel
 
 }; // END of namespace studio
index 740f791..5e0eef3 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file workarea.cpp
 **     \brief Template Header
 **
 #include <sigc++/hide.h>
 #include <ETL/misc>
 
-#include <sinfg/target_scanline.h>
-#include <sinfg/target_tile.h>
-#include <sinfg/surface.h>
-#include <sinfgapp/canvasinterface.h>
+#include <synfig/target_scanline.h>
+#include <synfig/target_tile.h>
+#include <synfig/surface.h>
+#include <synfigapp/canvasinterface.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "widget_color.h"
-#include <sinfg/distance.h>
+#include <synfig/distance.h>
 #include "workarearenderer.h"
 
 #include "renderer_canvas.h"
@@ -66,7 +66,7 @@
 #include "asyncrenderer.h"
 #include <gtkmm/frame.h>
 
-#include <sinfg/mutex.h>
+#include <synfig/mutex.h>
 
 #endif
 
@@ -74,7 +74,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -91,7 +91,7 @@ using namespace studio;
 
 /* === C L A S S E S ======================================================= */
 
-class WorkAreaTarget : public sinfg::Target_Tile
+class WorkAreaTarget : public synfig::Target_Tile
 {
 public:
        WorkArea *workarea;
@@ -107,9 +107,9 @@ public:
        bool onion_first_tile;
        int onion_layers;
 
-       std::list<sinfg::Time> onion_skin_queue;
+       std::list<synfig::Time> onion_skin_queue;
 
-       sinfg::Mutex mutex;
+       synfig::Mutex mutex;
 
        void set_onion_skin(bool x)
        {
@@ -182,7 +182,7 @@ public:
                workarea->queue_draw();
        }
 
-       virtual bool set_rend_desc(sinfg::RendDesc *newdesc)
+       virtual bool set_rend_desc(synfig::RendDesc *newdesc)
        {
                assert(workarea);
                newdesc->set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
@@ -213,10 +213,10 @@ public:
 
        virtual int next_frame(Time& time)
        {
-               sinfg::Mutex::Lock lock(mutex);
+               synfig::Mutex::Lock lock(mutex);
                
                if(!onionskin)
-                       return sinfg::Target_Tile::next_frame(time);
+                       return synfig::Target_Tile::next_frame(time);
                
                onion_first_tile=(onion_layers==(signed)onion_skin_queue.size());
                
@@ -233,7 +233,7 @@ public:
 
        virtual int next_tile(int& x, int& y)
        {
-               sinfg::Mutex::Lock lock(mutex);
+               synfig::Mutex::Lock lock(mutex);
                //if(workarea->tile_queue.empty()) return 0;
                        
                //int curr_tile(workarea->tile_queue.front());
@@ -259,9 +259,9 @@ public:
        }
 
        
-       virtual bool start_frame(sinfg::ProgressCallback *cb)
+       virtual bool start_frame(synfig::ProgressCallback *cb)
        {
-               sinfg::Mutex::Lock lock(mutex);
+               synfig::Mutex::Lock lock(mutex);
 
                int tw(rend_desc().get_w()/get_tile_w());
                if(rend_desc().get_w()%get_tile_w()!=0)tw++;
@@ -280,14 +280,14 @@ public:
                
        static void free_buff(const guint8 *x) { free(const_cast<guint8*>(x)); }
        
-       virtual bool add_tile(const sinfg::Surface &surface, int x, int y)
+       virtual bool add_tile(const synfig::Surface &surface, int x, int y)
        {
-               sinfg::Mutex::Lock lock(mutex);
+               synfig::Mutex::Lock lock(mutex);
                assert(surface);
                
                PixelFormat pf(PF_RGB);
                
-               const int total_bytes(get_tile_w()*get_tile_h()*sinfg::channels(pf));
+               const int total_bytes(get_tile_w()*get_tile_h()*synfig::channels(pf));
 
                unsigned char *buffer((unsigned char*)malloc(total_bytes));
 
@@ -332,7 +332,7 @@ public:
                        8, // bits per sample
                        surface.get_w(),        // width
                        surface.get_h(),        // height
-                       surface.get_w()*sinfg::channels(pf), // stride (pitch)
+                       surface.get_w()*synfig::channels(pf), // stride (pitch)
                        sigc::ptr_fun(&WorkAreaTarget::free_buff)
                );      
 
@@ -380,7 +380,7 @@ public:
 };
 
 
-class WorkAreaTarget_Full : public sinfg::Target_Scanline
+class WorkAreaTarget_Full : public synfig::Target_Scanline
 {
 public:
        WorkArea *workarea;
@@ -398,7 +398,7 @@ public:
 
        Surface surface;
 
-       std::list<sinfg::Time> onion_skin_queue;
+       std::list<synfig::Time> onion_skin_queue;
 
        void set_onion_skin(bool x)
        {
@@ -457,7 +457,7 @@ public:
        {
        }
 
-       virtual bool set_rend_desc(sinfg::RendDesc *newdesc)
+       virtual bool set_rend_desc(synfig::RendDesc *newdesc)
        {
                assert(workarea);
                newdesc->set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
@@ -488,7 +488,7 @@ public:
                        workarea->tile_book[0].second=refresh_id;
 
                if(!onionskin)
-                       return sinfg::Target_Scanline::next_frame(time);
+                       return synfig::Target_Scanline::next_frame(time);
                
                onion_first_tile=(onion_layers==(signed)onion_skin_queue.size());
                
@@ -503,7 +503,7 @@ public:
        }
 
        
-       virtual bool start_frame(sinfg::ProgressCallback *cb)
+       virtual bool start_frame(synfig::ProgressCallback *cb)
        {
                return true;
        }
@@ -526,7 +526,7 @@ public:
                
                PixelFormat pf(PF_RGB);
                
-               const int total_bytes(surface.get_w()*surface.get_h()*sinfg::channels(pf));
+               const int total_bytes(surface.get_w()*surface.get_h()*synfig::channels(pf));
 
                unsigned char *buffer((unsigned char*)malloc(total_bytes));
 
@@ -570,7 +570,7 @@ public:
                        8, // bits per sample
                        surface.get_w(),        // width
                        surface.get_h(),        // height
-                       surface.get_w()*sinfg::channels(pf), // stride (pitch)
+                       surface.get_w()*synfig::channels(pf), // stride (pitch)
                        sigc::ptr_fun(&WorkAreaTarget::free_buff)
                );      
 
@@ -618,7 +618,7 @@ public:
 /* === M E T H O D S ======================================================= */
 
 
-WorkArea::WorkArea(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface):
+WorkArea::WorkArea(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface):
        Gtk::Table(4+RULER_FIX, 3, false),
        canvas_interface(canvas_interface),
        canvas(canvas_interface->get_canvas()),
@@ -696,7 +696,7 @@ WorkArea::WorkArea(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface
        
        attach(*drawing_frame, 1, 3+RULER_FIX, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
 
-       Gtk::IconSize iconsize=Gtk::IconSize::from_name("sinfg-small_icon");
+       Gtk::IconSize iconsize=Gtk::IconSize::from_name("synfig-small_icon");
 
 
        // Create the vertical and horizontal rulers
@@ -875,7 +875,7 @@ WorkArea::load_meta_data()
                set_grid_size(Vector(gx,gy));
        }
        else
-               sinfg::error("WorkArea::load_meta_data(): Unable to parse data for \"grid_size\", which was \"%s\"",data.c_str());
+               synfig::error("WorkArea::load_meta_data(): Unable to parse data for \"grid_size\", which was \"%s\"",data.c_str());
 
        data=canvas->get_meta_data("grid_show");
        if(data.size() && (data=="1" || data[0]=='t' || data[0]=='T'))
@@ -1023,7 +1023,7 @@ WorkArea::popup_menu()
 }
 
 void
-WorkArea::set_grid_size(const sinfg::Vector &s)
+WorkArea::set_grid_size(const synfig::Vector &s)
 {
        Duckmatic::set_grid_size(s);
        save_meta_data();
@@ -1031,7 +1031,7 @@ WorkArea::set_grid_size(const sinfg::Vector &s)
 }
 
 void
-WorkArea::set_focus_point(const sinfg::Point &point)
+WorkArea::set_focus_point(const synfig::Point &point)
 {
        // These next three lines try to ensure that we place the
        // focus on a pixel boundry
@@ -1039,9 +1039,9 @@ WorkArea::set_focus_point(const sinfg::Point &point)
        adjusted[0]=(abs(adjusted[0]-floor(adjusted[0]))<0.5)?floor(adjusted[0])*abs(get_pw()):ceil(adjusted[0])*abs(get_ph());
        adjusted[1]=(abs(adjusted[1]-floor(adjusted[1]))<0.5)?floor(adjusted[1])*abs(get_ph()):ceil(adjusted[1])*abs(get_ph());
        */
-       const sinfg::Point& adjusted(point);
+       const synfig::Point& adjusted(point);
        
-       sinfg::RendDesc &rend_desc(get_canvas()->rend_desc());
+       synfig::RendDesc &rend_desc(get_canvas()->rend_desc());
        Real x_factor=(rend_desc.get_br()[0]-rend_desc.get_tl()[0]>0)?-1:1;
        Real y_factor=(rend_desc.get_br()[1]-rend_desc.get_tl()[1]>0)?-1:1;
 
@@ -1049,14 +1049,14 @@ WorkArea::set_focus_point(const sinfg::Point &point)
        get_scrolly_adjustment()->set_value(adjusted[1]*y_factor);      
 }
 
-sinfg::Point
+synfig::Point
 WorkArea::get_focus_point()const
 {
-       sinfg::RendDesc &rend_desc(get_canvas()->rend_desc());
+       synfig::RendDesc &rend_desc(get_canvas()->rend_desc());
        Real x_factor=(rend_desc.get_br()[0]-rend_desc.get_tl()[0]>0)?-1:1;
        Real y_factor=(rend_desc.get_br()[1]-rend_desc.get_tl()[1]>0)?-1:1;
        
-       return sinfg::Point(get_scrollx_adjustment()->get_value()*x_factor, get_scrolly_adjustment()->get_value()*y_factor);
+       return synfig::Point(get_scrollx_adjustment()->get_value()*x_factor, get_scrolly_adjustment()->get_value()*y_factor);
 }
 
 bool
@@ -1117,7 +1117,7 @@ WorkArea::on_key_press_event(GdkEventKey* event)
                        break;
        }
        
-       sinfgapp::Action::PassiveGrouper grouper(instance.get(),"Nudge");
+       synfigapp::Action::PassiveGrouper grouper(instance.get(),"Nudge");
        
        // Grid snap does not apply to nudging
        bool grid_snap_holder(get_grid_snap());
@@ -1144,7 +1144,7 @@ WorkArea::on_key_press_event(GdkEventKey* event)
 bool
 WorkArea::on_drawing_area_event(GdkEvent *event)
 {
-       sinfg::Point mouse_pos;
+       synfig::Point mouse_pos;
     float bezier_click_pos;
        const float radius((abs(pw)+abs(ph))*4);
        int button_pressed(0);
@@ -1198,7 +1198,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
                // and the buttons
                if(!event->button.axes)
                {
-                       mouse_pos=sinfg::Point(screen_to_comp_coords(sinfg::Point(event->button.x,event->button.y)));
+                       mouse_pos=synfig::Point(screen_to_comp_coords(synfig::Point(event->button.x,event->button.y)));
                        button_pressed=event->button.button;
                        pressure=1.0f;
                        is_mouse=true;
@@ -1213,14 +1213,14 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
                                return false;
 
                        pressure=event->button.axes[2];
-                       //sinfg::info("pressure=%f",pressure);
+                       //synfig::info("pressure=%f",pressure);
                        pressure-=0.04f;
                        pressure/=1.0f-0.04f;
                        
                        
                        assert(!isnan(pressure));
                        
-                       mouse_pos=sinfg::Point(screen_to_comp_coords(sinfg::Point(x,y)));
+                       mouse_pos=synfig::Point(screen_to_comp_coords(synfig::Point(x,y)));
                        
                        button_pressed=event->button.button;
                        
@@ -1230,7 +1230,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
                                pressure=0;
 
                        //if(event->any.type==GDK_BUTTON_PRESS && button_pressed)
-                       //      sinfg::info("Button pressed on input device = %d",event->button.button);
+                       //      synfig::info("Button pressed on input device = %d",event->button.button);
                        
                        //if(event->button.axes[2]>0.1)
                        //      button_pressed=1;
@@ -1503,7 +1503,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
                }
                if(dragging!=DRAG_WINDOW)
                {       // Update those triangle things on the rulers
-                       const sinfg::Point point(mouse_pos);
+                       const synfig::Point point(mouse_pos);
                        hruler->property_position()=Distance(point[0],Distance::SYSTEM_UNITS).get(App::distance_system,get_canvas()->rend_desc());
                        vruler->property_position()=Distance(point[1],Distance::SYSTEM_UNITS).get(App::distance_system,get_canvas()->rend_desc());
                }
@@ -1538,7 +1538,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
                else
                if(dragging==DRAG_DUCK)
                {                       
-                       sinfgapp::Action::PassiveGrouper grouper(instance.get(),"Move");
+                       synfigapp::Action::PassiveGrouper grouper(instance.get(),"Move");
                        dragging=DRAG_NONE;
                        //translate_selected_ducks(mouse_pos);
                        set_axis_lock(false);
@@ -1554,28 +1554,28 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
                                
                                if(modifier&GDK_SHIFT_MASK)
                                {
-                                       //sinfg::info("DUCK_DRAG_RELEASE: SHIFT-MASK ON!");
+                                       //synfig::info("DUCK_DRAG_RELEASE: SHIFT-MASK ON!");
                                        if(clicked_duck)
                                        {
-                                               //sinfg::info("DUCK_DRAG_RELEASE: CLICKED DUCK!");
+                                               //synfig::info("DUCK_DRAG_RELEASE: CLICKED DUCK!");
                                                unselect_duck(clicked_duck);
                                        }
                                }
                                else if(modifier&GDK_CONTROL_MASK)
                                {
-                                       //sinfg::info("DUCK_DRAG_RELEASE: CONTROL-MASK ON!");
+                                       //synfig::info("DUCK_DRAG_RELEASE: CONTROL-MASK ON!");
                                        if(clicked_duck)
                                        {
-                                               //sinfg::info("DUCK_DRAG_RELEASE: CLICKED DUCK!");
+                                               //synfig::info("DUCK_DRAG_RELEASE: CLICKED DUCK!");
                                                unselect_duck(clicked_duck);
                                        }
                                }
                                else
                                {
-                                       //sinfg::info("DUCK_DRAG_RELEASE: NO MASK!");
+                                       //synfig::info("DUCK_DRAG_RELEASE: NO MASK!");
                                        if(clicked_duck)
                                        {
-                                               //sinfg::info("DUCK_DRAG_RELEASE: CLICKED DUCK!");
+                                               //synfig::info("DUCK_DRAG_RELEASE: CLICKED DUCK!");
                                                clear_selected_ducks();
                                                select_duck(clicked_duck);
                                        }
@@ -1681,7 +1681,7 @@ WorkArea::on_hruler_event(GdkEvent *event)
                        if(isnan(y) || isnan(x))
                                return false;                   
                        
-                       *curr_guide=sinfg::Point(screen_to_comp_coords(sinfg::Point(x,y)))[1];
+                       *curr_guide=synfig::Point(screen_to_comp_coords(synfig::Point(x,y)))[1];
 
                        queue_draw();
                }
@@ -1741,7 +1741,7 @@ WorkArea::on_vruler_event(GdkEvent *event)
 void
 WorkArea::refresh_dimension_info()
 {
-       sinfg::RendDesc &rend_desc(get_canvas()->rend_desc());
+       synfig::RendDesc &rend_desc(get_canvas()->rend_desc());
 
        canvaswidth=rend_desc.get_br()[0]-rend_desc.get_tl()[0];
        canvasheight=rend_desc.get_br()[1]-rend_desc.get_tl()[1];
@@ -1763,9 +1763,9 @@ WorkArea::refresh_dimension_info()
        if(drawing_area->get_width()<=0 || drawing_area->get_height()<=0 || w==0 || h==0)
                return;
        
-       const sinfg::Point focus_point(get_focus_point());
-       const sinfg::Real x(focus_point[0]/pw+drawing_area->get_width()/2-w/2);
-       const sinfg::Real y(focus_point[1]/ph+drawing_area->get_height()/2-h/2);
+       const synfig::Point focus_point(get_focus_point());
+       const synfig::Real x(focus_point[0]/pw+drawing_area->get_width()/2-w/2);
+       const synfig::Real y(focus_point[1]/ph+drawing_area->get_height()/2-h/2);
        
        window_tl[0]=rend_desc.get_tl()[0]-pw*x;
        window_br[0]=rend_desc.get_br()[0]+pw*(drawing_area->get_width()-x-w);
@@ -1782,26 +1782,26 @@ WorkArea::refresh_dimension_info()
 }
 
 
-sinfg::Point
-WorkArea::screen_to_comp_coords(sinfg::Point pos)const
+synfig::Point
+WorkArea::screen_to_comp_coords(synfig::Point pos)const
 {
-       sinfg::RendDesc &rend_desc(get_canvas()->rend_desc());
-       //sinfg::Vector::value_type canvaswidth=rend_desc.get_br()[0]-rend_desc.get_tl()[0];
-       //sinfg::Vector::value_type canvasheight=rend_desc.get_br()[1]-rend_desc.get_tl()[1];
-       //sinfg::Vector::value_type pw=canvaswidth/w;
-       //sinfg::Vector::value_type ph=canvasheight/h;
+       synfig::RendDesc &rend_desc(get_canvas()->rend_desc());
+       //synfig::Vector::value_type canvaswidth=rend_desc.get_br()[0]-rend_desc.get_tl()[0];
+       //synfig::Vector::value_type canvasheight=rend_desc.get_br()[1]-rend_desc.get_tl()[1];
+       //synfig::Vector::value_type pw=canvaswidth/w;
+       //synfig::Vector::value_type ph=canvasheight/h;
        Vector focus_point=get_focus_point();
-       sinfg::Vector::value_type x=focus_point[0]/pw+drawing_area->get_width()/2-w/2;
-       sinfg::Vector::value_type y=focus_point[1]/ph+drawing_area->get_height()/2-h/2;
+       synfig::Vector::value_type x=focus_point[0]/pw+drawing_area->get_width()/2-w/2;
+       synfig::Vector::value_type y=focus_point[1]/ph+drawing_area->get_height()/2-h/2;
 
-       return rend_desc.get_tl()-sinfg::Point(pw*x,ph*y)+sinfg::Point(pw*pos[0],ph*pos[1]);
+       return rend_desc.get_tl()-synfig::Point(pw*x,ph*y)+synfig::Point(pw*pos[0],ph*pos[1]);
 }
 
-sinfg::Point
-WorkArea::comp_to_screen_coords(sinfg::Point pos)const
+synfig::Point
+WorkArea::comp_to_screen_coords(synfig::Point pos)const
 {
-       sinfg::warning("WorkArea::comp_to_screen_coords: Not yet implemented");
-       return sinfg::Point();
+       synfig::warning("WorkArea::comp_to_screen_coords: Not yet implemented");
+       return synfig::Point();
 }
 
 int
@@ -1811,13 +1811,13 @@ WorkArea::next_unrendered_tile(int refreshes)const
        if(tile_book.empty())
                return -1;
 
-       //const sinfg::RendDesc &rend_desc(get_canvas()->rend_desc());
+       //const synfig::RendDesc &rend_desc(get_canvas()->rend_desc());
        
-       const sinfg::Vector focus_point(get_focus_point());
+       const synfig::Vector focus_point(get_focus_point());
        
        // Calculate the window coordinates of the top-left
        // corner of the canvas.
-       const sinfg::Vector::value_type
+       const synfig::Vector::value_type
                x(focus_point[0]/pw+drawing_area->get_width()/2-w/2),
                y(focus_point[1]/ph+drawing_area->get_height()/2-h/2);
        
@@ -1894,9 +1894,9 @@ WorkArea::refresh(GdkEventExpose*event)
 
        drawing_area->get_window()->clear();
        
-       //const sinfg::RendDesc &rend_desc(get_canvas()->rend_desc());
+       //const synfig::RendDesc &rend_desc(get_canvas()->rend_desc());
        
-       const sinfg::Vector focus_point(get_focus_point());
+       const synfig::Vector focus_point(get_focus_point());
        
        // Update the old focus point
        last_focus_point=focus_point;
@@ -1917,21 +1917,21 @@ WorkArea::refresh(GdkEventExpose*event)
        
        // Calculate the window coordinates of the top-left
        // corner of the canvas.
-       //const sinfg::Vector::value_type
+       //const synfig::Vector::value_type
        //      x(focus_point[0]/pw+drawing_area->get_width()/2-w/2),
        //      y(focus_point[1]/ph+drawing_area->get_height()/2-h/2);
 
-       //const sinfg::Vector::value_type window_startx(window_tl[0]);
-       //const sinfg::Vector::value_type window_endx(window_br[0]);
-       //const sinfg::Vector::value_type window_starty(window_tl[1]);
-       //const sinfg::Vector::value_type window_endy(window_br[1]);
+       //const synfig::Vector::value_type window_startx(window_tl[0]);
+       //const synfig::Vector::value_type window_endx(window_br[0]);
+       //const synfig::Vector::value_type window_starty(window_tl[1]);
+       //const synfig::Vector::value_type window_endy(window_br[1]);
        
        Glib::RefPtr<Gdk::GC> gc=Gdk::GC::create(drawing_area->get_window());
 
 
 
        // If we are in animate mode, draw a red border around the screen
-       if(canvas_interface->get_mode()&sinfgapp::MODE_ANIMATE)
+       if(canvas_interface->get_mode()&synfigapp::MODE_ANIMATE)
        {
                /*gc->set_rgb_fg_color(Gdk::Color("#FF0000"));
                gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);       
@@ -1985,7 +1985,7 @@ WorkArea::set_quality(int x)
 }
 
 
-class WorkAreaProgress : public sinfg::ProgressCallback
+class WorkAreaProgress : public synfig::ProgressCallback
 {
        WorkArea *work_area;
        ProgressCallback *cb;
@@ -2037,7 +2037,7 @@ studio::WorkArea::async_update_preview()
        //studio::App::Busy busy;
        
        //WorkAreaProgress callback(this,get_canvas_view()->get_ui_interface().get());
-       //sinfg::ProgressCallback *cb=&callback;
+       //synfig::ProgressCallback *cb=&callback;
 
        if(!is_visible())return false;
        
@@ -2091,7 +2091,7 @@ studio::WorkArea::async_update_preview()
        // been set, so there is no need to have to
        // recalculate that over again.
        // UPDATE: This is kind of needless with
-       // the way that time is handled now in SINFG.
+       // the way that time is handled now in SYNFIG.
        //target->set_avoid_time_sync(true);
        async_renderer=new AsyncRenderer(target);
        async_renderer->signal_finished().connect(
@@ -2101,7 +2101,7 @@ studio::WorkArea::async_update_preview()
        rendering=true;
        async_renderer->start();
 
-       sinfg::ProgressCallback *cb=get_canvas_view()->get_ui_interface().get();
+       synfig::ProgressCallback *cb=get_canvas_view()->get_ui_interface().get();
 
        rendering=true;
        cb->task("Rendering...");
@@ -2113,7 +2113,7 @@ studio::WorkArea::async_update_preview()
 void 
 studio::WorkArea::async_update_finished()
 {
-       sinfg::ProgressCallback *cb=get_canvas_view()->get_ui_interface().get();
+       synfig::ProgressCallback *cb=get_canvas_view()->get_ui_interface().get();
 
        rendering=false;
 
@@ -2153,7 +2153,7 @@ again:
        studio::App::Busy busy;
        
        WorkAreaProgress callback(this,get_canvas_view()->get_ui_interface().get());
-       sinfg::ProgressCallback *cb=&callback;
+       synfig::ProgressCallback *cb=&callback;
        
        // We don't want to render if we are already rendering
        if(rendering)
@@ -2292,15 +2292,15 @@ WorkArea::sync_render_preview_hook()
 void
 WorkArea::queue_scroll()
 {
-//     const sinfg::RendDesc &rend_desc(get_canvas()->rend_desc());
+//     const synfig::RendDesc &rend_desc(get_canvas()->rend_desc());
        
-       const sinfg::Point focus_point(get_focus_point());
+       const synfig::Point focus_point(get_focus_point());
        
-       const sinfg::Real
+       const synfig::Real
                new_x(focus_point[0]/pw+drawing_area->get_width()/2-w/2),
                new_y(focus_point[1]/ph+drawing_area->get_height()/2-h/2);
 
-       const sinfg::Real
+       const synfig::Real
                old_x(last_focus_point[0]/pw+drawing_area->get_width()/2-w/2),
                old_y(last_focus_point[1]/ph+drawing_area->get_height()/2-h/2);
 
@@ -2370,12 +2370,12 @@ studio::WorkArea::__render_preview(gpointer data)
 void
 studio::WorkArea::queue_render_preview()
 {
-       //sinfg::info("queue_render_preview(): called for %s", get_canvas_view()->get_time().get_string().c_str());
+       //synfig::info("queue_render_preview(): called for %s", get_canvas_view()->get_time().get_string().c_str());
 
        if(queued==true)
        {
                return;
-               //sinfg::info("queue_render_preview(): already queued, unqueuing");
+               //synfig::info("queue_render_preview(): already queued, unqueuing");
 /*             if(render_idle_func_id)
                        g_source_remove(render_idle_func_id);
                render_idle_func_id=0;
@@ -2398,7 +2398,7 @@ studio::WorkArea::queue_render_preview()
 
        if(queued==false)
        {
-               //sinfg::info("queue_render_preview(): (re)queuing...");
+               //synfig::info("queue_render_preview(): (re)queuing...");
                //render_idle_func_id=g_idle_add_full(G_PRIORITY_DEFAULT,__render_preview,this,NULL);
                render_idle_func_id=g_timeout_add_full(G_PRIORITY_DEFAULT,queue_time,__render_preview,this,NULL);
                queued=true;
@@ -2477,7 +2477,7 @@ studio::WorkArea::set_zoom(float z)
 }
 
 void
-WorkArea::set_selected_value_node(etl::loose_handle<sinfg::ValueNode> x)
+WorkArea::set_selected_value_node(etl::loose_handle<synfig::ValueNode> x)
 {
        if(x!=selected_value_node_)
        {
index 8e1da79..2765510 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file workarea.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_GTKMM_WORKAREA_H
-#define __SINFG_GTKMM_WORKAREA_H
+#ifndef __SYNFIG_GTKMM_WORKAREA_H
+#define __SYNFIG_GTKMM_WORKAREA_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <gdkmm/cursor.h>
 #include <gdkmm/device.h>
 
-#include <sinfg/time.h>
-#include <sinfg/vector.h>
-#include <sinfg/general.h>
-#include <sinfg/renddesc.h>
-#include <sinfg/canvas.h>
+#include <synfig/time.h>
+#include <synfig/vector.h>
+#include <synfig/general.h>
+#include <synfig/renddesc.h>
+#include <synfig/canvas.h>
 
 #include "zoomdial.h"
 #include "duckmatic.h"
@@ -75,9 +75,9 @@ public:
 
 class WorkAreaTarget;
 class WorkAreaTarget_Full;
-namespace sinfgapp { class CanvasInterface; };
+namespace synfigapp { class CanvasInterface; };
 
-namespace sinfg { class Layer; };
+namespace synfig { class Layer; };
 namespace Gtk { class Frame; };
 
 namespace studio
@@ -135,8 +135,8 @@ private:
        etl::handle<studio::AsyncRenderer> async_renderer;
 
 
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface;
-       etl::handle<sinfg::Canvas> canvas;
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface;
+       etl::handle<synfig::Canvas> canvas;
        etl::loose_handle<studio::Instance> instance;
        etl::loose_handle<studio::CanvasView> canvas_view;
 
@@ -154,14 +154,14 @@ private:
        // Bleh!
        int     w;                                              //!< Width of the image (in pixels)
        int     h;                                              //!< Height of the image (in pixels)
-       sinfg::Real     canvaswidth;    //!< Width of the canvas
-       sinfg::Real     canvasheight;   //!< Height of the canvas
-       sinfg::Real     pw;                             //!< The width of a pixel
-       sinfg::Real     ph;                             //!< The height of a pixel
+       synfig::Real    canvaswidth;    //!< Width of the canvas
+       synfig::Real    canvasheight;   //!< Height of the canvas
+       synfig::Real    pw;                             //!< The width of a pixel
+       synfig::Real    ph;                             //!< The height of a pixel
        float zoom;                                     //!< Zoom factor
        float prev_zoom;                        //!< Previous Zoom factor
-       sinfg::Point window_tl;         //!< The (theoretical) top-left corner of the view window
-       sinfg::Point window_br;         //!< The (theoretical) bottom-right corner of the view window
+       synfig::Point window_tl;                //!< The (theoretical) top-left corner of the view window
+       synfig::Point window_br;                //!< The (theoretical) bottom-right corner of the view window
 
        guint32 last_event_time;
 
@@ -169,10 +169,10 @@ private:
        //unsigned char *buffer;
        
        //! ???
-       sinfg::ProgressCallback *progresscallback;
+       synfig::ProgressCallback *progresscallback;
 
        //! ???
-       sinfg::RendDesc desc;
+       synfig::RendDesc desc;
        
        //! This flag is set if the user is dragging the video window
        /*! \see drag_point */
@@ -182,12 +182,12 @@ private:
        etl::handle<Duckmatic::Duck> hover_duck;
 
        //! When dragging the viewport, this is set to the origin of the drag
-       sinfg::Point drag_point;
+       synfig::Point drag_point;
 
-       sinfg::Point curr_point;
+       synfig::Point curr_point;
 
        //! ???
-       sinfg::Point previous_focus;
+       synfig::Point previous_focus;
 
        //! This flag is set if the grid should be drawn
        bool show_grid;
@@ -218,7 +218,7 @@ private:
        gint render_idle_func_id;
 
        //! The coordinates of the focus the last time a part of the screen was refreshed
-       sinfg::Point last_focus_point;
+       synfig::Point last_focus_point;
 
        bool canceled_;
        
@@ -231,7 +231,7 @@ private:
        
        bool onion_skin;
                
-       etl::loose_handle<sinfg::ValueNode> selected_value_node_;
+       etl::loose_handle<synfig::ValueNode> selected_value_node_;
 
 
        /*
@@ -240,8 +240,8 @@ private:
 
 public:
 
-       const etl::loose_handle<sinfg::ValueNode>& get_selected_value_node() { return  selected_value_node_; }
-       const sinfg::Point& get_drag_point()const { return drag_point; }
+       const etl::loose_handle<synfig::ValueNode>& get_selected_value_node() { return  selected_value_node_; }
+       const synfig::Point& get_drag_point()const { return drag_point; }
        std::vector< std::pair<Glib::RefPtr<Gdk::Pixbuf>,int> >& get_tile_book(){ return tile_book; }
        int get_refreshes()const { return refreshes; }
        bool get_canceled()const { return canceled_; }
@@ -286,7 +286,7 @@ private:
        sigc::signal<void,GdkDevice* > signal_input_device_changed_;
 
        //! One signal per button
-       sigc::signal<void,sinfg::Point> signal_user_click_[5];
+       sigc::signal<void,synfig::Point> signal_user_click_[5];
 
        sigc::signal<void> signal_popup_menu_;
 
@@ -296,7 +296,7 @@ private:
        sigc::signal<void> signal_onion_skin_changed_;
 
        //! Signal for when the user clicks on a layer
-       sigc::signal<void, etl::handle<sinfg::Layer> > signal_layer_selected_;
+       sigc::signal<void, etl::handle<synfig::Layer> > signal_layer_selected_;
 
        sigc::signal<void> signal_view_window_changed_;
 
@@ -316,9 +316,9 @@ public:
        sigc::signal<void> &signal_popup_menu() { return signal_popup_menu_; }
 
        //! One signal per button (5 buttons)
-       sigc::signal<void,sinfg::Point> &signal_user_click(int button=0){ return signal_user_click_[button]; }
+       sigc::signal<void,synfig::Point> &signal_user_click(int button=0){ return signal_user_click_[button]; }
 
-       sigc::signal<void, etl::handle<sinfg::Layer> >& signal_layer_selected() { return signal_layer_selected_; }
+       sigc::signal<void, etl::handle<synfig::Layer> >& signal_layer_selected() { return signal_layer_selected_; }
 
        /*
  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
@@ -329,19 +329,19 @@ public:
        bool get_onion_skin()const;
        void toggle_onion_skin() { set_onion_skin(!get_onion_skin()); }
 
-       void set_selected_value_node(etl::loose_handle<sinfg::ValueNode> x);
+       void set_selected_value_node(etl::loose_handle<synfig::ValueNode> x);
 
        bool is_dragging() { return dragging!=DRAG_NONE; }
 
        DragMode get_dragging_mode() { return dragging; }
 
-       WorkArea(etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface);
+       WorkArea(etl::loose_handle<synfigapp::CanvasInterface> canvas_interface);
        virtual ~WorkArea();
 
        void set_cursor(const Gdk::Cursor& x);
        void set_cursor(Gdk::CursorType x);
 
-       const sinfg::Point& get_cursor_pos()const { return curr_point; }
+       const synfig::Point& get_cursor_pos()const { return curr_point; }
 
        Gtk::Adjustment *get_scrollx_adjustment() { return &scrollx_adjustment; }
        Gtk::Adjustment *get_scrolly_adjustment() { return &scrolly_adjustment; }
@@ -349,9 +349,9 @@ public:
        const Gtk::Adjustment *get_scrolly_adjustment()const { return &scrolly_adjustment; }
 
        void set_instance(etl::loose_handle<studio::Instance> x) { instance=x; }
-       void set_canvas(etl::handle<sinfg::Canvas> x) { canvas=x; }
+       void set_canvas(etl::handle<synfig::Canvas> x) { canvas=x; }
        void set_canvas_view(etl::loose_handle<studio::CanvasView> x) { canvas_view=x; }
-       etl::handle<sinfg::Canvas> get_canvas()const { return canvas; }
+       etl::handle<synfig::Canvas> get_canvas()const { return canvas; }
        etl::handle<studio::Instance> get_instance()const { return instance; }
        etl::loose_handle<studio::CanvasView> get_canvas_view()const { return canvas_view; }
 
@@ -383,7 +383,7 @@ public:
        void queue_scroll();
        
        //! Sets the size of the grid
-       void set_grid_size(const sinfg::Vector &s);
+       void set_grid_size(const synfig::Vector &s);
                
        //! ??
        void popup_menu();
@@ -398,31 +398,31 @@ public:
        int get_bpp()const { return bpp; }
 
        //! ??
-       const sinfg::RendDesc &get_rend_desc()const { return desc; }
+       const synfig::RendDesc &get_rend_desc()const { return desc; }
        
        //! ??
-       void set_rend_desc(const sinfg::RendDesc &x) { desc=x; }
+       void set_rend_desc(const synfig::RendDesc &x) { desc=x; }
        
        //! Converts screen coords (ie: pixels) to composition coordinates
-       sinfg::Point screen_to_comp_coords(sinfg::Point pos)const;
+       synfig::Point screen_to_comp_coords(synfig::Point pos)const;
 
        //! Converts composition coordinates to screen coords (ie: pixels)
-       sinfg::Point comp_to_screen_coords(sinfg::Point pos)const;
+       synfig::Point comp_to_screen_coords(synfig::Point pos)const;
 
        float get_pw()const { return pw; }
        float get_ph()const { return ph; }
        
-       const sinfg::Point &get_window_tl()const { return window_tl; }
-       const sinfg::Point &get_window_br()const { return window_br; }
+       const synfig::Point &get_window_tl()const { return window_tl; }
+       const synfig::Point &get_window_br()const { return window_br; }
 
 
        bool async_update_preview();
        void async_update_finished();
-       void async_render_preview(sinfg::Time time);
+       void async_render_preview(synfig::Time time);
        void async_render_preview();
        
        bool sync_update_preview();
-       bool sync_render_preview(sinfg::Time time);
+       bool sync_render_preview(synfig::Time time);
        bool sync_render_preview();
        void sync_render_preview_hook();
 
@@ -440,12 +440,12 @@ public:
        void set_zoom(float z);
 
 
-       void set_progress_callback(sinfg::ProgressCallback *x)  { progresscallback=x; }
-       sinfg::ProgressCallback *get_progress_callback() { return progresscallback; }
+       void set_progress_callback(synfig::ProgressCallback *x) { progresscallback=x; }
+       synfig::ProgressCallback *get_progress_callback() { return progresscallback; }
 
-       void set_focus_point(const sinfg::Point &x);
+       void set_focus_point(const synfig::Point &x);
 
-       sinfg::Point get_focus_point()const;
+       synfig::Point get_focus_point()const;
 
        void done_rendering();
        
index 47e2a18..ed1af36 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -37,7 +37,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -118,14 +118,14 @@ float
 WorkAreaRenderer::get_ph()const
 { return get_work_area()->get_ph(); }
 
-sinfg::Point
-WorkAreaRenderer::screen_to_comp_coords(sinfg::Point pos)const
+synfig::Point
+WorkAreaRenderer::screen_to_comp_coords(synfig::Point pos)const
 {
        return get_work_area()->screen_to_comp_coords(pos);
 }
 
-sinfg::Point
-WorkAreaRenderer::comp_to_screen_coords(sinfg::Point pos)const
+synfig::Point
+WorkAreaRenderer::comp_to_screen_coords(synfig::Point pos)const
 {
        return get_work_area()->comp_to_screen_coords(pos);
 }
index d9c41b8..81e8247 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_WORKAREARENDERER_H
-#define __SINFG_WORKAREARENDERER_H
+#ifndef __SYNFIG_WORKAREARENDERER_H
+#define __SYNFIG_WORKAREARENDERER_H
 
 /* === H E A D E R S ======================================================= */
 
 #include <ETL/handle>
 #include <sigc++/signal.h>
 #include <sigc++/object.h>
-#include <sinfg/vector.h>
+#include <synfig/vector.h>
 #include <gdkmm/drawable.h>
 #include <gdkmm/rectangle.h>
 
@@ -68,10 +68,10 @@ public:
        float get_ph()const;
 
        //! Converts screen coords (ie: pixels) to composition coordinates
-       sinfg::Point screen_to_comp_coords(sinfg::Point pos)const;
+       synfig::Point screen_to_comp_coords(synfig::Point pos)const;
 
        //! Converts composition coordinates to screen coords (ie: pixels)
-       sinfg::Point comp_to_screen_coords(sinfg::Point pos)const;
+       synfig::Point comp_to_screen_coords(synfig::Point pos)const;
 
        WorkAreaRenderer();
        virtual ~WorkAreaRenderer();
index 8557f44..27e9374 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file zoomdial.cpp
 **     \brief Template File
 **
index 42c902e..acc4c81 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file zoomdial.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_STUDIO_ZOOMDIAL_H
-#define __SINFG_STUDIO_ZOOMDIAL_H
+#ifndef __SYNFIG_STUDIO_ZOOMDIAL_H
+#define __SYNFIG_STUDIO_ZOOMDIAL_H
 
 /* === H E A D E R S ======================================================= */
 
diff --git a/synfig-studio/trunk/src/sinfgapp/Makefile.am b/synfig-studio/trunk/src/sinfgapp/Makefile.am
deleted file mode 100644 (file)
index 9c46228..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# $Header: /opt/voria/cvs/studio/src/sinfgapp/Makefile.am,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-
-MAINTAINERCLEANFILES=Makefile.in
-INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/libltdl
-
-LAYER_ACTION_HH=actions/layerremove.h actions/layermove.h actions/layerraise.h actions/layerlower.h actions/layeradd.h actions/layeractivate.h actions/layerparamset.h actions/layerparamconnect.h actions/layerparamdisconnect.h actions/layerencapsulate.h actions/layerduplicate.h actions/layersetdesc.h
-LAYER_ACTION_CC=actions/layerremove.cpp actions/layermove.cpp actions/layerraise.cpp actions/layerlower.cpp actions/layeradd.cpp actions/layeractivate.cpp actions/layerparamset.cpp actions/layerparamconnect.cpp actions/layerparamdisconnect.cpp actions/layerencapsulate.cpp actions/layerduplicate.cpp actions/layersetdesc.cpp
-
-VALUEDESC_ACTION_HH=actions/valuedescset.h actions/valuedescexport.h actions/valuedescconvert.h actions/valuedescconnect.h actions/valuedescdisconnect.h actions/valuedesclink.h
-VALUEDESC_ACTION_CC=actions/valuedescset.cpp actions/valuedescexport.cpp actions/valuedescconvert.cpp actions/valuedescconnect.cpp actions/valuedescdisconnect.cpp actions/valuedesclink.cpp
-
-VALUENODE_ACTION_HH=actions/valuenodeconstset.h actions/valuenodeadd.h actions/valuenodereplace.h actions/valuenodelinkconnect.h actions/valuenodelinkdisconnect.h actions/valuenodedynamiclistinsert.h actions/valuenodedynamiclistremove.h actions/valuenoderename.h actions/valuenoderemove.h actions/valuenodedynamiclistinsertsmart.h actions/valuenodedynamiclistremovesmart.h actions/valuenodedynamiclistloop.h actions/valuenodedynamiclistunloop.h actions/valuenodedynamiclistrotateorder.h
-VALUENODE_ACTION_CC=actions/valuenodeconstset.cpp actions/valuenodeadd.cpp actions/valuenodereplace.cpp actions/valuenodelinkconnect.cpp actions/valuenodelinkdisconnect.cpp actions/valuenodedynamiclistinsert.cpp actions/valuenodedynamiclistremove.cpp actions/valuenoderename.cpp actions/valuenoderemove.cpp actions/valuenodedynamiclistinsertsmart.cpp actions/valuenodedynamiclistremovesmart.cpp actions/valuenodedynamiclistloop.cpp actions/valuenodedynamiclistunloop.cpp actions/valuenodedynamiclistrotateorder.cpp
-
-WAYPOINT_ACTION_HH=actions/waypointadd.h actions/waypointset.h actions/waypointsetsmart.h actions/waypointremove.h actions/waypointsimpleadd.h
-WAYPOINT_ACTION_CC=actions/waypointadd.cpp actions/waypointset.cpp actions/waypointsetsmart.cpp actions/waypointremove.cpp actions/waypointsimpleadd.cpp
-
-TIMEPOINT_ACTION_HH=actions/timepointsmove.h actions/timepointscopy.h actions/timepointsdelete.h timegather.h
-TIMEPOINT_ACTION_CC=actions/timepointsmove.cpp actions/timepointscopy.cpp actions/timepointsdelete.cpp timegather.cpp
-
-ACTIVEPOINT_ACTION_HH=actions/activepointadd.h actions/activepointset.h actions/activepointsetsmart.h actions/activepointsetoff.h actions/activepointseton.h actions/activepointremove.h actions/activepointsimpleadd.h
-ACTIVEPOINT_ACTION_CC=actions/activepointadd.cpp actions/activepointset.cpp actions/activepointsetsmart.cpp actions/activepointsetoff.cpp actions/activepointseton.cpp actions/activepointremove.cpp actions/activepointsimpleadd.cpp
-
-KEYFRAME_ACTION_HH=actions/keyframesetdelta.h actions/keyframeadd.h actions/keyframeset.h actions/keyframeremove.h actions/keyframeduplicate.h actions/keyframewaypointset.h
-KEYFRAME_ACTION_CC=actions/keyframesetdelta.cpp actions/keyframeadd.cpp actions/keyframeset.cpp actions/keyframeremove.cpp actions/keyframeduplicate.cpp actions/keyframewaypointset.cpp
-
-CANVAS_ACTION_HH=actions/canvasrenddescset.h actions/canvasadd.h actions/canvasremove.h
-CANVAS_ACTION_CC=actions/canvasrenddescset.cpp actions/canvasadd.cpp actions/canvasremove.cpp
-
-GROUP_ACTION_HH=actions/groupaddlayers.h actions/groupremovelayers.h actions/groupremove.h actions/grouprename.h
-GROUP_ACTION_CC=actions/groupaddlayers.cpp actions/groupremovelayers.cpp actions/groupremove.cpp actions/grouprename.cpp
-
-OTHER_ACTION_HH=actions/colorset.h actions/editmodeset.h actions/blinepointtangentmerge.h actions/blinepointtangentsplit.h actions/gradientset.h
-OTHER_ACTION_CC=actions/colorset.cpp actions/editmodeset.cpp actions/blinepointtangentmerge.cpp actions/blinepointtangentsplit.cpp actions/gradientset.cpp
-
-ACTIONHH=$(GROUP_ACTION_HH) $(LAYER_ACTION_HH) $(VALUEDSEC_ACTION_HH) $(VALUENODE_ACTION_HH) $(WAYPOINT_ACTION_HH) $(KEYFRAME_ACTION_HH) $(OTHER_ACTION_HH) $(CANVAS_ACTION_HH) $(ACTIVEPOINT_ACTION_HH) $(TIMEPOINT_ACTION_HH)
-ACTIONCC=$(GROUP_ACTION_CC) $(LAYER_ACTION_CC) $(VALUEDESC_ACTION_CC) $(VALUENODE_ACTION_CC) $(WAYPOINT_ACTION_CC) $(KEYFRAME_ACTION_CC) $(OTHER_ACTION_CC) $(CANVAS_ACTION_CC) $(ACTIVEPOINT_ACTION_CC) $(TIMEPOINT_ACTION_CC)
-
-SINFGAPPHH=$(ACTIONHH) blineconvert.h cvs.h editmode.h action.h action_param.h action_system.h canvasinterface.h instance.h selectionmanager.h uimanager.h value_desc.h main.h inputdevice.h settings.h
-
-sinfglibdir=@sinfglibdir@
-
-lib_LTLIBRARIES = libsinfgapp.la
-libsinfgapp_la_SOURCES =  $(SINFGAPPHH) $(ACTIONCC) blineconvert.cpp cvs.cpp main.cpp action_param.cpp action.cpp action_system.cpp canvasinterface.cpp instance.cpp uimanager.cpp inputdevice.cpp settings.cpp
-libsinfgapp_la_LIBADD = @SINFG_LIBS@
-libsinfgapp_la_CXXFLAGS = @SINFG_CFLAGS@
-libsinfgapp_la_LDFLAGS = -export-dynamic -no-undefined
-
-include_sinfgappdir=$(prefix)/include/sinfgapp-0.0/sinfgapp
-include_sinfgapp_HEADERS = $(SINFGAPPHH)
diff --git a/synfig-studio/trunk/src/sinfgapp/action.cpp b/synfig-studio/trunk/src/sinfgapp/action.cpp
deleted file mode 100644 (file)
index 1c1dd7e..0000000
+++ /dev/null
@@ -1,449 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action.cpp
-**     \brief Template File
-**
-**     $Id: action.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "action.h"
-#include "instance.h"
-
-
-#include "actions/layerremove.h"
-#include "actions/layermove.h"
-#include "actions/layerraise.h"
-#include "actions/layerlower.h"
-#include "actions/layeradd.h"
-#include "actions/layeractivate.h"
-#include "actions/layerparamset.h"
-#include "actions/layerparamconnect.h"
-#include "actions/layerparamdisconnect.h"
-#include "actions/layerencapsulate.h"
-#include "actions/layerduplicate.h"
-#include "actions/layersetdesc.h"
-
-#include "actions/valuenodeconstset.h"
-#include "actions/valuenodeadd.h"
-#include "actions/valuenodereplace.h"
-#include "actions/valuenodelinkconnect.h"
-#include "actions/valuenodelinkdisconnect.h"
-#include "actions/valuenodedynamiclistinsert.h"
-#include "actions/valuenodedynamiclistremove.h"
-#include "actions/valuenodedynamiclistinsertsmart.h"
-#include "actions/valuenodedynamiclistremovesmart.h"
-#include "actions/valuenodedynamiclistloop.h"
-#include "actions/valuenodedynamiclistunloop.h"
-#include "actions/valuenodedynamiclistrotateorder.h"
-#include "actions/valuenoderename.h"
-#include "actions/valuenoderemove.h"
-
-#include "actions/valuedescset.h"
-#include "actions/valuedescexport.h"
-#include "actions/valuedescconvert.h"
-#include "actions/valuedescconnect.h"
-#include "actions/valuedescdisconnect.h"
-#include "actions/valuedesclink.h"
-
-#include "actions/waypointadd.h"
-#include "actions/waypointset.h"
-#include "actions/waypointsetsmart.h"
-#include "actions/waypointremove.h"
-
-#include "actions/activepointadd.h"
-#include "actions/activepointset.h"
-#include "actions/activepointsetsmart.h"
-#include "actions/activepointsetoff.h"
-#include "actions/activepointseton.h"
-#include "actions/activepointremove.h"
-
-#include "actions/keyframeadd.h"
-#include "actions/keyframeset.h"
-#include "actions/keyframeremove.h"
-#include "actions/keyframeduplicate.h"
-#include "actions/keyframewaypointset.h"
-#include "actions/keyframesetdelta.h"
-
-#include "actions/timepointsmove.h"
-#include "actions/timepointscopy.h"
-#include "actions/timepointsdelete.h"
-
-#include "actions/canvasrenddescset.h"
-#include "actions/canvasadd.h"
-#include "actions/canvasremove.h"
-
-#include "actions/editmodeset.h"
-
-#include "actions/blinepointtangentmerge.h"
-#include "actions/blinepointtangentsplit.h"
-
-#include "actions/gradientset.h"
-#include "actions/colorset.h"
-
-#include "actions/groupaddlayers.h"
-#include "actions/groupremovelayers.h"
-#include "actions/groupremove.h"
-#include "actions/grouprename.h"
-
-#include "canvasinterface.h"
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === S T A T I C S ======================================================= */
-
-sinfgapp::Action::Book *book_;
-
-/* === M E T H O D S ======================================================= */
-
-#define ADD_ACTION(x) { BookEntry &be(book()[x::name__]); \
-       be.name=x::name__; \
-       be.local_name=x::local_name__; \
-       be.version=x::version__; \
-       be.task=x::task__; \
-       be.priority=x::priority__; \
-       be.category=x::category__; \
-       be.factory=x::create; \
-       be.get_param_vocab=x::get_param_vocab; \
-       be.is_canidate=x::is_canidate; \
-       }
-       
-
-Action::Main::Main()
-{
-       book_=new sinfgapp::Action::Book();
-       
-       ADD_ACTION(Action::LayerRemove);
-       ADD_ACTION(Action::LayerMove);
-       ADD_ACTION(Action::LayerRaise);
-       ADD_ACTION(Action::LayerLower);
-       ADD_ACTION(Action::LayerAdd);
-       ADD_ACTION(Action::LayerActivate);
-       ADD_ACTION(Action::LayerParamSet);
-       ADD_ACTION(Action::LayerParamConnect);
-       ADD_ACTION(Action::LayerParamDisconnect);
-       ADD_ACTION(Action::LayerEncapsulate);
-       ADD_ACTION(Action::LayerDuplicate);
-       ADD_ACTION(Action::LayerSetDesc);
-       
-       ADD_ACTION(Action::ValueNodeConstSet);  
-       ADD_ACTION(Action::ValueNodeAdd);       
-       ADD_ACTION(Action::ValueNodeReplace);   
-       ADD_ACTION(Action::ValueNodeLinkConnect);
-       ADD_ACTION(Action::ValueNodeLinkDisconnect);
-       ADD_ACTION(Action::ValueNodeDynamicListInsert);
-       ADD_ACTION(Action::ValueNodeDynamicListRemove);
-       ADD_ACTION(Action::ValueNodeDynamicListInsertSmart);
-       ADD_ACTION(Action::ValueNodeDynamicListRemoveSmart);
-       ADD_ACTION(Action::ValueNodeDynamicListLoop);
-       ADD_ACTION(Action::ValueNodeDynamicListUnLoop);
-       ADD_ACTION(Action::ValueNodeDynamicListRotateOrder);
-       ADD_ACTION(Action::ValueNodeRename);
-       ADD_ACTION(Action::ValueNodeRemove);
-       
-       ADD_ACTION(Action::ValueDescSet);
-       ADD_ACTION(Action::ValueDescExport);
-       ADD_ACTION(Action::ValueDescConvert);
-       ADD_ACTION(Action::ValueDescConnect);
-       ADD_ACTION(Action::ValueDescDisconnect);
-       ADD_ACTION(Action::ValueDescLink);
-
-       ADD_ACTION(Action::WaypointAdd);
-       ADD_ACTION(Action::WaypointSet);
-       ADD_ACTION(Action::WaypointSetSmart);
-       ADD_ACTION(Action::WaypointRemove);
-
-       ADD_ACTION(Action::ActivepointAdd);
-       ADD_ACTION(Action::ActivepointSet);
-       ADD_ACTION(Action::ActivepointSetSmart);
-       ADD_ACTION(Action::ActivepointSetOn);
-       ADD_ACTION(Action::ActivepointSetOff);
-       ADD_ACTION(Action::ActivepointRemove);
-
-       ADD_ACTION(Action::KeyframeAdd);
-       ADD_ACTION(Action::KeyframeSet);
-       ADD_ACTION(Action::KeyframeRemove);
-       ADD_ACTION(Action::KeyframeDuplicate);
-       ADD_ACTION(Action::KeyframeWaypointSet);
-       ADD_ACTION(Action::KeyframeSetDelta);
-
-       ADD_ACTION(Action::CanvasRendDescSet);
-       ADD_ACTION(Action::CanvasAdd);
-       ADD_ACTION(Action::CanvasRemove);
-
-       ADD_ACTION(Action::EditModeSet);
-
-       ADD_ACTION(Action::BLinePointTangentMerge);
-       ADD_ACTION(Action::BLinePointTangentSplit);
-
-       ADD_ACTION(Action::GradientSet);
-       ADD_ACTION(Action::ColorSet);
-       
-       ADD_ACTION(Action::TimepointsMove);
-       ADD_ACTION(Action::TimepointsCopy);
-       ADD_ACTION(Action::TimepointsDelete);
-
-       ADD_ACTION(Action::GroupAddLayers);
-       ADD_ACTION(Action::GroupRemoveLayers);
-       ADD_ACTION(Action::GroupRemove);
-       ADD_ACTION(Action::GroupRename);
-}
-
-Action::Main::~Main()
-{
-       delete book_;
-       
-}
-
-
-Action::Book& Action::book() { return *book_; }
-
-
-Action::Handle
-Action::create(const String &name)
-{
-       if(!book().count(name))
-               return 0; //! \todo perhaps we should throw something instead?
-       return book()[name].factory();  
-}
-
-
-Action::CanidateList
-Action::compile_canidate_list(const ParamList& param_list, Category category)
-{
-       Action::CanidateList ret;
-       
-       Book::const_iterator iter;
-
-       //sinfg::info("param_list.size()=%d",param_list.size());
-
-       for(iter=book().begin();iter!=book().end();++iter)
-       {
-               if((iter->second.category&category))
-               {
-                       if(iter->second.is_canidate(param_list))
-                               ret.push_back(iter->second);
-                       else
-                       {
-                               //sinfg::info("Action \"%s\" is not a canidate",iter->second.name.c_str());
-                       }
-               }
-       }
-       
-       return ret;
-}
-
-Action::CanidateList::iterator
-Action::CanidateList::find(const String& x)
-{
-       iterator iter;
-       for(iter=begin();iter!=end();++iter)
-               if(iter->name==x)
-                       break;
-       return iter;
-}
-
-void
-Action::Base::set_param_list(const ParamList &param_list)
-{
-       ParamList::const_iterator iter;
-       
-       for(iter=param_list.begin();iter!=param_list.end();++iter)
-               set_param(iter->first,iter->second);
-}
-
-void
-Super::perform()
-{
-       set_dirty(false);
-       
-       prepare();
-
-       ActionList::const_iterator iter;
-       for(iter=action_list_.begin();iter!=action_list_.end();++iter)
-       {
-               try
-               {
-                       try
-                       {
-                               (*iter)->perform();
-                               CanvasSpecific* canvas_specific(dynamic_cast<CanvasSpecific*>(iter->get()));
-                               if(canvas_specific && canvas_specific->is_dirty())
-                                       set_dirty(true);
-                       }
-                       catch(...)
-                       {
-                               if(iter!=action_list_.begin())
-                               {
-                                       for(--iter;iter!=action_list_.begin();--iter)
-                                               (*iter)->undo();
-                                       (*iter)->undo();
-                               }
-                               throw;
-                       }
-               }
-               catch(Error x)
-               {
-                       throw Error(x.get_type(),((*iter)->get_name()+": "+x.get_desc()).c_str());
-               }
-       }
-}
-
-void
-Super::undo()
-{
-       set_dirty(false);
-
-       ActionList::const_reverse_iterator iter;
-       for(iter=const_cast<const ActionList &>(action_list_).rbegin();iter!=const_cast<const ActionList &>(action_list_).rend();++iter)
-       {
-               try {
-                       (*iter)->undo();
-                       CanvasSpecific* canvas_specific(dynamic_cast<CanvasSpecific*>(iter->get()));
-                       if(canvas_specific && canvas_specific->is_dirty())
-                               set_dirty(true);
-               }
-               catch(...)
-               {
-                       if(iter!=const_cast<const ActionList &>(action_list_).rbegin())
-                       {
-                               for(--iter;iter!=const_cast<const ActionList &>(action_list_).rbegin();--iter)
-                                       (*iter)->perform();
-                               (*iter)->perform();
-                       }
-                       throw;
-               }
-       }
-}
-
-void
-Super::add_action(etl::handle<Undoable> action)
-{
-       action_list_.push_back(action);
-       CanvasSpecific *specific_action=dynamic_cast<CanvasSpecific *>(action.get());
-       if(specific_action && !get_canvas())
-               set_canvas(specific_action->get_canvas());
-}
-
-void
-Super::add_action_front(etl::handle<Undoable> action)
-{
-       action_list_.push_front(action);
-       CanvasSpecific *specific_action=dynamic_cast<CanvasSpecific *>(action.get());
-       if(specific_action && !get_canvas())
-               set_canvas(specific_action->get_canvas());
-}
-
-
-Group::Group(const std::string &str):
-       name_(str),
-       ready_(true)
-{
-}
-
-Group::~Group()
-{
-}
-
-
-
-
-Action::ParamVocab
-Action::CanvasSpecific::get_param_vocab()
-{
-       ParamVocab ret;
-       
-       ret.push_back(ParamDesc("canvas",Param::TYPE_CANVAS)
-               .set_local_name(_("Canvas"))
-               .set_desc(_("Selected Canvas"))
-       );
-
-       ret.push_back(ParamDesc("canvas_interface",Param::TYPE_CANVASINTERFACE)
-               .set_local_name(_("Canvas Interface"))
-               .set_desc(_("Canvas Interface"))
-               .set_optional(true)
-       );
-       
-
-       return ret;
-}
-
-bool
-CanvasSpecific::set_param(const sinfg::String& name, const Param &param)
-{
-       if(name=="canvas" && param.get_type()==Param::TYPE_CANVAS)
-       {
-               if(!param.get_canvas())
-                       return false;
-               set_canvas(param.get_canvas());
-               
-               return true;
-       }
-       if(name=="canvas_interface" && param.get_type()==Param::TYPE_CANVASINTERFACE)
-       {
-               if(!param.get_canvas_interface())
-                       return false;
-               set_canvas_interface(param.get_canvas_interface());
-               if(!get_canvas())
-                       set_canvas(get_canvas_interface()->get_canvas());
-               
-               return true;
-       }
-       if(name=="edit_mode" && param.get_type()==Param::TYPE_EDITMODE)
-       {
-               set_edit_mode(param.get_edit_mode());
-               
-               return true;
-       }
-
-       return false;
-}
-
-bool
-CanvasSpecific::is_ready()const
-{
-       if(!get_canvas())
-               return false;
-       return true;
-}
-
-EditMode
-CanvasSpecific::get_edit_mode()const
-{
-       if(mode_!=MODE_UNDEFINED)
-               return mode_;
-       
-       if(get_canvas_interface())
-               return get_canvas_interface()->get_mode();
-       
-       return MODE_NORMAL;
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/action.h b/synfig-studio/trunk/src/sinfgapp/action.h
deleted file mode 100644 (file)
index 372c8c7..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action.h
-**     \brief Template File
-**
-**     $Id: action.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_H
-#define __SINFG_APP_ACTION_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/string.h>
-#include <sinfg/canvas.h>
-#include <ETL/handle>
-#include <ETL/stringf>
-#include <ETL/trivial>
-
-#include <map>
-#include <list>
-
-#include <sinfg/layer.h>
-#include <sinfg/canvas.h>
-#include <sinfg/valuenode.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/value.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_animated.h>
-#include <sinfg/string.h>
-#include <sinfg/keyframe.h>
-
-#include "action_param.h"
-#include "editmode.h"
-
-/* === M A C R O S ========================================================= */
-
-#define ACTION_MODULE_EXT public: \
-       static const char name__[], local_name__[], version__[], cvs_id__[], task__[]; \
-       static const Category category__; \
-       static const int priority__; \
-       static Action::Base *create(); \
-       virtual sinfg::String get_name()const;  \
-       virtual sinfg::String get_local_name()const;
-
-
-#define ACTION_SET_NAME(class,x) const char class::name__[]=x
-
-#define ACTION_SET_CATEGORY(class,x) const Category class::category__(x)
-
-#define ACTION_SET_TASK(class,x) const char class::task__[]=x
-
-#define ACTION_SET_PRIORITY(class,x) const int class::priority__=x
-
-#define ACTION_SET_LOCAL_NAME(class,x) const char class::local_name__[]=x
-
-#define ACTION_SET_VERSION(class,x) const char class::version__[]=x
-
-#define ACTION_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
-
-#define ACTION_INIT(class) \
-       Action::Base* class::create() { return new class(); }   \
-       sinfg::String class::get_name()const { return name__; } \
-       sinfg::String class::get_local_name()const { return local_name__; }     \
-
-/* === 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 Canvas;
-}; // END of namespace sinfg
-
-namespace sinfgapp {
-
-class Instance;
-class Main;
-       
-namespace Action {     
-
-class System;
-       
-
-//! Exception class, thrown when redoing or undoing an action
-class Error
-{
-public:
-       enum Type
-       {
-               TYPE_UNKNOWN,
-               TYPE_UNABLE,
-               TYPE_BADPARAM,
-               TYPE_CRITICAL,
-               TYPE_NOTREADY,
-               TYPE_BUG,
-
-               TYPE_END
-       };
-private:
-
-       Type type_;
-       sinfg::String desc_;
-
-public:
-       
-       Error(Type type, const char *format, ...):
-               type_(type)
-       {
-               va_list args;
-               va_start(args,format);
-               desc_=etl::vstrprintf(format,args);
-       }
-
-       Error(const char *format, ...):
-               type_(TYPE_UNKNOWN)
-       {
-               va_list args;
-               va_start(args,format);
-               desc_=etl::vstrprintf(format,args);
-       }
-
-       Error(Type type=TYPE_UNABLE):
-               type_(type)
-       {
-       }
-       
-       Type get_type()const { return type_; }
-       sinfg::String get_desc()const { return desc_; }
-       
-}; // END of class Action::Error
-
-class Param;
-class ParamList;
-class ParamDesc;
-class ParamVocab;
-
-// Action Category
-enum Category
-{
-       CATEGORY_NONE                   =0,
-       CATEGORY_LAYER                  =(1<<0),
-       CATEGORY_CANVAS                 =(1<<1),
-       CATEGORY_WAYPOINT               =(1<<2),
-       CATEGORY_ACTIVEPOINT    =(1<<3),
-       CATEGORY_VALUEDESC              =(1<<4),
-       CATEGORY_VALUENODE              =(1<<5),
-       CATEGORY_KEYFRAME               =(1<<6),
-       CATEGORY_GROUP                  =(1<<7),
-
-       CATEGORY_OTHER                  =(1<<12),
-
-       CATEGORY_DRAG                   =(1<<24),
-       
-       CATEGORY_HIDDEN                 =(1<<31),
-       CATEGORY_ALL                    =(~0)-(1<<31)           //!< All categories (EXCEPT HIDDEN)
-}; // END of enum Category
-
-inline Category operator|(Category lhs, Category rhs)
-{ return static_cast<Category>(int(lhs)|int(rhs)); }
-
-
-
-//! Action Base Class
-/*!    An action should implement the following functions:
-**     static bool is_canidate(const ParamList &x);
-**             -       Checks the ParamList to see if this action could be performed.
-**     static ParamVocab get_param_vocab();
-**             -       Yields the ParamVocab object which describes what
-**                     this action needs before it can perform the act.
-**     static Action::Base* create();
-**             -       Factory for creating this action from a ParamList
-**
-*/
-class Base : public etl::shared_object 
-{
-protected:
-       Base() { }
-       
-public:
-       virtual ~Base() { };
-
-       //! This function will throw an Action::Error() on failure
-       virtual void perform()=0;
-       
-       virtual bool set_param(const sinfg::String& name, const Param &) { return false; }
-       virtual bool is_ready()const=0;
-       
-       virtual sinfg::String get_name()const =0;
-       virtual sinfg::String get_local_name()const { return get_name(); }
-
-       void set_param_list(const ParamList &);
-       
-}; // END of class Action::Base
-
-typedef Action::Base* (*Factory)();
-typedef bool (*CanidateChecker)(const ParamList &x);
-typedef ParamVocab (*GetParamVocab)();
-
-typedef etl::handle<Base> Handle;
-
-//! Undoable Action Base Class
-class Undoable : public Base
-{
-       friend class System;
-       bool active_;
-
-protected:
-       Undoable():active_(true) { }
-
-private:
-       void set_active(bool x) { active_=x; }
-
-public:
-
-       //! This function will throw an Action::Error() on failure
-       virtual void undo()=0;
-
-       bool is_active()const { return active_; }
-
-}; // END of class Action::Undoable
-
-//! Action base class for canvas-specific actions
-class CanvasSpecific 
-{
-private:
-       bool is_dirty_;
-       EditMode        mode_;
-
-       etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_;
-       sinfg::Canvas::Handle canvas_;
-
-protected:
-       CanvasSpecific(const sinfg::Canvas::Handle &canvas):is_dirty_(true),mode_(MODE_UNDEFINED),canvas_(canvas) { }
-       CanvasSpecific():mode_(MODE_UNDEFINED) { }
-
-       virtual ~CanvasSpecific() { };
-       
-       
-public:
-
-       void set_canvas(sinfg::Canvas::Handle x) { canvas_=x; }
-       void set_canvas_interface(etl::loose_handle<sinfgapp::CanvasInterface> x) { canvas_interface_=x; }
-
-       sinfg::Canvas::Handle get_canvas()const { return canvas_; }
-       etl::loose_handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
-
-       static ParamVocab get_param_vocab();
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       EditMode get_edit_mode()const;
-
-       void set_edit_mode(EditMode x) { mode_=x; }
-       
-       bool is_dirty()const { return is_dirty_; }
-       void set_dirty(bool x=true) { is_dirty_=x; }
-       
-}; // END of class Action::Undoable
-
-typedef std::list< etl::handle<Action::Undoable> > ActionList;
-
-/*!    \class sinfgapp::Action::Super
-**     \brief Super-Action base class for actions composed of several other actions.
-**
-**     Actions deriving from this class should only implement prepare(), and
-**     NOT implement perform() or undo().
-*/
-class Super : public Undoable, public CanvasSpecific
-{
-       ActionList action_list_;
-
-public:
-
-       ActionList &action_list() { return action_list_; }
-       const ActionList &action_list()const { return action_list_; }
-
-       virtual void prepare()=0;
-
-       void clear() { action_list().clear(); }
-       
-       bool first_time()const { return action_list_.empty(); }
-       
-       void add_action(etl::handle<Undoable> action);
-
-       void add_action_front(etl::handle<Undoable> action);
-
-       virtual void perform();
-       virtual void undo();
-
-}; // END of class Action::Super
-
-
-class Group : public Super
-{
-       sinfg::String name_;
-
-       ActionList action_list_;
-protected:
-       bool ready_;
-public:
-       Group(const sinfg::String &str="Group");
-       virtual ~Group();
-
-       virtual sinfg::String get_name()const { return name_; }
-
-       virtual void prepare() { };
-
-       virtual bool set_param(const sinfg::String& name, const Param &)const { return false; }
-       virtual bool is_ready()const { return ready_; }
-
-       void set_name(std::string&x) { name_=x; }
-}; // END of class Action::Group
-
-
-
-
-
-struct BookEntry
-{
-       sinfg::String   name;
-       sinfg::String   local_name;
-       sinfg::String   version;
-       sinfg::String   task;
-       int                     priority;
-       Category                category;
-       Factory                 factory;
-       CanidateChecker is_canidate;
-       GetParamVocab   get_param_vocab;        
-       
-       bool operator<(const BookEntry &rhs)const { return priority<rhs.priority; }
-}; // END of struct BookEntry
-
-typedef std::map<sinfg::String,BookEntry> Book;
-
-class CanidateList : public std::list<BookEntry>
-{
-public:
-       iterator find(const sinfg::String& x);
-       const_iterator find(const sinfg::String& x)const { return const_cast<CanidateList*>(this)->find(x); }
-};
-
-Book& book();
-
-Handle create(const sinfg::String &name);
-
-//! Compiles a list of potential canidate actions with the given \a param_list and \a category
-CanidateList compile_canidate_list(const ParamList& param_list, Category category=CATEGORY_ALL);
-
-/*!    \class sinfgapp::Action::Main
-**     \brief \writeme
-**
-**     \writeme
-*/
-class Main
-{
-       friend class sinfgapp::Main;
-
-       Main();
-
-public:
-       ~Main();
-
-}; // END of class Action::Main
-
-}; // END of namespace Action
-
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/action_param.cpp b/synfig-studio/trunk/src/sinfgapp/action_param.cpp
deleted file mode 100644 (file)
index ef873b9..0000000
+++ /dev/null
@@ -1,515 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_param.cpp
-**     \brief Template File
-**
-**     $Id: action_param.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "action_param.h"
-#include "action.h"
-#include "canvasinterface.h"
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === P R O C E D U R E S ================================================= */
-
-bool
-Action::canidate_check(const ParamVocab& param_vocab, const ParamList& param_list)
-{
-       ParamVocab::const_iterator iter;
-       
-       for(iter=param_vocab.begin();iter!=param_vocab.end();++iter)
-       {
-               int n(param_list.count(iter->get_name()));
-
-//             if(n && !iter->get_mutual_exclusion().empty() && param_list.count(iter->get_mutual_exclusion()))
-//                     return false;
-
-               if(!n && !iter->get_mutual_exclusion().empty() && param_list.count(iter->get_mutual_exclusion()))
-                       continue;
-
-               if(iter->get_user_supplied() || iter->get_optional())
-                       continue;
-                                                       
-               if(n==0)
-                       return false;
-               if(n==1 && iter->get_requires_multiple())
-                       return false;
-               if(n>1 && !iter->get_supports_multiple())
-                       return false;
-               
-               if(iter->get_type()!=param_list.find(iter->get_name())->second.get_type())
-                       return false;
-       }
-       return true;
-}
-
-/* === S T A T I C S ======================================================= */
-
-struct _ParamCounter
-{
-       static int counter;
-       ~_ParamCounter()
-       {
-               if(counter)
-                       sinfg::error("%d action params not yet deleted!",counter);
-       }
-} _param_counter;
-
-int _ParamCounter::counter(0);
-
-/* === M E T H O D S ======================================================= */
-
-Param::Param(const Param &rhs):
-       type_(rhs.type_)
-{
-       _ParamCounter::counter++;
-       switch(type_)
-       {
-       case TYPE_ACTIVEPOINT:
-               data.activepoint.construct();
-               data.activepoint.get()=rhs.data.activepoint.get();
-               break;
-       case TYPE_WAYPOINT:
-               data.waypoint.construct();
-               data.waypoint.get()=rhs.data.waypoint.get();
-               break;
-       case TYPE_WAYPOINTMODEL:
-               data.waypoint_model.construct();
-               data.waypoint_model.get()=rhs.data.waypoint_model.get();
-               break;
-       case TYPE_KEYFRAME:
-               data.keyframe.construct();
-               data.keyframe.get()=rhs.data.keyframe.get();
-               break;
-       case TYPE_CANVAS:
-               data.canvas.construct();
-               data.canvas.get()=rhs.data.canvas.get();
-               break;
-       case TYPE_CANVASINTERFACE:
-               data.canvas_interface.construct();
-               data.canvas_interface.get()=rhs.data.canvas_interface.get();
-               break;
-       case TYPE_LAYER:
-               data.layer.construct();
-               data.layer.get()=rhs.data.layer.get();
-               break;
-       case TYPE_VALUENODE:
-               data.value_node.construct();
-               data.value_node.get()=rhs.data.value_node.get();
-               break;
-       case TYPE_VALUEDESC:
-               data.value_desc.construct();
-               data.value_desc.get()=rhs.data.value_desc.get();
-               break;
-       case TYPE_VALUE:
-               data.value.construct();
-               data.value.get()=rhs.data.value.get();
-               break;
-       case TYPE_STRING:
-               data.string.construct();
-               data.string.get()=rhs.data.string.get();
-               break;
-       case TYPE_RENDDESC:
-               data.rend_desc.construct();
-               data.rend_desc.get()=rhs.data.rend_desc.get();
-               break;
-       case TYPE_TIME:
-               data.time.construct();
-               data.time.get()=rhs.data.time.get();
-               break;
-
-       case TYPE_INTEGER:
-               data.integer=rhs.data.integer;
-               break;
-       case TYPE_EDITMODE:
-               data.edit_mode=rhs.data.edit_mode;
-               break;
-       case TYPE_REAL:
-               data.real=rhs.data.real;
-               break;
-       case TYPE_BOOL:
-               data.b=rhs.data.b;
-               break;
-
-       case TYPE_NIL:
-               break;
-
-       default:
-               assert(0);
-               break;
-       }
-}
-
-Param::Param(const etl::handle<sinfgapp::CanvasInterface>& x):
-       
-       type_(TYPE_CANVASINTERFACE)
-{
-       _ParamCounter::counter++;
-       data.canvas_interface.construct();
-       data.canvas_interface.get()=x;
-}
-
-/*
-Param::Param(sinfgapp::CanvasInterface* x):
-       
-       type_(TYPE_CANVASINTERFACE)
-{
-       _ParamCounter::counter++;
-       data.canvas_interface.construct();
-       data.canvas_interface=x;
-}
-*/
-
-Param::Param(const etl::loose_handle<sinfgapp::CanvasInterface>& x):
-       
-       type_(TYPE_CANVASINTERFACE)
-{
-       _ParamCounter::counter++;
-       data.canvas_interface.construct();
-       data.canvas_interface.get()=x;
-}
-
-Param::Param(const sinfg::Canvas::Handle& x):  
-       type_(TYPE_CANVAS)
-{
-       _ParamCounter::counter++;
-       data.canvas.construct();
-       data.canvas.get()=x;
-}
-
-Param::Param(const sinfg::Canvas::LooseHandle& x):     
-       type_(TYPE_CANVAS)
-{
-       _ParamCounter::counter++;
-       data.canvas.construct();
-       data.canvas.get()=x;
-}
-
-Param::Param(const sinfg::Layer::Handle& x):
-       
-       type_(TYPE_LAYER)
-{
-       _ParamCounter::counter++;
-       data.layer.construct();
-       data.layer.get()=x;
-}
-
-Param::Param(const sinfg::Layer::LooseHandle& x):
-       
-       type_(TYPE_LAYER)
-{
-       _ParamCounter::counter++;
-       data.layer.construct();
-       data.layer.get()=x;
-}
-
-Param::Param(const sinfg::ValueNode::Handle& x):
-       
-       type_(TYPE_VALUENODE)
-{
-       _ParamCounter::counter++;
-       data.value_node.construct();
-       data.value_node.get()=x;
-}
-
-Param::Param(const sinfg::ValueNode::LooseHandle& x):
-       
-       type_(TYPE_VALUENODE)
-{
-       _ParamCounter::counter++;
-       data.value_node.construct();
-       data.value_node.get()=x;
-}
-
-Param::Param(const sinfg::ValueBase& x):
-       
-       type_(TYPE_VALUE)
-{
-       _ParamCounter::counter++;
-       data.value.construct();
-       data.value.get()=x;
-}
-
-Param::Param(const sinfg::RendDesc& x):        
-       type_(TYPE_RENDDESC)
-{
-       _ParamCounter::counter++;
-       data.rend_desc.construct();
-       data.rend_desc.get()=x;
-}
-
-Param::Param(const sinfg::Time& x):
-       type_(TYPE_TIME)
-{
-       _ParamCounter::counter++;
-       data.time.construct();
-       data.time.get()=x;
-}
-
-Param::Param(const sinfg::Activepoint& x):
-       
-       type_(TYPE_ACTIVEPOINT)
-{
-       _ParamCounter::counter++;
-       data.activepoint.construct();
-       data.activepoint.get()=x;
-}
-
-Param::Param(const sinfg::Waypoint& x):        
-       type_(TYPE_WAYPOINT)
-{
-       _ParamCounter::counter++;
-       data.waypoint.construct();
-       data.waypoint.get()=x;
-}
-
-Param::Param(const sinfg::Waypoint::Model& x): 
-       type_(TYPE_WAYPOINTMODEL)
-{
-       _ParamCounter::counter++;
-       data.waypoint_model.construct();
-       data.waypoint_model.get()=x;
-}
-
-Param::Param(const sinfg::String& x):
-       type_(TYPE_STRING)
-{
-       _ParamCounter::counter++;
-       data.string.construct();
-       data.string.get()=x;
-}
-
-Param::Param(const char * x):
-       type_(TYPE_STRING)
-{
-       _ParamCounter::counter++;
-       data.string.construct();
-       data.string.get()=x;
-}
-
-Param::Param(const sinfg::Keyframe& x):
-       
-       type_(TYPE_KEYFRAME)
-{
-       _ParamCounter::counter++;
-       data.keyframe.construct();
-       data.keyframe.get()=x;
-}
-
-Param::Param(const sinfgapp::ValueDesc& x):
-       
-       type_(TYPE_VALUEDESC)
-{
-       _ParamCounter::counter++;
-       data.value_desc.construct();
-       data.value_desc.get()=x;
-}
-
-Param::Param(const int& x):
-       type_(TYPE_INTEGER)
-{
-       _ParamCounter::counter++;
-       data.integer=x;
-}
-
-Param::Param(const EditMode& x):
-       type_(TYPE_EDITMODE)
-{
-       _ParamCounter::counter++;
-       data.edit_mode=x;
-}
-
-Param::Param(const sinfg::Real& x):
-       
-       type_(TYPE_REAL)
-{
-       _ParamCounter::counter++;
-       data.real=x;
-}
-
-Param::Param(const bool& x):
-       
-       type_(TYPE_BOOL)
-{
-       _ParamCounter::counter++;
-       data.b=x;
-}
-
-Param::~Param()
-{
-       clear();
-       _ParamCounter::counter--;
-}
-
-Param&
-Param::operator=(const Param& rhs)
-{
-       clear();
-       type_=rhs.type_;
-       
-       switch(type_)
-       {
-       case TYPE_ACTIVEPOINT:
-               data.activepoint.construct();
-               data.activepoint.get()=rhs.data.activepoint.get();
-               break;
-       case TYPE_WAYPOINT:
-               data.waypoint.construct();
-               data.waypoint.get()=rhs.data.waypoint.get();
-               break;
-       case TYPE_WAYPOINTMODEL:
-               data.waypoint_model.construct();
-               data.waypoint_model.get()=rhs.data.waypoint_model.get();
-               break;
-       case TYPE_KEYFRAME:
-               data.keyframe.construct();
-               data.keyframe.get()=rhs.data.keyframe.get();
-               break;
-       case TYPE_CANVAS:
-               data.canvas.construct();
-               data.canvas.get()=rhs.data.canvas.get();
-               break;
-       case TYPE_CANVASINTERFACE:
-               data.canvas_interface.construct();
-               data.canvas_interface.get()=rhs.data.canvas_interface.get();
-               break;
-       case TYPE_TIME:
-               data.time.construct();
-               data.time.get()=rhs.data.time.get();
-               break;
-       case TYPE_LAYER:
-               data.layer.construct();
-               data.layer.get()=rhs.data.layer.get();
-               break;
-       case TYPE_VALUENODE:
-               data.value_node.construct();
-               data.value_node.get()=rhs.data.value_node.get();
-               break;
-       case TYPE_VALUEDESC:
-               data.value_desc.construct();
-               data.value_desc.get()=rhs.data.value_desc.get();
-               break;
-       case TYPE_VALUE:
-               data.value.construct();
-               data.value.get()=rhs.data.value.get();
-               break;
-       case TYPE_RENDDESC:
-               data.rend_desc.construct();
-               data.rend_desc.get()=rhs.data.rend_desc.get();
-               break;
-       case TYPE_STRING:
-               data.string.construct();
-               data.string.get()=rhs.data.string.get();
-               break;
-
-       case TYPE_INTEGER:
-               data.integer=rhs.data.integer;
-               break;
-       case TYPE_EDITMODE:
-               data.integer=rhs.data.integer;
-               break;
-       case TYPE_REAL:
-               data.real=rhs.data.real;
-               break;
-       case TYPE_BOOL:
-               data.b=rhs.data.b;
-               break;
-
-       case TYPE_NIL:
-               break;
-
-       default:
-               assert(0);
-               break;
-       }
-       return *this;
-}
-
-void
-Param::clear()
-{
-       switch(type_)
-       {
-       case TYPE_ACTIVEPOINT:
-               data.activepoint.destruct();
-               break;
-       case TYPE_WAYPOINT:
-               data.waypoint.destruct();
-               break;
-       case TYPE_WAYPOINTMODEL:
-               data.waypoint_model.destruct();
-               break;
-       case TYPE_KEYFRAME:
-               data.keyframe.destruct();
-               break;
-       case TYPE_CANVAS:
-               data.canvas.destruct();
-               break;
-       case TYPE_CANVASINTERFACE:
-               data.canvas_interface.destruct();
-               break;
-       case TYPE_LAYER:
-               data.layer.destruct();
-               break;
-       case TYPE_TIME:
-               data.time.destruct();
-               break;
-       case TYPE_VALUENODE:
-               data.value_node.destruct();
-               break;
-       case TYPE_VALUEDESC:
-               data.value_desc.destruct();
-               break;
-       case TYPE_VALUE:
-               data.value.destruct();
-               break;
-       case TYPE_RENDDESC:
-               data.rend_desc.destruct();
-               break;
-       case TYPE_STRING:
-               data.string.destruct();
-               break;
-
-       case TYPE_NIL:
-       case TYPE_EDITMODE:
-       case TYPE_INTEGER:
-       case TYPE_REAL:
-       case TYPE_BOOL:
-               break;
-
-       default:
-               assert(0);
-               break;
-       }
-       type_=TYPE_NIL;
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/action_param.h b/synfig-studio/trunk/src/sinfgapp/action_param.h
deleted file mode 100644 (file)
index 8771204..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_param.h
-**     \brief Template File
-**
-**     $Id: action_param.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_PARAM_H
-#define __SINFG_APP_ACTION_PARAM_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/string.h>
-#include <sinfg/canvas.h>
-#include <ETL/handle>
-#include <ETL/stringf>
-#include <ETL/trivial>
-
-#include <map>
-#include <list>
-
-#include <sinfg/layer.h>
-#include <sinfg/canvas.h>
-#include <sinfg/valuenode.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/value.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_animated.h>
-#include <sinfg/string.h>
-#include <sinfg/keyframe.h>
-#include <sinfg/waypoint.h>
-
-#include "editmode.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 ProgressCallback;
-class Canvas;
-class RendDesc;
-}; // END of namespace sinfg
-
-namespace sinfgapp {
-
-class CanvasInterface;
-       
-namespace Action {     
-
-//! Action Parameter
-class Param
-{
-public:
-       enum Type
-       {
-               TYPE_NIL,
-               TYPE_INTEGER,
-               TYPE_REAL,
-               TYPE_BOOL,
-               TYPE_ACTIVEPOINT,
-               TYPE_WAYPOINT,
-               TYPE_WAYPOINTMODEL,
-               TYPE_KEYFRAME,
-               TYPE_CANVAS,
-               TYPE_LAYER,
-               TYPE_VALUENODE,
-               TYPE_VALUEDESC,
-               TYPE_VALUE,
-               TYPE_STRING,
-               TYPE_TIME,
-               TYPE_CANVASINTERFACE,
-               TYPE_EDITMODE,
-               TYPE_RENDDESC,
-               
-               TYPE_END
-       };
-private:
-       Type type_;
-
-       union
-       {
-               etl::trivial<sinfg::Canvas::LooseHandle> canvas;
-               etl::trivial<sinfg::Layer::LooseHandle> layer;
-               etl::trivial<sinfg::ValueNode::LooseHandle> value_node;
-               etl::trivial<sinfg::ValueBase> value;
-               etl::trivial<sinfg::Activepoint> activepoint;
-               etl::trivial<sinfg::ValueNode_Animated::Waypoint> waypoint;
-               etl::trivial<sinfg::ValueNode_Animated::Waypoint::Model> waypoint_model;
-               etl::trivial<sinfg::String> string;
-               etl::trivial<sinfg::Keyframe> keyframe;
-               etl::trivial<sinfg::Time> time;
-               etl::trivial<sinfgapp::ValueDesc> value_desc;
-               etl::trivial<etl::loose_handle<sinfgapp::CanvasInterface> > canvas_interface;
-               etl::trivial<sinfg::RendDesc> rend_desc;
-               int integer;
-               sinfg::Real real;
-               bool b;
-               EditMode edit_mode;
-               
-       } data;
-public:
-
-       Param():type_(TYPE_NIL) { }
-       Param(const Param &x);
-       Param(const etl::handle<sinfgapp::CanvasInterface>& x);
-       Param(const etl::loose_handle<sinfgapp::CanvasInterface>& x);
-//     Param(sinfgapp::CanvasInterface* x);
-       Param(const sinfg::Canvas::Handle& x);
-       Param(const sinfg::Canvas::LooseHandle& x);
-       Param(const sinfg::Layer::Handle& x);
-       Param(const sinfg::Layer::LooseHandle& x);
-       Param(const sinfg::ValueNode::Handle& x);
-       Param(const sinfg::ValueNode::LooseHandle& x);
-       Param(const sinfg::Activepoint& x);
-       Param(const sinfg::Waypoint& x);
-       Param(const sinfg::Waypoint::Model& x);
-       Param(const sinfg::String& x);
-       Param(const sinfg::RendDesc& x);
-       Param(const char * x);
-       Param(const sinfg::Keyframe& x);
-       Param(const sinfgapp::ValueDesc& x);
-       Param(const int& x);
-       Param(const EditMode& x);
-       Param(const sinfg::Real& x);
-       Param(const sinfg::Time& x);
-       Param(const bool& x);
-       Param(const sinfg::ValueBase& x);
-
-       ~Param();
-       
-       Param& operator=(const Param& rhs);
-       
-       void clear();
-       
-       const sinfg::Canvas::LooseHandle& get_canvas()const { assert(type_==TYPE_CANVAS); return data.canvas.get(); }
-       const etl::loose_handle<sinfgapp::CanvasInterface>& get_canvas_interface()const { assert(type_==TYPE_CANVASINTERFACE); return data.canvas_interface.get(); }
-       const sinfg::Layer::LooseHandle& get_layer()const { assert(type_==TYPE_LAYER); return data.layer.get(); }
-       const sinfg::ValueNode::LooseHandle& get_value_node()const { assert(type_==TYPE_VALUENODE); return data.value_node.get(); }
-       const sinfg::ValueBase& get_value()const { assert(type_==TYPE_VALUE); return data.value.get(); }
-       const sinfg::Activepoint& get_activepoint()const { assert(type_==TYPE_ACTIVEPOINT); return data.activepoint.get(); }
-       const sinfg::Waypoint& get_waypoint()const { assert(type_==TYPE_WAYPOINT); return data.waypoint.get(); }
-       const sinfg::Waypoint::Model& get_waypoint_model()const { assert(type_==TYPE_WAYPOINTMODEL); return data.waypoint_model.get(); }
-       const sinfg::String& get_string()const { assert(type_==TYPE_STRING); return data.string.get(); }
-       const sinfg::Keyframe& get_keyframe()const { assert(type_==TYPE_KEYFRAME); return data.keyframe.get(); }
-       const sinfgapp::ValueDesc& get_value_desc()const { assert(type_==TYPE_VALUEDESC); return data.value_desc.get(); }
-       const sinfg::Real& get_real()const { assert(type_==TYPE_REAL); return data.real; }
-       const sinfg::Time& get_time()const { assert(type_==TYPE_TIME); return data.time.get(); }
-       const sinfg::RendDesc& get_rend_desc()const { assert(type_==TYPE_RENDDESC); return data.rend_desc.get(); }
-       int get_integer()const { assert(type_==TYPE_INTEGER); return data.integer; }
-       EditMode get_edit_mode()const { assert(type_==TYPE_EDITMODE); return data.edit_mode; }
-       bool get_bool()const { assert(type_==TYPE_BOOL); return data.b; }
-
-
-       const Type& get_type()const { return type_; }
-}; // END of class Param
-
-class ParamList : public std::multimap<sinfg::String,Param>
-{
-public:
-       ParamList& add(const sinfg::String& name, const Param &x) { insert(std::pair<sinfg::String,Param>(name,x)); return *this; }
-       ParamList& add(const ParamList& x) { insert(x.begin(),x.end()); return *this; }
-}; // END of class ParamList
-
-class ParamDesc
-{
-private:
-       sinfg::String   name_;
-       sinfg::String   local_name_;
-       sinfg::String   desc_;
-       sinfg::String   mutual_exclusion_;
-       Param::Type     type_;
-       bool    user_supplied_;
-       bool    supports_multiple_;
-       bool    requires_multiple_;
-       bool    optional_;
-
-public:
-       ParamDesc(const sinfg::String &name, Param::Type type):
-               name_(name),
-               local_name_(name),
-               type_(type),
-               user_supplied_(false),
-               supports_multiple_(false),
-               requires_multiple_(false),
-               optional_(false)
-       { }
-       
-       const sinfg::String& get_name()const { return name_; }
-       const sinfg::String& get_desc()const { return desc_; }
-       const sinfg::String& get_mutual_exclusion()const { return mutual_exclusion_; }
-       const sinfg::String& get_local_name()const { return local_name_; }
-       const Param::Type& get_type()const { return type_; }
-       bool get_user_supplied()const { return user_supplied_; }
-       bool get_supports_multiple()const { return supports_multiple_||requires_multiple_; }
-       bool get_requires_multiple()const { return requires_multiple_; }
-       bool get_optional()const { return optional_; }
-
-       ParamDesc& set_local_name(const sinfg::String& x) { local_name_=x; return *this; }
-       ParamDesc& set_desc(const sinfg::String& x) { desc_=x; return *this; }
-       ParamDesc& set_mutual_exclusion(const sinfg::String& x) { mutual_exclusion_=x; return *this; }
-       ParamDesc& set_user_supplied(bool x=true) { user_supplied_=x; return *this; }
-       ParamDesc& set_supports_multiple(bool x=true) { supports_multiple_=x; return *this; }
-       ParamDesc& set_requires_multiple(bool x=true) { requires_multiple_=x; if(x)supports_multiple_=true; return *this; }
-       ParamDesc& set_optional(bool x=true) { optional_=x; return *this; }
-}; // END of class ParamDesc
-
-class ParamVocab : public std::list< ParamDesc > { };
-
-bool canidate_check(const ParamVocab& param_vocab, const ParamList& param_list);
-
-}; // END of namespace Action
-
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/action_system.cpp b/synfig-studio/trunk/src/sinfgapp/action_system.cpp
deleted file mode 100644 (file)
index 4a5e4d1..0000000
+++ /dev/null
@@ -1,711 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_system.cpp
-**     \brief Template File
-**
-**     $Id: action_system.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "action_system.h"
-#include "instance.h"
-#include "canvasinterface.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfgapp;
-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 ======================================================= */
-
-
-
-Action::System::System():
-       action_count_(0)
-{
-       unset_ui_interface();
-       clear_redo_stack_on_new_action_=false;
-}
-
-Action::System::~System()
-{
-}
-
-bool
-Action::System::perform_action(handle<Action::Base> action)
-{
-       handle<UIInterface> uim(get_ui_interface());
-       
-       assert(action);
-       
-       if(!action->is_ready())
-       {
-               uim->error(action->get_name()+": "+_("Action is not ready."));
-               return false;
-       }       
-       
-       most_recent_action_=action;
-       
-       static bool inuse=false;
-
-       if(inuse) return false;
-
-       inuse=true;
-       try {
-               
-       assert(action);
-       
-       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
-       
-       if(canvas_specific && canvas_specific->get_canvas())
-       {
-               handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas_specific->get_canvas());
-               assert(canvas_interface);
-               uim=canvas_interface->get_ui_interface();
-       }
-
-       handle<Action::Undoable> undoable_action=handle<Action::Undoable>::cast_dynamic(action);
-       
-       // If we cannot undo this action, make sure
-       // that the user knows this.
-       if(!undoable_action)
-       {
-               if(uim->yes_no(
-                       action->get_name(),
-                       _("This action cannot be undone! Are you sure you want to continue?"),
-                       UIInterface::RESPONSE_NO
-                       ) == UIInterface::RESPONSE_NO
-               )
-                       return false;
-               else
-               {
-                       // Because this action cannot be undone,
-                       // we need to clear the undo stack
-                       clear_undo_stack();
-               }
-       }
-       else
-               assert(undoable_action->is_active());
-
-       // Perform the action
-       try { action->perform(); }
-       catch(Action::Error err)
-       {
-               uim->task(action->get_name()+' '+_("Failed"));
-               inuse=false;
-
-               if(err.get_type()!=Action::Error::TYPE_UNABLE)
-               {
-                       if(err.get_desc().empty())
-                               uim->error(action->get_name()+": "+strprintf("%d",err.get_type()));             
-                       else
-                               uim->error(action->get_name()+": "+err.get_desc());             
-               }
-
-               // If action failed for whatever reason, just return false and do
-               // not add the action onto the list
-               return false;
-       }
-       catch(std::exception err)
-       {
-               uim->task(action->get_name()+' '+_("Failed"));
-               inuse=false;
-
-               uim->error(action->get_name()+": "+err.what());         
-
-               // If action failed for whatever reason, just return false and do
-               // not add the action onto the list
-               return false;
-       }
-       catch(...)
-       {
-               uim->task(action->get_name()+' '+_("Failed"));
-               inuse=false;
-
-               // If action failed for whatever reason, just return false and do
-               // not add the action onto the list
-               return false;
-       }
-
-       // Clear the redo stack
-       if(clear_redo_stack_on_new_action_)
-               clear_redo_stack();     
-
-       if(!group_stack_.empty())
-               group_stack_.front()->inc_depth();
-       else
-               inc_action_count();
-       
-       // Push this action onto the action list if we can undo it
-       if(undoable_action)
-       {
-               // If necessary, signal the change in status of undo
-               if(undo_action_stack_.empty()) signal_undo_status_(true);
-               
-               // Add it to the list
-               undo_action_stack_.push_front(undoable_action);
-
-               // Signal that a new action has been added
-               if(group_stack_.empty())
-                       signal_new_action()(undoable_action);
-       }
-               
-       inuse=false;
-
-       uim->task(action->get_name()+' '+_("Successful"));
-
-       // If the action has "dirtied" the preview, signal it.
-       if(0)if(canvas_specific && canvas_specific->is_dirty())
-       {
-               Canvas::Handle canvas=canvas_specific->get_canvas();
-               if(!group_stack_.empty())
-                       group_stack_.front()->request_redraw(canvas_specific->get_canvas_interface());
-               else
-               {
-                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
-                       assert(canvas_interface);
-                       DEBUGPOINT();
-                       //canvas_interface->signal_dirty_preview()();
-               }
-       }
-
-       }catch(...) { inuse=false; throw; }
-
-       return true;
-}
-
-bool
-sinfgapp::Action::System::undo_(handle<UIInterface> uim)
-{
-       handle<Action::Undoable> action(undo_action_stack().front());
-       most_recent_action_=action;
-       
-       try { if(action->is_active()) action->undo(); }
-       catch(Action::Error err)
-       {
-               if(err.get_type()!=Action::Error::TYPE_UNABLE)
-               {
-                       if(err.get_desc().empty())
-                               uim->error(action->get_name()+_(" (Undo): ")+strprintf("%d",err.get_type()));           
-                       else
-                               uim->error(action->get_name()+_(" (Undo): ")+err.get_desc());           
-               }
-
-               return false;
-       }
-       catch(std::runtime_error x)
-       {
-               uim->error(x.what());
-               return false;
-       }
-       catch(...)
-       {
-               return false;
-       }
-
-       dec_action_count();
-
-       if(redo_action_stack_.empty())  signal_redo_status()(true);
-
-       redo_action_stack_.push_front(undo_action_stack_.front());
-       undo_action_stack_.pop_front();
-
-       if(undo_action_stack_.empty())  signal_undo_status()(false);
-
-       if(!group_stack_.empty())
-               group_stack_.front()->dec_depth();
-
-       signal_undo_();
-
-       return true;
-}
-
-bool
-sinfgapp::Action::System::undo()
-{
-       //! \todo This function is not exception safe!
-       static bool inuse=false;
-
-       // If there is nothing on the action list, there is nothing to undo
-       if(undo_action_stack().empty() || inuse)
-               return false;
-
-       handle<Action::Undoable> action=undo_action_stack().front();
-       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
-
-       handle<UIInterface> uim;
-       if(canvas_specific && canvas_specific->get_canvas())
-       {
-               Canvas::Handle canvas=canvas_specific->get_canvas();
-               handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
-               assert(canvas_interface);
-               uim=canvas_interface->get_ui_interface();
-       }
-       else
-               uim=get_ui_interface();
-
-       inuse=true;
-
-       if(!undo_(uim))
-       {
-               uim->error(undo_action_stack_.front()->get_name()+": "+_("Failed to undo."));
-               inuse=false;
-               return false;
-       }
-
-       inuse=false;
-       
-       // If the action has "dirtied" the preview, signal it.
-       if(0)if(action->is_active() && canvas_specific && canvas_specific->is_dirty())
-       {
-               Canvas::Handle canvas=canvas_specific->get_canvas();
-               if(!group_stack_.empty())
-                       group_stack_.front()->request_redraw(canvas_specific->get_canvas_interface());
-               else
-               {
-                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
-                       assert(canvas_interface);
-                       //DEBUGPOINT();
-                       //canvas_interface->signal_dirty_preview()();
-               }
-       }
-
-       return true;
-}
-
-bool
-Action::System::redo_(handle<UIInterface> uim)
-{
-       handle<Action::Undoable> action(redo_action_stack().front());
-       most_recent_action_=action;
-
-       try { if(action->is_active()) action->perform(); }
-       catch(Action::Error err)
-       {
-               if(err.get_type()!=Action::Error::TYPE_UNABLE)
-               {
-                       if(err.get_desc().empty())
-                               uim->error(action->get_name()+_(" (Redo): ")+strprintf("%d",err.get_type()));           
-                       else
-                               uim->error(action->get_name()+_(" (Redo): ")+err.get_desc());           
-               }
-
-               return false;
-       }
-       catch(std::runtime_error x)
-       {
-               uim->error(x.what());
-               return false;
-       }
-       catch(...)
-       {
-               return false;
-       }
-
-       inc_action_count();
-
-       if(undo_action_stack_.empty())  signal_undo_status()(true);
-
-       undo_action_stack_.push_front(redo_action_stack_.front());
-       redo_action_stack_.pop_front();
-
-       if(redo_action_stack_.empty())  signal_redo_status()(false);
-
-       if(!group_stack_.empty())
-               group_stack_.front()->inc_depth();
-
-       signal_redo_();
-
-       return true;
-}
-
-bool
-Action::System::redo()
-{
-       //! \todo This function is not exception safe!
-       static bool inuse=false;
-
-       // If there is nothing on the action list, there is nothing to undo
-       if(redo_action_stack_.empty() || inuse)
-               return false;
-
-       inuse=true;
-
-       handle<Action::Undoable> action=redo_action_stack().front();
-       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
-
-       handle<UIInterface> uim;
-       if(canvas_specific && canvas_specific->get_canvas())
-       {
-               Canvas::Handle canvas=canvas_specific->get_canvas();
-               handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
-               assert(canvas_interface);
-               uim=canvas_interface->get_ui_interface();
-       }
-       else
-               uim=get_ui_interface();
-
-       if(!redo_(uim))
-       {
-               uim->error(redo_action_stack_.front()->get_name()+": "+_("Failed to redo."));
-               inuse=false;
-               return false;
-       }
-
-       inuse=false;
-
-       // If the action has "dirtied" the preview, signal it.
-       if(0)if(action->is_active() && canvas_specific && canvas_specific->is_dirty())
-       {
-               Canvas::Handle canvas=canvas_specific->get_canvas();
-               if(!group_stack_.empty())
-                       group_stack_.front()->request_redraw(canvas_specific->get_canvas_interface());
-               else
-               {
-                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
-                       assert(canvas_interface);
-                       //DEBUGPOINT();
-                       //canvas_interface->signal_dirty_preview()();
-               }
-       }
-
-       return true;
-}
-
-void
-Action::System::inc_action_count()const
-{
-       action_count_++;
-       if(action_count_==1)
-               signal_unsaved_status_changed_(true);
-       if(!action_count_)
-               signal_unsaved_status_changed_(false);
-}
-
-void
-Action::System::dec_action_count()const
-{
-       action_count_--;
-       if(action_count_==-1)
-               signal_unsaved_status_changed_(true);
-       if(!action_count_)
-               signal_unsaved_status_changed_(false);
-}
-
-void
-Action::System::reset_action_count()const
-{
-       if(!action_count_)
-               return;
-
-       action_count_=0;
-       signal_unsaved_status_changed_(false);
-}
-
-void
-Action::System::clear_undo_stack()
-{
-       if(undo_action_stack_.empty()) return;
-       undo_action_stack_.clear();
-       signal_undo_status_(false);
-       signal_undo_stack_cleared_();
-}
-       
-void
-Action::System::clear_redo_stack()
-{
-       if(redo_action_stack_.empty()) return;
-       redo_action_stack_.clear();
-       signal_redo_status_(false);
-       signal_redo_stack_cleared_();
-}
-
-bool
-Action::System::set_action_status(etl::handle<Action::Undoable> action, bool x)
-{
-       Stack::iterator iter;
-       int failed=false;
-       
-       if(action->is_active()==x)
-               return true;
-
-       handle<Action::Undoable> cur_pos=undo_action_stack_.front();
-
-       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
-
-       handle<UIInterface> uim=new ConfidentUIInterface();
-       
-       iter=find(undo_action_stack_.begin(),undo_action_stack_.end(),action);
-       if(iter!=undo_action_stack_.end())
-       {
-               while(undo_action_stack_.front()!=action)
-               {
-                       if(!undo_(uim))
-                       {
-                               return false;
-                       }
-               } 
-               if(!undo_(uim))
-               {
-                       return false;
-               }
-               
-               action->set_active(x);
-
-               if(redo_(get_ui_interface()))
-               {
-                       signal_action_status_changed_(action);
-               }
-               else
-               {
-                       action->set_active(!x);
-                       failed=true;
-               }
-               
-               
-               while(undo_action_stack_.front()!=cur_pos)
-               {
-                       if(!redo_(uim))
-                       {
-                               redo_action_stack_.front()->set_active(false);
-                               signal_action_status_changed_(redo_action_stack_.front());
-                       }
-               }
-
-               if(!failed && canvas_specific && canvas_specific->is_dirty())
-               {
-                       Canvas::Handle canvas=canvas_specific->get_canvas();
-                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
-                       assert(canvas_interface);
-                       //DEBUGPOINT();
-                       //canvas_interface->signal_dirty_preview()();
-               }
-
-               return true;
-       }
-
-       iter=find(redo_action_stack_.begin(),redo_action_stack_.end(),action);
-       if(iter!=redo_action_stack_.end())
-       {
-               action->set_active(x);
-               signal_action_status_changed_(action);
-
-
-
-
-               if(canvas_specific && canvas_specific->is_dirty())
-               {
-                       Canvas::Handle canvas=canvas_specific->get_canvas();
-                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
-                       assert(canvas_interface);
-                       DEBUGPOINT();
-                       //canvas_interface->signal_dirty_preview()();
-               }
-
-               return true;
-       }
-
-       return false;
-}
-
-Action::PassiveGrouper::PassiveGrouper(etl::loose_handle<Action::System> instance_,sinfg::String name_):
-       instance_(instance_),
-       name_(name_),
-       redraw_requested_(false),
-       depth_(0)
-{
-       // Add this group onto the group stack
-       instance_->group_stack_.push_front(this);
-}
-
-void
-Action::PassiveGrouper::request_redraw(handle<CanvasInterface> x)
-{
-/*     DEBUGPOINT();
-       if(instance_->group_stack_.empty())
-       {
-               if(x!=canvas_interface_)
-               {
-                       DEBUGPOINT();
-                       x->signal_dirty_preview()();
-               }
-
-               redraw_requested_=false;
-       }
-       else
-       {
-               DEBUGPOINT();
-               if(instance_->group_stack_.back()==this)
-               {
-                       DEBUGPOINT();
-                       redraw_requested_=true;
-               }
-               else
-               {
-                       DEBUGPOINT();
-                       instance_->group_stack_.back()->request_redraw(x);
-                       redraw_requested_=false;
-               }
-               DEBUGPOINT();
-       }
-       DEBUGPOINT();
-*/
-       if(x)
-       {
-               redraw_requested_=true;
-               canvas_interface_=x;
-       }
-}
-
-Action::PassiveGrouper::~PassiveGrouper()
-{
-       assert(instance_->group_stack_.front()==this);
-       
-       // Remove this group from the group stack
-       instance_->group_stack_.pop_front();
-
-       handle<Action::Group> group;
-
-       if(depth_==1)
-       {
-               handle<Action::Undoable> action(instance_->undo_action_stack_.front());
-
-               group=handle<Action::Group>::cast_dynamic(action);
-
-               if(group)
-               {
-                       // If the only action inside of us is a group,
-                       // then we should rename the group to our name.
-                       group->set_name(name_);
-               }
-               else
-               {
-                       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
-                       
-                       if(0)if(canvas_specific && canvas_specific->is_dirty() && canvas_specific->get_canvas_interface())
-                       {
-                               if(instance_->group_stack_.empty())
-                                       request_redraw(canvas_specific->get_canvas_interface());                                        
-                       }
-               }
-
-               if(instance_->group_stack_.empty())
-               {
-                       instance_->inc_action_count();
-                       instance_->signal_new_action()(instance_->undo_action_stack_.front());
-               }
-               else
-                       instance_->group_stack_.front()->inc_depth();
-
-       }
-       else
-       if(depth_>0)
-       {
-               group=new Action::Group(name_);
-               
-               for(int i=0;i<depth_;i++)
-       //      for(;depth_;depth_--)
-               {
-                       handle<Action::Undoable> action(instance_->undo_action_stack_.front());
-                       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
-                       
-                       if(0)if(canvas_specific && canvas_specific->is_dirty())
-                       {
-                               group->set_dirty(true);
-                               group->set_canvas(canvas_specific->get_canvas());
-                               group->set_canvas_interface(canvas_specific->get_canvas_interface());
-                       }
-                       
-                       // Copy the action from the undo stack to the group
-                       group->add_action_front(action);
-       
-                       // Remove the action from the undo stack
-                       instance_->undo_action_stack_.pop_front();
-               }
-                       
-               // Push the group onto the stack
-               instance_->undo_action_stack_.push_front(group);
-       
-               if(0)if(group->is_dirty())
-                       request_redraw(group->get_canvas_interface());
-               //      group->get_canvas_interface()->signal_dirty_preview()();
-       
-               if(instance_->group_stack_.empty())
-               {
-                       instance_->inc_action_count();
-                       instance_->signal_new_action()(instance_->undo_action_stack_.front());
-               }
-               else
-                       instance_->group_stack_.front()->inc_depth();
-       }
-       
-       if(0)if(redraw_requested_)
-       {
-               if(instance_->group_stack_.empty())
-               {
-                       assert(canvas_interface_);
-                       DEBUGPOINT();
-                       canvas_interface_->signal_dirty_preview()();
-               }
-               else
-               {
-                       instance_->group_stack_.front()->request_redraw(canvas_interface_);
-                       redraw_requested_=false;
-               }
-       }
-}
-
-void
-Action::PassiveGrouper::cancel()
-{
-       bool error=false;
-
-       // Cancel any groupers that may be on top of us first
-       //while(instance_->group_stack_.front()!=this)
-       //      instance_->group_stack_.front()->cancel();
-       
-       sinfg::warning("Cancel depth: %d",depth_);
-       
-       while(depth_)
-               if(!instance_->undo())
-               {
-                       error=true;
-                       break;
-               }
-       
-       if(error)
-               instance_->get_ui_interface()->error(_("State restore failure"));
-       else
-               redraw_requested_=false;
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/action_system.h b/synfig-studio/trunk/src/sinfgapp/action_system.h
deleted file mode 100644 (file)
index 266bfb3..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_system.h
-**     \brief Template Header
-**
-**     $Id: action_system.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 __SINFGAPP_ACTIONSYSTEM_H
-#define __SINFGAPP_ACTIONSYSTEM_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "action.h"
-#include <sigc++/signal.h>
-#include <sigc++/object.h>
-#include <ETL/handle>
-#include <sinfg/canvas.h>
-#include "uimanager.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 sinfgapp {
-
-class CanvasInterface;
-       
-namespace Action {
-
-
-       
-       
-       
-class System;
-
-//! Passive action grouping class
-class PassiveGrouper
-{
-       etl::loose_handle<System> instance_;
-       sinfg::String name_;
-       bool redraw_requested_;
-       int depth_;
-       etl::handle<CanvasInterface> canvas_interface_;
-public:
-
-       PassiveGrouper(etl::loose_handle<System> instance_,sinfg::String name_);
-
-       ~PassiveGrouper();
-
-       const sinfg::String &get_name()const { return name_; }
-
-       void set_name(const sinfg::String &x) { name_=x; }
-
-       etl::loose_handle<System> get_instance() { return instance_; }
-       
-       void request_redraw(etl::handle<CanvasInterface>);
-       
-       void cancel();
-       
-       void inc_depth() { depth_++; }
-
-       void dec_depth() { depth_--; }
-
-       const int &get_depth()const { return depth_; }
-}; // END of class Action::PassiveGrouper
-
-typedef std::list< etl::handle<Action::Undoable> > Stack;
-       
-class System : public etl::shared_object, public sigc::trackable
-{
-       friend class PassiveGrouper;
-               
-       /*
- -- ** -- P U B L I C   T Y P E S ---------------------------------------------
-       */
-
-public:
-
-       /*
- -- ** -- P U B L I C  D A T A ------------------------------------------------
-       */
-
-public:
-       
-       /*
- -- ** -- P R I V A T E   D A T A ---------------------------------------------
-       */
-
-private:
-
-       Stack undo_action_stack_;
-       Stack redo_action_stack_;
-
-       etl::handle<Action::Base> most_recent_action_;
-
-       std::list<PassiveGrouper*> group_stack_;
-
-       sigc::signal<void,bool> signal_undo_status_;
-       sigc::signal<void,bool> signal_redo_status_;
-       sigc::signal<void,etl::handle<Action::Undoable> > signal_new_action_;
-       sigc::signal<void> signal_undo_stack_cleared_;
-       sigc::signal<void> signal_redo_stack_cleared_;
-       sigc::signal<void> signal_undo_;
-       sigc::signal<void> signal_redo_;
-       sigc::signal<void,etl::handle<Action::Undoable> > signal_action_status_changed_;
-       
-       mutable sigc::signal<void,bool> signal_unsaved_status_changed_;
-
-       //! If this is non-zero, then the changes have not yet been saved.
-       mutable int action_count_;
-
-       etl::handle<UIInterface> ui_interface_;
-
-       bool clear_redo_stack_on_new_action_;
-       
-       /*
- -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
-       */
-
-private:
-
-       bool undo_(etl::handle<UIInterface> uim);
-       bool redo_(etl::handle<UIInterface> uim);
-
-       /*
- -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
-       */
-
-private:
-
-       /*
- -- ** -- P U B L I C   M E T H O D S -----------------------------------------
-       */
-
-public:
-
-       System();
-       ~System();
-
-       /*
-       template <typename T> bool
-       perform_action(T x)
-       {
-               etl::handle<Action::Base> action((Action::Base*)new T(x));
-               return perform_action(action);
-       }
-       */
-
-       const etl::handle<Action::Base>& get_most_recent_action() { return most_recent_action_; }
-
-       bool get_clear_redo_stack_on_new_action()const { return clear_redo_stack_on_new_action_; }
-       
-       void set_clear_redo_stack_on_new_action(bool x) { clear_redo_stack_on_new_action_=x; }
-
-       bool perform_action(etl::handle<Action::Base> action);
-
-       bool set_action_status(etl::handle<Action::Undoable> action, bool x);
-
-       const Stack &undo_action_stack()const { return undo_action_stack_; }
-
-       const Stack &redo_action_stack()const { return redo_action_stack_; }
-
-       //! Undoes the last action
-       bool undo();
-
-       //! Redoes the last undone action
-       bool redo();
-       
-       //! Clears the undo stack. 
-       void clear_undo_stack();
-       
-       //! Clears the redo stack. 
-       void clear_redo_stack();
-       
-       //! Increments the action counter
-       /*! \note You should not have to call this under normal circumstances.
-       **      \see dec_action_count(), reset_action_count(), get_action_count() */
-       void inc_action_count()const;
-
-       //! Decrements the action counter
-       /*! \note You should not have to call this under normal circumstances.
-       **      \see inc_action_count(), reset_action_count(), get_action_count() */
-       void dec_action_count()const;
-
-       //! Resets the action counter
-       /*! \note You should not have to call this under normal circumstances.
-       **      \see inc_action_count(), dec_action_count(), get_action_count() */
-       void reset_action_count()const;
-
-       //! Returns the number of actions performed since last save.
-       /*!     \see inc_action_count(), dec_action_count(), reset_action_count() */
-       int get_action_count()const { return action_count_; }
-
-       void set_ui_interface(const etl::handle<UIInterface> &uim) { assert(uim); ui_interface_=uim; }
-       void unset_ui_interface() { ui_interface_=new DefaultUIInterface(); }
-       const etl::handle<UIInterface> &get_ui_interface() { return ui_interface_; }    
-
-       /*
- -- ** -- S I G N A L   I N T E R F A C E S -----------------------------------
-       */
-
-public:
-
-       sigc::signal<void,bool>& signal_unsaved_status_changed() { return signal_unsaved_status_changed_; }
-
-       sigc::signal<void,bool>& signal_undo_status() { return signal_undo_status_; }
-
-       sigc::signal<void,bool>& signal_redo_status() { return signal_redo_status_; }
-
-       sigc::signal<void>& signal_undo_stack_cleared() { return signal_undo_stack_cleared_; }
-
-       sigc::signal<void>& signal_redo_stack_cleared() { return signal_redo_stack_cleared_; }
-
-       sigc::signal<void>& signal_undo() { return signal_undo_; }
-
-       sigc::signal<void>& signal_redo() { return signal_redo_; }
-
-       //!     Called whenever an undoable action is processed and added to the stack.
-       sigc::signal<void,etl::handle<Action::Undoable> >& signal_new_action() { return signal_new_action_; }
-
-       sigc::signal<void,etl::handle<Action::Undoable> >& signal_action_status_changed() { return signal_action_status_changed_; }
-
-}; // END of class Action::System
-
-
-}; // END of namespace sinfgapp::Action
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointadd.cpp b/synfig-studio/trunk/src/sinfgapp/actions/activepointadd.cpp
deleted file mode 100644 (file)
index 5dcc281..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file acitvepointadd.cpp
-**     \brief Template File
-**
-**     $Id: activepointadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "activepointadd.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ActivepointAdd);
-ACTION_SET_NAME(Action::ActivepointAdd,"activepoint_add");
-ACTION_SET_LOCAL_NAME(Action::ActivepointAdd,"Add Activepoint");
-ACTION_SET_TASK(Action::ActivepointAdd,"add");
-ACTION_SET_CATEGORY(Action::ActivepointAdd,Action::CATEGORY_ACTIVEPOINT);
-ACTION_SET_PRIORITY(Action::ActivepointAdd,0);
-ACTION_SET_VERSION(Action::ActivepointAdd,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointAdd,"$Id: activepointadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ActivepointAdd::ActivepointAdd()
-{
-       activepoint.set_time(Time::begin()-1);
-       time_set=false;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ActivepointAdd::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
-               .set_local_name(_("New Activepoint"))
-               .set_desc(_("Activepoint to be added"))
-               .set_optional()
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_desc(_("Time where activepoint is to be added"))
-               .set_optional()
-       );
-
-       return ret;
-}
-
-bool
-Action::ActivepointAdd::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               // We need either a activepoint or a time.
-               if(x.count("activepoint") || x.count("time"))
-                       return true;
-       }
-       return false;
-}
-
-bool
-Action::ActivepointAdd::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-               
-               index=value_desc.get_index();
-               
-               if(time_set)
-                       calc_activepoint();
-               
-               return true;
-       }
-       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT && !time_set)
-       {
-               activepoint=param.get_activepoint();
-               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME && activepoint.get_time()==Time::begin()-1)
-       {
-               activepoint.set_time(param.get_time());
-               time_set=true;
-
-               if(value_node)
-                       calc_activepoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ActivepointAdd::is_ready()const
-{
-       if(!value_node || activepoint.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-// This function is called if a time is specified, but not 
-// a activepoint. In this case, we need to calculate the value
-// of the activepoint
-void
-Action::ActivepointAdd::calc_activepoint()
-{      
-       const Time time(activepoint.get_time());
-       activepoint.set_state(value_node->list[index].status_at_time(time));
-       activepoint.set_priority(0);
-       
-       // In this case, nothing is really changing, so there will be
-       // no need to redraw the window
-       set_dirty(false);
-}
-
-void
-Action::ActivepointAdd::perform()
-{      
-       try { value_node->list[index].find(activepoint.get_time()); throw Error(_("A Activepoint already exists at this point in time"));}
-       catch(sinfg::Exception::NotFound) { }   
-
-       try { if(value_node->list[index].find(activepoint)!=value_node->list[index].timing_info.end()) throw Error(_("This activepoint is already in the ValueNode"));}
-       catch(sinfg::Exception::NotFound) { }   
-       
-       value_node->list[index].add(activepoint);
-       value_node->changed();
-       
-       /*if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-       */
-}
-
-void
-Action::ActivepointAdd::undo()
-{
-       value_node->list[index].erase(activepoint);
-       value_node->changed();
-       /*
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-       */
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointadd.h b/synfig-studio/trunk/src/sinfgapp/actions/activepointadd.h
deleted file mode 100644 (file)
index 2eb39f5..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointadd.h
-**     \brief Template File
-**
-**     $Id: activepointadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_ACTIVEPOINTADD_H
-#define __SINFG_APP_ACTION_ACTIVEPOINTADD_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ActivepointAdd :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Activepoint activepoint;
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       int index;
-
-       bool time_set;
-
-       void calc_activepoint();
-
-public:
-
-       ActivepointAdd();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointremove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/activepointremove.cpp
deleted file mode 100644 (file)
index f940cd8..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointremove.cpp
-**     \brief Template File
-**
-**     $Id: activepointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "activepointremove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ActivepointRemove);
-ACTION_SET_NAME(Action::ActivepointRemove,"activepoint_remove");
-ACTION_SET_LOCAL_NAME(Action::ActivepointRemove,"Remove Activepoint");
-ACTION_SET_TASK(Action::ActivepointRemove,"remove");
-ACTION_SET_CATEGORY(Action::ActivepointRemove,Action::CATEGORY_ACTIVEPOINT);
-ACTION_SET_PRIORITY(Action::ActivepointRemove,0);
-ACTION_SET_VERSION(Action::ActivepointRemove,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointRemove,"$Id: activepointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ActivepointRemove::ActivepointRemove()
-{
-       activepoint.set_time(Time::begin()-1);
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ActivepointRemove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
-               .set_local_name(_("Activepoint"))
-               .set_desc(_("Activepoint to be changed"))
-       );
-
-       return ret;
-}
-
-bool
-Action::ActivepointRemove::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ActivepointRemove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-               
-               index=value_desc.get_index();
-               
-               return true;
-       }
-       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT)
-       {
-               activepoint=param.get_activepoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ActivepointRemove::is_ready()const
-{
-       if(!value_node || activepoint.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ActivepointRemove::perform()
-{      
-       ValueNode_DynamicList::ListEntry::ActivepointList::iterator iter;
-       
-       try { iter=value_node->list[index].find(activepoint); }
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find activepoint"));
-       }       
-
-       value_node->list[index].erase(activepoint);
-       value_node->changed();
-       
-       /*
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-       */
-}
-
-void
-Action::ActivepointRemove::undo()
-{
-       try { value_node->list[index].find(activepoint.get_time()); throw Error(_("A Activepoint already exists at this point in time"));}
-       catch(sinfg::Exception::NotFound) { }   
-
-       try { if(value_node->list[index].find(activepoint)!=value_node->list[index].timing_info.end()) throw Error(_("This activepoint is already in the ValueNode"));}
-       catch(sinfg::Exception::NotFound) { }   
-       
-       value_node->list[index].add(activepoint);
-       value_node->changed();
-       /*
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-       */
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointremove.h b/synfig-studio/trunk/src/sinfgapp/actions/activepointremove.h
deleted file mode 100644 (file)
index 6c2eb1e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointremove.h
-**     \brief Template File
-**
-**     $Id: activepointremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_ACTIVEPOINTREMOVE_H
-#define __SINFG_APP_ACTION_ACTIVEPOINTREMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ActivepointRemove :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       int index;
-       sinfg::Activepoint activepoint;
-
-public:
-
-       ActivepointRemove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/activepointset.cpp
deleted file mode 100644 (file)
index 42faf94..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointset.cpp
-**     \brief Template File
-**
-**     $Id: activepointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "activepointset.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ActivepointSet);
-ACTION_SET_NAME(Action::ActivepointSet,"activepoint_set");
-ACTION_SET_LOCAL_NAME(Action::ActivepointSet,"Set Activepoint");
-ACTION_SET_TASK(Action::ActivepointSet,"set");
-ACTION_SET_CATEGORY(Action::ActivepointSet,Action::CATEGORY_ACTIVEPOINT);
-ACTION_SET_PRIORITY(Action::ActivepointSet,0);
-ACTION_SET_VERSION(Action::ActivepointSet,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointSet,"$Id: activepointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ActivepointSet::ActivepointSet()
-{
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ActivepointSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
-               .set_local_name(_("Activepoint"))
-               .set_desc(_("Activepoint to be changed"))
-               .set_supports_multiple()
-       );
-
-       return ret;
-}
-
-bool
-Action::ActivepointSet::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ActivepointSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-               
-               index=value_desc.get_index();
-               
-               return true;
-       }
-       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT)
-       {
-               //NOTE: there is no duplication checking at the moment
-               activepoints.push_back(param.get_activepoint());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ActivepointSet::is_ready()const
-{
-       if(!value_node || activepoints.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ActivepointSet::perform()
-{      
-       typedef ValueNode_DynamicList::ListEntry::ActivepointList AList;
-       AList::iterator iter;
-
-#if 1  
-       vector<AList::iterator> iters;
-       vector<Activepoint>::iterator i = activepoints.begin(), end = activepoints.end();       
-       
-       for(; i != end; ++i)
-       {
-               try { iters.push_back(value_node->list[index].find(*i)); }
-               catch(sinfg::Exception::NotFound)
-               {
-                       throw Error(_("Unable to find activepoint"));
-               }
-       }
-       
-       //check to see which valuenodes are going to override because of the time...
-       ValueNode_DynamicList::ListEntry::findresult timeiter;
-       
-       for(i = activepoints.begin(); i != end; ++i)
-       {
-               timeiter = value_node->list[index].find_time(i->get_time());
-               
-               bool candelete = timeiter.second;
-       
-               //we only want to track overwrites (not activepoints that are also being modified)
-               if(candelete)
-               {
-                       for(vector<AList::iterator>::iterator ii = iters.begin(); ii != iters.end(); ++ii)
-                       {
-                               if(timeiter.first == *ii)
-                               {
-                                       candelete = false;
-                                       break;
-                               }
-                       }
-               }
-               
-               //if we can still delete it after checking, record it, and then remove them all later
-               if(candelete)
-               {
-                       Activepoint a = *timeiter.first;
-                       overwritten_activepoints.push_back(a);
-               }
-       }
-       
-       //overwrite all the valuenodes we're supposed to set
-       {
-               i = activepoints.begin();
-               for(vector<AList::iterator>::iterator ii = iters.begin(); ii != iters.end() && i != end; ++ii, ++i)
-               {
-                       old_activepoints.push_back(**ii);
-                       **ii = *i; //set the point to the corresponding point in the normal waypoint list
-               }
-       }
-       
-       //remove all the points we're supposed to be overwritting
-       {
-               vector<Activepoint>::iterator   oi = overwritten_activepoints.begin(),
-                                                                               oend = overwritten_activepoints.end();
-               for(; oi != oend; ++oi)
-               {
-                       value_node->list[index].erase(*oi);
-               }
-       }
-
-#else  
-       try { iter=value_node->list[index].find(activepoint); }
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find activepoint"));
-       }       
-
-       //find the value at the old time before we replace it
-       ValueNode_DynamicList::ListEntry::findresult timeiter;
-       timeiter = value_node->list[index].find_time(activepoint.get_time());
-       
-       //we only want to track overwrites (not inplace modifications)
-       if(timeiter.second && activepoint.get_uid() == timeiter.first->get_uid())
-       {
-               timeiter.second = false;
-       }
-               
-       old_activepoint=*iter;
-       *iter=activepoint;
-       
-       if(timeiter.second)
-       {
-               sinfg::info("Erasing the found activepoint");
-               time_overwrite = true;
-               overwritten_ap = *timeiter.first;
-               
-               value_node->list[index].erase(overwritten_ap);
-       }
-       
-#endif
-       
-       value_node->list[index].timing_info.sort();
-       
-       // Signal that a valuenode has been changed
-       value_node->changed();
-}
-
-void
-Action::ActivepointSet::undo()
-{
-       ValueNode_DynamicList::ListEntry::ActivepointList::iterator iter;
-
-#if 1  
-       vector<Activepoint>::iterator i = old_activepoints.begin(), end = old_activepoints.end();       
-       
-       for(; i != end; ++i)
-       {
-               try { iter = value_node->list[index].find(*i); }
-               catch(sinfg::Exception::NotFound)
-               {
-                       throw Error(_("Unable to find activepoint"));
-               }
-               
-               //overwrite with old one
-               *iter = *i;
-       }
-               
-       //add back in all the points that we removed before...
-       {
-               vector<Activepoint>::iterator   oi = overwritten_activepoints.begin(),
-                                                                               oend = overwritten_activepoints.end();
-               for(; oi != oend; ++oi)
-               {
-                       value_node->list[index].add(*oi);
-               }
-       }
-
-#else  
-       try { iter=value_node->list[index].find(activepoint); }
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find activepoint"));
-       }       
-
-       *iter=old_activepoint;
-               
-       if(time_overwrite)
-       {
-               value_node->list[index].add(overwritten_ap);
-       }
-#endif
-       
-       value_node->list[index].timing_info.sort();
-       
-       // Signal that a valuenode has been changed
-       value_node->changed();
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointset.h b/synfig-studio/trunk/src/sinfgapp/actions/activepointset.h
deleted file mode 100644 (file)
index 8937afe..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointset.h
-**     \brief Template File
-**
-**     $Id: activepointset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_ACTIVEPOINTSET_H
-#define __SINFG_APP_ACTION_ACTIVEPOINTSET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ActivepointSet :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       int index;
-       
-       std::vector<sinfg::Activepoint> activepoints;
-       std::vector<sinfg::Activepoint> old_activepoints;       
-
-       std::vector<sinfg::Activepoint> overwritten_activepoints;
-
-public:
-
-       ActivepointSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointsetoff.cpp b/synfig-studio/trunk/src/sinfgapp/actions/activepointsetoff.cpp
deleted file mode 100644 (file)
index 6324840..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointsetoff.cpp
-**     \brief Template File
-**
-**     $Id: activepointsetoff.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "activepointsetoff.h"
-#include "activepointsetsmart.h"
-#include "valuenodelinkconnect.h"
-#include "valuenodereplace.h"
-
-#include "activepointset.h"
-#include "activepointadd.h"
-
-#include "valuedescconnect.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ActivepointSetOff);
-ACTION_SET_NAME(Action::ActivepointSetOff,"activepoint_set_off");
-ACTION_SET_LOCAL_NAME(Action::ActivepointSetOff,_("Mark Activepoint as \"Off\""));
-ACTION_SET_TASK(Action::ActivepointSetOff,"set_off");
-ACTION_SET_CATEGORY(Action::ActivepointSetOff,Action::CATEGORY_ACTIVEPOINT|Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ActivepointSetOff,-9);
-ACTION_SET_VERSION(Action::ActivepointSetOff,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointSetOff,"$Id: activepointsetoff.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ActivepointSetOff::ActivepointSetOff()
-{
-       activepoint.set_time(Time::begin()-1);
-       time_set=false;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ActivepointSetOff::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
-               .set_local_name(_("Activepoint"))
-               .set_optional()
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ActivepointSetOff::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-               
-               // We are only a canidate if this canvas is animated.
-               Canvas::Handle canvas(x.find("canvas")->second.get_canvas());
-               if(canvas->rend_desc().get_time_start()==canvas->rend_desc().get_time_end())
-                       return false;
-               
-               // We need either a activepoint or a time.
-               if(x.count("activepoint") || x.count("time"))
-                       return true;
-       }
-       return false;
-}
-
-bool
-Action::ActivepointSetOff::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               value_desc=param.get_value_desc();
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-               
-               index=value_desc.get_index();
-               
-               if(time_set)
-                       calc_activepoint();
-               
-               return true;
-       }
-       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT && !time_set)
-       {
-               activepoint=param.get_activepoint();
-               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME && activepoint.get_time()==Time::begin()-1)
-       {
-               activepoint.set_time(param.get_time());
-               time_set=true;
-
-               if(value_node)
-                       calc_activepoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ActivepointSetOff::is_ready()const
-{
-       if(!value_node)
-               sinfg::error("Missing value_node");
-
-       if(activepoint.get_time()==(Time::begin()-1))
-               sinfg::error("Missing activepoint");
-       
-       if(!value_node || activepoint.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-// This function is called if a time is specified, but not 
-// a activepoint. In this case, we need to calculate the value
-// of the activepoint
-void
-Action::ActivepointSetOff::calc_activepoint()
-{      
-       const Time time(activepoint.get_time());
-       
-       try { activepoint=*value_node->list[index].find(time); }
-       catch(...)
-       {
-               activepoint.set_time(time);
-               activepoint.set_state(value_node->list[index].status_at_time(time));
-               activepoint.set_priority(0);
-       }
-}
-
-void
-Action::ActivepointSetOff::prepare()
-{
-       clear();
-
-       // Turn the activepoint off
-       activepoint.set_state(false);
-
-       Action::Handle action(ActivepointSetSmart::create());
-       
-       action->set_param("edit_mode",get_edit_mode());
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",get_canvas_interface());
-       action->set_param("value_desc",value_desc);
-       action->set_param("activepoint",activepoint);
-
-       assert(action->is_ready());
-       if(!action->is_ready())
-               throw Error(Error::TYPE_NOTREADY);
-
-       add_action_front(action);
-       
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointsetoff.h b/synfig-studio/trunk/src/sinfgapp/actions/activepointsetoff.h
deleted file mode 100644 (file)
index 74582ca..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointsetoff.h
-**     \brief Template File
-**
-**     $Id: activepointsetoff.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_ACTIVEPOINTSETOFF_H
-#define __SINFG_APP_ACTION_ACTIVEPOINTSETOFF_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/valuenode_dynamiclist.h>
-
-#include <list>
-#include <set>
-
-/* === 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 sinfgapp {
-
-namespace Action {
-
-class ActivepointSetOff :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       int index;
-       bool time_set;
-       sinfg::Activepoint activepoint;
-
-       void calc_activepoint();
-
-public:
-
-       ActivepointSetOff();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointseton.cpp b/synfig-studio/trunk/src/sinfgapp/actions/activepointseton.cpp
deleted file mode 100644 (file)
index 154893e..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointseton.cpp
-**     \brief Template File
-**
-**     $Id: activepointseton.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "activepointseton.h"
-#include "activepointsetsmart.h"
-#include "valuenodelinkconnect.h"
-#include "valuenodereplace.h"
-
-#include "activepointset.h"
-#include "activepointadd.h"
-
-#include "valuedescconnect.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ActivepointSetOn);
-ACTION_SET_NAME(Action::ActivepointSetOn,"activepoint_set_on");
-ACTION_SET_LOCAL_NAME(Action::ActivepointSetOn,_("Mark Activepoint as \"On\""));
-ACTION_SET_TASK(Action::ActivepointSetOn,"set_on");
-ACTION_SET_CATEGORY(Action::ActivepointSetOn,Action::CATEGORY_ACTIVEPOINT|Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ActivepointSetOn,-10);
-ACTION_SET_VERSION(Action::ActivepointSetOn,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointSetOn,"$Id: activepointseton.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ActivepointSetOn::ActivepointSetOn()
-{
-       activepoint.set_time(Time::begin()-1);
-       time_set=false;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ActivepointSetOn::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
-               .set_local_name(_("Activepoint"))
-               .set_optional()
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ActivepointSetOn::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               // We are only a canidate if this canvas is animated.
-               Canvas::Handle canvas(x.find("canvas")->second.get_canvas());
-               if(canvas->rend_desc().get_time_start()==canvas->rend_desc().get_time_end())
-                       return false;
-
-               // We need either a activepoint or a time.
-               if(x.count("activepoint") || x.count("time"))
-                       return true;
-       }
-       return false;
-}
-
-bool
-Action::ActivepointSetOn::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               value_desc=param.get_value_desc();
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-               
-               index=value_desc.get_index();
-               
-               if(time_set)
-                       calc_activepoint();
-               
-               return true;
-       }
-       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT && !time_set)
-       {
-               activepoint=param.get_activepoint();
-               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME && activepoint.get_time()==Time::begin()-1)
-       {
-               activepoint.set_time(param.get_time());
-               time_set=true;
-
-               if(value_node)
-                       calc_activepoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ActivepointSetOn::is_ready()const
-{
-       if(!value_node)
-               sinfg::error("Missing value_node");
-
-       if(activepoint.get_time()==(Time::begin()-1))
-               sinfg::error("Missing activepoint");
-       
-       if(!value_node || activepoint.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-// This function is called if a time is specified, but not 
-// a activepoint. In this case, we need to calculate the value
-// of the activepoint
-void
-Action::ActivepointSetOn::calc_activepoint()
-{      
-       const Time time(activepoint.get_time());
-       
-       try { activepoint=*value_node->list[index].find(time); }
-       catch(...)
-       {
-               activepoint.set_time(time);
-               activepoint.set_state(value_node->list[index].status_at_time(time));
-               activepoint.set_priority(0);
-       }
-}
-
-void
-Action::ActivepointSetOn::prepare()
-{
-       clear();
-
-       // Turn the activepoint off
-       activepoint.set_state(true);
-
-       Action::Handle action(ActivepointSetSmart::create());
-       
-       action->set_param("edit_mode",get_edit_mode());
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",get_canvas_interface());
-       action->set_param("value_desc",value_desc);
-       action->set_param("activepoint",activepoint);
-
-       assert(action->is_ready());
-       if(!action->is_ready())
-               throw Error(Error::TYPE_NOTREADY);
-
-       add_action_front(action);
-       
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointseton.h b/synfig-studio/trunk/src/sinfgapp/actions/activepointseton.h
deleted file mode 100644 (file)
index 5198109..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointseton.h
-**     \brief Template File
-**
-**     $Id: activepointseton.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_ACTIVEPOINTSETON_H
-#define __SINFG_APP_ACTION_ACTIVEPOINTSETON_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/valuenode_dynamiclist.h>
-
-#include <list>
-#include <set>
-
-/* === 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 sinfgapp {
-
-namespace Action {
-
-class ActivepointSetOn :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       int index;
-       sinfg::Activepoint activepoint;
-       bool time_set;
-
-       void calc_activepoint();
-
-public:
-
-       ActivepointSetOn();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointsetsmart.cpp b/synfig-studio/trunk/src/sinfgapp/actions/activepointsetsmart.cpp
deleted file mode 100644 (file)
index 2a85ccc..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointsetsmart.cpp
-**     \brief Template File
-**
-**     $Id: activepointsetsmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "activepointsetsmart.h"
-#include "valuenodelinkconnect.h"
-#include "valuenodereplace.h"
-
-#include "activepointset.h"
-#include "activepointadd.h"
-
-#include "valuedescconnect.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ActivepointSetSmart);
-ACTION_SET_NAME(Action::ActivepointSetSmart,"activepoint_set_smart");
-ACTION_SET_LOCAL_NAME(Action::ActivepointSetSmart,_("Set Activepoint (Smart)"));
-ACTION_SET_TASK(Action::ActivepointSetSmart,"set");
-ACTION_SET_CATEGORY(Action::ActivepointSetSmart,Action::CATEGORY_ACTIVEPOINT);
-ACTION_SET_PRIORITY(Action::ActivepointSetSmart,0);
-ACTION_SET_VERSION(Action::ActivepointSetSmart,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointSetSmart,"$Id: activepointsetsmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ActivepointSetSmart::ActivepointSetSmart()
-{
-       activepoint.set_time(Time::begin()-1);
-       time_set=false;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ActivepointSetSmart::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
-               .set_local_name(_("New Activepoint"))
-               .set_desc(_("Activepoint to be added"))
-               .set_optional()
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_desc(_("Time where activepoint is to be added"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ActivepointSetSmart::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               // We need either a activepoint or a time.
-               if(x.count("activepoint") || x.count("time"))
-                       return true;
-       }
-       return false;
-}
-
-bool
-Action::ActivepointSetSmart::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               value_desc=param.get_value_desc();
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-               
-               index=value_desc.get_index();
-               
-               if(time_set)
-                       calc_activepoint();
-               
-               return true;
-       }
-       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT && !time_set)
-       {
-               activepoint=param.get_activepoint();
-               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME && activepoint.get_time()==Time::begin()-1)
-       {
-               activepoint.set_time(param.get_time());
-               time_set=true;
-
-               if(value_node)
-                       calc_activepoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ActivepointSetSmart::is_ready()const
-{
-       if(!value_node)
-               sinfg::error("Missing value_node");
-
-       if(activepoint.get_time()==(Time::begin()-1))
-               sinfg::error("Missing activepoint");
-       
-       if(!value_node || activepoint.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-// This function is called if a time is specified, but not 
-// a activepoint. In this case, we need to calculate the value
-// of the activepoint
-void
-Action::ActivepointSetSmart::calc_activepoint()
-{      
-/*
-       const Time time(activepoint.get_time());
-       activepoint.set_state(value_node->list[index].status_at_time(time));
-       activepoint.set_priority(0);
-*/
-
-       activepoint=value_node->list[index].new_activepoint_at_time(activepoint.get_time());
-
-       // In this case, nothing is really changing, so there will be
-       // no need to redraw the window
-       set_dirty(false);
-}
-
-void
-Action::ActivepointSetSmart::enclose_activepoint(const sinfg::Activepoint& activepoint)
-{
-       times.insert(activepoint.get_time());                   
-
-       if(get_edit_mode()&MODE_ANIMATE_PAST) try
-       {
-               // Try to find prev keyframe
-               Keyframe keyframe(*get_canvas()->keyframe_list().find_prev(activepoint.get_time()));
-
-               if(times.count(keyframe.get_time()))
-                       throw int();
-               else
-                       times.insert(keyframe.get_time());                      
-               
-               try { value_node->list[index].find(keyframe.get_time()); }
-               catch(sinfg::Exception::NotFound)
-               {
-                       Action::Handle action(ActivepointAdd::create());
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("value_desc",value_desc);
-               
-                       if(!value_node->list[index].timing_info.empty())
-                       {       
-                               action->set_param("time",keyframe.get_time());
-                       }
-                       else
-                       {
-                               sinfg::Activepoint tmp;
-                               
-                               tmp.set_state(true);
-                               tmp.set_time(keyframe.get_time());
-                               action->set_param("activepoint",tmp);
-                       }
-
-                       assert(action->is_ready());
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-               
-                       add_action_front(action);
-               }                                               
-       }
-       catch(int) { }
-       catch(sinfg::Exception::NotFound) { }
-
-       if(get_edit_mode()&MODE_ANIMATE_FUTURE)try
-       {
-               // Try to find next keyframe
-               Keyframe keyframe(*get_canvas()->keyframe_list().find_next(activepoint.get_time()));
-
-               if(times.count(keyframe.get_time()))
-                       throw int();
-               else
-                       times.insert(keyframe.get_time());                      
-               
-               try { value_node->list[index].find(keyframe.get_time()); }
-               catch(sinfg::Exception::NotFound)
-               {
-                       Action::Handle action(ActivepointAdd::create());
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("value_desc",value_desc);
-               
-                       if(!value_node->list[index].timing_info.empty())
-                       {       
-                               action->set_param("time",keyframe.get_time());
-                       }
-                       else
-                       {
-                               sinfg::Activepoint tmp;
-                               
-                               tmp.set_state(true);
-                               tmp.set_time(keyframe.get_time());
-                               action->set_param("activepoint",tmp);
-                       }
-
-                       assert(action->is_ready());
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-               
-                       add_action_front(action);
-               }                                               
-       }
-       catch(int) { }
-       catch(sinfg::Exception::NotFound) { }
-}
-
-void
-Action::ActivepointSetSmart::prepare()
-{
-       clear();
-       times.clear();
-       
-       // First, we need to to add any activepoints necessary to
-       // maintain the integrity of the keyframes.
-       enclose_activepoint(activepoint);
-       
-       try
-       {
-               if(value_node->list[index].find(activepoint)==value_node->list[index].timing_info.end())
-                       throw int();
-               
-               // Then, lets try to replace the old activepoint, if it exists
-               enclose_activepoint(*value_node->list[index].find(activepoint));
-
-               Action::Handle action(ActivepointSet::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",value_desc);
-               action->set_param("activepoint",activepoint);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               
-               return;
-       }
-       catch(int){}
-       catch(Exception::NotFound){}
-
-       try
-       {
-               // Check to see if a activepoint exists at this point in time
-               activepoint.mimic(*value_node->list[index].find(activepoint.get_time()));
-
-               enclose_activepoint(*value_node->list[index].find(activepoint.get_time()));
-               
-               Action::Handle action(ActivepointSet::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",value_desc);
-               action->set_param("activepoint",activepoint);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               
-               return;
-       }
-       catch(int){}
-       catch(Exception::NotFound){}
-       
-       try
-       {
-               // At this point we know that the old activepoint doesn't exist,
-               // so we need to create it.
-               Action::Handle action(ActivepointAdd::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",value_desc);
-               action->set_param("activepoint",activepoint);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               
-               return;
-       }
-       catch(int){}
-       catch(Exception::NotFound){}
-       
-       throw Error(_("Unable to determine how to procede. This is a bug."));
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointsetsmart.h b/synfig-studio/trunk/src/sinfgapp/actions/activepointsetsmart.h
deleted file mode 100644 (file)
index 6dcb966..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointsetsmart.h
-**     \brief Template File
-**
-**     $Id: activepointsetsmart.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_ACTIVEPOINTSETSMART_H
-#define __SINFG_APP_ACTION_ACTIVEPOINTSETSMART_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/valuenode_dynamiclist.h>
-
-#include <list>
-#include <set>
-
-/* === 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 sinfgapp {
-
-namespace Action {
-
-class ActivepointSetSmart :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       int index;
-       sinfg::Activepoint activepoint;
-       bool time_set;
-
-       void calc_activepoint();
-       void enclose_activepoint(const sinfg::Activepoint& activepoint);
-
-       std::set<sinfg::Time> times;
-
-public:
-
-       ActivepointSetSmart();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointsimpleadd.cpp b/synfig-studio/trunk/src/sinfgapp/actions/activepointsimpleadd.cpp
deleted file mode 100644 (file)
index c1afdc6..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointsimpleadd.cpp
-**     \brief Simple add activepoint File
-**
-**     $Id: activepointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "activepointsimpleadd.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ActivepointSimpleAdd);
-ACTION_SET_NAME(Action::ActivepointSimpleAdd,"waypoint_simpleadd");
-ACTION_SET_LOCAL_NAME(Action::ActivepointSimpleAdd,"Simply Add Waypoint");
-ACTION_SET_TASK(Action::ActivepointSimpleAdd,"add");
-ACTION_SET_CATEGORY(Action::ActivepointSimpleAdd,Action::CATEGORY_WAYPOINT);
-ACTION_SET_PRIORITY(Action::ActivepointSimpleAdd,0);
-ACTION_SET_VERSION(Action::ActivepointSimpleAdd,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointSimpleAdd,"$Id: activepointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ActivepointSimpleAdd::ActivepointSimpleAdd()
-{
-       set_dirty(true);
-       activepoint.set_time(Time::begin()-1);
-}
-
-Action::ParamVocab
-Action::ActivepointSimpleAdd::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("Destination ValueNode (Animated)"))
-       );
-
-       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
-               .set_local_name(_("Activepoint"))
-               .set_desc(_("Activepoint to be added"))
-       );
-
-       return ret;
-}
-
-bool
-Action::ActivepointSimpleAdd::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               return true;
-       }
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::ActivepointSimpleAdd::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-               
-               index=value_desc.get_index();
-               
-               return true;
-       }
-       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT)
-       {
-               activepoint = param.get_activepoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ActivepointSimpleAdd::is_ready()const
-{
-       if(!value_node && activepoint.get_time() != (Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ActivepointSimpleAdd::perform()
-{      
-       //remove any pretenders that lie at our destination
-       ValueNode_DynamicList::ListEntry::findresult iter = value_node->list[index]
-                                                                                                                       .find_time(activepoint.get_time());
-       
-       time_overwrite = false;
-       if(iter.second)
-       {
-               overwritten_ap = *iter.first;
-               time_overwrite = true;
-               value_node->list[index].erase(overwritten_ap);
-       }
-       
-       //add the value node in since it's safe
-       value_node->list[index].add(activepoint);
-       
-       //sort them...
-       value_node->list[index].timing_info.sort();
-       
-       // Signal that a valuenode has been changed
-       value_node->changed();
-}
-
-void
-Action::ActivepointSimpleAdd::undo()
-{
-       //remove our old version...
-       ValueNode_DynamicList::ListEntry::findresult iter = value_node->list[index].find_uid(activepoint);
-       
-       if(!iter.second)
-       {
-               throw Error(_("The activepoint to remove no longer exists"));
-       }
-       
-       //remove the offending value
-       value_node->list[index].erase(*iter.first); //could also just use waypoint
-       
-       if(time_overwrite)
-       {
-               value_node->list[index].add(overwritten_ap);                            
-       }
-       
-       //sort them...
-       value_node->list[index].timing_info.sort();
-       
-       // Signal that a valuenode has been changed
-       value_node->changed();
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/activepointsimpleadd.h b/synfig-studio/trunk/src/sinfgapp/actions/activepointsimpleadd.h
deleted file mode 100644 (file)
index 8e0e5eb..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file activepointsimpleadd.h
-**     \brief A simple add a activepoint function Header
-**
-**     $Id: activepointsimpleadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_ACTIVEPOINTSIMPLEADD_H
-#define __SINFG_ACTIVEPOINTSIMPLEADD_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ActivepointSimpleAdd :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-       
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       int     index;
-       
-       sinfg::Activepoint activepoint;
-
-       bool time_overwrite;
-       sinfg::Activepoint overwritten_ap;
-
-public:
-
-       ActivepointSimpleAdd();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentmerge.cpp b/synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentmerge.cpp
deleted file mode 100644 (file)
index 492dc38..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blinepointtangentmerge.cpp
-**     \brief Template File
-**
-**     $Id: blinepointtangentmerge.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "blinepointtangentmerge.h"
-#include "valuedescset.h"
-
-#include "activepointset.h"
-#include "activepointadd.h"
-
-#include "valuedescconnect.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::BLinePointTangentMerge);
-ACTION_SET_NAME(Action::BLinePointTangentMerge,"bline_point_tangent_merge");
-ACTION_SET_LOCAL_NAME(Action::BLinePointTangentMerge,_("Merge Tangents"));
-ACTION_SET_TASK(Action::BLinePointTangentMerge,"merge");
-ACTION_SET_CATEGORY(Action::BLinePointTangentMerge,Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::BLinePointTangentMerge,0);
-ACTION_SET_VERSION(Action::BLinePointTangentMerge,"0.0");
-ACTION_SET_CVS_ID(Action::BLinePointTangentMerge,"$Id: blinepointtangentmerge.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::BLinePointTangentMerge::BLinePointTangentMerge()
-{
-       time=(Time::begin()-1);
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::BLinePointTangentMerge::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode of BLinePoint"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::BLinePointTangentMerge::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueNode_Composite::Handle value_node;
-               value_node=ValueNode_Composite::Handle::cast_dynamic(x.find("value_node")->second.get_value_node());
-               if(!value_node || value_node->get_type()!=ValueBase::TYPE_BLINEPOINT)
-                       return false;
-               sinfg::Time time(x.find("time")->second.get_time());
-               if((*value_node->get_link("split"))(time).get(bool())==false)
-                       return false;
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::BLinePointTangentMerge::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=value_node.cast_dynamic(param.get_value_node());
-               
-               return (bool)(value_node);
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::BLinePointTangentMerge::is_ready()const
-{
-       if(!value_node)
-               sinfg::error("Missing or bad value_node");
-
-       if(time==(Time::begin()-1))
-               sinfg::error("Missing time");
-       
-       if(!value_node || time==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::BLinePointTangentMerge::prepare()
-{
-       clear();
-
-       Action::Handle action;
-       
-       {
-               action=Action::create("value_desc_set");
-               if(!action)
-                       throw Error(_("Couldn't find action \"value_desc_set\""));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,3));
-               action->set_param("time",time);
-               action->set_param("new_value",sinfg::ValueBase(false));
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-       }
-       {
-               action=Action::create("value_desc_set");
-               if(!action)
-                       throw Error(_("Couldn't find action \"value_desc_set\""));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,5));
-               action->set_param("time",time);
-               action->set_param("new_value",(*value_node->get_link("t1"))(time));
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-       }
-       
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentmerge.h b/synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentmerge.h
deleted file mode 100644 (file)
index 7304be0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blinepointtangentmerge.h
-**     \brief Template File
-**
-**     $Id: blinepointtangentmerge.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_BLINEPOINTTANGENTMERGE_H
-#define __SINFG_APP_ACTION_BLINEPOINTTANGENTMERGE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/blinepoint.h>
-#include <sinfg/valuenode_composite.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 sinfgapp {
-
-namespace Action {
-
-class BLinePointTangentMerge :
-       public Super
-{
-private:
-
-       sinfg::ValueNode_Composite::Handle value_node;
-       sinfg::Time time;
-
-public:
-
-       BLinePointTangentMerge();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentsplit.cpp b/synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentsplit.cpp
deleted file mode 100644 (file)
index 4220744..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blinepointtangentsplit.cpp
-**     \brief Template File
-**
-**     $Id: blinepointtangentsplit.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "blinepointtangentsplit.h"
-#include "valuedescset.h"
-
-#include "activepointset.h"
-#include "activepointadd.h"
-
-#include "valuedescconnect.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::BLinePointTangentSplit);
-ACTION_SET_NAME(Action::BLinePointTangentSplit,"bline_point_tangent_split");
-ACTION_SET_LOCAL_NAME(Action::BLinePointTangentSplit,_("Split Tangents"));
-ACTION_SET_TASK(Action::BLinePointTangentSplit,"split");
-ACTION_SET_CATEGORY(Action::BLinePointTangentSplit,Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::BLinePointTangentSplit,0);
-ACTION_SET_VERSION(Action::BLinePointTangentSplit,"0.0");
-ACTION_SET_CVS_ID(Action::BLinePointTangentSplit,"$Id: blinepointtangentsplit.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::BLinePointTangentSplit::BLinePointTangentSplit()
-{
-       time=(Time::begin()-1);
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::BLinePointTangentSplit::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode of BLinePoint"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::BLinePointTangentSplit::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueNode_Composite::Handle value_node;
-               value_node=ValueNode_Composite::Handle::cast_dynamic(x.find("value_node")->second.get_value_node());
-               if(!value_node || value_node->get_type()!=ValueBase::TYPE_BLINEPOINT)
-                       return false;
-               sinfg::Time time(x.find("time")->second.get_time());
-               if((*value_node->get_link("split"))(time).get(bool())==true)
-                       return false;
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::BLinePointTangentSplit::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=value_node.cast_dynamic(param.get_value_node());
-               
-               return (bool)(value_node);
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::BLinePointTangentSplit::is_ready()const
-{
-       if(!value_node)
-               sinfg::error("Missing or bad value_node");
-
-       if(time==(Time::begin()-1))
-               sinfg::error("Missing time");
-       
-       if(!value_node || time==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::BLinePointTangentSplit::prepare()
-{
-       clear();
-
-       Action::Handle action;
-       
-       {
-               action=Action::create("value_desc_set");
-               if(!action)
-                       throw Error(_("Couldn't find action \"value_desc_set\""));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,3));
-               action->set_param("time",time);
-               action->set_param("new_value",sinfg::ValueBase(true));
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-       }
-       {
-               action=Action::create("value_desc_set");
-               if(!action)
-                       throw Error(_("Couldn't find action \"value_desc_set\""));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,5));
-               action->set_param("time",time);
-               action->set_param("new_value",(*value_node->get_link("t1"))(time));
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-       }
-       
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentsplit.h b/synfig-studio/trunk/src/sinfgapp/actions/blinepointtangentsplit.h
deleted file mode 100644 (file)
index 790c705..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blinepointtangentsplit.h
-**     \brief Template File
-**
-**     $Id: blinepointtangentsplit.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_BLINEPOINTTANGENTSPLIT_H
-#define __SINFG_APP_ACTION_BLINEPOINTTANGENTSPLIT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/blinepoint.h>
-#include <sinfg/valuenode_composite.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 sinfgapp {
-
-namespace Action {
-
-class BLinePointTangentSplit :
-       public Super
-{
-private:
-
-       sinfg::ValueNode_Composite::Handle value_node;
-       sinfg::Time time;
-
-public:
-
-       BLinePointTangentSplit();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/canvasadd.cpp b/synfig-studio/trunk/src/sinfgapp/actions/canvasadd.cpp
deleted file mode 100644 (file)
index 4f8a7a8..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasadd.cpp
-**     \brief Template File
-**
-**     $Id: canvasadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "canvasadd.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::CanvasAdd);
-ACTION_SET_NAME(Action::CanvasAdd,"canvas_add");
-ACTION_SET_LOCAL_NAME(Action::CanvasAdd,"Add Child Canvas");
-ACTION_SET_TASK(Action::CanvasAdd,"add");
-ACTION_SET_CATEGORY(Action::CanvasAdd,Action::CATEGORY_CANVAS);
-ACTION_SET_PRIORITY(Action::CanvasAdd,0);
-ACTION_SET_VERSION(Action::CanvasAdd,"0.0");
-ACTION_SET_CVS_ID(Action::CanvasAdd,"$Id: canvasadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::CanvasAdd::CanvasAdd()
-{
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::CanvasAdd::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("src",Param::TYPE_CANVAS)
-               .set_local_name(_("New Canvas"))
-               .set_optional()
-       );
-
-       ret.push_back(ParamDesc("id",Param::TYPE_STRING)
-               .set_local_name(_("ID"))
-               .set_desc(_("The name that you want this canvas to be"))
-               .set_user_supplied()
-       );
-       
-       return ret;
-}
-
-bool
-Action::CanvasAdd::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::CanvasAdd::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="src" && param.get_type()==Param::TYPE_CANVAS)
-       {
-               new_canvas=param.get_canvas();
-               
-               return true;
-       }
-       if(name=="id" && param.get_type()==Param::TYPE_STRING)
-       {
-               id=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::CanvasAdd::is_ready()const
-{
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::CanvasAdd::perform()
-{
-       if(!new_canvas)
-       {
-               new_canvas=get_canvas()->new_child_canvas(id);
-       }
-       else
-       {
-               if(new_canvas->is_inline())
-               {
-                       inline_parent=new_canvas->parent();
-               }
-               get_canvas()->add_child_canvas(new_canvas,id);
-       }
-
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_canvas_added()(new_canvas);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::CanvasAdd::undo()
-{
-       get_canvas()->remove_child_canvas(new_canvas);
-
-       if(inline_parent)
-               new_canvas->set_inline(inline_parent);          
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_canvas_removed()(new_canvas);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/canvasadd.h b/synfig-studio/trunk/src/sinfgapp/actions/canvasadd.h
deleted file mode 100644 (file)
index 7926877..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasadd.h
-**     \brief Template File
-**
-**     $Id: canvasadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_CANVASADD_H
-#define __SINFG_APP_ACTION_CANVASADD_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/renddesc.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class CanvasAdd :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Canvas::Handle new_canvas;
-       sinfg::String id;
-
-       sinfg::Canvas::Handle inline_parent;
-
-public:
-
-       CanvasAdd();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/canvasremove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/canvasremove.cpp
deleted file mode 100644 (file)
index 81302a8..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasremove.cpp
-**     \brief Template File
-**
-**     $Id: canvasremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "canvasremove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::CanvasRemove);
-ACTION_SET_NAME(Action::CanvasRemove,"canvas_remove");
-ACTION_SET_LOCAL_NAME(Action::CanvasRemove,"Remove Canvas");
-ACTION_SET_TASK(Action::CanvasRemove,"remove");
-ACTION_SET_CATEGORY(Action::CanvasRemove,Action::CATEGORY_CANVAS);
-ACTION_SET_PRIORITY(Action::CanvasRemove,0);
-ACTION_SET_VERSION(Action::CanvasRemove,"0.0");
-ACTION_SET_CVS_ID(Action::CanvasRemove,"$Id: canvasremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::CanvasRemove::CanvasRemove()
-{
-}
-
-Action::ParamVocab
-Action::CanvasRemove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       return ret;
-}
-
-bool
-Action::CanvasRemove::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               Canvas::Handle canvas=x.find("canvas")->second.get_canvas();
-               assert(canvas);
-               // We cannot remove the root canvas.
-               if(canvas->is_root())
-                       return false;
-               
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::CanvasRemove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::CanvasRemove::is_ready()const
-{
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::CanvasRemove::perform()
-{
-       // We cannot remove the root canvas.
-       if(get_canvas()->is_root())
-               throw Error(_("You cannot remove the root canvas!"));
-
-       if(get_canvas()->is_inline())
-               throw Error(_("You cannot remove an inline canvas!"));
-       
-       parent_canvas=get_canvas()->parent();
-       canvas_id=get_canvas()->get_id();
-       
-       assert(parent_canvas);
-       
-       parent_canvas->remove_child_canvas(get_canvas());
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_canvas_removed()(get_canvas());
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::CanvasRemove::undo()
-{
-       parent_canvas->add_child_canvas(get_canvas(), canvas_id);
-
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_canvas_added()(get_canvas());
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/canvasremove.h b/synfig-studio/trunk/src/sinfgapp/actions/canvasremove.h
deleted file mode 100644 (file)
index dd9cca2..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasremove.h
-**     \brief Template File
-**
-**     $Id: canvasremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_CANVASREMOVE_H
-#define __SINFG_APP_ACTION_CANVASREMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/renddesc.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class CanvasRemove :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-       sinfg::Canvas::Handle parent_canvas;
-       sinfg::String   canvas_id;
-public:
-
-       CanvasRemove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/canvasrenddescset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/canvasrenddescset.cpp
deleted file mode 100644 (file)
index 97f12ad..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasrenddescset.cpp
-**     \brief Template File
-**
-**     $Id: canvasrenddescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "canvasrenddescset.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::CanvasRendDescSet);
-ACTION_SET_NAME(Action::CanvasRendDescSet,"canvas_rend_desc_set");
-ACTION_SET_LOCAL_NAME(Action::CanvasRendDescSet,"Set Canvas RendDesc");
-ACTION_SET_TASK(Action::CanvasRendDescSet,"set");
-ACTION_SET_CATEGORY(Action::CanvasRendDescSet,Action::CATEGORY_CANVAS);
-ACTION_SET_PRIORITY(Action::CanvasRendDescSet,0);
-ACTION_SET_VERSION(Action::CanvasRendDescSet,"0.0");
-ACTION_SET_CVS_ID(Action::CanvasRendDescSet,"$Id: canvasrenddescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::CanvasRendDescSet::CanvasRendDescSet()
-{
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::CanvasRendDescSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("rend_desc",Param::TYPE_RENDDESC)
-               .set_local_name(_("RendDesc"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::CanvasRendDescSet::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::CanvasRendDescSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="rend_desc" && param.get_type()==Param::TYPE_RENDDESC)
-       {
-               new_rend_desc=param.get_rend_desc();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::CanvasRendDescSet::is_ready()const
-{
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::CanvasRendDescSet::perform()
-{
-       old_rend_desc=get_canvas()->rend_desc();
-
-       get_canvas()->rend_desc()=new_rend_desc;
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_rend_desc_changed()();
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::CanvasRendDescSet::undo()
-{
-       get_canvas()->rend_desc()=old_rend_desc;
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_rend_desc_changed()();
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/canvasrenddescset.h b/synfig-studio/trunk/src/sinfgapp/actions/canvasrenddescset.h
deleted file mode 100644 (file)
index c089bee..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasrenddescset.h
-**     \brief Template File
-**
-**     $Id: canvasrenddescset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_CANVASRENDDESCSET_H
-#define __SINFG_APP_ACTION_CANVASRENDDESCSET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/renddesc.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class CanvasRendDescSet :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::RendDesc new_rend_desc;
-       sinfg::RendDesc old_rend_desc;
-
-public:
-
-       CanvasRendDescSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/colorset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/colorset.cpp
deleted file mode 100644 (file)
index f117b19..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file colorset.cpp
-**     \brief Template File
-**
-**     $Id: colorset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerparamset.h"
-#include "valuenodeconstset.h"
-#include "valuedescconnect.h"
-#include "waypointsetsmart.h"
-
-#include "colorset.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/main.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ColorSet);
-ACTION_SET_NAME(Action::ColorSet,"color_set");
-ACTION_SET_LOCAL_NAME(Action::ColorSet,"Apply Default Color");
-ACTION_SET_TASK(Action::ColorSet,"set");
-ACTION_SET_CATEGORY(Action::ColorSet,Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ColorSet,0);
-ACTION_SET_VERSION(Action::ColorSet,"0.0");
-ACTION_SET_CVS_ID(Action::ColorSet,"$Id: colorset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ColorSet::ColorSet():
-       time(0)
-{
-}
-
-Action::ParamVocab
-Action::ColorSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ColorSet::is_canidate(const ParamList &x)
-{
-       if(!canidate_check(get_param_vocab(),x))
-               return false;
-       return x.find("value_desc")->second.get_value_desc().get_value_type()==ValueBase::TYPE_COLOR;
-}
-
-bool
-Action::ColorSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               // Grab the value_desc
-               value_desc=param.get_value_desc();
-               
-               // Grab the current color
-               color=sinfgapp::Main::get_foreground_color();
-               
-               return value_desc.get_value_type()==ValueBase::TYPE_COLOR;
-       }
-
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ColorSet::is_ready()const
-{
-       if(!value_desc || value_desc.get_value_type()!=ValueBase::TYPE_COLOR)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ColorSet::prepare()
-{
-       clear();
-       
-       Action::Handle action;
-       action=Action::create("value_desc_set");
-               
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",get_canvas_interface());
-       action->set_param("value_desc",value_desc);
-       action->set_param("new_value",ValueBase(color));
-       action->set_param("time",time);
-       
-       if(!action->is_ready())
-               throw Error(Error::TYPE_NOTREADY);
-
-       add_action_front(action);
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/colorset.h b/synfig-studio/trunk/src/sinfgapp/actions/colorset.h
deleted file mode 100644 (file)
index fac71e2..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file colorset.h
-**     \brief Template File
-**
-**     $Id: colorset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_COLORSET_H
-#define __SINFG_APP_ACTION_COLORSET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.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 sinfgapp {
-
-namespace Action {
-
-class ColorSet :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::Color color;
-       sinfg::Time time;
-
-public:
-
-       ColorSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/editmodeset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/editmodeset.cpp
deleted file mode 100644 (file)
index 4c52efb..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file editmodeset.cpp
-**     \brief Template File
-**
-**     $Id: editmodeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "editmodeset.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::EditModeSet);
-ACTION_SET_NAME(Action::EditModeSet,"edit_mode_set");
-ACTION_SET_LOCAL_NAME(Action::EditModeSet,"Set Edit Mode");
-ACTION_SET_TASK(Action::EditModeSet,"set");
-ACTION_SET_CATEGORY(Action::EditModeSet,Action::CATEGORY_OTHER);
-ACTION_SET_PRIORITY(Action::EditModeSet,0);
-ACTION_SET_VERSION(Action::EditModeSet,"0.0");
-ACTION_SET_CVS_ID(Action::EditModeSet,"$Id: editmodeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::EditModeSet::EditModeSet()
-{
-}
-
-Action::ParamVocab
-Action::EditModeSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("edit_mode",Param::TYPE_EDITMODE)
-               .set_local_name(_("New Edit Mode"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::EditModeSet::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::EditModeSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-/*
-       if(name=="edit_mode" && param.get_type()==Param::TYPE_EDITMODE)
-       {
-               set_edit_mode(param.get_edit_mode());
-               
-               return true;
-       }
-*/
-       
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::EditModeSet::is_ready()const
-{
-       return Action::CanvasSpecific::is_ready() && get_canvas_interface();
-}
-
-void
-Action::EditModeSet::perform()
-{
-       set_dirty(false);
-
-       old_edit_mode=get_canvas_interface()->get_mode();
-
-       if(old_edit_mode==get_edit_mode())
-               return;
-
-       get_canvas_interface()->mode_=get_edit_mode();
-               
-       get_canvas_interface()->signal_mode_changed_(get_edit_mode());
-}
-
-void
-Action::EditModeSet::undo()
-{
-       set_dirty(false);
-
-       if(old_edit_mode==get_edit_mode())
-               return;
-
-       get_canvas_interface()->mode_=old_edit_mode;
-               
-       get_canvas_interface()->signal_mode_changed_(old_edit_mode);
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/editmodeset.h b/synfig-studio/trunk/src/sinfgapp/actions/editmodeset.h
deleted file mode 100644 (file)
index 4ef3de8..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file editmodeset.h
-**     \brief Template File
-**
-**     $Id: editmodeset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_EDITMODESET_H
-#define __SINFG_APP_ACTION_EDITMODESET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.h>
-#include <sinfgapp/editmode.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class EditModeSet :
-       public Undoable,
-       public CanvasSpecific
-{
-       EditMode old_edit_mode;
-public:
-
-       EditModeSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/gradientset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/gradientset.cpp
deleted file mode 100644 (file)
index 19f9337..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file gradientset.cpp
-**     \brief Template File
-**
-**     $Id: gradientset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerparamset.h"
-#include "valuenodeconstset.h"
-#include "valuedescconnect.h"
-#include "waypointsetsmart.h"
-
-#include "gradientset.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/main.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::GradientSet);
-ACTION_SET_NAME(Action::GradientSet,"gradient_set");
-ACTION_SET_LOCAL_NAME(Action::GradientSet,"Apply Default Gradient");
-ACTION_SET_TASK(Action::GradientSet,"set");
-ACTION_SET_CATEGORY(Action::GradientSet,Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::GradientSet,0);
-ACTION_SET_VERSION(Action::GradientSet,"0.0");
-ACTION_SET_CVS_ID(Action::GradientSet,"$Id: gradientset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::GradientSet::GradientSet():
-       time(0)
-{
-}
-
-Action::ParamVocab
-Action::GradientSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::GradientSet::is_canidate(const ParamList &x)
-{
-       if(!canidate_check(get_param_vocab(),x))
-               return false;
-       return x.find("value_desc")->second.get_value_desc().get_value_type()==ValueBase::TYPE_GRADIENT;
-}
-
-bool
-Action::GradientSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               // Grab the value_desc
-               value_desc=param.get_value_desc();
-               
-               // Grab the current gradient
-               gradient=sinfgapp::Main::get_gradient();
-               
-               return value_desc.get_value_type()==ValueBase::TYPE_GRADIENT;
-       }
-
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::GradientSet::is_ready()const
-{
-       if(!value_desc || value_desc.get_value_type()!=ValueBase::TYPE_GRADIENT)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::GradientSet::prepare()
-{
-       clear();
-       
-       Action::Handle action;
-       action=Action::create("value_desc_set");
-               
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",get_canvas_interface());
-       action->set_param("value_desc",value_desc);
-       action->set_param("new_value",ValueBase(gradient));
-       action->set_param("time",time);
-       
-       if(!action->is_ready())
-               throw Error(Error::TYPE_NOTREADY);
-
-       add_action_front(action);
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/gradientset.h b/synfig-studio/trunk/src/sinfgapp/actions/gradientset.h
deleted file mode 100644 (file)
index f4f69a5..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file gradientset.h
-**     \brief Template File
-**
-**     $Id: gradientset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_GRADIENTSET_H
-#define __SINFG_APP_ACTION_GRADIENTSET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.h>
-#include <list>
-#include <sinfg/gradient.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 sinfgapp {
-
-namespace Action {
-
-class GradientSet :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::Gradient gradient;
-       sinfg::Time time;
-
-public:
-
-       GradientSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/groupaddlayers.cpp b/synfig-studio/trunk/src/sinfgapp/actions/groupaddlayers.cpp
deleted file mode 100644 (file)
index 9b21c9d..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_layerremove.cpp
-**     \brief Template File
-**
-**     $Id: groupaddlayers.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "groupaddlayers.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::GroupAddLayers);
-ACTION_SET_NAME(Action::GroupAddLayers,"group_add_layers");
-ACTION_SET_LOCAL_NAME(Action::GroupAddLayers,"Add Layers to Group");
-ACTION_SET_TASK(Action::GroupAddLayers,"add");
-ACTION_SET_CATEGORY(Action::GroupAddLayers,Action::CATEGORY_LAYER|Action::CATEGORY_GROUP);
-ACTION_SET_PRIORITY(Action::GroupAddLayers,0);
-ACTION_SET_VERSION(Action::GroupAddLayers,"0.0");
-ACTION_SET_CVS_ID(Action::GroupAddLayers,"$Id: groupaddlayers.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::GroupAddLayers::GroupAddLayers()
-{
-}
-
-Action::ParamVocab
-Action::GroupAddLayers::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be added to group"))
-               .set_supports_multiple()
-       );
-
-       ret.push_back(ParamDesc("group",Param::TYPE_STRING)
-               .set_local_name(_("Group"))
-               .set_desc(_("Name of the Group to add the Layers to"))
-               .set_user_supplied()
-       );
-       
-       return ret;
-}
-
-bool
-Action::GroupAddLayers::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::GroupAddLayers::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               std::pair<sinfg::Layer::Handle,String> layer_pair;
-               layer_pair.first=param.get_layer();
-               layer_list.push_back(layer_pair);
-               
-               return true;
-       }
-
-       if(name=="group" && param.get_type()==Param::TYPE_STRING)
-       {
-               group=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::GroupAddLayers::is_ready()const
-{
-       if(layer_list.empty() || group.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::GroupAddLayers::perform()
-{
-       std::list<std::pair<sinfg::Layer::Handle,String> >::iterator iter;
-       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
-       {
-               Layer::Handle layer(iter->first);
-               iter->second=layer->get_group();
-               
-               layer->add_to_group(group);
-       }
-}
-
-void
-Action::GroupAddLayers::undo()
-{
-       std::list<std::pair<sinfg::Layer::Handle,String> >::iterator iter;
-       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
-       {
-               Layer::Handle layer(iter->first);
-               
-               layer->remove_from_group(group);
-               
-               layer->add_to_group(iter->second);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/groupaddlayers.h b/synfig-studio/trunk/src/sinfgapp/actions/groupaddlayers.h
deleted file mode 100644 (file)
index 1e25861..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_groupaddlayers.h
-**     \brief Template File
-**
-**     $Id: groupaddlayers.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_GROUPADDLAYERS_H
-#define __SINFG_APP_ACTION_GROUPADDLAYERS_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class GroupAddLayers :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       // List contains the layers and their previous groups
-       std::list<std::pair<sinfg::Layer::Handle,sinfg::String> > layer_list;
-       
-       // The name of the new group
-       sinfg::String group;
-
-public:
-
-       GroupAddLayers();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/groupremove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/groupremove.cpp
deleted file mode 100644 (file)
index 22d2e27..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_layerremove.cpp
-**     \brief Template File
-**
-**     $Id: groupremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "groupremove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::GroupRemove);
-ACTION_SET_NAME(Action::GroupRemove,"group_remove");
-ACTION_SET_LOCAL_NAME(Action::GroupRemove,"Remove Group");
-ACTION_SET_TASK(Action::GroupRemove,"remove");
-ACTION_SET_CATEGORY(Action::GroupRemove,Action::CATEGORY_GROUP);
-ACTION_SET_PRIORITY(Action::GroupRemove,0);
-ACTION_SET_VERSION(Action::GroupRemove,"0.0");
-ACTION_SET_CVS_ID(Action::GroupRemove,"$Id: groupremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::GroupRemove::GroupRemove()
-{
-}
-
-Action::ParamVocab
-Action::GroupRemove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("group",Param::TYPE_STRING)
-               .set_local_name(_("Group"))
-               .set_desc(_("Name of the Group to remove"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::GroupRemove::is_canidate(const ParamList &x)
-{
-       bool ret(canidate_check(get_param_vocab(),x));
-       if(!ret)
-       {
-               sinfg::info("Action::GroupRemove::is_canidate(): failed canidate check");
-               ParamList::const_iterator iter;
-               for(iter=x.begin();iter!=x.end();++iter)
-               {
-                       sinfg::info("PARAM: %s",iter->first.c_str());
-               }
-       }
-       return ret;
-}
-
-bool
-Action::GroupRemove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="group" && param.get_type()==Param::TYPE_STRING)
-       {
-               group=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::GroupRemove::is_ready()const
-{
-       if(group.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::GroupRemove::perform()
-{
-       layer_list=get_canvas()->get_layers_in_group(group);
-       
-       std::set<sinfg::Layer::Handle>::iterator iter;
-       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
-       {
-               (*iter)->remove_from_group(group);
-       }
-}
-
-void
-Action::GroupRemove::undo()
-{
-       std::set<sinfg::Layer::Handle>::iterator iter;
-       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
-       {
-               (*iter)->add_to_group(group);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/groupremove.h b/synfig-studio/trunk/src/sinfgapp/actions/groupremove.h
deleted file mode 100644 (file)
index 8c1ee1b..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_groupaddlayers.h
-**     \brief Template File
-**
-**     $Id: groupremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_GROUPREMOVE_H
-#define __SINFG_APP_ACTION_GROUPREMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.h>
-#include <set>
-
-/* === 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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class GroupRemove :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       // List contains the layers
-       std::set<sinfg::Layer::Handle> layer_list;
-       
-       // The name of the group to remove
-       sinfg::String group;
-
-public:
-
-       GroupRemove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/groupremovelayers.cpp b/synfig-studio/trunk/src/sinfgapp/actions/groupremovelayers.cpp
deleted file mode 100644 (file)
index 4c76fd0..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_layerremove.cpp
-**     \brief Template File
-**
-**     $Id: groupremovelayers.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "groupremovelayers.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::GroupRemoveLayers);
-ACTION_SET_NAME(Action::GroupRemoveLayers,"group_remove_layers");
-ACTION_SET_LOCAL_NAME(Action::GroupRemoveLayers,"Remove Layers from a Group");
-ACTION_SET_TASK(Action::GroupRemoveLayers,"remove");
-ACTION_SET_CATEGORY(Action::GroupRemoveLayers,Action::CATEGORY_LAYER|Action::CATEGORY_GROUP);
-ACTION_SET_PRIORITY(Action::GroupRemoveLayers,0);
-ACTION_SET_VERSION(Action::GroupRemoveLayers,"0.0");
-ACTION_SET_CVS_ID(Action::GroupRemoveLayers,"$Id: groupremovelayers.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::GroupRemoveLayers::GroupRemoveLayers()
-{
-}
-
-Action::ParamVocab
-Action::GroupRemoveLayers::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be added to group"))
-               .set_supports_multiple()
-       );
-
-       ret.push_back(ParamDesc("group",Param::TYPE_STRING)
-               .set_local_name(_("Group"))
-               .set_desc(_("Name of the Group to add the Layers to"))
-               .set_user_supplied()
-       );
-       
-       return ret;
-}
-
-bool
-Action::GroupRemoveLayers::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::GroupRemoveLayers::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               std::pair<sinfg::Layer::Handle,String> layer_pair;
-               layer_pair.first=param.get_layer();
-               layer_list.push_back(layer_pair);
-               
-               return true;
-       }
-
-       if(name=="group" && param.get_type()==Param::TYPE_STRING)
-       {
-               group=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::GroupRemoveLayers::is_ready()const
-{
-       if(layer_list.empty() || group.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::GroupRemoveLayers::perform()
-{
-       std::list<std::pair<sinfg::Layer::Handle,String> >::iterator iter;
-       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
-       {
-               Layer::Handle layer(iter->first);
-               iter->second=layer->get_group();
-               
-               layer->remove_from_group(group);
-       }
-}
-
-void
-Action::GroupRemoveLayers::undo()
-{
-       std::list<std::pair<sinfg::Layer::Handle,String> >::iterator iter;
-       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
-       {
-               Layer::Handle layer(iter->first);
-               
-               layer->add_to_group(iter->second);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/groupremovelayers.h b/synfig-studio/trunk/src/sinfgapp/actions/groupremovelayers.h
deleted file mode 100644 (file)
index 26875b2..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_groupremovelayers.h
-**     \brief Template File
-**
-**     $Id: groupremovelayers.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_GROUPREMOVELAYERS_H
-#define __SINFG_APP_ACTION_GROUPREMOVELAYERS_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class GroupRemoveLayers :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       // List contains the layers and their previous groups
-       std::list<std::pair<sinfg::Layer::Handle,sinfg::String> > layer_list;
-       
-       // The name of the new group
-       sinfg::String group;
-
-public:
-
-       GroupRemoveLayers();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/grouprename.cpp b/synfig-studio/trunk/src/sinfgapp/actions/grouprename.cpp
deleted file mode 100644 (file)
index d55c26e..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_layerremove.cpp
-**     \brief Template File
-**
-**     $Id: grouprename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "grouprename.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::GroupRename);
-ACTION_SET_NAME(Action::GroupRename,"group_rename");
-ACTION_SET_LOCAL_NAME(Action::GroupRename,"Rename Group");
-ACTION_SET_TASK(Action::GroupRename,"rename");
-ACTION_SET_CATEGORY(Action::GroupRename,Action::CATEGORY_GROUP);
-ACTION_SET_PRIORITY(Action::GroupRename,0);
-ACTION_SET_VERSION(Action::GroupRename,"0.0");
-ACTION_SET_CVS_ID(Action::GroupRename,"$Id: grouprename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::GroupRename::GroupRename()
-{
-}
-
-Action::ParamVocab
-Action::GroupRename::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("group",Param::TYPE_STRING)
-               .set_local_name(_("Old Group"))
-               .set_desc(_("Name of the Group to rename"))
-       );
-
-       ret.push_back(ParamDesc("new_group",Param::TYPE_STRING)
-               .set_local_name(_("New Group"))
-               .set_desc(_("New name for group"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::GroupRename::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::GroupRename::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="group" && param.get_type()==Param::TYPE_STRING)
-       {
-               old_group_name=param.get_string();
-               
-               return true;
-       }
-
-       if(name=="new_group" && param.get_type()==Param::TYPE_STRING)
-       {
-               new_group_name=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::GroupRename::is_ready()const
-{
-       if(old_group_name.empty()||new_group_name.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::GroupRename::perform()
-{
-       if(get_canvas()->get_groups().count(new_group_name)!=0)
-       {
-               throw Error(_("A group with the name \"%s\" already exists!"),new_group_name.c_str());
-       }
-       get_canvas()->rename_group(old_group_name,new_group_name);
-}
-
-void
-Action::GroupRename::undo()
-{
-       get_canvas()->rename_group(new_group_name,old_group_name);
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/grouprename.h b/synfig-studio/trunk/src/sinfgapp/actions/grouprename.h
deleted file mode 100644 (file)
index d16d68d..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_grouprename.h
-**     \brief Template File
-**
-**     $Id: grouprename.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_GROUPRENAME_H
-#define __SINFG_APP_ACTION_GROUPRENAME_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.h>
-#include <set>
-
-/* === 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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class GroupRename :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       // List contains the layers
-       std::set<sinfg::Layer::Handle> layer_list;
-       
-       // The name of the group to remove
-       sinfg::String old_group_name;
-
-       sinfg::String new_group_name;
-
-public:
-
-       GroupRename();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframeadd.cpp b/synfig-studio/trunk/src/sinfgapp/actions/keyframeadd.cpp
deleted file mode 100644 (file)
index 5757109..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeadd.cpp
-**     \brief Template File
-**
-**     $Id: keyframeadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "keyframeadd.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::KeyframeAdd);
-ACTION_SET_NAME(Action::KeyframeAdd,"keyframe_add");
-ACTION_SET_LOCAL_NAME(Action::KeyframeAdd,"Add Keyframe");
-ACTION_SET_TASK(Action::KeyframeAdd,"add");
-ACTION_SET_CATEGORY(Action::KeyframeAdd,Action::CATEGORY_KEYFRAME);
-ACTION_SET_PRIORITY(Action::KeyframeAdd,0);
-ACTION_SET_VERSION(Action::KeyframeAdd,"0.0");
-ACTION_SET_CVS_ID(Action::KeyframeAdd,"$Id: keyframeadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::KeyframeAdd::KeyframeAdd()
-{
-       keyframe.set_time(Time::begin()-1);
-       set_dirty(false);
-}
-
-Action::ParamVocab
-Action::KeyframeAdd::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
-               .set_local_name(_("New Keyframe"))
-               .set_desc(_("Keyframe to be added"))
-       );
-
-       return ret;
-}
-
-bool
-Action::KeyframeAdd::is_canidate(const ParamList &x)
-{
-       if(!canidate_check(get_param_vocab(),x))
-               return false;
-       
-       return true;
-}
-
-bool
-Action::KeyframeAdd::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
-       {
-               keyframe=param.get_keyframe();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::KeyframeAdd::is_ready()const
-{
-       if(keyframe.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::KeyframeAdd::perform()
-{      
-       try { get_canvas()->keyframe_list().find(keyframe.get_time()); throw Error(_("A Keyframe already exists at this point in time"));}
-       catch(sinfg::Exception::NotFound) { }   
-
-       try { get_canvas()->keyframe_list().find(keyframe); throw Error(_("This keyframe is already in the ValueNode"));}
-       catch(sinfg::Exception::NotFound) { }   
-       
-       get_canvas()->keyframe_list().add(keyframe);
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_added()(keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::KeyframeAdd::undo()
-{
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_removed()(keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-
-       get_canvas()->keyframe_list().erase(keyframe);  
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframeadd.h b/synfig-studio/trunk/src/sinfgapp/actions/keyframeadd.h
deleted file mode 100644 (file)
index 635e251..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeadd.h
-**     \brief Template File
-**
-**     $Id: keyframeadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_KEYFRAMEADD_H
-#define __SINFG_APP_ACTION_KEYFRAMEADD_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/keyframe.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class KeyframeAdd :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Keyframe keyframe;
-
-public:
-
-       KeyframeAdd();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframeduplicate.cpp b/synfig-studio/trunk/src/sinfgapp/actions/keyframeduplicate.cpp
deleted file mode 100644 (file)
index 2cc348b..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeduplicate.cpp
-**     \brief Template File
-**
-**     $Id: keyframeduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "keyframeduplicate.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_animated.h>
-#include "activepointsetsmart.h"
-#include "waypointsetsmart.h"
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::KeyframeDuplicate);
-ACTION_SET_NAME(Action::KeyframeDuplicate,"keyframe_duplicate");
-ACTION_SET_LOCAL_NAME(Action::KeyframeDuplicate,"Duplicate Keyframe");
-ACTION_SET_TASK(Action::KeyframeDuplicate,"duplicate");
-ACTION_SET_CATEGORY(Action::KeyframeDuplicate,Action::CATEGORY_KEYFRAME);
-ACTION_SET_PRIORITY(Action::KeyframeDuplicate,0);
-ACTION_SET_VERSION(Action::KeyframeDuplicate,"0.0");
-ACTION_SET_CVS_ID(Action::KeyframeDuplicate,"$Id: keyframeduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::KeyframeDuplicate::KeyframeDuplicate()
-{
-       new_keyframe.set_time(Time::begin()-1);
-       keyframe.set_time(Time::begin()-1);
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::KeyframeDuplicate::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
-               .set_local_name(_("Keyframe"))
-               .set_desc(_("Keyframe to be duplicated"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-       );
-
-       return ret;
-}
-
-bool
-Action::KeyframeDuplicate::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::KeyframeDuplicate::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
-       {
-               keyframe=param.get_keyframe();
-               new_keyframe.set_description(keyframe.get_description()+_(" (Duplicate)"));
-               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               new_keyframe.set_time(param.get_time());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::KeyframeDuplicate::is_ready()const
-{
-       if(keyframe.get_time()==(Time::begin()-1) || new_keyframe.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::KeyframeDuplicate::prepare()
-{
-       clear();
-
-       const sinfg::Time old_time=keyframe.get_time();
-       const sinfg::Time new_time=new_keyframe.get_time();
-
-       try { get_canvas()->keyframe_list().find(keyframe);}
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find the given keyframe"));
-       }       
-
-       try { if(get_canvas()->keyframe_list().find(new_time)!=get_canvas()->keyframe_list().end()) throw Error(_("A Keyframe already exists at this point in time"));}
-       catch(...) { }                  
-
-       // If the times are different, then we 
-       // will need to romp through the valuenodes
-       // and add actions to update their values.
-       if(new_time!=old_time)
-       {
-               std::vector<sinfgapp::ValueDesc> value_desc_list;
-               get_canvas_interface()->find_important_value_descs(value_desc_list);
-               while(!value_desc_list.empty())
-               {
-                       process_value_desc(value_desc_list.back());
-                       value_desc_list.pop_back();
-               }
-       }
-}
-
-void
-Action::KeyframeDuplicate::process_value_desc(const sinfgapp::ValueDesc& value_desc)
-{      
-       const sinfg::Time old_time=keyframe.get_time();
-       const sinfg::Time new_time=new_keyframe.get_time();
-
-       if(value_desc.is_value_node())
-       {
-               ValueNode::Handle value_node(value_desc.get_value_node());
-       
-               // If we are a dynamic list, then we need to update the ActivePoints
-               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node))
-               {
-                       ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node));
-                       int i;
-                       
-                       for(i=0;i<value_node->link_count();i++)
-                       {
-                               sinfgapp::ValueDesc value_desc(value_node,i);
-                               Activepoint activepoint(value_node->list[i].new_activepoint_at_time(old_time));
-                               activepoint.set_time(new_time);
-
-                               Action::Handle action(ActivepointSetSmart::create());
-                               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_desc",value_desc);
-                               action->set_param("activepoint",activepoint);
-
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                       
-                               add_action_front(action);                                               
-                       }
-               }
-               else if(ValueNode_Animated::Handle::cast_dynamic(value_node))
-               {
-                       ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node));
-                       Waypoint waypoint(value_node->new_waypoint_at_time(old_time));
-                       waypoint.set_time(new_time);
-                       
-                       Action::Handle action(WaypointSetSmart::create());
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("value_node",ValueNode::Handle(value_node));
-                       action->set_param("waypoint",waypoint);
-       
-                       assert(action->is_ready());
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-               
-                       add_action_front(action);                                               
-               }
-       }
-}
-
-void
-Action::KeyframeDuplicate::perform()
-{
-       try { get_canvas()->keyframe_list().find(new_keyframe.get_time()); throw Error(_("A Keyframe already exists at this point in time"));}
-       catch(sinfg::Exception::NotFound) { }   
-
-       try { get_canvas()->keyframe_list().find(new_keyframe); throw Error(_("This keyframe is already in the ValueNode"));}
-       catch(sinfg::Exception::NotFound) { }   
-
-       Action::Super::perform();
-       
-       get_canvas()->keyframe_list().add(new_keyframe);
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_added()(new_keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::KeyframeDuplicate::undo()
-{
-       Action::Super::undo();
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_removed()(new_keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-
-       get_canvas()->keyframe_list().erase(new_keyframe);      
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframeduplicate.h b/synfig-studio/trunk/src/sinfgapp/actions/keyframeduplicate.h
deleted file mode 100644 (file)
index 23affe8..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeduplicate.h
-**     \brief Template File
-**
-**     $Id: keyframeduplicate.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_KEYFRAMEDUPLICATE_H
-#define __SINFG_APP_ACTION_KEYFRAMEDUPLICATE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/keyframe.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class KeyframeDuplicate :
-       public Super
-{
-private:
-
-       sinfg::Keyframe keyframe;
-       sinfg::Keyframe new_keyframe;
-
-       void process_value_desc(const sinfgapp::ValueDesc& value_desc);
-
-public:
-
-       KeyframeDuplicate();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframeremove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/keyframeremove.cpp
deleted file mode 100644 (file)
index e9796af..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeremove.cpp
-**     \brief Template File
-**
-**     $Id: keyframeremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "keyframeremove.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_animated.h>
-#include "activepointremove.h"
-#include "waypointremove.h"
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::KeyframeRemove);
-ACTION_SET_NAME(Action::KeyframeRemove,"keyframe_remove");
-ACTION_SET_LOCAL_NAME(Action::KeyframeRemove,"Remove Keyframe");
-ACTION_SET_TASK(Action::KeyframeRemove,"remove");
-ACTION_SET_CATEGORY(Action::KeyframeRemove,Action::CATEGORY_KEYFRAME);
-ACTION_SET_PRIORITY(Action::KeyframeRemove,0);
-ACTION_SET_VERSION(Action::KeyframeRemove,"0.0");
-ACTION_SET_CVS_ID(Action::KeyframeRemove,"$Id: keyframeremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::KeyframeRemove::KeyframeRemove()
-{
-       keyframe.set_time(Time::begin()-1);
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::KeyframeRemove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
-               .set_local_name(_("Keyframe"))
-               .set_desc(_("Keyframe to be removed"))
-       );
-
-       return ret;
-}
-
-bool
-Action::KeyframeRemove::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::KeyframeRemove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
-       {
-               keyframe=param.get_keyframe();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::KeyframeRemove::is_ready()const
-{
-       if(keyframe.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::KeyframeRemove::prepare()
-{
-       clear();
-
-       try { get_canvas()->keyframe_list().find(keyframe);}
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find the given keyframe"));
-       }       
-
-       
-       {
-               std::vector<sinfgapp::ValueDesc> value_desc_list;
-               get_canvas_interface()->find_important_value_descs(value_desc_list);
-               while(!value_desc_list.empty())
-               {
-                       process_value_desc(value_desc_list.back());
-                       value_desc_list.pop_back();
-               }
-       }
-}
-
-void
-Action::KeyframeRemove::process_value_desc(const sinfgapp::ValueDesc& value_desc)
-{      
-       const sinfg::Time time(keyframe.get_time());
-
-       if(value_desc.is_value_node())
-       {
-               ValueNode::Handle value_node(value_desc.get_value_node());
-       
-               // If we are a dynamic list, then we need to update the ActivePoints
-               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node))
-               {
-                       ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node));
-                       int i;
-                       for(i=0;i<value_node->link_count();i++)
-                       try
-                       {
-                               Activepoint activepoint;
-                               activepoint=*value_node->list[i].find(time);
-
-                               sinfgapp::ValueDesc value_desc(value_node,i);
-
-                               Action::Handle action(ActivepointRemove::create());
-                               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_desc",value_desc);
-                               action->set_param("activepoint",activepoint);
-
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                       
-                               add_action_front(action);                                               
-                       }
-                       catch(...)
-                       {
-                       }
-               }
-               else if(ValueNode_Animated::Handle::cast_dynamic(value_node))
-               try
-               {
-                       ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node));
-                       Waypoint waypoint;
-                       waypoint=*value_node->find(time);
-                       assert(waypoint.get_time()==time);
-                       
-                       Action::Handle action(WaypointRemove::create());
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("value_node",ValueNode::Handle(value_node));
-                       action->set_param("waypoint",waypoint);
-       
-                       assert(action->is_ready());
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-               
-                       add_action_front(action);                                               
-               }
-               catch(...)
-               {
-               }
-       }
-}
-
-
-void
-Action::KeyframeRemove::perform()
-{
-       Action::Super::perform();
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_removed()(keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-
-       get_canvas()->keyframe_list().erase(keyframe);  
-}
-
-void
-Action::KeyframeRemove::undo()
-{
-       try { get_canvas()->keyframe_list().find(keyframe.get_time()); throw Error(_("A Keyframe already exists at this point in time"));}
-       catch(sinfg::Exception::NotFound) { }   
-
-       try { get_canvas()->keyframe_list().find(keyframe); throw Error(_("This keyframe is already in the ValueNode"));}
-       catch(sinfg::Exception::NotFound) { }   
-
-       Action::Super::undo();
-       
-       get_canvas()->keyframe_list().add(keyframe);
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_added()(keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframeremove.h b/synfig-studio/trunk/src/sinfgapp/actions/keyframeremove.h
deleted file mode 100644 (file)
index f6b4903..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeremove.h
-**     \brief Template File
-**
-**     $Id: keyframeremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_KEYFRAMEREMOVE_H
-#define __SINFG_APP_ACTION_KEYFRAMEREMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/keyframe.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class KeyframeRemove :
-       public Super
-{
-private:
-
-       sinfg::Keyframe keyframe;
-
-       void process_value_desc(const sinfgapp::ValueDesc& value_desc);
-
-public:
-
-       KeyframeRemove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframeset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/keyframeset.cpp
deleted file mode 100644 (file)
index 31764f5..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeset.cpp
-**     \brief Template File
-**
-**     $Id: keyframeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "keyframeset.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_animated.h>
-#include "activepointsetsmart.h"
-#include "waypointsetsmart.h"
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::KeyframeSet);
-ACTION_SET_NAME(Action::KeyframeSet,"keyframe_set");
-ACTION_SET_LOCAL_NAME(Action::KeyframeSet,"Set Keyframe");
-ACTION_SET_TASK(Action::KeyframeSet,"set");
-ACTION_SET_CATEGORY(Action::KeyframeSet,Action::CATEGORY_KEYFRAME|Action::CATEGORY_HIDDEN);
-ACTION_SET_PRIORITY(Action::KeyframeSet,0);
-ACTION_SET_VERSION(Action::KeyframeSet,"0.0");
-ACTION_SET_CVS_ID(Action::KeyframeSet,"$Id: keyframeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::KeyframeSet::KeyframeSet()
-{
-       keyframe.set_time(Time::begin()-1);
-       set_dirty(false);
-}
-
-Action::ParamVocab
-Action::KeyframeSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
-               .set_local_name(_("New Keyframe"))
-               .set_desc(_("Keyframe to be added"))
-       );
-
-       return ret;
-}
-
-bool
-Action::KeyframeSet::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::KeyframeSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
-       {
-               sinfg::info("KeyframeSet::set_param():old_time: %s",keyframe.get_time().get_string().c_str());
-               keyframe=param.get_keyframe();
-               sinfg::info("KeyframeSet::set_param():new_time: %s",keyframe.get_time().get_string().c_str());
-               sinfg::info("KeyframeSet::set_param():get_keyframe(): %s",param.get_keyframe().get_time().get_string().c_str());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::KeyframeSet::is_ready()const
-{
-       if(keyframe.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::KeyframeSet::prepare()
-{
-       clear();
-       guid_set.clear();
-       
-       
-
-       
-       
-       //sinfg::info("new_time: %s",new_time.get_string().c_str());
-       //sinfg::info("old_time: %s",old_time.get_string().c_str());
-       
-       try { if(get_canvas()->keyframe_list().find(new_time)!=get_canvas()->keyframe_list().end()) throw Error(_("A Keyframe already exists at this point in time"));}
-       catch(...) { }  
-
-
-       // If the times are different, then we 
-       // will need to romp through the valuenodes
-       // and add actions to update their values.
-       if(new_time!=old_time)
-       {
-               std::vector<sinfgapp::ValueDesc> value_desc_list;
-               get_canvas_interface()->find_important_value_descs(value_desc_list);
-               while(!value_desc_list.empty())
-               {
-                       process_value_desc(value_desc_list.back());
-                       value_desc_list.pop_back();
-               }
-       }
-}
-
-#define old_2_new(x)   (((x)-old_begin)/(old_end-old_begin)*(new_end-new_begin)+new_begin)
-
-int
-Action::KeyframeSet::scale_activepoints(const sinfgapp::ValueDesc& value_desc,const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end)
-{
-       ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_static(value_desc.get_parent_value_node()));
-       ValueNode_DynamicList::ListEntry& list_entry(value_node->list[value_desc.get_index()]);
-       
-       std::vector<Activepoint*> selected;
-       std::vector<Activepoint*>::iterator iter;
-       
-       if(list_entry.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;
-                               list_entry.find(new_time);
-                               // If we found a activepoint already at that time, then
-                               // we need to abort
-                               //throw Exception::BadTime(_("Activepoint Conflict"));
-                       }
-                       catch(Exception::NotFound) { }
-               }
-               
-               int ret(0);
-               while(!selected.empty())
-               {
-                       if(selected.back()->get_time()!=old_2_new(selected.back()->get_time()))
-                       {
-                               Action::Handle action(Action::create("activepoint_set"));
-                               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_desc",value_desc);
-                               
-                               Activepoint activepoint(*selected.back());
-                               activepoint.set_time(old_2_new(selected.back()->get_time()));
-
-                               action->set_param("activepoint",activepoint);
-
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                       
-                               add_action_front(action);                                               
-
-                               ret++;
-                       }
-                       selected.pop_back();
-               }
-               return ret;
-       }
-       return 0;
-}
-
-int
-Action::KeyframeSet::scale_waypoints(const sinfgapp::ValueDesc& value_desc,const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end)
-{
-       ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_static(value_desc.get_value_node()));
-       
-       std::vector<Waypoint*> selected;
-       std::vector<Waypoint*>::iterator iter;
-       
-       if(value_node->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;
-                               value_node->find(new_time);
-                               // If we found a waypoint point already at that time, then
-                               // we need to abort
-                               //sinfg::info(_("old_begin: %s, old_end: %s"),old_begin.get_string().c_str(),old_end.get_string().c_str());
-                               //sinfg::info(_("new_begin: %s, new_end: %s"),new_begin.get_string().c_str(),new_end.get_string().c_str());
-                               //throw Exception::BadTime(strprintf(_("Waypoint Conflict, old: %s, new: %s"),(*iter)->get_time().get_string().c_str(),new_time.get_string().c_str()));
-                       }
-                       catch(Exception::NotFound) { }
-               }
-               
-               int ret(0);
-               while(!selected.empty())
-               {
-                       if(selected.back()->get_time()!=old_2_new(selected.back()->get_time()))
-                       {
-                               Action::Handle action(Action::create("waypoint_set"));
-                               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_node",ValueNode::Handle::cast_static(value_node));
-                               
-                               Waypoint waypoint(*selected.back());
-                               waypoint.set_time(old_2_new(selected.back()->get_time()));
-
-                               action->set_param("waypoint",waypoint);
-
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                       
-                               add_action_front(action);                                               
-
-                               ret++;
-                       }
-                       selected.pop_back();
-               }
-               return ret;
-       }
-       return 0;
-}
-
-void
-Action::KeyframeSet::process_value_desc(const sinfgapp::ValueDesc& value_desc)
-{      
-       if(value_desc.is_value_node())
-       {               
-               ValueNode::Handle value_node(value_desc.get_value_node());
-
-               //if(guid_set.count(value_node->get_guid()))
-               //      return;
-               //guid_set.insert(value_node->get_guid());
-
-               // If we are a dynamic list, then we need to update the ActivePoints
-               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node))
-               {
-                       ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node));
-                       int i;
-                       for(i=0;i<value_node->link_count();i++)
-                       {
-                               sinfgapp::ValueDesc value_desc(value_node,i);
-                               if(new_time>keyframe_prev && new_time<keyframe_next)
-                               {
-                                       // In this circumstance, we need to adjust any
-                                       // activepoints between the previous and next
-                                       // keyframes
-                                       scale_activepoints(value_desc,keyframe_prev,old_time,keyframe_prev,new_time);
-                                       scale_activepoints(value_desc,old_time,keyframe_next,new_time,keyframe_next);
-                               }
-                               //else
-                               {       
-                                       Action::Handle action(ActivepointSetSmart::create());
-                                       
-                                       action->set_param("canvas",get_canvas());
-                                       action->set_param("canvas_interface",get_canvas_interface());
-                                       action->set_param("value_desc",value_desc);
-                                       
-                                       Activepoint activepoint;
-                                       try
-                                       {
-                                               activepoint=*value_node->list[i].find(old_time);
-                                               activepoint.set_time(new_time);
-                                       }
-                                       catch(...)
-                                       {
-                                               activepoint.set_time(new_time);
-                                               activepoint.set_state(value_node->list[i].status_at_time(old_time));
-                                               activepoint.set_priority(0);
-                                       }
-                                       action->set_param("activepoint",activepoint);
-       
-                                       assert(action->is_ready());
-                                       if(!action->is_ready())
-                                               throw Error(Error::TYPE_NOTREADY);
-                               
-                                       add_action_front(action);
-                               }
-                       }
-               }
-               else if(ValueNode_Animated::Handle::cast_dynamic(value_node))
-               {
-                       if(new_time>keyframe_prev && new_time<keyframe_next)
-                       {
-                                       // In this circumstance, we need to adjust any
-                                       // waypoints between the previous and next
-                                       // keyframes
-                                       scale_waypoints(value_desc,keyframe_prev,old_time,keyframe_prev,new_time);
-                                       scale_waypoints(value_desc,old_time,keyframe_next,new_time,keyframe_next);
-                       }
-                       //else
-                       {
-                               ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node));
-                               
-                               Action::Handle action(WaypointSetSmart::create());
-                               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_node",ValueNode::Handle(value_node));
-                               
-                               Waypoint waypoint;
-                               try
-                               {
-                                       waypoint=*value_node->find(old_time);
-                                       waypoint.set_time(new_time);
-                               }
-                               catch(...)
-                               {
-                                       waypoint.set_time(new_time);
-                                       waypoint.set_value((*value_node)(old_time));
-                               }
-                               action->set_param("waypoint",waypoint);
-               
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                       
-                               add_action_front(action);
-                       }
-               }
-       }
-}
-
-
-void
-Action::KeyframeSet::perform()
-{
-
-       old_time=get_canvas()->keyframe_list().find(keyframe)->get_time();
-       new_time=keyframe.get_time();
-       
-       try { get_canvas()->keyframe_list().find(keyframe);}
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find the given keyframe"));
-       }       
-       
-       // Check for colisions
-       if(old_time!=new_time)
-       {
-               try {
-                       get_canvas()->keyframe_list().find(new_time);
-                       throw Error(_("Cannot change keyframe time because another keyframe already exists with that time."));
-               }
-               catch(Exception::NotFound) { }
-       }
-       try { keyframe_next=get_canvas()->keyframe_list().find_next(old_time)->get_time(); }
-       catch(...) { keyframe_next=Time::end(); }
-       try { keyframe_prev=get_canvas()->keyframe_list().find_prev(old_time)->get_time(); }
-       catch(...) { keyframe_prev=Time::begin(); }
-
-       old_keyframe=*get_canvas()->keyframe_list().find(keyframe);
-       *get_canvas()->keyframe_list().find(keyframe)=keyframe;
-       
-       get_canvas()->keyframe_list().sync();
-
-       try{
-               Action::Super::perform();
-       } catch(...)
-       {
-               *get_canvas()->keyframe_list().find(old_keyframe)=old_keyframe;
-
-               get_canvas()->keyframe_list().sync();
-               throw;
-       }
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_changed()(keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::KeyframeSet::undo()
-{
-       Action::Super::undo();
-
-       *get_canvas()->keyframe_list().find(old_keyframe)=old_keyframe;
-
-       get_canvas()->keyframe_list().sync();
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_changed()(keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframeset.h b/synfig-studio/trunk/src/sinfgapp/actions/keyframeset.h
deleted file mode 100644 (file)
index a943eea..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeset.h
-**     \brief Template File
-**
-**     $Id: keyframeset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_KEYFRAMESET_H
-#define __SINFG_APP_ACTION_KEYFRAMESET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/keyframe.h>
-#include <sinfg/time.h>
-#include <sinfg/guid.h>
-#include <set>
-
-/* === 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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class KeyframeSet :
-       public Super
-{
-private:
-
-       sinfg::Keyframe keyframe;
-       sinfg::Keyframe old_keyframe;
-       sinfg::Time old_time;
-       sinfg::Time new_time;
-
-       sinfg::Time keyframe_prev,keyframe_next;
-       
-       std::set<sinfg::GUID> guid_set;
-
-       void process_value_desc(const sinfgapp::ValueDesc& value_desc);
-       
-       int scale_activepoints(const sinfgapp::ValueDesc& value_desc,const sinfg::Time& old_begin,const sinfg::Time& old_end,const sinfg::Time& new_begin,const sinfg::Time& new_end);
-       int scale_waypoints(const sinfgapp::ValueDesc& value_desc,const sinfg::Time& old_begin,const sinfg::Time& old_end,const sinfg::Time& new_begin,const sinfg::Time& new_end);
-
-public:
-
-       KeyframeSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframesetdelta.cpp b/synfig-studio/trunk/src/sinfgapp/actions/keyframesetdelta.cpp
deleted file mode 100644 (file)
index ad311c2..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeset.cpp
-**     \brief Template File
-**
-**     $Id: keyframesetdelta.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "keyframesetdelta.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_animated.h>
-#include "activepointsetsmart.h"
-#include "waypointsetsmart.h"
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::KeyframeSetDelta);
-ACTION_SET_NAME(Action::KeyframeSetDelta,"keyframe_set_delta");
-ACTION_SET_LOCAL_NAME(Action::KeyframeSetDelta,"Set Keyframe Delta");
-ACTION_SET_TASK(Action::KeyframeSetDelta,"set");
-ACTION_SET_CATEGORY(Action::KeyframeSetDelta,Action::CATEGORY_KEYFRAME|Action::CATEGORY_HIDDEN);
-ACTION_SET_PRIORITY(Action::KeyframeSetDelta,0);
-ACTION_SET_VERSION(Action::KeyframeSetDelta,"0.0");
-ACTION_SET_CVS_ID(Action::KeyframeSetDelta,"$Id: keyframesetdelta.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::KeyframeSetDelta::KeyframeSetDelta():
-       delta(0)
-{
-       keyframe.set_time(Time::end());
-       set_dirty(false);
-}
-
-Action::ParamVocab
-Action::KeyframeSetDelta::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
-               .set_local_name(_("Keyframe"))
-       );
-       ret.push_back(ParamDesc("delta",Param::TYPE_KEYFRAME)
-               .set_local_name(_("Delta"))
-       );
-
-       return ret;
-}
-
-bool
-Action::KeyframeSetDelta::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::KeyframeSetDelta::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
-       {
-               keyframe=param.get_keyframe();
-               return true;
-       }
-       if(name=="delta" && param.get_type()==Param::TYPE_TIME)
-       {
-               delta=param.get_time();
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::KeyframeSetDelta::is_ready()const
-{
-       if(keyframe.get_time()==Time::end())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::KeyframeSetDelta::prepare()
-{
-       clear();
-       value_desc_list.clear();
-       get_canvas_interface()->find_important_value_descs(value_desc_list);
-
-       
-       Time time(get_canvas()->keyframe_list().find(keyframe)->get_time());
-       
-       std::vector<sinfgapp::ValueDesc>::iterator iter;
-               DEBUGPOINT();
-       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
-       {
-               ValueDesc& value_desc(*iter);
-               ValueNode_Animated::Handle value_node(
-                       ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())
-               );
-               
-               if(!value_node)
-                       continue;
-               
-               try{
-                       value_node->find(time);
-                       // if we got to this point, then we know that
-                       // a waypoint already exists here and we don't
-                       // need to add a new one.
-                       continue;
-               }catch(...)
-               {
-                       // Make sure there is something previous
-                       try{
-                               value_node->find_prev(time);
-                       }catch(...)
-                       {
-                               continue;
-                       }
-               }
-               Action::Handle action(Action::create("waypoint_set_smart"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_node",ValueNode::Handle::cast_static(value_node));
-
-               action->set_param("time",time);
-
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);                                             
-       }
-}
-
-void
-Action::KeyframeSetDelta::perform()
-{
-       if(!delta)
-               return;
-       Action::Super::perform();
-       
-//     Time location(keyframe.get_time());
-       Time location(get_canvas()->keyframe_list().find(keyframe)->get_time());        
-       Time delta(delta);
-       
-       get_canvas()->keyframe_list().insert_time(location,delta);
-
-       std::vector<sinfgapp::ValueDesc>::iterator iter;
-       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
-       {
-               ValueDesc& value_desc(*iter);
-               if(!value_desc.is_value_node())
-                       continue;
-               ValueNode_Animated::Handle animated(
-                       ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())
-               );
-               if(animated)
-               {
-                       animated->insert_time(location,delta);
-                       continue;
-               }
-               ValueNode_DynamicList::Handle dyn_list(
-                       ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_value_node())
-               );
-               if(dyn_list)
-               {
-                       dyn_list->insert_time(location,delta);
-                       continue;
-               }
-       }
-
-       // Signal that something has changed
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_changed()(keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::KeyframeSetDelta::undo()
-{
-       if(!delta)
-               return;
-       
-//     Time location(keyframe.get_time());
-       Time location(get_canvas()->keyframe_list().find(keyframe)->get_time());        
-       Time delta(-delta);
-       
-       get_canvas()->keyframe_list().insert_time(location,delta);
-
-       std::vector<sinfgapp::ValueDesc>::iterator iter;
-       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
-       {
-               ValueDesc& value_desc(*iter);
-               if(!value_desc.is_value_node())
-                       continue;
-               ValueNode_Animated::Handle animated(
-                       ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())
-               );
-               if(animated)
-               {
-                       animated->insert_time(location,delta);
-                       continue;
-               }
-               ValueNode_DynamicList::Handle dyn_list(
-                       ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_value_node())
-               );
-               if(dyn_list)
-               {
-                       dyn_list->insert_time(location,delta);
-                       continue;
-               }
-       }
-
-       Action::Super::undo();
-
-       // Signal that something has changed
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_keyframe_changed()(keyframe);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframesetdelta.h b/synfig-studio/trunk/src/sinfgapp/actions/keyframesetdelta.h
deleted file mode 100644 (file)
index 5e993f8..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeset.h
-**     \brief Template File
-**
-**     $Id: keyframesetdelta.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_KEYFRAMESETDELTA_H
-#define __SINFG_APP_ACTION_KEYFRAMESETDELTA_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/keyframe.h>
-#include <sinfg/time.h>
-#include <sinfg/guid.h>
-#include <set>
-
-/* === 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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class KeyframeSetDelta :
-       public Super
-{
-private:
-       sinfg::Keyframe keyframe;
-       sinfg::Time delta;
-
-       std::vector<sinfgapp::ValueDesc> value_desc_list;
-
-       void process_value_desc(const sinfgapp::ValueDesc& value_desc);
-       
-       int scale_activepoints(const sinfgapp::ValueDesc& value_desc,const sinfg::Time& old_begin,const sinfg::Time& old_end,const sinfg::Time& new_begin,const sinfg::Time& new_end);
-       int scale_waypoints(const sinfgapp::ValueDesc& value_desc,const sinfg::Time& old_begin,const sinfg::Time& old_end,const sinfg::Time& new_begin,const sinfg::Time& new_end);
-
-public:
-
-       KeyframeSetDelta();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframewaypointset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/keyframewaypointset.cpp
deleted file mode 100644 (file)
index 17b9a7f..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframeset.cpp
-**     \brief Template File
-**
-**     $Id: keyframewaypointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "keyframewaypointset.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_animated.h>
-#include "activepointsetsmart.h"
-#include "waypointsetsmart.h"
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::KeyframeWaypointSet);
-ACTION_SET_NAME(Action::KeyframeWaypointSet,"keyframe_waypoint_set");
-ACTION_SET_LOCAL_NAME(Action::KeyframeWaypointSet,"Set Waypoints at Keyframe");
-ACTION_SET_TASK(Action::KeyframeWaypointSet,"set");
-ACTION_SET_CATEGORY(Action::KeyframeWaypointSet,Action::CATEGORY_KEYFRAME);
-ACTION_SET_PRIORITY(Action::KeyframeWaypointSet,0);
-ACTION_SET_VERSION(Action::KeyframeWaypointSet,"0.0");
-ACTION_SET_CVS_ID(Action::KeyframeWaypointSet,"$Id: keyframewaypointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::KeyframeWaypointSet::KeyframeWaypointSet()
-{
-       keyframe.set_time(Time::begin()-1);
-       set_dirty(false);
-}
-
-Action::ParamVocab
-Action::KeyframeWaypointSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
-               .set_local_name(_("Keyframe"))
-       );
-
-       ret.push_back(ParamDesc("model",Param::TYPE_WAYPOINTMODEL)
-               .set_local_name(_("Waypoint Model"))
-       );
-
-       return ret;
-}
-
-bool
-Action::KeyframeWaypointSet::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::KeyframeWaypointSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
-       {
-               keyframe=param.get_keyframe();
-               
-               return true;
-       }
-       if(name=="model" && param.get_type()==Param::TYPE_WAYPOINTMODEL)
-       {
-               waypoint_model=param.get_waypoint_model();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::KeyframeWaypointSet::is_ready()const
-{
-       if(keyframe.get_time()==(Time::begin()-1) || waypoint_model.is_trivial())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::KeyframeWaypointSet::prepare()
-{
-       clear();
-
-       try { get_canvas()->keyframe_list().find(keyframe);}
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find the given keyframe"));
-       }       
-
-       {
-               std::vector<sinfgapp::ValueDesc> value_desc_list;
-               get_canvas_interface()->find_important_value_descs(value_desc_list);
-               while(!value_desc_list.empty())
-               {
-                       process_value_desc(value_desc_list.back());
-                       value_desc_list.pop_back();
-               }
-       }
-}
-
-void
-Action::KeyframeWaypointSet::process_value_desc(const sinfgapp::ValueDesc& value_desc)
-{      
-       if(value_desc.is_value_node())
-       {
-               ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node()));
-       
-               if(value_node)
-               {                       
-                       Action::Handle action(WaypointSetSmart::create());
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("value_node",ValueNode::Handle(value_node));
-                       
-                       Waypoint waypoint;
-                       try
-                       {
-                               waypoint=*value_node->find(keyframe.get_time());
-                       }
-                       catch(...)
-                       {
-                               waypoint.set_time(keyframe.get_time());
-                               waypoint.set_value((*value_node)(keyframe.get_time()));
-                       }
-                       waypoint.apply_model(waypoint_model);
-                       
-                       action->set_param("waypoint",waypoint);
-       
-                       assert(action->is_ready());
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-               
-                       add_action_front(action);                                               
-               }
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/keyframewaypointset.h b/synfig-studio/trunk/src/sinfgapp/actions/keyframewaypointset.h
deleted file mode 100644 (file)
index 697a081..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file keyframewaypointset.h
-**     \brief Template File
-**
-**     $Id: keyframewaypointset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_KEYFRAMEWAYPOINTSET_H
-#define __SINFG_APP_ACTION_KEYFRAMESET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/keyframe.h>
-#include <sinfg/waypoint.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class KeyframeWaypointSet :
-       public Super
-{
-private:
-
-       sinfg::Keyframe keyframe;
-       sinfg::Waypoint::Model waypoint_model;
-
-
-       void process_value_desc(const sinfgapp::ValueDesc& value_desc);
-
-public:
-
-       KeyframeWaypointSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layeractivate.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layeractivate.cpp
deleted file mode 100644 (file)
index fe0cefa..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layeractivate.cpp
-**     \brief Template File
-**
-**     $Id: layeractivate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layeractivate.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-#define ACTION_INIT2(class) \
-       Action::Base* class::create() { return new class(); }   \
-       sinfg::String class::get_name()const { return name__; } 
-
-ACTION_INIT2(Action::LayerActivate);
-ACTION_SET_NAME(Action::LayerActivate,"layer_activate");
-ACTION_SET_LOCAL_NAME(Action::LayerActivate,_("Activate Layer"));
-ACTION_SET_TASK(Action::LayerActivate,"activate");
-ACTION_SET_CATEGORY(Action::LayerActivate,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerActivate,0);
-ACTION_SET_VERSION(Action::LayerActivate,"0.0");
-ACTION_SET_CVS_ID(Action::LayerActivate,"$Id: layeractivate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerActivate::LayerActivate()
-{
-}
-
-sinfg::String
-Action::LayerActivate::get_local_name()const
-{
-       if(!layer)
-               return _("Activate Layer");
-       String name;
-       if(layer->get_description().empty())
-               name=layer->get_local_name();
-       else
-               name=layer->get_description();
-
-       return (new_status?_("Activate "):_("Deactivate "))+name;
-}
-
-Action::ParamVocab
-Action::LayerActivate::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-       );
-
-       ret.push_back(ParamDesc("new_status",Param::TYPE_BOOL)
-               .set_local_name(_("New Status"))
-               .set_desc(_("The new status of the layer"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerActivate::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerActivate::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layer=param.get_layer();
-               
-               return true;
-       }
-
-       if(name=="new_status" && param.get_type()==Param::TYPE_BOOL)
-       {
-               new_status=param.get_bool();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerActivate::is_ready()const
-{
-       if(!layer)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerActivate::perform()
-{
-       Canvas::Handle subcanvas(layer->get_canvas());
-       
-       // Find the iterator for the layer
-       Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
-       
-       // If we couldn't find the layer in the canvas, then bail
-       if(*iter!=layer)
-               throw Error(_("This layer doesn't exist anymore."));
-
-       // If the subcanvas isn't the same as the canvas,
-       // then it had better be an inline canvas. If not,
-       // bail
-       //if(get_canvas()!=subcanvas && !subcanvas->is_inline())
-       //if(get_canvas()->get_root()!=subcanvas->get_root())
-       //      throw Error(_("This layer doesn't belong to this composition"));
-       
-       old_status=layer->active();
-       
-       // If we are changing the status to what it already is,
-       // the go ahead and return
-       if(new_status==old_status)
-       {
-               set_dirty(false);
-               return;
-       }
-       else
-               set_dirty();
-       
-       if(new_status)
-               layer->enable();
-       else
-               layer->disable();
-
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_status_changed()(layer,new_status);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::LayerActivate::undo()
-{
-       // If we are changing the status to what it already is,
-       // the go ahead and return
-       if(new_status==old_status)
-       {
-               set_dirty(false);
-               return;
-       }
-       else
-               set_dirty();
-
-       // restore the old status
-       if(old_status)
-               layer->enable();
-       else
-               layer->disable();
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_status_changed()(layer,old_status);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layeractivate.h b/synfig-studio/trunk/src/sinfgapp/actions/layeractivate.h
deleted file mode 100644 (file)
index 57330ca..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layeractivate.h
-**     \brief Template File
-**
-**     $Id: layeractivate.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERACTIVATE_H
-#define __SINFG_APP_ACTION_LAYERACTIVATE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class LayerActivate :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Layer::Handle layer;
-       bool old_status;
-       bool new_status;
-
-public:
-
-       LayerActivate();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layeradd.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layeradd.cpp
deleted file mode 100644 (file)
index d22ccc6..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layeradd.cpp
-**     \brief Template File
-**
-**     $Id: layeradd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layeradd.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerAdd);
-ACTION_SET_NAME(Action::LayerAdd,"layer_add");
-ACTION_SET_LOCAL_NAME(Action::LayerAdd,"Add Layer");
-ACTION_SET_TASK(Action::LayerAdd,"add");
-ACTION_SET_CATEGORY(Action::LayerAdd,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerAdd,0);
-ACTION_SET_VERSION(Action::LayerAdd,"0.0");
-ACTION_SET_CVS_ID(Action::LayerAdd,"$Id: layeradd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerAdd::LayerAdd()
-{
-}
-
-Action::ParamVocab
-Action::LayerAdd::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("new",Param::TYPE_LAYER)
-               .set_local_name(_("New Layer"))
-               .set_desc(_("Layer to be added"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerAdd::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerAdd::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="new" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layer=param.get_layer();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerAdd::is_ready()const
-{
-       if(!layer)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerAdd::perform()
-{
-       // Set the layer's canvas
-       layer->set_canvas(get_canvas());
-               
-       // Push the layer onto the front of the canvas
-       get_canvas()->push_front(layer);        
-
-       // Mark ourselves as dirty if necessary
-       //set_dirty(layer->active());
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_inserted()(layer,0);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::LayerAdd::undo()
-{
-       // Find the iterator for the layer
-       Canvas::iterator iter=find(get_canvas()->begin(),get_canvas()->end(),layer);
-               
-       // If we couldn't find the layer in the canvas, then bail
-       if(*iter!=layer)
-               throw Error(_("This layer doesn't exist anymore."));
-       
-       // Remove the layer from the canvas
-       get_canvas()->erase(iter);
-
-       // Mark ourselves as dirty if necessary
-       //set_dirty(layer->active());
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_removed()(layer);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layeradd.h b/synfig-studio/trunk/src/sinfgapp/actions/layeradd.h
deleted file mode 100644 (file)
index 48c3132..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layeradd.h
-**     \brief Template File
-**
-**     $Id: layeradd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERADD_H
-#define __SINFG_APP_ACTION_LAYERADD_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class LayerAdd :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Layer::Handle layer;
-
-public:
-
-       LayerAdd();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerduplicate.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layerduplicate.cpp
deleted file mode 100644 (file)
index d59217f..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerduplicate.cpp
-**     \brief Template File
-**
-**     $Id: layerduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerduplicate.h"
-#include "layeradd.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerDuplicate);
-ACTION_SET_NAME(Action::LayerDuplicate,"layer_duplicate");
-ACTION_SET_LOCAL_NAME(Action::LayerDuplicate,"Duplicate Layer");
-ACTION_SET_TASK(Action::LayerDuplicate,"duplicate");
-ACTION_SET_CATEGORY(Action::LayerDuplicate,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerDuplicate,0);
-ACTION_SET_VERSION(Action::LayerDuplicate,"0.0");
-ACTION_SET_CVS_ID(Action::LayerDuplicate,"$Id: layerduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerDuplicate::LayerDuplicate()
-{
-}
-
-Action::ParamVocab
-Action::LayerDuplicate::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be duplicated"))
-               .set_supports_multiple()
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerDuplicate::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerDuplicate::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layers.push_back(param.get_layer());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerDuplicate::is_ready()const
-{
-       if(layers.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerDuplicate::prepare()
-{
-       if(!first_time())
-               return;
-       
-       std::list<sinfg::Layer::Handle>::const_iterator iter;
-       
-       for(iter=layers.begin();iter!=layers.end();++iter)
-       {
-               Layer::Handle layer(*iter);
-               
-               Canvas::Handle subcanvas(layer->get_canvas());
-               
-               // Find the iterator for the layer
-               Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
-               
-               // If we couldn't find the layer in the canvas, then bail
-               if(*iter!=layer)
-                       throw Error(_("This layer doesn't exist anymore."));
-       
-               // If the subcanvas isn't the same as the canvas,
-               // then it had better be an inline canvas. If not,
-               // bail
-               if(get_canvas()!=subcanvas && !subcanvas->is_inline())
-                       throw Error(_("This layer doesn't belong to this canvas anymore"));
-               
-               Layer::Handle new_layer(layer->clone(guid));
-               
-               {
-                       Action::Handle action(Action::create("layer_move"));
-                       
-                       action->set_param("canvas",subcanvas);
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("layer",new_layer);
-                       action->set_param("new_index",layers.front()->get_depth());
-                       
-                       add_action_front(action);
-               }
-               {
-                       Action::Handle action(Action::create("layer_add"));
-               
-                       action->set_param("canvas",subcanvas);
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("new",new_layer);
-                       
-                       add_action_front(action);
-               }
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerduplicate.h b/synfig-studio/trunk/src/sinfgapp/actions/layerduplicate.h
deleted file mode 100644 (file)
index 041e769..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerduplicate.h
-**     \brief Template File
-**
-**     $Id: layerduplicate.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERDUPLICATE_H
-#define __SINFG_APP_ACTION_LAYERDUPLICATE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.h>
-#include <list>
-#include <sinfg/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 sinfgapp {
-
-namespace Action {
-
-class LayerDuplicate :
-       public Super
-{
-private:
-
-       sinfg::GUID guid;
-       std::list<sinfg::Layer::Handle> layers;
-
-public:
-
-       LayerDuplicate();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerencapsulate.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layerencapsulate.cpp
deleted file mode 100644 (file)
index fd08d03..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerraise.cpp
-**     \brief Template File
-**
-**     $Id: layerencapsulate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerencapsulate.h"
-#include "layeradd.h"
-#include "layerremove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerEncapsulate);
-ACTION_SET_NAME(Action::LayerEncapsulate,"layer_encapsulate");
-ACTION_SET_LOCAL_NAME(Action::LayerEncapsulate,"Encapsulate");
-ACTION_SET_TASK(Action::LayerEncapsulate,"encapsulate");
-ACTION_SET_CATEGORY(Action::LayerEncapsulate,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerEncapsulate,0);
-ACTION_SET_VERSION(Action::LayerEncapsulate,"0.0");
-ACTION_SET_CVS_ID(Action::LayerEncapsulate,"$Id: layerencapsulate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerEncapsulate::LayerEncapsulate()
-{
-}
-
-Action::ParamVocab
-Action::LayerEncapsulate::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be encapsulated"))
-               .set_supports_multiple()
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerEncapsulate::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerEncapsulate::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layers.push_back(param.get_layer());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerEncapsulate::is_ready()const
-{
-       if(layers.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-int
-Action::LayerEncapsulate::lowest_depth()const
-{
-       std::list<sinfg::Layer::Handle>::const_iterator iter;
-       int lowest_depth(0x7fffffff);
-       
-       for(iter=layers.begin();iter!=layers.end();++iter)
-       {
-               int depth((*iter)->get_depth());
-               if(depth<lowest_depth)
-                       lowest_depth=depth;
-       }
-       if(lowest_depth==0x7fffffff)
-               return 0;
-       return lowest_depth;
-}
-
-void
-Action::LayerEncapsulate::prepare()
-{
-
-       if(!first_time())
-               return;
-
-       if(layers.empty())
-               throw Error("No layers to encapsulate");
-               
-       // First create the new canvas and layer
-       if(!child_canvas)
-               child_canvas=Canvas::create_inline(get_canvas());
-       
-       Layer::Handle new_layer(Layer::create("PasteCanvas"));
-       
-       new_layer->set_param("canvas",child_canvas);
-       
-       int target_depth(lowest_depth());
-       
-       // Add the layer
-       {
-               Action::Handle action(LayerAdd::create());
-       
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("new",new_layer);
-               
-               add_action(action);
-       }       
-       
-       // Move the layer
-       {
-               Action::Handle action(Action::create("layer_move"));
-               
-               assert(action);
-       
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("layer",new_layer);
-               action->set_param("new_index",target_depth);
-               
-               add_action(action);
-       }               
-               
-       std::list<sinfg::Layer::Handle>::reverse_iterator iter;
-       
-       for(iter=layers.rbegin();iter!=layers.rend();++iter)
-       {
-               Layer::Handle layer(*iter);
-               
-               Canvas::Handle subcanvas(layer->get_canvas());
-               
-               // Find the iterator for the layer
-               Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
-               
-               // If we couldn't find the layer in the canvas, then bail
-               if(*iter!=layer)
-                       throw Error(_("This layer doesn't exist anymore."));
-       
-               if(!subcanvas)
-                       throw Error(_("This layer doesn't have a parent canvas"));
-
-               // If the subcanvas isn't the same as the canvas,
-               // then it had better be an inline canvas. If not,
-               // bail
-               if(get_canvas()!=subcanvas && !subcanvas->is_inline())
-                       throw Error(_("This layer doesn't belong to this canvas anymore"));
-
-               if(get_canvas()!=subcanvas)
-                       throw Error(_("get_canvas()!=subcanvas"));
-               
-               // Remove the layer from the old canvas
-               {
-                       Action::Handle action(LayerRemove::create());
-                       
-                       action->set_param("canvas",subcanvas);
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("layer",layer);
-                       
-                       add_action(action);
-               }
-               // Add the layer to the new canvas
-               {
-                       Action::Handle action(LayerAdd::create());
-                       
-                       action->set_param("canvas",child_canvas);
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("new",layer);
-                       
-                       add_action(action);
-               }
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerencapsulate.h b/synfig-studio/trunk/src/sinfgapp/actions/layerencapsulate.h
deleted file mode 100644 (file)
index 6573aae..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerencapsulate.h
-**     \brief Template File
-**
-**     $Id: layerencapsulate.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERENCAPSULATE_H
-#define __SINFG_APP_ACTION_LAYERENCAPSULATE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.h>
-#include <list>
-#include <sinfg/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 sinfgapp {
-
-namespace Action {
-
-class LayerEncapsulate :
-       public Super
-{
-private:
-       sinfg::Canvas::Handle child_canvas;
-       std::list<sinfg::Layer::Handle> layers;
-
-       int lowest_depth()const;
-
-public:
-
-       LayerEncapsulate();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerlower.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layerlower.cpp
deleted file mode 100644 (file)
index d08ff40..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerlower.cpp
-**     \brief Template File
-**
-**     $Id: layerlower.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerlower.h"
-#include "layermove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerLower);
-ACTION_SET_NAME(Action::LayerLower,"layer_lower");
-ACTION_SET_LOCAL_NAME(Action::LayerLower,"Lower Layer");
-ACTION_SET_TASK(Action::LayerLower,"lower");
-ACTION_SET_CATEGORY(Action::LayerLower,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerLower,10);
-ACTION_SET_VERSION(Action::LayerLower,"0.0");
-ACTION_SET_CVS_ID(Action::LayerLower,"$Id: layerlower.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerLower::LayerLower()
-{
-}
-
-Action::ParamVocab
-Action::LayerLower::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be lowered"))
-               .set_supports_multiple()
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerLower::is_canidate(const ParamList &x)
-{
-       if(!canidate_check(get_param_vocab(),x))
-               return false;
-       
-       Layer::Handle layer(x.find("layer")->second.get_layer());
-       //sinfg::info("layer->get_depth()= %d ; layer->get_canvas()->size()=%d ;",layer->get_depth(),layer->get_canvas()->size());
-       if(layer->get_depth()+1>=layer->get_canvas()->size())
-               return false;
-       return true;
-}
-
-bool
-Action::LayerLower::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layers.push_back(param.get_layer());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerLower::is_ready()const
-{
-       if(layers.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerLower::prepare()
-{
-       std::list<sinfg::Layer::Handle>::const_iterator iter;
-
-       clear();
-       
-       for(iter=layers.begin();iter!=layers.end();++iter)
-       {
-               Layer::Handle layer(*iter);
-               
-               Canvas::Handle subcanvas(layer->get_canvas());
-               
-               // Find the iterator for the layer
-               Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
-               
-               // If we couldn't find the layer in the canvas, then bail
-               if(*iter!=layer)
-                       throw Error(_("This layer doesn't exist anymore."));
-       
-               // If the subcanvas isn't the same as the canvas,
-               // then it had better be an inline canvas. If not,
-               // bail
-               //if(get_canvas()!=subcanvas && !subcanvas->is_inline())
-               //      throw Error(_("This layer doesn't belong to this canvas anymore"));
-               
-               int new_index=iter-subcanvas->begin();
-                               
-               new_index++;
-               
-               // If this lowers the layer past the bottom then don't bother
-               if(new_index==subcanvas->size())
-                       continue;
-               
-               Action::Handle layer_move(LayerMove::create());
-               
-               layer_move->set_param("canvas",get_canvas());
-               layer_move->set_param("canvas_interface",get_canvas_interface());
-               layer_move->set_param("layer",layer);
-               layer_move->set_param("new_index",new_index);
-               
-               add_action_front(layer_move);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerlower.h b/synfig-studio/trunk/src/sinfgapp/actions/layerlower.h
deleted file mode 100644 (file)
index 5ae1886..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerlower.h
-**     \brief Template File
-**
-**     $Id: layerlower.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERLOWER_H
-#define __SINFG_APP_ACTION_LAYERLOWER_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-namespace Action {
-
-class LayerLower :
-       public Super
-{
-private:
-
-       std::list<sinfg::Layer::Handle> layers;
-
-public:
-
-       LayerLower();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layermove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layermove.cpp
deleted file mode 100644 (file)
index bd47fcd..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layermove.cpp
-**     \brief Template File
-**
-**     $Id: layermove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layermove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerMove);
-ACTION_SET_NAME(Action::LayerMove,"layer_move");
-ACTION_SET_LOCAL_NAME(Action::LayerMove,_("Move Layer"));
-ACTION_SET_TASK(Action::LayerMove,"move");
-ACTION_SET_CATEGORY(Action::LayerMove,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerMove,0);
-ACTION_SET_VERSION(Action::LayerMove,"0.0");
-ACTION_SET_CVS_ID(Action::LayerMove,"$Id: layermove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-static const int nindex=-1;
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerMove::LayerMove():
-       new_index(0xdeadbeef)
-{
-}
-
-Action::ParamVocab
-Action::LayerMove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be moved"))
-       );
-
-       ret.push_back(ParamDesc("new_index",Param::TYPE_INTEGER)
-               .set_local_name(_("New Index"))
-               .set_desc(_("Where the layer is to be moved to"))
-       );
-
-       ret.push_back(ParamDesc("dest_canvas",Param::TYPE_CANVAS)
-               .set_local_name(_("Destination Canvas"))
-               .set_desc(_("The canvas the layer is to be moved to"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerMove::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerMove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-
-               layer=param.get_layer();
-               
-               return true;
-       }
-
-       if(name=="new_index" && param.get_type()==Param::TYPE_INTEGER)
-       {
-               new_index=param.get_integer();
-               
-               return true;
-       }
-
-       if(name=="dest_canvas" && param.get_type()==Param::TYPE_CANVAS)
-       {
-               dest_canvas=param.get_canvas();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerMove::is_ready()const
-{
-       sinfg::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
-       if(!layer || (unsigned)new_index==0xdeadbeef)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerMove::perform()
-{              
-       sinfg::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
-
-       Canvas::Handle subcanvas(layer->get_canvas());
-       src_canvas=subcanvas;
-       if(!dest_canvas)
-               dest_canvas=subcanvas;
-               
-       // Find the iterator for the layer
-       Canvas::iterator iter=find(src_canvas->begin(),src_canvas->end(),layer);
-       
-       // If we couldn't find the layer in the canvas, then bail
-       if(*iter!=layer)
-               throw Error(_("This layer doesn't exist anymore."));
-
-       sinfg::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
-
-       // If the subcanvas isn't the same as the canvas,
-       // then it had better be an inline canvas. If not,
-       // bail
-       //if(get_canvas()!=subcanvas && !subcanvas->is_inline())
-       if(get_canvas()->get_root()!=dest_canvas->get_root() || get_canvas()->get_root()!=src_canvas->get_root())
-               throw Error(_("You cannot directly move layers across compositions"));
-       
-       old_index=iter-src_canvas->begin();
-       int depth;
-       
-       if(new_index<0)
-               depth=dest_canvas->size()+new_index+1;
-       else
-               depth=new_index;
-       
-       set_dirty(layer->active());
-
-       sinfg::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
-
-       // If we were to move it to where it is
-       if(old_index==depth && src_canvas==dest_canvas)
-               return;
-       
-       if(depth>dest_canvas->size())
-               depth=dest_canvas->size();
-       if(depth<0)
-               depth=0;
-               
-       src_canvas->erase(iter);
-       
-       dest_canvas->insert(dest_canvas->begin()+depth,layer);          
-       layer->set_canvas(dest_canvas);
-       
-       layer->changed();
-       dest_canvas->changed(); if(dest_canvas!=src_canvas) src_canvas->changed();
-       
-       sinfg::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
-       
-       if(get_canvas_interface())
-       {
-               if(src_canvas==dest_canvas)
-               {
-                       if(new_index==old_index-1)      // Raise
-                               get_canvas_interface()->signal_layer_raised()(layer);
-                       else if(new_index==old_index+1) // Lower
-                               get_canvas_interface()->signal_layer_lowered()(layer);
-                       else            // Moved
-                       {
-                               get_canvas_interface()->signal_layer_moved()(layer,depth,dest_canvas);
-                       }
-               }
-               else
-               {
-                       get_canvas_interface()->signal_layer_moved()(layer,depth,dest_canvas);
-               }
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-
-       sinfg::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
-}
-
-void
-Action::LayerMove::undo()
-{
-       // Find the iterator for the layer
-       Canvas::iterator iter=find(dest_canvas->begin(),dest_canvas->end(),layer);
-       
-       // If we couldn't find the layer in the canvas, then bail
-       if(*iter!=layer || (get_canvas()!=dest_canvas && !dest_canvas->is_inline()))
-               throw Error(_("This layer doesn't exist anymore."));
-       
-       // If we were to move it to where it is
-       if(old_index==new_index && src_canvas==dest_canvas)
-               return;
-
-       // Mark ourselves as dirty if necessary
-       set_dirty(layer->active());
-
-       dest_canvas->erase(iter);
-       
-       src_canvas->insert(src_canvas->begin()+old_index,layer);
-       layer->set_canvas(src_canvas);
-
-       layer->changed();
-       dest_canvas->changed(); if(dest_canvas!=src_canvas) src_canvas->changed();
-       
-       // Execute any signals
-       if(get_canvas_interface())
-       {
-               if(src_canvas==dest_canvas)
-               {
-                       if(new_index==old_index+1)      // Raise
-                               get_canvas_interface()->signal_layer_raised()(layer);
-                       else if(new_index==old_index-1) // Lower
-                               get_canvas_interface()->signal_layer_lowered()(layer);
-                       else            // Moved
-                       {
-                       get_canvas_interface()->signal_layer_moved()(layer,old_index,src_canvas);
-                       }
-               }
-               else
-               {
-                       get_canvas_interface()->signal_layer_moved()(layer,old_index,src_canvas);
-                       //get_canvas_interface()->signal_layer_removed()(layer);        
-                       //get_canvas_interface()->signal_layer_inserted()(layer,old_index);
-               }
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layermove.h b/synfig-studio/trunk/src/sinfgapp/actions/layermove.h
deleted file mode 100644 (file)
index a6dc5ea..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layermove.h
-**     \brief Template File
-**
-**     $Id: layermove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERMOVE_H
-#define __SINFG_APP_ACTION_LAYERMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class LayerMove :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Layer::Handle layer;
-       int old_index;
-       int new_index;
-
-       sinfg::Canvas::Handle src_canvas;
-       sinfg::Canvas::Handle dest_canvas;
-
-public:
-
-       LayerMove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerparamconnect.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layerparamconnect.cpp
deleted file mode 100644 (file)
index 241c662..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerparamconnect.cpp
-**     \brief Template File
-**
-**     $Id: layerparamconnect.cpp,v 1.2 2005/01/16 19:55:57 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerparamconnect.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerParamConnect);
-ACTION_SET_NAME(Action::LayerParamConnect,"layer_param_connect");
-ACTION_SET_LOCAL_NAME(Action::LayerParamConnect,_("Connect Layer Parameter"));
-ACTION_SET_TASK(Action::LayerParamConnect,"connect");
-ACTION_SET_CATEGORY(Action::LayerParamConnect,Action::CATEGORY_LAYER|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::LayerParamConnect,0);
-ACTION_SET_VERSION(Action::LayerParamConnect,"0.0");
-ACTION_SET_CVS_ID(Action::LayerParamConnect,"$Id: layerparamconnect.cpp,v 1.2 2005/01/16 19:55:57 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerParamConnect::LayerParamConnect()
-{
-}
-
-Action::ParamVocab
-Action::LayerParamConnect::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-       );
-
-       ret.push_back(ParamDesc("param",Param::TYPE_STRING)
-               .set_local_name(_("Param"))
-       );
-
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerParamConnect::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerParamConnect::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layer=param.get_layer();
-               
-               return true;
-       }
-
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=param.get_value_node();
-               
-               return true;
-       }
-
-       if(name=="param" && param.get_type()==Param::TYPE_STRING)
-       {
-               param_name=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerParamConnect::is_ready()const
-{
-       if(!layer)
-               sinfg::warning("Action::LayerParamConnect: Missing \"layer\"");
-       if(!value_node)
-               sinfg::warning("Action::LayerParamConnect: Missing \"value_node\"");
-       if(param_name.empty())
-               sinfg::warning("Action::LayerParamConnect: Missing \"param\"");
-       
-       if(!layer || !value_node || param_name.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerParamConnect::perform()
-{
-       // See if the parameter is dynamic
-       if(layer->dynamic_param_list().count(param_name))
-               old_value_node=layer->dynamic_param_list().find(param_name)->second;
-       else
-       {
-               old_value_node=0;
-       }
-
-       old_value=layer->get_param(param_name);
-       if(!old_value.is_valid())
-               throw Error(_("Layer did not recognise parameter name"));               
-
-       if(!layer->set_param(param_name,(*value_node)(0)))
-               throw Error(_("Bad connection"));
-       
-       layer->connect_dynamic_param(param_name,value_node);
-
-       layer->changed();
-       value_node->changed();
-/*     if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
-               //get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-*/
-}
-
-void
-Action::LayerParamConnect::undo()
-{
-       if(old_value_node)
-               layer->connect_dynamic_param(param_name,old_value_node);
-       else
-       {
-               layer->disconnect_dynamic_param(param_name);
-               layer->set_param(param_name,old_value);
-       }
-       
-       layer->changed();
-       if(old_value_node)
-               old_value_node->changed();
-       /*
-       if(layer->active())
-               set_dirty(true);
-       else
-               set_dirty(false);
-       */
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
-               //if(old_value_node)get_canvas_interface()->signal_value_node_changed()(old_value_node);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerparamconnect.h b/synfig-studio/trunk/src/sinfgapp/actions/layerparamconnect.h
deleted file mode 100644 (file)
index 080c478..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerparamconnect.h
-**     \brief Template File
-**
-**     $Id: layerparamconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERPARAMCONNECT_H
-#define __SINFG_APP_ACTION_LAYERPARAMCONNECT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class LayerParamConnect :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Layer::Handle layer;
-       sinfg::String   param_name;
-       sinfg::ValueNode::Handle        value_node;
-       sinfg::ValueNode::Handle        old_value_node;
-       sinfg::ValueBase old_value;
-
-
-public:
-
-       LayerParamConnect();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerparamdisconnect.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layerparamdisconnect.cpp
deleted file mode 100644 (file)
index 72cd3c5..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerparamdisconnect.cpp
-**     \brief Template File
-**
-**     $Id: layerparamdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerparamdisconnect.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerParamDisconnect);
-ACTION_SET_NAME(Action::LayerParamDisconnect,"layer_param_disconnect");
-ACTION_SET_LOCAL_NAME(Action::LayerParamDisconnect,_("Disconnect Layer Parameter"));
-ACTION_SET_TASK(Action::LayerParamDisconnect,"disconnect");
-ACTION_SET_CATEGORY(Action::LayerParamDisconnect,Action::CATEGORY_LAYER|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::LayerParamDisconnect,0);
-ACTION_SET_VERSION(Action::LayerParamDisconnect,"0.0");
-ACTION_SET_CVS_ID(Action::LayerParamDisconnect,"$Id: layerparamdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerParamDisconnect::LayerParamDisconnect():
-       time(0)
-{
-       
-}
-
-Action::ParamVocab
-Action::LayerParamDisconnect::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-       );
-
-       ret.push_back(ParamDesc("param",Param::TYPE_STRING)
-               .set_local_name(_("Param"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_STRING)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerParamDisconnect::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerParamDisconnect::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layer=param.get_layer();
-               
-               return true;
-       }
-
-       if(name=="param" && param.get_type()==Param::TYPE_STRING)
-       {
-               param_name=param.get_string();
-               
-               return true;
-       }
-
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerParamDisconnect::is_ready()const
-{
-       if(!layer || param_name.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerParamDisconnect::perform()
-{
-       if(!layer->dynamic_param_list().count(param_name))
-               throw Error(_("Layer Parameter is not connected to anything"));
-
-       old_value_node=layer->dynamic_param_list().find(param_name)->second;
-       layer->disconnect_dynamic_param(param_name);
-       
-       if(new_value_node || ValueNode_DynamicList::Handle::cast_dynamic(old_value_node))
-       {
-               if(!new_value_node)
-                       new_value_node=old_value_node.clone();
-               layer->connect_dynamic_param(param_name,new_value_node);
-       }
-       else
-               layer->set_param(param_name,(*old_value_node)(time));
-       
-       layer->changed();
-       old_value_node->changed();
-
-       set_dirty(false);
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
-       }
-}
-
-void
-Action::LayerParamDisconnect::undo()
-{
-       layer->connect_dynamic_param(param_name,old_value_node);
-       
-/*     if(layer->active() && get_canvas()->get_time()!=time)
-               set_dirty(true);
-       else
-               set_dirty(false);
-*/
-       layer->changed();
-       old_value_node->changed();
-
-       set_dirty(false);
-
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerparamdisconnect.h b/synfig-studio/trunk/src/sinfgapp/actions/layerparamdisconnect.h
deleted file mode 100644 (file)
index 1a0f63f..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerparamdisconnect.h
-**     \brief Template File
-**
-**     $Id: layerparamdisconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERPARAMDISCONNECT_H
-#define __SINFG_APP_ACTION_LAYERPARAMDISCONNECT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class LayerParamDisconnect :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Layer::Handle layer;
-       sinfg::String   param_name;
-       sinfg::ValueNode::Handle        old_value_node;
-       sinfg::ValueNode::Handle        new_value_node;
-       sinfg::Time time;
-
-public:
-
-       LayerParamDisconnect();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerparamset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layerparamset.cpp
deleted file mode 100644 (file)
index 681b25c..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerparamset.cpp
-**     \brief Template File
-**
-**     $Id: layerparamset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerparamset.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerParamSet);
-ACTION_SET_NAME(Action::LayerParamSet,"layer_param_set");
-ACTION_SET_LOCAL_NAME(Action::LayerParamSet,_("Set Layer Parameter"));
-ACTION_SET_TASK(Action::LayerParamSet,"set");
-ACTION_SET_CATEGORY(Action::LayerParamSet,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerParamSet,0);
-ACTION_SET_VERSION(Action::LayerParamSet,"0.0");
-ACTION_SET_CVS_ID(Action::LayerParamSet,"$Id: layerparamset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerParamSet::LayerParamSet()
-{
-}
-
-Action::ParamVocab
-Action::LayerParamSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-       );
-
-       ret.push_back(ParamDesc("param",Param::TYPE_STRING)
-               .set_local_name(_("Param"))
-       );
-
-       ret.push_back(ParamDesc("new_value",Param::TYPE_VALUE)
-               .set_local_name(_("ValueBase"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerParamSet::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerParamSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layer=param.get_layer();
-               
-               return true;
-       }
-
-       if(name=="new_value" && param.get_type()==Param::TYPE_VALUE)
-       {
-               new_value=param.get_value();
-               
-               return true;
-       }
-
-       if(name=="param" && param.get_type()==Param::TYPE_STRING)
-       {
-               param_name=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerParamSet::is_ready()const
-{
-       if(!layer || !new_value.is_valid() || param_name.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerParamSet::perform()
-{
-       // See if the parameter is dynamic
-       if(layer->dynamic_param_list().count(param_name))
-               throw Error(_("ValueNode attached to Parameter."));
-
-       old_value=layer->get_param(param_name);
-       
-       if(!layer->set_param(param_name,new_value))
-               throw Error(_("Layer did not accept parameter."));
-
-       /*if(layer->active())
-               set_dirty(true);
-       else
-               set_dirty(false);
-       */
-       layer->changed();
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
-       }
-}
-
-void
-Action::LayerParamSet::undo()
-{
-       if(!layer->set_param(param_name,old_value))
-               throw Error(_("Layer did not accept parameter."));
-
-       /*
-       if(layer->active())
-               set_dirty(true);
-       else
-               set_dirty(false);
-       */
-       
-       layer->changed();
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerparamset.h b/synfig-studio/trunk/src/sinfgapp/actions/layerparamset.h
deleted file mode 100644 (file)
index 39cbd62..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerparamset.h
-**     \brief Template File
-**
-**     $Id: layerparamset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERPARAMSET_H
-#define __SINFG_APP_ACTION_LAYERPARAMSET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class LayerParamSet :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Layer::Handle layer;
-       sinfg::String   param_name;
-       sinfg::ValueBase        new_value;
-       sinfg::ValueBase        old_value;
-
-
-public:
-
-       LayerParamSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerraise.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layerraise.cpp
deleted file mode 100644 (file)
index 30b717f..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerraise.cpp
-**     \brief Template File
-**
-**     $Id: layerraise.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerraise.h"
-#include "layermove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerRaise);
-ACTION_SET_NAME(Action::LayerRaise,"layer_raise");
-ACTION_SET_LOCAL_NAME(Action::LayerRaise,"Raise Layer");
-ACTION_SET_TASK(Action::LayerRaise,"raise");
-ACTION_SET_CATEGORY(Action::LayerRaise,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerRaise,9);
-ACTION_SET_VERSION(Action::LayerRaise,"0.0");
-ACTION_SET_CVS_ID(Action::LayerRaise,"$Id: layerraise.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerRaise::LayerRaise()
-{
-}
-
-Action::ParamVocab
-Action::LayerRaise::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be raised"))
-               .set_supports_multiple()
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerRaise::is_canidate(const ParamList &x)
-{
-       if(!canidate_check(get_param_vocab(),x))
-               return false;
-       if(x.find("layer")->second.get_layer()->get_depth()==0)
-               return false;
-       return true;
-}
-
-bool
-Action::LayerRaise::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layers.push_back(param.get_layer());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerRaise::is_ready()const
-{
-       if(layers.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerRaise::prepare()
-{
-       std::list<sinfg::Layer::Handle>::reverse_iterator iter;
-
-       clear();
-       
-       for(iter=layers.rbegin();!(iter==layers.rend());++iter)
-       {
-               Layer::Handle layer(*iter);
-               
-               Canvas::Handle subcanvas(layer->get_canvas());
-               
-               // Find the iterator for the layer
-               Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
-               
-               // If we couldn't find the layer in the canvas, then bail
-               if(*iter!=layer)
-                       throw Error(_("This layer doesn't exist anymore."));
-       
-               // If the subcanvas isn't the same as the canvas,
-               // then it had better be an inline canvas. If not,
-               // bail
-               //if(get_canvas()!=subcanvas && !subcanvas->is_inline())
-               //      throw Error(_("This layer doesn't belong to this canvas anymore"));
-               
-               int new_index=iter-subcanvas->begin();
-               
-               if(new_index==0)
-                       continue;
-               
-               new_index--;
-               
-               Action::Handle layer_move(LayerMove::create());
-               
-               layer_move->set_param("canvas",get_canvas());
-               layer_move->set_param("canvas_interface",get_canvas_interface());
-               layer_move->set_param("layer",layer);
-               layer_move->set_param("new_index",new_index);
-               
-               add_action_front(layer_move);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerraise.h b/synfig-studio/trunk/src/sinfgapp/actions/layerraise.h
deleted file mode 100644 (file)
index bb01316..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layerraise.h
-**     \brief Template File
-**
-**     $Id: layerraise.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERRAISE_H
-#define __SINFG_APP_ACTION_LAYERRAISE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-namespace Action {
-
-class LayerRaise :
-       public Super
-{
-private:
-
-       std::list<sinfg::Layer::Handle> layers;
-
-public:
-
-       LayerRaise();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerremove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layerremove.cpp
deleted file mode 100644 (file)
index a37a876..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_layerremove.cpp
-**     \brief Template File
-**
-**     $Id: layerremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerremove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerRemove);
-ACTION_SET_NAME(Action::LayerRemove,"layer_remove");
-ACTION_SET_LOCAL_NAME(Action::LayerRemove,"Remove Layer");
-ACTION_SET_TASK(Action::LayerRemove,"remove");
-ACTION_SET_CATEGORY(Action::LayerRemove,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerRemove,0);
-ACTION_SET_VERSION(Action::LayerRemove,"0.0");
-ACTION_SET_CVS_ID(Action::LayerRemove,"$Id: layerremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerRemove::LayerRemove()
-{
-}
-
-Action::ParamVocab
-Action::LayerRemove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be deleted"))
-               .set_supports_multiple()
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerRemove::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerRemove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               std::pair<sinfg::Layer::Handle,int> layer_pair;
-               layer_pair.first=param.get_layer();
-               layer_list.push_back(layer_pair);
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerRemove::is_ready()const
-{
-       if(layer_list.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerRemove::perform()
-{
-       std::list<std::pair<sinfg::Layer::Handle,int> >::iterator iter;
-       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
-       {
-               Layer::Handle layer(iter->first);
-//             int& depth(iter->second);
-               Canvas::Handle subcanvas(layer->get_canvas());
-
-               // Find the iterator for the layer
-               Canvas::iterator iter2=find(subcanvas->begin(),subcanvas->end(),layer);
-               
-               // If we couldn't find the layer in the canvas, then bail
-               if(*iter2!=layer)
-               {
-                       /*!     \fixme We should really undo all prior removals
-                       **      before we go throwing shit around */
-                       throw Error(_("This layer doesn't exist anymore."));
-               }
-               
-               // If the subcanvas isn't the same as the canvas,
-               // then it had better be an inline canvas. If not,
-               // bail
-               if(get_canvas()!=subcanvas && !subcanvas->is_inline())
-               {
-                       /*!     \fixme We should really undo all prior removals
-                       **      before we go throwing shit around */
-                       throw Error(_("This layer doesn't belong to this canvas anymore"));
-               }
-               
-               set_canvas(subcanvas);
-               
-               // Calculate the depth that the layer was at (For the undo)
-               iter->second=layer->get_depth();
-       
-               // Mark ourselves as dirty if necessary
-               set_dirty(layer->active());
-                       
-               // Remove the layer from the canvas
-               subcanvas->erase(iter2);
-               
-               // Signal that a layer has been removed
-               if(get_canvas_interface())
-                       get_canvas_interface()->signal_layer_removed()(layer);
-       }
-}
-
-void
-Action::LayerRemove::undo()
-{
-       std::list<std::pair<sinfg::Layer::Handle,int> >::reverse_iterator iter;
-       for(iter=layer_list.rbegin();iter!=layer_list.rend();++iter)
-       {       
-               Layer::Handle layer(iter->first);
-               int& depth(iter->second);
-               
-               // Set the layer's canvas
-               layer->set_canvas(get_canvas());
-       
-               // Make sure that the depth is valid
-               if(get_canvas()->size()<depth)
-                       depth=get_canvas()->size();
-               
-               // Mark ourselves as dirty if necessary
-               set_dirty(layer->active());
-       
-               // Insert the layer into the canvas at the desired depth
-               get_canvas()->insert(get_canvas()->begin()+depth,layer);        
-               
-               // Signal that a layer has been inserted
-               if(get_canvas_interface())
-                       get_canvas_interface()->signal_layer_inserted()(layer,depth);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layerremove.h b/synfig-studio/trunk/src/sinfgapp/actions/layerremove.h
deleted file mode 100644 (file)
index fb12d51..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file action_layerremove.h
-**     \brief Template File
-**
-**     $Id: layerremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERREMOVE_H
-#define __SINFG_APP_ACTION_LAYERREMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class LayerRemove :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       std::list<std::pair<sinfg::Layer::Handle,int> > layer_list;
-       
-       //sinfg::Layer::Handle layer;
-       //int depth;
-
-public:
-
-       LayerRemove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layersetdesc.cpp b/synfig-studio/trunk/src/sinfgapp/actions/layersetdesc.cpp
deleted file mode 100644 (file)
index 717c3b5..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layersetdesc.cpp
-**     \brief Template File
-**
-**     $Id: layersetdesc.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layersetdesc.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::LayerSetDesc);
-ACTION_SET_NAME(Action::LayerSetDesc,"layer_set_desc");
-ACTION_SET_LOCAL_NAME(Action::LayerSetDesc,_("Set Layer Description"));
-ACTION_SET_TASK(Action::LayerSetDesc,"set_desc");
-ACTION_SET_CATEGORY(Action::LayerSetDesc,Action::CATEGORY_LAYER);
-ACTION_SET_PRIORITY(Action::LayerSetDesc,0);
-ACTION_SET_VERSION(Action::LayerSetDesc,"0.0");
-ACTION_SET_CVS_ID(Action::LayerSetDesc,"$Id: layersetdesc.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-static const int nindex=-1;
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::LayerSetDesc::LayerSetDesc()
-{
-}
-
-Action::ParamVocab
-Action::LayerSetDesc::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
-               .set_local_name(_("Layer"))
-               .set_desc(_("Layer to be moved"))
-       );
-
-       ret.push_back(ParamDesc("new_description",Param::TYPE_STRING)
-               .set_local_name(_("New Description"))
-               .set_local_name(_("Enter a new description for this layer"))
-               .set_user_supplied()
-       );
-       
-       return ret;
-}
-
-bool
-Action::LayerSetDesc::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::LayerSetDesc::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               layer=param.get_layer();
-               
-               return true;
-       }
-
-       if(name=="new_description" && param.get_type()==Param::TYPE_STRING)
-       {
-               new_description=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::LayerSetDesc::is_ready()const
-{
-       if(!layer)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::LayerSetDesc::perform()
-{
-       old_description=layer->get_description();
-       layer->set_description(new_description);
-       set_dirty(false);
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_new_description()(layer,new_description);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::LayerSetDesc::undo()
-{
-       layer->set_description(old_description);
-       set_dirty(false);
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_layer_new_description()(layer,old_description);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/layersetdesc.h b/synfig-studio/trunk/src/sinfgapp/actions/layersetdesc.h
deleted file mode 100644 (file)
index d4c011c..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file layersetdesc.h
-**     \brief Template File
-**
-**     $Id: layersetdesc.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_LAYERSETDSEC_H
-#define __SINFG_APP_ACTION_LAYERSETDSEC_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class LayerSetDesc :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Layer::Handle layer;
-       sinfg::String old_description;
-       sinfg::String new_description;
-
-public:
-
-       LayerSetDesc();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/timepointscopy.cpp b/synfig-studio/trunk/src/sinfgapp/actions/timepointscopy.cpp
deleted file mode 100644 (file)
index 9a868a6..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timepointscopy.cpp
-**     \brief Copy the Time Points File
-**
-**     $Id: timepointscopy.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "timepointscopy.h"
-#include <sinfg/layer_pastecanvas.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_animated.h>
-
-#include "activepointsimpleadd.h"
-#include "waypointsimpleadd.h"
-#include <sinfgapp/timegather.h>
-
-#include <typeinfo>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::TimepointsCopy);
-ACTION_SET_NAME(Action::TimepointsCopy,"timepoint_copy");
-ACTION_SET_LOCAL_NAME(Action::TimepointsCopy,"Copy Time Points");
-ACTION_SET_TASK(Action::TimepointsCopy,"copy");
-ACTION_SET_CATEGORY(Action::TimepointsCopy,Action::CATEGORY_WAYPOINT|Action::CATEGORY_ACTIVEPOINT);
-ACTION_SET_PRIORITY(Action::TimepointsCopy,0);
-ACTION_SET_VERSION(Action::TimepointsCopy,"0.0");
-ACTION_SET_CVS_ID(Action::TimepointsCopy,"$Id: timepointscopy.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::TimepointsCopy::TimepointsCopy()
-{
-       timedelta = 0;
-       set_dirty(false);
-}
-
-Action::ParamVocab
-Action::TimepointsCopy::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("addlayer",Param::TYPE_VALUE)
-               .set_local_name(_("New Selected Layer"))
-               .set_desc(_("A layer to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addcanvas",Param::TYPE_CANVAS)
-               .set_local_name(_("New Selected Canvas"))
-               .set_desc(_("A canvas to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addvaluedesc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("New Selected ValueBase"))
-               .set_desc(_("A valuenode's description to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addtime",Param::TYPE_TIME)
-               .set_local_name(_("New Selected Time Point"))
-               .set_desc(_("A time point to add to our selected list"))
-               .set_supports_multiple()
-       );
-       
-       ret.push_back(ParamDesc("deltatime",Param::TYPE_TIME)
-               .set_local_name(_("Time adjustment"))
-               .set_desc(_("The amount of time to adjust all the selected points"))
-       );
-
-       return ret;
-}
-
-bool
-Action::TimepointsCopy::is_canidate(const ParamList &x)
-{
-       if(!canidate_check(get_param_vocab(),x)) 
-               return false;
-       
-       if(     x.find("addlayer") == x.end() && 
-               x.find("addcanvas") == x.end() && 
-               x.find("addvaluedesc") == x.end())
-               return false;
-       return true;
-}
-
-bool
-Action::TimepointsCopy::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="addlayer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               //add a layer to the list
-               sel_layers.push_back(param.get_layer());
-               //sinfg::info("action got layer");
-               
-               return true;
-       }
-       
-       if(name=="addcanvas" && param.get_type()==Param::TYPE_CANVAS)
-       {
-               //add a layer to the list
-               sel_canvases.push_back(param.get_canvas());
-               //sinfg::info("action got canvas");
-               
-               return true;
-       }
-       
-       if(name=="addvaluedesc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               //add a layer to the list
-               sel_values.push_back(param.get_value_desc());
-               //sinfg::info("action got valuedesc");
-               
-               return true;
-       }
-       
-       if(name=="addtime" && param.get_type()==Param::TYPE_TIME)
-       {
-               //add a layer to the list
-               sel_times.insert(param.get_time());
-               //sinfg::info("action got time");
-               
-               return true;
-       }
-       
-       if(name=="deltatime" && param.get_type()==Param::TYPE_TIME)
-       {
-               timedelta = param.get_time();
-               //sinfg::info("action got time to move");
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::TimepointsCopy::is_ready()const
-{
-       if((sel_layers.empty() && sel_canvases.empty() && sel_values.empty()) || sel_times.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::TimepointsCopy::prepare()
-{
-       clear();
-       
-       //sinfg::info("Preparing TimepointsCopy by %f secs",(float)timemove);
-       
-       if(sel_times.empty()) return;
-       
-       //all our lists should be set correctly...
-
-       //build our sub-action list
-       //      and yes we do need to store it temporarily so we don't duplicate 
-       //              an operation on a specific valuenode, etc....
-       timepoints_ref  match;
-       
-       Time fps = get_canvas()->rend_desc().get_frame_rate();
-       
-       //std::vector<sinfg::Layer::Handle>
-       //sinfg::info("Layers %d", sel_layers.size());
-       {
-               std::vector<sinfg::Layer::Handle>::iterator i = sel_layers.begin(),
-                                                                                                       end = sel_layers.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a layer");
-                       recurse_layer(*i,sel_times,match);
-               }
-       }
-       
-       //std::vector<sinfg::Canvas::Handle>    sel_canvases;
-       //sinfg::info("Canvases %d", sel_canvases.size());
-       {
-               std::vector<sinfg::Canvas::Handle>::iterator    i = sel_canvases.begin(),
-                                                                                                               end = sel_canvases.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a canvas");
-                       recurse_canvas(*i,sel_times,match);
-               }
-       }
-       
-       //std::vector<sinfgapp::ValueDesc>
-       //sinfg::info("ValueBasedescs %d", sel_values.size());
-       {
-               std::vector<sinfgapp::ValueDesc>::iterator      i = sel_values.begin(),
-                                                                                                       end = sel_values.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a valuedesc");
-                       recurse_valuedesc(*i,sel_times,match);
-               }
-       }
-       
-       //sinfg::info("built list of waypoints/activepoints to modify");
-       //sinfg::info("\t There are %d waypoint sets and %d activepointsets", 
-       //                              match.waypointbiglist.size(), match.actpointbiglist.size());
-       //process the hell out of em...
-       {
-               //must build from both lists
-               timepoints_ref::waytracker::const_iterator      i = match.waypointbiglist.begin(),
-                                                                                                       end = match.waypointbiglist.end();
-               for(; i != end; ++i)
-               {
-                       //iterate through each waypoint for this specific valuenode
-                       std::set<sinfg::Waypoint>::const_iterator       j = i->waypoints.begin(),
-                                                                                                               end = i->waypoints.end();                       
-                       for(; j != end; ++j)
-                       {
-                               Action::Handle action(WaypointSimpleAdd::create());
-               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_node",ValueNode::Handle(i->val));
-                               
-                               //sinfg::info("add waypoint mod...");
-                               //NOTE: We may want to store the old time for undoing the action...
-                               Waypoint neww;
-                               Waypoint w = *j;
-                               w.set_time((w.get_time() + timedelta).round(fps));
-                               w.mimic(neww); //make sure the new waypoint has a new id
-                               
-                               action->set_param("waypoint",w);
-                               
-                               //run the action now that we've added everything
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                               
-                               add_action_front(action);
-                       }
-               }
-       }
-       {
-               //must build from both lists
-               timepoints_ref::acttracker::const_iterator      i = match.actpointbiglist.begin(),
-                                                                                                       end = match.actpointbiglist.end();
-               for(; i != end; ++i)
-               {
-                       //iterate through each activepoint for this specific valuenode
-                       std::set<sinfg::Activepoint>::const_iterator    j = i->activepoints.begin(),
-                                                                                                                       jend = i->activepoints.end();
-                       for(; j != jend; ++j)
-                       {
-                               Action::Handle action(ActivepointSimpleAdd::create());
-                                       
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_desc",i->val);
-                               
-                               //NOTE: We may want to store the old time for undoing the action...
-                               Activepoint newa;
-                               Activepoint a = *j;
-                               a.set_time((a.get_time() + timedelta).round(fps));
-                               a.mimic(newa); //make sure the new activepoint has a new id
-                               
-                               action->set_param("activepoint",a);
-                               
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                               {
-                                       throw Error(Error::TYPE_NOTREADY);
-                               }
-                       
-                               add_action_front(action);
-                       }
-               }
-       }
-}
-
-void
-Action::TimepointsCopy::perform()
-{
-       Action::Super::perform();
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/timepointscopy.h b/synfig-studio/trunk/src/sinfgapp/actions/timepointscopy.h
deleted file mode 100644 (file)
index 4ee4026..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timepointscopy.h
-**     \brief Copy the Time Points Header
-**
-**     $Id: timepointscopy.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_TIMEPOINTSCOPY_H
-#define __SINFG_APP_ACTION_TIMEPOINTSCOPY_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/time.h>
-#include <sinfg/layer.h>
-#include <sinfg/canvas.h>
-#include <sinfgapp/value_desc.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class TimepointsCopy :
-       public Super
-{
-private:
-       
-       //process all the value descriptions that are selected (or are in subselections)
-       std::vector<sinfg::Layer::Handle>       sel_layers;
-       std::vector<sinfg::Canvas::Handle>      sel_canvases;
-       std::vector<sinfgapp::ValueDesc>        sel_values;
-       std::set<sinfg::Time>                           sel_times;
-       
-       sinfg::Time                                                     timedelta;
-
-public:
-
-       TimepointsCopy();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-       virtual void perform();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/timepointsdelete.cpp b/synfig-studio/trunk/src/sinfgapp/actions/timepointsdelete.cpp
deleted file mode 100644 (file)
index 6d88419..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timepointsdelete.cpp
-**     \brief Delete the Time Points File
-**
-**     $Id: timepointsdelete.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "timepointsdelete.h"
-#include <sinfg/layer_pastecanvas.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_animated.h>
-
-#include "activepointremove.h"
-#include "waypointremove.h"
-#include <sinfgapp/timegather.h>
-
-#include <typeinfo>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::TimepointsDelete);
-ACTION_SET_NAME(Action::TimepointsDelete,"timepoint_delete");
-ACTION_SET_LOCAL_NAME(Action::TimepointsDelete,"Delete Time Points");
-ACTION_SET_TASK(Action::TimepointsDelete,"delete");
-ACTION_SET_CATEGORY(Action::TimepointsDelete,Action::CATEGORY_WAYPOINT|Action::CATEGORY_ACTIVEPOINT);
-ACTION_SET_PRIORITY(Action::TimepointsDelete,0);
-ACTION_SET_VERSION(Action::TimepointsDelete,"0.0");
-ACTION_SET_CVS_ID(Action::TimepointsDelete,"$Id: timepointsdelete.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::TimepointsDelete::TimepointsDelete()
-{
-       set_dirty(false);
-}
-
-Action::ParamVocab
-Action::TimepointsDelete::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("addlayer",Param::TYPE_VALUE)
-               .set_local_name(_("New Selected Layer"))
-               .set_desc(_("A layer to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addcanvas",Param::TYPE_CANVAS)
-               .set_local_name(_("New Selected Canvas"))
-               .set_desc(_("A canvas to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addvaluedesc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("New Selected ValueBase"))
-               .set_desc(_("A valuenode's description to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addtime",Param::TYPE_TIME)
-               .set_local_name(_("New Selected Time Point"))
-               .set_desc(_("A time point to add to our selected list"))
-               .set_supports_multiple()
-       );
-       
-       return ret;
-}
-
-bool
-Action::TimepointsDelete::is_canidate(const ParamList &x)
-{
-       if(!canidate_check(get_param_vocab(),x)) 
-               return false;
-       
-       if(     x.find("addlayer") == x.end() && 
-               x.find("addcanvas") == x.end() && 
-               x.find("addvaluedesc") == x.end())
-               return false;
-       return true;
-}
-
-bool
-Action::TimepointsDelete::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="addlayer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               //add a layer to the list
-               sel_layers.push_back(param.get_layer());
-               
-               return true;
-       }
-       
-       if(name=="addcanvas" && param.get_type()==Param::TYPE_CANVAS)
-       {
-               //add a layer to the list
-               sel_canvases.push_back(param.get_canvas());
-               
-               return true;
-       }
-       
-       if(name=="addvaluedesc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               //add a layer to the list
-               sel_values.push_back(param.get_value_desc());
-               
-               return true;
-       }
-       
-       if(name=="addtime" && param.get_type()==Param::TYPE_TIME)
-       {
-               //add a layer to the list
-               sel_times.insert(param.get_time());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::TimepointsDelete::is_ready()const
-{
-       if((sel_layers.empty() && sel_canvases.empty() && sel_values.empty()) || sel_times.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::TimepointsDelete::prepare()
-{
-       clear();
-       
-       if(sel_times.empty()) return;
-       
-       //all our lists should be set correctly...
-
-       //build our sub-action list
-       //      and yes we do need to store it temporarily so we don't duplicate 
-       //              an operation on a specific valuenode, etc....
-       timepoints_ref  match;
-       
-       Time fps = get_canvas()->rend_desc().get_frame_rate();
-       
-       //std::vector<sinfg::Layer::Handle>
-       //sinfg::info("Layers %d", sel_layers.size());
-       {
-               std::vector<sinfg::Layer::Handle>::iterator i = sel_layers.begin(),
-                                                                                                       end = sel_layers.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a layer");
-                       recurse_layer(*i,sel_times,match);
-               }
-       }
-       
-       //std::vector<sinfg::Canvas::Handle>    sel_canvases;
-       //sinfg::info("Canvases %d", sel_canvases.size());
-       {
-               std::vector<sinfg::Canvas::Handle>::iterator    i = sel_canvases.begin(),
-                                                                                                               end = sel_canvases.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a canvas");
-                       recurse_canvas(*i,sel_times,match);
-               }
-       }
-       
-       //std::vector<sinfgapp::ValueDesc>
-       //sinfg::info("ValueBasedescs %d", sel_values.size());
-       {
-               std::vector<sinfgapp::ValueDesc>::iterator      i = sel_values.begin(),
-                                                                                                       end = sel_values.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a valuedesc");
-                       recurse_valuedesc(*i,sel_times,match);
-               }
-       }
-       
-       //process the hell out of em...
-       {
-               //must build from both lists
-               timepoints_ref::waytracker::const_iterator      i = match.waypointbiglist.begin(),
-                                                                                                       end = match.waypointbiglist.end();
-               for(; i != end; ++i)
-               {
-                       //iterate through each waypoint for this specific valuenode
-                       std::set<sinfg::Waypoint>::const_iterator       j = i->waypoints.begin(),
-                                                                                                               end = i->waypoints.end();                       
-                       for(; j != end; ++j)
-                       {
-                               Action::Handle action(WaypointRemove::create());
-               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_node",ValueNode::Handle(i->val));
-                               action->set_param("waypoint",*j);
-                               
-                               //run the action now that we've added everything
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                               
-                               add_action_front(action);
-                       }
-               }
-       }
-       {
-               //must build from both lists
-               timepoints_ref::acttracker::const_iterator      i = match.actpointbiglist.begin(),
-                                                                                                       end = match.actpointbiglist.end();
-               for(; i != end; ++i)
-               {
-                       //iterate through each activepoint for this specific valuenode
-                       std::set<sinfg::Activepoint>::const_iterator    j = i->activepoints.begin(),
-                                                                                                                       jend = i->activepoints.end();
-                       for(; j != jend; ++j)
-                       {
-                               Action::Handle action(ActivepointRemove::create());
-                                       
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_desc",i->val);
-                               action->set_param("activepoint",*j);
-                               
-                               //run the action now that everything should be in order
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                               {
-                                       throw Error(Error::TYPE_NOTREADY);
-                               }
-                       
-                               add_action_front(action);
-                       }
-               }
-       }
-}
-
-void
-Action::TimepointsDelete::perform()
-{
-       Action::Super::perform();
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/timepointsdelete.h b/synfig-studio/trunk/src/sinfgapp/actions/timepointsdelete.h
deleted file mode 100644 (file)
index e6d1cce..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timepointsdelete.h
-**     \brief Delete the Time Points Header
-**
-**     $Id: timepointsdelete.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_TIMEPOINTSDELETE_H
-#define __SINFG_APP_ACTION_TIMEPOINTSDELETE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/time.h>
-#include <sinfg/layer.h>
-#include <sinfg/canvas.h>
-#include <sinfgapp/value_desc.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class TimepointsDelete :
-       public Super
-{
-private:
-       
-       //process all the value descriptions that are selected (or are in subselections)
-       std::vector<sinfg::Layer::Handle>       sel_layers;
-       std::vector<sinfg::Canvas::Handle>      sel_canvases;
-       std::vector<sinfgapp::ValueDesc>        sel_values;
-       std::set<sinfg::Time>                           sel_times;
-
-public:
-
-       TimepointsDelete();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-       virtual void perform();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/timepointsmove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/timepointsmove.cpp
deleted file mode 100644 (file)
index 27ae969..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timepointsmove.cpp
-**     \brief Move the Time Points File
-**
-**     $Id: timepointsmove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "timepointsmove.h"
-#include <sinfg/layer_pastecanvas.h>
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_animated.h>
-
-#include "activepointset.h"
-#include "waypointset.h"
-#include <sinfgapp/timegather.h>
-
-#include <typeinfo>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::TimepointsMove);
-ACTION_SET_NAME(Action::TimepointsMove,"timepoint_move");
-ACTION_SET_LOCAL_NAME(Action::TimepointsMove,"Move Time Points");
-ACTION_SET_TASK(Action::TimepointsMove,"move");
-ACTION_SET_CATEGORY(Action::TimepointsMove,Action::CATEGORY_WAYPOINT|Action::CATEGORY_ACTIVEPOINT);
-ACTION_SET_PRIORITY(Action::TimepointsMove,0);
-ACTION_SET_VERSION(Action::TimepointsMove,"0.0");
-ACTION_SET_CVS_ID(Action::TimepointsMove,"$Id: timepointsmove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::TimepointsMove::TimepointsMove()
-{
-       timemove = 0;
-       set_dirty(false);
-}
-
-Action::ParamVocab
-Action::TimepointsMove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("addlayer",Param::TYPE_VALUE)
-               .set_local_name(_("New Selected Layer"))
-               .set_desc(_("A layer to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addcanvas",Param::TYPE_CANVAS)
-               .set_local_name(_("New Selected Canvas"))
-               .set_desc(_("A canvas to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addvaluedesc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("New Selected ValueBase"))
-               .set_desc(_("A valuenode's description to add to our selected list"))
-               .set_supports_multiple()
-               .set_optional()
-       );
-       
-       ret.push_back(ParamDesc("addtime",Param::TYPE_TIME)
-               .set_local_name(_("New Selected Time Point"))
-               .set_desc(_("A time point to add to our selected list"))
-               .set_supports_multiple()
-       );
-       
-       ret.push_back(ParamDesc("deltatime",Param::TYPE_TIME)
-               .set_local_name(_("Time adjustment"))
-               .set_desc(_("The amount of time to adjust all the selected points"))
-       );
-
-       return ret;
-}
-
-bool
-Action::TimepointsMove::is_canidate(const ParamList &x)
-{
-       if(!canidate_check(get_param_vocab(),x)) 
-               return false;
-       
-       if(     x.find("addlayer") == x.end() && 
-               x.find("addcanvas") == x.end() && 
-               x.find("addvaluedesc") == x.end())
-               return false;
-       return true;
-}
-
-bool
-Action::TimepointsMove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="addlayer" && param.get_type()==Param::TYPE_LAYER)
-       {
-               //add a layer to the list
-               sel_layers.push_back(param.get_layer());
-               //sinfg::info("action got layer");
-               
-               return true;
-       }
-       
-       if(name=="addcanvas" && param.get_type()==Param::TYPE_CANVAS)
-       {
-               //add a layer to the list
-               sel_canvases.push_back(param.get_canvas());
-               //sinfg::info("action got canvas");
-               
-               return true;
-       }
-       
-       if(name=="addvaluedesc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               //add a layer to the list
-               sel_values.push_back(param.get_value_desc());
-               //sinfg::info("action got valuedesc");
-               
-               return true;
-       }
-       
-       if(name=="addtime" && param.get_type()==Param::TYPE_TIME)
-       {
-               //add a layer to the list
-               sel_times.insert(param.get_time());
-               //sinfg::info("action got time");
-               
-               return true;
-       }
-       
-       if(name=="deltatime" && param.get_type()==Param::TYPE_TIME)
-       {
-               timemove = param.get_time();
-               //sinfg::info("action got time to move");
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::TimepointsMove::is_ready()const
-{
-       if((sel_layers.empty() && sel_canvases.empty() && sel_values.empty()) || sel_times.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::TimepointsMove::prepare()
-{
-       clear();
-       
-       //sinfg::info("Preparing TimepointsMove by %f secs",(float)timemove);
-       
-       if(sel_times.empty()) return;
-       
-       //all our lists should be set correctly...
-       
-       /*{
-               std::set<sinfg::Time>::iterator i = sel_times.begin(), end = sel_times.end();
-               
-               for(; i != end; ++i)
-               {
-                       sinfg::info("Time %f", (float)*i);
-               }               
-       }*/
-
-       //build our sub-action list
-       //      and yes we do need to store it temporarily so we don't duplicate 
-       //              an operation on a specific valuenode, etc....
-       timepoints_ref  match;
-       
-       Time fps = get_canvas()->rend_desc().get_frame_rate();
-       
-       //std::vector<sinfg::Layer::Handle>
-       //sinfg::info("Layers %d", sel_layers.size());
-       {
-               std::vector<sinfg::Layer::Handle>::iterator i = sel_layers.begin(),
-                                                                                                       end = sel_layers.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a layer");
-                       recurse_layer(*i,sel_times,match);
-               }
-       }
-       
-       //std::vector<sinfg::Canvas::Handle>    sel_canvases;
-       //sinfg::info("Canvases %d", sel_canvases.size());
-       {
-               std::vector<sinfg::Canvas::Handle>::iterator    i = sel_canvases.begin(),
-                                                                                                               end = sel_canvases.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a canvas");
-                       recurse_canvas(*i,sel_times,match);
-               }
-       }
-       
-       //std::vector<sinfgapp::ValueDesc>
-       //sinfg::info("ValueBasedescs %d", sel_values.size());
-       {
-               std::vector<sinfgapp::ValueDesc>::iterator      i = sel_values.begin(),
-                                                                                                       end = sel_values.end();
-               
-               for(; i != end; ++i)
-               {
-                       //sinfg::info("Recurse through a valuedesc");
-                       recurse_valuedesc(*i,sel_times,match);
-               }
-       }
-       
-       //sinfg::info("built list of waypoints/activepoints to modify");
-       //sinfg::info("\t There are %d waypoint sets and %d activepointsets", 
-       //                              match.waypointbiglist.size(), match.actpointbiglist.size());
-       //process the hell out of em...
-       {
-               //must build from both lists
-               timepoints_ref::waytracker::const_iterator      i = match.waypointbiglist.begin(),
-                                                                                                       end = match.waypointbiglist.end();
-               for(; i != end; ++i)
-               {
-                       Action::Handle action(WaypointSet::create());
-               
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("value_node",ValueNode::Handle(i->val));
-                       
-                       //iterate through each waypoint for this specific valuenode
-                       std::set<sinfg::Waypoint>::const_iterator       j = i->waypoints.begin(),
-                                                                                                               end = i->waypoints.end();                       
-                       for(; j != end; ++j)
-                       {                               
-                               //sinfg::info("add waypoint mod...");
-                               //NOTE: We may want to store the old time for undoing the action...
-                               Waypoint w = *j;
-                               w.set_time((w.get_time() + timemove).round(fps));
-                               action->set_param("waypoint",w);
-                       }
-                       
-                       //run the action now that we've added everything
-                       assert(action->is_ready());
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-                       
-                       add_action_front(action);
-               }
-       }
-       {
-               //must build from both lists
-               timepoints_ref::acttracker::const_iterator      i = match.actpointbiglist.begin(),
-                                                                                                       end = match.actpointbiglist.end();
-               for(; i != end; ++i)
-               {
-                       Action::Handle action(ActivepointSet::create());
-                                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("value_desc",i->val);
-                       
-                       //iterate through each activepoint for this specific valuenode
-                       std::set<sinfg::Activepoint>::const_iterator    j = i->activepoints.begin(),
-                                                                                                                       jend = i->activepoints.end();
-                       for(; j != jend; ++j)
-                       {
-                               //sinfg::info("add activepoint mod...");
-                               
-                               //NOTE: We may want to store the old time for undoing the action...
-                               Activepoint a = *j;
-                               a.set_time((a.get_time() + timemove).round(fps));
-                               action->set_param("activepoint",a);
-                       }
-                       
-                       assert(action->is_ready());
-                       if(!action->is_ready())
-                       {
-                               throw Error(Error::TYPE_NOTREADY);
-                       }
-               
-                       add_action_front(action);
-               }
-       }
-}
-
-void
-Action::TimepointsMove::perform()
-{
-       Action::Super::perform();
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/timepointsmove.h b/synfig-studio/trunk/src/sinfgapp/actions/timepointsmove.h
deleted file mode 100644 (file)
index 90d1468..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timepointsmove.h
-**     \brief Move the Time Points Header
-**
-**     $Id: timepointsmove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_TIMEPOINTSMOVE_H
-#define __SINFG_APP_ACTION_TIMEPOINTSMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/time.h>
-#include <sinfg/layer.h>
-#include <sinfg/canvas.h>
-#include <sinfgapp/value_desc.h>
-
-#include <vector>
-#include <set>
-
-/* === 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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class TimepointsMove :
-       public Super
-{
-private:
-       
-       //process all the value descriptions that are selected (or are in subselections)
-       std::vector<sinfg::Layer::Handle>       sel_layers;
-       std::vector<sinfg::Canvas::Handle>      sel_canvases;
-       std::vector<sinfgapp::ValueDesc>        sel_values;
-       std::set<sinfg::Time>                           sel_times;
-       
-       sinfg::Time                                                     timemove;
-
-public:
-
-       TimepointsMove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-       virtual void perform();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescconnect.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuedescconnect.cpp
deleted file mode 100644 (file)
index b11b1d5..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescconnect.cpp
-**     \brief Template File
-**
-**     $Id: valuedescconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerparamconnect.h"
-#include "valuenodelinkconnect.h"
-#include "valuenodereplace.h"
-
-#include "valuedescconnect.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueDescConnect);
-ACTION_SET_NAME(Action::ValueDescConnect,"value_desc_connect");
-ACTION_SET_LOCAL_NAME(Action::ValueDescConnect,"Connect");
-ACTION_SET_TASK(Action::ValueDescConnect,"connect");
-ACTION_SET_CATEGORY(Action::ValueDescConnect,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueDescConnect,0);
-ACTION_SET_VERSION(Action::ValueDescConnect,"0.0");
-ACTION_SET_CVS_ID(Action::ValueDescConnect,"$Id: valuedescconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueDescConnect::ValueDescConnect()
-{
-}
-
-Action::ParamVocab
-Action::ValueDescConnect::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("dest",Param::TYPE_VALUEDESC)
-               .set_local_name(_("Destination ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("src",Param::TYPE_VALUENODE)
-               .set_local_name(_("Source ValueNode"))
-               .set_mutual_exclusion("src_name")
-       );
-
-       ret.push_back(ParamDesc("src_name",Param::TYPE_STRING)
-               .set_local_name(_("Source ValueNode Name"))
-               .set_mutual_exclusion("src")
-               .set_user_supplied()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueDescConnect::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               if(x.count("src"))
-               {
-                       ValueDesc value_desc=x.find("dest")->second.get_value_desc();
-                       ValueNode::Handle value_node=x.find("src")->second.get_value_node();
-                       if(value_desc.get_value_type()==value_node->get_type()) 
-                               return true;
-               }
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueDescConnect::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="dest" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               value_desc=param.get_value_desc();
-               
-               return true;
-       }
-
-       if(name=="src" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=param.get_value_node();
-               
-               return true;
-       }
-
-       if(!value_node_name.empty() && !value_node && name=="canvas" && param.get_type()==Param::TYPE_CANVAS)
-       {
-               value_node=param.get_canvas()->find_value_node(value_node_name);
-       }
-       
-       if(name=="src_name" && param.get_type()==Param::TYPE_STRING)
-       {
-               value_node_name=param.get_string();
-               
-               if(get_canvas())
-               {
-                       value_node=get_canvas()->find_value_node(value_node_name);
-                       if(!value_node)
-                               return false;
-               }
-               
-               return true;
-       }
-       
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueDescConnect::is_ready()const
-{
-       if(!value_desc || !value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueDescConnect::prepare()
-{
-       clear();
-
-       if(value_desc.parent_is_canvas())
-       {                               
-               ValueNode::Handle dest_value_node;
-               dest_value_node=value_desc.get_value_node();
-
-               Action::Handle action(ValueNodeReplace::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("src",value_node);
-               action->set_param("dest",value_desc.get_value_node());
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       else
-       if(value_desc.parent_is_linkable_value_node())
-       {
-               Action::Handle action(ValueNodeLinkConnect::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("parent_value_node",value_desc.get_parent_value_node());
-               action->set_param("value_node", value_node);
-               action->set_param("index",value_desc.get_index());
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       else
-       if(value_desc.parent_is_layer_param())
-       {
-               Action::Handle action(LayerParamConnect::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("layer",value_desc.get_layer());
-               action->set_param("param",value_desc.get_param_name());
-               action->set_param("value_node",value_node);
-       
-               assert(action->is_ready());             
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       
-       throw Error(_("ValueDesc is not recognised or supported."));    
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescconnect.h b/synfig-studio/trunk/src/sinfgapp/actions/valuedescconnect.h
deleted file mode 100644 (file)
index c05e38d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescconnect.h
-**     \brief Template File
-**
-**     $Id: valuedescconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUEDESCCONNECT_H
-#define __SINFG_APP_ACTION_VALUEDESCCONNECT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.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 sinfgapp {
-
-namespace Action {
-
-class ValueDescConnect :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::ValueNode::Handle value_node;
-       sinfg::String value_node_name;
-
-public:
-
-       ValueDescConnect();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescconvert.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuedescconvert.cpp
deleted file mode 100644 (file)
index 5163bb5..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescconvert.cpp
-**     \brief Template File
-**
-**     $Id: valuedescconvert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodereplace.h"
-#include "layerparamconnect.h"
-#include "valuenodelinkconnect.h"
-*/
-
-#include "valuedescconnect.h"
-
-#include "valuedescconvert.h"
-
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_const.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueDescConvert);
-ACTION_SET_NAME(Action::ValueDescConvert,"value_desc_convert");
-ACTION_SET_LOCAL_NAME(Action::ValueDescConvert,"Convert");
-ACTION_SET_TASK(Action::ValueDescConvert,"convert");
-ACTION_SET_CATEGORY(Action::ValueDescConvert,Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ValueDescConvert,0);
-ACTION_SET_VERSION(Action::ValueDescConvert,"0.0");
-ACTION_SET_CVS_ID(Action::ValueDescConvert,"$Id: valuedescconvert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueDescConvert::ValueDescConvert()
-{
-}
-
-Action::ParamVocab
-Action::ValueDescConvert::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("type",Param::TYPE_STRING)
-               .set_local_name(_("Type"))
-               .set_desc(_("The type of ValueNode that you want to be converted to"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueDescConvert::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::ValueDescConvert::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               value_desc=param.get_value_desc();
-               
-               return true;
-       }
-
-       if(name=="type" && param.get_type()==Param::TYPE_STRING)
-       {
-               type=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueDescConvert::is_ready()const
-{
-       if(!value_desc || type.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueDescConvert::prepare()
-{
-       clear();
-
-       ValueBase value;
-       
-       if(value_desc.is_const())
-               value=value_desc.get_value();
-       else if(value_desc.is_value_node())
-               value=(*value_desc.get_value_node())(0);
-       else
-               throw Error(_("Unable to decipher ValueDesc (Bug?)"));
-       
-       ValueNode::Handle src_value_node(LinkableValueNode::create(type,value));
-
-       if(!src_value_node)
-               throw Error(_("Unable to create new value node"));
-
-       
-       ValueNode::Handle dest_value_node;
-       dest_value_node=value_desc.get_value_node();
-
-       Action::Handle action(ValueDescConnect::create());
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",get_canvas_interface());
-       action->set_param("src",src_value_node);
-       action->set_param("dest",value_desc);
-
-       assert(action->is_ready());
-       if(!action->is_ready())
-               throw Error(Error::TYPE_NOTREADY);
-
-       add_action_front(action);
-
-/*
-       return;         
-
-               
-       if(value_desc.parent_is_canvas())
-       {                               
-               ValueNode::Handle dest_value_node;
-               dest_value_node=value_desc.get_value_node();
-
-               Action::Handle action(ValueNodeReplace::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("src",src_value_node);
-               action->set_param("dest",dest_value_node);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       else
-       if(value_desc.parent_is_linkable_value_node())
-       {
-               Action::Handle action(ValueNodeLinkConnect::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("parent_value_node",value_desc.get_parent_value_node());
-               action->set_param("value_node", src_value_node);
-               action->set_param("index",value_desc.get_index());
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       else
-       if(value_desc.parent_is_layer_param())
-       {
-               Action::Handle action(LayerParamConnect::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("layer",value_desc.get_layer());
-               action->set_param("param",value_desc.get_param_name());
-               action->set_param("value_node",src_value_node);
-       
-               assert(action->is_ready());             
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       
-       
-       
-       throw Error(_("ValueDesc is not recognised or supported."));    
-*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescconvert.h b/synfig-studio/trunk/src/sinfgapp/actions/valuedescconvert.h
deleted file mode 100644 (file)
index bc18a3c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescconvert.h
-**     \brief Template File
-**
-**     $Id: valuedescconvert.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUEDESCCONVERT_H
-#define __SINFG_APP_ACTION_VALUEDESCCONVERT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.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 sinfgapp {
-
-namespace Action {
-
-class ValueDescConvert :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::String type;
-
-public:
-
-       ValueDescConvert();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescdisconnect.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuedescdisconnect.cpp
deleted file mode 100644 (file)
index 6227ed6..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescdisconnect.cpp
-**     \brief Template File
-**
-**     $Id: valuedescdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerparamdisconnect.h"
-#include "valuenodelinkdisconnect.h"
-#include "valuenodereplace.h"
-
-#include "valuedescdisconnect.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_const.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueDescDisconnect);
-ACTION_SET_NAME(Action::ValueDescDisconnect,"value_desc_disconnect");
-ACTION_SET_LOCAL_NAME(Action::ValueDescDisconnect,"Disconnect");
-ACTION_SET_TASK(Action::ValueDescDisconnect,"disconnect");
-ACTION_SET_CATEGORY(Action::ValueDescDisconnect,Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ValueDescDisconnect,-100);
-ACTION_SET_VERSION(Action::ValueDescDisconnect,"0.0");
-ACTION_SET_CVS_ID(Action::ValueDescDisconnect,"$Id: valuedescdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueDescDisconnect::ValueDescDisconnect():
-       time(0)
-{
-}
-
-Action::ParamVocab
-Action::ValueDescDisconnect::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueDescDisconnect::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_canvas() && value_desc.is_value_node() && value_desc.get_value_node()->rcount()>1)
-                       return true;
-               if(value_desc.is_const())
-                       return false;
-               if(value_desc.is_value_node() && ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
-                       return false;
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueDescDisconnect::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               value_desc=param.get_value_desc();
-               
-               return true;
-       }
-
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueDescDisconnect::is_ready()const
-{
-       if(!value_desc)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueDescDisconnect::prepare()
-{
-       clear();
-
-       if(value_desc.parent_is_canvas())
-       {                               
-               ValueNode::Handle src_value_node;
-               src_value_node=ValueNode_Const::create((*value_desc.get_value_node())(time));
-
-               Action::Handle action(ValueNodeReplace::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("src",src_value_node);
-               action->set_param("dest",value_desc.get_value_node());
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       else
-       if(value_desc.parent_is_linkable_value_node())
-       {
-               Action::Handle action(ValueNodeLinkDisconnect::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("parent_value_node",value_desc.get_parent_value_node());
-               action->set_param("index",value_desc.get_index());
-               action->set_param("time",time);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       else
-       if(value_desc.parent_is_layer_param())
-       {
-               Action::Handle action(LayerParamDisconnect::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("layer",value_desc.get_layer());
-               action->set_param("param",value_desc.get_param_name());
-               action->set_param("time",time);
-       
-               assert(action->is_ready());             
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-               return;         
-       }
-       
-       throw Error(_("ValueDesc is not recognised or supported."));    
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescdisconnect.h b/synfig-studio/trunk/src/sinfgapp/actions/valuedescdisconnect.h
deleted file mode 100644 (file)
index c388cc3..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescdisconnect.h
-**     \brief Template File
-**
-**     $Id: valuedescdisconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUEDESCDISCONNECT_H
-#define __SINFG_APP_ACTION_VALUEDESCDISCONNECT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.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 sinfgapp {
-
-namespace Action {
-
-class ValueDescDisconnect :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::Time time;
-
-public:
-
-       ValueDescDisconnect();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescexport.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuedescexport.cpp
deleted file mode 100644 (file)
index a5fc143..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescset.cpp
-**     \brief Template File
-**
-**     $Id: valuedescexport.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodeadd.h"
-
-#include "canvasadd.h"
-#include "valuedescexport.h"
-#include "layerparamconnect.h"
-
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_const.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueDescExport);
-ACTION_SET_NAME(Action::ValueDescExport,"value_desc_export");
-ACTION_SET_LOCAL_NAME(Action::ValueDescExport,"Export");
-ACTION_SET_TASK(Action::ValueDescExport,"export");
-ACTION_SET_CATEGORY(Action::ValueDescExport,Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ValueDescExport,0);
-ACTION_SET_VERSION(Action::ValueDescExport,"0.0");
-ACTION_SET_CVS_ID(Action::ValueDescExport,"$Id: valuedescexport.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueDescExport::ValueDescExport()
-{
-}
-
-Action::ParamVocab
-Action::ValueDescExport::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("name",Param::TYPE_STRING)
-               .set_local_name(_("Name"))
-               .set_desc(_("The name that you want this value to be exported as"))
-               .set_user_supplied()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueDescExport::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc=x.find("value_desc")->second.get_value_desc();
-               if(!value_desc || value_desc.parent_is_canvas() || (value_desc.is_value_node() && value_desc.get_value_node()->is_exported()))
-                       return false;
-               return true;
-       }
-       return false;           
-}
-
-bool
-Action::ValueDescExport::set_param(const sinfg::String& param_name, const Action::Param &param)
-{
-       if(param_name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               value_desc=param.get_value_desc();
-               
-               return true;
-       }
-
-       if(param_name=="name" && param.get_type()==Param::TYPE_STRING)
-       {
-               name=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(param_name,param);
-}
-
-bool
-Action::ValueDescExport::is_ready()const
-{
-       if(!value_desc || name.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueDescExport::prepare()
-{
-       clear();
-
-       ValueNode::Handle value_node;
-
-       if(value_desc.get_value_type()==ValueBase::TYPE_CANVAS)
-       {
-               if(!value_desc.is_const())
-                       throw Error(_("Can only export Canvas when used as constant parameter"));
-               Canvas::Handle canvas(value_desc.get_value().get(Canvas::Handle()));
-               
-               Action::Handle action(CanvasAdd::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("src",canvas);
-               action->set_param("id",name);
-       
-               assert(action->is_ready());             
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);               
-               
-               return;
-       }
-
-       
-       if(value_desc.is_value_node())
-       {
-               if(value_desc.get_value_node()->is_exported())
-                       throw Error(_("ValueBase is already exported"));
-
-               value_node=value_desc.get_value_node();
-       }
-       else
-       {
-               if(!value_desc.parent_is_layer_param())
-                       throw Error(_("Unable to export parameter. (Bug?)"));
-                       
-               value_node=ValueNode_Const::create(value_desc.get_value());
-               
-               Action::Handle action(LayerParamConnect::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("layer",value_desc.get_layer());
-               action->set_param("param",value_desc.get_param_name());
-               action->set_param("value_node",value_node);
-       
-               assert(action->is_ready());             
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);               
-       }
-       
-       Action::Handle action(ValueNodeAdd::create());
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",get_canvas_interface());
-       action->set_param("new",value_node);
-       action->set_param("name",name);
-
-       assert(action->is_ready());             
-       if(!action->is_ready())
-               throw Error(Error::TYPE_NOTREADY);
-
-       add_action_front(action);
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescexport.h b/synfig-studio/trunk/src/sinfgapp/actions/valuedescexport.h
deleted file mode 100644 (file)
index d367104..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescexport.h
-**     \brief Template File
-**
-**     $Id: valuedescexport.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUEDESCEXPORT_H
-#define __SINFG_APP_ACTION_VALUEDESCEXPORT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.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 sinfgapp {
-
-namespace Action {
-
-class ValueDescExport :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::String name;
-
-public:
-
-       ValueDescExport();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedesclink.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuedesclink.cpp
deleted file mode 100644 (file)
index 307d79f..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedesclink.cpp
-**     \brief Template File
-**
-**     $Id: valuedesclink.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuedesclink.h"
-
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_const.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueDescLink);
-ACTION_SET_NAME(Action::ValueDescLink,"value_desc_link");
-ACTION_SET_LOCAL_NAME(Action::ValueDescLink,"Link");
-ACTION_SET_TASK(Action::ValueDescLink,"connect");
-ACTION_SET_CATEGORY(Action::ValueDescLink,Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ValueDescLink,0);
-ACTION_SET_VERSION(Action::ValueDescLink,"0.0");
-ACTION_SET_CVS_ID(Action::ValueDescLink,"$Id: valuedesclink.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueDescLink::ValueDescLink()
-{
-       poison=false;
-}
-
-Action::ParamVocab
-Action::ValueDescLink::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc to link"))
-               .set_requires_multiple()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueDescLink::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::ValueDescLink::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               return true;
-       }
-       
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-                               
-               if(value_desc.is_value_node() && value_desc.get_value_node()->is_exported())
-               {
-                       if(link_value_node==value_desc.get_value_node())
-                               return true;
-                       
-                       if(link_value_node && link_value_node->is_exported())
-                       {
-                               poison=true;
-                               return false;
-                       }
-                                               
-                       link_value_node=value_desc.get_value_node();
-               }
-               else if(value_desc.is_value_node())
-               {
-                       if(!link_value_node)
-                       {
-                               link_value_node=value_desc.get_value_node();
-                       }
-
-                       // Use the one that is referenced more
-                       else if(link_value_node->rcount()<value_desc.get_value_node()->rcount())
-                       {
-                               link_value_node=value_desc.get_value_node();
-                       }
-
-                       // If the current link value node is a constant and
-                       // this one isn't, then give preference to the exotic
-                       else if(ValueNode_Const::Handle::cast_dynamic(link_value_node) && !ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
-                       {
-                               link_value_node=value_desc.get_value_node();
-                       }
-
-                       // If both are animated, and this one has more waypoints,
-                       // then use the one with more waypoints
-                       else if(
-                                       ValueNode_Animated::Handle::cast_dynamic(link_value_node)
-                               &&      ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())
-                               && (
-                                       ValueNode_Animated::Handle::cast_dynamic(link_value_node)->waypoint_list().size()
-                               <       ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())->waypoint_list().size()
-                               )
-                       )
-                       {
-                               link_value_node=value_desc.get_value_node();
-                       }
-                       
-                       /*
-                       // Use the one that was most recently changed
-                       else if(link_value_node->get_time_last_changed()<value_desc.get_value_node()->get_time_last_changed())
-                       {
-                               link_value_node=value_desc.get_value_node();
-                       }
-                       */
-               }
-
-               
-               if(value_desc_list.size() && value_desc.get_value_type()!=value_desc_list.front().get_value_type())
-               {
-                       // Everything must be of the same type
-                       poison=true;
-                       return false;
-               }
-               value_desc_list.push_back(value_desc);
-
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueDescLink::is_ready()const
-{
-       if(poison || value_desc_list.size()<=1)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueDescLink::prepare()
-{
-       if(poison || value_desc_list.empty())
-               throw Error(Error::TYPE_NOTREADY);
-               
-       clear();
-
-       if(!link_value_node)
-       {
-               ValueDesc& value_desc(value_desc_list.front());
-               
-               link_value_node=ValueNode_Const::create(value_desc.get_value(time));
-               
-               Action::Handle action(Action::create("value_desc_connect"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("src",link_value_node);
-               action->set_param("dest",value_desc);
-       
-               assert(action->is_ready());             
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);               
-       }
-
-       /*
-       if(!link_value_node->is_exported())
-       {
-               Action::Handle action(Action::create("value_node_add"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("new",link_value_node);
-               action->set_param("name",strprintf(_("Unnamed%08d"),sinfg::UniqueID().get_uid()));
-       
-               assert(action->is_ready());             
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);
-       }
-       */
-       
-       std::list<ValueDesc>::iterator iter;
-       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
-       {
-               ValueDesc& value_desc(*iter);
-               
-               if(value_desc.is_value_node() && value_desc.get_value_node()==link_value_node)
-                       continue;
-
-               Action::Handle action(Action::create("value_desc_connect"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("src",link_value_node);
-               action->set_param("dest",value_desc);
-       
-               assert(action->is_ready());             
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action_front(action);               
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedesclink.h b/synfig-studio/trunk/src/sinfgapp/actions/valuedesclink.h
deleted file mode 100644 (file)
index 76e3369..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedesclink.h
-**     \brief Template File
-**
-**     $Id: valuedesclink.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUEDESCLINK_H
-#define __SINFG_APP_ACTION_VALUEDESCLINK_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.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 sinfgapp {
-
-namespace Action {
-
-class ValueDescLink :
-       public Super
-{
-private:
-
-       std::list<ValueDesc> value_desc_list;
-       sinfg::ValueNode::Handle link_value_node;
-       bool poison;
-       sinfg::Time time;
-public:
-
-       ValueDescLink();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuedescset.cpp
deleted file mode 100644 (file)
index 9531d58..0000000
+++ /dev/null
@@ -1,532 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescset.cpp
-**     \brief Template File
-**
-**     $Id: valuedescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "layerparamset.h"
-#include "valuenodeconstset.h"
-#include "valuedescconnect.h"
-#include "waypointsetsmart.h"
-
-#include "valuedescset.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_composite.h>
-#include <sinfg/valuenode_radialcomposite.h>
-#include <sinfg/valuenode_reference.h>
-#include <sinfgapp/main.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-#define ACTION_INIT2(class) \
-       Action::Base* class::create() { return new class(); }   \
-       sinfg::String class::get_name()const { return name__; } 
-
-ACTION_INIT2(Action::ValueDescSet);
-ACTION_SET_NAME(Action::ValueDescSet,"value_desc_set");
-ACTION_SET_LOCAL_NAME(Action::ValueDescSet,"Set ValueDesc");
-ACTION_SET_TASK(Action::ValueDescSet,"set");
-ACTION_SET_CATEGORY(Action::ValueDescSet,Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ValueDescSet,0);
-ACTION_SET_VERSION(Action::ValueDescSet,"0.0");
-ACTION_SET_CVS_ID(Action::ValueDescSet,"$Id: valuedescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueDescSet::ValueDescSet():
-       time(0)
-{
-}
-
-sinfg::String
-Action::ValueDescSet::get_local_name()const
-{
-       String name("ValueDesc");
-       
-       if(!value_desc)
-       {
-       }
-       else if(value_desc.parent_is_layer_param())
-       {
-               if(value_desc.get_layer()->get_description().empty())
-                       name=value_desc.get_layer()->get_local_name();
-               else
-                       name=value_desc.get_layer()->get_description();
-               name+="->"+value_desc.get_param_name();
-       }
-       else if(value_desc.parent_is_value_node())
-       {
-               sinfg::LinkableValueNode::Handle value_node(sinfg::LinkableValueNode::Handle::cast_reinterpret(value_desc.get_parent_value_node()));
-               name=value_node->link_local_name(value_desc.get_index());
-               
-               sinfg::Node* node;
-               for(node=value_node.get();!node->parent_set.empty() && !dynamic_cast<Layer*>(node);node=*node->parent_set.begin());
-               Layer::Handle parent_layer(dynamic_cast<Layer*>(node));
-               if(parent_layer)
-               {
-                       if(parent_layer->get_description().empty())
-                               name=parent_layer->get_local_name()+"=>"+name;
-                       else
-                               name=parent_layer->get_description()+"=>"+name;
-               }
-       }
-
-       return strprintf(_("Set %s"),name.c_str());
-}
-
-Action::ParamVocab
-Action::ValueDescSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       ret.push_back(ParamDesc("new_value",Param::TYPE_VALUE)
-               .set_local_name(_("ValueBase"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueDescSet::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::ValueDescSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               value_desc=param.get_value_desc();
-               
-               return true;
-       }
-
-       if(name=="new_value" && param.get_type()==Param::TYPE_VALUE)
-       {
-               value=param.get_value();
-               
-               return true;
-       }
-
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueDescSet::is_ready()const
-{
-       if(!value_desc || !value.is_valid())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueDescSet::prepare()
-{
-       clear();
-
-       // If our tangents are merged, and
-       // our first tangent is being manipulated,
-       // then we also need to adjust the other
-       // tangent.
-       if(     value_desc.parent_is_value_node()
-       &&      value_desc.get_parent_value_node()->get_type()==ValueBase::TYPE_BLINEPOINT
-       &&      value_desc.get_index()==4
-       &&      (*value_desc.get_parent_value_node())(time).get(BLinePoint()).get_split_tangent_flag()==false
-       )
-       {
-               DEBUGPOINT();
-               ValueNode_Composite::Handle parent_value_node;
-               parent_value_node=parent_value_node.cast_dynamic(value_desc.get_parent_value_node());
-               
-               assert(parent_value_node);
-               
-               Action::Handle action(Action::create("value_desc_set"));
-       
-               if(!action)
-                       throw Error(_("Unable to find action value_desc_set (bug)"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("time",time);
-               action->set_param("new_value",value);
-               action->set_param("value_desc",ValueDesc(parent_value_node,5));
-               
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);                     
-       }
-
-       // If we are a reference value node, then
-       // we need to distribute the changes to the
-       // referenced value node
-       if(value_desc.is_value_node() && ValueNode_Reference::Handle::cast_dynamic(value_desc.get_value_node()))
-       {
-               ValueDesc reference_value_desc(ValueNode_Reference::Handle::cast_dynamic(value_desc.get_value_node()),0);
-
-               Action::Handle action(Action::create("value_desc_set"));
-
-               if(!action)
-                       throw Error(_("Unable to find action value_desc_set (bug)"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("time",time);
-               action->set_param("new_value",value);
-               action->set_param("value_desc",reference_value_desc);
-               
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-
-               add_action(action);                     
-       
-               return;
-       }
-       
-       // If we are a composite value node, then
-       // we need to distribute the changes to the
-       // individual parts
-       if(value_desc.is_value_node() && ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()))
-       {
-               ValueBase components[6];
-               int n_components(0);
-               switch(value.get_type())
-               {
-               case ValueBase::TYPE_VECTOR:
-                       components[0]=value.get(Vector())[0];
-                       components[1]=value.get(Vector())[1];
-                       n_components=2;
-                       break;
-               case ValueBase::TYPE_COLOR:
-                       components[0]=value.get(Color()).get_r();
-                       components[1]=value.get(Color()).get_g();
-                       components[2]=value.get(Color()).get_b();
-                       components[3]=value.get(Color()).get_a();
-                       n_components=4;
-                       break;
-               case ValueBase::TYPE_SEGMENT:
-                       components[0]=value.get(Segment()).p1;
-                       components[1]=value.get(Segment()).t1;
-                       components[2]=value.get(Segment()).p2;
-                       components[3]=value.get(Segment()).t2;
-                       n_components=4;
-                       break;
-               case ValueBase::TYPE_BLINEPOINT:
-               {
-                       BLinePoint bline_point(value);
-                       components[0]=bline_point.get_vertex();
-                       components[1]=bline_point.get_width();
-                       components[2]=bline_point.get_origin();
-                       components[3]=bline_point.get_split_tangent_flag();
-                       components[4]=bline_point.get_tangent1();
-                       components[5]=bline_point.get_tangent2();
-                       n_components=6;
-                       break;
-               }
-               default:
-                       throw Error("Bad type for composite (%s)",ValueBase::type_name(value.get_type()).c_str());                      
-                       break;
-               }
-               
-               for(int i=0;i<n_components;i++)
-               {
-                       ValueDesc component_value_desc(ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()),i);
-
-                       Action::Handle action(Action::create("value_desc_set"));
-       
-                       if(!action)
-                               throw Error(_("Unable to find action value_desc_set (bug)"));
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("time",time);
-                       action->set_param("new_value",components[i]);
-                       action->set_param("value_desc",component_value_desc);
-                       
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-       
-                       add_action(action);                     
-               }
-               
-               return;
-       }
-
-       
-       // If we are a RADIAL composite value node, then
-       // we need to distribute the changes to the
-       // individual parts
-       if(value_desc.is_value_node() && ValueNode_RadialComposite::Handle::cast_dynamic(value_desc.get_value_node()))
-       {
-               ValueBase components[6];
-               int n_components(0);
-               switch(value.get_type())
-               {
-               case ValueBase::TYPE_VECTOR:
-               {
-                       Vector vect(value.get(Vector()));
-                       components[0]=vect.mag();
-                       components[1]=Angle(Angle::tan(vect[1],vect[0]));
-                       n_components=2;
-               }
-                       break;
-               case ValueBase::TYPE_COLOR:
-                       components[0]=value.get(Color()).get_y();
-                       components[1]=value.get(Color()).get_s();
-                       components[2]=value.get(Color()).get_hue();
-                       components[3]=value.get(Color()).get_a();
-                       n_components=4;
-                       break;
-               default:
-                       throw Error("Bad type for radial composite (%s)",ValueBase::type_name(value.get_type()).c_str());                       
-                       break;
-               }
-               for(int i=0;i<n_components;i++)
-               {
-                       ValueDesc component_value_desc(ValueNode_RadialComposite::Handle::cast_dynamic(value_desc.get_value_node()),i);
-
-                       Action::Handle action(Action::create("value_desc_set"));
-       
-                       if(!action)
-                               throw Error(_("Unable to find action value_desc_set (bug)"));
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("time",time);
-                       action->set_param("new_value",components[i]);
-                       action->set_param("value_desc",component_value_desc);
-                       
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-       
-                       add_action(action);                     
-               }
-               
-               return;
-       }
-
-       // If we are merging the tangents of a BLinePoint,
-       // we must also set the second tangent for things
-       // to interpolate properly
-       if(     value_desc.parent_is_value_node()
-       &&      value_desc.get_parent_value_node()->get_type()==ValueBase::TYPE_BLINEPOINT
-       &&      value_desc.get_index()==3
-//     &&      value.get(bool())==false        // Actually, we want to do this any time the split flag is tweaked with
-       )
-       {
-               ValueNode_Composite::Handle parent_value_node;
-               parent_value_node=parent_value_node.cast_dynamic(value_desc.get_parent_value_node());
-               
-               assert(parent_value_node);
-               
-               Action::Handle action(Action::create("value_desc_set"));
-       
-               if(!action)
-                       throw Error(_("Unable to find action value_desc_set (bug)"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("time",time);
-               action->set_param("new_value",(*parent_value_node->get_link(4))(time));
-               action->set_param("value_desc",ValueDesc(parent_value_node,5));
-               
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);                     
-       }
-
-/*     DEBUGPOINT();
-       if(     value_desc.parent_is_value_node())
-       {
-               DEBUGPOINT();
-               if(value_desc.get_parent_value_node()->get_type()==ValueBase::TYPE_BLINEPOINT)
-               {
-                       DEBUGPOINT();
-                       if(value_desc.get_index()==4)
-                       {
-                               DEBUGPOINT();
-                               if((*value_desc.get_parent_value_node())(time).get(BLinePoint()).get_split_tangent_flag()==false)
-                               {
-                                       DEBUGPOINT();
-                               }
-                       }
-               }
-       }
-*/     
-
-       
-       // If we are in animate editing mode
-       if(get_edit_mode()&MODE_ANIMATE)
-       {
-
-               ValueNode_Animated::Handle& value_node(value_node_animated);
-
-               // If this value isn't a ValueNode_Animated, but
-               // it is somewhat constant, then go ahead and convert
-               // it to a ValueNode_Animated.
-               if(!value_desc.is_value_node() || ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
-               {
-                       ValueBase value;
-                       if(value_desc.is_value_node())
-                               value=ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node())->get_value();
-                       else
-                               value=value_desc.get_value();
-                       
-                       if(!value_node)value_node=ValueNode_Animated::create(value,time);
-                       //if(!value_node)value_node=ValueNode_Animated::create(value.get_type());
-                       
-                       Action::Handle action;
-                       
-                       if(!value_desc.is_value_node())
-                       {
-                               action=(ValueDescConnect::create());
-                               action->set_param("dest",value_desc);
-                               action->set_param("src",ValueNode::Handle(value_node));
-                       }
-                       else
-                       {
-                               action=Action::create("value_node_replace");
-                               action->set_param("dest",value_desc.get_value_node());
-                               action->set_param("src",ValueNode::Handle(value_node));
-                       }
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-       
-                               DEBUGPOINT();
-                       add_action_front(action);
-               }
-               else
-               {
-                       value_node=value_node.cast_dynamic(value_desc.get_value_node());
-               }
-               
-                               DEBUGPOINT();
-               if(!value_node)
-                       throw Error(_("Direct manipulation of this ValueNode type is not yet supported"));              
-               
-               Action::Handle action(WaypointSetSmart::create());
-               
-               //Waypoint waypoint(value,time);
-               
-               Waypoint waypoint(value_node->new_waypoint_at_time(time));
-               waypoint.set_value(value);
-               
-               waypoint.set_before(sinfgapp::Main::get_interpolation());
-               waypoint.set_after(sinfgapp::Main::get_interpolation());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_node",ValueNode::Handle(value_node));
-               action->set_param("waypoint",waypoint);
-               
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-
-                               DEBUGPOINT();
-               add_action(action);
-               
-               return;
-       }
-       else
-       {
-               if(value_desc.is_value_node())
-               {
-                       if(ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
-                       {
-                               Action::Handle action(ValueNodeConstSet::create());
-                               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_node",value_desc.get_value_node());
-                               action->set_param("new_value",value);
-                               
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-               
-                               add_action_front(action);
-                               return;
-                       }
-                       else
-                       if(ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node()))
-                               throw Error(_("You must be in Animate-Editing-Mode to directly manipulate this value"));                
-                       else
-                               throw Error(_("Direct manipulation of this ValueNode type is not yet supported"));              
-               }
-               else
-               if(value_desc.parent_is_layer_param() && !value_desc.is_value_node())
-               {
-                       Action::Handle layer_param_set(LayerParamSet::create());
-                       
-                       layer_param_set->set_param("canvas",get_canvas());
-                       layer_param_set->set_param("canvas_interface",get_canvas_interface());
-                       layer_param_set->set_param("layer",value_desc.get_layer());
-                       layer_param_set->set_param("param",value_desc.get_param_name());
-                       layer_param_set->set_param("new_value",value);
-       
-                       if(!layer_param_set->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-                       
-                       add_action_front(layer_param_set);
-                       return;
-               }
-
-               throw Error(_("Unsupported ValueDesc type"));
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuedescset.h b/synfig-studio/trunk/src/sinfgapp/actions/valuedescset.h
deleted file mode 100644 (file)
index dfba6fc..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuedescset.h
-**     \brief Template File
-**
-**     $Id: valuedescset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUEDESCSET_H
-#define __SINFG_APP_ACTION_VALUEDESCSET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/valuenode_animated.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 sinfgapp {
-
-namespace Action {
-
-class ValueDescSet :
-       public Super
-{
-private:
-
-       ValueDesc value_desc;
-       sinfg::ValueBase value;
-       sinfg::Time time;
-       sinfg::ValueNode_Animated::Handle value_node_animated;
-
-public:
-
-       ValueDescSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodeadd.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodeadd.cpp
deleted file mode 100644 (file)
index 5639633..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodeadd.cpp
-**     \brief Template File
-**
-**     $Id: valuenodeadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodeadd.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeAdd);
-ACTION_SET_NAME(Action::ValueNodeAdd,"value_node_add");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeAdd,"Add ValueNode");
-ACTION_SET_TASK(Action::ValueNodeAdd,"add");
-ACTION_SET_CATEGORY(Action::ValueNodeAdd,Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeAdd,0);
-ACTION_SET_VERSION(Action::ValueNodeAdd,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeAdd,"$Id: valuenodeadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeAdd::ValueNodeAdd()
-{
-}
-
-Action::ParamVocab
-Action::ValueNodeAdd::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("new",Param::TYPE_VALUENODE)
-               .set_local_name(_("New ValueNode"))
-               .set_desc(_("ValueNode to be added"))
-       );
-
-       ret.push_back(ParamDesc("name",Param::TYPE_STRING)
-               .set_local_name(_("Name"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueNodeAdd::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::ValueNodeAdd::set_param(const sinfg::String& param_name, const Action::Param &param)
-{
-       if(param_name=="new" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=param.get_value_node();
-               
-               return true;
-       }
-
-       if(param_name=="name" && param.get_type()==Param::TYPE_STRING)
-       {
-               name=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(param_name,param);
-}
-
-bool
-Action::ValueNodeAdd::is_ready()const
-{
-       if(!value_node || name.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeAdd::perform()
-{
-       if(value_node->is_exported())
-       {
-               throw Error(_("Parameter appears to already be exported"));
-       }
-       
-       try
-       {
-               get_canvas()->add_value_node(value_node,name);
-       }
-       catch(Exception::IDAlreadyExists)
-       {
-               throw Error(_("Another exported ValueBase with this name already exists"));
-       }
-       catch(...)
-       {
-               throw Error(_("Exception caught on Add ValueNode."));
-       }
-
-       set_dirty(false);
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_added()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
-
-void
-Action::ValueNodeAdd::undo()
-{
-       try { get_canvas()->remove_value_node(value_node); }
-       catch(...)
-       {
-               throw Error(_("Exception caught on Remove ValueNode."));
-       }
-
-       set_dirty(false);
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_deleted()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodeadd.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodeadd.h
deleted file mode 100644 (file)
index 3536f23..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodeadd.h
-**     \brief Template File
-**
-**     $Id: valuenodeadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEADD_H
-#define __SINFG_APP_ACTION_VALUENODEADD_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeAdd :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode::Handle value_node;
-       sinfg::String name;
-
-public:
-
-       ValueNodeAdd();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodeconstset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodeconstset.cpp
deleted file mode 100644 (file)
index c83f6a6..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodeconstset.cpp
-**     \brief Template File
-**
-**     $Id: valuenodeconstset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodeconstset.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeConstSet);
-ACTION_SET_NAME(Action::ValueNodeConstSet,"value_node_const_set");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeConstSet,_("Set ValueNode_Const"));
-ACTION_SET_TASK(Action::ValueNodeConstSet,"set");
-ACTION_SET_CATEGORY(Action::ValueNodeConstSet,Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeConstSet,0);
-ACTION_SET_VERSION(Action::ValueNodeConstSet,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeConstSet,"$Id: valuenodeconstset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeConstSet::ValueNodeConstSet()
-{
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ValueNodeConstSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode_Const"))
-       );
-
-       ret.push_back(ParamDesc("new_value",Param::TYPE_VALUE)
-               .set_local_name(_("ValueBase"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueNodeConstSet::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               if(ValueNode_Const::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
-                       return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeConstSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=ValueNode_Const::Handle::cast_dynamic(param.get_value_node());
-               
-               return (bool)value_node;
-       }
-
-       if(name=="new_value" && param.get_type()==Param::TYPE_VALUE)
-       {
-               new_value=param.get_value();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeConstSet::is_ready()const
-{
-       if(!value_node || !new_value.is_valid())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeConstSet::perform()
-{
-       //set_dirty(true);
-       
-       old_value=value_node->get_value();
-
-       value_node->set_value(new_value);       
-       
-       // Signal that a layer has been inserted
-       /*if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }*/
-}
-
-void
-Action::ValueNodeConstSet::undo()
-{
-       //set_dirty(true);
-
-       value_node->set_value(old_value);       
-       
-       // Signal that a layer has been inserted
-       /*if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodeconstset.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodeconstset.h
deleted file mode 100644 (file)
index df57a60..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodeconstset.h
-**     \brief Template File
-**
-**     $Id: valuenodeconstset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODECONSTSET_H
-#define __SINFG_APP_ACTION_VALUENODECONSTSET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/valuenode_const.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeConstSet :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode_Const::Handle value_node;
-       sinfg::ValueBase        new_value;
-       sinfg::ValueBase        old_value;
-
-
-public:
-
-       ValueNodeConstSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsert.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsert.cpp
deleted file mode 100644 (file)
index 97a12e9..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistinsert.cpp
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistinsert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodedynamiclistinsert.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeDynamicListInsert);
-ACTION_SET_NAME(Action::ValueNodeDynamicListInsert,"value_node_dynamic_list_insert");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListInsert,"Insert Item");
-ACTION_SET_TASK(Action::ValueNodeDynamicListInsert,"insert");
-ACTION_SET_CATEGORY(Action::ValueNodeDynamicListInsert,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE|Action::CATEGORY_HIDDEN);
-ACTION_SET_PRIORITY(Action::ValueNodeDynamicListInsert,-20);
-ACTION_SET_VERSION(Action::ValueNodeDynamicListInsert,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeDynamicListInsert,"$Id: valuenodedynamiclistinsert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeDynamicListInsert::ValueNodeDynamicListInsert()
-{
-       index=0;
-       time=0;
-       origin=0.5f;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ValueNodeDynamicListInsert::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       ret.push_back(ParamDesc("origin",Param::TYPE_REAL)
-               .set_local_name(_("Origin"))
-               .set_optional()
-       );
-       ret.push_back(ParamDesc("item",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode to insert"))
-               .set_optional()
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeDynamicListInsert::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeDynamicListInsert::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-
-               index=value_desc.get_index();
-
-               value_node_bline=ValueNode_BLine::Handle::cast_dynamic(value_desc.get_parent_value_node());
-
-               list_entry=value_node->create_list_entry(index,time,origin);
-               if(item)
-                       list_entry.value_node=item;
-               
-               assert(list_entry.value_node.rcount()==1);
-                               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-       if(name=="item" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               item=param.get_value_node();
-               if(item)
-                       list_entry.value_node=item;
-               
-               return true;
-       }
-       if(name=="origin" && param.get_type()==Param::TYPE_REAL)
-       {
-               origin=param.get_real();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeDynamicListInsert::is_ready()const
-{
-       if(!value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeDynamicListInsert::perform()
-{      
-       if(index>value_node->link_count())
-               index=value_node->link_count();
-       
-       value_node->add(list_entry,index);
-       assert(list_entry.value_node.rcount()>=2);
-       
-       // Signal that a layer has been inserted
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
-
-void
-Action::ValueNodeDynamicListInsert::undo()
-{
-       assert(list_entry.value_node.rcount()>=2);
-       value_node->erase((value_node->list.begin()+index)->value_node);
-       assert(list_entry.value_node.rcount()>=1);
-       
-       // Signal that a layer has been inserted
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsert.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsert.h
deleted file mode 100644 (file)
index 17b4482..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistinsert.h
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistinsert.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEDYNAMICLISTINSERT_H
-#define __SINFG_APP_ACTION_VALUENODEDYNAMICLISTINSERT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_bline.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeDynamicListInsert :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       sinfg::ValueNode_BLine::Handle value_node_bline;
-       sinfg::ValueNode_DynamicList::ListEntry list_entry;
-       sinfg::ValueNode::Handle item;
-       sinfg::Time time;
-       sinfg::Real origin;
-       int index;
-
-
-public:
-
-       ValueNodeDynamicListInsert();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsertsmart.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsertsmart.cpp
deleted file mode 100644 (file)
index 1351e85..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistinsertsmart.cpp
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistinsertsmart.cpp,v 1.3 2005/01/17 05:20:08 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodedynamiclistinsertsmart.h"
-#include "valuenodedynamiclistinsert.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeDynamicListInsertSmart);
-ACTION_SET_NAME(Action::ValueNodeDynamicListInsertSmart,"value_node_dynamic_list_insert_smart");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListInsertSmart,"Insert Item (Smart)");
-ACTION_SET_TASK(Action::ValueNodeDynamicListInsertSmart,"insert");
-ACTION_SET_CATEGORY(Action::ValueNodeDynamicListInsertSmart,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeDynamicListInsertSmart,-20);
-ACTION_SET_VERSION(Action::ValueNodeDynamicListInsertSmart,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeDynamicListInsertSmart,"$Id: valuenodedynamiclistinsertsmart.cpp,v 1.3 2005/01/17 05:20:08 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeDynamicListInsertSmart::ValueNodeDynamicListInsertSmart()
-{
-       index=0;
-       time=0;
-       origin=0.5f;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ValueNodeDynamicListInsertSmart::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       ret.push_back(ParamDesc("origin",Param::TYPE_REAL)
-               .set_local_name(_("Origin"))
-               .set_optional()
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeDynamicListInsertSmart::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeDynamicListInsertSmart::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-
-               index=value_desc.get_index();
-                               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-       if(name=="origin" && param.get_type()==Param::TYPE_REAL)
-       {
-               origin=param.get_real();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeDynamicListInsertSmart::is_ready()const
-{
-       if(!value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeDynamicListInsertSmart::prepare()
-{      
-       //clear();
-       // HACK
-       if(!first_time())
-               return;
-       
-       // If we are in animate editing mode
-       if(get_edit_mode()&MODE_ANIMATE)
-       {
-               int index(ValueNodeDynamicListInsertSmart::index);
-
-               // In this case we need to first determine if there is
-               // a currently disabled item in the list that we can
-               // turn on. If not, then we need to go ahead and create one.
-               sinfg::info("ValueNodeDynamicListInsertSmart: index=%d",index);
-               sinfg::info("ValueNodeDynamicListInsertSmart: value_node->list.size()=%d",value_node->list.size());
-               if(value_node->list.size()<=index && index>0)
-                       sinfg::info("ValueNodeDynamicListInsertSmart: value_node->list[index-1].status_at_time(time)=%d",value_node->list[index-1].status_at_time(time));
-               
-               if(value_node->list.size()>=index && index>0 && !value_node->list[index-1].status_at_time(time))
-               {
-                       // Ok, we do not have to create a new
-                       // entry in the dynamic list after all.                 
-                       // However, we do need to set the
-                       // position and tangent of this point.
-                       ValueNode_DynamicList::ListEntry list_entry(value_node->create_list_entry(index,time,origin));
-                       ValueBase value((*list_entry.value_node)(time));
-                       index--;
-                       
-                       ValueDesc item_value_desc(value_node,index);
-
-                       Action::Handle action(Action::create("value_desc_set"));
-       
-                       if(!action)
-                               throw Error(_("Unable to find action value_desc_set (bug)"));
-                       
-                       action->set_param("edit_mode",get_edit_mode());
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("time",time);
-                       action->set_param("new_value",value);
-                       action->set_param("value_desc",ValueDesc(value_node,index));
-                       
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-       
-                       add_action(action);                     
-               }
-               else
-               {
-                       // Ok, not a big deal, we just need to
-                       // add a new item
-                       Action::Handle action(Action::create("value_node_dynamic_list_insert"));
-       
-                       if(!action)
-                               throw Error(_("Unable to find action (bug)"));
-                       
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("time",time);
-                       action->set_param("origin",origin);
-                       action->set_param("value_desc",ValueDesc(value_node,index));
-                       
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-       
-                       add_action(action);
-                       
-                       action=Action::create("activepoint_set_off");
-       
-                       if(!action)
-                               throw Error(_("Unable to find action \"activepoint_set_off\""));
-                       
-                       action->set_param("edit_mode",MODE_ANIMATE);
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("time",Time::begin());
-                       action->set_param("origin",origin);
-                       action->set_param("value_desc",ValueDesc(value_node,index));
-                       
-                       if(!action->is_ready())
-                               throw Error(Error::TYPE_NOTREADY);
-       
-                       add_action(action);
-               }
-                       
-               // Now we set the activepoint up and then we'll be done
-               Action::Handle action(Action::create("activepoint_set_on"));
-
-               if(!action)
-                       throw Error(_("Unable to find action \"activepoint_set_on\""));
-               
-               action->set_param("edit_mode",get_edit_mode());
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("time",time);
-               action->set_param("origin",origin);
-               action->set_param("value_desc",ValueDesc(value_node,index));
-               
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-
-               add_action(action);
-       }
-       else
-       {
-               Action::Handle action(Action::create("value_node_dynamic_list_insert"));
-
-               if(!action)
-                       throw Error(_("Unable to find action (bug)"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("time",time);
-               action->set_param("origin",origin);
-               action->set_param("value_desc",ValueDesc(value_node,index));
-               
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-
-               add_action(action);     
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsertsmart.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistinsertsmart.h
deleted file mode 100644 (file)
index 9d65b57..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistinsertsmart.h
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistinsertsmart.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEDYNAMICLISTINSERTSMART_H
-#define __SINFG_APP_ACTION_VALUENODEDYNAMICLISTINSERTSMART_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_bline.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeDynamicListInsertSmart :
-       public Super
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       sinfg::Time time;
-       sinfg::Real origin;
-       int index;
-
-
-public:
-
-       ValueNodeDynamicListInsertSmart();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistloop.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistloop.cpp
deleted file mode 100644 (file)
index efedbec..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistloop.cpp
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistloop.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodedynamiclistloop.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeDynamicListLoop);
-ACTION_SET_NAME(Action::ValueNodeDynamicListLoop,"value_node_dynamic_list_loop");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListLoop,"Loop");
-ACTION_SET_TASK(Action::ValueNodeDynamicListLoop,"loop");
-ACTION_SET_CATEGORY(Action::ValueNodeDynamicListLoop,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeDynamicListLoop,0);
-ACTION_SET_VERSION(Action::ValueNodeDynamicListLoop,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeDynamicListLoop,"$Id: valuenodedynamiclistloop.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeDynamicListLoop::ValueNodeDynamicListLoop()
-{
-}
-
-Action::ParamVocab
-Action::ValueNodeDynamicListLoop::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode"))
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeDynamicListLoop::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueNode::Handle value_node(x.find("value_node")->second.get_value_node());
-               if(!ValueNode_DynamicList::Handle::cast_dynamic(value_node))
-                       return false;
-               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)->get_loop()==true)
-                       return false;
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeDynamicListLoop::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(param.get_value_node());
-               
-               if(!value_node)
-                       return false;
-
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeDynamicListLoop::is_ready()const
-{
-       if(!value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeDynamicListLoop::perform()
-{      
-       old_loop_value=value_node->get_loop();
-       
-       if(old_loop_value==true)
-       {
-               set_dirty(false);
-               return;
-       }
-       set_dirty(true);
-       value_node->set_loop(true);
-               
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
-
-void
-Action::ValueNodeDynamicListLoop::undo()
-{
-       if(old_loop_value==value_node->get_loop())
-       {
-               set_dirty(false);
-               return;
-       }
-       set_dirty(true);
-       value_node->set_loop(old_loop_value);
-               
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistloop.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistloop.h
deleted file mode 100644 (file)
index 3cc2a93..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistloop.h
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistloop.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEDYNAMICLISTLOOP_H
-#define __SINFG_APP_ACTION_VALUENODEDYNAMICLISTLOOP_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_bline.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeDynamicListLoop :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       bool old_loop_value;
-
-
-public:
-
-       ValueNodeDynamicListLoop();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremove.cpp
deleted file mode 100644 (file)
index ed562dc..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistremove.cpp
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodedynamiclistremove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeDynamicListRemove);
-ACTION_SET_NAME(Action::ValueNodeDynamicListRemove,"value_node_dynamic_list_remove");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRemove,"Remove Item");
-ACTION_SET_TASK(Action::ValueNodeDynamicListRemove,"remove");
-ACTION_SET_CATEGORY(Action::ValueNodeDynamicListRemove,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE|Action::CATEGORY_HIDDEN);
-ACTION_SET_PRIORITY(Action::ValueNodeDynamicListRemove,-19);
-ACTION_SET_VERSION(Action::ValueNodeDynamicListRemove,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeDynamicListRemove,"$Id: valuenodedynamiclistremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeDynamicListRemove::ValueNodeDynamicListRemove()
-{
-       index=0;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ValueNodeDynamicListRemove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeDynamicListRemove::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeDynamicListRemove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-               
-               index=value_desc.get_index();
-               
-               return true;
-       }
-       
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeDynamicListRemove::is_ready()const
-{
-       if(!value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeDynamicListRemove::perform()
-{      
-       if(index>=value_node->link_count())
-               index=value_node->link_count()-1;
-
-       list_entry=value_node->list[index];
-       value_node->erase((value_node->list.begin()+index)->value_node);
-               
-       // Signal that a layer has been inserted
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
-
-void
-Action::ValueNodeDynamicListRemove::undo()
-{
-       value_node->add(list_entry,index);
-       
-       // Signal that a layer has been inserted
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremove.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremove.h
deleted file mode 100644 (file)
index e340417..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistremove.h
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEDYNAMICLISTREMOVE_H
-#define __SINFG_APP_ACTION_VALUENODEDYNAMICLISTREMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeDynamicListRemove :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       sinfg::ValueNode_DynamicList::ListEntry list_entry;
-       int index;
-
-
-public:
-
-       ValueNodeDynamicListRemove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremovesmart.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremovesmart.cpp
deleted file mode 100644 (file)
index ae05e5e..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistremovesmart.cpp
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistremovesmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodedynamiclistremovesmart.h"
-#include "valuenodedynamiclistremove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeDynamicListRemoveSmart);
-ACTION_SET_NAME(Action::ValueNodeDynamicListRemoveSmart,"value_node_dynamic_list_remove_smart");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRemoveSmart,"Remove Item (Smart)");
-ACTION_SET_TASK(Action::ValueNodeDynamicListRemoveSmart,"remove");
-ACTION_SET_CATEGORY(Action::ValueNodeDynamicListRemoveSmart,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeDynamicListRemoveSmart,-19);
-ACTION_SET_VERSION(Action::ValueNodeDynamicListRemoveSmart,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeDynamicListRemoveSmart,"$Id: valuenodedynamiclistremovesmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeDynamicListRemoveSmart::ValueNodeDynamicListRemoveSmart()
-{
-       index=0;
-       time=0;
-       origin=0.5f;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ValueNodeDynamicListRemoveSmart::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-       ret.push_back(ParamDesc("origin",Param::TYPE_REAL)
-               .set_local_name(_("Origin"))
-               .set_optional()
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeDynamicListRemoveSmart::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeDynamicListRemoveSmart::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-
-               index=value_desc.get_index();
-                               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-       if(name=="origin" && param.get_type()==Param::TYPE_REAL)
-       {
-               origin=param.get_real();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeDynamicListRemoveSmart::is_ready()const
-{
-       if(!value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeDynamicListRemoveSmart::prepare()
-{      
-       clear();
-       
-       // If we are in animate editing mode
-       if(get_edit_mode()&MODE_ANIMATE)
-       {
-               Action::Handle action(Action::create("activepoint_set_off"));
-
-               if(!action)
-                       throw Error(_("Unable to find action (bug)"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("time",time);
-               action->set_param("origin",origin);
-               action->set_param("value_desc",ValueDesc(value_node,index));
-               
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-
-               add_action(action);
-       }
-       else
-       {
-               Action::Handle action(Action::create("value_node_dynamic_list_remove"));
-
-               if(!action)
-                       throw Error(_("Unable to find action (bug)"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("time",time);
-               action->set_param("origin",origin);
-               action->set_param("value_desc",ValueDesc(value_node,index));
-               
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-
-               add_action(action);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremovesmart.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistremovesmart.h
deleted file mode 100644 (file)
index c07a61a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistremovesmart.h
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistremovesmart.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEDYNAMICLISTREMOVESMART_H
-#define __SINFG_APP_ACTION_VALUENODEDYNAMICLISTREMOVESMART_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_bline.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeDynamicListRemoveSmart :
-       public Super
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       sinfg::Time time;
-       sinfg::Real origin;
-       int index;
-
-
-public:
-
-       ValueNodeDynamicListRemoveSmart();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistrotateorder.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistrotateorder.cpp
deleted file mode 100644 (file)
index e3651a0..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistinsert.cpp
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistrotateorder.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodedynamiclistrotateorder.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeDynamicListRotateOrder);
-ACTION_SET_NAME(Action::ValueNodeDynamicListRotateOrder,"value_node_dynamic_list_rotate_order");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRotateOrder,"Rotate Order");
-ACTION_SET_TASK(Action::ValueNodeDynamicListRotateOrder,"rotate");
-ACTION_SET_CATEGORY(Action::ValueNodeDynamicListRotateOrder,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeDynamicListRotateOrder,0);
-ACTION_SET_VERSION(Action::ValueNodeDynamicListRotateOrder,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeDynamicListRotateOrder,"$Id: valuenodedynamiclistrotateorder.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeDynamicListRotateOrder::ValueNodeDynamicListRotateOrder()
-{
-       index=0;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::ValueNodeDynamicListRotateOrder::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
-               .set_local_name(_("ValueDesc"))
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeDynamicListRotateOrder::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
-
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeDynamicListRotateOrder::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
-       {
-               ValueDesc value_desc(param.get_value_desc());
-               
-               if(!value_desc.parent_is_value_node())
-                       return false;
-               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-               
-               if(!value_node)
-                       return false;
-
-               index=value_desc.get_index();
-
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeDynamicListRotateOrder::is_ready()const
-{
-       if(!value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeDynamicListRotateOrder::prepare()
-{
-       clear();
-       
-       for(int i(0);i<(value_node->link_count()-index)%value_node->link_count();++i)
-       {
-               ValueDesc value_desc(value_node,value_node->link_count()-1-i);
-               ValueNode::Handle child(value_desc.get_value_node());
-
-
-               Action::Handle action(Action::create("value_node_dynamic_list_remove"));
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,value_node->link_count()-1));
-               
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-               
-               
-               action=Action::create("value_node_dynamic_list_insert");
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,0));
-               action->set_param("item",child);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-
-               
-               
-       
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistrotateorder.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistrotateorder.h
deleted file mode 100644 (file)
index 244542d..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistrotateorder.h
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistrotateorder.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEDYNAMICLISTROTATEORDER_H
-#define __SINFG_APP_ACTION_VALUENODEDYNAMICLISTROTATEORDER_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_bline.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeDynamicListRotateOrder :
-       public Super
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       int index;
-
-
-public:
-
-       ValueNodeDynamicListRotateOrder();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistunloop.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistunloop.cpp
deleted file mode 100644 (file)
index 4ba2ead..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistunloop.cpp
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistunloop.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodedynamiclistunloop.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeDynamicListUnLoop);
-ACTION_SET_NAME(Action::ValueNodeDynamicListUnLoop,"value_node_dynamic_list_unloop");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListUnLoop,"Unloop");
-ACTION_SET_TASK(Action::ValueNodeDynamicListUnLoop,"unloop");
-ACTION_SET_CATEGORY(Action::ValueNodeDynamicListUnLoop,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeDynamicListUnLoop,0);
-ACTION_SET_VERSION(Action::ValueNodeDynamicListUnLoop,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeDynamicListUnLoop,"$Id: valuenodedynamiclistunloop.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeDynamicListUnLoop::ValueNodeDynamicListUnLoop()
-{
-}
-
-Action::ParamVocab
-Action::ValueNodeDynamicListUnLoop::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode"))
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeDynamicListUnLoop::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueNode::Handle value_node(x.find("value_node")->second.get_value_node());
-               if(!ValueNode_DynamicList::Handle::cast_dynamic(value_node))
-                       return false;
-               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)->get_loop()==false)
-                       return false;
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeDynamicListUnLoop::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {               
-               value_node=ValueNode_DynamicList::Handle::cast_dynamic(param.get_value_node());
-               
-               if(!value_node)
-                       return false;
-
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeDynamicListUnLoop::is_ready()const
-{
-       if(!value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeDynamicListUnLoop::perform()
-{      
-       old_loop_value=value_node->get_loop();
-       
-       if(old_loop_value==false)
-       {
-               set_dirty(false);
-               return;
-       }
-
-       set_dirty(true);
-       value_node->set_loop(false);
-               
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
-
-void
-Action::ValueNodeDynamicListUnLoop::undo()
-{
-       if(old_loop_value==value_node->get_loop())
-       {
-               set_dirty(false);
-               return;
-       }
-
-       set_dirty(true);
-       value_node->set_loop(old_loop_value);
-               
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistunloop.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodedynamiclistunloop.h
deleted file mode 100644 (file)
index 0abc884..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodedynamiclistunloop.h
-**     \brief Template File
-**
-**     $Id: valuenodedynamiclistunloop.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEDYNAMICLISTUNLOOP_H
-#define __SINFG_APP_ACTION_VALUENODEDYNAMICLISTUNLOOP_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/activepoint.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/valuenode_bline.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeDynamicListUnLoop :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode_DynamicList::Handle value_node;
-       bool old_loop_value;
-
-
-public:
-
-       ValueNodeDynamicListUnLoop();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkconnect.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkconnect.cpp
deleted file mode 100644 (file)
index 7502a4e..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodelinkconnect.cpp
-**     \brief Template File
-**
-**     $Id: valuenodelinkconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodelinkconnect.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeLinkConnect);
-ACTION_SET_NAME(Action::ValueNodeLinkConnect,"value_node_link_connect");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeLinkConnect,_("Connect ValueNode Link"));
-ACTION_SET_TASK(Action::ValueNodeLinkConnect,"connect");
-ACTION_SET_CATEGORY(Action::ValueNodeLinkConnect,Action::CATEGORY_LAYER|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeLinkConnect,0);
-ACTION_SET_VERSION(Action::ValueNodeLinkConnect,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeLinkConnect,"$Id: valuenodelinkconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeLinkConnect::ValueNodeLinkConnect():
-       index(-1)       // Initially set it to negative one so that we know when it has changed
-{
-}
-
-Action::ParamVocab
-Action::ValueNodeLinkConnect::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("parent_value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("Parent ValueNode"))
-       );
-
-       ret.push_back(ParamDesc("index",Param::TYPE_INTEGER)
-               .set_local_name(_("Index"))
-       );
-
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode to be connected"))
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeLinkConnect::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::ValueNodeLinkConnect::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="parent_value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               parent_value_node=LinkableValueNode::Handle::cast_dynamic(param.get_value_node());
-               
-               return static_cast<bool>(parent_value_node);
-       }
-
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               new_value_node=param.get_value_node();
-               
-               return true;
-       }
-
-       if(name=="index" && param.get_type()==Param::TYPE_INTEGER)
-       {
-               index=param.get_integer();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeLinkConnect::is_ready()const
-{
-       if(!new_value_node || !parent_value_node || index==-1)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeLinkConnect::perform()
-{
-       if(parent_value_node->link_count()<=index)
-               throw Error(_("Bad index, too big. LinkCount=%d, Index=%d"),parent_value_node->link_count(),index);             
-               
-       old_value_node=parent_value_node->get_link(index);
-
-       if(!parent_value_node->set_link(index,new_value_node))
-               throw Error(_("Parent would not accept link"));
-       
-       /*set_dirty(true);
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(parent_value_node);
-       }*/
-}
-
-void
-Action::ValueNodeLinkConnect::undo()
-{
-       if(parent_value_node->link_count()<=index)
-               throw Error(_("Bad index, too big. LinkCount=%d, Index=%d"),parent_value_node->link_count(),index);             
-               
-       if(!parent_value_node->set_link(index,old_value_node))
-               throw Error(_("Parent would not accept old link"));
-       
-       /*set_dirty(true);
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(parent_value_node);
-       }*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkconnect.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkconnect.h
deleted file mode 100644 (file)
index ce7663c..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodelinkconnect.h
-**     \brief Template File
-**
-**     $Id: valuenodelinkconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODELINKCONNECT_H
-#define __SINFG_APP_ACTION_VALUENODELINKCONNECT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/valuenode.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeLinkConnect :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::LinkableValueNode::Handle        parent_value_node;
-       sinfg::ValueNode::Handle        new_value_node;
-       sinfg::ValueNode::Handle        old_value_node;
-       int index;
-
-
-public:
-
-       ValueNodeLinkConnect();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkdisconnect.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkdisconnect.cpp
deleted file mode 100644 (file)
index 90e0f1b..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodelinkdisconnect.cpp
-**     \brief Template File
-**
-**     $Id: valuenodelinkdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodelinkdisconnect.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/valuenode_const.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeLinkDisconnect);
-ACTION_SET_NAME(Action::ValueNodeLinkDisconnect,"value_node_link_disconnect");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeLinkDisconnect,_("Disconnect ValueNode Link"));
-ACTION_SET_TASK(Action::ValueNodeLinkDisconnect,"disconnect");
-ACTION_SET_CATEGORY(Action::ValueNodeLinkDisconnect,Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeLinkDisconnect,0);
-ACTION_SET_VERSION(Action::ValueNodeLinkDisconnect,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeLinkDisconnect,"$Id: valuenodelinkdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeLinkDisconnect::ValueNodeLinkDisconnect():
-       index(-1),      // Initially set it to negative one so that we know when it has changed
-       time(0)
-{
-}
-
-Action::ParamVocab
-Action::ValueNodeLinkDisconnect::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("parent_value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("Parent ValueNode"))
-       );
-
-       ret.push_back(ParamDesc("index",Param::TYPE_INTEGER)
-               .set_local_name(_("Index"))
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_optional()
-       );
-
-       return ret;
-}
-
-bool
-Action::ValueNodeLinkDisconnect::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::ValueNodeLinkDisconnect::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="parent_value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               parent_value_node=LinkableValueNode::Handle::cast_dynamic(param.get_value_node());
-               
-               return static_cast<bool>(parent_value_node);
-       }
-
-       if(name=="index" && param.get_type()==Param::TYPE_INTEGER)
-       {
-               index=param.get_integer();
-               
-               return true;
-       }
-
-       if(name=="time" && param.get_type()==Param::TYPE_TIME)
-       {
-               time=param.get_time();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeLinkDisconnect::is_ready()const
-{
-       if(!parent_value_node || index==-1)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeLinkDisconnect::perform()
-{
-       if(parent_value_node->link_count()<=index)
-               throw Error(_("Bad index, too big. LinkCount=%d, Index=%d"),parent_value_node->link_count(),index);             
-               
-       old_value_node=parent_value_node->get_link(index);
-
-       if(!parent_value_node->set_link(index,ValueNode_Const::create((*old_value_node)(time))))
-               throw Error(_("Parent would not accept link"));
-       
-       /*
-       if(get_canvas()->get_time()!=time)
-               set_dirty(true);
-       else
-               set_dirty(false);
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(parent_value_node);
-       }
-       */
-}
-
-void
-Action::ValueNodeLinkDisconnect::undo()
-{
-       if(parent_value_node->link_count()<=index)
-               throw Error(_("Bad index, too big. LinkCount=%d, Index=%d"),parent_value_node->link_count(),index);             
-               
-       if(!parent_value_node->set_link(index,old_value_node))
-               throw Error(_("Parent would not accept old link"));
-       
-       /*if(get_canvas()->get_time()!=time)
-               set_dirty(true);
-       else
-               set_dirty(false);
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(parent_value_node);
-       }*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkdisconnect.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodelinkdisconnect.h
deleted file mode 100644 (file)
index 19b2865..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodelinkdisconnect.h
-**     \brief Template File
-**
-**     $Id: valuenodelinkdisconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODELINKDISCONNECT_H
-#define __SINFG_APP_ACTION_VALUENODELINKDISCONNECT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/valuenode.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeLinkDisconnect :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::LinkableValueNode::Handle        parent_value_node;
-       int index;
-       sinfg::ValueNode::Handle        old_value_node;
-       sinfg::Time time;
-
-public:
-
-       ValueNodeLinkDisconnect();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenoderemove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenoderemove.cpp
deleted file mode 100644 (file)
index 2dbb176..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenoderemove.cpp
-**     \brief Template File
-**
-**     $Id: valuenoderemove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenoderemove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeRemove);
-ACTION_SET_NAME(Action::ValueNodeRemove,"value_node_remove");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeRemove,_("Unexport"));
-ACTION_SET_TASK(Action::ValueNodeRemove,"remove");
-ACTION_SET_CATEGORY(Action::ValueNodeRemove,Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeRemove,0);
-ACTION_SET_VERSION(Action::ValueNodeRemove,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeRemove,"$Id: valuenoderemove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeRemove::ValueNodeRemove()
-{
-}
-
-Action::ParamVocab
-Action::ValueNodeRemove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueNodeRemove::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               ValueNode::Handle value_node=x.find("value_node")->second.get_value_node();
-               if(!value_node->is_exported())
-                       return false;
-//             if(value_node->rcount()!=1)
-//                     return false;
-               return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeRemove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=param.get_value_node();
-               
-               if(value_node && !value_node->is_exported())
-               {
-                       sinfg::error("Action::ValueNodeRemove::set_param(): ValueBase node not exported!");
-                       value_node=0;
-               }
-               
-               return (bool)value_node;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeRemove::is_ready()const
-{
-       if(!value_node)
-               sinfg::error("Action::ValueNodeRemove::is_ready(): ValueNode not set!");
-
-       if(!value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeRemove::perform()
-{      
-//     if(value_node->rcount()!=1)
-//             throw Error(_("ValueNode is still being used by something"));
-
-       old_name=value_node->get_id();
-       parent_canvas=value_node->get_parent_canvas();
-       parent_canvas->remove_value_node(value_node);
-
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_deleted()(value_node);
-       }
-       
-       //throw Error(_("Not yet implemented"));
-/*
-       assert(value_node->is_exported());
-
-       if(get_canvas()->value_node_list().count(new_name))
-               throw Error(_("A ValueNode with this ID already exists in this canvas"));
-       
-       old_name=value_node->get_id();
-
-       value_node->set_id(new_name);   
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-*/
-}
-
-void
-Action::ValueNodeRemove::undo()
-{
-       parent_canvas->add_value_node(value_node,old_name);
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_added()(value_node);
-       }
-       
-       //throw Error(_("Not yet implemented"));
-/*
-       assert(value_node->is_exported());
-
-       if(get_canvas()->value_node_list().count(old_name))
-               throw Error(_("A ValueNode with the old ID already exists in this canvas (BUG)"));
-       
-       value_node->set_id(old_name);   
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenoderemove.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenoderemove.h
deleted file mode 100644 (file)
index 94207bd..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenoderemove.h
-**     \brief Template File
-**
-**     $Id: valuenoderemove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEREMOVE_H
-#define __SINFG_APP_ACTION_VALUENODEREMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/valuenode_const.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeRemove :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode::Handle value_node;
-       sinfg::Canvas::Handle parent_canvas;
-       sinfg::String new_name;
-       sinfg::String old_name;
-
-
-public:
-
-       ValueNodeRemove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenoderename.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenoderename.cpp
deleted file mode 100644 (file)
index 1a6bd1a..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenoderename.cpp
-**     \brief Template File
-**
-**     $Id: valuenoderename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenoderename.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeRename);
-ACTION_SET_NAME(Action::ValueNodeRename,"value_node_rename");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeRename,_("Rename ValueNode"));
-ACTION_SET_TASK(Action::ValueNodeRename,"rename");
-ACTION_SET_CATEGORY(Action::ValueNodeRename,Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::ValueNodeRename,0);
-ACTION_SET_VERSION(Action::ValueNodeRename,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeRename,"$Id: valuenoderename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeRename::ValueNodeRename()
-{
-}
-
-Action::ParamVocab
-Action::ValueNodeRename::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode_Const"))
-       );
-
-       ret.push_back(ParamDesc("name",Param::TYPE_STRING)
-               .set_local_name(_("Name"))
-               .set_desc(_("The new name of the ValueNode"))
-               .set_user_supplied()
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueNodeRename::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               if(x.find("value_node")->second.get_value_node()->is_exported())
-                       return true;
-       }
-       return false;
-}
-
-bool
-Action::ValueNodeRename::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=param.get_value_node();
-               
-               if(value_node && !value_node->is_exported())
-               {
-                       sinfg::error("Action::ValueNodeRename::set_param(): ValueBase node not exported!");
-                       value_node=0;
-               }
-               
-               return (bool)value_node;
-       }
-
-       if(name=="name" && param.get_type()==Param::TYPE_STRING)
-       {
-               new_name=param.get_string();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeRename::is_ready()const
-{
-       if(!value_node)
-               sinfg::error("Action::ValueNodeRename::is_ready(): ValueNode not set!");
-
-       if(new_name.empty())
-               sinfg::error("Action::ValueNodeRename::is_ready(): ValueNode not set!");
-
-       if(!value_node || new_name.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeRename::perform()
-{      
-       assert(value_node->is_exported());
-
-       if(get_canvas()->value_node_list().count(new_name))
-               throw Error(_("A ValueNode with this ID already exists in this canvas"));
-       
-       old_name=value_node->get_id();
-
-       value_node->set_id(new_name);   
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-}
-
-void
-Action::ValueNodeRename::undo()
-{
-       assert(value_node->is_exported());
-
-       if(get_canvas()->value_node_list().count(old_name))
-               throw Error(_("A ValueNode with the old ID already exists in this canvas (BUG)"));
-       
-       value_node->set_id(old_name);   
-       
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenoderename.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenoderename.h
deleted file mode 100644 (file)
index 026eee7..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenoderename.h
-**     \brief Template File
-**
-**     $Id: valuenoderename.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODERENAME_H
-#define __SINFG_APP_ACTION_VALUENODERENAME_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/valuenode_const.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeRename :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode::Handle value_node;
-       sinfg::String new_name;
-       sinfg::String old_name;
-
-
-public:
-
-       ValueNodeRename();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodereplace.cpp b/synfig-studio/trunk/src/sinfgapp/actions/valuenodereplace.cpp
deleted file mode 100644 (file)
index f9a0e25..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodereplace.cpp
-**     \brief Template File
-**
-**     $Id: valuenodereplace.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "valuenodereplace.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::ValueNodeReplace);
-ACTION_SET_NAME(Action::ValueNodeReplace,"value_node_replace");
-ACTION_SET_LOCAL_NAME(Action::ValueNodeReplace,"Replace ValueNode");
-ACTION_SET_TASK(Action::ValueNodeReplace,"replace");
-ACTION_SET_CATEGORY(Action::ValueNodeReplace,Action::CATEGORY_VALUENODE|Action::CATEGORY_DRAG);
-ACTION_SET_PRIORITY(Action::ValueNodeReplace,0);
-ACTION_SET_VERSION(Action::ValueNodeReplace,"0.0");
-ACTION_SET_CVS_ID(Action::ValueNodeReplace,"$Id: valuenodereplace.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-void swap_guid(const ValueNode::Handle& a,const ValueNode::Handle& b)
-{
-       GUID old_a(a->get_guid());
-       a->set_guid(GUID());
-
-       GUID old_b(b->get_guid());
-       b->set_guid(GUID());
-       
-       a->set_guid(old_b);
-       b->set_guid(old_a);
-}
-
-/* === M E T H O D S ======================================================= */
-
-Action::ValueNodeReplace::ValueNodeReplace():
-       is_undoable(true)
-{
-}
-
-Action::ParamVocab
-Action::ValueNodeReplace::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("dest",Param::TYPE_VALUENODE)
-               .set_local_name(_("Destination ValueNode"))
-               .set_desc(_("ValueNode to replaced"))
-       );
-
-       ret.push_back(ParamDesc("src",Param::TYPE_VALUENODE)
-               .set_local_name(_("Source ValueNode"))
-               .set_desc(_("ValueNode that will replace the destination"))
-       );
-       
-       return ret;
-}
-
-bool
-Action::ValueNodeReplace::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::ValueNodeReplace::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="dest" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               dest_value_node=param.get_value_node();
-               
-               return true;
-       }
-
-       if(name=="src" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               src_value_node=param.get_value_node();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::ValueNodeReplace::is_ready()const
-{
-       if(!dest_value_node || !src_value_node)
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::ValueNodeReplace::perform()
-{
-       set_dirty(true);
-
-       if(dest_value_node == src_value_node)
-               throw Error(_("Attempted to replace valuenode with itself"));
-
-       if(dest_value_node->get_type() != src_value_node->get_type())
-               throw Error(_("You cannot replace ValueNodes with different types!"));
-       
-       is_undoable=true;
-       
-       if(!src_value_node->is_exported())
-       {
-               src_value_node->set_id(dest_value_node->get_id());
-               src_value_node->set_parent_canvas(dest_value_node->get_parent_canvas());
-
-               ValueNode::RHandle value_node(src_value_node);
-               
-               if(!value_node.runique() && value_node.rcount()>1)
-                       is_undoable=false;      // !!!
-       }
-       else
-               is_undoable=false;      // !!!
-       
-       if(!is_undoable)
-               sinfg::warning("ValueNodeReplace: Circumstances make undoing this action impossible at the current time. :(");
-       
-       ValueNode::RHandle value_node(dest_value_node);
-       
-       if(value_node.runique() || value_node.rcount()<=1)
-               throw Error(_("Nothing to replace."));
-       
-       int replacements;
-               
-       replacements=value_node->replace(src_value_node);
-       assert(replacements);
-       if(!replacements)
-               throw Error(_("Action Failure. This is a bug. Please report it."));
-       swap_guid(dest_value_node,src_value_node);
-       
-       //src_value_node->parent_set.swap(dest_value_node->parent_set);
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_replaced()(dest_value_node,src_value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-       
-}
-
-void
-Action::ValueNodeReplace::undo()
-{
-       if(!is_undoable)
-               throw Error(_("This action cannot be undone under these circumstances."));
-               
-       set_dirty(true);
-
-       if(dest_value_node == src_value_node)
-               throw Error(_("Attempted to replace valuenode with itself"));
-
-       if(dest_value_node->get_type() != src_value_node->get_type())
-               throw Error(_("You cannot replace ValueNodes with different types!"));
-               
-       ValueNode::RHandle value_node(src_value_node);
-       
-       if(value_node.runique() || value_node.rcount()<=1)
-               throw Error(_("Nothing to replace."));
-       
-       int replacements;
-       
-       replacements=value_node->replace(dest_value_node);
-       assert(replacements);
-       if(!replacements)
-               throw Error(_("Action Failure. This is a bug. Please report it."));
-       swap_guid(dest_value_node,src_value_node);
-
-       //src_value_node->parent_set.swap(dest_value_node->parent_set);
-       
-       sinfg::info(get_name()+_(": (Undo) ")+strprintf("Replaced %d ValueNode instances",replacements));
-
-       src_value_node->set_id(String());
-       src_value_node->set_parent_canvas(0);
-       
-       // Signal that a layer has been inserted
-       if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_replaced()(src_value_node,dest_value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");
-       
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/valuenodereplace.h b/synfig-studio/trunk/src/sinfgapp/actions/valuenodereplace.h
deleted file mode 100644 (file)
index 3395e20..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file valuenodereplace.h
-**     \brief Template File
-**
-**     $Id: valuenodereplace.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_VALUENODEREPLACE_H
-#define __SINFG_APP_ACTION_VALUENODEREPLACE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/layer.h>
-#include <sinfgapp/action.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class ValueNodeReplace :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode::Handle src_value_node;
-       sinfg::ValueNode::Handle dest_value_node;
-       bool is_undoable;
-
-public:
-
-       ValueNodeReplace();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointadd.cpp b/synfig-studio/trunk/src/sinfgapp/actions/waypointadd.cpp
deleted file mode 100644 (file)
index 87105fb..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointadd.cpp
-**     \brief Template File
-**
-**     $Id: waypointadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "waypointadd.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfgapp/main.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::WaypointAdd);
-ACTION_SET_NAME(Action::WaypointAdd,"waypoint_add");
-ACTION_SET_LOCAL_NAME(Action::WaypointAdd,"Add Waypoint");
-ACTION_SET_TASK(Action::WaypointAdd,"add");
-ACTION_SET_CATEGORY(Action::WaypointAdd,Action::CATEGORY_WAYPOINT);
-ACTION_SET_PRIORITY(Action::WaypointAdd,0);
-ACTION_SET_VERSION(Action::WaypointAdd,"0.0");
-ACTION_SET_CVS_ID(Action::WaypointAdd,"$Id: waypointadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::WaypointAdd::WaypointAdd()
-{
-       waypoint.set_time(Time::begin()-1);
-       time_set=false;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::WaypointAdd::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("Destination ValueNode (Animated)"))
-       );
-
-       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
-               .set_local_name(_("New Waypoint"))
-               .set_desc(_("Waypoint to be added"))
-               .set_optional()
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_desc(_("Time where waypoint is to be added"))
-               .set_optional()
-       );
-
-       return ret;
-}
-
-bool
-Action::WaypointAdd::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               if(!ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
-                       return false;
-
-               // We need either a waypoint or a time.
-               if(x.count("waypoint") || x.count("time"))
-                       return true;
-       }
-       return false;
-}
-
-bool
-Action::WaypointAdd::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
-               if(time_set)
-                       calc_waypoint();
-               
-               return static_cast<bool>(value_node);
-       }
-       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT && !time_set)
-       {
-               waypoint=param.get_waypoint();
-               
-               return true;
-       }
-       if(name=="time" && param.get_type()==Param::TYPE_TIME && waypoint.get_time()==Time::begin()-1)
-       {
-               waypoint.set_time(param.get_time());
-               time_set=true;
-
-               if(value_node)
-                       calc_waypoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::WaypointAdd::is_ready()const
-{
-       if(!value_node || waypoint.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-// This function is called if a time is specified, but not 
-// a waypoint. In this case, we need to calculate the value
-// of the waypoint
-void
-Action::WaypointAdd::calc_waypoint()
-{      
-       Time time=waypoint.get_time();
-       Waypoint original(waypoint);
-       waypoint=value_node->new_waypoint_at_time(time);        
-       waypoint.mimic(original);
-       waypoint.set_before(sinfgapp::Main::get_interpolation());
-       waypoint.set_after(sinfgapp::Main::get_interpolation());
-
-/*
-       ValueNode_Animated::WaypointList &waypoint_list(value_node->waypoint_list());
-       ValueNode_Animated::WaypointList::iterator iter;
-       
-       if(waypoint_list.empty())
-       {
-               waypoint.set_value((*value_node)(time));
-               return;
-       }
-
-       ValueNode_Animated::WaypointList::iterator closest=waypoint_list.begin();
-               
-       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(!closest->is_static())
-               waypoint.set_value_node(closest->get_value_node());
-       else
-               waypoint.set_value((*value_node)(time));
-       */
-}
-
-void
-Action::WaypointAdd::perform()
-{              
-       try { value_node->find(waypoint.get_time()); throw Error(_("A Waypoint already exists at this point in time (%s)"),waypoint.get_time().get_string().c_str());}
-       catch(sinfg::Exception::NotFound) { }   
-
-       try { if(value_node->find(waypoint)!=value_node->waypoint_list().end()) throw Error(_("This waypoint is already in the ValueNode"));}
-       catch(sinfg::Exception::NotFound) { }   
-       
-       value_node->add(waypoint);
-       
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
-
-void
-Action::WaypointAdd::undo()
-{
-       value_node->erase(waypoint);
-       
-       value_node->changed();
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointadd.h b/synfig-studio/trunk/src/sinfgapp/actions/waypointadd.h
deleted file mode 100644 (file)
index 720bf17..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointadd.h
-**     \brief Template File
-**
-**     $Id: waypointadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_WAYPOINTADD_H
-#define __SINFG_APP_ACTION_WAYPOINTADD_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/waypoint.h>
-#include <sinfg/valuenode_animated.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class WaypointAdd :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::Waypoint waypoint;
-       
-       bool time_overwrite;
-       sinfg::Waypoint overwritten_wp;
-
-       sinfg::ValueNode_Animated::Handle value_node;
-       bool time_set;
-
-       void calc_waypoint();
-
-public:
-
-       WaypointAdd();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointremove.cpp b/synfig-studio/trunk/src/sinfgapp/actions/waypointremove.cpp
deleted file mode 100644 (file)
index fd8154c..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointremove.cpp
-**     \brief Template File
-**
-**     $Id: waypointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "waypointremove.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::WaypointRemove);
-ACTION_SET_NAME(Action::WaypointRemove,"waypoint_remove");
-ACTION_SET_LOCAL_NAME(Action::WaypointRemove,"Remove Waypoint");
-ACTION_SET_TASK(Action::WaypointRemove,"remove");
-ACTION_SET_CATEGORY(Action::WaypointRemove,Action::CATEGORY_WAYPOINT);
-ACTION_SET_PRIORITY(Action::WaypointRemove,0);
-ACTION_SET_VERSION(Action::WaypointRemove,"0.0");
-ACTION_SET_CVS_ID(Action::WaypointRemove,"$Id: waypointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::WaypointRemove::WaypointRemove()
-{
-       waypoint.set_time(Time::begin()-1);
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::WaypointRemove::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("ValueNode (Animated)"))
-       );
-
-       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
-               .set_local_name(_("Waypoint"))
-               .set_desc(_("Waypoint to be Removed"))
-       );
-
-       return ret;
-}
-
-bool
-Action::WaypointRemove::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::WaypointRemove::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
-               
-               return static_cast<bool>(value_node);
-       }
-       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT)
-       {
-               waypoint=param.get_waypoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::WaypointRemove::is_ready()const
-{
-       if(!value_node || waypoint.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::WaypointRemove::perform()
-{      
-       WaypointList::iterator iter(value_node->find(waypoint));
-
-       if((UniqueID)*iter!=(UniqueID)waypoint)
-               throw Error(_("UniqueID mismatch, iter=%d, waypoint=%d"),iter->get_uid(),waypoint.get_uid());
-
-       if(iter->get_time()!=waypoint.get_time())
-               throw Error(_("Time mismatch iter=%s, waypoint=%s"),iter->get_time().get_string().c_str(),waypoint.get_time().get_string().c_str());
-       
-       waypoint=*iter;
-       
-       value_node->erase(waypoint);
-
-       // In this case, we need to convert this to a
-       // constant value node
-       if(value_node->waypoint_list().size()==0)
-       {
-               if(!value_node_ref)
-               {
-                       value_node_ref=waypoint.get_value_node();
-                       if(!value_node_ref)
-                               throw Error(_("Unable to create ValueNode_Reference"));
-               }
-               
-               value_node->replace(value_node_ref);
-               value_node->waypoint_list().clear();
-               
-               if(get_canvas_interface())
-               {
-                       get_canvas_interface()->signal_value_node_replaced()(value_node,value_node_ref);
-               }
-       }
-
-       value_node->changed();
-}
-
-void
-Action::WaypointRemove::undo()
-{
-       if(value_node_ref)
-       {
-               if(value_node->waypoint_list().size()!=0)
-                       throw Error(_("This animated value node should be empty, but for some reason it isn't. This is a bug. (1)"));
-               
-               value_node_ref->replace(value_node);
-               
-               waypoint.set_value_node(value_node_ref);
-               
-               if(get_canvas_interface())
-                       get_canvas_interface()->signal_value_node_replaced()(value_node_ref,value_node);
-
-               if(value_node->waypoint_list().size()!=0)
-                       throw Error(_("This animated value node should be empty, but for some reason it isn't. This is a bug. (2)"));
-       }
-
-       if(value_node->waypoint_list().size()!=0)
-       {
-               try { value_node->find(waypoint.get_time()); throw Error(_("A Waypoint already exists at this point in time"));}
-               catch(sinfg::Exception::NotFound) { }   
-               
-               try { if(value_node->find(waypoint)!=value_node->waypoint_list().end()) throw Error(_("This waypoint is already in the ValueNode"));}
-               catch(sinfg::Exception::NotFound) { }   
-       }
-       
-       value_node->add(waypoint);
-       
-/*_if(get_canvas_interface())
-       {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
-       }
-       else sinfg::warning("CanvasInterface not set on action");*/
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointremove.h b/synfig-studio/trunk/src/sinfgapp/actions/waypointremove.h
deleted file mode 100644 (file)
index 8a161b0..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointremove.h
-**     \brief Template File
-**
-**     $Id: waypointremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_WAYPOINTREMOVE_H
-#define __SINFG_APP_ACTION_WAYPOINTREMOVE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/waypoint.h>
-#include <sinfg/valuenode_animated.h>
-#include <sinfg/valuenode_reference.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class WaypointRemove :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-
-       sinfg::ValueNode_Animated::Handle value_node;
-       sinfg::ValueNode::Handle value_node_ref;
-       sinfg::Waypoint waypoint;
-
-public:
-
-       WaypointRemove();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointset.cpp b/synfig-studio/trunk/src/sinfgapp/actions/waypointset.cpp
deleted file mode 100644 (file)
index 4ee92f4..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointset.cpp
-**     \brief Template File
-**
-**     $Id: waypointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "waypointset.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::WaypointSet);
-ACTION_SET_NAME(Action::WaypointSet,"waypoint_set");
-ACTION_SET_LOCAL_NAME(Action::WaypointSet,"Set Waypoint");
-ACTION_SET_TASK(Action::WaypointSet,"set");
-ACTION_SET_CATEGORY(Action::WaypointSet,Action::CATEGORY_WAYPOINT);
-ACTION_SET_PRIORITY(Action::WaypointSet,0);
-ACTION_SET_VERSION(Action::WaypointSet,"0.0");
-ACTION_SET_CVS_ID(Action::WaypointSet,"$Id: waypointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::WaypointSet::WaypointSet()
-{
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::WaypointSet::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("Destination ValueNode (Animated)"))
-       );
-
-       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
-               .set_local_name(_("Waypoint"))
-               .set_desc(_("Waypoint to be changed"))
-               .set_supports_multiple()
-       );
-
-       return ret;
-}
-
-bool
-Action::WaypointSet::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::WaypointSet::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
-               
-               return static_cast<bool>(value_node);
-       }
-       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT)
-       {
-               //NOTE: at the moment there is no error checking for multiple sets!!!
-               waypoints.push_back(param.get_waypoint());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::WaypointSet::is_ready()const
-{
-       if(!value_node || waypoints.empty())
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::WaypointSet::perform()
-{      
-       WaypointList::iterator iter;
-
-#if 1  
-       vector<WaypointList::iterator>  iters;
-       vector<Waypoint>::iterator i = waypoints.begin(), end = waypoints.end();        
-       
-       for(; i != end; ++i)
-       {
-               try { iters.push_back(value_node->find(*i)); }
-               catch(sinfg::Exception::NotFound)
-               {
-                       throw Error(_("Unable to find waypoint"));
-               }
-       }
-       
-       //check to see which valuenodes are going to override because of the time...
-       ValueNode_Animated::findresult timeiter;
-       
-       for(i = waypoints.begin(); i != end; ++i)
-       {
-               timeiter = value_node->find_time(i->get_time());
-               
-               bool candelete = timeiter.second;
-       
-               //we only want to track overwrites (not waypoints that are also being modified)
-               if(candelete)
-               {
-                       for(vector<WaypointList::iterator>::iterator ii = iters.begin(); ii != iters.end(); ++ii)
-                       {
-                               if(timeiter.first == *ii)
-                               {
-                                       candelete = false;
-                                       break;
-                               }
-                       }
-               }
-               
-               //if we can still delete it after checking, record it, and then remove them all later
-               if(candelete)
-               {
-                       Waypoint w = *timeiter.first;
-                       overwritten_waypoints.push_back(w);
-               }
-       }
-       
-       //overwrite all the valuenodes we're supposed to set
-       {
-               i = waypoints.begin();
-               for(vector<WaypointList::iterator>::iterator ii = iters.begin(); ii != iters.end() && i != end; ++ii, ++i)
-               {
-                       old_waypoints.push_back(**ii);
-                       **ii = *i; //set the point to the corresponding point in the normal waypoint list
-               }
-       }
-       
-       //remove all the points we're supposed to be overwritting
-       {
-               vector<Waypoint>::iterator      oi = overwritten_waypoints.begin(),
-                                                                       oend = overwritten_waypoints.end();
-               for(; oi != oend; ++oi)
-               {
-                       value_node->erase(*oi);
-               }
-       }
-
-#else
-       try { iter=value_node->find(waypoint); }
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find waypoint"));
-       }
-
-       //find the value at the old time before we replace it
-       ValueNode_Animated::findresult timeiter;
-       timeiter = value_node->find_time(waypoint.get_time());
-       
-       //we only want to track overwrites (not inplace modifications)
-       if(timeiter.second && waypoint.get_uid() == timeiter.first->get_uid())
-       {
-               timeiter.second = false;                        
-       }
-               
-       //copy and overwrite
-       old_waypoint=*iter;
-       *iter=waypoint;
-       
-       //if we've found a unique one then we need to erase it, but store it first
-       if(timeiter.second)
-       {
-               time_overwrite = true;
-               overwritten_wp = *timeiter.first;
-               
-               value_node->erase(overwritten_wp);
-       }
-#endif
-       
-       // Signal that a valuenode has been changed
-       value_node->changed();
-}
-
-void
-Action::WaypointSet::undo()
-{
-       WaypointList::iterator iter;
-       
-#if 1
-       vector<Waypoint>::iterator i = old_waypoints.begin(), end = old_waypoints.end();        
-       
-       for(; i != end; ++i)
-       {
-               try { iter = value_node->find(*i); }
-               catch(sinfg::Exception::NotFound)
-               {
-                       throw Error(_("Unable to find waypoint"));
-               }
-               
-               //overwrite with old one
-               *iter = *i;
-       }
-               
-       //add back in all the points that we removed before...
-       {
-               vector<Waypoint>::iterator      oi = overwritten_waypoints.begin(),
-                                                                       oend = overwritten_waypoints.end();
-               for(; oi != oend; ++oi)
-               {
-                       value_node->add(*oi);
-               }
-       }
-
-#else
-       try { iter=value_node->find(old_waypoint); }
-       catch(sinfg::Exception::NotFound)
-       {
-               throw Error(_("Unable to find waypoint"));
-       }       
-
-       *iter=old_waypoint;
-       
-       if(time_overwrite)
-       {
-               value_node->add(overwritten_wp);
-       }
-#endif
-       
-       // Signal that a valuenode has been changed
-       value_node->changed();
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointset.h b/synfig-studio/trunk/src/sinfgapp/actions/waypointset.h
deleted file mode 100644 (file)
index e0e4bda..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointset.h
-**     \brief Template File
-**
-**     $Id: waypointset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_WAYPOINTSET_H
-#define __SINFG_APP_ACTION_WAYPOINTSET_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/waypoint.h>
-#include <sinfg/valuenode_animated.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class WaypointSet :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-       
-       sinfg::ValueNode_Animated::Handle value_node;
-       
-       std::vector<sinfg::Waypoint> waypoints;
-       std::vector<sinfg::Waypoint> old_waypoints;     
-
-       std::vector<sinfg::Waypoint> overwritten_waypoints;
-
-public:
-
-       WaypointSet();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointsetsmart.cpp b/synfig-studio/trunk/src/sinfgapp/actions/waypointsetsmart.cpp
deleted file mode 100644 (file)
index a110bb0..0000000
+++ /dev/null
@@ -1,467 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointsetsmart.cpp
-**     \brief Template File
-**
-**     $Id: waypointsetsmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "waypointsetsmart.h"
-#include "valuenodelinkconnect.h"
-#include "valuenodereplace.h"
-
-#include "waypointset.h"
-#include "waypointadd.h"
-
-#include "valuedescconnect.h"
-#include <sinfgapp/canvasinterface.h>
-#include <sinfg/exception.h>
-#include <sinfgapp/main.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::WaypointSetSmart);
-ACTION_SET_NAME(Action::WaypointSetSmart,"waypoint_set_smart");
-ACTION_SET_LOCAL_NAME(Action::WaypointSetSmart,"Connect");
-ACTION_SET_TASK(Action::WaypointSetSmart,"set");
-ACTION_SET_CATEGORY(Action::WaypointSetSmart,Action::CATEGORY_WAYPOINT|Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
-ACTION_SET_PRIORITY(Action::WaypointSetSmart,0);
-ACTION_SET_VERSION(Action::WaypointSetSmart,"0.0");
-ACTION_SET_CVS_ID(Action::WaypointSetSmart,"$Id: waypointsetsmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-
-/*#ifdef DEBUGPOINT
-#undef DEBUGPOINT
-#endif
-#define DEBUGPOINT()
-*/
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::WaypointSetSmart::WaypointSetSmart()
-{
-       waypoint.set_time(Time::begin()-1);
-       time_set=false;
-       set_dirty(true);
-}
-
-Action::ParamVocab
-Action::WaypointSetSmart::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("Destination ValueNode (Animated)"))
-       );
-
-       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
-               .set_local_name(_("New Waypoint"))
-               .set_desc(_("Waypoint to be added"))
-               .set_optional()
-       );
-
-       ret.push_back(ParamDesc("waypoint_model",Param::TYPE_WAYPOINTMODEL)
-               .set_local_name(_("Waypoint Model"))
-               .set_optional()
-       );
-
-       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
-               .set_local_name(_("Time"))
-               .set_desc(_("Time where waypoint is to be added"))
-               .set_optional()
-       );
-       
-       return ret;
-}
-
-bool
-Action::WaypointSetSmart::is_canidate(const ParamList &x)
-{
-       if(canidate_check(get_param_vocab(),x))
-       {
-               if(!ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
-                       return false;
-               // We need either a waypoint or a time.
-               if(x.count("waypoint") || x.count("time"))
-                       return true;
-               return false;
-       }
-       return false;
-}
-
-bool
-Action::WaypointSetSmart::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
-               DEBUGPOINT();
-               if(time_set)
-                       calc_waypoint();
-               
-               return static_cast<bool>(value_node);
-       }
-       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT && !time_set)
-       {
-               waypoint=param.get_waypoint();
-               DEBUGPOINT();
-               
-               return true;
-       }
-
-       if(name=="time" && param.get_type()==Param::TYPE_TIME && waypoint.get_time()==(Time::begin()-1))
-       {
-               waypoint.set_time(param.get_time());
-               time_set=true;
-
-               if(value_node)
-                       calc_waypoint();
-               DEBUGPOINT();
-               
-               return true;
-       }
-
-       if(name=="model" && param.get_type()==Param::TYPE_WAYPOINTMODEL)
-       {
-               if(value_node)
-                       calc_waypoint();
-
-               waypoint.apply_model(param.get_waypoint_model());
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::WaypointSetSmart::is_ready()const
-{
-       if(!value_node)
-               sinfg::error("Missing value_node");
-
-       if(waypoint.get_time()==(Time::begin()-1))
-               sinfg::error("Missing waypoint");
-       
-       if(!value_node || waypoint.get_time()==(Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-// This function is called if a time is specified, but not 
-// a waypoint. In this case, we need to calculate the value
-// of the waypoint
-void
-Action::WaypointSetSmart::calc_waypoint()
-{
-       DEBUGPOINT();
-       Time time=waypoint.get_time();  
-       try
-       {
-               // Trivial case, we are sitting on a waypoint
-               waypoint=*value_node->find(waypoint.get_time());
-       }
-       catch(...)
-       {
-               waypoint=value_node->new_waypoint_at_time(time);        
-               waypoint.set_before(sinfgapp::Main::get_interpolation());
-               waypoint.set_after(sinfgapp::Main::get_interpolation());
-       }
-/*
-       Time time=waypoint.get_time();
-       ValueNode_Animated::WaypointList &waypoint_list(value_node->waypoint_list());
-       ValueNode_Animated::WaypointList::iterator iter;
-       
-       if(waypoint_list.empty())
-       {
-               waypoint.set_value((*value_node)(time));
-               return;
-       }
-
-       ValueNode_Animated::WaypointList::iterator closest=waypoint_list.begin();
-               
-       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(!closest->is_static())
-               waypoint.set_value_node(closest->get_value_node());
-       else
-               waypoint.set_value((*value_node)(time));
-*/
-}
-
-void
-Action::WaypointSetSmart::enclose_waypoint(const sinfg::Waypoint& waypoint)
-{
-       times.insert(waypoint.get_time());                      
-       
-       try {
-               times.insert(value_node->find(waypoint)->get_time());
-//             sinfg::info(__FILE__":%d: value_node->find(waypoint)->get_time()=%s",__LINE__,value_node->find(waypoint)->get_time().get_string().c_str());
-//             DEBUGPOINT();
-       }catch (...) { }
-       
-//     DEBUGPOINT();
-       // First we need to to add any waypoints necessary to
-       // maintain the integrity of the keyframes.     
-       if(get_edit_mode()&MODE_ANIMATE_PAST) try
-       {
-               Time curr_time(waypoint.get_time());
-               
-               //while(value_node->waypoint_list().front().get_time()<=curr_time)
-               {
-                       // Try to find prev keyframe
-                       Keyframe keyframe(*get_canvas()->keyframe_list().find_prev(curr_time));
-                       curr_time=keyframe.get_time();
-
-//                     sinfg::info(__FILE__":%d: prev_keyframe->time=%s",__LINE__,keyframe.get_time().get_string().c_str());
-//                     sinfg::info(__FILE__":%d: waypoint->time=%s",__LINE__,waypoint.get_time().get_string().c_str());
-                       
-//                     DEBUGPOINT();
-                       if(times.count(keyframe.get_time()))
-                       {
-//                             DEBUGPOINT();
-                               throw int();
-                       }
-                       if(waypoint.get_time().is_equal(keyframe.get_time()))
-                       {
-//                             DEBUGPOINT();
-                               throw int();
-                       }
-
-                       times.insert(keyframe.get_time());                      
-//                     DEBUGPOINT();
-                       try
-                       {
-                               value_node->find(keyframe.get_time());
-//                             sinfg::info(__FILE__":%d: waypointtime=%s",__LINE__,value_node->find(keyframe.get_time())->get_time().get_string().c_str());
-                       }
-                       catch(sinfg::Exception::NotFound)
-                       {
-                               Action::Handle action(WaypointAdd::create());
-                               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_node",ValueNode::Handle(value_node));
-                       
-                               if(!value_node->waypoint_list().empty())
-                               {       
-                                       action->set_param("time",keyframe.get_time());
-                               }
-                               else
-                               {
-                                       sinfg::Waypoint tmp;
-                                       
-                                       tmp.set_value(waypoint.get_value());
-                                       tmp.set_time(keyframe.get_time());
-                                       action->set_param("waypoint",tmp);
-                               }
-       
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                       
-                               add_action(action);
-                       }                                               
-               }               
-       }
-       catch(Error x) { throw x; }
-       catch(sinfg::Exception::NotFound) { DEBUGPOINT(); }
-       catch(int) { DEBUGPOINT(); }
-       catch(...) { DEBUGPOINT(); }
-                       //DEBUGPOINT();
-
-               //DEBUGPOINT();
-       if(get_edit_mode()&MODE_ANIMATE_FUTURE)try
-       {
-               Time curr_time(waypoint.get_time());
-               
-               //while(value_node->waypoint_list().back().get_time()>=curr_time)
-               {
-       
-                       //DEBUGPOINT();
-                       // Try to find next keyframe
-                       //sinfg::info("FUTURE waypoint.get_time()=%s",waypoint.get_time().get_string().c_str());
-                       Keyframe keyframe(*get_canvas()->keyframe_list().find_next(curr_time));
-                       //sinfg::info("FUTURE keyframe.get_time()=%s",keyframe.get_time().get_string().c_str());
-                       curr_time=keyframe.get_time();
-                       
-                       //DEBUGPOINT();
-                       if(times.count(keyframe.get_time())|| waypoint.get_time().is_equal(keyframe.get_time()))
-                               throw int();
-                       else
-                               times.insert(keyframe.get_time());                      
-                       //DEBUGPOINT();
-                       
-                       try
-                       {
-                               value_node->find(keyframe.get_time());
-                               sinfg::info(__FILE__":%d: time=%s",__LINE__,keyframe.get_time().get_string().c_str());
-                               sinfg::info(__FILE__":%d: waypointtime=%s",__LINE__,value_node->find(keyframe.get_time())->get_time().get_string().c_str());
-                               
-                       }
-                       catch(sinfg::Exception::NotFound)
-                       {
-                               Action::Handle action(WaypointAdd::create());
-                               
-                               action->set_param("canvas",get_canvas());
-                               action->set_param("canvas_interface",get_canvas_interface());
-                               action->set_param("value_node",ValueNode::Handle(value_node));
-                       
-                               if(!value_node->waypoint_list().empty())
-                               {       
-                                       action->set_param("time",keyframe.get_time());
-                               }
-                               else
-                               {
-                                       sinfg::Waypoint tmp;
-                                       
-                                       tmp.set_value(waypoint.get_value());
-                                       tmp.set_time(keyframe.get_time());
-                                       action->set_param("waypoint",tmp);
-                               }
-       
-                               assert(action->is_ready());
-                               if(!action->is_ready())
-                                       throw Error(Error::TYPE_NOTREADY);
-                       
-                               add_action(action);
-                       }
-               }
-                       //DEBUGPOINT();
-       }
-       catch(Error x) { throw x; }
-       catch(sinfg::Exception::NotFound) { DEBUGPOINT(); }
-       catch(int) { DEBUGPOINT(); }
-       catch(...) { DEBUGPOINT(); }
-               //DEBUGPOINT();
-}
-
-void
-Action::WaypointSetSmart::prepare()
-{
-               //DEBUGPOINT();
-       clear();
-       times.clear();
-       
-       // First we need to to add any waypoints necessary to
-       // maintain the integrity of the keyframes.     
-       enclose_waypoint(waypoint);
-
-       try
-       {
-               //sinfg::info("WaypointSetSmart: Move/Update?");
-               // Lets try to replace the old waypoint, if it exists
-               WaypointList::iterator iter(value_node->find(waypoint));
-               
-               if(iter == value_node->waypoint_list().end())
-                       throw int();
-               
-               enclose_waypoint(*iter);
-
-               Action::Handle action(WaypointSet::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_node",ValueNode::Handle(value_node));
-               action->set_param("waypoint",waypoint);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-               
-               return;
-       }
-       catch(sinfg::Exception::NotFound){ } catch(int){ }
-
-       try
-       {
-               //sinfg::info("WaypointSetSmart: Replace?");
-               //DEBUGPOINT();
-               // Check to see if a waypoint exists at this point in time
-               WaypointList::iterator iter=value_node->find(waypoint.get_time());
-               
-               waypoint.mimic(*iter);
-
-               enclose_waypoint(*iter);
-               
-               Action::Handle action(WaypointSet::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_node",ValueNode::Handle(value_node));
-               action->set_param("waypoint",waypoint);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-               
-               return;
-       }
-       catch(sinfg::Exception::NotFound){ } catch(int){ }
-       
-       try
-       {
-               //sinfg::info("WaypointSetSmart: Add?");
-               //DEBUGPOINT();
-               // At this point we know that the old waypoint doesn't exist,
-               // so we need to create it.
-               Action::Handle action(WaypointAdd::create());
-               
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_node",ValueNode::Handle(value_node));
-               action->set_param("waypoint",waypoint);
-       
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-       
-               add_action(action);
-               
-               return;
-       }
-       catch(sinfg::Exception::NotFound){ } catch(int){ }
-
-       throw Error(_("Unable to determine how to procede. This is a bug."));   
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointsetsmart.h b/synfig-studio/trunk/src/sinfgapp/actions/waypointsetsmart.h
deleted file mode 100644 (file)
index 900fe67..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointsetsmart.h
-**     \brief Template File
-**
-**     $Id: waypointsetsmart.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_ACTION_WAYPOINTSETSMART_H
-#define __SINFG_APP_ACTION_WAYPOINTSETSMART_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfgapp/value_desc.h>
-#include <sinfg/valuenode_animated.h>
-
-#include <list>
-#include <set>
-
-/* === 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 sinfgapp {
-
-namespace Action {
-
-class WaypointSetSmart :
-       public Super
-{
-private:
-
-       sinfg::ValueNode_Animated::Handle value_node;
-       sinfg::Waypoint waypoint;
-       //sinfg::WaypointModel waypoint_model;
-       bool time_set;
-
-       void calc_waypoint();
-       void enclose_waypoint(const sinfg::Waypoint& waypoint);
-
-       std::set<sinfg::Time> times;
-
-public:
-
-       WaypointSetSmart();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void prepare();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointsimpleadd.cpp b/synfig-studio/trunk/src/sinfgapp/actions/waypointsimpleadd.cpp
deleted file mode 100644 (file)
index 766bb6b..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointsimpleadd.cpp
-**     \brief Simple add waypoint File
-**
-**     $Id: waypointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "waypointsimpleadd.h"
-#include <sinfgapp/canvasinterface.h>
-
-#endif
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-using namespace Action;
-
-/* === M A C R O S ========================================================= */
-
-ACTION_INIT(Action::WaypointSimpleAdd);
-ACTION_SET_NAME(Action::WaypointSimpleAdd,"waypoint_simpleadd");
-ACTION_SET_LOCAL_NAME(Action::WaypointSimpleAdd,"Simply Add Waypoint");
-ACTION_SET_TASK(Action::WaypointSimpleAdd,"add");
-ACTION_SET_CATEGORY(Action::WaypointSimpleAdd,Action::CATEGORY_WAYPOINT);
-ACTION_SET_PRIORITY(Action::WaypointSimpleAdd,0);
-ACTION_SET_VERSION(Action::WaypointSimpleAdd,"0.0");
-ACTION_SET_CVS_ID(Action::WaypointSimpleAdd,"$Id: waypointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-Action::WaypointSimpleAdd::WaypointSimpleAdd()
-{
-       set_dirty(true);
-       waypoint.set_time(Time::begin()-1);
-}
-
-Action::ParamVocab
-Action::WaypointSimpleAdd::get_param_vocab()
-{
-       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-       
-       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
-               .set_local_name(_("Destination ValueNode (Animated)"))
-       );
-
-       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
-               .set_local_name(_("Waypoint"))
-               .set_desc(_("Waypoint to be added"))
-       );
-
-       return ret;
-}
-
-bool
-Action::WaypointSimpleAdd::is_canidate(const ParamList &x)
-{
-       return canidate_check(get_param_vocab(),x);
-}
-
-bool
-Action::WaypointSimpleAdd::set_param(const sinfg::String& name, const Action::Param &param)
-{
-       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
-       {
-               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
-               
-               return static_cast<bool>(value_node);
-       }
-       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT)
-       {
-               waypoint = param.get_waypoint();
-               
-               return true;
-       }
-
-       return Action::CanvasSpecific::set_param(name,param);
-}
-
-bool
-Action::WaypointSimpleAdd::is_ready()const
-{
-       if(!value_node && waypoint.get_time() != (Time::begin()-1))
-               return false;
-       return Action::CanvasSpecific::is_ready();
-}
-
-void
-Action::WaypointSimpleAdd::perform()
-{      
-       //remove any pretenders that lie at our destination
-       ValueNode_Animated::findresult iter = value_node->find_time(waypoint.get_time());
-       
-       time_overwrite = false;
-       if(iter.second)
-       {
-               overwritten_wp = *iter.first;
-               time_overwrite = true;
-       }
-       
-       //add the value node in since it's safe
-       value_node->add(waypoint);
-       
-       // Signal that a valuenode has been changed
-       value_node->changed();
-}
-
-void
-Action::WaypointSimpleAdd::undo()
-{
-       //remove our old version...
-       ValueNode_Animated::findresult iter = value_node->find_uid(waypoint);
-       
-       if(!iter.second)
-       {
-               throw Error(_("The waypoint to remove no longer exists"));
-       }
-       
-       //remove the offending value
-       value_node->erase(*iter.first); //could also just use waypoint
-       
-       if(time_overwrite)
-       {
-               value_node->add(overwritten_wp);                                
-       }
-       
-       // Signal that a valuenode has been changed
-       value_node->changed();
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/actions/waypointsimpleadd.h b/synfig-studio/trunk/src/sinfgapp/actions/waypointsimpleadd.h
deleted file mode 100644 (file)
index 2c044e8..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file waypointsimpleadd.h
-**     \brief A simple add a waypoint function Header
-**
-**     $Id: waypointsimpleadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_WAYPOINTSIMPLEADD_H
-#define __SINFG_WAYPOINTSIMPLEADD_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfgapp/action.h>
-#include <sinfg/waypoint.h>
-#include <sinfg/valuenode_animated.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 sinfgapp {
-
-class Instance;
-
-namespace Action {
-
-class WaypointSimpleAdd :
-       public Undoable,
-       public CanvasSpecific
-{
-private:
-       
-       sinfg::ValueNode_Animated::Handle value_node;
-       
-       sinfg::Waypoint waypoint;
-
-       bool time_overwrite;
-       sinfg::Waypoint overwritten_wp;
-
-public:
-
-       WaypointSimpleAdd();
-
-       static ParamVocab get_param_vocab();
-       static bool is_canidate(const ParamList &x);
-
-       virtual bool set_param(const sinfg::String& name, const Param &);
-       virtual bool is_ready()const;
-
-       virtual void perform();
-       virtual void undo();
-
-       ACTION_MODULE_EXT
-};
-
-}; // END of namespace action
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/blineconvert.cpp b/synfig-studio/trunk/src/sinfgapp/blineconvert.cpp
deleted file mode 100644 (file)
index d35496e..0000000
+++ /dev/null
@@ -1,835 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blineconvert.cpp
-**     \brief Template File
-**
-**     $Id: blineconvert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "blineconvert.h"
-#include <vector>
-#include <ETL/gaussian>
-#include <ETL/hermite>
-#include <ETL/clock>
-#include <float.h>
-#include <algorithm>
-#include <sinfg/general.h>
-#include <cassert>
-
-
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-
-/* === M A C R O S ========================================================= */
-
-#define EPSILON                (1e-10)
-
-/* === G L O B A L S ======================================================= */
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-
-//Derivative Functions for numerical approximation
-
-//bias == 0 will get F' at f3, bias < 0 will get F' at f1, and bias > 0 will get F' at f5
-template < class T >
-inline void FivePointdt(T &df, const T &f1, const T &f2, const T &f3, const T &f4, const T &f5, int bias)
-{
-       if(bias == 0)
-       {
-               //middle
-               df = (f1 - f2*8 + f4*8 - f5)*(1/12.0f);
-       }else if(bias < 0)
-       {
-               //left
-               df = (-f1*25 + f2*48 - f3*36 + f4*16 - f5*3)*(1/12.0f);
-       }else
-       {
-               //right
-               df = (f1*3 - f2*16 + f3*36 - f4*48 + f5*25)*(1/12.0f);
-       }
-}
-
-template < class T >
-inline void ThreePointdt(T &df, const T &f1, const T &f2, const T &f3, int bias)
-{
-       if(bias == 0)
-       {
-               //middle
-               df = (-f1 + f3)*(1/2.0f);
-       }else if(bias < 0)
-       {
-               //left
-               df = (-f1*3 + f2*4 - f3)*(1/2.0f);
-       }else
-       {
-               //right
-               df = (f1 - f2*4 + f3*3)*(1/2.0f);
-       }
-}
-
-template < class T >
-inline void ThreePointddt(T &df, const T &f1, const T &f2, const T &f3, int bias)
-{
-       //a 3 point approximation pretends to have constant acceleration, so only one algorithm needed for left, middle, or right
-       df = (f1 -f2*2 + f3)*(1/2.0f);
-}
-
-// WARNING -- totaly broken
-template < class T >
-inline void FivePointddt(T &df, const T &f1, const T &f2, const T &f3, int bias)
-{
-       if(bias == 0)
-       {
-               assert(0); // !?
-               //middle
-               //df = (- f1 + f2*16 - f3*30 +  f4*16 - f5)*(1/12.0f);
-       }/*else if(bias < 0)
-       {
-               //left
-               df = (f1*7 - f2*26*4 + f3*19*6 - f4*14*4 + f5*11)*(1/12.0f);
-       }else
-       {
-               //right
-               df = (f1*3 - f2*16 + f3*36 - f4*48 + f5*25)*(1/12.0f);
-       }*/
-       //side ones don't work, use 3 point
-}
-
-//implement an arbitrary derivative
-//dumb algorithm
-template < class T >
-void DerivativeApprox(T &df, const T f[], const Real t[], int npoints, int indexval)
-{
-       /*
-       Lj(x) = PI_i!=j (x - xi) / PI_i!=j (xj - xi)
-       
-       so Lj'(x) = SUM_k PI_i!=j|k (x - xi) / PI_i!=j (xj - xi)
-       */
-       
-       unsigned int i,j,k,i0,i1;
-       
-       Real Lpj,mult,div,tj;
-       Real tval = t[indexval];
-                               
-       //sum k 
-       for(j=0;j<npoints;++j)
-       {
-               Lpj = 0;
-               div = 1;
-               tj = t[j];
-               
-               for(k=0;k<npoints;++k)
-               {
-                       if(k != j) //because there is no summand for k == j, since that term is missing from the original equation
-                       {
-                               //summation for k
-                               for(i=0;i<npoints;++i)
-                               {
-                                       if(i != k)
-                                       {
-                                               mult *= tval - t[i];
-                                       }
-                               }
-                               
-                               Lpj += mult; //add into the summation
-                               
-                               //since the ks follow the exact patern we need for the divisor (use that too)
-                               div *= tj - t[k];
-                       }
-               }
-               
-               //get the actual coefficient
-               Lpj /= div;
-               
-               //add it in to the equation
-               df += f[j]*Lpj;
-       }
-}
-
-//END numerical derivatives
-
-template < class T >
-inline int sign(T f, T tol)
-{
-       if(f < -tol) return -1;
-       if(f > tol) return 1;
-       return 0;
-}
-
-void GetFirstDerivatives(const std::vector<sinfg::Point> &f, unsigned int left, unsigned int right, char *out, unsigned int dfstride)
-{
-       unsigned int current = left;
-
-       if(right - left < 2)
-               return;
-       else if(right - left < 3)
-       {
-               sinfg::Vector v = f[left+1] - f[left];
-               
-               //set both to the one we want
-               *(sinfg::Vector*)out = v;
-               out += dfstride;
-               *(sinfg::Vector*)out = v;
-               out += dfstride;
-       }
-       else if(right - left < 6/*5*/) //should use 3 point
-       {
-               //left then middle then right
-               ThreePointdt(*(sinfg::Vector*)out,f[left+0], f[left+1], f[left+2], -1);
-               current += 1;
-               out += dfstride;
-               
-               for(;current < right-1; current++, out += dfstride)
-               {
-                       ThreePointdt(*(sinfg::Vector*)out,f[current-1], f[current], f[current+1], 0);
-               }
-
-               ThreePointdt(*(sinfg::Vector*)out,f[right-3], f[right-2], f[right-1], 1);
-               current++;
-               out += dfstride;
-               
-       }else //can use 5 point
-       {
-               //left 2 then middle bunch then right two
-               //may want to use 3 point for inner edge ones
-               
-               FivePointdt(*(sinfg::Vector*)out,f[left+0], f[left+1], f[left+2], f[left+3], f[left+4], -2);
-               out += dfstride;
-               FivePointdt(*(sinfg::Vector*)out,f[left+1], f[left+2], f[left+3], f[left+4], f[left+5], -1);
-               out += dfstride;
-               current += 2;
-               
-               for(;current < right-2; current++, out += dfstride)
-               {
-                       FivePointdt(*(sinfg::Vector*)out,f[current-2], f[current-1], f[current], f[current+1], f[current+2], 0);
-               }
-
-               FivePointdt(*(sinfg::Vector*)out,f[right-5], f[right-4], f[right-3], f[right-2], f[right-1], 1);
-               out += dfstride;
-               FivePointdt(*(sinfg::Vector*)out,f[right-6], f[right-5], f[right-4], f[right-3], f[right-2], 2);                
-               out += dfstride;
-               current += 2;
-       }
-}
-
-void GetSimpleDerivatives(const std::vector<sinfg::Point> &f, int left, int right, 
-                                                       std::vector<sinfg::Point> &df, int outleft,
-                                                       const std::vector<sinfg::Real> &di)
-{
-       int i1,i2,i;
-       int offset = 2; //df = 1/2 (f[i+o]-f[i-o])
-       
-       assert((int)df.size() >= right-left+outleft); //must be big enough
-       
-       for(i = left; i < right; ++i)
-       {
-               //right now indices (figure out distance later)
-               i1 = std::max(left,i-offset);
-               i2 = std::max(left,i+offset);
-               
-               df[outleft++] = (f[i2] - f[i1])*0.5f;
-       }
-}
-
-//get the curve error from the double sample list of work points (hopefully that's enough)
-Real CurveError(const sinfg::Point *pts, unsigned int n, std::vector<sinfg::Point> &work, int left, int right)
-{
-       if(right-left < 2) return -1;
-               
-       int i,j;
-       
-       //get distances to each point
-       Real d,dtemp,dsum;
-       //sinfg::Vector v,vt;
-       //sinfg::Point p1,p2;
-       sinfg::Point pi;
-       std::vector<sinfg::Point>::const_iterator it;//,end = work.begin()+right;
-       
-       //unsigned int size = work.size();
-       
-       //for each line, get distance
-       d = 0; //starts at 0
-       for(i = 0; i < (int)n; ++i)
-       {               
-               pi = pts[i];
-               
-               dsum = FLT_MAX;
-               
-               it = work.begin()+left;
-               //p2 = *it++; //put it at left+1
-               for(j = left/*+1*/; j < right; ++j,++it)
-               {
-                       /*p1 = p2;
-                       p2 = *it;
-                       
-                       v = p2 - p1;                    
-                       vt = pi - p1;
-                       
-                       dtemp = 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(dtemp >= 1)  //use p+v
-                       {
-                               vt += v; //makes it pp - (p+v)  
-                       }else if(dtemp > 0)     //use vt-proj
-                       {
-                               vt -= v*dtemp; // vt - proj_v(vt)       //must normalize the projection vector to work
-                       }
-                       
-                       //else use p
-                       dtemp = vt.mag_squared();*/
-                       
-                       dtemp = (pi - *it).mag_squared();                       
-                       if(dtemp < dsum)
-                               dsum = dtemp;
-               }
-               
-               //accumulate the points' min distance from the curve
-               d += sqrt(dsum);
-       }
-       
-       return d;
-}
-
-typedef sinfgapp::BLineConverter::cpindex cpindex;
-
-//has the index data and the tangent scale data (relevant as it may be)
-int tesselate_curves(const std::vector<cpindex> &inds, const std::vector<Point> &f, const std::vector<sinfg::Vector> &df, std::vector<Point> &work)
-{
-       if(inds.size() < 2)
-               return 0;
-       
-       etl::hermite<Point>     curve;
-       int ntess = 0;
-       
-       std::vector<cpindex>::const_iterator j = inds.begin(),j2, end = inds.end();
-       
-       unsigned int ibase = inds[0].curind;
-               
-       j2 = j++;
-       for(; j != end; j2 = j++)
-       {
-               //if this curve has invalid error (in j) then retesselate it's work points (requires reparametrization, etc.)
-               if(j->error < 0)
-               {
-                       //get the stepsize etc. for the number of points in here
-                       unsigned int n = j->curind - j2->curind + 1; //thats the number of points in the span
-                       unsigned int k, kend, i0, i3;
-                       //so reset the right chunk
-                       
-                       Real t, dt = 1/(Real)(n*2-2); //assuming that they own only n points
-                       
-                       //start at first intermediate
-                       t = 0;
-
-                       i0 = j2->curind; i3 = j->curind;                        
-                       k = (i0-ibase)*2; //start on first intermediary point (2x+1)
-                       kend = (i3-ibase)*2; //last point to set (not intermediary)
-                       
-                       //build hermite curve, it's easier
-                       curve.p1() = f[i0];
-                       curve.p2() = f[i3];
-                       curve.t1() = df[i0]*(df[i0].mag_squared() > 1e-4 ? j2->tangentscale/df[i0].mag() : j2->tangentscale);
-                       curve.t2() = df[i3]*(df[i3].mag_squared() > 1e-4 ? j->tangentscale/df[i3].mag() : j->tangentscale);
-                       curve.sync();
-                                               
-                       //MUST include the end point (since we are ignoring left one)
-                       for(; k < kend; ++k, t += dt)
-                       {
-                               work[k] = curve(t);
-                       }
-                       
-                       work[k] = curve(1); //k == kend, t == 1 -> c(t) == p2
-                       ++ntess;
-               }
-       }
-       
-       return ntess;
-}
-
-sinfgapp::BLineConverter::BLineConverter()
-{
-       pixelwidth = 1;
-       smoothness = 0.70f;
-       width = 0;
-};
-
-void 
-sinfgapp::BLineConverter::clear()
-{
-       f.clear();
-       f_w.clear();
-       ftemp.clear();
-       df.clear();
-       cvt.clear();
-       brk.clear();
-       di.clear();
-       d_i.clear();
-       work.clear();
-       curind.clear();
-}
-
-void
-sinfgapp::BLineConverter::operator () (std::list<sinfg::BLinePoint> &out, const std::list<sinfg::Point> &in,const std::list<sinfg::Real> &in_w)
-{      
-       //Profiling information
-       /*etl::clock::value_type initialprocess=0, curveval=0, breakeval=0, disteval=0;
-       etl::clock::value_type preproceval=0, tesseval=0, erroreval=0, spliteval=0;
-       unsigned int                    numpre=0, numtess=0, numerror=0, numsplit=0;
-       etl::clock_realtime timer,total;*/
-
-       //total.reset();
-       if(in.size()<=1)
-               return;
-
-       clear();
-       
-       //removing digitization error harder than expected
-       
-       //intended to fix little pen errors caused by the way people draw (tiny juts in opposite direction)
-       //Different solutions
-       //      Average at both end points (will probably eliminate many points at each end of the samples)
-       //      Average after the break points are found (weird points would still affect the curve)
-       //      Just always get rid of breaks at the beginning and end if they are a certain distance apart
-       //              This is will be current approach so all we do now is try to remove duplicate points
-       
-       //remove duplicate points - very bad for fitting
-       
-       //timer.reset();
-       
-       {
-               std::list<sinfg::Point>::const_iterator i = in.begin(), end = in.end();
-               std::list<sinfg::Real>::const_iterator  iw = in_w.begin();
-               sinfg::Point    c;
-               
-               if(in.size() == in_w.size())
-               {
-                       for(;i != end; ++i,++iw)
-                       {       
-                               //eliminate duplicate points
-                               if(*i != c)
-                               {
-                                       f.push_back(c = *i);
-                                       f_w.push_back(*iw);
-                               }
-                       }
-               }else
-               {
-                       for(;i != end; ++i)
-                       {       
-                               //eliminate duplicate points
-                               if(*i != c)
-                               {
-                                       f.push_back(c = *i);
-                               }
-                       }
-               }
-       }
-       //initialprocess = timer();
-       
-       if(f.size()<=6)
-               return;
-       
-       //get curvature information
-       //timer.reset();
-       
-       {
-               int i,i0,i1;
-               sinfg::Vector v1,v2;
-               
-               cvt.resize(f.size());
-               
-               cvt.front() = 1;
-               cvt.back() = 1;
-               
-               for(i = 1; i < (int)f.size()-1; ++i)
-               {
-                       i0 = std::max(0,i - 2);
-                       i1 = std::min((int)(f.size()-1),i + 2);
-                       
-                       v1 = f[i] - f[i0];
-                       v2 = f[i1] - f[i];
-       
-                       cvt[i] = (v1*v2)/(v1.mag()*v2.mag());
-               }
-       }
-       
-       //curveval = timer();
-       //sinfg::info("calculated curvature");
-       
-       //find corner points and interpolate inside those
-       //timer.reset();
-       {               
-               //break at sharp derivative points
-               //TODO tolerance should be set based upon digitization resolution (length dependent index selection)
-               Real    tol = 0;                //break tolerance, for the cosine of the change in angle (really high curvature or something)
-               Real    fixdistsq = 4*width*width; //the distance to ignore breaks at the end points (for fixing stuff)
-               unsigned int i = 0;
-               
-               int             maxi = -1, last=0;
-               Real    minc = 1;
-               
-               brk.push_back(0);
-               
-               for(i = 1; i < cvt.size()-1; ++i)
-               {                       
-                       //insert if too sharp (we need to break the tangents to insert onto the break list)
-                       
-                       if(cvt[i] < tol)
-                       {
-                               if(cvt[i] < minc)
-                               {
-                                       minc = cvt[i];
-                                       maxi = i;
-                               }
-                       }else if(maxi >= 0)
-                       {
-                               if(maxi >= last + 8)
-                               {
-                                       //sinfg::info("break: %d-%d",maxi+1,cvt.size());                                                
-                                       brk.push_back(maxi);
-                                       last = maxi;
-                               }
-                               maxi = -1;
-                               minc = 1;
-                       }
-               }
-               
-               brk.push_back(i);
-               
-               //postprocess for breaks too close to eachother
-               Real d = 0;
-               Point p = f[brk.front()];
-               
-               //first set
-               for(i = 1; i < brk.size()-1; ++i) //do not want to include end point...
-               {
-                       d = (f[brk[i]] - p).mag_squared();
-                       if(d > fixdistsq) break; //don't want to group breaks if we ever get over the dist... 
-               }
-               //want to erase all points before...
-               if(i != 1)
-                       brk.erase(brk.begin(),brk.begin()+i-1); 
-               
-               //end set
-               p = f[brk.back()];
-               for(i = brk.size()-2; i > 0; --i) //start at one in from the end
-               {
-                       d = (f[brk[i]] - p).mag_squared();
-                       if(d > fixdistsq) break; //don't want to group breaks if we ever get over the dist
-               }
-               if(i != brk.size()-2)
-                       brk.erase(brk.begin()+i+2,brk.end()); //erase all points that we found... found none if i has not advanced
-               //must not include the one we ended up on
-       }
-       //breakeval = timer();
-       //sinfg::info("found break points: %d",brk.size());
-       
-       //get the distance calculation of the entire curve (for tangent scaling)
-
-       //timer.reset();
-       {
-               sinfg::Point p1,p2;
-               
-               p1=p2=f[0];
-               
-               di.resize(f.size()); d_i.resize(f.size());
-               Real d = 0;
-               for(unsigned int i = 0; i < f.size();)
-               {
-                       d += (d_i[i] = (p2-p1).mag());
-                       di[i] = d;
-                       
-                       p1=p2;
-                       p2=f[++i];
-               }
-       }
-       //disteval = timer();
-       //sinfg::info("calculated distance");
-               
-       //now break at every point - calculate new derivatives each time
-       
-       //TODO
-       //must be sure that the break points are 3 or more apart
-       //then must also store the breaks which are not smooth, etc.
-       //and figure out tangents between there
-       
-       //for each pair of break points (as long as they are far enough apart) recursively subdivide stuff
-       //ignore the detected intermediate points
-       {
-               unsigned int i0=0,i3=0,is=0;
-               int i=0,j=0;
-               
-               bool done = false;
-               
-               Real errortol = smoothness*pixelwidth; //???? what the hell should this value be
-               
-               BLinePoint a;
-               sinfg::Vector v;
-               
-               //intemp = f; //don't want to smooth out the corners
-               
-               bool breaktan = false, setwidth;
-               a.set_split_tangent_flag(false);
-               //a.set_width(width);
-               a.set_width(1.0f);
-               
-               setwidth = (f.size() == f_w.size());
-               
-               for(j = 0; j < (int)brk.size() - 1; ++j)
-               {
-                       //for b[j] to b[j+1] subdivide and stuff
-                       i0 = brk[j];
-                       i3 = brk[j+1];
-                       
-                       unsigned int size = i3-i0+1; //must include the end points
-                       
-                       //new derivatives
-                       //timer.reset();
-                       ftemp.assign(f.begin()+i0, f.begin()+i3+1);
-                       for(i=0;i<20;++i)
-                               gaussian_blur_3(ftemp.begin(),ftemp.end(),false);
-                       
-                       df.resize(size);
-                       GetFirstDerivatives(ftemp,0,size,(char*)&df[0],sizeof(df[0]));
-                       //GetSimpleDerivatives(ftemp,0,size,df,0,di); 
-                       //< don't have to worry about indexing stuff as it is all being taken car of right now
-                       //preproceval += timer();
-                       //numpre++;
-                       
-                       work.resize(size*2-1); //guarantee that all points will be tesselated correctly (one point inbetween every 2 adjacent points)
-                       
-                       //if size of work is size*2-1, the step size should be 1/(size*2 - 2)
-                       //Real step = 1/(Real)(size*2 - 1);
-                       
-                       //start off with break points as indices
-                       curind.clear();
-                       curind.push_back(cpindex(i0,di[i3]-di[i0],0)); //0 error because no curve on the left
-                       curind.push_back(cpindex(i3,di[i3]-di[i0],-1)); //error needs to be reevaluated
-                       done = false; //we want to loop
-                       
-                       unsigned int dcount = 0;
-                       
-                       //while there are still enough points between us, and the error is too high subdivide (and invalidate neighbors that share tangents)            
-                       while(!done)
-                       {                                       
-                               //tesselate all curves with invalid error values
-                               work[0] = f[i0];
-                               
-                               //timer.reset();
-                               /*numtess += */tesselate_curves(curind,f,df,work);
-                               //tesseval += timer();
-                               
-                               //now get all error values
-                               //timer.reset();
-                               for(i = 1; i < (int)curind.size(); ++i)
-                               {
-                                       if(curind[i].error < 0) //must have been retesselated, so now recalculate error value
-                                       {
-                                               //evaluate error from points (starting at current index)
-                                               int size = curind[i].curind - curind[i-1].curind + 1;
-                                               curind[i].error = CurveError(&f[curind[i-1].curind], size,
-                                                                                                        work,(curind[i-1].curind - i0)*2,(curind[i].curind - i0)*2+1);
-                                               
-                                               /*if(curind[i].error > 1.0e5)
-                                               {
-                                                       sinfg::info("Holy crap %d-%d error %f",curind[i-1].curind,curind[i].curind,curind[i].error);
-                                                       curind[i].error = -1;
-                                                       numtess += tesselate_curves(curind,f,df,work);
-                                                       curind[i].error = CurveError(&f[curind[i-1].curind], size,
-                                                                                                        work,0,work.size());//(curind[i-1].curind - i0)*2,(curind[i].curind - i0)*2+1);
-                                               }*/
-                                               //numerror++;
-                                       }
-                               }
-                               //erroreval += timer();
-                               
-                               //assume we're done
-                               done = true;
-                               
-                               //check each error to see if it's too big, if so, then subdivide etc.
-                               int indsize = (int)curind.size();
-                               Real maxrelerror = 0;
-                               int maxi = -1;//, numpoints;
-                               
-                               //timer.reset();
-                               //get the maximum error and split there
-                               for(i = 1; i < indsize; ++i)
-                               {
-                                       //numpoints = curind[i].curind - curind[i-1].curind + 1;
-                                       
-                                       if(curind[i].error > maxrelerror && curind[i].curind - curind[i-1].curind > 2) //only accept if it's valid
-                                       {
-                                               maxrelerror = curind[i].error;
-                                               maxi = i;
-                                       }
-                               }
-                               
-                               //split if error is too great
-                               if(maxrelerror > errortol)
-                               {
-                                       //add one to the left etc
-                                       unsigned int    ibase = curind[maxi-1].curind, itop = curind[maxi].curind,
-                                                                       ibreak = (ibase + itop)/2;
-                                       Real scale, scale2;
-                                       
-                                       assert(ibreak < f.size());
-                                       
-                                       //sinfg::info("Split %d -%d- %d, error: %f", ibase,ibreak,itop,maxrelerror);
-                                       
-                                       if(ibase != itop)
-                                       {
-                                               //invalidate current error of the changed tangents and add an extra segment
-                                               //enforce minimum tangents property
-                                               curind[maxi].error = -1;
-                                               curind[maxi-1].error = -1;
-                                               if(maxi+1 < indsize) curind[maxi+1].error = -1; //if there is a curve segment beyond this it will be effected as well
-                                               
-                                               scale = di[itop] - di[ibreak];
-                                               scale2 = maxi+1 < indsize ? di[curind[maxi+1].curind] - di[itop] : scale; //to the right valid?
-                                               curind[maxi].tangentscale = std::min(scale, scale2);
-                                                                                               
-                                               scale = di[ibreak] - di[ibase];
-                                               scale2 = maxi >= 2 ? di[ibase] - di[curind[maxi-2].curind] : scale; // to the left valid -2 ?
-                                               curind[maxi-1].tangentscale = std::min(scale, scale2);
-                                               
-                                               scale = std::min(di[ibreak] - di[ibase], di[itop] - di[ibreak]);
-                                               
-                                               curind.insert(curind.begin()+maxi,cpindex(ibreak, scale, -1));
-                                               //curind.push_back(cpindex(ibreak, scale, -1));
-                                               //std::sort(curind.begin(), curind.end());
-                                               
-                                               done = false;
-                                               //numsplit++;
-                                       }
-                               }
-                               //spliteval += timer();
-                               
-                               dcount++;
-                       }
-       
-                       //insert the last point too (just set tangent for now                   
-                       is = curind[0].curind;
-                       
-                       //first point inherits current tangent status                   
-                       v = df[is - i0];
-                       if(v.mag_squared() > EPSILON)
-                               v *= (curind[0].tangentscale/v.mag());
-                                                       
-                       if(!breaktan)
-                               a.set_tangent(v);
-                       else a.set_tangent2(v);
-                       
-                       a.set_vertex(f[is]);
-                       if(setwidth)a.set_width(f_w[is]);
-                       
-                       out.push_back(a);
-                       a.set_split_tangent_flag(false); //won't need to break anymore
-                       breaktan = false;
-                       
-                       for(i = 1; i < (int)curind.size()-1; ++i)
-                       {
-                               is = curind[i].curind;
-                               
-                               //first point inherits current tangent status
-                               v = df[is-i0];
-                               if(v.mag_squared() > EPSILON)
-                                       v *= (curind[i].tangentscale/v.mag());
-                                                               
-                               a.set_tangent(v); // always inside, so guaranteed to be smooth
-                               a.set_vertex(f[is]);
-                               if(setwidth)a.set_width(f_w[is]);
-                               
-                               out.push_back(a);
-                       }
-                       
-                       //set the last point's data
-                       is = curind.back().curind; //should already be this
-                       
-                       v = df[is-i0];
-                       if(v.mag_squared() > EPSILON)
-                               v *= (curind.back().tangentscale/v.mag());
-                       
-                       a.set_tangent1(v);
-                       a.set_split_tangent_flag(true);
-                       breaktan = true;
-                       
-                       //will get the vertex and tangent 2 from next round
-               }
-               
-               a.set_vertex(f[i3]);
-               a.set_split_tangent_flag(false);
-               if(setwidth)
-                       a.set_width(f_w[i3]);
-               out.push_back(a);
-               
-               /*etl::clock::value_type totaltime = total(),
-                                                          misctime = totaltime - initialprocess - curveval - breakeval - disteval
-                                                                         - preproceval - tesseval - erroreval - spliteval;
-               
-               sinfg::info(
-                       "Curve Convert Profile:\n"
-                       "\tInitial Preprocess:    %f\n"
-                       "\tCurvature Calculation: %f\n"
-                       "\tBreak Calculation:     %f\n"
-                       "\tDistance Calculation:  %f\n"
-                       "  Algorithm: (numtimes,totaltime)\n"
-                       "\tPreprocess step:      (%d,%f)\n"
-                       "\tTesselation step:     (%d,%f)\n"
-                       "\tError step:           (%d,%f)\n"
-                       "\tSplit step:           (%d,%f)\n"
-                       "  Num Input: %d, Num Output: %d\n"
-                       "  Total time: %f, Misc time: %f\n",
-                       initialprocess, curveval,breakeval,disteval,
-                       numpre,preproceval,numtess,tesseval,numerror,erroreval,numsplit,spliteval,
-                       in.size(),out.size(),
-                       totaltime,misctime);*/
-               
-               return;
-       }
-}
-
-void sinfgapp::BLineConverter::EnforceMinWidth(std::list<sinfg::BLinePoint> &bline, sinfg::Real min_pressure)
-{
-       std::list<sinfg::BLinePoint>::iterator  i = bline.begin(),
-                                                                                       end = bline.end();
-       
-       for(i = bline.begin(); i != end; ++i)
-       {
-               if(i->get_width() < min_pressure)
-               {
-                       i->set_width(min_pressure);
-               }
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/blineconvert.h b/synfig-studio/trunk/src/sinfgapp/blineconvert.h
deleted file mode 100644 (file)
index d09108f..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file blineconvert.h
-**     \brief Template Header
-**
-**     $Id: blineconvert.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_BLINE_CONVERT_H
-#define __SINFG_BLINE_CONVERT_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/general.h>
-#include <sinfg/blinepoint.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 sinfgapp {
-       
-class BLineConverter
-{
-public:
-       struct cpindex
-       {
-               int             curind;
-               sinfg::Real     tangentscale;
-               sinfg::Real     error;  //negative error will indicate invalid;
-               
-               cpindex(int ci, sinfg::Real s=0, sinfg::Real e=-1) 
-               :curind(ci), tangentscale(s), error(e) 
-               {}
-               
-               cpindex(const cpindex & o)
-               :curind(o.curind), tangentscale(o.tangentscale), error(o.error) 
-               {}
-               
-               const cpindex & operator = (const cpindex & rhs)
-               {
-                       curind = rhs.curind;
-                       tangentscale = rhs.tangentscale;
-                       error = rhs.error;
-                       return *this;
-               }
-               
-               bool operator < (const cpindex &rhs) const
-               {
-                       return curind < rhs.curind;             
-               }
-               
-               //point is obviously in[curind]
-               //tangent scale will get reset to the smallest (or something else depending on experimentation)
-       };
-
-private:
-       //cached data
-       std::vector<sinfg::Point>       f;      //the preprocessed input cache
-       std::vector<sinfg::Real>        f_w;
-
-       //temporary point storage for vector calc
-       std::vector<sinfg::Point>       ftemp;
-       
-       std::vector<sinfg::Vector>      df; //the derivative cache      
-       std::vector<sinfg::Real>        cvt; //the curvature cache
-       
-       std::vector<int>                        brk; //the break point cache
-       
-       std::vector<sinfg::Real>        di,     //cumulative distance
-                                                               d_i; //distance between adjacent segments
-       
-       std::vector<sinfg::Point>       work; //the working point cache for the entire curve
-       std::vector<cpindex>            curind;
-       
-       //function parameters
-       void clear();
-
-public:
-       sinfg::Real width;
-
-       //Converter properties
-       sinfg::Real pixelwidth;
-       sinfg::Real smoothness; //actual error will be smoothness*pixelwidth (for global set pixelwidth = 1)
-
-       BLineConverter();
-
-       static void EnforceMinWidth(std::list<sinfg::BLinePoint> &bline, sinfg::Real min_pressure);
-       void operator ()(std::list<sinfg::BLinePoint> &out, const std::list<sinfg::Point> &in,const std::list<sinfg::Real> &in_w);
-};
-       
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/canvasinterface.cpp b/synfig-studio/trunk/src/sinfgapp/canvasinterface.cpp
deleted file mode 100644 (file)
index 4b97077..0000000
+++ /dev/null
@@ -1,857 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasinterface.cpp
-**     \brief Template File
-**
-**     $Id: canvasinterface.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 <iostream>
-
-#include <ETL/clock>
-#include <sinfg/valuenode_scale.h>
-#include <sinfg/valuenode_timedswap.h>
-#include <sinfg/valuenode_composite.h>
-#include <sinfg/valuenode_subtract.h>
-#include <sinfg/valuenode_linear.h>
-#include <sinfg/valuenode_reference.h>
-#include <sinfg/valuenode_twotone.h>
-#include <sinfg/valuenode_stripes.h>
-
-#include <sinfg/waypoint.h>
-#include <sinfg/loadcanvas.h>
-#include <sinfg/importer.h>
-#include <sinfg/guidset.h>
-
-#include "canvasinterface.h"
-#include "instance.h"
-
-#include "actions/layeradd.h"
-#include "actions/valuedescconvert.h"
-#include "actions/valuenodeadd.h"
-#include "actions/editmodeset.h"
-#include "action_system.h"
-
-#include "main.h"
-
-#include <sinfg/gradient.h>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-
-/* === 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 ======================================================= */
-
-CanvasInterface::CanvasInterface(loose_handle<Instance> instance,handle<Canvas> canvas):
-       instance_(instance),
-       canvas_(canvas),
-       cur_time_(canvas->rend_desc().get_frame_start()),
-       mode_(MODE_NORMAL|MODE_ANIMATE_PAST|MODE_ANIMATE_FUTURE)
-{
-       set_selection_manager(get_instance()->get_selection_manager());
-       set_ui_interface(get_instance()->get_ui_interface());
-}
-
-CanvasInterface::~CanvasInterface()
-{
-       sinfg::info("sinfgapp::CanvasInterface::~CanvasInterface(): Deleted");
-}
-
-void
-CanvasInterface::set_time(sinfg::Time x)
-{
-       if(get_canvas()->rend_desc().get_frame_rate())
-       {
-               float fps(get_canvas()->rend_desc().get_frame_rate());
-               Time r(x.round(fps));
-               //sinfg::info("CanvasInterface::set_time(): %s rounded to %s\n",x.get_string(fps).c_str(),r.get_string(fps).c_str());
-               x=r;
-       }
-       if(cur_time_.is_equal(x))
-               return;
-       cur_time_=x;
-       
-       signal_time_changed()();
-       signal_dirty_preview()();
-}
-       
-sinfg::Time
-CanvasInterface::get_time()const
-{
-       return cur_time_;
-}
-
-void 
-CanvasInterface::refresh_current_values()
-{
-       get_canvas()->set_time(cur_time_);
-       signal_time_changed()();
-       signal_dirty_preview()();
-}
-
-etl::handle<CanvasInterface>
-CanvasInterface::create(loose_handle<Instance> instance,handle<Canvas> canvas)
-{
-       etl::handle<CanvasInterface> intrfc;
-       intrfc=new CanvasInterface(instance,canvas);
-       instance->canvas_interface_list().push_front(intrfc);
-       return intrfc;
-}
-
-void
-CanvasInterface::set_mode(Mode x)
-{
-       Action::Handle  action(Action::EditModeSet::create());
-
-       assert(action);
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("edit_mode",x);
-       
-       if(!action->is_ready())
-       {
-               get_ui_interface()->error(_("Action Not Ready, unable to change mode"));
-               assert(0);
-               return;
-       }
-       
-       if(!get_instance()->perform_action(action))
-               get_ui_interface()->error(_("Unable to change mode"));                  
-
-//     mode_=x;
-//     signal_mode_changed_(x);
-}
-
-CanvasInterface::Mode
-CanvasInterface::get_mode()const
-{
-       return mode_;
-}
-
-
-
-Layer::Handle
-CanvasInterface::add_layer_to(String name, Canvas::Handle canvas, int depth)
-{
-       sinfgapp::Action::PassiveGrouper group(get_instance().get(),_("Add Layer To"));
-
-       Layer::Handle   layer(Layer::create(name));
-       
-       assert(layer);
-       
-       if(!layer)
-               return 0;
-
-       if(canvas!=get_canvas() && !canvas->is_inline())
-       {
-               sinfg::error("Bad canvas passed to \"add_layer_to\"");
-               return 0;
-       }
-
-       layer->set_canvas(canvas);
-       
-       // Apply some defaults
-       if(layer->set_param("fg",sinfgapp::Main::get_foreground_color()))
-               layer->set_param("bg",sinfgapp::Main::get_background_color());
-       else
-               layer->set_param("color",sinfgapp::Main::get_foreground_color());
-
-       layer->set_param("width",sinfgapp::Main::get_bline_width().units(get_canvas()->rend_desc()));
-       layer->set_param("gradient",sinfgapp::Main::get_gradient());
-       if(name!="zoom")
-               layer->set_param("amount",sinfgapp::Main::get_opacity());
-       layer->set_param("blend_method",sinfgapp::Main::get_blend_method());
-
-       {
-               // Grab the layer's list pf parameters
-               Layer::ParamList paramlist=layer->get_param_list();
-               Layer::ParamList::iterator iter;
-               for(iter=paramlist.begin();iter!=paramlist.end();++iter)
-               {
-                       ValueNode::Handle value_node;
-                       
-                       if(iter->second.get_type()==ValueBase::TYPE_LIST)
-                               value_node=LinkableValueNode::create("dynamic_list",iter->second);
-                       else if(LinkableValueNode::check_type("composite",iter->second.get_type()) &&
-                               (iter->second.get_type()!=ValueBase::TYPE_COLOR && iter->second.get_type()!=ValueBase::TYPE_VECTOR)
-                       )
-                               value_node=LinkableValueNode::create("composite",iter->second);
-                       
-                       if(value_node)
-                               layer->connect_dynamic_param(iter->first,value_node);
-               }
-       }
-
-       // Action to add the layer
-       Action::Handle  action(Action::LayerAdd::create());
-
-       assert(action);
-       if(!action)
-               return 0;
-       
-       action->set_param("canvas",canvas);
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("new",layer);
-       
-       if(!action->is_ready())
-       {
-               get_ui_interface()->error(_("Action Not Ready"));                       
-               return 0;
-       }
-       
-       if(!get_instance()->perform_action(action))
-       {
-               get_ui_interface()->error(_("Action Failed."));                 
-               return 0;
-       }
-
-       sinfg::info("DEPTH=%d",depth);
-       // Action to move the layer (if necessary)
-       if(depth>0)
-       {
-               Action::Handle  action(Action::create("layer_move"));
-       
-               assert(action);
-               if(!action)
-                       return 0;
-               
-               action->set_param("canvas",canvas);
-               action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-               action->set_param("layer",layer);
-               action->set_param("new_index",depth);
-               
-               if(!action->is_ready())
-               {
-                       get_ui_interface()->error(_("Move Action Not Ready"));                  
-                       return 0;
-               }
-               
-               if(!get_instance()->perform_action(action))
-               {
-                       get_ui_interface()->error(_("Move Action Failed."));                    
-                       return 0;
-               }
-       }       
-       
-       
-       return layer;
-}
-
-
-bool
-CanvasInterface::convert(ValueDesc value_desc, String type)
-{
-       Action::Handle  action(Action::ValueDescConvert::create());
-
-       assert(action);
-       if(!action)
-               return 0;
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("value_desc",value_desc);
-       action->set_param("type",type);
-       
-       if(!action->is_ready())
-       {
-               get_ui_interface()->error(_("Action Not Ready"));                       
-               return 0;
-       }
-       
-       if(get_instance()->perform_action(action))
-               return true;
-       
-       get_ui_interface()->error(_("Action Failed."));                 
-       return false;
-}
-
-bool
-CanvasInterface::add_value_node(sinfg::ValueNode::Handle value_node, sinfg::String name)
-{
-       if(name.empty())
-       {
-               get_ui_interface()->error(_("Empty name!"));
-               return false;
-       }
-       
-       Action::Handle  action(Action::ValueNodeAdd::create());
-
-       assert(action);
-       if(!action)
-               return 0;
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("new",value_node);
-       action->set_param("name",name);
-       
-       if(!action->is_ready())
-       {
-               get_ui_interface()->error(_("Action Not Ready"));                       
-               return 0;
-       }
-       
-       if(get_instance()->perform_action(action))
-               return true;
-       
-       get_ui_interface()->error(_("Action Failed."));                 
-       return false;
-}
-
-Action::ParamList
-CanvasInterface::generate_param_list(const ValueDesc &value_desc)
-{
-       sinfgapp::Action::ParamList param_list;
-       param_list.add("time",get_time());
-       param_list.add("canvas_interface",etl::handle<CanvasInterface>(this));
-       param_list.add("canvas",get_canvas());
-
-       param_list.add("value_desc",value_desc);
-
-       if(value_desc.parent_is_value_node())
-               param_list.add("parent_value_node",value_desc.get_parent_value_node());
-       
-       if(value_desc.is_value_node())
-               param_list.add("value_node",value_desc.get_value_node());
-       
-       if(value_desc.is_const())
-               param_list.add("value",value_desc.get_value());
-
-       if(value_desc.parent_is_layer_param())
-       {
-               param_list.add("parent_layer",value_desc.get_layer());
-               param_list.add("parent_layer_param",value_desc.get_param_name());
-       }
-
-       {
-               sinfgapp::SelectionManager::ChildrenList children_list;
-               children_list=get_selection_manager()->get_selected_children();
-               if(!value_desc.parent_is_canvas() && children_list.size()==1)
-               {
-                       param_list.add("dest",value_desc);
-                       param_list.add("src",children_list.front().get_value_node());
-               }
-       }       
-       return param_list;
-}
-
-Action::ParamList
-CanvasInterface::generate_param_list(const std::list<sinfgapp::ValueDesc> &value_desc_list)
-{
-       sinfgapp::Action::ParamList param_list;
-       param_list.add("time",get_time());
-       param_list.add("canvas_interface",etl::handle<CanvasInterface>(this));
-       param_list.add("canvas",get_canvas());
-
-       std::list<sinfgapp::ValueDesc>::const_iterator iter;
-       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
-       {
-               param_list.add("value_desc",*iter);
-               if(iter->is_value_node())
-               {
-                       param_list.add("value_node",iter->get_value_node());                    
-               }
-       }
-
-
-       return param_list;
-}
-
-void
-CanvasInterface::set_rend_desc(const sinfg::RendDesc &rend_desc)
-{
-       Action::Handle  action(Action::create("canvas_rend_desc_set"));
-
-       assert(action);
-       if(!action)
-               return;
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("rend_desc",rend_desc);
-               
-       if(!get_instance()->perform_action(action))
-               get_ui_interface()->error(_("Action Failed."));                 
-}
-
-bool
-CanvasInterface::set_name(const String &x)
-{
-       //! \todo This needs to be converted into an action
-       get_canvas()->set_name(x);
-       signal_id_changed_();
-       return true;
-}
-
-bool
-CanvasInterface::set_description(const String &x)
-{
-       //! \todo This needs to be converted into an action
-       get_canvas()->set_description(x);
-       return true;
-}
-
-bool
-CanvasInterface::set_id(const String &x)
-{
-       //! \todo This needs to be converted into an action
-       get_canvas()->set_id(x);
-       signal_id_changed_();
-       return true;
-}
-
-
-void
-CanvasInterface::jump_to_next_keyframe()
-{
-       sinfg::info("Current time: %s",get_time().get_string().c_str());
-       try
-       {
-               sinfg::Keyframe keyframe(*get_canvas()->keyframe_list().find_next(get_time()));
-               sinfg::info("Jumping to keyframe \"%s\" at %s",keyframe.get_description().c_str(),keyframe.get_time().get_string().c_str());
-               set_time(keyframe.get_time());
-       }
-       catch(...) { sinfg::warning("Unable to find next keyframe"); }
-}
-
-void
-CanvasInterface::jump_to_prev_keyframe()
-{
-       sinfg::info("Current time: %s",get_time().get_string().c_str());
-       try
-       {
-               sinfg::Keyframe keyframe(*get_canvas()->keyframe_list().find_prev(get_time()));
-               sinfg::info("Jumping to keyframe \"%s\" at %s",keyframe.get_description().c_str(),keyframe.get_time().get_string().c_str());
-               set_time(keyframe.get_time());
-       }
-       catch(...) { sinfg::warning("Unable to find prev keyframe"); }
-}
-
-bool
-CanvasInterface::import(const sinfg::String &filename, bool copy)
-{
-       Action::PassiveGrouper group(get_instance().get(),_("Import Image"));
-       
-       sinfg::info("Attempting to import "+filename);
-
-
-       if(find(filename.begin(),filename.end(),'.')==filename.end())
-       {
-               get_ui_interface()->error("Filename must have an extension!");
-               return false;
-       }
-
-       String ext(String(filename.begin()+filename.find_last_of('.')+1,filename.end()));
-       std::transform(ext.begin(),ext.end(),ext.begin(),&::tolower);
-
-       // If this is a SIF file, then we need to do things slightly differently
-       if(ext=="sif" || ext=="sifz")try
-       {
-               
-               Canvas::Handle outside_canvas(sinfg::open_canvas(filename));
-               if(!outside_canvas)
-                       throw String(_("Unable to open this composition"));
-
-               Layer::Handle layer(add_layer_to("PasteCanvas",get_canvas()));
-               if(!layer)
-                       throw String(_("Unable to create \"PasteCanvas\" layer"));
-               if(!layer->set_param("canvas",ValueBase(outside_canvas)))
-                       throw int();
-
-               //layer->set_description(basename(filename));
-               signal_layer_new_description()(layer,filename);
-               return true;
-       }
-       catch(String x)
-       {
-               get_ui_interface()->error(x+" -- "+filename);
-               return false;
-       }
-       catch(...)
-       {
-               get_ui_interface()->error(_("Uncaught exception when attempting\nto open this composition -- ")+filename);
-               return false;
-       }
-       
-       
-       
-       if(!Importer::book().count(ext))
-       {
-               get_ui_interface()->error(_("I don't know how to open images of this type -- ")+ext);
-               return false;
-       }
-
-       try
-       {
-               Layer::Handle layer(add_layer_to("Import",get_canvas()));
-               int w,h;
-               if(!layer)
-                       throw int();
-               if(!layer->set_param("filename",ValueBase(filename)))
-                       throw int();
-               w=layer->get_param("_width").get(int());
-               h=layer->get_param("_height").get(int());
-               if(w&&h)
-               {
-                       Vector size=ValueBase(get_canvas()->rend_desc().get_br()-get_canvas()->rend_desc().get_tl());
-                       Vector x;
-                       if(size[0]<size[1])
-                       {
-                               x[0]=size[0];
-                               x[1]=size[0]/w*h;
-                               if(size[0]<0 ^ size[1]<0)
-                                       x[1]=-x[1];
-                       }
-                       else
-                       {
-                               x[1]=size[1];
-                               x[0]=size[1]/h*w;
-                               if(size[0]<0 ^ size[1]<0)
-                                       x[0]=-x[0];
-                       }
-                       if(!layer->set_param("tl",ValueBase(-x/2)))
-                               throw int();
-                       if(!layer->set_param("br",ValueBase(x/2)))
-                               throw int();
-               }
-               else
-               {
-                       if(!layer->set_param("tl",ValueBase(get_canvas()->rend_desc().get_tl())))
-                               throw int();
-                       if(!layer->set_param("br",ValueBase(get_canvas()->rend_desc().get_br())))
-                               throw int();
-               }
-
-               layer->set_description(basename(filename));
-               signal_layer_new_description()(layer,filename);
-       
-               return true;            
-       }
-       catch(...)
-       {
-               get_ui_interface()->error("Unable to import "+filename);
-               group.cancel();
-               return false;
-       }
-}
-
-
-void
-CanvasInterface::waypoint_duplicate(sinfgapp::ValueDesc value_desc,sinfg::Waypoint waypoint)
-{
-       Action::Handle  action(Action::create("waypoint_set_smart"));
-
-       assert(action);
-       if(!action)
-               return;
-       
-       waypoint.make_unique();
-       waypoint.set_time(get_time());
-
-       ValueNode::Handle value_node(value_desc.get_value_node());
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("waypoint",waypoint);
-       action->set_param("time",get_time());
-       action->set_param("value_node",value_node);
-               
-       if(!get_instance()->perform_action(action))
-               get_ui_interface()->error(_("Action Failed."));                 
-}
-
-void
-CanvasInterface::waypoint_remove(sinfgapp::ValueDesc value_desc,sinfg::Waypoint waypoint)
-{
-       Action::Handle  action(Action::create("waypoint_remove"));
-
-       assert(action);
-       if(!action)
-               return;
-       
-       ValueNode::Handle value_node(value_desc.get_value_node());
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("waypoint",waypoint);
-       action->set_param("value_node",value_node);
-               
-       if(!get_instance()->perform_action(action))
-               get_ui_interface()->error(_("Action Failed."));                 
-}
-
-
-void
-CanvasInterface::auto_export(ValueNode::Handle value_node)
-{
-/*
-       // Check to see if we are already exported.
-       if(value_node->is_exported())
-               return;
-
-       Action::Handle  action(Action::create("value_node_add"));
-
-       assert(action);
-       if(!action)
-               return;
-       
-       String name(strprintf(_("Unnamed%08d"),sinfg::UniqueID().get_uid()));
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("new",value_node);
-       action->set_param("name",name);
-               
-       if(!get_instance()->perform_action(action))
-               get_ui_interface()->error(_("Action Failed."));                 
-*/
-}
-
-void
-CanvasInterface::auto_export(const ValueDesc& value_desc)
-{      
-       // THIS FUNCTION IS DEPRECATED, AND IS NOW A STUB.
-#if 0  
-       // Check to see if we are already exported.
-       if(value_desc.is_exported())
-               return;
-
-       Action::Handle  action(Action::create("value_desc_export"));
-
-       assert(action);
-       if(!action)
-               return;
-       
-       String name(strprintf(_("Unnamed%08d"),sinfg::UniqueID().get_uid()));
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("value_desc",value_desc);
-       action->set_param("name",name);
-               
-       if(!get_instance()->perform_action(action))
-               get_ui_interface()->error(_("Action Failed."));                 
-#endif
-}
-
-bool
-CanvasInterface::change_value(sinfgapp::ValueDesc value_desc,sinfg::ValueBase new_value)
-{
-       // If this isn't really a change, then don't bother
-       if(new_value==value_desc.get_value(get_time()))
-               return true;
-               
-       // If this change needs to take place elsewhere, then so be it.
-       if(value_desc.get_canvas() && value_desc.get_canvas()->get_root()!=get_canvas()->get_root())do
-       {
-               etl::handle<Instance> instance;
-               instance=find_instance(value_desc.get_canvas()->get_root());
-               
-               if(instance)
-                       return instance->find_canvas_interface(value_desc.get_canvas())->change_value(value_desc,new_value);
-               else
-               {
-                       get_ui_interface()->error(_("The value you are trying to edit is in a composition\nwhich doesn't seem to be open. Open that composition and you\nshould be able to edit this value as normal."));                       
-                       return false;
-               }
-       }while(0);
-#ifdef _DEBUG
-       else
-       { sinfg::warning("Can't get canvas from value desc...?"); }
-#endif
-       
-       sinfgapp::Action::Handle action(sinfgapp::Action::create("value_desc_set"));
-       if(!action)
-       {
-               return false;
-       }
-       
-       action->set_param("canvas",get_canvas());
-       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
-       action->set_param("time",get_time());
-       action->set_param("value_desc",value_desc);
-       action->set_param("new_value",new_value);
-
-       return get_instance()->perform_action(action);
-}
-
-void
-CanvasInterface::set_meta_data(const sinfg::String& key,const sinfg::String& data)
-{
-       get_canvas()->set_meta_data(key,data);
-}
-
-
-// this function goes with find_important_value_descs()
-static int
-_process_value_desc(const sinfgapp::ValueDesc& value_desc,std::vector<sinfgapp::ValueDesc>& out, sinfg::GUIDSet& guid_set)
-{
-       int ret(0);
-
-       if(value_desc.get_value_type()==ValueBase::TYPE_CANVAS)
-       {
-               Canvas::Handle canvas;
-               canvas=value_desc.get_value().get(canvas);
-               if(!canvas || !canvas->is_inline())
-                       return ret;
-               ret+=CanvasInterface::find_important_value_descs(canvas,out,guid_set);
-       }
-       
-       if(value_desc.is_value_node())
-       {
-               ValueNode::Handle value_node(value_desc.get_value_node());
-
-               if(guid_set.count(value_node->get_guid()))
-                       return ret;
-               guid_set.insert(value_node->get_guid());
-               
-               if(LinkableValueNode::Handle::cast_dynamic(value_node))
-               {
-                       if(ValueNode_DynamicList::Handle::cast_dynamic(value_node))
-                       {
-                               out.push_back(value_desc);
-                               ret++;
-                       }
-                       // Process the linkable ValueNode's children
-                       LinkableValueNode::Handle value_node(LinkableValueNode::Handle::cast_dynamic(value_node));
-                       int i;
-                       for(i=0;i<value_node->link_count();i++)
-                       {
-                               ValueNode::Handle link(value_node->get_link(i));
-                               if(!link->is_exported())
-                                       ret+=_process_value_desc(ValueDesc(value_node,i),out,guid_set);
-                       }
-               }
-               else if(ValueNode_Animated::Handle::cast_dynamic(value_node))
-               {
-                       out.push_back(value_desc);
-                       ret++;
-               }
-       }
-       
-       return ret;
-}
-
-int
-CanvasInterface::find_important_value_descs(sinfg::Canvas::Handle canvas,std::vector<sinfgapp::ValueDesc>& out,sinfg::GUIDSet& guid_set)
-{
-       int ret(0);
-       if(!canvas->is_inline())
-       {
-               ValueNodeList::const_iterator iter;
-       
-               for(
-                       iter=canvas->value_node_list().begin();
-                       iter!=canvas->value_node_list().end();
-                       ++iter)
-                       ret+=_process_value_desc(ValueDesc(canvas,(*iter)->get_id()),out,guid_set);
-       }
-
-       Canvas::const_iterator iter;
-       
-       for(iter=canvas->begin();iter!=canvas->end();++iter)
-       {
-               Layer::Handle layer(*iter);
-               
-               Layer::DynamicParamList::const_iterator iter;
-               for(
-                       iter=layer->dynamic_param_list().begin();
-                       iter!=layer->dynamic_param_list().end();
-                       ++iter)
-               {
-                       if(!iter->second->is_exported())
-                               ret+=_process_value_desc(ValueDesc(layer,iter->first),out,guid_set);
-               }
-               ValueBase value(layer->get_param("canvas"));
-               if(value.is_valid())
-                       ret+=_process_value_desc(ValueDesc(layer,"canvas"),out,guid_set);
-       }
-       
-       return ret;
-}
-
-int
-CanvasInterface::find_important_value_descs(std::vector<sinfgapp::ValueDesc>& out)
-{
-       sinfg::GUIDSet tmp;
-       return find_important_value_descs(get_canvas(),out,tmp);
-}
-
-void
-CanvasInterface::seek_frame(int frames)
-{
-       if(!frames)
-               return;
-       float fps(get_canvas()->rend_desc().get_frame_rate());
-       Time newtime(get_time()+(float)frames/fps);
-       newtime=newtime.round(fps);
-
-       if(newtime<=get_canvas()->rend_desc().get_frame_start())
-               newtime=get_canvas()->rend_desc().get_frame_start();
-       if(newtime>=get_canvas()->rend_desc().get_frame_end())
-               newtime=get_canvas()->rend_desc().get_frame_end();
-       set_time(newtime);
-}
-
-void
-CanvasInterface::seek_time(sinfg::Time time)
-{
-       if(!time)
-               return;
-       
-       float fps(get_canvas()->rend_desc().get_frame_rate());
-
-       if(time>=sinfg::Time::end())
-       {
-               set_time(get_canvas()->rend_desc().get_time_end());
-               return;
-       }
-       if(time<=sinfg::Time::begin())
-       {
-               set_time(get_canvas()->rend_desc().get_time_end());
-               return;
-       }
-               
-       Time newtime(get_time()+time);
-       newtime=newtime.round(fps);
-
-       if(newtime<=get_canvas()->rend_desc().get_time_start())
-               newtime=get_canvas()->rend_desc().get_time_start();
-       if(newtime>=get_canvas()->rend_desc().get_time_end())
-               newtime=get_canvas()->rend_desc().get_time_end();
-       set_time(newtime);
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/canvasinterface.h b/synfig-studio/trunk/src/sinfgapp/canvasinterface.h
deleted file mode 100644 (file)
index 79a548c..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file canvasinterface.h
-**     \brief Template Header
-**
-**     $Id: canvasinterface.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_CANVASINTERFACE_H
-#define __SINFG_APP_CANVASINTERFACE_H
-
-/* === H E A D E R S ======================================================= */
-
-//#include <sinfg/canvas.h>
-#include <sinfg/value.h>
-#include <sigc++/signal.h>
-#include <sigc++/object.h>
-#include <list>
-#include "selectionmanager.h"
-#include "uimanager.h"
-#include "value_desc.h"
-#include "editmode.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_DynamicList; class Waypoint; class GUIDSet; class Canvas; };
-
-namespace sinfgapp {
-
-namespace Action { class ParamList; class Param; class EditModeSet; }; 
-
-class Instance;
-class ValueDesc;
-       
-class CanvasInterface : public etl::shared_object, public sigc::trackable
-{
-       friend class Instance;
-       friend class Action::EditModeSet;
-               
-public:
-
-       typedef EditMode Mode;
-
-private:
-       // Constructor is private to force the use of the "create()" constructor.
-       CanvasInterface(etl::loose_handle<Instance> instance,etl::handle<sinfg::Canvas> canvas);
-
-private:
-       etl::loose_handle<Instance> instance_;
-       etl::handle<sinfg::Canvas> canvas_;
-       etl::handle<SelectionManager> selection_manager_;
-       etl::handle<UIInterface> ui_interface_;
-       sinfg::Time cur_time_;
-       Mode mode_;
-
-       sigc::signal<void,sinfg::Layer::Handle> signal_layer_raised_;
-       sigc::signal<void,sinfg::Layer::Handle> signal_layer_lowered_;
-       sigc::signal<void,sinfg::Layer::Handle,int> signal_layer_inserted_;
-       sigc::signal<void,sinfg::Layer::Handle,int,sinfg::Canvas::Handle> signal_layer_moved_;
-       sigc::signal<void,sinfg::Layer::Handle> signal_layer_removed_;
-       sigc::signal<void,sinfg::Layer::Handle,bool> signal_layer_status_changed_;
-       sigc::signal<void,sinfg::Layer::Handle,sinfg::String> signal_layer_new_description_;
-       sigc::signal<void,sinfg::Canvas::Handle> signal_canvas_added_;
-       sigc::signal<void,sinfg::Canvas::Handle> signal_canvas_removed_;
-       
-       sigc::signal<void,sinfg::ValueNode::Handle> signal_value_node_added_;
-       sigc::signal<void,sinfg::ValueNode::Handle> signal_value_node_deleted_;
-       sigc::signal<void,sinfg::ValueNode::Handle> signal_value_node_changed_;
-       sigc::signal<void,sinfg::ValueNode::Handle,sinfg::ValueNode::Handle> signal_value_node_replaced_;
-
-       sigc::signal<void,sinfg::Keyframe> signal_keyframe_added_;
-       sigc::signal<void,sinfg::Keyframe> signal_keyframe_removed_;
-       sigc::signal<void,sinfg::Keyframe> signal_keyframe_changed_;
-
-       sigc::signal<void> signal_id_changed_;
-
-       sigc::signal<void> signal_time_changed_;
-
-       sigc::signal<void> signal_rend_desc_changed_;
-
-       sigc::signal<void,Mode> signal_mode_changed_;
-
-       //sigc::signal<void> signal_dirty_preview_;
-
-       sigc::signal<void,sinfg::Layer::Handle,sinfg::String> signal_layer_param_changed_;
-
-public:        // Signal Interface
-
-       sigc::signal<void,sinfg::Layer::Handle,int,sinfg::Canvas::Handle>& signal_layer_moved() { return signal_layer_moved_; }
-
-       sigc::signal<void,sinfg::Layer::Handle,sinfg::String>& signal_layer_new_description() { return signal_layer_new_description_; }
-
-       //! Signal called when layer is raised.
-       sigc::signal<void,sinfg::Layer::Handle>& signal_layer_raised() { return signal_layer_raised_; }
-       
-       //! Signal called when layer is lowered.
-       sigc::signal<void,sinfg::Layer::Handle>& signal_layer_lowered() { return signal_layer_lowered_; }
-       
-       //! Signal called when layer has been inserted at a given position.
-       sigc::signal<void,sinfg::Layer::Handle,int>& signal_layer_inserted() { return signal_layer_inserted_; }
-
-       //! Signal called when a layer has been removed from the canvas.
-       sigc::signal<void,sinfg::Layer::Handle>& signal_layer_removed() { return signal_layer_removed_; }
-
-       //! Signal called when the layer's active status has changed.
-       sigc::signal<void,sinfg::Layer::Handle,bool>& signal_layer_status_changed() { return signal_layer_status_changed_; }
-
-       //! Signal called when a canvas has been added.
-       sigc::signal<void,etl::handle<sinfg::Canvas> >& signal_canvas_added() { return signal_canvas_added_; }
-
-       //! Signal called when a canvas has been removed.
-       sigc::signal<void,etl::handle<sinfg::Canvas> >& signal_canvas_removed() { return signal_canvas_removed_; }
-
-       //! Signal called when a layer's parameter has been changed
-       sigc::signal<void,sinfg::Layer::Handle,sinfg::String>& signal_layer_param_changed() { return signal_layer_param_changed_; }
-
-       //! Signal called when the canvas's preview needs to be updated
-       //sigc::signal<void>& signal_dirty_preview() { return signal_dirty_preview_; }
-       sigc::signal<void>& signal_dirty_preview() { return get_canvas()->signal_dirty(); }
-
-       sigc::signal<void,etl::handle<sinfg::ValueNode>,etl::handle<sinfg::ValueNode> >&
-               signal_value_node_child_added() { return get_canvas()->signal_value_node_child_added(); }
-       sigc::signal<void,etl::handle<sinfg::ValueNode>,etl::handle<sinfg::ValueNode> >&
-               signal_value_node_child_removed() { return get_canvas()->signal_value_node_child_removed(); }
-
-       //! Signal called when a ValueNode has changed
-       sigc::signal<void,etl::handle<sinfg::ValueNode> >& signal_value_node_added() { return signal_value_node_added_; }
-
-       //! Signal called when a ValueNode has been deleted
-       sigc::signal<void,etl::handle<sinfg::ValueNode> >& signal_value_node_deleted() { return signal_value_node_deleted_; }
-
-       //! Signal called when a ValueNode has been changed
-       sigc::signal<void,etl::handle<sinfg::ValueNode> >& signal_value_node_changed() { return get_canvas()->signal_value_node_changed(); }
-       //sigc::signal<void,etl::handle<sinfg::ValueNode> >& signal_value_node_changed() { return signal_value_node_changed_; }
-
-       //! Signal called when the mode has changed
-       sigc::signal<void,Mode> signal_mode_changed() { return signal_mode_changed_; }
-
-       //! Signal called when a the ID has been changed
-       sigc::signal<void>& signal_id_changed() { return signal_id_changed_; }
-
-       //! Signal called whenever the time changes
-       sigc::signal<void> signal_time_changed() { return signal_time_changed_; }
-
-       //! Signal called whenever a data node has been replaced.
-       /*!     Second ValueNode replaces first */
-       sigc::signal<void,sinfg::ValueNode::Handle,sinfg::ValueNode::Handle>& signal_value_node_replaced()
-               { return signal_value_node_replaced_; }
-
-       //! Signal called whenever the RendDesc changes
-       sigc::signal<void>& signal_rend_desc_changed() { return signal_rend_desc_changed_; }
-
-       sigc::signal<void,sinfg::Keyframe>& signal_keyframe_added() { return signal_keyframe_added_; }
-
-       sigc::signal<void,sinfg::Keyframe>& signal_keyframe_removed() { return signal_keyframe_removed_; }
-
-       sigc::signal<void,sinfg::Keyframe>& signal_keyframe_changed() { return signal_keyframe_changed_; }
-
-public:
-
-       void auto_export(const ValueDesc& value_desc);
-
-       void auto_export(sinfg::ValueNode::Handle value_node);
-
-       void set_meta_data(const sinfg::String& key,const sinfg::String& data);
-
-       //! Changes the current SelectionManager object
-       void set_selection_manager(const etl::handle<SelectionManager> &sm) { selection_manager_=sm; }
-       
-       //! Disables the selection manager
-       void unset_selection_manager() { selection_manager_=new NullSelectionManager(); }
-       
-       //! Returns a handle to the current SelectionManager
-       const etl::handle<SelectionManager> &get_selection_manager()const { return selection_manager_; }        
-
-       //! Changes the current UIInterface object
-       void set_ui_interface(const etl::handle<UIInterface> &uim) { ui_interface_=uim; }
-
-       //! Disables the UIInterface
-       void unset_ui_interface() { ui_interface_=new DefaultUIInterface(); }
-       
-       //! Returns a handle to the current UIInterface
-       const etl::handle<UIInterface> &get_ui_interface() { return ui_interface_; }    
-
-       //! Returns the Canvas associated with this interface
-       etl::handle<sinfg::Canvas> get_canvas()const { return canvas_; }
-
-       //! Returns the Instance associated with this interface
-       etl::loose_handle<Instance> get_instance()const { return instance_; }
-
-       //! Changes the name of the canvas. Undoable.
-       bool set_name(const sinfg::String &x);
-
-       //! Changes the description of the canvas. Undoable.
-       bool set_description(const sinfg::String &x);
-
-       //! Changes the ID of the canvas. Undoable.
-       bool set_id(const sinfg::String &x);
-       
-       //! Convience function to retrieve the name of the canvas
-       sinfg::String get_name()const { return get_canvas()->get_name(); }
-
-       //! Convience function to retrieve the description of the canvas
-       sinfg::String get_description()const { return get_canvas()->get_description(); }
-
-       //! Convience function to retrieve the ID of the canvas
-       sinfg::String get_id()const { return get_canvas()->get_id(); }
-
-       //! Sets the current time
-       void set_time(sinfg::Time x);
-       
-       //! Retrieves the current time
-       sinfg::Time get_time()const;
-       
-       //! Changes the current time to the next keyframe
-       void jump_to_next_keyframe();
-
-       //! Changes the current time to the next keyframe
-       void jump_to_prev_keyframe();
-       
-       void seek_frame(int frames);
-
-       void seek_time(sinfg::Time time);
-       
-       //! \writeme
-       void refresh_current_values();
-       
-       //! Sets the current editing mode
-       /*! \see Mode */
-       void set_mode(Mode x);
-
-       //! Retrieves the current editing mode
-       /*! \see Mode */
-       Mode get_mode()const;
-
-       //! Creates a new layer, of type \c id at the top of the layer stack
-       sinfg::Layer::Handle add_layer(sinfg::String id) { return add_layer_to(id,get_canvas()); }
-
-       sinfg::Layer::Handle add_layer_to(sinfg::String id,sinfg::Canvas::Handle canvas, int depth=0);
-
-       bool convert(ValueDesc value_desc, sinfg::String type);
-       //! Adds the given ValueNode to the canvas.
-       bool add_value_node(sinfg::ValueNode::Handle value_node, sinfg::String name);
-
-
-       Action::ParamList generate_param_list(const sinfgapp::ValueDesc &);
-
-       Action::ParamList generate_param_list(const std::list<sinfgapp::ValueDesc> &);
-
-       void set_rend_desc(const sinfg::RendDesc &rend_desc);
-
-       bool import(const sinfg::String &filename, bool copy=false);
-       
-       
-       void waypoint_duplicate(sinfgapp::ValueDesc value_desc,sinfg::Waypoint waypoint);
-
-       void waypoint_remove(sinfgapp::ValueDesc value_desc,sinfg::Waypoint waypoint);
-
-       bool change_value(sinfgapp::ValueDesc value_desc,sinfg::ValueBase new_value);
-
-
-       int find_important_value_descs(std::vector<sinfgapp::ValueDesc>& out);
-       static int find_important_value_descs(sinfg::Canvas::Handle canvas,std::vector<sinfgapp::ValueDesc>& out,sinfg::GUIDSet& guid_set);
-
-       ~CanvasInterface();
-
-       static etl::handle<CanvasInterface> create(etl::loose_handle<Instance> instance,etl::handle<sinfg::Canvas> canvas);
-}; // END of class CanvasInterface
-
-/*!    \class PushMode
-**     \brief Class that changes the mode of a CanvasInterface, and restores it on destruction.
-*/
-class PushMode
-{
-       CanvasInterface* canvas_interface_;
-       CanvasInterface::Mode old_mode_;
-public:
-       PushMode(etl::loose_handle<CanvasInterface> c, CanvasInterface::Mode mode):
-               canvas_interface_(c.get()), old_mode_(canvas_interface_->get_mode())
-       { canvas_interface_->set_mode(mode); }
-       
-       ~PushMode() { canvas_interface_->set_mode(old_mode_); }
-}; // END of class PushMode
-
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/cvs.cpp b/synfig-studio/trunk/src/sinfgapp/cvs.cpp
deleted file mode 100644 (file)
index 65a16a2..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file cvs.cpp
-**     \brief Template File
-**
-**     $Id: cvs.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "cvs.h"
-#include <ETL/stringf>
-#include <fstream>
-#include <iostream>
-#include <sinfg/general.h>
-#include <stdlib.h>
-
-
-#include <sys/types.h>
-#include <sys/stat.h>
-//#include <unistd.h>
-
-#include <cassert>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-
-/* === M A C R O S ========================================================= */
-
-#define cvs_command            sinfg::String("cvs -z4")
-
-#ifndef WIN32
-#define HAVE_STRPTIME
-#endif
-
-#ifdef __APPLE__
-time_t _daylight_() { time_t t(time(0)); return localtime(&t)->tm_gmtoff; }
-#define daylight _daylight_()
-#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 ======================================================= */
-
-CVSInfo::CVSInfo(const sinfg::String& file_name)
-{
-       update_available_=false;
-       set_file_name(file_name);
-}
-
-CVSInfo::CVSInfo()
-{
-       update_available_=false;
-}
-
-CVSInfo::~CVSInfo()
-{
-}
-
-void
-CVSInfo::set_file_name(const sinfg::String& file_name)
-{
-       file_name_=file_name;
-       
-       std::ifstream file((dirname(file_name_)+"/CVS/Root").c_str());
-
-       if(file)
-       {
-               in_sandbox_=true;
-               calc_repository_info();
-       }
-       else
-               in_sandbox_=false;
-}
-
-void
-CVSInfo::calc_repository_info()
-{
-#ifdef _DEBUG
-       sinfg::info("in_sandbox() = %d",in_sandbox());
-#endif
-       
-       if(!in_sandbox_)
-               return;
-       
-       std::ifstream file((dirname(file_name_)+"/CVS/Entries").c_str());
-
-       while(file)
-       {
-               String line;
-               getline(file,line);
-               if(line.find(basename(file_name_))!=String::npos)
-               {
-                       in_repository_=true;
-                       String::size_type s,f;
-                       
-                       // Grab the version
-                       s=line.find('/',1);
-                       assert(s!=String::npos);
-                       s++;
-                       f=line.find('/',s+1);
-                       assert(f!=String::npos);
-                       cvs_version_=String(line,s,f-s);
-                       
-                       // Grab the time
-#ifdef HAVE_STRPTIME
-                       s=f+1;
-                       f=line.find('/',s+1);
-                       assert(f!=String::npos);
-                       tm time_struct;
-                       strptime(String(line,s,f-s).c_str(),"%c",&time_struct);
-                       original_timestamp_=mktime(&time_struct);
-#endif
-                       
-                       if(
-                               system(strprintf(
-                                       "cd '%s' && cvs status '%s' | grep -q -e 'Needs Patch'",
-                                       dirname(file_name_).c_str(),
-                                       basename(file_name_).c_str()
-                               ).c_str())==0
-                       )
-                       {
-                               sinfg::info("UPDATE_AVAILABLE=TRUE");
-                               update_available_=true;
-                       }
-                       else
-                       {
-                               system(strprintf(
-                                       "cd '%s' && cvs status '%s'",
-                                       dirname(file_name_).c_str(),
-                                       basename(file_name_).c_str()
-                               ).c_str());
-                               sinfg::info("UPDATE_AVAILABLE=FALSE");
-                               update_available_=false;
-                       }
-                               
-                       
-#ifdef _DEBUG
-                       sinfg::info("in_repository() = %d",in_repository());
-                       sinfg::info("get_cvs_version() = %s",get_cvs_version().c_str());
-                       sinfg::info("get_original_timestamp() = %s",ctime(&get_original_timestamp()));
-                       time_t t(get_current_timestamp());
-                       sinfg::info("get_current_timestamp() = %s",ctime(&t));
-                       sinfg::info("get_cvs_root() = %s",get_cvs_root().c_str());
-                       sinfg::info("get_cvs_module() = %s",get_cvs_module().c_str());
-#endif                 
-                       return;
-               }
-       }
-
-       in_repository_=false;
-       cvs_version_.clear();
-       original_timestamp_=0;
-
-#ifdef _DEBUG
-       sinfg::info("in_repository() = %d",in_repository());
-#endif
-}
-
-bool
-CVSInfo::in_sandbox()const
-{
-       return in_sandbox_;
-}
-
-bool
-CVSInfo::in_repository()const
-{
-       if(!in_sandbox_)
-               return false;
-       return in_repository_;
-}
-
-bool
-CVSInfo::is_modified()const
-{
-#ifdef _DEBUG
-       sinfg::info("%d-%d=%d",get_current_timestamp(),get_original_timestamp(),get_current_timestamp()-get_original_timestamp());
-#endif
-       if(!in_sandbox() || !in_repository())
-               return false;
-       return get_current_timestamp()!=get_original_timestamp() && abs(get_current_timestamp()-get_original_timestamp())!=3600;
-}
-
-bool
-CVSInfo::is_updated()const
-{
-       return update_available_;
-}
-
-const sinfg::String&
-CVSInfo::get_cvs_version()const
-{
-       return cvs_version_;
-}
-
-const time_t&
-CVSInfo::get_original_timestamp()const
-{
-       return original_timestamp_;
-}
-
-time_t
-CVSInfo::get_current_timestamp()const
-{
-       struct stat st;
-       if(stat(file_name_.c_str(),&st)<0)
-       {
-               sinfg::error("Unable to get file stats");
-               return false;
-       }
-       return st.st_mtime+timezone+(daylight-1)*3600;
-}
-
-sinfg::String
-CVSInfo::get_cvs_root()const
-{
-       if(!in_sandbox_)
-               return sinfg::String();
-       
-       std::ifstream file((dirname(file_name_)+"/CVS/Root").c_str());
-
-       if(file)
-       {
-               String ret;
-               getline(file,ret);
-               return ret;
-       }
-
-       return sinfg::String();
-}
-
-sinfg::String
-CVSInfo::get_cvs_module()const
-{
-       if(!in_sandbox_)
-               return sinfg::String();
-
-       std::ifstream file((dirname(file_name_)+"/CVS/Repository").c_str());
-
-       if(file)
-       {
-               String ret;
-               getline(file,ret);
-               return ret;
-       }
-
-       return sinfg::String();
-}
-
-// This function pre-processes the message so that we
-// don't get any CVS syntax errors.
-inline sinfg::String fix_msg(const sinfg::String& message)
-{
-       sinfg::String ret;
-       int i;
-       for(i=0;i<(int)message.size();i++)
-       {
-               if(message[i]=='\'')
-                       ret+="'\"'\"'";
-               else
-                       ret+=message[i];
-       }
-       return ret;
-}
-
-void
-CVSInfo::cvs_add(const sinfg::String& message)
-{
-       if(!in_sandbox_)
-       {
-               sinfg::error("cvs_add(): Not in a sand box");
-               throw int();
-               return;
-       }
-       
-       sinfg::String command(strprintf("cd '%s' && %s add -m '%s' '%s'",dirname(file_name_).c_str(),cvs_command.c_str(),fix_msg(message).c_str(),basename(file_name_).c_str()));
-       
-       int ret(system(command.c_str()));
-       
-       calc_repository_info();
-
-       switch(ret)
-       {
-       case 0:
-               break;
-       default:
-               sinfg::error("Unknown errorcode %d (\"%s\")",ret,command.c_str());
-               throw(ret);
-               break;
-       }
-}
-       
-void
-CVSInfo::cvs_update()
-{
-       if(!in_sandbox_)
-       {
-               sinfg::error("cvs_update(): Not in a sand box");
-               throw int();
-               return;
-       }
-       
-       sinfg::String command(strprintf("cd '%s' && %s update '%s'",dirname(file_name_).c_str(),cvs_command.c_str(),basename(file_name_).c_str()));
-       
-       int ret(system(command.c_str()));
-
-       calc_repository_info();
-       
-       switch(ret)
-       {
-       case 0:
-               break;
-       default:
-               sinfg::error("Unknown errorcode %d (\"%s\")",ret,command.c_str());
-               throw(ret);
-               break;
-       }
-}
-       
-void
-CVSInfo::cvs_commit(const sinfg::String& message)
-{
-       if(!in_sandbox_)
-       {
-               sinfg::error("cvs_commit(): Not in a sand box");
-               throw int();
-               return;
-       }
-       
-       sinfg::String command(strprintf("cd '%s' && %s commit -m '%s' '%s'",dirname(file_name_).c_str(),cvs_command.c_str(),fix_msg(message).c_str(),basename(file_name_).c_str()));
-       
-       int ret(system(command.c_str()));
-
-       calc_repository_info();
-       
-       switch(ret)
-       {
-       case 0:
-               break;
-       default:
-               sinfg::error("Unknown errorcode %d (\"%s\")",ret,command.c_str());
-               if(is_modified())
-                       throw(ret);
-               break;
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/cvs.h b/synfig-studio/trunk/src/sinfgapp/cvs.h
deleted file mode 100644 (file)
index b25c6e0..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file cvs.h
-**     \brief Template Header
-**
-**     $Id: cvs.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_CVS_H
-#define __SINFG_CVS_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/string.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 sinfgapp {
-
-class CVSInfo
-{
-       sinfg::String file_name_;
-
-       bool in_sandbox_;
-       bool in_repository_;
-       bool update_available_;
-       
-       sinfg::String cvs_version_;
-       time_t original_timestamp_;
-       
-       
-public:
-       void calc_repository_info();
-       
-       CVSInfo(const sinfg::String& file_name);
-       CVSInfo();
-       ~CVSInfo();
-
-       void set_file_name(const sinfg::String& file_name);
-
-//     READ OPERATIONS --------------------------------------------------
-
-       //! Returns TRUE if \a file_name is in a sandbox
-       bool in_sandbox()const;
-       
-       //! Returns TRUE if \a file_name is in the repository
-       bool in_repository()const;
-
-       //! Returns TRUE if \a file_name has modifications not yet on the repository
-       bool is_modified()const;
-
-       //! Returns TRUE if there is a new version of \a file_name on the repository
-       bool is_updated()const;
-
-       //! Returns the CVS version string
-       const sinfg::String& get_cvs_version()const;
-       
-       //! Returns the unix timestamp of the repository file
-       const time_t &get_original_timestamp()const;
-
-       //! Returns the unix timestamp of the checked out file
-       time_t get_current_timestamp()const;
-
-       //! Returns the Root
-       sinfg::String get_cvs_root()const;
-
-       //! Returns the name of the module
-       sinfg::String get_cvs_module()const;
-                       
-//     WRITE OPERATIONS -------------------------------------------------
-       
-       void cvs_add(const sinfg::String& message=sinfg::String());
-       
-       void cvs_update();
-       
-       void cvs_commit(const sinfg::String& message=sinfg::String());
-}; // END of class CVSInfo
-       
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/editmode.h b/synfig-studio/trunk/src/sinfgapp/editmode.h
deleted file mode 100644 (file)
index 7bc4874..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file editmode.h
-**     \brief Template Header
-**
-**     $Id: editmode.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_EDITMODE_H
-#define __SINFG_EDITMODE_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 sinfgapp {
-       
-/*!    \enum EditMode
-**     \brief \writeme
-*/
-enum EditMode
-{
-       MODE_NORMAL                     =0,                     //!< Normal editing mode. Place holder.
-
-       MODE_ANIMATE            =(1<<0),        //!< Animated editing mode.
-       MODE_ANIMATE_FUTURE     =(1<<1),        //!< Respect <i>future</i> keyframes
-       MODE_ANIMATE_PAST       =(1<<2),        //!< Respect <i>past</i> keyframes
-       MODE_ANIMATE_ALL        =(3<<1),        //!< Respect <i>all</i> keyframes
-
-       MODE_UNDEFINED          =(~0)   //!< Undefined Mode
-}; // END of enum EditMode
-
-//! Combine Flags
-inline EditMode
-operator|(const EditMode& lhs, const EditMode& rhs)
-{ return static_cast<EditMode>(int(lhs)|int(rhs)); }
-
-//! Exclude Flags
-inline EditMode
-operator-(const EditMode& lhs, const EditMode& rhs)
-{ return static_cast<EditMode>(int(lhs)&~int(rhs)); }
-
-inline EditMode&
-operator|=(EditMode& lhs, const EditMode& rhs)
-{ *reinterpret_cast<int*>(&lhs)|=int(rhs); return lhs; }
-
-//!    Flag Comparison. THIS IS NOT LESS-THAN-OR-EQUAL-TO.
-/*!    This function will return true of all of the flags
-**     in the \a rhs are set in the \a lhs */
-inline EditMode
-operator&(const EditMode& lhs, const EditMode& rhs)
-{ return static_cast<EditMode>(int(lhs)&int(rhs)); }
-
-//!    Flag Comparison. THIS IS NOT LESS-THAN-OR-EQUAL-TO.
-/*!    This function will return true of all of the flags
-**     in the \a rhs are set in the \a lhs */
-inline bool
-operator<=(const EditMode& lhs, const EditMode& rhs)
-{ return lhs&rhs==int(rhs); }
-
-}; // END if namespace sinfgapp
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/inputdevice.cpp b/synfig-studio/trunk/src/sinfgapp/inputdevice.cpp
deleted file mode 100644 (file)
index a6281c0..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file inputdevice.cpp
-**     \brief Template File
-**
-**     $Id: inputdevice.cpp,v 1.2 2005/01/12 04:08:32 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "inputdevice.h"
-#include "settings.h"
-#include <cstdio>
-#include <ETL/stringf>
-#include "main.h"
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-class DeviceSettings : public Settings
-{
-       InputDevice* input_device;
-public:
-       DeviceSettings(InputDevice* input_device):
-               input_device(input_device) { }
-               
-
-       virtual bool get_value(const sinfg::String& key, sinfg::String& value)const
-       {
-               if(key=="state")
-               {
-                       value=input_device->get_state();
-                       return true;
-               }
-               if(key=="bline_width")
-               {
-                       value=strprintf("%s",input_device->get_bline_width().get_string().c_str());
-                       return true;
-               }
-               if(key=="opacity")
-               {
-                       value=strprintf("%f",(float)input_device->get_opacity());
-                       return true;
-               }
-               if(key=="blend_method")
-               {
-                       value=strprintf("%i",(int)input_device->get_blend_method());
-                       return true;
-               }
-               if(key=="color")
-               {
-                       Color c(input_device->get_foreground_color());
-                       value=strprintf("%f %f %f %f",(float)c.get_r(),(float)c.get_g(),(float)c.get_b(),(float)c.get_a());
-
-                       return true;
-               }
-               
-               return Settings::get_value(key, value);
-       }
-       
-       virtual bool set_value(const sinfg::String& key,const sinfg::String& value)
-       {
-                       DEBUGPOINT();
-               if(key=="state")
-               {
-                       input_device->set_state(value);
-                       return true;
-               }
-               if(key=="bline_width")
-               {
-                       input_device->set_bline_width(sinfg::Distance(value));
-                       return true;
-               }
-               if(key=="opacity")
-               {
-                       input_device->set_opacity(atof(value.c_str()));
-                       return true;
-               }
-               if(key=="blend_method")
-               {
-                       input_device->set_blend_method(Color::BlendMethod(atoi(value.c_str())));
-                       return true;
-               }
-               if(key=="color")
-               {
-                       float r=0,g=0,b=0,a=1;
-                       if(!strscanf(value,"%f %f %f %f",&r,&g,&b,&a))
-                               return false;
-                       input_device->set_foreground_color(sinfg::Color(r,g,b,a));
-                       return true;
-               }
-               
-               return Settings::set_value(key, value);
-       }
-       
-       virtual KeyList get_key_list()const
-       {
-               KeyList ret(Settings::get_key_list());
-               ret.push_back("color");
-               ret.push_back("state");
-               ret.push_back("bline_width");
-               ret.push_back("blend_method");
-               ret.push_back("opacity");
-               return ret;
-       }
-};
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-InputDevice::InputDevice(const sinfg::String id_, Type type_):
-       id_(id_),
-       type_(type_),
-       state_((type_==TYPE_PEN)?"sketch":"normal"),
-       foreground_color_(Color::black()),
-       background_color_(Color::white()),
-       bline_width_(Distance(1,Distance::SYSTEM_POINTS)),
-       opacity_(1.0f),
-       blend_method_(Color::BLEND_COMPOSITE)
-{
-       switch(type_)
-       {
-               case TYPE_MOUSE:
-                       state_="normal";
-                       break;
-
-               case TYPE_PEN:
-                       state_="draw";
-                       break;
-
-               case TYPE_ERASER:
-                       state_="normal";
-                       break;
-
-               case TYPE_CURSOR:
-                       state_="normal";
-                       break;
-
-               default:
-                       state_="normal";
-                       break;
-       }
-       
-       device_settings=new DeviceSettings(this);
-       Main::settings().add_domain(device_settings,"input_device."+id_);
-}
-
-InputDevice::~InputDevice()
-{
-       Main::settings().remove_domain("input_device."+id_);    
-       delete device_settings;
-}
-
-Settings&
-InputDevice::settings()
-{
-       return *device_settings;
-}
-
-const Settings&
-InputDevice::settings()const
-{
-       return *device_settings;
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/inputdevice.h b/synfig-studio/trunk/src/sinfgapp/inputdevice.h
deleted file mode 100644 (file)
index 920096c..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.h
-**     \brief Template Header
-**
-**     $Id: inputdevice.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_INPUTDEVICE_H
-#define __SINFG_INPUTDEVICE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/color.h>
-#include <sinfg/vector.h>
-#include <sinfg/distance.h>
-#include <sinfg/string.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 ======================================= */
-
-class DeviceSettings;
-
-namespace sinfgapp {
-class Settings;
-
-       
-class InputDevice : public etl::shared_object
-{
-public:
-       enum Type
-       {
-               TYPE_MOUSE,
-               TYPE_PEN,
-               TYPE_ERASER,
-               TYPE_CURSOR
-       };
-
-       typedef etl::handle<InputDevice> Handle;
-       
-private:
-       sinfg::String id_;
-       Type type_;
-       sinfg::String state_;
-       sinfg::Color foreground_color_;
-       sinfg::Color background_color_;
-       sinfg::Distance bline_width_;   
-       sinfg::Real opacity_;
-       sinfg::Color::BlendMethod blend_method_;
-
-       DeviceSettings* device_settings;
-
-public:
-       InputDevice(const sinfg::String id_, Type type_=TYPE_MOUSE);
-       ~InputDevice();
-
-       const sinfg::String& get_id()const { return id_; }
-       const sinfg::String& get_state()const { return state_; }
-       const sinfg::Color& get_foreground_color()const { return foreground_color_; }
-       const sinfg::Color& get_background_color()const { return background_color_; }
-       const sinfg::Distance& get_bline_width()const { return bline_width_; }
-       const sinfg::Real& get_opacity()const { return opacity_; }
-       const sinfg::Color::BlendMethod& get_blend_method()const { return blend_method_; }
-       Type get_type()const { return type_; }
-       
-       void set_state(const sinfg::String& x) { state_=x; }
-       void set_foreground_color(const sinfg::Color& x) { foreground_color_=x; }
-       void set_background_color(const sinfg::Color& x) { background_color_=x; }
-       void set_bline_width(const sinfg::Distance& x) { bline_width_=x; }
-       void set_blend_method(const sinfg::Color::BlendMethod& x) { blend_method_=x; }
-       void set_opacity(const sinfg::Real& x) { opacity_=x; }
-       void set_type(Type x) { type_=x; }
-       
-       Settings& settings();
-       const Settings& settings()const;
-}; // END of class InputDevice
-
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/instance.cpp b/synfig-studio/trunk/src/sinfgapp/instance.cpp
deleted file mode 100644 (file)
index 6cb56ac..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file instance.cpp
-**     \brief Instance
-**
-**     $Id: instance.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "instance.h"
-#include "canvasinterface.h"
-#include <iostream>
-#include <sinfg/loadcanvas.h>
-#include <sinfg/savecanvas.h>
-#include <sinfg/valuenode_composite.h>
-#include <sinfg/valuenode_radialcomposite.h>
-#include <sinfg/valuenode_reference.h>
-#include <map>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-
-/* === M A C R O S ========================================================= */
-
-/* === G L O B A L S ======================================================= */
-
-static std::map<loose_handle<Canvas>, loose_handle<Instance> > instance_map_;
-
-/* === P R O C E D U R E S ================================================= */
-
-bool
-sinfgapp::is_editable(sinfg::ValueNode::Handle value_node)
-{
-       if(ValueNode_Const::Handle::cast_dynamic(value_node)
-               || ValueNode_TimedSwap::Handle::cast_dynamic(value_node)
-               || ValueNode_Animated::Handle::cast_dynamic(value_node)
-               || ValueNode_Composite::Handle::cast_dynamic(value_node)
-               || ValueNode_RadialComposite::Handle::cast_dynamic(value_node)
-               || ValueNode_Reference::Handle::cast_dynamic(value_node)
-       )
-               return true;
-       return false;
-}
-
-etl::handle<Instance>
-sinfgapp::find_instance(etl::handle<sinfg::Canvas> canvas)
-{
-       if(instance_map_.count(canvas)==0)
-               return 0;
-       return instance_map_[canvas];
-}
-
-/* === M E T H O D S ======================================================= */
-
-Instance::Instance(Canvas::Handle canvas):
-       CVSInfo(canvas->get_file_name()),
-       canvas_(canvas)
-{
-       assert(canvas->is_root());
-
-       unset_selection_manager();
-       
-       instance_map_[canvas]=this;
-} // END of sinfgapp::Instance::Instance()
-
-handle<Instance>
-Instance::create(Canvas::Handle canvas)
-{
-       // Construct a new instance
-       handle<Instance> instance(new Instance(canvas));
-
-       return instance;
-} // END of sinfgapp::Instance::create()
-
-sinfg::String
-Instance::get_file_name()const
-{
-       return get_canvas()->get_file_name();
-}
-
-void
-Instance::set_file_name(const sinfg::String &name)
-{
-       get_canvas()->set_file_name(name);
-       CVSInfo::set_file_name(name);
-}
-
-Instance::~Instance()
-{
-       instance_map_.erase(canvas_);
-       sinfg::info("studio::Instance::~Instance(): Deleted");
-} // END of studio::Instance::~Instance()
-
-handle<CanvasInterface>
-Instance::find_canvas_interface(handle<Canvas> canvas)
-{
-       if(!canvas)
-               return 0;
-       while(canvas->is_inline())
-               canvas=canvas->parent();
-       
-       CanvasInterfaceList::iterator iter;
-
-       for(iter=canvas_interface_list().begin();iter!=canvas_interface_list().end();iter++)
-               if((*iter)->get_canvas()==canvas)
-                       return *iter;
-
-       return CanvasInterface::create(this,canvas);
-}
-
-bool
-Instance::save()const
-{
-       bool ret=save_canvas(get_file_name(),canvas_);
-       if(ret)
-       {
-               reset_action_count();
-               const_cast<sigc::signal<void>& >(signal_saved_)();
-       }
-       return ret;
-}
-
-bool
-Instance::save_as(const std::string &file_name)const
-{
-       bool ret=save_canvas(file_name,canvas_);
-       if(ret)
-       {
-               reset_action_count();
-               const_cast<sigc::signal<void>& >(signal_saved_)();
-       }
-       return ret;
-}
-
-bool
-Instance::save_as(const std::string &file_name)
-{
-       bool ret;
-
-       String old_file_name(get_file_name());
-       
-       set_file_name(file_name);
-
-       ret=save_canvas(file_name,canvas_);
-
-       if(ret)
-       {
-               reset_action_count();
-               signal_saved_();
-       }
-       else
-       {
-               set_file_name(old_file_name);
-       }
-
-       signal_filename_changed_();
-
-       return ret;
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/instance.h b/synfig-studio/trunk/src/sinfgapp/instance.h
deleted file mode 100644 (file)
index a9901ad..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file instance.h
-**     \brief writeme
-**
-**     $Id: instance.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_INSTANCE_H
-#define __SINFG_APP_INSTANCE_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "action.h"
-#include <ETL/handle>
-#include <sinfg/canvas.h>
-#include <sinfg/string.h>
-#include <list>
-#include <sigc++/signal.h>
-#include <sigc++/object.h>
-#include "action_system.h"
-#include "selectionmanager.h"
-#include "cvs.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 sinfgapp {
-
-class CanvasInterface;
-
-
-class Instance : public Action::System , public CVSInfo
-{
-       friend class PassiveGrouper;
-       /*
- -- ** -- P U B L I C   T Y P E S ---------------------------------------------
-       */
-
-public:
-
-       typedef std::list< etl::handle<CanvasInterface> > CanvasInterfaceList;
-
-       using etl::shared_object::ref;
-       using etl::shared_object::unref;
-
-       /*
- -- ** -- P U B L I C  D A T A ------------------------------------------------
-       */
-
-public:
-       
-       /*
- -- ** -- P R I V A T E   D A T A ---------------------------------------------
-       */
-
-private:
-       //! Handle for root canvas
-       sinfg::Canvas::Handle canvas_;
-
-
-       CanvasInterfaceList canvas_interface_list_;
-
-       sigc::signal<void> signal_filename_changed_;
-       sigc::signal<void> signal_saved_;
-       etl::handle<SelectionManager> selection_manager_;
-       
-protected:
-       Instance(etl::handle<sinfg::Canvas>);
-
-       /*
- -- ** -- P U B L I C   M E T H O D S -----------------------------------------
-       */
-
-public:
-
-       ~Instance();
-
-       void set_selection_manager(const etl::handle<SelectionManager> &sm) { assert(sm); selection_manager_=sm; }
-       void unset_selection_manager() { selection_manager_=new NullSelectionManager(); }
-       const etl::handle<SelectionManager> &get_selection_manager() { return selection_manager_; }     
-
-
-
-       etl::handle<CanvasInterface> find_canvas_interface(sinfg::Canvas::Handle canvas);
-
-       sinfg::Canvas::Handle get_canvas()const { return canvas_; }
-
-       //! Saves the instance to filename_
-       bool save()const;
-
-       bool save_as(const sinfg::String &filename)const;
-
-       bool save_as(const sinfg::String &filename);
-
-public:        // Interfaces to internal information
-       sigc::signal<void>& signal_filename_changed() { return signal_filename_changed_; }
-       sigc::signal<void>& signal_saved() { return signal_saved_; }
-
-       CanvasInterfaceList & canvas_interface_list() { return canvas_interface_list_; }
-       const CanvasInterfaceList & canvas_interface_list()const { return canvas_interface_list_; }
-
-       sinfg::String get_file_name()const;
-
-       void set_file_name(const sinfg::String &name);
-
-public:
-       
-
-public:        // Constructor interfaces
-       static etl::handle<Instance> create(etl::handle<sinfg::Canvas> canvas);
-}; // END class Instance
-
-etl::handle<Instance> find_instance(etl::handle<sinfg::Canvas> canvas);
-
-bool is_editable(sinfg::ValueNode::Handle value_node);
-
-}; // END namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/main.cpp b/synfig-studio/trunk/src/sinfgapp/main.cpp
deleted file mode 100644 (file)
index cd7becb..0000000
+++ /dev/null
@@ -1,401 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file main.cpp
-**     \brief Template File
-**
-**     $Id: main.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "main.h"
-#include "action.h"
-
-#include <sinfg/color.h>
-#include <sinfg/gradient.h>
-
-#include <ETL/trivial>
-
-#include <list>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-
-/* === M A C R O S ========================================================= */
-
-/* === S T A T I C S ======================================================= */
-
-static etl::reference_counter sinfgapp_ref_count_(0);
-static sinfgapp::Action::Main* action_main;
-
-static Color foreground_;
-static Color background_;
-static Gradient gradient_;
-static bool gradient_default_colors_;
-
-static sinfg::Distance bline_width_;
-
-static Color::BlendMethod blend_method_;
-static Real opacity_;
-
-static sinfgapp::InputDevice::Handle selected_input_device_;
-static list<sinfgapp::InputDevice::Handle> input_devices_;
-
-trivial<sigc::signal<void> > signal_foreground_color_changed_;
-trivial<sigc::signal<void> > signal_background_color_changed_;
-trivial<sigc::signal<void> > signal_gradient_changed_;
-trivial<sigc::signal<void> > signal_bline_width_changed_;
-trivial<sigc::signal<void> > signal_blend_method_changed_;
-trivial<sigc::signal<void> > signal_opacity_changed_;
-trivial<sigc::signal<void> > signal_interpolation_changed_;
-
-trivial<Settings> settings_;
-
-static sinfg::Waypoint::Interpolation interpolation_;
-
-/* === P R O C E D U R E S ================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-sinfgapp::Main::Main(const sinfg::String &basepath,ProgressCallback *cb):
-       sinfg::Main(basepath,cb),
-       ref_count_(sinfgapp_ref_count_)
-{
-       if(ref_count_.count())
-               return;
-
-       sinfgapp_ref_count_.reset();
-       ref_count_=sinfgapp_ref_count_;
-       
-       // Add initialization after this point
-       action_main=new sinfgapp::Action::Main();
-
-       settings_.construct();
-       
-       signal_foreground_color_changed_.construct();
-       signal_background_color_changed_.construct();
-       signal_gradient_changed_.construct();
-       signal_opacity_changed_.construct();
-       signal_blend_method_changed_.construct();
-       signal_interpolation_changed_.construct();
-       
-       set_foreground_color(Color::black());
-       set_background_color(Color::white());
-       set_gradient_default_colors();
-       set_bline_width(Distance(1,Distance::SYSTEM_POINTS));
-       set_opacity(1.0);
-       set_blend_method(Color::BLEND_COMPOSITE);
-}
-
-sinfgapp::Main::~Main()
-{
-       ref_count_.detach();
-       if(!sinfgapp_ref_count_.unique())
-               return;
-       sinfgapp_ref_count_.detach();
-       
-       // Add deinitialization after this point
-
-       delete action_main;     
-       
-       selected_input_device_=0;
-       input_devices_.clear();
-       
-       settings_.destruct();
-       signal_foreground_color_changed_.destruct();
-       signal_background_color_changed_.destruct();
-       signal_gradient_changed_.destruct();
-
-       signal_opacity_changed_.destruct();
-       signal_blend_method_changed_.destruct();
-       signal_interpolation_changed_.destruct();
-}
-
-Settings&
-sinfgapp::Main::settings()
-{
-       return settings_;
-}
-
-sigc::signal<void>&
-sinfgapp::Main::signal_foreground_color_changed()
-{
-       return signal_foreground_color_changed_;
-}
-
-sigc::signal<void>&
-sinfgapp::Main::signal_background_color_changed()
-{
-       return signal_background_color_changed_;
-}
-
-sigc::signal<void>&
-sinfgapp::Main::signal_gradient_changed()
-{
-       return signal_gradient_changed_;
-}
-
-sigc::signal<void>&
-sinfgapp::Main::signal_bline_width_changed()
-{
-       return signal_bline_width_changed_;
-}
-
-sigc::signal<void>&
-sinfgapp::Main::signal_blend_method_changed()
-{
-       return signal_blend_method_changed_;
-}
-
-sigc::signal<void>&
-sinfgapp::Main::signal_opacity_changed()
-{
-       return signal_opacity_changed_;
-}
-
-sigc::signal<void>&
-sinfgapp::Main::signal_interpolation_changed()
-{
-       return signal_interpolation_changed_;
-}
-
-const sinfg::Color&
-sinfgapp::Main::get_foreground_color()
-{
-       return foreground_;
-}
-
-const sinfg::Color&
-sinfgapp::Main::get_background_color()
-{
-       return background_;
-}
-
-const sinfg::Gradient&
-sinfgapp::Main::get_gradient()
-{
-       return gradient_;
-}
-
-const sinfg::Real&
-sinfgapp::Main::get_opacity()
-{
-       return opacity_;
-}
-
-sinfg::Color::BlendMethod
-sinfgapp::Main::get_blend_method()
-{
-       return blend_method_;
-}
-
-void
-sinfgapp::Main::set_foreground_color(sinfg::Color color)
-{
-       foreground_=color;
-       signal_foreground_color_changed()();
-       if(selected_input_device_)
-               selected_input_device_->set_foreground_color(foreground_);
-       if(gradient_default_colors_)
-       {
-               gradient_=Gradient(foreground_,background_);
-               signal_gradient_changed()();
-       }
-}
-
-void
-sinfgapp::Main::set_background_color(sinfg::Color color)
-{
-       background_=color;
-       signal_background_color_changed()();
-
-       if(selected_input_device_)
-               selected_input_device_->set_background_color(background_);
-
-       if(gradient_default_colors_)
-       {
-               gradient_=Gradient(foreground_,background_);
-               signal_gradient_changed()();
-       }
-}
-
-void
-sinfgapp::Main::set_gradient(sinfg::Gradient gradient)
-{
-       gradient_=gradient;
-       gradient_default_colors_=false;
-       signal_gradient_changed()();
-}
-
-void
-sinfgapp::Main::set_gradient_default_colors()
-{
-       gradient_default_colors_=true;
-       gradient_=Gradient(foreground_,background_);
-       signal_gradient_changed()();
-}
-
-void
-sinfgapp::Main::color_swap()
-{
-       const Color tmp(foreground_);
-       foreground_=background_;
-       background_=tmp;
-
-       if(selected_input_device_)
-       {
-               selected_input_device_->set_foreground_color(foreground_);
-               selected_input_device_->set_background_color(background_);
-       }
-
-       signal_foreground_color_changed()();
-       signal_background_color_changed()();
-
-       if(gradient_default_colors_)
-       {
-               gradient_=Gradient(foreground_,background_);
-               signal_gradient_changed()();
-       }
-}
-
-sinfg::Waypoint::Interpolation
-sinfgapp::Main::get_interpolation()
-{
-       return interpolation_;
-}
-
-
-void
-sinfgapp::Main::set_interpolation(sinfg::Waypoint::Interpolation x)
-{
-       if(interpolation_!=x)
-       {
-               interpolation_=x;
-               
-               signal_interpolation_changed();
-       }
-}
-
-const sinfg::Distance&
-sinfgapp::Main::get_bline_width()
-{
-       return bline_width_;
-}
-
-void
-sinfgapp::Main::set_bline_width(sinfg::Distance x)
-{
-       if(x<0)x=0;
-       if(x!=bline_width_)
-       {
-               bline_width_=x;
-               
-               if(selected_input_device_)
-                       selected_input_device_->set_bline_width(x);
-               
-               signal_bline_width_changed()();
-       }
-}
-
-void
-sinfgapp::Main::set_opacity(sinfg::Real x)
-{
-       opacity_=x;
-       if(selected_input_device_)
-               selected_input_device_->set_opacity(opacity_);
-       signal_opacity_changed()();
-}
-
-void
-sinfgapp::Main::set_blend_method(sinfg::Color::BlendMethod x)
-{
-       blend_method_=x;
-       if(selected_input_device_)
-               selected_input_device_->set_blend_method(x);
-       signal_blend_method_changed()();
-}
-
-
-InputDevice::Handle
-sinfgapp::Main::add_input_device(const sinfg::String id, InputDevice::Type type)
-{
-       input_devices_.push_back(new InputDevice(id,type));
-       return input_devices_.back();
-}
-
-InputDevice::Handle
-sinfgapp::Main::find_input_device(const sinfg::String id)
-{
-       list<InputDevice::Handle>::iterator iter;
-       for(iter=input_devices_.begin();iter!=input_devices_.end();++iter)
-               if((*iter)->get_id()==id)
-                       return *iter;
-       return 0;
-}
-
-InputDevice::Handle
-sinfgapp::Main::select_input_device(const sinfg::String id)
-{
-       InputDevice::Handle input_device(find_input_device(id));
-       if(!input_device)
-               return 0;
-       if(!select_input_device(input_device))
-               return 0;
-       return input_device;
-}
-
-bool
-sinfgapp::Main::select_input_device(InputDevice::Handle input_device)
-{
-       assert(input_device);
-       
-       sinfg::info("Input device changed to \"%s\"",input_device->get_id().c_str());
-       
-       selected_input_device_=input_device;
-
-       set_bline_width(input_device->get_bline_width());       
-       set_foreground_color(input_device->get_foreground_color());
-       set_opacity(input_device->get_opacity());       
-       set_blend_method(input_device->get_blend_method());     
-       
-       return true;
-}
-
-InputDevice::Handle
-sinfgapp::Main::get_selected_input_device()
-{
-       return selected_input_device_;  
-}
-
-void
-sinfgapp::Main::set_state(sinfg::String state)
-{
-       if(selected_input_device_)
-               selected_input_device_->set_state(state);
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/main.h b/synfig-studio/trunk/src/sinfgapp/main.h
deleted file mode 100644 (file)
index 26622c3..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file main.h
-**     \brief Template Header
-**
-**     $Id: main.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 __SINFGAPP_MAIN_H
-#define __SINFGAPP_MAIN_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/ref_count>
-#include <sinfg/string.h>
-#include <sinfg/general.h>
-#include <sinfg/main.h>
-#include <sinfg/distance.h>
-#include <sinfg/real.h>
-#include <sinfg/waypoint.h>
-#include <sigc++/signal.h>
-#include <sigc++/object.h>
-#include "inputdevice.h"
-#include "settings.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 Color;
-       class Gradient;
-};
-
-namespace sinfgapp {
-       
-/*!    \class sinfgapp::Main
-**     \brief \writeme
-**
-**     \writeme
-*/
-class Main : public sinfg::Main
-{
-       etl::reference_counter ref_count_;
-public:
-       Main(const sinfg::String &basepath,sinfg::ProgressCallback *cb=0);
-       ~Main();
-
-       const etl::reference_counter& ref_count()const { return ref_count_; }
-               
-       static const sinfg::Color& get_foreground_color();
-       static const sinfg::Color& get_background_color();
-       static const sinfg::Gradient& get_gradient();
-       static const sinfg::Distance& get_bline_width();
-       static sinfg::Waypoint::Interpolation get_interpolation();
-
-
-       static void set_interpolation(sinfg::Waypoint::Interpolation x);
-       static void set_bline_width(sinfg::Distance x); 
-       static void set_foreground_color(sinfg::Color color);
-       static void set_background_color(sinfg::Color color);
-       static void set_gradient(sinfg::Gradient gradient);
-       static void set_gradient_default_colors();
-       static void color_swap();       
-
-       static sinfg::Color::BlendMethod get_blend_method();
-       static const sinfg::Real& get_opacity();
-       static void set_blend_method(sinfg::Color::BlendMethod);
-       static void set_opacity(sinfg::Real);
-       static sigc::signal<void>& signal_blend_method_changed();
-       static sigc::signal<void>& signal_opacity_changed();
-       static sigc::signal<void>& signal_interpolation_changed();
-       
-       // Input Device stuff
-       static InputDevice::Handle add_input_device(const sinfg::String id_, InputDevice::Type type_=InputDevice::TYPE_MOUSE);
-       static InputDevice::Handle find_input_device(const sinfg::String id_);
-       static InputDevice::Handle select_input_device(const sinfg::String id_);
-       static bool select_input_device(InputDevice::Handle input_device);
-       static InputDevice::Handle get_selected_input_device();
-       static void set_state(sinfg::String state);
-
-       static Settings& settings();
-       
-       // Signal interfaces    
-       static sigc::signal<void>& signal_foreground_color_changed();
-       static sigc::signal<void>& signal_background_color_changed();
-       static sigc::signal<void>& signal_gradient_changed();
-       static sigc::signal<void>& signal_bline_width_changed();
-
-}; // END of class Main
-
-}; // END if namespace sinfgapp
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/selectionmanager.h b/synfig-studio/trunk/src/sinfgapp/selectionmanager.h
deleted file mode 100644 (file)
index e6abeea..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.h
-**     \brief Template Header
-**
-**     $Id: selectionmanager.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_SELECTIONMANAGER_H
-#define __SINFG_APP_SELECTIONMANAGER_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <list>
-#include <set>
-#include <ETL/handle>
-#include <sinfg/layer.h>
-#include <sinfg/valuenode.h>
-#include "value_desc.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 sinfgapp {
-
-class SelectionManager : public etl::shared_object
-{
-public:
-       typedef std::pair<sinfg::Layer::Handle,sinfg::String> LayerParam;
-       typedef std::list<LayerParam> LayerParamList;
-
-       typedef std::list<sinfg::Layer::Handle> LayerList;
-       typedef std::list<ValueDesc> ChildrenList;
-       //typedef std::list<sinfg::ValueNode::Handle> ValueNodeList;
-
-       virtual ~SelectionManager() { }
-
-       //! Returns the number of layers selected.
-       virtual int get_selected_layer_count()const=0;
-
-       //! Returns a list of the currently selected layers.
-       virtual LayerList get_selected_layers()const=0;
-       
-       //! Returns the first layer selected or an empty handle if none are selected.
-       virtual sinfg::Layer::Handle get_selected_layer()const=0;
-       
-       //! Sets which layers should be selected
-       virtual void set_selected_layers(const LayerList &layer_list)=0;
-
-       //! Sets which layer should be selected. Empty handle if none.
-       virtual void set_selected_layer(const sinfg::Layer::Handle &layer)=0;
-
-       //! Clears the layer selection list
-       virtual void clear_selected_layers()=0;
-
-
-
-       //! Returns the number of childrens selected.
-       virtual int get_selected_children_count()const=0;
-
-       //! Returns a list of the currently selected childrens.
-       virtual ChildrenList get_selected_children()const=0;
-       
-       //! Returns the first children selected or an empty handle if none are selected.
-       virtual ChildrenList::value_type get_selected_child()const=0;
-       
-       //! Sets which childrens should be selected
-       virtual void set_selected_children(const ChildrenList &children_list)=0;
-
-       //! Sets which children should be selected. Empty handle if none.
-       virtual void set_selected_child(const ChildrenList::value_type &children)=0;
-
-       //! Clears the children selection list
-       virtual void clear_selected_children()=0;
-
-
-       //! Returns the number of layer parameters selected.
-       virtual int get_selected_layer_parameter_count()const=0;
-
-       //! Returns a list of the currently selected layer parameters.
-       virtual LayerParamList get_selected_layer_parameters()const=0;
-       
-       //! Returns the first layer parameter selected or an empty handle if none are selected.
-       virtual LayerParam get_selected_layer_parameter()const=0;
-       
-       //! Sets which layer parameters should be selected
-       virtual void set_selected_layer_parameters(const LayerParamList &layer_param_list)=0;
-
-       //! Sets which layer parameter should be selected. Empty handle if none.
-       virtual void set_selected_layer_param(const LayerParam &layer_param)=0;
-
-       //! Clears the layer parameter selection list
-       virtual void clear_selected_layer_parameters()=0;
-}; // END of class SelectionManager
-
-//! A place holding selection manager that does nothing
-class NullSelectionManager : public SelectionManager
-{
-public:
-       int get_selected_layer_count()const { return 0; }
-       LayerList get_selected_layers()const { return LayerList(); }
-       sinfg::Layer::Handle get_selected_layer()const { return 0; }
-       void set_selected_layers(const LayerList &layer_list) { return; }
-       void set_selected_layer(const sinfg::Layer::Handle &layer) { return; }
-       void clear_selected_layers() { return; }
-
-
-       int get_selected_children_count()const { return 0; }
-       ChildrenList get_selected_children()const { return ChildrenList(); }
-       ChildrenList::value_type get_selected_child()const { return ChildrenList::value_type(); }
-       void set_selected_children(const ChildrenList &children_list) { return; }
-       void set_selected_child(const ChildrenList::value_type &child) { return; }
-       void clear_selected_children() { return; }
-
-       int get_selected_layer_parameter_count()const { return 0; }
-       LayerParamList get_selected_layer_parameters()const { return LayerParamList(); }
-       LayerParam get_selected_layer_parameter()const { return LayerParam(); }
-       void set_selected_layer_parameters(const LayerParamList &layer_param_list) { return; }
-       void set_selected_layer_param(const LayerParam &layer_param) { return; }
-       void clear_selected_layer_parameters() { return; }
-
-}; // END of class NullSelectionManager
-
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/settings.cpp b/synfig-studio/trunk/src/sinfgapp/settings.cpp
deleted file mode 100644 (file)
index 05ea188..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.cpp
-**     \brief Template File
-**
-**     $Id: settings.cpp,v 1.2 2005/01/12 04:08:32 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 <fstream>
-#include <iostream>
-#include "settings.h"
-#include <sinfg/general.h>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-
-/* === 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 ======================================================= */
-
-Settings::Settings()
-{
-}
-
-Settings::~Settings()
-{
-}
-
-sinfg::String
-Settings::get_value(const sinfg::String& key)const
-{
-       sinfg::String value;
-       if(!get_value(key,value))
-               return sinfg::String();
-       return value;
-}
-
-void
-Settings::add_domain(Settings* domain, const sinfg::String& name)
-{
-       domain_map[name]=domain;
-}
-
-void
-Settings::remove_domain(const sinfg::String& name)
-{
-       domain_map.erase(name);
-}
-
-bool
-Settings::get_value(const sinfg::String& key, sinfg::String& value)const
-{
-       // Search for the value in any children domains
-       DomainMap::const_iterator iter;
-       for(iter=domain_map.begin();iter!=domain_map.end();++iter)
-       {
-               // if we have a domain hit
-               if(key.size()>iter->first.size() && String(key.begin(),key.begin()+iter->first.size())==iter->first)
-               {
-                       sinfg::String key_(key.begin()+iter->first.size()+1,key.end());
-                       
-                       // If the domain has it, then we have got a hit
-                       if(iter->second->get_value(key_,value))
-                               return true;
-               }
-       }
-
-       // Search for the value in our simple map
-       if(simple_value_map.count(key))
-       {
-               value=simple_value_map.find(key)->second;
-               return true;
-       }
-       
-       // key not found
-       return false;
-}
-
-bool
-Settings::set_value(const sinfg::String& key,const sinfg::String& value)
-{
-       // Search for the key in any children domains
-       DomainMap::iterator iter;
-       for(iter=domain_map.begin();iter!=domain_map.end();++iter)
-       {
-               // if we have a domain hit
-               if(key.size()>iter->first.size() && String(key.begin(),key.begin()+iter->first.size())==iter->first)
-               {
-                       sinfg::String key_(key.begin()+iter->first.size()+1,key.end());
-                       
-                       return iter->second->set_value(key_,value);
-               }
-       }
-
-       simple_value_map[key]=value;
-       return true;
-}
-
-Settings::KeyList
-Settings::get_key_list()const
-{
-       KeyList key_list;
-
-       // Get keys from the domains
-       {
-               DomainMap::const_iterator iter;
-               for(iter=domain_map.begin();iter!=domain_map.end();++iter)
-               {
-                       KeyList sub_key_list(iter->second->get_key_list());
-                       KeyList::iterator key_iter;
-                       for(key_iter=sub_key_list.begin();key_iter!=sub_key_list.end();++key_iter)
-                               key_list.push_back(iter->first+'.'+*key_iter);
-               }
-       }
-       
-       // Get keys from the simple variables
-       {
-               ValueBaseMap::const_iterator iter;
-               for(iter=simple_value_map.begin();iter!=simple_value_map.end();++iter)
-                       key_list.push_back(iter->first);
-       }
-
-       // Sort the keys
-       key_list.sort();
-       
-       return key_list;
-}
-
-bool
-Settings::save_to_file(const sinfg::String& filename)const
-{
-       sinfg::String tmp_filename(filename+".TMP");
-       
-       try
-       {
-               std::ofstream file(tmp_filename.c_str());
-
-               if(!file)return false;
-       
-               KeyList key_list(get_key_list());
-               
-               // Save the keys
-               {
-                       KeyList::const_iterator iter;
-                       for(iter=key_list.begin();iter!=key_list.end();++iter)
-                       {
-                               if(!file)return false;
-                               file<<*iter<<'='<<get_value(*iter)<<endl;
-                       }
-               }
-       
-               if(!file)
-                       return false;
-       }catch(...) { return false; }
-       
-#ifdef _WIN32
-       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());
-               return false;
-       }
-       remove(old_file);
-#else
-       if(rename(tmp_filename.c_str(),filename.c_str())!=0)
-               return false;
-#endif
-       
-       return true;
-}
-
-bool
-Settings::load_from_file(const sinfg::String& filename)
-{
-       std::ifstream file(filename.c_str());
-       if(!file)
-               return false;
-       while(file)
-       {
-               std::string line;
-               getline(file,line);
-               if(!line.empty() && ((line[0]>='a' && line[0]<='z')||(line[0]>='A' && line[0]<='Z')))
-               {
-                       std::string::iterator equal(find(line.begin(),line.end(),'='));
-                       if(equal==line.end())
-                               continue;
-                       std::string key(line.begin(),equal);
-                       std::string value(equal+1,line.end());
-                       
-                       //sinfg::info("Settings::load_from_file(): Trying Key \"%s\" with a value of \"%s\".",key.c_str(),value.c_str());
-                       try{
-                       if(!set_value(key,value))
-                               sinfg::warning("Settings::load_from_file(): Key \"%s\" with a value of \"%s\" was rejected.",key.c_str(),value.c_str());
-                       }
-                       catch(...)
-                       {
-                               sinfg::error("Settings::load_from_file(): Attept to set key \"%s\" with a value of \"%s\" has thrown an exception.",key.c_str(),value.c_str());
-                               throw;
-                       }
-               }
-       }
-       return true;
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/settings.h b/synfig-studio/trunk/src/sinfgapp/settings.h
deleted file mode 100644 (file)
index d67f173..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file template.h
-**     \brief Template Header
-**
-**     $Id: settings.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_SETTINGS_H
-#define __SINFG_SETTINGS_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/string.h>
-#include <map>
-#include <list>
-#include <ETL/stringf>
-
-/* === 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 sinfgapp {
-
-class Settings
-{
-public:
-       
-       typedef std::list<sinfg::String> KeyList;
-       typedef std::map<sinfg::String,sinfg::String> ValueBaseMap;
-       typedef std::map<sinfg::String,Settings*> DomainMap;
-       
-private:
-       ValueBaseMap simple_value_map;
-
-       DomainMap domain_map;
-
-public:
-       Settings();
-       virtual ~Settings();
-
-       virtual bool get_value(const sinfg::String& key, sinfg::String& value)const;
-       virtual bool set_value(const sinfg::String& key,const sinfg::String& value);
-       virtual KeyList get_key_list()const;
-
-       sinfg::String get_value(const sinfg::String& key)const;
-       void add_domain(Settings* domain, const sinfg::String& name);
-       void remove_domain(const sinfg::String& name);
-
-       bool load_from_string(const sinfg::String& data);
-       bool save_to_string(sinfg::String& data);
-
-       bool load_from_file(const sinfg::String& filename);
-       bool save_to_file(const sinfg::String& filename)const;
-}; // END of class Settings
-
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/timegather.cpp b/synfig-studio/trunk/src/sinfgapp/timegather.cpp
deleted file mode 100644 (file)
index 22987fd..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timegather.cpp
-**     \brief Time Gather File
-**
-**     $Id: timegather.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "timegather.h"
-#include "value_desc.h"
-
-#include <sinfg/layer_pastecanvas.h>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-
-/* === 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 ================================================= */
-
-//! Definitions for build a list of accurate valuenode references
-
-void sinfgapp::timepoints_ref::insert(sinfg::ValueNode_Animated::Handle v, sinfg::Waypoint w)
-{
-       ValueBaseTimeInfo       vt;
-       vt.val = v;
-       
-       waytracker::iterator i = waypointbiglist.find(vt);
-       
-       if(i != waypointbiglist.end())
-       {
-               i->waypoints.insert(w);
-       }else
-       {
-               vt.waypoints.insert(w);
-               waypointbiglist.insert(vt);
-       }
-}
-
-void sinfgapp::timepoints_ref::insert(sinfgapp::ValueDesc v, sinfg::Activepoint a)
-{
-       ActiveTimeInfo  vt;
-       vt.val = v;
-       
-       acttracker::iterator i = actpointbiglist.find(vt);
-       
-       if(i != actpointbiglist.end())
-       {
-               i->activepoints.insert(a);
-               /*{ //if it fails...
-                       sinfg::info("!!!!For some reason it wasn't able to insert the activepoint in the list (%s,%.4lg)",
-                                                       a.state?"true":"false", (double)a.time);
-               }*/
-       }else
-       {
-               vt.activepoints.insert(a);
-               actpointbiglist.insert(vt);
-               //sinfg::info("Insert new activept list for valdesc");
-       }
-}
-
-//recursion functions
-void sinfgapp::recurse_canvas(sinfg::Canvas::Handle h, const std::set<Time> &tlist, 
-                                                               timepoints_ref &vals)
-{
-       
-       //sinfg::info("Canvas...\n Recurse through layers");
-       // iterate through the layers
-
-       sinfg::Canvas::iterator i = h->begin(), end = h->end();
-
-       for(; i != end; ++i)
-       {
-               const Node::time_set &tset = (*i)->get_times();
-               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
-               {
-                       recurse_layer(*i,tlist,vals);
-               }
-       }
-}
-
-void sinfgapp::recurse_layer(sinfg::Layer::Handle h, const std::set<Time> &tlist, 
-                                                               timepoints_ref &vals)
-{
-       // iterate through the layers
-       //check for special case of paste canvas
-       etl::handle<sinfg::Layer_PasteCanvas> p = etl::handle<sinfg::Layer_PasteCanvas>::cast_dynamic(h);
-       
-       //sinfg::info("Layer...");
-       
-       if(p)
-       {
-               //sinfg::info("We are a paste canvas so go into that");
-               //recurse into the canvas
-               const sinfg::Node::time_set &tset = p->get_sub_canvas()->get_times();
-               
-               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
-               {
-                       //we have to offset the times so it won't wreck havoc if the canvas is imported more than once...
-                       // and so we get correct results when offsets are present
-                       std::set<Time>  tlistoff;                       
-                       std::set<Time>::iterator i = tlist.begin(), end = tlist.end();
-                       for(; i != end; ++i)
-                       {
-                               tlistoff.insert(*i - p->get_time_offset());
-                       }
-                       
-                       recurse_canvas(p->get_sub_canvas(),tlist,vals);
-               }
-       }
-
-       //check all the valuenodes regardless...
-       //sinfg::info("Recurse all valuenodes");
-       sinfg::Layer::DynamicParamList::const_iterator  i = h->dynamic_param_list().begin(),
-                                                                                                       end = h->dynamic_param_list().end();
-       for(; i != end; ++i)
-       {
-               const sinfg::Node::time_set &tset = i->second->get_times();
-               
-               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
-               {
-                       recurse_valuedesc(ValueDesc(h,i->first),tlist,vals);
-               }
-       }
-}
-
-template < typename IT, typename CMP >
-static bool sorted(IT i,IT end, const CMP &cmp = CMP())
-{
-       if(i == end) return true;
-               
-       for(IT last = i++; i != end; last = i++)
-       {
-               if(!cmp(*last,*i))
-                       return false;
-       }
-       
-       return true;
-}
-
-void sinfgapp::recurse_valuedesc(sinfgapp::ValueDesc h, const std::set<Time> &tlist, 
-                                                               timepoints_ref &vals)
-{
-       //special cases for Animated, DynamicList, and Linkable
-       
-       //sinfg::info("ValueBasenode... %p, %s", h.get_value_node().get(),typeid(*h.get_value_node()).name());
-       
-       
-       //animated case
-       {
-               sinfg::ValueNode_Animated::Handle p = sinfg::ValueNode_Animated::Handle::cast_dynamic(h.get_value_node());
-               
-               if(p)
-               {
-                       //loop through and determine which waypoint we will need to reference
-                       const sinfg::WaypointList &w = p->waypoint_list();
-                       
-                       sinfg::WaypointList::const_iterator i = w.begin(),
-                                                                                               end = w.end();
-                       
-                       std::set<Time>::const_iterator          j = tlist.begin(),
-                                                                                               jend = tlist.end();
-                       for(; i != end && j != jend;) 
-                       {
-                               //sinfg::info("tpair t(%.3f) = %.3f", (float)*j, (float)(i->get_time()));
-                               
-                               if(j->is_equal(i->get_time()))
-                               {
-                                       vals.insert(p,*i);
-                                       ++i,++j;
-                               }else if(*i < *j) 
-                               {
-                                       ++i;
-                               }else ++j;
-                       }
-                       return;
-               }
-       }
-       
-       //parent dynamiclist case - just for active points for that object...
-       if(h.parent_is_value_node())
-       {
-               sinfg::ValueNode_DynamicList::Handle p = sinfg::ValueNode_DynamicList::Handle::cast_dynamic(h.get_parent_value_node());                                         
-                               
-               if(p)
-               {
-                       int index = h.get_index();
-                       
-                       //check all the active points in each list...
-                       const sinfg::ActivepointList &a = p->list[index].timing_info;
-                       
-                       //sinfg::info("Our parent = dynamic list, searching in %d activepts",a.size());
-                                               
-                       std::set<Time>::const_iterator                  i = tlist.begin(),
-                                                                                                       end = tlist.end();
-                       
-                       sinfg::ActivepointList::const_iterator  j = a.begin(),
-                                                                                                       jend = a.end();
-                       
-                       for(; j != jend && i != end;)
-                       {
-                               double it = *i;
-                               double jt = j->get_time();
-                               double diff = (double)(it - jt);
-                               
-                               //sinfg::info("\ttpair match(%.4lg) - %.4lg (diff = %lg",it,jt,diff);                           
-                               
-                               //
-                               if(abs(diff) < (double)Time::epsilon())
-                               {
-                                       //sinfg::info("\tActivepoint to add being referenced (%x,%s,%.4lg)",
-                                       //                              (int)j->get_uid(),j->state?"true":"false", (double)j->time);
-                                       vals.insert(ValueDesc(p,index),*j);
-                                       ++i,++j;                                                
-                               }else if(it < jt)
-                               {
-                                       ++i;
-                                       //sinfg::info("\tIncrementing time");
-                               }
-                               else 
-                               {
-                                       ++j;
-                                       //sinfg::info("\tIncrementing actpt");
-                               }
-                       }
-               }
-       }
-       
-       //dynamiclist case - we must still make sure that we read from the list entries the time values
-       //                                              because just the linked valuenodes will not do that
-       {
-               sinfg::ValueNode_DynamicList::Handle p = sinfg::ValueNode_DynamicList::Handle::cast_dynamic(h.get_value_node());
-               
-               if(p)
-               {
-                       //sinfg::info("Process dynamic list valuenode");
-                       int index = 0;
-                       
-                       std::vector<sinfg::ValueNode_DynamicList::ListEntry>::const_iterator    
-                                                       i = p->list.begin(),
-                                                       end = p->list.end();
-                       
-                       for(; i != end; ++i, ++index)
-                       {
-                               const Node::time_set &tset = i->get_times();
-                               
-                               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
-                               {
-                                       recurse_valuedesc(ValueDesc(p,index),tlist,vals);
-                               }
-                       }
-                       return;
-               }
-       }
-       
-       //the linkable case...
-       {
-               etl::handle<sinfg::LinkableValueNode> p = etl::handle<sinfg::LinkableValueNode>::cast_dynamic(h.get_value_node());
-               
-               if(p)
-               {
-                       //sinfg::info("Process Linkable ValueBasenode");
-                       int i = 0, size = p->link_count();
-                       
-                       for(; i < size; ++i)
-                       {
-                               ValueNode::Handle v = p->get_link(i);
-                               const Node::time_set &tset = v->get_times();
-                               
-                               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
-                               {
-                                       recurse_valuedesc(ValueDesc(p,i),tlist,vals);
-                               }
-                       }
-               }
-       }
-}
diff --git a/synfig-studio/trunk/src/sinfgapp/timegather.h b/synfig-studio/trunk/src/sinfgapp/timegather.h
deleted file mode 100644 (file)
index fb1416b..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file timegather.h
-**     \brief Time Gather Header
-**
-**     $Id: timegather.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2004 Adrian Bentley
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_TIMEGATHER_H
-#define __SINFG_TIMEGATHER_H
-
-/* === H E A D E R S ======================================================= */
-#include <sinfg/valuenode_animated.h>
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfg/time.h>
-#include "value_desc.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 sinfgapp {
-
-class ValueDesc;
-class sinfg::Time;
-
-struct ValueBaseTimeInfo
-{
-       sinfg::ValueNode_Animated::Handle       val;
-       mutable std::set<sinfg::Waypoint>       waypoints;
-       
-       bool operator<(const ValueBaseTimeInfo &rhs) const
-       {
-               return val < rhs.val;
-       }
-};
-
-struct ActiveTimeInfo
-{
-       struct actcmp
-       {
-               bool operator()(const sinfg::Activepoint &lhs, const sinfg::Activepoint &rhs) const
-               {
-                       return lhs.time < rhs.time;
-               }               
-       };
-       
-       sinfgapp::ValueDesc                                             val;
-       
-       typedef std::set<sinfg::Activepoint,actcmp>     set;
-       
-       mutable set activepoints;
-       
-       bool operator<(const ActiveTimeInfo &rhs) const
-       {
-               return val.get_parent_value_node() == rhs.val.get_parent_value_node() ? 
-                                               val.get_index() < rhs.val.get_index() : 
-                                               val.get_parent_value_node() < rhs.val.get_parent_value_node();
-       }
-};
-
-struct timepoints_ref
-{
-       typedef std::set<ValueBaseTimeInfo>             waytracker;     
-       typedef std::set<ActiveTimeInfo>        acttracker;
-       
-       waytracker              waypointbiglist;
-       acttracker              actpointbiglist;        
-       
-       void insert(sinfg::ValueNode_Animated::Handle v, sinfg::Waypoint w);    
-       void insert(sinfgapp::ValueDesc v, sinfg::Activepoint a);
-};
-
-//assumes they're sorted... (incremental advance)
-//checks the intersection of the two sets... might be something better in the stl
-template < typename I1, typename I2 >
-bool check_intersect(I1 b1, I1 end1, I2 b2, I2 end2)
-{
-       if(b1 == end1 || b2 == end2) 
-               return false;
-       
-       for(; b1 != end1 && b2 != end2;)
-       {
-               if(*b1 < *b2) ++b1;
-               else if(*b2 < *b1) ++b2;
-               else
-               {
-                       assert(*b1 == *b2);
-                       return true;
-               }
-       }
-       return false;
-}
-
-//pointer kind of a hack, gets the accurate times from a value desc 
-//     (deals with dynamic list member correctly... i.e. gathers activepoints)
-const sinfg::Node::time_set *get_times_from_vdesc(const sinfgapp::ValueDesc &v);
-
-//get's the closest time inside the set
-bool get_closest_time(const sinfg::Node::time_set &tset, const sinfg::Time &t, 
-                                               const sinfg::Time &range, sinfg::Time &out);
-
-//recursion functions based on time restrictions (can be expanded later)...
-//builds a list of relevant waypoints and activepoints inside the timepoints_ref structure
-void recurse_valuedesc(sinfgapp::ValueDesc valdesc, const std::set<sinfg::Time> &tlist,
-                                                               timepoints_ref &vals);
-void recurse_layer(sinfg::Layer::Handle layer, const std::set<sinfg::Time> &tlist, 
-                                                               timepoints_ref &vals);
-void recurse_canvas(sinfg::Canvas::Handle canvas, const std::set<sinfg::Time> &tlist, 
-                                                               timepoints_ref &vals);
-
-
-
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/uimanager.cpp b/synfig-studio/trunk/src/sinfgapp/uimanager.cpp
deleted file mode 100644 (file)
index e9c9e91..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file uimanager.cpp
-**     \brief Template File
-**
-**     $Id: uimanager.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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 "uimanager.h"
-#include <iostream>
-#include <string>
-
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace sinfg;
-using namespace sinfgapp;
-
-/* === M A C R O S ========================================================= */
-
-/* === M E T H O D S ======================================================= */
-
-UIInterface::Response
-ConsoleUIInterface::yes_no(const std::string &title, const std::string &message,Response dflt)
-{
-       cout<<title<<": "<<message<<' ';
-       if(dflt==RESPONSE_NO)
-               cout<<_("(no/yes)")<<endl;
-       else
-               cout<<_("(yes/no)")<<endl;
-       string resp;
-       cin>>resp;
-
-       if(dflt==RESPONSE_NO)
-       {
-               if(resp=="yes")
-                       return RESPONSE_YES;
-               else
-                       return RESPONSE_NO;
-       }
-       else
-       {
-               if(resp=="no")
-                       return RESPONSE_NO;
-               else
-                       return RESPONSE_YES;
-       }
-}
-
-UIInterface::Response
-ConsoleUIInterface::yes_no_cancel(const string &title, const string &message,Response dflt)
-{
-       cout<<title<<": "<<message<<' ';
-       if(dflt==RESPONSE_NO)
-               cout<<_("(no/yes)")<<endl;
-       else
-               cout<<_("(yes/no)")<<endl;
-       string resp;
-       cin>>resp;
-
-       if(dflt==RESPONSE_NO)
-       {
-               if(resp=="yes")
-                       return RESPONSE_YES;
-               else
-                       return RESPONSE_NO;
-       }
-       else
-       {
-               if(resp=="no")
-                       return RESPONSE_NO;
-               else
-                       return RESPONSE_YES;
-       }
-}
-
-UIInterface::Response
-ConsoleUIInterface::ok_cancel(const std::string &title, const std::string &message,Response dflt)
-{
-       cout<<title<<": "<<message<<' ';
-       if(dflt==RESPONSE_CANCEL)
-               cout<<_("(cancel/ok)")<<endl;
-       else
-               cout<<_("(ok/cancel)")<<endl;
-       string resp;
-       cin>>resp;
-
-       if(dflt==RESPONSE_CANCEL)
-       {
-               if(resp=="ok")
-                       return RESPONSE_OK;
-               else
-                       return RESPONSE_CANCEL;
-       }
-       else
-       {
-               if(resp=="cancel")
-                       return RESPONSE_CANCEL;
-               else
-                       return RESPONSE_OK;
-       }
-}
-       
-bool
-ConsoleUIInterface::task(const std::string &task)
-{
-       cout<<task<<endl;
-       return true;
-}
-
-bool
-ConsoleUIInterface::error(const std::string &task)
-{
-       cout<<_("error: ")<<task<<endl;
-       return true;
-}
-
-bool
-ConsoleUIInterface::warning(const std::string &task)
-{
-       cout<<_("warning: ")<<task<<endl;
-       return true;
-}
-
-bool
-ConsoleUIInterface::amount_complete(int current, int total)
-{
-       return true;
-}
-
-
-
diff --git a/synfig-studio/trunk/src/sinfgapp/uimanager.h b/synfig-studio/trunk/src/sinfgapp/uimanager.h
deleted file mode 100644 (file)
index 72fcb86..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file uimanager.h
-**     \brief User Interface Manager Class
-**
-**     $Id: uimanager.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_UIMANAGER_H
-#define __SINFG_APP_UIMANAGER_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <ETL/handle>
-#include <sinfg/general.h>
-#include <sinfg/string.h>
-#include <sigc++/object.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 sinfgapp {
-
-class UIInterface : public etl::shared_object, public sinfg::ProgressCallback, public sigc::trackable
-{
-public:
-       enum Response
-       {
-               RESPONSE_CANCEL=-1,
-               RESPONSE_NO=0,
-               RESPONSE_YES=1,
-               RESPONSE_OK=2
-       };
-       virtual ~UIInterface() { }
-       virtual Response yes_no(const std::string &title, const std::string &message,Response dflt=RESPONSE_YES)=0;
-       virtual Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt=RESPONSE_YES)=0;
-       virtual Response ok_cancel(const std::string &title, const std::string &message,Response dflt=RESPONSE_OK)=0;
-};     
-
-class DefaultUIInterface : public UIInterface
-{
-public:
-       Response yes_no(const std::string &title, const std::string &message,Response dflt)
-               { return dflt; }
-       Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt)
-               { return dflt; }
-       Response ok_cancel(const std::string &title, const std::string &message,Response dflt)
-               { return dflt; }
-       
-       bool task(const std::string &task)
-               { return true; }
-       bool error(const std::string &task)
-               { return true; }
-       bool warning(const std::string &task)
-               { return true; }
-       bool amount_complete(int current, int total)
-               { return true; }
-};     
-
-class ConfidentUIInterface : public UIInterface
-{
-public:
-       Response yes_no(const std::string &title, const std::string &message,Response dflt)
-               { return RESPONSE_YES; }
-       Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt)
-               { return RESPONSE_YES; }
-       Response ok_cancel(const std::string &title, const std::string &message,Response dflt)
-               { return RESPONSE_OK; }
-       
-       bool task(const std::string &task)
-               { return true; }
-       bool error(const std::string &task)
-               { return true; }
-       bool warning(const std::string &task)
-               { return true; }
-       bool amount_complete(int current, int total)
-               { return true; }
-};     
-
-class ConsoleUIInterface : public UIInterface
-{
-public:
-       Response yes_no(const std::string &title, const std::string &message,Response dflt);
-       Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt);
-       Response ok_cancel(const std::string &title, const std::string &message,Response dflt);
-       
-       bool task(const std::string &task);
-       bool error(const std::string &task);
-       bool warning(const std::string &task);
-       bool amount_complete(int current, int total);
-};     
-
-}; // END of namespace sinfgapp
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/sinfgapp/value_desc.h b/synfig-studio/trunk/src/sinfgapp/value_desc.h
deleted file mode 100644 (file)
index 66a185c..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/* === S I N F G =========================================================== */
-/*!    \file value_desc.h
-**     \brief Template Header
-**
-**     $Id: value_desc.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
-**
-**     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
-**
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
-**
-**     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_APP_VALUE_DESC_H
-#define __SINFG_APP_VALUE_DESC_H
-
-/* === H E A D E R S ======================================================= */
-
-#include <sinfg/valuenode.h>
-#include <sinfg/string.h>
-#include <sinfg/layer.h>
-#include <sinfg/value.h>
-#include <sinfg/valuenode_const.h>
-#include <sinfg/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 sinfgapp {
-
-class ValueDesc
-{
-       // Info for Layer parent
-       sinfg::Layer::Handle layer;
-       sinfg::String name;
-       
-       // Info for ValueNode parent
-       sinfg::ValueNode::Handle parent_value_node;
-       int index;
-
-       // Info for exported ValueNode
-       sinfg::Canvas::Handle canvas;
-       
-public:
-       bool operator==(const ValueDesc &rhs)const
-       {
-               if((layer||rhs.layer) && layer!=rhs.layer)
-                       return false;
-               if((!name.empty()||!rhs.name.empty()) && name!=rhs.name)
-                       return false;
-               if(layer)
-                       return true;
-               if((canvas||rhs.canvas) && canvas!=rhs.canvas)
-                       return false;
-               if((parent_value_node||rhs.parent_value_node) && parent_value_node!=rhs.parent_value_node)
-                       return false;
-               if((index>-1||rhs.index>-1) && index!=rhs.index)
-                       return false;
-               return true;
-       }
-       bool operator!=(const ValueDesc &rhs)const
-       {
-               return !operator==(rhs);
-       }
-
-       
-       ValueDesc(sinfg::Layer::Handle layer,const sinfg::String& param_name):
-               layer(layer),
-               name(param_name) { }
-
-       ValueDesc(sinfg::Layer::LooseHandle layer,const sinfg::String& param_name):
-               layer(layer),
-               name(param_name) { }
-
-       ValueDesc(sinfg::LinkableValueNode::Handle parent_value_node,int index):
-               parent_value_node(parent_value_node),
-               index(index) { }
-
-//     ValueDesc(sinfg::LinkableValueNode::Handle parent_value_node,const sinfg::String& param_name):
-//             parent_value_node(parent_value_node),
-//             index(parent_value_node->get_link_index_from_name(param_name)) { }
-
-       ValueDesc(sinfg::Canvas::Handle canvas,const sinfg::String& name):
-               name(name),
-               canvas(canvas) { }
-
-       ValueDesc(sinfg::ValueNode_Const::Handle parent_value_node):
-               parent_value_node(parent_value_node),
-               index(-1) { }
-
-       ValueDesc() { }
-
-       bool is_valid()const { return layer || parent_value_node || canvas; }
-       operator bool()const { return is_valid(); }
-
-       bool parent_is_layer_param()const { return (bool)layer; }
-       bool parent_is_value_node()const { return (bool)parent_value_node; }
-       bool parent_is_linkable_value_node()const { return parent_is_value_node() && index>=0; }
-       bool parent_is_value_node_const()const { return parent_is_value_node() && index==-1; }
-       bool parent_is_canvas()const { return (bool)canvas; }
-       
-       bool is_value_node()const { return parent_is_value_node() || parent_is_canvas() || (parent_is_layer_param() && (bool)layer->dynamic_param_list().count(name)); }
-       bool is_const()const { return (parent_is_layer_param() && !layer->dynamic_param_list().count(name)) || parent_is_value_node_const(); }
-       
-       sinfg::Layer::Handle get_layer()const { assert(parent_is_layer_param()); return layer; }
-       const sinfg::String& get_param_name()const { assert(parent_is_layer_param()); return name; }
-       
-       sinfg::ValueNode::Handle get_parent_value_node()const { assert(parent_is_value_node()); return parent_value_node; }
-       int get_index()const { assert(parent_is_linkable_value_node()); return index; }
-       
-       const sinfg::String& get_value_node_id()const { assert(parent_is_canvas()); return name; }
-
-       sinfg::Canvas::Handle get_canvas()const
-       {
-               if(canvas)
-                       return canvas;
-               if(layer)
-                       return layer->get_canvas();
-               if(parent_value_node)
-                       return parent_value_node->get_root_canvas();
-               return 0;
-       }
-       
-       sinfg::ValueNode::Handle
-       get_value_node()const
-       {
-               if(parent_is_canvas())
-                       return canvas->find_value_node(name);
-               if(parent_is_layer_param() && layer->dynamic_param_list().count(name))
-                       return layer->dynamic_param_list().find(name)->second;
-               if(parent_is_linkable_value_node())
-                       return sinfg::LinkableValueNode::Handle::cast_reinterpret(parent_value_node)->get_link(index);
-//                     return reinterpret_cast<sinfg::LinkableValueNode*>(parent_value_node.get())->get_link(index);
-               return 0;
-       }
-
-       sinfg::ValueBase
-       get_value(sinfg::Time time=0)const
-       {
-               if(parent_is_value_node_const() && parent_value_node)
-                       return (*parent_value_node)(0);
-               if(is_value_node() && get_value_node())
-                       return (*get_value_node())(time);
-               if(parent_is_layer_param() && layer)
-                       return layer->get_param(name);
-               return sinfg::ValueBase();
-       }       
-
-       sinfg::ValueBase::Type
-       get_value_type()const
-       {
-               sinfg::ValueNode::Handle value_node=get_value_node();
-               if(value_node)
-                       return value_node->get_type();
-               return get_value().get_type();
-       }
-       
-       bool
-       is_exported()const
-       {
-               return is_value_node() && get_value_node()->is_exported();
-       }
-}; // END of class ValueDesc
-
-}; // END of namespace sinfgapp_instance
-
-/* === E N D =============================================================== */
-
-#endif
diff --git a/synfig-studio/trunk/src/synfigapp/Makefile.am b/synfig-studio/trunk/src/synfigapp/Makefile.am
new file mode 100644 (file)
index 0000000..feb6f74
--- /dev/null
@@ -0,0 +1,50 @@
+# $Header: /opt/voria/cvs/studio/src/synfigapp/Makefile.am,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+
+MAINTAINERCLEANFILES=Makefile.in
+INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/libltdl
+
+LAYER_ACTION_HH=actions/layerremove.h actions/layermove.h actions/layerraise.h actions/layerlower.h actions/layeradd.h actions/layeractivate.h actions/layerparamset.h actions/layerparamconnect.h actions/layerparamdisconnect.h actions/layerencapsulate.h actions/layerduplicate.h actions/layersetdesc.h
+LAYER_ACTION_CC=actions/layerremove.cpp actions/layermove.cpp actions/layerraise.cpp actions/layerlower.cpp actions/layeradd.cpp actions/layeractivate.cpp actions/layerparamset.cpp actions/layerparamconnect.cpp actions/layerparamdisconnect.cpp actions/layerencapsulate.cpp actions/layerduplicate.cpp actions/layersetdesc.cpp
+
+VALUEDESC_ACTION_HH=actions/valuedescset.h actions/valuedescexport.h actions/valuedescconvert.h actions/valuedescconnect.h actions/valuedescdisconnect.h actions/valuedesclink.h
+VALUEDESC_ACTION_CC=actions/valuedescset.cpp actions/valuedescexport.cpp actions/valuedescconvert.cpp actions/valuedescconnect.cpp actions/valuedescdisconnect.cpp actions/valuedesclink.cpp
+
+VALUENODE_ACTION_HH=actions/valuenodeconstset.h actions/valuenodeadd.h actions/valuenodereplace.h actions/valuenodelinkconnect.h actions/valuenodelinkdisconnect.h actions/valuenodedynamiclistinsert.h actions/valuenodedynamiclistremove.h actions/valuenoderename.h actions/valuenoderemove.h actions/valuenodedynamiclistinsertsmart.h actions/valuenodedynamiclistremovesmart.h actions/valuenodedynamiclistloop.h actions/valuenodedynamiclistunloop.h actions/valuenodedynamiclistrotateorder.h
+VALUENODE_ACTION_CC=actions/valuenodeconstset.cpp actions/valuenodeadd.cpp actions/valuenodereplace.cpp actions/valuenodelinkconnect.cpp actions/valuenodelinkdisconnect.cpp actions/valuenodedynamiclistinsert.cpp actions/valuenodedynamiclistremove.cpp actions/valuenoderename.cpp actions/valuenoderemove.cpp actions/valuenodedynamiclistinsertsmart.cpp actions/valuenodedynamiclistremovesmart.cpp actions/valuenodedynamiclistloop.cpp actions/valuenodedynamiclistunloop.cpp actions/valuenodedynamiclistrotateorder.cpp
+
+WAYPOINT_ACTION_HH=actions/waypointadd.h actions/waypointset.h actions/waypointsetsmart.h actions/waypointremove.h actions/waypointsimpleadd.h
+WAYPOINT_ACTION_CC=actions/waypointadd.cpp actions/waypointset.cpp actions/waypointsetsmart.cpp actions/waypointremove.cpp actions/waypointsimpleadd.cpp
+
+TIMEPOINT_ACTION_HH=actions/timepointsmove.h actions/timepointscopy.h actions/timepointsdelete.h timegather.h
+TIMEPOINT_ACTION_CC=actions/timepointsmove.cpp actions/timepointscopy.cpp actions/timepointsdelete.cpp timegather.cpp
+
+ACTIVEPOINT_ACTION_HH=actions/activepointadd.h actions/activepointset.h actions/activepointsetsmart.h actions/activepointsetoff.h actions/activepointseton.h actions/activepointremove.h actions/activepointsimpleadd.h
+ACTIVEPOINT_ACTION_CC=actions/activepointadd.cpp actions/activepointset.cpp actions/activepointsetsmart.cpp actions/activepointsetoff.cpp actions/activepointseton.cpp actions/activepointremove.cpp actions/activepointsimpleadd.cpp
+
+KEYFRAME_ACTION_HH=actions/keyframesetdelta.h actions/keyframeadd.h actions/keyframeset.h actions/keyframeremove.h actions/keyframeduplicate.h actions/keyframewaypointset.h
+KEYFRAME_ACTION_CC=actions/keyframesetdelta.cpp actions/keyframeadd.cpp actions/keyframeset.cpp actions/keyframeremove.cpp actions/keyframeduplicate.cpp actions/keyframewaypointset.cpp
+
+CANVAS_ACTION_HH=actions/canvasrenddescset.h actions/canvasadd.h actions/canvasremove.h
+CANVAS_ACTION_CC=actions/canvasrenddescset.cpp actions/canvasadd.cpp actions/canvasremove.cpp
+
+GROUP_ACTION_HH=actions/groupaddlayers.h actions/groupremovelayers.h actions/groupremove.h actions/grouprename.h
+GROUP_ACTION_CC=actions/groupaddlayers.cpp actions/groupremovelayers.cpp actions/groupremove.cpp actions/grouprename.cpp
+
+OTHER_ACTION_HH=actions/colorset.h actions/editmodeset.h actions/blinepointtangentmerge.h actions/blinepointtangentsplit.h actions/gradientset.h
+OTHER_ACTION_CC=actions/colorset.cpp actions/editmodeset.cpp actions/blinepointtangentmerge.cpp actions/blinepointtangentsplit.cpp actions/gradientset.cpp
+
+ACTIONHH=$(GROUP_ACTION_HH) $(LAYER_ACTION_HH) $(VALUEDSEC_ACTION_HH) $(VALUENODE_ACTION_HH) $(WAYPOINT_ACTION_HH) $(KEYFRAME_ACTION_HH) $(OTHER_ACTION_HH) $(CANVAS_ACTION_HH) $(ACTIVEPOINT_ACTION_HH) $(TIMEPOINT_ACTION_HH)
+ACTIONCC=$(GROUP_ACTION_CC) $(LAYER_ACTION_CC) $(VALUEDESC_ACTION_CC) $(VALUENODE_ACTION_CC) $(WAYPOINT_ACTION_CC) $(KEYFRAME_ACTION_CC) $(OTHER_ACTION_CC) $(CANVAS_ACTION_CC) $(ACTIVEPOINT_ACTION_CC) $(TIMEPOINT_ACTION_CC)
+
+SYNFIGAPPHH=$(ACTIONHH) blineconvert.h cvs.h editmode.h action.h action_param.h action_system.h canvasinterface.h instance.h selectionmanager.h uimanager.h value_desc.h main.h inputdevice.h settings.h
+
+synfiglibdir=@synfiglibdir@
+
+lib_LTLIBRARIES = libsynfigapp.la
+libsynfigapp_la_SOURCES =  $(SYNFIGAPPHH) $(ACTIONCC) blineconvert.cpp cvs.cpp main.cpp action_param.cpp action.cpp action_system.cpp canvasinterface.cpp instance.cpp uimanager.cpp inputdevice.cpp settings.cpp
+libsynfigapp_la_LIBADD = @SYNFIG_LIBS@
+libsynfigapp_la_CXXFLAGS = @SYNFIG_CFLAGS@
+libsynfigapp_la_LDFLAGS = -export-dynamic -no-undefined
+
+include_synfigappdir=$(prefix)/include/synfigapp-0.0/synfigapp
+include_synfigapp_HEADERS = $(SYNFIGAPPHH)
diff --git a/synfig-studio/trunk/src/synfigapp/action.cpp b/synfig-studio/trunk/src/synfigapp/action.cpp
new file mode 100644 (file)
index 0000000..26fbd57
--- /dev/null
@@ -0,0 +1,449 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action.cpp
+**     \brief Template File
+**
+**     $Id: action.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "action.h"
+#include "instance.h"
+
+
+#include "actions/layerremove.h"
+#include "actions/layermove.h"
+#include "actions/layerraise.h"
+#include "actions/layerlower.h"
+#include "actions/layeradd.h"
+#include "actions/layeractivate.h"
+#include "actions/layerparamset.h"
+#include "actions/layerparamconnect.h"
+#include "actions/layerparamdisconnect.h"
+#include "actions/layerencapsulate.h"
+#include "actions/layerduplicate.h"
+#include "actions/layersetdesc.h"
+
+#include "actions/valuenodeconstset.h"
+#include "actions/valuenodeadd.h"
+#include "actions/valuenodereplace.h"
+#include "actions/valuenodelinkconnect.h"
+#include "actions/valuenodelinkdisconnect.h"
+#include "actions/valuenodedynamiclistinsert.h"
+#include "actions/valuenodedynamiclistremove.h"
+#include "actions/valuenodedynamiclistinsertsmart.h"
+#include "actions/valuenodedynamiclistremovesmart.h"
+#include "actions/valuenodedynamiclistloop.h"
+#include "actions/valuenodedynamiclistunloop.h"
+#include "actions/valuenodedynamiclistrotateorder.h"
+#include "actions/valuenoderename.h"
+#include "actions/valuenoderemove.h"
+
+#include "actions/valuedescset.h"
+#include "actions/valuedescexport.h"
+#include "actions/valuedescconvert.h"
+#include "actions/valuedescconnect.h"
+#include "actions/valuedescdisconnect.h"
+#include "actions/valuedesclink.h"
+
+#include "actions/waypointadd.h"
+#include "actions/waypointset.h"
+#include "actions/waypointsetsmart.h"
+#include "actions/waypointremove.h"
+
+#include "actions/activepointadd.h"
+#include "actions/activepointset.h"
+#include "actions/activepointsetsmart.h"
+#include "actions/activepointsetoff.h"
+#include "actions/activepointseton.h"
+#include "actions/activepointremove.h"
+
+#include "actions/keyframeadd.h"
+#include "actions/keyframeset.h"
+#include "actions/keyframeremove.h"
+#include "actions/keyframeduplicate.h"
+#include "actions/keyframewaypointset.h"
+#include "actions/keyframesetdelta.h"
+
+#include "actions/timepointsmove.h"
+#include "actions/timepointscopy.h"
+#include "actions/timepointsdelete.h"
+
+#include "actions/canvasrenddescset.h"
+#include "actions/canvasadd.h"
+#include "actions/canvasremove.h"
+
+#include "actions/editmodeset.h"
+
+#include "actions/blinepointtangentmerge.h"
+#include "actions/blinepointtangentsplit.h"
+
+#include "actions/gradientset.h"
+#include "actions/colorset.h"
+
+#include "actions/groupaddlayers.h"
+#include "actions/groupremovelayers.h"
+#include "actions/groupremove.h"
+#include "actions/grouprename.h"
+
+#include "canvasinterface.h"
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === S T A T I C S ======================================================= */
+
+synfigapp::Action::Book *book_;
+
+/* === M E T H O D S ======================================================= */
+
+#define ADD_ACTION(x) { BookEntry &be(book()[x::name__]); \
+       be.name=x::name__; \
+       be.local_name=x::local_name__; \
+       be.version=x::version__; \
+       be.task=x::task__; \
+       be.priority=x::priority__; \
+       be.category=x::category__; \
+       be.factory=x::create; \
+       be.get_param_vocab=x::get_param_vocab; \
+       be.is_canidate=x::is_canidate; \
+       }
+       
+
+Action::Main::Main()
+{
+       book_=new synfigapp::Action::Book();
+       
+       ADD_ACTION(Action::LayerRemove);
+       ADD_ACTION(Action::LayerMove);
+       ADD_ACTION(Action::LayerRaise);
+       ADD_ACTION(Action::LayerLower);
+       ADD_ACTION(Action::LayerAdd);
+       ADD_ACTION(Action::LayerActivate);
+       ADD_ACTION(Action::LayerParamSet);
+       ADD_ACTION(Action::LayerParamConnect);
+       ADD_ACTION(Action::LayerParamDisconnect);
+       ADD_ACTION(Action::LayerEncapsulate);
+       ADD_ACTION(Action::LayerDuplicate);
+       ADD_ACTION(Action::LayerSetDesc);
+       
+       ADD_ACTION(Action::ValueNodeConstSet);  
+       ADD_ACTION(Action::ValueNodeAdd);       
+       ADD_ACTION(Action::ValueNodeReplace);   
+       ADD_ACTION(Action::ValueNodeLinkConnect);
+       ADD_ACTION(Action::ValueNodeLinkDisconnect);
+       ADD_ACTION(Action::ValueNodeDynamicListInsert);
+       ADD_ACTION(Action::ValueNodeDynamicListRemove);
+       ADD_ACTION(Action::ValueNodeDynamicListInsertSmart);
+       ADD_ACTION(Action::ValueNodeDynamicListRemoveSmart);
+       ADD_ACTION(Action::ValueNodeDynamicListLoop);
+       ADD_ACTION(Action::ValueNodeDynamicListUnLoop);
+       ADD_ACTION(Action::ValueNodeDynamicListRotateOrder);
+       ADD_ACTION(Action::ValueNodeRename);
+       ADD_ACTION(Action::ValueNodeRemove);
+       
+       ADD_ACTION(Action::ValueDescSet);
+       ADD_ACTION(Action::ValueDescExport);
+       ADD_ACTION(Action::ValueDescConvert);
+       ADD_ACTION(Action::ValueDescConnect);
+       ADD_ACTION(Action::ValueDescDisconnect);
+       ADD_ACTION(Action::ValueDescLink);
+
+       ADD_ACTION(Action::WaypointAdd);
+       ADD_ACTION(Action::WaypointSet);
+       ADD_ACTION(Action::WaypointSetSmart);
+       ADD_ACTION(Action::WaypointRemove);
+
+       ADD_ACTION(Action::ActivepointAdd);
+       ADD_ACTION(Action::ActivepointSet);
+       ADD_ACTION(Action::ActivepointSetSmart);
+       ADD_ACTION(Action::ActivepointSetOn);
+       ADD_ACTION(Action::ActivepointSetOff);
+       ADD_ACTION(Action::ActivepointRemove);
+
+       ADD_ACTION(Action::KeyframeAdd);
+       ADD_ACTION(Action::KeyframeSet);
+       ADD_ACTION(Action::KeyframeRemove);
+       ADD_ACTION(Action::KeyframeDuplicate);
+       ADD_ACTION(Action::KeyframeWaypointSet);
+       ADD_ACTION(Action::KeyframeSetDelta);
+
+       ADD_ACTION(Action::CanvasRendDescSet);
+       ADD_ACTION(Action::CanvasAdd);
+       ADD_ACTION(Action::CanvasRemove);
+
+       ADD_ACTION(Action::EditModeSet);
+
+       ADD_ACTION(Action::BLinePointTangentMerge);
+       ADD_ACTION(Action::BLinePointTangentSplit);
+
+       ADD_ACTION(Action::GradientSet);
+       ADD_ACTION(Action::ColorSet);
+       
+       ADD_ACTION(Action::TimepointsMove);
+       ADD_ACTION(Action::TimepointsCopy);
+       ADD_ACTION(Action::TimepointsDelete);
+
+       ADD_ACTION(Action::GroupAddLayers);
+       ADD_ACTION(Action::GroupRemoveLayers);
+       ADD_ACTION(Action::GroupRemove);
+       ADD_ACTION(Action::GroupRename);
+}
+
+Action::Main::~Main()
+{
+       delete book_;
+       
+}
+
+
+Action::Book& Action::book() { return *book_; }
+
+
+Action::Handle
+Action::create(const String &name)
+{
+       if(!book().count(name))
+               return 0; //! \todo perhaps we should throw something instead?
+       return book()[name].factory();  
+}
+
+
+Action::CanidateList
+Action::compile_canidate_list(const ParamList& param_list, Category category)
+{
+       Action::CanidateList ret;
+       
+       Book::const_iterator iter;
+
+       //synfig::info("param_list.size()=%d",param_list.size());
+
+       for(iter=book().begin();iter!=book().end();++iter)
+       {
+               if((iter->second.category&category))
+               {
+                       if(iter->second.is_canidate(param_list))
+                               ret.push_back(iter->second);
+                       else
+                       {
+                               //synfig::info("Action \"%s\" is not a canidate",iter->second.name.c_str());
+                       }
+               }
+       }
+       
+       return ret;
+}
+
+Action::CanidateList::iterator
+Action::CanidateList::find(const String& x)
+{
+       iterator iter;
+       for(iter=begin();iter!=end();++iter)
+               if(iter->name==x)
+                       break;
+       return iter;
+}
+
+void
+Action::Base::set_param_list(const ParamList &param_list)
+{
+       ParamList::const_iterator iter;
+       
+       for(iter=param_list.begin();iter!=param_list.end();++iter)
+               set_param(iter->first,iter->second);
+}
+
+void
+Super::perform()
+{
+       set_dirty(false);
+       
+       prepare();
+
+       ActionList::const_iterator iter;
+       for(iter=action_list_.begin();iter!=action_list_.end();++iter)
+       {
+               try
+               {
+                       try
+                       {
+                               (*iter)->perform();
+                               CanvasSpecific* canvas_specific(dynamic_cast<CanvasSpecific*>(iter->get()));
+                               if(canvas_specific && canvas_specific->is_dirty())
+                                       set_dirty(true);
+                       }
+                       catch(...)
+                       {
+                               if(iter!=action_list_.begin())
+                               {
+                                       for(--iter;iter!=action_list_.begin();--iter)
+                                               (*iter)->undo();
+                                       (*iter)->undo();
+                               }
+                               throw;
+                       }
+               }
+               catch(Error x)
+               {
+                       throw Error(x.get_type(),((*iter)->get_name()+": "+x.get_desc()).c_str());
+               }
+       }
+}
+
+void
+Super::undo()
+{
+       set_dirty(false);
+
+       ActionList::const_reverse_iterator iter;
+       for(iter=const_cast<const ActionList &>(action_list_).rbegin();iter!=const_cast<const ActionList &>(action_list_).rend();++iter)
+       {
+               try {
+                       (*iter)->undo();
+                       CanvasSpecific* canvas_specific(dynamic_cast<CanvasSpecific*>(iter->get()));
+                       if(canvas_specific && canvas_specific->is_dirty())
+                               set_dirty(true);
+               }
+               catch(...)
+               {
+                       if(iter!=const_cast<const ActionList &>(action_list_).rbegin())
+                       {
+                               for(--iter;iter!=const_cast<const ActionList &>(action_list_).rbegin();--iter)
+                                       (*iter)->perform();
+                               (*iter)->perform();
+                       }
+                       throw;
+               }
+       }
+}
+
+void
+Super::add_action(etl::handle<Undoable> action)
+{
+       action_list_.push_back(action);
+       CanvasSpecific *specific_action=dynamic_cast<CanvasSpecific *>(action.get());
+       if(specific_action && !get_canvas())
+               set_canvas(specific_action->get_canvas());
+}
+
+void
+Super::add_action_front(etl::handle<Undoable> action)
+{
+       action_list_.push_front(action);
+       CanvasSpecific *specific_action=dynamic_cast<CanvasSpecific *>(action.get());
+       if(specific_action && !get_canvas())
+               set_canvas(specific_action->get_canvas());
+}
+
+
+Group::Group(const std::string &str):
+       name_(str),
+       ready_(true)
+{
+}
+
+Group::~Group()
+{
+}
+
+
+
+
+Action::ParamVocab
+Action::CanvasSpecific::get_param_vocab()
+{
+       ParamVocab ret;
+       
+       ret.push_back(ParamDesc("canvas",Param::TYPE_CANVAS)
+               .set_local_name(_("Canvas"))
+               .set_desc(_("Selected Canvas"))
+       );
+
+       ret.push_back(ParamDesc("canvas_interface",Param::TYPE_CANVASINTERFACE)
+               .set_local_name(_("Canvas Interface"))
+               .set_desc(_("Canvas Interface"))
+               .set_optional(true)
+       );
+       
+
+       return ret;
+}
+
+bool
+CanvasSpecific::set_param(const synfig::String& name, const Param &param)
+{
+       if(name=="canvas" && param.get_type()==Param::TYPE_CANVAS)
+       {
+               if(!param.get_canvas())
+                       return false;
+               set_canvas(param.get_canvas());
+               
+               return true;
+       }
+       if(name=="canvas_interface" && param.get_type()==Param::TYPE_CANVASINTERFACE)
+       {
+               if(!param.get_canvas_interface())
+                       return false;
+               set_canvas_interface(param.get_canvas_interface());
+               if(!get_canvas())
+                       set_canvas(get_canvas_interface()->get_canvas());
+               
+               return true;
+       }
+       if(name=="edit_mode" && param.get_type()==Param::TYPE_EDITMODE)
+       {
+               set_edit_mode(param.get_edit_mode());
+               
+               return true;
+       }
+
+       return false;
+}
+
+bool
+CanvasSpecific::is_ready()const
+{
+       if(!get_canvas())
+               return false;
+       return true;
+}
+
+EditMode
+CanvasSpecific::get_edit_mode()const
+{
+       if(mode_!=MODE_UNDEFINED)
+               return mode_;
+       
+       if(get_canvas_interface())
+               return get_canvas_interface()->get_mode();
+       
+       return MODE_NORMAL;
+}
diff --git a/synfig-studio/trunk/src/synfigapp/action.h b/synfig-studio/trunk/src/synfigapp/action.h
new file mode 100644 (file)
index 0000000..c2c9265
--- /dev/null
@@ -0,0 +1,387 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action.h
+**     \brief Template File
+**
+**     $Id: action.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_H
+#define __SYNFIG_APP_ACTION_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/string.h>
+#include <synfig/canvas.h>
+#include <ETL/handle>
+#include <ETL/stringf>
+#include <ETL/trivial>
+
+#include <map>
+#include <list>
+
+#include <synfig/layer.h>
+#include <synfig/canvas.h>
+#include <synfig/valuenode.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/value.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_animated.h>
+#include <synfig/string.h>
+#include <synfig/keyframe.h>
+
+#include "action_param.h"
+#include "editmode.h"
+
+/* === M A C R O S ========================================================= */
+
+#define ACTION_MODULE_EXT public: \
+       static const char name__[], local_name__[], version__[], cvs_id__[], task__[]; \
+       static const Category category__; \
+       static const int priority__; \
+       static Action::Base *create(); \
+       virtual synfig::String get_name()const; \
+       virtual synfig::String get_local_name()const;
+
+
+#define ACTION_SET_NAME(class,x) const char class::name__[]=x
+
+#define ACTION_SET_CATEGORY(class,x) const Category class::category__(x)
+
+#define ACTION_SET_TASK(class,x) const char class::task__[]=x
+
+#define ACTION_SET_PRIORITY(class,x) const int class::priority__=x
+
+#define ACTION_SET_LOCAL_NAME(class,x) const char class::local_name__[]=x
+
+#define ACTION_SET_VERSION(class,x) const char class::version__[]=x
+
+#define ACTION_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
+
+#define ACTION_INIT(class) \
+       Action::Base* class::create() { return new class(); }   \
+       synfig::String class::get_name()const { return name__; }        \
+       synfig::String class::get_local_name()const { return local_name__; }    \
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace synfig {
+class ProgressCallback;
+class Canvas;
+}; // END of namespace synfig
+
+namespace synfigapp {
+
+class Instance;
+class Main;
+       
+namespace Action {     
+
+class System;
+       
+
+//! Exception class, thrown when redoing or undoing an action
+class Error
+{
+public:
+       enum Type
+       {
+               TYPE_UNKNOWN,
+               TYPE_UNABLE,
+               TYPE_BADPARAM,
+               TYPE_CRITICAL,
+               TYPE_NOTREADY,
+               TYPE_BUG,
+
+               TYPE_END
+       };
+private:
+
+       Type type_;
+       synfig::String desc_;
+
+public:
+       
+       Error(Type type, const char *format, ...):
+               type_(type)
+       {
+               va_list args;
+               va_start(args,format);
+               desc_=etl::vstrprintf(format,args);
+       }
+
+       Error(const char *format, ...):
+               type_(TYPE_UNKNOWN)
+       {
+               va_list args;
+               va_start(args,format);
+               desc_=etl::vstrprintf(format,args);
+       }
+
+       Error(Type type=TYPE_UNABLE):
+               type_(type)
+       {
+       }
+       
+       Type get_type()const { return type_; }
+       synfig::String get_desc()const { return desc_; }
+       
+}; // END of class Action::Error
+
+class Param;
+class ParamList;
+class ParamDesc;
+class ParamVocab;
+
+// Action Category
+enum Category
+{
+       CATEGORY_NONE                   =0,
+       CATEGORY_LAYER                  =(1<<0),
+       CATEGORY_CANVAS                 =(1<<1),
+       CATEGORY_WAYPOINT               =(1<<2),
+       CATEGORY_ACTIVEPOINT    =(1<<3),
+       CATEGORY_VALUEDESC              =(1<<4),
+       CATEGORY_VALUENODE              =(1<<5),
+       CATEGORY_KEYFRAME               =(1<<6),
+       CATEGORY_GROUP                  =(1<<7),
+
+       CATEGORY_OTHER                  =(1<<12),
+
+       CATEGORY_DRAG                   =(1<<24),
+       
+       CATEGORY_HIDDEN                 =(1<<31),
+       CATEGORY_ALL                    =(~0)-(1<<31)           //!< All categories (EXCEPT HIDDEN)
+}; // END of enum Category
+
+inline Category operator|(Category lhs, Category rhs)
+{ return static_cast<Category>(int(lhs)|int(rhs)); }
+
+
+
+//! Action Base Class
+/*!    An action should implement the following functions:
+**     static bool is_canidate(const ParamList &x);
+**             -       Checks the ParamList to see if this action could be performed.
+**     static ParamVocab get_param_vocab();
+**             -       Yields the ParamVocab object which describes what
+**                     this action needs before it can perform the act.
+**     static Action::Base* create();
+**             -       Factory for creating this action from a ParamList
+**
+*/
+class Base : public etl::shared_object 
+{
+protected:
+       Base() { }
+       
+public:
+       virtual ~Base() { };
+
+       //! This function will throw an Action::Error() on failure
+       virtual void perform()=0;
+       
+       virtual bool set_param(const synfig::String& name, const Param &) { return false; }
+       virtual bool is_ready()const=0;
+       
+       virtual synfig::String get_name()const =0;
+       virtual synfig::String get_local_name()const { return get_name(); }
+
+       void set_param_list(const ParamList &);
+       
+}; // END of class Action::Base
+
+typedef Action::Base* (*Factory)();
+typedef bool (*CanidateChecker)(const ParamList &x);
+typedef ParamVocab (*GetParamVocab)();
+
+typedef etl::handle<Base> Handle;
+
+//! Undoable Action Base Class
+class Undoable : public Base
+{
+       friend class System;
+       bool active_;
+
+protected:
+       Undoable():active_(true) { }
+
+private:
+       void set_active(bool x) { active_=x; }
+
+public:
+
+       //! This function will throw an Action::Error() on failure
+       virtual void undo()=0;
+
+       bool is_active()const { return active_; }
+
+}; // END of class Action::Undoable
+
+//! Action base class for canvas-specific actions
+class CanvasSpecific 
+{
+private:
+       bool is_dirty_;
+       EditMode        mode_;
+
+       etl::loose_handle<synfigapp::CanvasInterface> canvas_interface_;
+       synfig::Canvas::Handle canvas_;
+
+protected:
+       CanvasSpecific(const synfig::Canvas::Handle &canvas):is_dirty_(true),mode_(MODE_UNDEFINED),canvas_(canvas) { }
+       CanvasSpecific():mode_(MODE_UNDEFINED) { }
+
+       virtual ~CanvasSpecific() { };
+       
+       
+public:
+
+       void set_canvas(synfig::Canvas::Handle x) { canvas_=x; }
+       void set_canvas_interface(etl::loose_handle<synfigapp::CanvasInterface> x) { canvas_interface_=x; }
+
+       synfig::Canvas::Handle get_canvas()const { return canvas_; }
+       etl::loose_handle<synfigapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+
+       static ParamVocab get_param_vocab();
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       EditMode get_edit_mode()const;
+
+       void set_edit_mode(EditMode x) { mode_=x; }
+       
+       bool is_dirty()const { return is_dirty_; }
+       void set_dirty(bool x=true) { is_dirty_=x; }
+       
+}; // END of class Action::Undoable
+
+typedef std::list< etl::handle<Action::Undoable> > ActionList;
+
+/*!    \class synfigapp::Action::Super
+**     \brief Super-Action base class for actions composed of several other actions.
+**
+**     Actions deriving from this class should only implement prepare(), and
+**     NOT implement perform() or undo().
+*/
+class Super : public Undoable, public CanvasSpecific
+{
+       ActionList action_list_;
+
+public:
+
+       ActionList &action_list() { return action_list_; }
+       const ActionList &action_list()const { return action_list_; }
+
+       virtual void prepare()=0;
+
+       void clear() { action_list().clear(); }
+       
+       bool first_time()const { return action_list_.empty(); }
+       
+       void add_action(etl::handle<Undoable> action);
+
+       void add_action_front(etl::handle<Undoable> action);
+
+       virtual void perform();
+       virtual void undo();
+
+}; // END of class Action::Super
+
+
+class Group : public Super
+{
+       synfig::String name_;
+
+       ActionList action_list_;
+protected:
+       bool ready_;
+public:
+       Group(const synfig::String &str="Group");
+       virtual ~Group();
+
+       virtual synfig::String get_name()const { return name_; }
+
+       virtual void prepare() { };
+
+       virtual bool set_param(const synfig::String& name, const Param &)const { return false; }
+       virtual bool is_ready()const { return ready_; }
+
+       void set_name(std::string&x) { name_=x; }
+}; // END of class Action::Group
+
+
+
+
+
+struct BookEntry
+{
+       synfig::String  name;
+       synfig::String  local_name;
+       synfig::String  version;
+       synfig::String  task;
+       int                     priority;
+       Category                category;
+       Factory                 factory;
+       CanidateChecker is_canidate;
+       GetParamVocab   get_param_vocab;        
+       
+       bool operator<(const BookEntry &rhs)const { return priority<rhs.priority; }
+}; // END of struct BookEntry
+
+typedef std::map<synfig::String,BookEntry> Book;
+
+class CanidateList : public std::list<BookEntry>
+{
+public:
+       iterator find(const synfig::String& x);
+       const_iterator find(const synfig::String& x)const { return const_cast<CanidateList*>(this)->find(x); }
+};
+
+Book& book();
+
+Handle create(const synfig::String &name);
+
+//! Compiles a list of potential canidate actions with the given \a param_list and \a category
+CanidateList compile_canidate_list(const ParamList& param_list, Category category=CATEGORY_ALL);
+
+/*!    \class synfigapp::Action::Main
+**     \brief \writeme
+**
+**     \writeme
+*/
+class Main
+{
+       friend class synfigapp::Main;
+
+       Main();
+
+public:
+       ~Main();
+
+}; // END of class Action::Main
+
+}; // END of namespace Action
+
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/action_param.cpp b/synfig-studio/trunk/src/synfigapp/action_param.cpp
new file mode 100644 (file)
index 0000000..3d38587
--- /dev/null
@@ -0,0 +1,515 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_param.cpp
+**     \brief Template File
+**
+**     $Id: action_param.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "action_param.h"
+#include "action.h"
+#include "canvasinterface.h"
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === P R O C E D U R E S ================================================= */
+
+bool
+Action::canidate_check(const ParamVocab& param_vocab, const ParamList& param_list)
+{
+       ParamVocab::const_iterator iter;
+       
+       for(iter=param_vocab.begin();iter!=param_vocab.end();++iter)
+       {
+               int n(param_list.count(iter->get_name()));
+
+//             if(n && !iter->get_mutual_exclusion().empty() && param_list.count(iter->get_mutual_exclusion()))
+//                     return false;
+
+               if(!n && !iter->get_mutual_exclusion().empty() && param_list.count(iter->get_mutual_exclusion()))
+                       continue;
+
+               if(iter->get_user_supplied() || iter->get_optional())
+                       continue;
+                                                       
+               if(n==0)
+                       return false;
+               if(n==1 && iter->get_requires_multiple())
+                       return false;
+               if(n>1 && !iter->get_supports_multiple())
+                       return false;
+               
+               if(iter->get_type()!=param_list.find(iter->get_name())->second.get_type())
+                       return false;
+       }
+       return true;
+}
+
+/* === S T A T I C S ======================================================= */
+
+struct _ParamCounter
+{
+       static int counter;
+       ~_ParamCounter()
+       {
+               if(counter)
+                       synfig::error("%d action params not yet deleted!",counter);
+       }
+} _param_counter;
+
+int _ParamCounter::counter(0);
+
+/* === M E T H O D S ======================================================= */
+
+Param::Param(const Param &rhs):
+       type_(rhs.type_)
+{
+       _ParamCounter::counter++;
+       switch(type_)
+       {
+       case TYPE_ACTIVEPOINT:
+               data.activepoint.construct();
+               data.activepoint.get()=rhs.data.activepoint.get();
+               break;
+       case TYPE_WAYPOINT:
+               data.waypoint.construct();
+               data.waypoint.get()=rhs.data.waypoint.get();
+               break;
+       case TYPE_WAYPOINTMODEL:
+               data.waypoint_model.construct();
+               data.waypoint_model.get()=rhs.data.waypoint_model.get();
+               break;
+       case TYPE_KEYFRAME:
+               data.keyframe.construct();
+               data.keyframe.get()=rhs.data.keyframe.get();
+               break;
+       case TYPE_CANVAS:
+               data.canvas.construct();
+               data.canvas.get()=rhs.data.canvas.get();
+               break;
+       case TYPE_CANVASINTERFACE:
+               data.canvas_interface.construct();
+               data.canvas_interface.get()=rhs.data.canvas_interface.get();
+               break;
+       case TYPE_LAYER:
+               data.layer.construct();
+               data.layer.get()=rhs.data.layer.get();
+               break;
+       case TYPE_VALUENODE:
+               data.value_node.construct();
+               data.value_node.get()=rhs.data.value_node.get();
+               break;
+       case TYPE_VALUEDESC:
+               data.value_desc.construct();
+               data.value_desc.get()=rhs.data.value_desc.get();
+               break;
+       case TYPE_VALUE:
+               data.value.construct();
+               data.value.get()=rhs.data.value.get();
+               break;
+       case TYPE_STRING:
+               data.string.construct();
+               data.string.get()=rhs.data.string.get();
+               break;
+       case TYPE_RENDDESC:
+               data.rend_desc.construct();
+               data.rend_desc.get()=rhs.data.rend_desc.get();
+               break;
+       case TYPE_TIME:
+               data.time.construct();
+               data.time.get()=rhs.data.time.get();
+               break;
+
+       case TYPE_INTEGER:
+               data.integer=rhs.data.integer;
+               break;
+       case TYPE_EDITMODE:
+               data.edit_mode=rhs.data.edit_mode;
+               break;
+       case TYPE_REAL:
+               data.real=rhs.data.real;
+               break;
+       case TYPE_BOOL:
+               data.b=rhs.data.b;
+               break;
+
+       case TYPE_NIL:
+               break;
+
+       default:
+               assert(0);
+               break;
+       }
+}
+
+Param::Param(const etl::handle<synfigapp::CanvasInterface>& x):
+       
+       type_(TYPE_CANVASINTERFACE)
+{
+       _ParamCounter::counter++;
+       data.canvas_interface.construct();
+       data.canvas_interface.get()=x;
+}
+
+/*
+Param::Param(synfigapp::CanvasInterface* x):
+       
+       type_(TYPE_CANVASINTERFACE)
+{
+       _ParamCounter::counter++;
+       data.canvas_interface.construct();
+       data.canvas_interface=x;
+}
+*/
+
+Param::Param(const etl::loose_handle<synfigapp::CanvasInterface>& x):
+       
+       type_(TYPE_CANVASINTERFACE)
+{
+       _ParamCounter::counter++;
+       data.canvas_interface.construct();
+       data.canvas_interface.get()=x;
+}
+
+Param::Param(const synfig::Canvas::Handle& x): 
+       type_(TYPE_CANVAS)
+{
+       _ParamCounter::counter++;
+       data.canvas.construct();
+       data.canvas.get()=x;
+}
+
+Param::Param(const synfig::Canvas::LooseHandle& x):    
+       type_(TYPE_CANVAS)
+{
+       _ParamCounter::counter++;
+       data.canvas.construct();
+       data.canvas.get()=x;
+}
+
+Param::Param(const synfig::Layer::Handle& x):
+       
+       type_(TYPE_LAYER)
+{
+       _ParamCounter::counter++;
+       data.layer.construct();
+       data.layer.get()=x;
+}
+
+Param::Param(const synfig::Layer::LooseHandle& x):
+       
+       type_(TYPE_LAYER)
+{
+       _ParamCounter::counter++;
+       data.layer.construct();
+       data.layer.get()=x;
+}
+
+Param::Param(const synfig::ValueNode::Handle& x):
+       
+       type_(TYPE_VALUENODE)
+{
+       _ParamCounter::counter++;
+       data.value_node.construct();
+       data.value_node.get()=x;
+}
+
+Param::Param(const synfig::ValueNode::LooseHandle& x):
+       
+       type_(TYPE_VALUENODE)
+{
+       _ParamCounter::counter++;
+       data.value_node.construct();
+       data.value_node.get()=x;
+}
+
+Param::Param(const synfig::ValueBase& x):
+       
+       type_(TYPE_VALUE)
+{
+       _ParamCounter::counter++;
+       data.value.construct();
+       data.value.get()=x;
+}
+
+Param::Param(const synfig::RendDesc& x):       
+       type_(TYPE_RENDDESC)
+{
+       _ParamCounter::counter++;
+       data.rend_desc.construct();
+       data.rend_desc.get()=x;
+}
+
+Param::Param(const synfig::Time& x):
+       type_(TYPE_TIME)
+{
+       _ParamCounter::counter++;
+       data.time.construct();
+       data.time.get()=x;
+}
+
+Param::Param(const synfig::Activepoint& x):
+       
+       type_(TYPE_ACTIVEPOINT)
+{
+       _ParamCounter::counter++;
+       data.activepoint.construct();
+       data.activepoint.get()=x;
+}
+
+Param::Param(const synfig::Waypoint& x):       
+       type_(TYPE_WAYPOINT)
+{
+       _ParamCounter::counter++;
+       data.waypoint.construct();
+       data.waypoint.get()=x;
+}
+
+Param::Param(const synfig::Waypoint::Model& x):        
+       type_(TYPE_WAYPOINTMODEL)
+{
+       _ParamCounter::counter++;
+       data.waypoint_model.construct();
+       data.waypoint_model.get()=x;
+}
+
+Param::Param(const synfig::String& x):
+       type_(TYPE_STRING)
+{
+       _ParamCounter::counter++;
+       data.string.construct();
+       data.string.get()=x;
+}
+
+Param::Param(const char * x):
+       type_(TYPE_STRING)
+{
+       _ParamCounter::counter++;
+       data.string.construct();
+       data.string.get()=x;
+}
+
+Param::Param(const synfig::Keyframe& x):
+       
+       type_(TYPE_KEYFRAME)
+{
+       _ParamCounter::counter++;
+       data.keyframe.construct();
+       data.keyframe.get()=x;
+}
+
+Param::Param(const synfigapp::ValueDesc& x):
+       
+       type_(TYPE_VALUEDESC)
+{
+       _ParamCounter::counter++;
+       data.value_desc.construct();
+       data.value_desc.get()=x;
+}
+
+Param::Param(const int& x):
+       type_(TYPE_INTEGER)
+{
+       _ParamCounter::counter++;
+       data.integer=x;
+}
+
+Param::Param(const EditMode& x):
+       type_(TYPE_EDITMODE)
+{
+       _ParamCounter::counter++;
+       data.edit_mode=x;
+}
+
+Param::Param(const synfig::Real& x):
+       
+       type_(TYPE_REAL)
+{
+       _ParamCounter::counter++;
+       data.real=x;
+}
+
+Param::Param(const bool& x):
+       
+       type_(TYPE_BOOL)
+{
+       _ParamCounter::counter++;
+       data.b=x;
+}
+
+Param::~Param()
+{
+       clear();
+       _ParamCounter::counter--;
+}
+
+Param&
+Param::operator=(const Param& rhs)
+{
+       clear();
+       type_=rhs.type_;
+       
+       switch(type_)
+       {
+       case TYPE_ACTIVEPOINT:
+               data.activepoint.construct();
+               data.activepoint.get()=rhs.data.activepoint.get();
+               break;
+       case TYPE_WAYPOINT:
+               data.waypoint.construct();
+               data.waypoint.get()=rhs.data.waypoint.get();
+               break;
+       case TYPE_WAYPOINTMODEL:
+               data.waypoint_model.construct();
+               data.waypoint_model.get()=rhs.data.waypoint_model.get();
+               break;
+       case TYPE_KEYFRAME:
+               data.keyframe.construct();
+               data.keyframe.get()=rhs.data.keyframe.get();
+               break;
+       case TYPE_CANVAS:
+               data.canvas.construct();
+               data.canvas.get()=rhs.data.canvas.get();
+               break;
+       case TYPE_CANVASINTERFACE:
+               data.canvas_interface.construct();
+               data.canvas_interface.get()=rhs.data.canvas_interface.get();
+               break;
+       case TYPE_TIME:
+               data.time.construct();
+               data.time.get()=rhs.data.time.get();
+               break;
+       case TYPE_LAYER:
+               data.layer.construct();
+               data.layer.get()=rhs.data.layer.get();
+               break;
+       case TYPE_VALUENODE:
+               data.value_node.construct();
+               data.value_node.get()=rhs.data.value_node.get();
+               break;
+       case TYPE_VALUEDESC:
+               data.value_desc.construct();
+               data.value_desc.get()=rhs.data.value_desc.get();
+               break;
+       case TYPE_VALUE:
+               data.value.construct();
+               data.value.get()=rhs.data.value.get();
+               break;
+       case TYPE_RENDDESC:
+               data.rend_desc.construct();
+               data.rend_desc.get()=rhs.data.rend_desc.get();
+               break;
+       case TYPE_STRING:
+               data.string.construct();
+               data.string.get()=rhs.data.string.get();
+               break;
+
+       case TYPE_INTEGER:
+               data.integer=rhs.data.integer;
+               break;
+       case TYPE_EDITMODE:
+               data.integer=rhs.data.integer;
+               break;
+       case TYPE_REAL:
+               data.real=rhs.data.real;
+               break;
+       case TYPE_BOOL:
+               data.b=rhs.data.b;
+               break;
+
+       case TYPE_NIL:
+               break;
+
+       default:
+               assert(0);
+               break;
+       }
+       return *this;
+}
+
+void
+Param::clear()
+{
+       switch(type_)
+       {
+       case TYPE_ACTIVEPOINT:
+               data.activepoint.destruct();
+               break;
+       case TYPE_WAYPOINT:
+               data.waypoint.destruct();
+               break;
+       case TYPE_WAYPOINTMODEL:
+               data.waypoint_model.destruct();
+               break;
+       case TYPE_KEYFRAME:
+               data.keyframe.destruct();
+               break;
+       case TYPE_CANVAS:
+               data.canvas.destruct();
+               break;
+       case TYPE_CANVASINTERFACE:
+               data.canvas_interface.destruct();
+               break;
+       case TYPE_LAYER:
+               data.layer.destruct();
+               break;
+       case TYPE_TIME:
+               data.time.destruct();
+               break;
+       case TYPE_VALUENODE:
+               data.value_node.destruct();
+               break;
+       case TYPE_VALUEDESC:
+               data.value_desc.destruct();
+               break;
+       case TYPE_VALUE:
+               data.value.destruct();
+               break;
+       case TYPE_RENDDESC:
+               data.rend_desc.destruct();
+               break;
+       case TYPE_STRING:
+               data.string.destruct();
+               break;
+
+       case TYPE_NIL:
+       case TYPE_EDITMODE:
+       case TYPE_INTEGER:
+       case TYPE_REAL:
+       case TYPE_BOOL:
+               break;
+
+       default:
+               assert(0);
+               break;
+       }
+       type_=TYPE_NIL;
+}
diff --git a/synfig-studio/trunk/src/synfigapp/action_param.h b/synfig-studio/trunk/src/synfigapp/action_param.h
new file mode 100644 (file)
index 0000000..98dc0ee
--- /dev/null
@@ -0,0 +1,236 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_param.h
+**     \brief Template File
+**
+**     $Id: action_param.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_PARAM_H
+#define __SYNFIG_APP_ACTION_PARAM_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/string.h>
+#include <synfig/canvas.h>
+#include <ETL/handle>
+#include <ETL/stringf>
+#include <ETL/trivial>
+
+#include <map>
+#include <list>
+
+#include <synfig/layer.h>
+#include <synfig/canvas.h>
+#include <synfig/valuenode.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/value.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_animated.h>
+#include <synfig/string.h>
+#include <synfig/keyframe.h>
+#include <synfig/waypoint.h>
+
+#include "editmode.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 synfig {
+class ProgressCallback;
+class Canvas;
+class RendDesc;
+}; // END of namespace synfig
+
+namespace synfigapp {
+
+class CanvasInterface;
+       
+namespace Action {     
+
+//! Action Parameter
+class Param
+{
+public:
+       enum Type
+       {
+               TYPE_NIL,
+               TYPE_INTEGER,
+               TYPE_REAL,
+               TYPE_BOOL,
+               TYPE_ACTIVEPOINT,
+               TYPE_WAYPOINT,
+               TYPE_WAYPOINTMODEL,
+               TYPE_KEYFRAME,
+               TYPE_CANVAS,
+               TYPE_LAYER,
+               TYPE_VALUENODE,
+               TYPE_VALUEDESC,
+               TYPE_VALUE,
+               TYPE_STRING,
+               TYPE_TIME,
+               TYPE_CANVASINTERFACE,
+               TYPE_EDITMODE,
+               TYPE_RENDDESC,
+               
+               TYPE_END
+       };
+private:
+       Type type_;
+
+       union
+       {
+               etl::trivial<synfig::Canvas::LooseHandle> canvas;
+               etl::trivial<synfig::Layer::LooseHandle> layer;
+               etl::trivial<synfig::ValueNode::LooseHandle> value_node;
+               etl::trivial<synfig::ValueBase> value;
+               etl::trivial<synfig::Activepoint> activepoint;
+               etl::trivial<synfig::ValueNode_Animated::Waypoint> waypoint;
+               etl::trivial<synfig::ValueNode_Animated::Waypoint::Model> waypoint_model;
+               etl::trivial<synfig::String> string;
+               etl::trivial<synfig::Keyframe> keyframe;
+               etl::trivial<synfig::Time> time;
+               etl::trivial<synfigapp::ValueDesc> value_desc;
+               etl::trivial<etl::loose_handle<synfigapp::CanvasInterface> > canvas_interface;
+               etl::trivial<synfig::RendDesc> rend_desc;
+               int integer;
+               synfig::Real real;
+               bool b;
+               EditMode edit_mode;
+               
+       } data;
+public:
+
+       Param():type_(TYPE_NIL) { }
+       Param(const Param &x);
+       Param(const etl::handle<synfigapp::CanvasInterface>& x);
+       Param(const etl::loose_handle<synfigapp::CanvasInterface>& x);
+//     Param(synfigapp::CanvasInterface* x);
+       Param(const synfig::Canvas::Handle& x);
+       Param(const synfig::Canvas::LooseHandle& x);
+       Param(const synfig::Layer::Handle& x);
+       Param(const synfig::Layer::LooseHandle& x);
+       Param(const synfig::ValueNode::Handle& x);
+       Param(const synfig::ValueNode::LooseHandle& x);
+       Param(const synfig::Activepoint& x);
+       Param(const synfig::Waypoint& x);
+       Param(const synfig::Waypoint::Model& x);
+       Param(const synfig::String& x);
+       Param(const synfig::RendDesc& x);
+       Param(const char * x);
+       Param(const synfig::Keyframe& x);
+       Param(const synfigapp::ValueDesc& x);
+       Param(const int& x);
+       Param(const EditMode& x);
+       Param(const synfig::Real& x);
+       Param(const synfig::Time& x);
+       Param(const bool& x);
+       Param(const synfig::ValueBase& x);
+
+       ~Param();
+       
+       Param& operator=(const Param& rhs);
+       
+       void clear();
+       
+       const synfig::Canvas::LooseHandle& get_canvas()const { assert(type_==TYPE_CANVAS); return data.canvas.get(); }
+       const etl::loose_handle<synfigapp::CanvasInterface>& get_canvas_interface()const { assert(type_==TYPE_CANVASINTERFACE); return data.canvas_interface.get(); }
+       const synfig::Layer::LooseHandle& get_layer()const { assert(type_==TYPE_LAYER); return data.layer.get(); }
+       const synfig::ValueNode::LooseHandle& get_value_node()const { assert(type_==TYPE_VALUENODE); return data.value_node.get(); }
+       const synfig::ValueBase& get_value()const { assert(type_==TYPE_VALUE); return data.value.get(); }
+       const synfig::Activepoint& get_activepoint()const { assert(type_==TYPE_ACTIVEPOINT); return data.activepoint.get(); }
+       const synfig::Waypoint& get_waypoint()const { assert(type_==TYPE_WAYPOINT); return data.waypoint.get(); }
+       const synfig::Waypoint::Model& get_waypoint_model()const { assert(type_==TYPE_WAYPOINTMODEL); return data.waypoint_model.get(); }
+       const synfig::String& get_string()const { assert(type_==TYPE_STRING); return data.string.get(); }
+       const synfig::Keyframe& get_keyframe()const { assert(type_==TYPE_KEYFRAME); return data.keyframe.get(); }
+       const synfigapp::ValueDesc& get_value_desc()const { assert(type_==TYPE_VALUEDESC); return data.value_desc.get(); }
+       const synfig::Real& get_real()const { assert(type_==TYPE_REAL); return data.real; }
+       const synfig::Time& get_time()const { assert(type_==TYPE_TIME); return data.time.get(); }
+       const synfig::RendDesc& get_rend_desc()const { assert(type_==TYPE_RENDDESC); return data.rend_desc.get(); }
+       int get_integer()const { assert(type_==TYPE_INTEGER); return data.integer; }
+       EditMode get_edit_mode()const { assert(type_==TYPE_EDITMODE); return data.edit_mode; }
+       bool get_bool()const { assert(type_==TYPE_BOOL); return data.b; }
+
+
+       const Type& get_type()const { return type_; }
+}; // END of class Param
+
+class ParamList : public std::multimap<synfig::String,Param>
+{
+public:
+       ParamList& add(const synfig::String& name, const Param &x) { insert(std::pair<synfig::String,Param>(name,x)); return *this; }
+       ParamList& add(const ParamList& x) { insert(x.begin(),x.end()); return *this; }
+}; // END of class ParamList
+
+class ParamDesc
+{
+private:
+       synfig::String  name_;
+       synfig::String  local_name_;
+       synfig::String  desc_;
+       synfig::String  mutual_exclusion_;
+       Param::Type     type_;
+       bool    user_supplied_;
+       bool    supports_multiple_;
+       bool    requires_multiple_;
+       bool    optional_;
+
+public:
+       ParamDesc(const synfig::String &name, Param::Type type):
+               name_(name),
+               local_name_(name),
+               type_(type),
+               user_supplied_(false),
+               supports_multiple_(false),
+               requires_multiple_(false),
+               optional_(false)
+       { }
+       
+       const synfig::String& get_name()const { return name_; }
+       const synfig::String& get_desc()const { return desc_; }
+       const synfig::String& get_mutual_exclusion()const { return mutual_exclusion_; }
+       const synfig::String& get_local_name()const { return local_name_; }
+       const Param::Type& get_type()const { return type_; }
+       bool get_user_supplied()const { return user_supplied_; }
+       bool get_supports_multiple()const { return supports_multiple_||requires_multiple_; }
+       bool get_requires_multiple()const { return requires_multiple_; }
+       bool get_optional()const { return optional_; }
+
+       ParamDesc& set_local_name(const synfig::String& x) { local_name_=x; return *this; }
+       ParamDesc& set_desc(const synfig::String& x) { desc_=x; return *this; }
+       ParamDesc& set_mutual_exclusion(const synfig::String& x) { mutual_exclusion_=x; return *this; }
+       ParamDesc& set_user_supplied(bool x=true) { user_supplied_=x; return *this; }
+       ParamDesc& set_supports_multiple(bool x=true) { supports_multiple_=x; return *this; }
+       ParamDesc& set_requires_multiple(bool x=true) { requires_multiple_=x; if(x)supports_multiple_=true; return *this; }
+       ParamDesc& set_optional(bool x=true) { optional_=x; return *this; }
+}; // END of class ParamDesc
+
+class ParamVocab : public std::list< ParamDesc > { };
+
+bool canidate_check(const ParamVocab& param_vocab, const ParamList& param_list);
+
+}; // END of namespace Action
+
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/action_system.cpp b/synfig-studio/trunk/src/synfigapp/action_system.cpp
new file mode 100644 (file)
index 0000000..0913a29
--- /dev/null
@@ -0,0 +1,711 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_system.cpp
+**     \brief Template File
+**
+**     $Id: action_system.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "action_system.h"
+#include "instance.h"
+#include "canvasinterface.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfigapp;
+using namespace synfig;
+
+/* === 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 ======================================================= */
+
+
+
+Action::System::System():
+       action_count_(0)
+{
+       unset_ui_interface();
+       clear_redo_stack_on_new_action_=false;
+}
+
+Action::System::~System()
+{
+}
+
+bool
+Action::System::perform_action(handle<Action::Base> action)
+{
+       handle<UIInterface> uim(get_ui_interface());
+       
+       assert(action);
+       
+       if(!action->is_ready())
+       {
+               uim->error(action->get_name()+": "+_("Action is not ready."));
+               return false;
+       }       
+       
+       most_recent_action_=action;
+       
+       static bool inuse=false;
+
+       if(inuse) return false;
+
+       inuse=true;
+       try {
+               
+       assert(action);
+       
+       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
+       
+       if(canvas_specific && canvas_specific->get_canvas())
+       {
+               handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas_specific->get_canvas());
+               assert(canvas_interface);
+               uim=canvas_interface->get_ui_interface();
+       }
+
+       handle<Action::Undoable> undoable_action=handle<Action::Undoable>::cast_dynamic(action);
+       
+       // If we cannot undo this action, make sure
+       // that the user knows this.
+       if(!undoable_action)
+       {
+               if(uim->yes_no(
+                       action->get_name(),
+                       _("This action cannot be undone! Are you sure you want to continue?"),
+                       UIInterface::RESPONSE_NO
+                       ) == UIInterface::RESPONSE_NO
+               )
+                       return false;
+               else
+               {
+                       // Because this action cannot be undone,
+                       // we need to clear the undo stack
+                       clear_undo_stack();
+               }
+       }
+       else
+               assert(undoable_action->is_active());
+
+       // Perform the action
+       try { action->perform(); }
+       catch(Action::Error err)
+       {
+               uim->task(action->get_name()+' '+_("Failed"));
+               inuse=false;
+
+               if(err.get_type()!=Action::Error::TYPE_UNABLE)
+               {
+                       if(err.get_desc().empty())
+                               uim->error(action->get_name()+": "+strprintf("%d",err.get_type()));             
+                       else
+                               uim->error(action->get_name()+": "+err.get_desc());             
+               }
+
+               // If action failed for whatever reason, just return false and do
+               // not add the action onto the list
+               return false;
+       }
+       catch(std::exception err)
+       {
+               uim->task(action->get_name()+' '+_("Failed"));
+               inuse=false;
+
+               uim->error(action->get_name()+": "+err.what());         
+
+               // If action failed for whatever reason, just return false and do
+               // not add the action onto the list
+               return false;
+       }
+       catch(...)
+       {
+               uim->task(action->get_name()+' '+_("Failed"));
+               inuse=false;
+
+               // If action failed for whatever reason, just return false and do
+               // not add the action onto the list
+               return false;
+       }
+
+       // Clear the redo stack
+       if(clear_redo_stack_on_new_action_)
+               clear_redo_stack();     
+
+       if(!group_stack_.empty())
+               group_stack_.front()->inc_depth();
+       else
+               inc_action_count();
+       
+       // Push this action onto the action list if we can undo it
+       if(undoable_action)
+       {
+               // If necessary, signal the change in status of undo
+               if(undo_action_stack_.empty()) signal_undo_status_(true);
+               
+               // Add it to the list
+               undo_action_stack_.push_front(undoable_action);
+
+               // Signal that a new action has been added
+               if(group_stack_.empty())
+                       signal_new_action()(undoable_action);
+       }
+               
+       inuse=false;
+
+       uim->task(action->get_name()+' '+_("Successful"));
+
+       // If the action has "dirtied" the preview, signal it.
+       if(0)if(canvas_specific && canvas_specific->is_dirty())
+       {
+               Canvas::Handle canvas=canvas_specific->get_canvas();
+               if(!group_stack_.empty())
+                       group_stack_.front()->request_redraw(canvas_specific->get_canvas_interface());
+               else
+               {
+                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
+                       assert(canvas_interface);
+                       DEBUGPOINT();
+                       //canvas_interface->signal_dirty_preview()();
+               }
+       }
+
+       }catch(...) { inuse=false; throw; }
+
+       return true;
+}
+
+bool
+synfigapp::Action::System::undo_(handle<UIInterface> uim)
+{
+       handle<Action::Undoable> action(undo_action_stack().front());
+       most_recent_action_=action;
+       
+       try { if(action->is_active()) action->undo(); }
+       catch(Action::Error err)
+       {
+               if(err.get_type()!=Action::Error::TYPE_UNABLE)
+               {
+                       if(err.get_desc().empty())
+                               uim->error(action->get_name()+_(" (Undo): ")+strprintf("%d",err.get_type()));           
+                       else
+                               uim->error(action->get_name()+_(" (Undo): ")+err.get_desc());           
+               }
+
+               return false;
+       }
+       catch(std::runtime_error x)
+       {
+               uim->error(x.what());
+               return false;
+       }
+       catch(...)
+       {
+               return false;
+       }
+
+       dec_action_count();
+
+       if(redo_action_stack_.empty())  signal_redo_status()(true);
+
+       redo_action_stack_.push_front(undo_action_stack_.front());
+       undo_action_stack_.pop_front();
+
+       if(undo_action_stack_.empty())  signal_undo_status()(false);
+
+       if(!group_stack_.empty())
+               group_stack_.front()->dec_depth();
+
+       signal_undo_();
+
+       return true;
+}
+
+bool
+synfigapp::Action::System::undo()
+{
+       //! \todo This function is not exception safe!
+       static bool inuse=false;
+
+       // If there is nothing on the action list, there is nothing to undo
+       if(undo_action_stack().empty() || inuse)
+               return false;
+
+       handle<Action::Undoable> action=undo_action_stack().front();
+       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
+
+       handle<UIInterface> uim;
+       if(canvas_specific && canvas_specific->get_canvas())
+       {
+               Canvas::Handle canvas=canvas_specific->get_canvas();
+               handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
+               assert(canvas_interface);
+               uim=canvas_interface->get_ui_interface();
+       }
+       else
+               uim=get_ui_interface();
+
+       inuse=true;
+
+       if(!undo_(uim))
+       {
+               uim->error(undo_action_stack_.front()->get_name()+": "+_("Failed to undo."));
+               inuse=false;
+               return false;
+       }
+
+       inuse=false;
+       
+       // If the action has "dirtied" the preview, signal it.
+       if(0)if(action->is_active() && canvas_specific && canvas_specific->is_dirty())
+       {
+               Canvas::Handle canvas=canvas_specific->get_canvas();
+               if(!group_stack_.empty())
+                       group_stack_.front()->request_redraw(canvas_specific->get_canvas_interface());
+               else
+               {
+                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
+                       assert(canvas_interface);
+                       //DEBUGPOINT();
+                       //canvas_interface->signal_dirty_preview()();
+               }
+       }
+
+       return true;
+}
+
+bool
+Action::System::redo_(handle<UIInterface> uim)
+{
+       handle<Action::Undoable> action(redo_action_stack().front());
+       most_recent_action_=action;
+
+       try { if(action->is_active()) action->perform(); }
+       catch(Action::Error err)
+       {
+               if(err.get_type()!=Action::Error::TYPE_UNABLE)
+               {
+                       if(err.get_desc().empty())
+                               uim->error(action->get_name()+_(" (Redo): ")+strprintf("%d",err.get_type()));           
+                       else
+                               uim->error(action->get_name()+_(" (Redo): ")+err.get_desc());           
+               }
+
+               return false;
+       }
+       catch(std::runtime_error x)
+       {
+               uim->error(x.what());
+               return false;
+       }
+       catch(...)
+       {
+               return false;
+       }
+
+       inc_action_count();
+
+       if(undo_action_stack_.empty())  signal_undo_status()(true);
+
+       undo_action_stack_.push_front(redo_action_stack_.front());
+       redo_action_stack_.pop_front();
+
+       if(redo_action_stack_.empty())  signal_redo_status()(false);
+
+       if(!group_stack_.empty())
+               group_stack_.front()->inc_depth();
+
+       signal_redo_();
+
+       return true;
+}
+
+bool
+Action::System::redo()
+{
+       //! \todo This function is not exception safe!
+       static bool inuse=false;
+
+       // If there is nothing on the action list, there is nothing to undo
+       if(redo_action_stack_.empty() || inuse)
+               return false;
+
+       inuse=true;
+
+       handle<Action::Undoable> action=redo_action_stack().front();
+       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
+
+       handle<UIInterface> uim;
+       if(canvas_specific && canvas_specific->get_canvas())
+       {
+               Canvas::Handle canvas=canvas_specific->get_canvas();
+               handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
+               assert(canvas_interface);
+               uim=canvas_interface->get_ui_interface();
+       }
+       else
+               uim=get_ui_interface();
+
+       if(!redo_(uim))
+       {
+               uim->error(redo_action_stack_.front()->get_name()+": "+_("Failed to redo."));
+               inuse=false;
+               return false;
+       }
+
+       inuse=false;
+
+       // If the action has "dirtied" the preview, signal it.
+       if(0)if(action->is_active() && canvas_specific && canvas_specific->is_dirty())
+       {
+               Canvas::Handle canvas=canvas_specific->get_canvas();
+               if(!group_stack_.empty())
+                       group_stack_.front()->request_redraw(canvas_specific->get_canvas_interface());
+               else
+               {
+                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
+                       assert(canvas_interface);
+                       //DEBUGPOINT();
+                       //canvas_interface->signal_dirty_preview()();
+               }
+       }
+
+       return true;
+}
+
+void
+Action::System::inc_action_count()const
+{
+       action_count_++;
+       if(action_count_==1)
+               signal_unsaved_status_changed_(true);
+       if(!action_count_)
+               signal_unsaved_status_changed_(false);
+}
+
+void
+Action::System::dec_action_count()const
+{
+       action_count_--;
+       if(action_count_==-1)
+               signal_unsaved_status_changed_(true);
+       if(!action_count_)
+               signal_unsaved_status_changed_(false);
+}
+
+void
+Action::System::reset_action_count()const
+{
+       if(!action_count_)
+               return;
+
+       action_count_=0;
+       signal_unsaved_status_changed_(false);
+}
+
+void
+Action::System::clear_undo_stack()
+{
+       if(undo_action_stack_.empty()) return;
+       undo_action_stack_.clear();
+       signal_undo_status_(false);
+       signal_undo_stack_cleared_();
+}
+       
+void
+Action::System::clear_redo_stack()
+{
+       if(redo_action_stack_.empty()) return;
+       redo_action_stack_.clear();
+       signal_redo_status_(false);
+       signal_redo_stack_cleared_();
+}
+
+bool
+Action::System::set_action_status(etl::handle<Action::Undoable> action, bool x)
+{
+       Stack::iterator iter;
+       int failed=false;
+       
+       if(action->is_active()==x)
+               return true;
+
+       handle<Action::Undoable> cur_pos=undo_action_stack_.front();
+
+       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
+
+       handle<UIInterface> uim=new ConfidentUIInterface();
+       
+       iter=find(undo_action_stack_.begin(),undo_action_stack_.end(),action);
+       if(iter!=undo_action_stack_.end())
+       {
+               while(undo_action_stack_.front()!=action)
+               {
+                       if(!undo_(uim))
+                       {
+                               return false;
+                       }
+               } 
+               if(!undo_(uim))
+               {
+                       return false;
+               }
+               
+               action->set_active(x);
+
+               if(redo_(get_ui_interface()))
+               {
+                       signal_action_status_changed_(action);
+               }
+               else
+               {
+                       action->set_active(!x);
+                       failed=true;
+               }
+               
+               
+               while(undo_action_stack_.front()!=cur_pos)
+               {
+                       if(!redo_(uim))
+                       {
+                               redo_action_stack_.front()->set_active(false);
+                               signal_action_status_changed_(redo_action_stack_.front());
+                       }
+               }
+
+               if(!failed && canvas_specific && canvas_specific->is_dirty())
+               {
+                       Canvas::Handle canvas=canvas_specific->get_canvas();
+                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
+                       assert(canvas_interface);
+                       //DEBUGPOINT();
+                       //canvas_interface->signal_dirty_preview()();
+               }
+
+               return true;
+       }
+
+       iter=find(redo_action_stack_.begin(),redo_action_stack_.end(),action);
+       if(iter!=redo_action_stack_.end())
+       {
+               action->set_active(x);
+               signal_action_status_changed_(action);
+
+
+
+
+               if(canvas_specific && canvas_specific->is_dirty())
+               {
+                       Canvas::Handle canvas=canvas_specific->get_canvas();
+                       handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
+                       assert(canvas_interface);
+                       DEBUGPOINT();
+                       //canvas_interface->signal_dirty_preview()();
+               }
+
+               return true;
+       }
+
+       return false;
+}
+
+Action::PassiveGrouper::PassiveGrouper(etl::loose_handle<Action::System> instance_,synfig::String name_):
+       instance_(instance_),
+       name_(name_),
+       redraw_requested_(false),
+       depth_(0)
+{
+       // Add this group onto the group stack
+       instance_->group_stack_.push_front(this);
+}
+
+void
+Action::PassiveGrouper::request_redraw(handle<CanvasInterface> x)
+{
+/*     DEBUGPOINT();
+       if(instance_->group_stack_.empty())
+       {
+               if(x!=canvas_interface_)
+               {
+                       DEBUGPOINT();
+                       x->signal_dirty_preview()();
+               }
+
+               redraw_requested_=false;
+       }
+       else
+       {
+               DEBUGPOINT();
+               if(instance_->group_stack_.back()==this)
+               {
+                       DEBUGPOINT();
+                       redraw_requested_=true;
+               }
+               else
+               {
+                       DEBUGPOINT();
+                       instance_->group_stack_.back()->request_redraw(x);
+                       redraw_requested_=false;
+               }
+               DEBUGPOINT();
+       }
+       DEBUGPOINT();
+*/
+       if(x)
+       {
+               redraw_requested_=true;
+               canvas_interface_=x;
+       }
+}
+
+Action::PassiveGrouper::~PassiveGrouper()
+{
+       assert(instance_->group_stack_.front()==this);
+       
+       // Remove this group from the group stack
+       instance_->group_stack_.pop_front();
+
+       handle<Action::Group> group;
+
+       if(depth_==1)
+       {
+               handle<Action::Undoable> action(instance_->undo_action_stack_.front());
+
+               group=handle<Action::Group>::cast_dynamic(action);
+
+               if(group)
+               {
+                       // If the only action inside of us is a group,
+                       // then we should rename the group to our name.
+                       group->set_name(name_);
+               }
+               else
+               {
+                       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
+                       
+                       if(0)if(canvas_specific && canvas_specific->is_dirty() && canvas_specific->get_canvas_interface())
+                       {
+                               if(instance_->group_stack_.empty())
+                                       request_redraw(canvas_specific->get_canvas_interface());                                        
+                       }
+               }
+
+               if(instance_->group_stack_.empty())
+               {
+                       instance_->inc_action_count();
+                       instance_->signal_new_action()(instance_->undo_action_stack_.front());
+               }
+               else
+                       instance_->group_stack_.front()->inc_depth();
+
+       }
+       else
+       if(depth_>0)
+       {
+               group=new Action::Group(name_);
+               
+               for(int i=0;i<depth_;i++)
+       //      for(;depth_;depth_--)
+               {
+                       handle<Action::Undoable> action(instance_->undo_action_stack_.front());
+                       Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
+                       
+                       if(0)if(canvas_specific && canvas_specific->is_dirty())
+                       {
+                               group->set_dirty(true);
+                               group->set_canvas(canvas_specific->get_canvas());
+                               group->set_canvas_interface(canvas_specific->get_canvas_interface());
+                       }
+                       
+                       // Copy the action from the undo stack to the group
+                       group->add_action_front(action);
+       
+                       // Remove the action from the undo stack
+                       instance_->undo_action_stack_.pop_front();
+               }
+                       
+               // Push the group onto the stack
+               instance_->undo_action_stack_.push_front(group);
+       
+               if(0)if(group->is_dirty())
+                       request_redraw(group->get_canvas_interface());
+               //      group->get_canvas_interface()->signal_dirty_preview()();
+       
+               if(instance_->group_stack_.empty())
+               {
+                       instance_->inc_action_count();
+                       instance_->signal_new_action()(instance_->undo_action_stack_.front());
+               }
+               else
+                       instance_->group_stack_.front()->inc_depth();
+       }
+       
+       if(0)if(redraw_requested_)
+       {
+               if(instance_->group_stack_.empty())
+               {
+                       assert(canvas_interface_);
+                       DEBUGPOINT();
+                       canvas_interface_->signal_dirty_preview()();
+               }
+               else
+               {
+                       instance_->group_stack_.front()->request_redraw(canvas_interface_);
+                       redraw_requested_=false;
+               }
+       }
+}
+
+void
+Action::PassiveGrouper::cancel()
+{
+       bool error=false;
+
+       // Cancel any groupers that may be on top of us first
+       //while(instance_->group_stack_.front()!=this)
+       //      instance_->group_stack_.front()->cancel();
+       
+       synfig::warning("Cancel depth: %d",depth_);
+       
+       while(depth_)
+               if(!instance_->undo())
+               {
+                       error=true;
+                       break;
+               }
+       
+       if(error)
+               instance_->get_ui_interface()->error(_("State restore failure"));
+       else
+               redraw_requested_=false;
+}
diff --git a/synfig-studio/trunk/src/synfigapp/action_system.h b/synfig-studio/trunk/src/synfigapp/action_system.h
new file mode 100644 (file)
index 0000000..ebd0f99
--- /dev/null
@@ -0,0 +1,249 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_system.h
+**     \brief Template Header
+**
+**     $Id: action_system.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIGAPP_ACTIONSYSTEM_H
+#define __SYNFIGAPP_ACTIONSYSTEM_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "action.h"
+#include <sigc++/signal.h>
+#include <sigc++/object.h>
+#include <ETL/handle>
+#include <synfig/canvas.h>
+#include "uimanager.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 synfigapp {
+
+class CanvasInterface;
+       
+namespace Action {
+
+
+       
+       
+       
+class System;
+
+//! Passive action grouping class
+class PassiveGrouper
+{
+       etl::loose_handle<System> instance_;
+       synfig::String name_;
+       bool redraw_requested_;
+       int depth_;
+       etl::handle<CanvasInterface> canvas_interface_;
+public:
+
+       PassiveGrouper(etl::loose_handle<System> instance_,synfig::String name_);
+
+       ~PassiveGrouper();
+
+       const synfig::String &get_name()const { return name_; }
+
+       void set_name(const synfig::String &x) { name_=x; }
+
+       etl::loose_handle<System> get_instance() { return instance_; }
+       
+       void request_redraw(etl::handle<CanvasInterface>);
+       
+       void cancel();
+       
+       void inc_depth() { depth_++; }
+
+       void dec_depth() { depth_--; }
+
+       const int &get_depth()const { return depth_; }
+}; // END of class Action::PassiveGrouper
+
+typedef std::list< etl::handle<Action::Undoable> > Stack;
+       
+class System : public etl::shared_object, public sigc::trackable
+{
+       friend class PassiveGrouper;
+               
+       /*
+ -- ** -- P U B L I C   T Y P E S ---------------------------------------------
+       */
+
+public:
+
+       /*
+ -- ** -- P U B L I C  D A T A ------------------------------------------------
+       */
+
+public:
+       
+       /*
+ -- ** -- P R I V A T E   D A T A ---------------------------------------------
+       */
+
+private:
+
+       Stack undo_action_stack_;
+       Stack redo_action_stack_;
+
+       etl::handle<Action::Base> most_recent_action_;
+
+       std::list<PassiveGrouper*> group_stack_;
+
+       sigc::signal<void,bool> signal_undo_status_;
+       sigc::signal<void,bool> signal_redo_status_;
+       sigc::signal<void,etl::handle<Action::Undoable> > signal_new_action_;
+       sigc::signal<void> signal_undo_stack_cleared_;
+       sigc::signal<void> signal_redo_stack_cleared_;
+       sigc::signal<void> signal_undo_;
+       sigc::signal<void> signal_redo_;
+       sigc::signal<void,etl::handle<Action::Undoable> > signal_action_status_changed_;
+       
+       mutable sigc::signal<void,bool> signal_unsaved_status_changed_;
+
+       //! If this is non-zero, then the changes have not yet been saved.
+       mutable int action_count_;
+
+       etl::handle<UIInterface> ui_interface_;
+
+       bool clear_redo_stack_on_new_action_;
+       
+       /*
+ -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
+       */
+
+private:
+
+       bool undo_(etl::handle<UIInterface> uim);
+       bool redo_(etl::handle<UIInterface> uim);
+
+       /*
+ -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
+       */
+
+private:
+
+       /*
+ -- ** -- P U B L I C   M E T H O D S -----------------------------------------
+       */
+
+public:
+
+       System();
+       ~System();
+
+       /*
+       template <typename T> bool
+       perform_action(T x)
+       {
+               etl::handle<Action::Base> action((Action::Base*)new T(x));
+               return perform_action(action);
+       }
+       */
+
+       const etl::handle<Action::Base>& get_most_recent_action() { return most_recent_action_; }
+
+       bool get_clear_redo_stack_on_new_action()const { return clear_redo_stack_on_new_action_; }
+       
+       void set_clear_redo_stack_on_new_action(bool x) { clear_redo_stack_on_new_action_=x; }
+
+       bool perform_action(etl::handle<Action::Base> action);
+
+       bool set_action_status(etl::handle<Action::Undoable> action, bool x);
+
+       const Stack &undo_action_stack()const { return undo_action_stack_; }
+
+       const Stack &redo_action_stack()const { return redo_action_stack_; }
+
+       //! Undoes the last action
+       bool undo();
+
+       //! Redoes the last undone action
+       bool redo();
+       
+       //! Clears the undo stack. 
+       void clear_undo_stack();
+       
+       //! Clears the redo stack. 
+       void clear_redo_stack();
+       
+       //! Increments the action counter
+       /*! \note You should not have to call this under normal circumstances.
+       **      \see dec_action_count(), reset_action_count(), get_action_count() */
+       void inc_action_count()const;
+
+       //! Decrements the action counter
+       /*! \note You should not have to call this under normal circumstances.
+       **      \see inc_action_count(), reset_action_count(), get_action_count() */
+       void dec_action_count()const;
+
+       //! Resets the action counter
+       /*! \note You should not have to call this under normal circumstances.
+       **      \see inc_action_count(), dec_action_count(), get_action_count() */
+       void reset_action_count()const;
+
+       //! Returns the number of actions performed since last save.
+       /*!     \see inc_action_count(), dec_action_count(), reset_action_count() */
+       int get_action_count()const { return action_count_; }
+
+       void set_ui_interface(const etl::handle<UIInterface> &uim) { assert(uim); ui_interface_=uim; }
+       void unset_ui_interface() { ui_interface_=new DefaultUIInterface(); }
+       const etl::handle<UIInterface> &get_ui_interface() { return ui_interface_; }    
+
+       /*
+ -- ** -- S I G N A L   I N T E R F A C E S -----------------------------------
+       */
+
+public:
+
+       sigc::signal<void,bool>& signal_unsaved_status_changed() { return signal_unsaved_status_changed_; }
+
+       sigc::signal<void,bool>& signal_undo_status() { return signal_undo_status_; }
+
+       sigc::signal<void,bool>& signal_redo_status() { return signal_redo_status_; }
+
+       sigc::signal<void>& signal_undo_stack_cleared() { return signal_undo_stack_cleared_; }
+
+       sigc::signal<void>& signal_redo_stack_cleared() { return signal_redo_stack_cleared_; }
+
+       sigc::signal<void>& signal_undo() { return signal_undo_; }
+
+       sigc::signal<void>& signal_redo() { return signal_redo_; }
+
+       //!     Called whenever an undoable action is processed and added to the stack.
+       sigc::signal<void,etl::handle<Action::Undoable> >& signal_new_action() { return signal_new_action_; }
+
+       sigc::signal<void,etl::handle<Action::Undoable> >& signal_action_status_changed() { return signal_action_status_changed_; }
+
+}; // END of class Action::System
+
+
+}; // END of namespace synfigapp::Action
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointadd.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointadd.cpp
new file mode 100644 (file)
index 0000000..ddf5381
--- /dev/null
@@ -0,0 +1,204 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file acitvepointadd.cpp
+**     \brief Template File
+**
+**     $Id: activepointadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "activepointadd.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ActivepointAdd);
+ACTION_SET_NAME(Action::ActivepointAdd,"activepoint_add");
+ACTION_SET_LOCAL_NAME(Action::ActivepointAdd,"Add Activepoint");
+ACTION_SET_TASK(Action::ActivepointAdd,"add");
+ACTION_SET_CATEGORY(Action::ActivepointAdd,Action::CATEGORY_ACTIVEPOINT);
+ACTION_SET_PRIORITY(Action::ActivepointAdd,0);
+ACTION_SET_VERSION(Action::ActivepointAdd,"0.0");
+ACTION_SET_CVS_ID(Action::ActivepointAdd,"$Id: activepointadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ActivepointAdd::ActivepointAdd()
+{
+       activepoint.set_time(Time::begin()-1);
+       time_set=false;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ActivepointAdd::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
+               .set_local_name(_("New Activepoint"))
+               .set_desc(_("Activepoint to be added"))
+               .set_optional()
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_desc(_("Time where activepoint is to be added"))
+               .set_optional()
+       );
+
+       return ret;
+}
+
+bool
+Action::ActivepointAdd::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               // We need either a activepoint or a time.
+               if(x.count("activepoint") || x.count("time"))
+                       return true;
+       }
+       return false;
+}
+
+bool
+Action::ActivepointAdd::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+               
+               index=value_desc.get_index();
+               
+               if(time_set)
+                       calc_activepoint();
+               
+               return true;
+       }
+       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT && !time_set)
+       {
+               activepoint=param.get_activepoint();
+               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME && activepoint.get_time()==Time::begin()-1)
+       {
+               activepoint.set_time(param.get_time());
+               time_set=true;
+
+               if(value_node)
+                       calc_activepoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ActivepointAdd::is_ready()const
+{
+       if(!value_node || activepoint.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+// This function is called if a time is specified, but not 
+// a activepoint. In this case, we need to calculate the value
+// of the activepoint
+void
+Action::ActivepointAdd::calc_activepoint()
+{      
+       const Time time(activepoint.get_time());
+       activepoint.set_state(value_node->list[index].status_at_time(time));
+       activepoint.set_priority(0);
+       
+       // In this case, nothing is really changing, so there will be
+       // no need to redraw the window
+       set_dirty(false);
+}
+
+void
+Action::ActivepointAdd::perform()
+{      
+       try { value_node->list[index].find(activepoint.get_time()); throw Error(_("A Activepoint already exists at this point in time"));}
+       catch(synfig::Exception::NotFound) { }  
+
+       try { if(value_node->list[index].find(activepoint)!=value_node->list[index].timing_info.end()) throw Error(_("This activepoint is already in the ValueNode"));}
+       catch(synfig::Exception::NotFound) { }  
+       
+       value_node->list[index].add(activepoint);
+       value_node->changed();
+       
+       /*if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+       */
+}
+
+void
+Action::ActivepointAdd::undo()
+{
+       value_node->list[index].erase(activepoint);
+       value_node->changed();
+       /*
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+       */
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointadd.h b/synfig-studio/trunk/src/synfigapp/actions/activepointadd.h
new file mode 100644 (file)
index 0000000..6da931f
--- /dev/null
@@ -0,0 +1,80 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointadd.h
+**     \brief Template File
+**
+**     $Id: activepointadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_ACTIVEPOINTADD_H
+#define __SYNFIG_APP_ACTION_ACTIVEPOINTADD_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ActivepointAdd :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Activepoint activepoint;
+       synfig::ValueNode_DynamicList::Handle value_node;
+       int index;
+
+       bool time_set;
+
+       void calc_activepoint();
+
+public:
+
+       ActivepointAdd();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointremove.cpp
new file mode 100644 (file)
index 0000000..bff1bd9
--- /dev/null
@@ -0,0 +1,176 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointremove.cpp
+**     \brief Template File
+**
+**     $Id: activepointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "activepointremove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ActivepointRemove);
+ACTION_SET_NAME(Action::ActivepointRemove,"activepoint_remove");
+ACTION_SET_LOCAL_NAME(Action::ActivepointRemove,"Remove Activepoint");
+ACTION_SET_TASK(Action::ActivepointRemove,"remove");
+ACTION_SET_CATEGORY(Action::ActivepointRemove,Action::CATEGORY_ACTIVEPOINT);
+ACTION_SET_PRIORITY(Action::ActivepointRemove,0);
+ACTION_SET_VERSION(Action::ActivepointRemove,"0.0");
+ACTION_SET_CVS_ID(Action::ActivepointRemove,"$Id: activepointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ActivepointRemove::ActivepointRemove()
+{
+       activepoint.set_time(Time::begin()-1);
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ActivepointRemove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
+               .set_local_name(_("Activepoint"))
+               .set_desc(_("Activepoint to be changed"))
+       );
+
+       return ret;
+}
+
+bool
+Action::ActivepointRemove::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ActivepointRemove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+               
+               index=value_desc.get_index();
+               
+               return true;
+       }
+       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT)
+       {
+               activepoint=param.get_activepoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ActivepointRemove::is_ready()const
+{
+       if(!value_node || activepoint.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ActivepointRemove::perform()
+{      
+       ValueNode_DynamicList::ListEntry::ActivepointList::iterator iter;
+       
+       try { iter=value_node->list[index].find(activepoint); }
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find activepoint"));
+       }       
+
+       value_node->list[index].erase(activepoint);
+       value_node->changed();
+       
+       /*
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+       */
+}
+
+void
+Action::ActivepointRemove::undo()
+{
+       try { value_node->list[index].find(activepoint.get_time()); throw Error(_("A Activepoint already exists at this point in time"));}
+       catch(synfig::Exception::NotFound) { }  
+
+       try { if(value_node->list[index].find(activepoint)!=value_node->list[index].timing_info.end()) throw Error(_("This activepoint is already in the ValueNode"));}
+       catch(synfig::Exception::NotFound) { }  
+       
+       value_node->list[index].add(activepoint);
+       value_node->changed();
+       /*
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+       */
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointremove.h b/synfig-studio/trunk/src/synfigapp/actions/activepointremove.h
new file mode 100644 (file)
index 0000000..79373af
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointremove.h
+**     \brief Template File
+**
+**     $Id: activepointremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_ACTIVEPOINTREMOVE_H
+#define __SYNFIG_APP_ACTION_ACTIVEPOINTREMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ActivepointRemove :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       int index;
+       synfig::Activepoint activepoint;
+
+public:
+
+       ActivepointRemove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointset.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointset.cpp
new file mode 100644 (file)
index 0000000..e9492ef
--- /dev/null
@@ -0,0 +1,289 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointset.cpp
+**     \brief Template File
+**
+**     $Id: activepointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "activepointset.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ActivepointSet);
+ACTION_SET_NAME(Action::ActivepointSet,"activepoint_set");
+ACTION_SET_LOCAL_NAME(Action::ActivepointSet,"Set Activepoint");
+ACTION_SET_TASK(Action::ActivepointSet,"set");
+ACTION_SET_CATEGORY(Action::ActivepointSet,Action::CATEGORY_ACTIVEPOINT);
+ACTION_SET_PRIORITY(Action::ActivepointSet,0);
+ACTION_SET_VERSION(Action::ActivepointSet,"0.0");
+ACTION_SET_CVS_ID(Action::ActivepointSet,"$Id: activepointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ActivepointSet::ActivepointSet()
+{
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ActivepointSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
+               .set_local_name(_("Activepoint"))
+               .set_desc(_("Activepoint to be changed"))
+               .set_supports_multiple()
+       );
+
+       return ret;
+}
+
+bool
+Action::ActivepointSet::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ActivepointSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+               
+               index=value_desc.get_index();
+               
+               return true;
+       }
+       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT)
+       {
+               //NOTE: there is no duplication checking at the moment
+               activepoints.push_back(param.get_activepoint());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ActivepointSet::is_ready()const
+{
+       if(!value_node || activepoints.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ActivepointSet::perform()
+{      
+       typedef ValueNode_DynamicList::ListEntry::ActivepointList AList;
+       AList::iterator iter;
+
+#if 1  
+       vector<AList::iterator> iters;
+       vector<Activepoint>::iterator i = activepoints.begin(), end = activepoints.end();       
+       
+       for(; i != end; ++i)
+       {
+               try { iters.push_back(value_node->list[index].find(*i)); }
+               catch(synfig::Exception::NotFound)
+               {
+                       throw Error(_("Unable to find activepoint"));
+               }
+       }
+       
+       //check to see which valuenodes are going to override because of the time...
+       ValueNode_DynamicList::ListEntry::findresult timeiter;
+       
+       for(i = activepoints.begin(); i != end; ++i)
+       {
+               timeiter = value_node->list[index].find_time(i->get_time());
+               
+               bool candelete = timeiter.second;
+       
+               //we only want to track overwrites (not activepoints that are also being modified)
+               if(candelete)
+               {
+                       for(vector<AList::iterator>::iterator ii = iters.begin(); ii != iters.end(); ++ii)
+                       {
+                               if(timeiter.first == *ii)
+                               {
+                                       candelete = false;
+                                       break;
+                               }
+                       }
+               }
+               
+               //if we can still delete it after checking, record it, and then remove them all later
+               if(candelete)
+               {
+                       Activepoint a = *timeiter.first;
+                       overwritten_activepoints.push_back(a);
+               }
+       }
+       
+       //overwrite all the valuenodes we're supposed to set
+       {
+               i = activepoints.begin();
+               for(vector<AList::iterator>::iterator ii = iters.begin(); ii != iters.end() && i != end; ++ii, ++i)
+               {
+                       old_activepoints.push_back(**ii);
+                       **ii = *i; //set the point to the corresponding point in the normal waypoint list
+               }
+       }
+       
+       //remove all the points we're supposed to be overwritting
+       {
+               vector<Activepoint>::iterator   oi = overwritten_activepoints.begin(),
+                                                                               oend = overwritten_activepoints.end();
+               for(; oi != oend; ++oi)
+               {
+                       value_node->list[index].erase(*oi);
+               }
+       }
+
+#else  
+       try { iter=value_node->list[index].find(activepoint); }
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find activepoint"));
+       }       
+
+       //find the value at the old time before we replace it
+       ValueNode_DynamicList::ListEntry::findresult timeiter;
+       timeiter = value_node->list[index].find_time(activepoint.get_time());
+       
+       //we only want to track overwrites (not inplace modifications)
+       if(timeiter.second && activepoint.get_uid() == timeiter.first->get_uid())
+       {
+               timeiter.second = false;
+       }
+               
+       old_activepoint=*iter;
+       *iter=activepoint;
+       
+       if(timeiter.second)
+       {
+               synfig::info("Erasing the found activepoint");
+               time_overwrite = true;
+               overwritten_ap = *timeiter.first;
+               
+               value_node->list[index].erase(overwritten_ap);
+       }
+       
+#endif
+       
+       value_node->list[index].timing_info.sort();
+       
+       // Signal that a valuenode has been changed
+       value_node->changed();
+}
+
+void
+Action::ActivepointSet::undo()
+{
+       ValueNode_DynamicList::ListEntry::ActivepointList::iterator iter;
+
+#if 1  
+       vector<Activepoint>::iterator i = old_activepoints.begin(), end = old_activepoints.end();       
+       
+       for(; i != end; ++i)
+       {
+               try { iter = value_node->list[index].find(*i); }
+               catch(synfig::Exception::NotFound)
+               {
+                       throw Error(_("Unable to find activepoint"));
+               }
+               
+               //overwrite with old one
+               *iter = *i;
+       }
+               
+       //add back in all the points that we removed before...
+       {
+               vector<Activepoint>::iterator   oi = overwritten_activepoints.begin(),
+                                                                               oend = overwritten_activepoints.end();
+               for(; oi != oend; ++oi)
+               {
+                       value_node->list[index].add(*oi);
+               }
+       }
+
+#else  
+       try { iter=value_node->list[index].find(activepoint); }
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find activepoint"));
+       }       
+
+       *iter=old_activepoint;
+               
+       if(time_overwrite)
+       {
+               value_node->list[index].add(overwritten_ap);
+       }
+#endif
+       
+       value_node->list[index].timing_info.sort();
+       
+       // Signal that a valuenode has been changed
+       value_node->changed();
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointset.h b/synfig-studio/trunk/src/synfigapp/actions/activepointset.h
new file mode 100644 (file)
index 0000000..46d4b61
--- /dev/null
@@ -0,0 +1,80 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointset.h
+**     \brief Template File
+**
+**     $Id: activepointset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_ACTIVEPOINTSET_H
+#define __SYNFIG_APP_ACTION_ACTIVEPOINTSET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ActivepointSet :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       int index;
+       
+       std::vector<synfig::Activepoint> activepoints;
+       std::vector<synfig::Activepoint> old_activepoints;      
+
+       std::vector<synfig::Activepoint> overwritten_activepoints;
+
+public:
+
+       ActivepointSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.cpp
new file mode 100644 (file)
index 0000000..f2c5a3a
--- /dev/null
@@ -0,0 +1,212 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointsetoff.cpp
+**     \brief Template File
+**
+**     $Id: activepointsetoff.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "activepointsetoff.h"
+#include "activepointsetsmart.h"
+#include "valuenodelinkconnect.h"
+#include "valuenodereplace.h"
+
+#include "activepointset.h"
+#include "activepointadd.h"
+
+#include "valuedescconnect.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ActivepointSetOff);
+ACTION_SET_NAME(Action::ActivepointSetOff,"activepoint_set_off");
+ACTION_SET_LOCAL_NAME(Action::ActivepointSetOff,_("Mark Activepoint as \"Off\""));
+ACTION_SET_TASK(Action::ActivepointSetOff,"set_off");
+ACTION_SET_CATEGORY(Action::ActivepointSetOff,Action::CATEGORY_ACTIVEPOINT|Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ActivepointSetOff,-9);
+ACTION_SET_VERSION(Action::ActivepointSetOff,"0.0");
+ACTION_SET_CVS_ID(Action::ActivepointSetOff,"$Id: activepointsetoff.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ActivepointSetOff::ActivepointSetOff()
+{
+       activepoint.set_time(Time::begin()-1);
+       time_set=false;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ActivepointSetOff::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
+               .set_local_name(_("Activepoint"))
+               .set_optional()
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ActivepointSetOff::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+               
+               // We are only a canidate if this canvas is animated.
+               Canvas::Handle canvas(x.find("canvas")->second.get_canvas());
+               if(canvas->rend_desc().get_time_start()==canvas->rend_desc().get_time_end())
+                       return false;
+               
+               // We need either a activepoint or a time.
+               if(x.count("activepoint") || x.count("time"))
+                       return true;
+       }
+       return false;
+}
+
+bool
+Action::ActivepointSetOff::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               value_desc=param.get_value_desc();
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+               
+               index=value_desc.get_index();
+               
+               if(time_set)
+                       calc_activepoint();
+               
+               return true;
+       }
+       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT && !time_set)
+       {
+               activepoint=param.get_activepoint();
+               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME && activepoint.get_time()==Time::begin()-1)
+       {
+               activepoint.set_time(param.get_time());
+               time_set=true;
+
+               if(value_node)
+                       calc_activepoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ActivepointSetOff::is_ready()const
+{
+       if(!value_node)
+               synfig::error("Missing value_node");
+
+       if(activepoint.get_time()==(Time::begin()-1))
+               synfig::error("Missing activepoint");
+       
+       if(!value_node || activepoint.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+// This function is called if a time is specified, but not 
+// a activepoint. In this case, we need to calculate the value
+// of the activepoint
+void
+Action::ActivepointSetOff::calc_activepoint()
+{      
+       const Time time(activepoint.get_time());
+       
+       try { activepoint=*value_node->list[index].find(time); }
+       catch(...)
+       {
+               activepoint.set_time(time);
+               activepoint.set_state(value_node->list[index].status_at_time(time));
+               activepoint.set_priority(0);
+       }
+}
+
+void
+Action::ActivepointSetOff::prepare()
+{
+       clear();
+
+       // Turn the activepoint off
+       activepoint.set_state(false);
+
+       Action::Handle action(ActivepointSetSmart::create());
+       
+       action->set_param("edit_mode",get_edit_mode());
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",get_canvas_interface());
+       action->set_param("value_desc",value_desc);
+       action->set_param("activepoint",activepoint);
+
+       assert(action->is_ready());
+       if(!action->is_ready())
+               throw Error(Error::TYPE_NOTREADY);
+
+       add_action_front(action);
+       
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.h b/synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.h
new file mode 100644 (file)
index 0000000..3aaa399
--- /dev/null
@@ -0,0 +1,79 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointsetoff.h
+**     \brief Template File
+**
+**     $Id: activepointsetoff.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_ACTIVEPOINTSETOFF_H
+#define __SYNFIG_APP_ACTION_ACTIVEPOINTSETOFF_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/valuenode_dynamiclist.h>
+
+#include <list>
+#include <set>
+
+/* === 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 synfigapp {
+
+namespace Action {
+
+class ActivepointSetOff :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::ValueNode_DynamicList::Handle value_node;
+       int index;
+       bool time_set;
+       synfig::Activepoint activepoint;
+
+       void calc_activepoint();
+
+public:
+
+       ActivepointSetOff();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointseton.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointseton.cpp
new file mode 100644 (file)
index 0000000..b5e430a
--- /dev/null
@@ -0,0 +1,212 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointseton.cpp
+**     \brief Template File
+**
+**     $Id: activepointseton.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "activepointseton.h"
+#include "activepointsetsmart.h"
+#include "valuenodelinkconnect.h"
+#include "valuenodereplace.h"
+
+#include "activepointset.h"
+#include "activepointadd.h"
+
+#include "valuedescconnect.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ActivepointSetOn);
+ACTION_SET_NAME(Action::ActivepointSetOn,"activepoint_set_on");
+ACTION_SET_LOCAL_NAME(Action::ActivepointSetOn,_("Mark Activepoint as \"On\""));
+ACTION_SET_TASK(Action::ActivepointSetOn,"set_on");
+ACTION_SET_CATEGORY(Action::ActivepointSetOn,Action::CATEGORY_ACTIVEPOINT|Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ActivepointSetOn,-10);
+ACTION_SET_VERSION(Action::ActivepointSetOn,"0.0");
+ACTION_SET_CVS_ID(Action::ActivepointSetOn,"$Id: activepointseton.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ActivepointSetOn::ActivepointSetOn()
+{
+       activepoint.set_time(Time::begin()-1);
+       time_set=false;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ActivepointSetOn::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
+               .set_local_name(_("Activepoint"))
+               .set_optional()
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ActivepointSetOn::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               // We are only a canidate if this canvas is animated.
+               Canvas::Handle canvas(x.find("canvas")->second.get_canvas());
+               if(canvas->rend_desc().get_time_start()==canvas->rend_desc().get_time_end())
+                       return false;
+
+               // We need either a activepoint or a time.
+               if(x.count("activepoint") || x.count("time"))
+                       return true;
+       }
+       return false;
+}
+
+bool
+Action::ActivepointSetOn::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               value_desc=param.get_value_desc();
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+               
+               index=value_desc.get_index();
+               
+               if(time_set)
+                       calc_activepoint();
+               
+               return true;
+       }
+       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT && !time_set)
+       {
+               activepoint=param.get_activepoint();
+               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME && activepoint.get_time()==Time::begin()-1)
+       {
+               activepoint.set_time(param.get_time());
+               time_set=true;
+
+               if(value_node)
+                       calc_activepoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ActivepointSetOn::is_ready()const
+{
+       if(!value_node)
+               synfig::error("Missing value_node");
+
+       if(activepoint.get_time()==(Time::begin()-1))
+               synfig::error("Missing activepoint");
+       
+       if(!value_node || activepoint.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+// This function is called if a time is specified, but not 
+// a activepoint. In this case, we need to calculate the value
+// of the activepoint
+void
+Action::ActivepointSetOn::calc_activepoint()
+{      
+       const Time time(activepoint.get_time());
+       
+       try { activepoint=*value_node->list[index].find(time); }
+       catch(...)
+       {
+               activepoint.set_time(time);
+               activepoint.set_state(value_node->list[index].status_at_time(time));
+               activepoint.set_priority(0);
+       }
+}
+
+void
+Action::ActivepointSetOn::prepare()
+{
+       clear();
+
+       // Turn the activepoint off
+       activepoint.set_state(true);
+
+       Action::Handle action(ActivepointSetSmart::create());
+       
+       action->set_param("edit_mode",get_edit_mode());
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",get_canvas_interface());
+       action->set_param("value_desc",value_desc);
+       action->set_param("activepoint",activepoint);
+
+       assert(action->is_ready());
+       if(!action->is_ready())
+               throw Error(Error::TYPE_NOTREADY);
+
+       add_action_front(action);
+       
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointseton.h b/synfig-studio/trunk/src/synfigapp/actions/activepointseton.h
new file mode 100644 (file)
index 0000000..2268211
--- /dev/null
@@ -0,0 +1,79 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointseton.h
+**     \brief Template File
+**
+**     $Id: activepointseton.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_ACTIVEPOINTSETON_H
+#define __SYNFIG_APP_ACTION_ACTIVEPOINTSETON_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/valuenode_dynamiclist.h>
+
+#include <list>
+#include <set>
+
+/* === 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 synfigapp {
+
+namespace Action {
+
+class ActivepointSetOn :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::ValueNode_DynamicList::Handle value_node;
+       int index;
+       synfig::Activepoint activepoint;
+       bool time_set;
+
+       void calc_activepoint();
+
+public:
+
+       ActivepointSetOn();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointsetsmart.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointsetsmart.cpp
new file mode 100644 (file)
index 0000000..6a1c9a6
--- /dev/null
@@ -0,0 +1,364 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointsetsmart.cpp
+**     \brief Template File
+**
+**     $Id: activepointsetsmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "activepointsetsmart.h"
+#include "valuenodelinkconnect.h"
+#include "valuenodereplace.h"
+
+#include "activepointset.h"
+#include "activepointadd.h"
+
+#include "valuedescconnect.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ActivepointSetSmart);
+ACTION_SET_NAME(Action::ActivepointSetSmart,"activepoint_set_smart");
+ACTION_SET_LOCAL_NAME(Action::ActivepointSetSmart,_("Set Activepoint (Smart)"));
+ACTION_SET_TASK(Action::ActivepointSetSmart,"set");
+ACTION_SET_CATEGORY(Action::ActivepointSetSmart,Action::CATEGORY_ACTIVEPOINT);
+ACTION_SET_PRIORITY(Action::ActivepointSetSmart,0);
+ACTION_SET_VERSION(Action::ActivepointSetSmart,"0.0");
+ACTION_SET_CVS_ID(Action::ActivepointSetSmart,"$Id: activepointsetsmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ActivepointSetSmart::ActivepointSetSmart()
+{
+       activepoint.set_time(Time::begin()-1);
+       time_set=false;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ActivepointSetSmart::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
+               .set_local_name(_("New Activepoint"))
+               .set_desc(_("Activepoint to be added"))
+               .set_optional()
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_desc(_("Time where activepoint is to be added"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ActivepointSetSmart::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               // We need either a activepoint or a time.
+               if(x.count("activepoint") || x.count("time"))
+                       return true;
+       }
+       return false;
+}
+
+bool
+Action::ActivepointSetSmart::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               value_desc=param.get_value_desc();
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+               
+               index=value_desc.get_index();
+               
+               if(time_set)
+                       calc_activepoint();
+               
+               return true;
+       }
+       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT && !time_set)
+       {
+               activepoint=param.get_activepoint();
+               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME && activepoint.get_time()==Time::begin()-1)
+       {
+               activepoint.set_time(param.get_time());
+               time_set=true;
+
+               if(value_node)
+                       calc_activepoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ActivepointSetSmart::is_ready()const
+{
+       if(!value_node)
+               synfig::error("Missing value_node");
+
+       if(activepoint.get_time()==(Time::begin()-1))
+               synfig::error("Missing activepoint");
+       
+       if(!value_node || activepoint.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+// This function is called if a time is specified, but not 
+// a activepoint. In this case, we need to calculate the value
+// of the activepoint
+void
+Action::ActivepointSetSmart::calc_activepoint()
+{      
+/*
+       const Time time(activepoint.get_time());
+       activepoint.set_state(value_node->list[index].status_at_time(time));
+       activepoint.set_priority(0);
+*/
+
+       activepoint=value_node->list[index].new_activepoint_at_time(activepoint.get_time());
+
+       // In this case, nothing is really changing, so there will be
+       // no need to redraw the window
+       set_dirty(false);
+}
+
+void
+Action::ActivepointSetSmart::enclose_activepoint(const synfig::Activepoint& activepoint)
+{
+       times.insert(activepoint.get_time());                   
+
+       if(get_edit_mode()&MODE_ANIMATE_PAST) try
+       {
+               // Try to find prev keyframe
+               Keyframe keyframe(*get_canvas()->keyframe_list().find_prev(activepoint.get_time()));
+
+               if(times.count(keyframe.get_time()))
+                       throw int();
+               else
+                       times.insert(keyframe.get_time());                      
+               
+               try { value_node->list[index].find(keyframe.get_time()); }
+               catch(synfig::Exception::NotFound)
+               {
+                       Action::Handle action(ActivepointAdd::create());
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("value_desc",value_desc);
+               
+                       if(!value_node->list[index].timing_info.empty())
+                       {       
+                               action->set_param("time",keyframe.get_time());
+                       }
+                       else
+                       {
+                               synfig::Activepoint tmp;
+                               
+                               tmp.set_state(true);
+                               tmp.set_time(keyframe.get_time());
+                               action->set_param("activepoint",tmp);
+                       }
+
+                       assert(action->is_ready());
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+               
+                       add_action_front(action);
+               }                                               
+       }
+       catch(int) { }
+       catch(synfig::Exception::NotFound) { }
+
+       if(get_edit_mode()&MODE_ANIMATE_FUTURE)try
+       {
+               // Try to find next keyframe
+               Keyframe keyframe(*get_canvas()->keyframe_list().find_next(activepoint.get_time()));
+
+               if(times.count(keyframe.get_time()))
+                       throw int();
+               else
+                       times.insert(keyframe.get_time());                      
+               
+               try { value_node->list[index].find(keyframe.get_time()); }
+               catch(synfig::Exception::NotFound)
+               {
+                       Action::Handle action(ActivepointAdd::create());
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("value_desc",value_desc);
+               
+                       if(!value_node->list[index].timing_info.empty())
+                       {       
+                               action->set_param("time",keyframe.get_time());
+                       }
+                       else
+                       {
+                               synfig::Activepoint tmp;
+                               
+                               tmp.set_state(true);
+                               tmp.set_time(keyframe.get_time());
+                               action->set_param("activepoint",tmp);
+                       }
+
+                       assert(action->is_ready());
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+               
+                       add_action_front(action);
+               }                                               
+       }
+       catch(int) { }
+       catch(synfig::Exception::NotFound) { }
+}
+
+void
+Action::ActivepointSetSmart::prepare()
+{
+       clear();
+       times.clear();
+       
+       // First, we need to to add any activepoints necessary to
+       // maintain the integrity of the keyframes.
+       enclose_activepoint(activepoint);
+       
+       try
+       {
+               if(value_node->list[index].find(activepoint)==value_node->list[index].timing_info.end())
+                       throw int();
+               
+               // Then, lets try to replace the old activepoint, if it exists
+               enclose_activepoint(*value_node->list[index].find(activepoint));
+
+               Action::Handle action(ActivepointSet::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",value_desc);
+               action->set_param("activepoint",activepoint);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               
+               return;
+       }
+       catch(int){}
+       catch(Exception::NotFound){}
+
+       try
+       {
+               // Check to see if a activepoint exists at this point in time
+               activepoint.mimic(*value_node->list[index].find(activepoint.get_time()));
+
+               enclose_activepoint(*value_node->list[index].find(activepoint.get_time()));
+               
+               Action::Handle action(ActivepointSet::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",value_desc);
+               action->set_param("activepoint",activepoint);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               
+               return;
+       }
+       catch(int){}
+       catch(Exception::NotFound){}
+       
+       try
+       {
+               // At this point we know that the old activepoint doesn't exist,
+               // so we need to create it.
+               Action::Handle action(ActivepointAdd::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",value_desc);
+               action->set_param("activepoint",activepoint);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               
+               return;
+       }
+       catch(int){}
+       catch(Exception::NotFound){}
+       
+       throw Error(_("Unable to determine how to procede. This is a bug."));
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointsetsmart.h b/synfig-studio/trunk/src/synfigapp/actions/activepointsetsmart.h
new file mode 100644 (file)
index 0000000..edfa82f
--- /dev/null
@@ -0,0 +1,82 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointsetsmart.h
+**     \brief Template File
+**
+**     $Id: activepointsetsmart.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_ACTIVEPOINTSETSMART_H
+#define __SYNFIG_APP_ACTION_ACTIVEPOINTSETSMART_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/valuenode_dynamiclist.h>
+
+#include <list>
+#include <set>
+
+/* === 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 synfigapp {
+
+namespace Action {
+
+class ActivepointSetSmart :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::ValueNode_DynamicList::Handle value_node;
+       int index;
+       synfig::Activepoint activepoint;
+       bool time_set;
+
+       void calc_activepoint();
+       void enclose_activepoint(const synfig::Activepoint& activepoint);
+
+       std::set<synfig::Time> times;
+
+public:
+
+       ActivepointSetSmart();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointsimpleadd.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointsimpleadd.cpp
new file mode 100644 (file)
index 0000000..62f8cf6
--- /dev/null
@@ -0,0 +1,182 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointsimpleadd.cpp
+**     \brief Simple add activepoint File
+**
+**     $Id: activepointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "activepointsimpleadd.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ActivepointSimpleAdd);
+ACTION_SET_NAME(Action::ActivepointSimpleAdd,"waypoint_simpleadd");
+ACTION_SET_LOCAL_NAME(Action::ActivepointSimpleAdd,"Simply Add Waypoint");
+ACTION_SET_TASK(Action::ActivepointSimpleAdd,"add");
+ACTION_SET_CATEGORY(Action::ActivepointSimpleAdd,Action::CATEGORY_WAYPOINT);
+ACTION_SET_PRIORITY(Action::ActivepointSimpleAdd,0);
+ACTION_SET_VERSION(Action::ActivepointSimpleAdd,"0.0");
+ACTION_SET_CVS_ID(Action::ActivepointSimpleAdd,"$Id: activepointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ActivepointSimpleAdd::ActivepointSimpleAdd()
+{
+       set_dirty(true);
+       activepoint.set_time(Time::begin()-1);
+}
+
+Action::ParamVocab
+Action::ActivepointSimpleAdd::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("Destination ValueNode (Animated)"))
+       );
+
+       ret.push_back(ParamDesc("activepoint",Param::TYPE_ACTIVEPOINT)
+               .set_local_name(_("Activepoint"))
+               .set_desc(_("Activepoint to be added"))
+       );
+
+       return ret;
+}
+
+bool
+Action::ActivepointSimpleAdd::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               return true;
+       }
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::ActivepointSimpleAdd::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+               
+               index=value_desc.get_index();
+               
+               return true;
+       }
+       if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT)
+       {
+               activepoint = param.get_activepoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ActivepointSimpleAdd::is_ready()const
+{
+       if(!value_node && activepoint.get_time() != (Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ActivepointSimpleAdd::perform()
+{      
+       //remove any pretenders that lie at our destination
+       ValueNode_DynamicList::ListEntry::findresult iter = value_node->list[index]
+                                                                                                                       .find_time(activepoint.get_time());
+       
+       time_overwrite = false;
+       if(iter.second)
+       {
+               overwritten_ap = *iter.first;
+               time_overwrite = true;
+               value_node->list[index].erase(overwritten_ap);
+       }
+       
+       //add the value node in since it's safe
+       value_node->list[index].add(activepoint);
+       
+       //sort them...
+       value_node->list[index].timing_info.sort();
+       
+       // Signal that a valuenode has been changed
+       value_node->changed();
+}
+
+void
+Action::ActivepointSimpleAdd::undo()
+{
+       //remove our old version...
+       ValueNode_DynamicList::ListEntry::findresult iter = value_node->list[index].find_uid(activepoint);
+       
+       if(!iter.second)
+       {
+               throw Error(_("The activepoint to remove no longer exists"));
+       }
+       
+       //remove the offending value
+       value_node->list[index].erase(*iter.first); //could also just use waypoint
+       
+       if(time_overwrite)
+       {
+               value_node->list[index].add(overwritten_ap);                            
+       }
+       
+       //sort them...
+       value_node->list[index].timing_info.sort();
+       
+       // Signal that a valuenode has been changed
+       value_node->changed();
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointsimpleadd.h b/synfig-studio/trunk/src/synfigapp/actions/activepointsimpleadd.h
new file mode 100644 (file)
index 0000000..32786b7
--- /dev/null
@@ -0,0 +1,80 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file activepointsimpleadd.h
+**     \brief A simple add a activepoint function Header
+**
+**     $Id: activepointsimpleadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_ACTIVEPOINTSIMPLEADD_H
+#define __SYNFIG_ACTIVEPOINTSIMPLEADD_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ActivepointSimpleAdd :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+       
+       synfig::ValueNode_DynamicList::Handle value_node;
+       int     index;
+       
+       synfig::Activepoint activepoint;
+
+       bool time_overwrite;
+       synfig::Activepoint overwritten_ap;
+
+public:
+
+       ActivepointSimpleAdd();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentmerge.cpp b/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentmerge.cpp
new file mode 100644 (file)
index 0000000..1860aaa
--- /dev/null
@@ -0,0 +1,179 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file blinepointtangentmerge.cpp
+**     \brief Template File
+**
+**     $Id: blinepointtangentmerge.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "blinepointtangentmerge.h"
+#include "valuedescset.h"
+
+#include "activepointset.h"
+#include "activepointadd.h"
+
+#include "valuedescconnect.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::BLinePointTangentMerge);
+ACTION_SET_NAME(Action::BLinePointTangentMerge,"bline_point_tangent_merge");
+ACTION_SET_LOCAL_NAME(Action::BLinePointTangentMerge,_("Merge Tangents"));
+ACTION_SET_TASK(Action::BLinePointTangentMerge,"merge");
+ACTION_SET_CATEGORY(Action::BLinePointTangentMerge,Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::BLinePointTangentMerge,0);
+ACTION_SET_VERSION(Action::BLinePointTangentMerge,"0.0");
+ACTION_SET_CVS_ID(Action::BLinePointTangentMerge,"$Id: blinepointtangentmerge.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::BLinePointTangentMerge::BLinePointTangentMerge()
+{
+       time=(Time::begin()-1);
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::BLinePointTangentMerge::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode of BLinePoint"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::BLinePointTangentMerge::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueNode_Composite::Handle value_node;
+               value_node=ValueNode_Composite::Handle::cast_dynamic(x.find("value_node")->second.get_value_node());
+               if(!value_node || value_node->get_type()!=ValueBase::TYPE_BLINEPOINT)
+                       return false;
+               synfig::Time time(x.find("time")->second.get_time());
+               if((*value_node->get_link("split"))(time).get(bool())==false)
+                       return false;
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::BLinePointTangentMerge::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=value_node.cast_dynamic(param.get_value_node());
+               
+               return (bool)(value_node);
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::BLinePointTangentMerge::is_ready()const
+{
+       if(!value_node)
+               synfig::error("Missing or bad value_node");
+
+       if(time==(Time::begin()-1))
+               synfig::error("Missing time");
+       
+       if(!value_node || time==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::BLinePointTangentMerge::prepare()
+{
+       clear();
+
+       Action::Handle action;
+       
+       {
+               action=Action::create("value_desc_set");
+               if(!action)
+                       throw Error(_("Couldn't find action \"value_desc_set\""));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",ValueDesc(value_node,3));
+               action->set_param("time",time);
+               action->set_param("new_value",synfig::ValueBase(false));
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+       }
+       {
+               action=Action::create("value_desc_set");
+               if(!action)
+                       throw Error(_("Couldn't find action \"value_desc_set\""));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",ValueDesc(value_node,5));
+               action->set_param("time",time);
+               action->set_param("new_value",(*value_node->get_link("t1"))(time));
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+       }
+       
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentmerge.h b/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentmerge.h
new file mode 100644 (file)
index 0000000..2a1d516
--- /dev/null
@@ -0,0 +1,72 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file blinepointtangentmerge.h
+**     \brief Template File
+**
+**     $Id: blinepointtangentmerge.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_BLINEPOINTTANGENTMERGE_H
+#define __SYNFIG_APP_ACTION_BLINEPOINTTANGENTMERGE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/blinepoint.h>
+#include <synfig/valuenode_composite.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 synfigapp {
+
+namespace Action {
+
+class BLinePointTangentMerge :
+       public Super
+{
+private:
+
+       synfig::ValueNode_Composite::Handle value_node;
+       synfig::Time time;
+
+public:
+
+       BLinePointTangentMerge();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.cpp b/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.cpp
new file mode 100644 (file)
index 0000000..8a30cd5
--- /dev/null
@@ -0,0 +1,179 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file blinepointtangentsplit.cpp
+**     \brief Template File
+**
+**     $Id: blinepointtangentsplit.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "blinepointtangentsplit.h"
+#include "valuedescset.h"
+
+#include "activepointset.h"
+#include "activepointadd.h"
+
+#include "valuedescconnect.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::BLinePointTangentSplit);
+ACTION_SET_NAME(Action::BLinePointTangentSplit,"bline_point_tangent_split");
+ACTION_SET_LOCAL_NAME(Action::BLinePointTangentSplit,_("Split Tangents"));
+ACTION_SET_TASK(Action::BLinePointTangentSplit,"split");
+ACTION_SET_CATEGORY(Action::BLinePointTangentSplit,Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::BLinePointTangentSplit,0);
+ACTION_SET_VERSION(Action::BLinePointTangentSplit,"0.0");
+ACTION_SET_CVS_ID(Action::BLinePointTangentSplit,"$Id: blinepointtangentsplit.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::BLinePointTangentSplit::BLinePointTangentSplit()
+{
+       time=(Time::begin()-1);
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::BLinePointTangentSplit::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode of BLinePoint"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::BLinePointTangentSplit::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueNode_Composite::Handle value_node;
+               value_node=ValueNode_Composite::Handle::cast_dynamic(x.find("value_node")->second.get_value_node());
+               if(!value_node || value_node->get_type()!=ValueBase::TYPE_BLINEPOINT)
+                       return false;
+               synfig::Time time(x.find("time")->second.get_time());
+               if((*value_node->get_link("split"))(time).get(bool())==true)
+                       return false;
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::BLinePointTangentSplit::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=value_node.cast_dynamic(param.get_value_node());
+               
+               return (bool)(value_node);
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::BLinePointTangentSplit::is_ready()const
+{
+       if(!value_node)
+               synfig::error("Missing or bad value_node");
+
+       if(time==(Time::begin()-1))
+               synfig::error("Missing time");
+       
+       if(!value_node || time==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::BLinePointTangentSplit::prepare()
+{
+       clear();
+
+       Action::Handle action;
+       
+       {
+               action=Action::create("value_desc_set");
+               if(!action)
+                       throw Error(_("Couldn't find action \"value_desc_set\""));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",ValueDesc(value_node,3));
+               action->set_param("time",time);
+               action->set_param("new_value",synfig::ValueBase(true));
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+       }
+       {
+               action=Action::create("value_desc_set");
+               if(!action)
+                       throw Error(_("Couldn't find action \"value_desc_set\""));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",ValueDesc(value_node,5));
+               action->set_param("time",time);
+               action->set_param("new_value",(*value_node->get_link("t1"))(time));
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+       }
+       
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.h b/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.h
new file mode 100644 (file)
index 0000000..e63d83c
--- /dev/null
@@ -0,0 +1,72 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file blinepointtangentsplit.h
+**     \brief Template File
+**
+**     $Id: blinepointtangentsplit.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_BLINEPOINTTANGENTSPLIT_H
+#define __SYNFIG_APP_ACTION_BLINEPOINTTANGENTSPLIT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/blinepoint.h>
+#include <synfig/valuenode_composite.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 synfigapp {
+
+namespace Action {
+
+class BLinePointTangentSplit :
+       public Super
+{
+private:
+
+       synfig::ValueNode_Composite::Handle value_node;
+       synfig::Time time;
+
+public:
+
+       BLinePointTangentSplit();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/canvasadd.cpp b/synfig-studio/trunk/src/synfigapp/actions/canvasadd.cpp
new file mode 100644 (file)
index 0000000..be986b3
--- /dev/null
@@ -0,0 +1,150 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file canvasadd.cpp
+**     \brief Template File
+**
+**     $Id: canvasadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "canvasadd.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::CanvasAdd);
+ACTION_SET_NAME(Action::CanvasAdd,"canvas_add");
+ACTION_SET_LOCAL_NAME(Action::CanvasAdd,"Add Child Canvas");
+ACTION_SET_TASK(Action::CanvasAdd,"add");
+ACTION_SET_CATEGORY(Action::CanvasAdd,Action::CATEGORY_CANVAS);
+ACTION_SET_PRIORITY(Action::CanvasAdd,0);
+ACTION_SET_VERSION(Action::CanvasAdd,"0.0");
+ACTION_SET_CVS_ID(Action::CanvasAdd,"$Id: canvasadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::CanvasAdd::CanvasAdd()
+{
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::CanvasAdd::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("src",Param::TYPE_CANVAS)
+               .set_local_name(_("New Canvas"))
+               .set_optional()
+       );
+
+       ret.push_back(ParamDesc("id",Param::TYPE_STRING)
+               .set_local_name(_("ID"))
+               .set_desc(_("The name that you want this canvas to be"))
+               .set_user_supplied()
+       );
+       
+       return ret;
+}
+
+bool
+Action::CanvasAdd::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::CanvasAdd::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="src" && param.get_type()==Param::TYPE_CANVAS)
+       {
+               new_canvas=param.get_canvas();
+               
+               return true;
+       }
+       if(name=="id" && param.get_type()==Param::TYPE_STRING)
+       {
+               id=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::CanvasAdd::is_ready()const
+{
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::CanvasAdd::perform()
+{
+       if(!new_canvas)
+       {
+               new_canvas=get_canvas()->new_child_canvas(id);
+       }
+       else
+       {
+               if(new_canvas->is_inline())
+               {
+                       inline_parent=new_canvas->parent();
+               }
+               get_canvas()->add_child_canvas(new_canvas,id);
+       }
+
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_canvas_added()(new_canvas);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::CanvasAdd::undo()
+{
+       get_canvas()->remove_child_canvas(new_canvas);
+
+       if(inline_parent)
+               new_canvas->set_inline(inline_parent);          
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_canvas_removed()(new_canvas);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/canvasadd.h b/synfig-studio/trunk/src/synfigapp/actions/canvasadd.h
new file mode 100644 (file)
index 0000000..5f575b3
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file canvasadd.h
+**     \brief Template File
+**
+**     $Id: canvasadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_CANVASADD_H
+#define __SYNFIG_APP_ACTION_CANVASADD_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/renddesc.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class CanvasAdd :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Canvas::Handle new_canvas;
+       synfig::String id;
+
+       synfig::Canvas::Handle inline_parent;
+
+public:
+
+       CanvasAdd();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/canvasremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/canvasremove.cpp
new file mode 100644 (file)
index 0000000..70ebdb4
--- /dev/null
@@ -0,0 +1,133 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file canvasremove.cpp
+**     \brief Template File
+**
+**     $Id: canvasremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "canvasremove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::CanvasRemove);
+ACTION_SET_NAME(Action::CanvasRemove,"canvas_remove");
+ACTION_SET_LOCAL_NAME(Action::CanvasRemove,"Remove Canvas");
+ACTION_SET_TASK(Action::CanvasRemove,"remove");
+ACTION_SET_CATEGORY(Action::CanvasRemove,Action::CATEGORY_CANVAS);
+ACTION_SET_PRIORITY(Action::CanvasRemove,0);
+ACTION_SET_VERSION(Action::CanvasRemove,"0.0");
+ACTION_SET_CVS_ID(Action::CanvasRemove,"$Id: canvasremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::CanvasRemove::CanvasRemove()
+{
+}
+
+Action::ParamVocab
+Action::CanvasRemove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       return ret;
+}
+
+bool
+Action::CanvasRemove::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               Canvas::Handle canvas=x.find("canvas")->second.get_canvas();
+               assert(canvas);
+               // We cannot remove the root canvas.
+               if(canvas->is_root())
+                       return false;
+               
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::CanvasRemove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::CanvasRemove::is_ready()const
+{
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::CanvasRemove::perform()
+{
+       // We cannot remove the root canvas.
+       if(get_canvas()->is_root())
+               throw Error(_("You cannot remove the root canvas!"));
+
+       if(get_canvas()->is_inline())
+               throw Error(_("You cannot remove an inline canvas!"));
+       
+       parent_canvas=get_canvas()->parent();
+       canvas_id=get_canvas()->get_id();
+       
+       assert(parent_canvas);
+       
+       parent_canvas->remove_child_canvas(get_canvas());
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_canvas_removed()(get_canvas());
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::CanvasRemove::undo()
+{
+       parent_canvas->add_child_canvas(get_canvas(), canvas_id);
+
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_canvas_added()(get_canvas());
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/canvasremove.h b/synfig-studio/trunk/src/synfigapp/actions/canvasremove.h
new file mode 100644 (file)
index 0000000..1e25690
--- /dev/null
@@ -0,0 +1,72 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file canvasremove.h
+**     \brief Template File
+**
+**     $Id: canvasremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_CANVASREMOVE_H
+#define __SYNFIG_APP_ACTION_CANVASREMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/renddesc.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class CanvasRemove :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+       synfig::Canvas::Handle parent_canvas;
+       synfig::String  canvas_id;
+public:
+
+       CanvasRemove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/canvasrenddescset.cpp b/synfig-studio/trunk/src/synfigapp/actions/canvasrenddescset.cpp
new file mode 100644 (file)
index 0000000..222562d
--- /dev/null
@@ -0,0 +1,125 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file canvasrenddescset.cpp
+**     \brief Template File
+**
+**     $Id: canvasrenddescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "canvasrenddescset.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::CanvasRendDescSet);
+ACTION_SET_NAME(Action::CanvasRendDescSet,"canvas_rend_desc_set");
+ACTION_SET_LOCAL_NAME(Action::CanvasRendDescSet,"Set Canvas RendDesc");
+ACTION_SET_TASK(Action::CanvasRendDescSet,"set");
+ACTION_SET_CATEGORY(Action::CanvasRendDescSet,Action::CATEGORY_CANVAS);
+ACTION_SET_PRIORITY(Action::CanvasRendDescSet,0);
+ACTION_SET_VERSION(Action::CanvasRendDescSet,"0.0");
+ACTION_SET_CVS_ID(Action::CanvasRendDescSet,"$Id: canvasrenddescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::CanvasRendDescSet::CanvasRendDescSet()
+{
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::CanvasRendDescSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("rend_desc",Param::TYPE_RENDDESC)
+               .set_local_name(_("RendDesc"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::CanvasRendDescSet::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::CanvasRendDescSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="rend_desc" && param.get_type()==Param::TYPE_RENDDESC)
+       {
+               new_rend_desc=param.get_rend_desc();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::CanvasRendDescSet::is_ready()const
+{
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::CanvasRendDescSet::perform()
+{
+       old_rend_desc=get_canvas()->rend_desc();
+
+       get_canvas()->rend_desc()=new_rend_desc;
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_rend_desc_changed()();
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::CanvasRendDescSet::undo()
+{
+       get_canvas()->rend_desc()=old_rend_desc;
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_rend_desc_changed()();
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/canvasrenddescset.h b/synfig-studio/trunk/src/synfigapp/actions/canvasrenddescset.h
new file mode 100644 (file)
index 0000000..b378584
--- /dev/null
@@ -0,0 +1,74 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file canvasrenddescset.h
+**     \brief Template File
+**
+**     $Id: canvasrenddescset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_CANVASRENDDESCSET_H
+#define __SYNFIG_APP_ACTION_CANVASRENDDESCSET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/renddesc.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class CanvasRendDescSet :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::RendDesc new_rend_desc;
+       synfig::RendDesc old_rend_desc;
+
+public:
+
+       CanvasRendDescSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/colorset.cpp b/synfig-studio/trunk/src/synfigapp/actions/colorset.cpp
new file mode 100644 (file)
index 0000000..b2dff02
--- /dev/null
@@ -0,0 +1,145 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file colorset.cpp
+**     \brief Template File
+**
+**     $Id: colorset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerparamset.h"
+#include "valuenodeconstset.h"
+#include "valuedescconnect.h"
+#include "waypointsetsmart.h"
+
+#include "colorset.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/main.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ColorSet);
+ACTION_SET_NAME(Action::ColorSet,"color_set");
+ACTION_SET_LOCAL_NAME(Action::ColorSet,"Apply Default Color");
+ACTION_SET_TASK(Action::ColorSet,"set");
+ACTION_SET_CATEGORY(Action::ColorSet,Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ColorSet,0);
+ACTION_SET_VERSION(Action::ColorSet,"0.0");
+ACTION_SET_CVS_ID(Action::ColorSet,"$Id: colorset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ColorSet::ColorSet():
+       time(0)
+{
+}
+
+Action::ParamVocab
+Action::ColorSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ColorSet::is_canidate(const ParamList &x)
+{
+       if(!canidate_check(get_param_vocab(),x))
+               return false;
+       return x.find("value_desc")->second.get_value_desc().get_value_type()==ValueBase::TYPE_COLOR;
+}
+
+bool
+Action::ColorSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               // Grab the value_desc
+               value_desc=param.get_value_desc();
+               
+               // Grab the current color
+               color=synfigapp::Main::get_foreground_color();
+               
+               return value_desc.get_value_type()==ValueBase::TYPE_COLOR;
+       }
+
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ColorSet::is_ready()const
+{
+       if(!value_desc || value_desc.get_value_type()!=ValueBase::TYPE_COLOR)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ColorSet::prepare()
+{
+       clear();
+       
+       Action::Handle action;
+       action=Action::create("value_desc_set");
+               
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",get_canvas_interface());
+       action->set_param("value_desc",value_desc);
+       action->set_param("new_value",ValueBase(color));
+       action->set_param("time",time);
+       
+       if(!action->is_ready())
+               throw Error(Error::TYPE_NOTREADY);
+
+       add_action_front(action);
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/colorset.h b/synfig-studio/trunk/src/synfigapp/actions/colorset.h
new file mode 100644 (file)
index 0000000..cac69e2
--- /dev/null
@@ -0,0 +1,72 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file colorset.h
+**     \brief Template File
+**
+**     $Id: colorset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_COLORSET_H
+#define __SYNFIG_APP_ACTION_COLORSET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.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 synfigapp {
+
+namespace Action {
+
+class ColorSet :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::Color color;
+       synfig::Time time;
+
+public:
+
+       ColorSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/editmodeset.cpp b/synfig-studio/trunk/src/synfigapp/actions/editmodeset.cpp
new file mode 100644 (file)
index 0000000..3f20347
--- /dev/null
@@ -0,0 +1,128 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file editmodeset.cpp
+**     \brief Template File
+**
+**     $Id: editmodeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "editmodeset.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::EditModeSet);
+ACTION_SET_NAME(Action::EditModeSet,"edit_mode_set");
+ACTION_SET_LOCAL_NAME(Action::EditModeSet,"Set Edit Mode");
+ACTION_SET_TASK(Action::EditModeSet,"set");
+ACTION_SET_CATEGORY(Action::EditModeSet,Action::CATEGORY_OTHER);
+ACTION_SET_PRIORITY(Action::EditModeSet,0);
+ACTION_SET_VERSION(Action::EditModeSet,"0.0");
+ACTION_SET_CVS_ID(Action::EditModeSet,"$Id: editmodeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::EditModeSet::EditModeSet()
+{
+}
+
+Action::ParamVocab
+Action::EditModeSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("edit_mode",Param::TYPE_EDITMODE)
+               .set_local_name(_("New Edit Mode"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::EditModeSet::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::EditModeSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+/*
+       if(name=="edit_mode" && param.get_type()==Param::TYPE_EDITMODE)
+       {
+               set_edit_mode(param.get_edit_mode());
+               
+               return true;
+       }
+*/
+       
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::EditModeSet::is_ready()const
+{
+       return Action::CanvasSpecific::is_ready() && get_canvas_interface();
+}
+
+void
+Action::EditModeSet::perform()
+{
+       set_dirty(false);
+
+       old_edit_mode=get_canvas_interface()->get_mode();
+
+       if(old_edit_mode==get_edit_mode())
+               return;
+
+       get_canvas_interface()->mode_=get_edit_mode();
+               
+       get_canvas_interface()->signal_mode_changed_(get_edit_mode());
+}
+
+void
+Action::EditModeSet::undo()
+{
+       set_dirty(false);
+
+       if(old_edit_mode==get_edit_mode())
+               return;
+
+       get_canvas_interface()->mode_=old_edit_mode;
+               
+       get_canvas_interface()->signal_mode_changed_(old_edit_mode);
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/editmodeset.h b/synfig-studio/trunk/src/synfigapp/actions/editmodeset.h
new file mode 100644 (file)
index 0000000..226e40a
--- /dev/null
@@ -0,0 +1,71 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file editmodeset.h
+**     \brief Template File
+**
+**     $Id: editmodeset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_EDITMODESET_H
+#define __SYNFIG_APP_ACTION_EDITMODESET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.h>
+#include <synfigapp/editmode.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class EditModeSet :
+       public Undoable,
+       public CanvasSpecific
+{
+       EditMode old_edit_mode;
+public:
+
+       EditModeSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/gradientset.cpp b/synfig-studio/trunk/src/synfigapp/actions/gradientset.cpp
new file mode 100644 (file)
index 0000000..d69b71d
--- /dev/null
@@ -0,0 +1,145 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file gradientset.cpp
+**     \brief Template File
+**
+**     $Id: gradientset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerparamset.h"
+#include "valuenodeconstset.h"
+#include "valuedescconnect.h"
+#include "waypointsetsmart.h"
+
+#include "gradientset.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/main.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::GradientSet);
+ACTION_SET_NAME(Action::GradientSet,"gradient_set");
+ACTION_SET_LOCAL_NAME(Action::GradientSet,"Apply Default Gradient");
+ACTION_SET_TASK(Action::GradientSet,"set");
+ACTION_SET_CATEGORY(Action::GradientSet,Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::GradientSet,0);
+ACTION_SET_VERSION(Action::GradientSet,"0.0");
+ACTION_SET_CVS_ID(Action::GradientSet,"$Id: gradientset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::GradientSet::GradientSet():
+       time(0)
+{
+}
+
+Action::ParamVocab
+Action::GradientSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::GradientSet::is_canidate(const ParamList &x)
+{
+       if(!canidate_check(get_param_vocab(),x))
+               return false;
+       return x.find("value_desc")->second.get_value_desc().get_value_type()==ValueBase::TYPE_GRADIENT;
+}
+
+bool
+Action::GradientSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               // Grab the value_desc
+               value_desc=param.get_value_desc();
+               
+               // Grab the current gradient
+               gradient=synfigapp::Main::get_gradient();
+               
+               return value_desc.get_value_type()==ValueBase::TYPE_GRADIENT;
+       }
+
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::GradientSet::is_ready()const
+{
+       if(!value_desc || value_desc.get_value_type()!=ValueBase::TYPE_GRADIENT)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::GradientSet::prepare()
+{
+       clear();
+       
+       Action::Handle action;
+       action=Action::create("value_desc_set");
+               
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",get_canvas_interface());
+       action->set_param("value_desc",value_desc);
+       action->set_param("new_value",ValueBase(gradient));
+       action->set_param("time",time);
+       
+       if(!action->is_ready())
+               throw Error(Error::TYPE_NOTREADY);
+
+       add_action_front(action);
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/gradientset.h b/synfig-studio/trunk/src/synfigapp/actions/gradientset.h
new file mode 100644 (file)
index 0000000..de256f7
--- /dev/null
@@ -0,0 +1,73 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file gradientset.h
+**     \brief Template File
+**
+**     $Id: gradientset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_GRADIENTSET_H
+#define __SYNFIG_APP_ACTION_GRADIENTSET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.h>
+#include <list>
+#include <synfig/gradient.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 synfigapp {
+
+namespace Action {
+
+class GradientSet :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::Gradient gradient;
+       synfig::Time time;
+
+public:
+
+       GradientSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/groupaddlayers.cpp b/synfig-studio/trunk/src/synfigapp/actions/groupaddlayers.cpp
new file mode 100644 (file)
index 0000000..872d2ca
--- /dev/null
@@ -0,0 +1,144 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_layerremove.cpp
+**     \brief Template File
+**
+**     $Id: groupaddlayers.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "groupaddlayers.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::GroupAddLayers);
+ACTION_SET_NAME(Action::GroupAddLayers,"group_add_layers");
+ACTION_SET_LOCAL_NAME(Action::GroupAddLayers,"Add Layers to Group");
+ACTION_SET_TASK(Action::GroupAddLayers,"add");
+ACTION_SET_CATEGORY(Action::GroupAddLayers,Action::CATEGORY_LAYER|Action::CATEGORY_GROUP);
+ACTION_SET_PRIORITY(Action::GroupAddLayers,0);
+ACTION_SET_VERSION(Action::GroupAddLayers,"0.0");
+ACTION_SET_CVS_ID(Action::GroupAddLayers,"$Id: groupaddlayers.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::GroupAddLayers::GroupAddLayers()
+{
+}
+
+Action::ParamVocab
+Action::GroupAddLayers::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be added to group"))
+               .set_supports_multiple()
+       );
+
+       ret.push_back(ParamDesc("group",Param::TYPE_STRING)
+               .set_local_name(_("Group"))
+               .set_desc(_("Name of the Group to add the Layers to"))
+               .set_user_supplied()
+       );
+       
+       return ret;
+}
+
+bool
+Action::GroupAddLayers::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::GroupAddLayers::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               std::pair<synfig::Layer::Handle,String> layer_pair;
+               layer_pair.first=param.get_layer();
+               layer_list.push_back(layer_pair);
+               
+               return true;
+       }
+
+       if(name=="group" && param.get_type()==Param::TYPE_STRING)
+       {
+               group=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::GroupAddLayers::is_ready()const
+{
+       if(layer_list.empty() || group.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::GroupAddLayers::perform()
+{
+       std::list<std::pair<synfig::Layer::Handle,String> >::iterator iter;
+       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
+       {
+               Layer::Handle layer(iter->first);
+               iter->second=layer->get_group();
+               
+               layer->add_to_group(group);
+       }
+}
+
+void
+Action::GroupAddLayers::undo()
+{
+       std::list<std::pair<synfig::Layer::Handle,String> >::iterator iter;
+       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
+       {
+               Layer::Handle layer(iter->first);
+               
+               layer->remove_from_group(group);
+               
+               layer->add_to_group(iter->second);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/groupaddlayers.h b/synfig-studio/trunk/src/synfigapp/actions/groupaddlayers.h
new file mode 100644 (file)
index 0000000..d1b34a1
--- /dev/null
@@ -0,0 +1,78 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_groupaddlayers.h
+**     \brief Template File
+**
+**     $Id: groupaddlayers.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_GROUPADDLAYERS_H
+#define __SYNFIG_APP_ACTION_GROUPADDLAYERS_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class GroupAddLayers :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       // List contains the layers and their previous groups
+       std::list<std::pair<synfig::Layer::Handle,synfig::String> > layer_list;
+       
+       // The name of the new group
+       synfig::String group;
+
+public:
+
+       GroupAddLayers();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/groupremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/groupremove.cpp
new file mode 100644 (file)
index 0000000..53245f0
--- /dev/null
@@ -0,0 +1,133 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_layerremove.cpp
+**     \brief Template File
+**
+**     $Id: groupremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "groupremove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::GroupRemove);
+ACTION_SET_NAME(Action::GroupRemove,"group_remove");
+ACTION_SET_LOCAL_NAME(Action::GroupRemove,"Remove Group");
+ACTION_SET_TASK(Action::GroupRemove,"remove");
+ACTION_SET_CATEGORY(Action::GroupRemove,Action::CATEGORY_GROUP);
+ACTION_SET_PRIORITY(Action::GroupRemove,0);
+ACTION_SET_VERSION(Action::GroupRemove,"0.0");
+ACTION_SET_CVS_ID(Action::GroupRemove,"$Id: groupremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::GroupRemove::GroupRemove()
+{
+}
+
+Action::ParamVocab
+Action::GroupRemove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("group",Param::TYPE_STRING)
+               .set_local_name(_("Group"))
+               .set_desc(_("Name of the Group to remove"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::GroupRemove::is_canidate(const ParamList &x)
+{
+       bool ret(canidate_check(get_param_vocab(),x));
+       if(!ret)
+       {
+               synfig::info("Action::GroupRemove::is_canidate(): failed canidate check");
+               ParamList::const_iterator iter;
+               for(iter=x.begin();iter!=x.end();++iter)
+               {
+                       synfig::info("PARAM: %s",iter->first.c_str());
+               }
+       }
+       return ret;
+}
+
+bool
+Action::GroupRemove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="group" && param.get_type()==Param::TYPE_STRING)
+       {
+               group=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::GroupRemove::is_ready()const
+{
+       if(group.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::GroupRemove::perform()
+{
+       layer_list=get_canvas()->get_layers_in_group(group);
+       
+       std::set<synfig::Layer::Handle>::iterator iter;
+       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
+       {
+               (*iter)->remove_from_group(group);
+       }
+}
+
+void
+Action::GroupRemove::undo()
+{
+       std::set<synfig::Layer::Handle>::iterator iter;
+       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
+       {
+               (*iter)->add_to_group(group);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/groupremove.h b/synfig-studio/trunk/src/synfigapp/actions/groupremove.h
new file mode 100644 (file)
index 0000000..45de616
--- /dev/null
@@ -0,0 +1,78 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_groupaddlayers.h
+**     \brief Template File
+**
+**     $Id: groupremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_GROUPREMOVE_H
+#define __SYNFIG_APP_ACTION_GROUPREMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.h>
+#include <set>
+
+/* === 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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class GroupRemove :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       // List contains the layers
+       std::set<synfig::Layer::Handle> layer_list;
+       
+       // The name of the group to remove
+       synfig::String group;
+
+public:
+
+       GroupRemove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/groupremovelayers.cpp b/synfig-studio/trunk/src/synfigapp/actions/groupremovelayers.cpp
new file mode 100644 (file)
index 0000000..036a9d6
--- /dev/null
@@ -0,0 +1,142 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_layerremove.cpp
+**     \brief Template File
+**
+**     $Id: groupremovelayers.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "groupremovelayers.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::GroupRemoveLayers);
+ACTION_SET_NAME(Action::GroupRemoveLayers,"group_remove_layers");
+ACTION_SET_LOCAL_NAME(Action::GroupRemoveLayers,"Remove Layers from a Group");
+ACTION_SET_TASK(Action::GroupRemoveLayers,"remove");
+ACTION_SET_CATEGORY(Action::GroupRemoveLayers,Action::CATEGORY_LAYER|Action::CATEGORY_GROUP);
+ACTION_SET_PRIORITY(Action::GroupRemoveLayers,0);
+ACTION_SET_VERSION(Action::GroupRemoveLayers,"0.0");
+ACTION_SET_CVS_ID(Action::GroupRemoveLayers,"$Id: groupremovelayers.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::GroupRemoveLayers::GroupRemoveLayers()
+{
+}
+
+Action::ParamVocab
+Action::GroupRemoveLayers::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be added to group"))
+               .set_supports_multiple()
+       );
+
+       ret.push_back(ParamDesc("group",Param::TYPE_STRING)
+               .set_local_name(_("Group"))
+               .set_desc(_("Name of the Group to add the Layers to"))
+               .set_user_supplied()
+       );
+       
+       return ret;
+}
+
+bool
+Action::GroupRemoveLayers::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::GroupRemoveLayers::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               std::pair<synfig::Layer::Handle,String> layer_pair;
+               layer_pair.first=param.get_layer();
+               layer_list.push_back(layer_pair);
+               
+               return true;
+       }
+
+       if(name=="group" && param.get_type()==Param::TYPE_STRING)
+       {
+               group=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::GroupRemoveLayers::is_ready()const
+{
+       if(layer_list.empty() || group.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::GroupRemoveLayers::perform()
+{
+       std::list<std::pair<synfig::Layer::Handle,String> >::iterator iter;
+       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
+       {
+               Layer::Handle layer(iter->first);
+               iter->second=layer->get_group();
+               
+               layer->remove_from_group(group);
+       }
+}
+
+void
+Action::GroupRemoveLayers::undo()
+{
+       std::list<std::pair<synfig::Layer::Handle,String> >::iterator iter;
+       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
+       {
+               Layer::Handle layer(iter->first);
+               
+               layer->add_to_group(iter->second);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/groupremovelayers.h b/synfig-studio/trunk/src/synfigapp/actions/groupremovelayers.h
new file mode 100644 (file)
index 0000000..3a70509
--- /dev/null
@@ -0,0 +1,78 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_groupremovelayers.h
+**     \brief Template File
+**
+**     $Id: groupremovelayers.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_GROUPREMOVELAYERS_H
+#define __SYNFIG_APP_ACTION_GROUPREMOVELAYERS_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class GroupRemoveLayers :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       // List contains the layers and their previous groups
+       std::list<std::pair<synfig::Layer::Handle,synfig::String> > layer_list;
+       
+       // The name of the new group
+       synfig::String group;
+
+public:
+
+       GroupRemoveLayers();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/grouprename.cpp b/synfig-studio/trunk/src/synfigapp/actions/grouprename.cpp
new file mode 100644 (file)
index 0000000..5c9a805
--- /dev/null
@@ -0,0 +1,129 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_layerremove.cpp
+**     \brief Template File
+**
+**     $Id: grouprename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "grouprename.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::GroupRename);
+ACTION_SET_NAME(Action::GroupRename,"group_rename");
+ACTION_SET_LOCAL_NAME(Action::GroupRename,"Rename Group");
+ACTION_SET_TASK(Action::GroupRename,"rename");
+ACTION_SET_CATEGORY(Action::GroupRename,Action::CATEGORY_GROUP);
+ACTION_SET_PRIORITY(Action::GroupRename,0);
+ACTION_SET_VERSION(Action::GroupRename,"0.0");
+ACTION_SET_CVS_ID(Action::GroupRename,"$Id: grouprename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::GroupRename::GroupRename()
+{
+}
+
+Action::ParamVocab
+Action::GroupRename::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("group",Param::TYPE_STRING)
+               .set_local_name(_("Old Group"))
+               .set_desc(_("Name of the Group to rename"))
+       );
+
+       ret.push_back(ParamDesc("new_group",Param::TYPE_STRING)
+               .set_local_name(_("New Group"))
+               .set_desc(_("New name for group"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::GroupRename::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::GroupRename::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="group" && param.get_type()==Param::TYPE_STRING)
+       {
+               old_group_name=param.get_string();
+               
+               return true;
+       }
+
+       if(name=="new_group" && param.get_type()==Param::TYPE_STRING)
+       {
+               new_group_name=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::GroupRename::is_ready()const
+{
+       if(old_group_name.empty()||new_group_name.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::GroupRename::perform()
+{
+       if(get_canvas()->get_groups().count(new_group_name)!=0)
+       {
+               throw Error(_("A group with the name \"%s\" already exists!"),new_group_name.c_str());
+       }
+       get_canvas()->rename_group(old_group_name,new_group_name);
+}
+
+void
+Action::GroupRename::undo()
+{
+       get_canvas()->rename_group(new_group_name,old_group_name);
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/grouprename.h b/synfig-studio/trunk/src/synfigapp/actions/grouprename.h
new file mode 100644 (file)
index 0000000..4400ab5
--- /dev/null
@@ -0,0 +1,80 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_grouprename.h
+**     \brief Template File
+**
+**     $Id: grouprename.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_GROUPRENAME_H
+#define __SYNFIG_APP_ACTION_GROUPRENAME_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.h>
+#include <set>
+
+/* === 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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class GroupRename :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       // List contains the layers
+       std::set<synfig::Layer::Handle> layer_list;
+       
+       // The name of the group to remove
+       synfig::String old_group_name;
+
+       synfig::String new_group_name;
+
+public:
+
+       GroupRename();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeadd.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframeadd.cpp
new file mode 100644 (file)
index 0000000..4ec09b6
--- /dev/null
@@ -0,0 +1,136 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeadd.cpp
+**     \brief Template File
+**
+**     $Id: keyframeadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "keyframeadd.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::KeyframeAdd);
+ACTION_SET_NAME(Action::KeyframeAdd,"keyframe_add");
+ACTION_SET_LOCAL_NAME(Action::KeyframeAdd,"Add Keyframe");
+ACTION_SET_TASK(Action::KeyframeAdd,"add");
+ACTION_SET_CATEGORY(Action::KeyframeAdd,Action::CATEGORY_KEYFRAME);
+ACTION_SET_PRIORITY(Action::KeyframeAdd,0);
+ACTION_SET_VERSION(Action::KeyframeAdd,"0.0");
+ACTION_SET_CVS_ID(Action::KeyframeAdd,"$Id: keyframeadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::KeyframeAdd::KeyframeAdd()
+{
+       keyframe.set_time(Time::begin()-1);
+       set_dirty(false);
+}
+
+Action::ParamVocab
+Action::KeyframeAdd::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
+               .set_local_name(_("New Keyframe"))
+               .set_desc(_("Keyframe to be added"))
+       );
+
+       return ret;
+}
+
+bool
+Action::KeyframeAdd::is_canidate(const ParamList &x)
+{
+       if(!canidate_check(get_param_vocab(),x))
+               return false;
+       
+       return true;
+}
+
+bool
+Action::KeyframeAdd::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
+       {
+               keyframe=param.get_keyframe();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::KeyframeAdd::is_ready()const
+{
+       if(keyframe.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::KeyframeAdd::perform()
+{      
+       try { get_canvas()->keyframe_list().find(keyframe.get_time()); throw Error(_("A Keyframe already exists at this point in time"));}
+       catch(synfig::Exception::NotFound) { }  
+
+       try { get_canvas()->keyframe_list().find(keyframe); throw Error(_("This keyframe is already in the ValueNode"));}
+       catch(synfig::Exception::NotFound) { }  
+       
+       get_canvas()->keyframe_list().add(keyframe);
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_added()(keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::KeyframeAdd::undo()
+{
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_removed()(keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+
+       get_canvas()->keyframe_list().erase(keyframe);  
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeadd.h b/synfig-studio/trunk/src/synfigapp/actions/keyframeadd.h
new file mode 100644 (file)
index 0000000..a3458e7
--- /dev/null
@@ -0,0 +1,73 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeadd.h
+**     \brief Template File
+**
+**     $Id: keyframeadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_KEYFRAMEADD_H
+#define __SYNFIG_APP_ACTION_KEYFRAMEADD_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/keyframe.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class KeyframeAdd :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Keyframe keyframe;
+
+public:
+
+       KeyframeAdd();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.cpp
new file mode 100644 (file)
index 0000000..425fd64
--- /dev/null
@@ -0,0 +1,243 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeduplicate.cpp
+**     \brief Template File
+**
+**     $Id: keyframeduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "keyframeduplicate.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_animated.h>
+#include "activepointsetsmart.h"
+#include "waypointsetsmart.h"
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::KeyframeDuplicate);
+ACTION_SET_NAME(Action::KeyframeDuplicate,"keyframe_duplicate");
+ACTION_SET_LOCAL_NAME(Action::KeyframeDuplicate,"Duplicate Keyframe");
+ACTION_SET_TASK(Action::KeyframeDuplicate,"duplicate");
+ACTION_SET_CATEGORY(Action::KeyframeDuplicate,Action::CATEGORY_KEYFRAME);
+ACTION_SET_PRIORITY(Action::KeyframeDuplicate,0);
+ACTION_SET_VERSION(Action::KeyframeDuplicate,"0.0");
+ACTION_SET_CVS_ID(Action::KeyframeDuplicate,"$Id: keyframeduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::KeyframeDuplicate::KeyframeDuplicate()
+{
+       new_keyframe.set_time(Time::begin()-1);
+       keyframe.set_time(Time::begin()-1);
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::KeyframeDuplicate::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
+               .set_local_name(_("Keyframe"))
+               .set_desc(_("Keyframe to be duplicated"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+       );
+
+       return ret;
+}
+
+bool
+Action::KeyframeDuplicate::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::KeyframeDuplicate::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
+       {
+               keyframe=param.get_keyframe();
+               new_keyframe.set_description(keyframe.get_description()+_(" (Duplicate)"));
+               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               new_keyframe.set_time(param.get_time());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::KeyframeDuplicate::is_ready()const
+{
+       if(keyframe.get_time()==(Time::begin()-1) || new_keyframe.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::KeyframeDuplicate::prepare()
+{
+       clear();
+
+       const synfig::Time old_time=keyframe.get_time();
+       const synfig::Time new_time=new_keyframe.get_time();
+
+       try { get_canvas()->keyframe_list().find(keyframe);}
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find the given keyframe"));
+       }       
+
+       try { if(get_canvas()->keyframe_list().find(new_time)!=get_canvas()->keyframe_list().end()) throw Error(_("A Keyframe already exists at this point in time"));}
+       catch(...) { }                  
+
+       // If the times are different, then we 
+       // will need to romp through the valuenodes
+       // and add actions to update their values.
+       if(new_time!=old_time)
+       {
+               std::vector<synfigapp::ValueDesc> value_desc_list;
+               get_canvas_interface()->find_important_value_descs(value_desc_list);
+               while(!value_desc_list.empty())
+               {
+                       process_value_desc(value_desc_list.back());
+                       value_desc_list.pop_back();
+               }
+       }
+}
+
+void
+Action::KeyframeDuplicate::process_value_desc(const synfigapp::ValueDesc& value_desc)
+{      
+       const synfig::Time old_time=keyframe.get_time();
+       const synfig::Time new_time=new_keyframe.get_time();
+
+       if(value_desc.is_value_node())
+       {
+               ValueNode::Handle value_node(value_desc.get_value_node());
+       
+               // If we are a dynamic list, then we need to update the ActivePoints
+               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node))
+               {
+                       ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node));
+                       int i;
+                       
+                       for(i=0;i<value_node->link_count();i++)
+                       {
+                               synfigapp::ValueDesc value_desc(value_node,i);
+                               Activepoint activepoint(value_node->list[i].new_activepoint_at_time(old_time));
+                               activepoint.set_time(new_time);
+
+                               Action::Handle action(ActivepointSetSmart::create());
+                               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_desc",value_desc);
+                               action->set_param("activepoint",activepoint);
+
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                       
+                               add_action_front(action);                                               
+                       }
+               }
+               else if(ValueNode_Animated::Handle::cast_dynamic(value_node))
+               {
+                       ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node));
+                       Waypoint waypoint(value_node->new_waypoint_at_time(old_time));
+                       waypoint.set_time(new_time);
+                       
+                       Action::Handle action(WaypointSetSmart::create());
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("value_node",ValueNode::Handle(value_node));
+                       action->set_param("waypoint",waypoint);
+       
+                       assert(action->is_ready());
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+               
+                       add_action_front(action);                                               
+               }
+       }
+}
+
+void
+Action::KeyframeDuplicate::perform()
+{
+       try { get_canvas()->keyframe_list().find(new_keyframe.get_time()); throw Error(_("A Keyframe already exists at this point in time"));}
+       catch(synfig::Exception::NotFound) { }  
+
+       try { get_canvas()->keyframe_list().find(new_keyframe); throw Error(_("This keyframe is already in the ValueNode"));}
+       catch(synfig::Exception::NotFound) { }  
+
+       Action::Super::perform();
+       
+       get_canvas()->keyframe_list().add(new_keyframe);
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_added()(new_keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::KeyframeDuplicate::undo()
+{
+       Action::Super::undo();
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_removed()(new_keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+
+       get_canvas()->keyframe_list().erase(new_keyframe);      
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.h b/synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.h
new file mode 100644 (file)
index 0000000..f04b461
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeduplicate.h
+**     \brief Template File
+**
+**     $Id: keyframeduplicate.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_KEYFRAMEDUPLICATE_H
+#define __SYNFIG_APP_ACTION_KEYFRAMEDUPLICATE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/keyframe.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class KeyframeDuplicate :
+       public Super
+{
+private:
+
+       synfig::Keyframe keyframe;
+       synfig::Keyframe new_keyframe;
+
+       void process_value_desc(const synfigapp::ValueDesc& value_desc);
+
+public:
+
+       KeyframeDuplicate();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframeremove.cpp
new file mode 100644 (file)
index 0000000..280c7c2
--- /dev/null
@@ -0,0 +1,231 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeremove.cpp
+**     \brief Template File
+**
+**     $Id: keyframeremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "keyframeremove.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_animated.h>
+#include "activepointremove.h"
+#include "waypointremove.h"
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::KeyframeRemove);
+ACTION_SET_NAME(Action::KeyframeRemove,"keyframe_remove");
+ACTION_SET_LOCAL_NAME(Action::KeyframeRemove,"Remove Keyframe");
+ACTION_SET_TASK(Action::KeyframeRemove,"remove");
+ACTION_SET_CATEGORY(Action::KeyframeRemove,Action::CATEGORY_KEYFRAME);
+ACTION_SET_PRIORITY(Action::KeyframeRemove,0);
+ACTION_SET_VERSION(Action::KeyframeRemove,"0.0");
+ACTION_SET_CVS_ID(Action::KeyframeRemove,"$Id: keyframeremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::KeyframeRemove::KeyframeRemove()
+{
+       keyframe.set_time(Time::begin()-1);
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::KeyframeRemove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
+               .set_local_name(_("Keyframe"))
+               .set_desc(_("Keyframe to be removed"))
+       );
+
+       return ret;
+}
+
+bool
+Action::KeyframeRemove::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::KeyframeRemove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
+       {
+               keyframe=param.get_keyframe();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::KeyframeRemove::is_ready()const
+{
+       if(keyframe.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::KeyframeRemove::prepare()
+{
+       clear();
+
+       try { get_canvas()->keyframe_list().find(keyframe);}
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find the given keyframe"));
+       }       
+
+       
+       {
+               std::vector<synfigapp::ValueDesc> value_desc_list;
+               get_canvas_interface()->find_important_value_descs(value_desc_list);
+               while(!value_desc_list.empty())
+               {
+                       process_value_desc(value_desc_list.back());
+                       value_desc_list.pop_back();
+               }
+       }
+}
+
+void
+Action::KeyframeRemove::process_value_desc(const synfigapp::ValueDesc& value_desc)
+{      
+       const synfig::Time time(keyframe.get_time());
+
+       if(value_desc.is_value_node())
+       {
+               ValueNode::Handle value_node(value_desc.get_value_node());
+       
+               // If we are a dynamic list, then we need to update the ActivePoints
+               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node))
+               {
+                       ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node));
+                       int i;
+                       for(i=0;i<value_node->link_count();i++)
+                       try
+                       {
+                               Activepoint activepoint;
+                               activepoint=*value_node->list[i].find(time);
+
+                               synfigapp::ValueDesc value_desc(value_node,i);
+
+                               Action::Handle action(ActivepointRemove::create());
+                               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_desc",value_desc);
+                               action->set_param("activepoint",activepoint);
+
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                       
+                               add_action_front(action);                                               
+                       }
+                       catch(...)
+                       {
+                       }
+               }
+               else if(ValueNode_Animated::Handle::cast_dynamic(value_node))
+               try
+               {
+                       ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node));
+                       Waypoint waypoint;
+                       waypoint=*value_node->find(time);
+                       assert(waypoint.get_time()==time);
+                       
+                       Action::Handle action(WaypointRemove::create());
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("value_node",ValueNode::Handle(value_node));
+                       action->set_param("waypoint",waypoint);
+       
+                       assert(action->is_ready());
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+               
+                       add_action_front(action);                                               
+               }
+               catch(...)
+               {
+               }
+       }
+}
+
+
+void
+Action::KeyframeRemove::perform()
+{
+       Action::Super::perform();
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_removed()(keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+
+       get_canvas()->keyframe_list().erase(keyframe);  
+}
+
+void
+Action::KeyframeRemove::undo()
+{
+       try { get_canvas()->keyframe_list().find(keyframe.get_time()); throw Error(_("A Keyframe already exists at this point in time"));}
+       catch(synfig::Exception::NotFound) { }  
+
+       try { get_canvas()->keyframe_list().find(keyframe); throw Error(_("This keyframe is already in the ValueNode"));}
+       catch(synfig::Exception::NotFound) { }  
+
+       Action::Super::undo();
+       
+       get_canvas()->keyframe_list().add(keyframe);
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_added()(keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeremove.h b/synfig-studio/trunk/src/synfigapp/actions/keyframeremove.h
new file mode 100644 (file)
index 0000000..2fbabf9
--- /dev/null
@@ -0,0 +1,75 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeremove.h
+**     \brief Template File
+**
+**     $Id: keyframeremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_KEYFRAMEREMOVE_H
+#define __SYNFIG_APP_ACTION_KEYFRAMEREMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/keyframe.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class KeyframeRemove :
+       public Super
+{
+private:
+
+       synfig::Keyframe keyframe;
+
+       void process_value_desc(const synfigapp::ValueDesc& value_desc);
+
+public:
+
+       KeyframeRemove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeset.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframeset.cpp
new file mode 100644 (file)
index 0000000..62c7859
--- /dev/null
@@ -0,0 +1,429 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeset.cpp
+**     \brief Template File
+**
+**     $Id: keyframeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "keyframeset.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_animated.h>
+#include "activepointsetsmart.h"
+#include "waypointsetsmart.h"
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::KeyframeSet);
+ACTION_SET_NAME(Action::KeyframeSet,"keyframe_set");
+ACTION_SET_LOCAL_NAME(Action::KeyframeSet,"Set Keyframe");
+ACTION_SET_TASK(Action::KeyframeSet,"set");
+ACTION_SET_CATEGORY(Action::KeyframeSet,Action::CATEGORY_KEYFRAME|Action::CATEGORY_HIDDEN);
+ACTION_SET_PRIORITY(Action::KeyframeSet,0);
+ACTION_SET_VERSION(Action::KeyframeSet,"0.0");
+ACTION_SET_CVS_ID(Action::KeyframeSet,"$Id: keyframeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::KeyframeSet::KeyframeSet()
+{
+       keyframe.set_time(Time::begin()-1);
+       set_dirty(false);
+}
+
+Action::ParamVocab
+Action::KeyframeSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
+               .set_local_name(_("New Keyframe"))
+               .set_desc(_("Keyframe to be added"))
+       );
+
+       return ret;
+}
+
+bool
+Action::KeyframeSet::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::KeyframeSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
+       {
+               synfig::info("KeyframeSet::set_param():old_time: %s",keyframe.get_time().get_string().c_str());
+               keyframe=param.get_keyframe();
+               synfig::info("KeyframeSet::set_param():new_time: %s",keyframe.get_time().get_string().c_str());
+               synfig::info("KeyframeSet::set_param():get_keyframe(): %s",param.get_keyframe().get_time().get_string().c_str());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::KeyframeSet::is_ready()const
+{
+       if(keyframe.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::KeyframeSet::prepare()
+{
+       clear();
+       guid_set.clear();
+       
+       
+
+       
+       
+       //synfig::info("new_time: %s",new_time.get_string().c_str());
+       //synfig::info("old_time: %s",old_time.get_string().c_str());
+       
+       try { if(get_canvas()->keyframe_list().find(new_time)!=get_canvas()->keyframe_list().end()) throw Error(_("A Keyframe already exists at this point in time"));}
+       catch(...) { }  
+
+
+       // If the times are different, then we 
+       // will need to romp through the valuenodes
+       // and add actions to update their values.
+       if(new_time!=old_time)
+       {
+               std::vector<synfigapp::ValueDesc> value_desc_list;
+               get_canvas_interface()->find_important_value_descs(value_desc_list);
+               while(!value_desc_list.empty())
+               {
+                       process_value_desc(value_desc_list.back());
+                       value_desc_list.pop_back();
+               }
+       }
+}
+
+#define old_2_new(x)   (((x)-old_begin)/(old_end-old_begin)*(new_end-new_begin)+new_begin)
+
+int
+Action::KeyframeSet::scale_activepoints(const synfigapp::ValueDesc& value_desc,const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end)
+{
+       ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_static(value_desc.get_parent_value_node()));
+       ValueNode_DynamicList::ListEntry& list_entry(value_node->list[value_desc.get_index()]);
+       
+       std::vector<Activepoint*> selected;
+       std::vector<Activepoint*>::iterator iter;
+       
+       if(list_entry.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;
+                               list_entry.find(new_time);
+                               // If we found a activepoint already at that time, then
+                               // we need to abort
+                               //throw Exception::BadTime(_("Activepoint Conflict"));
+                       }
+                       catch(Exception::NotFound) { }
+               }
+               
+               int ret(0);
+               while(!selected.empty())
+               {
+                       if(selected.back()->get_time()!=old_2_new(selected.back()->get_time()))
+                       {
+                               Action::Handle action(Action::create("activepoint_set"));
+                               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_desc",value_desc);
+                               
+                               Activepoint activepoint(*selected.back());
+                               activepoint.set_time(old_2_new(selected.back()->get_time()));
+
+                               action->set_param("activepoint",activepoint);
+
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                       
+                               add_action_front(action);                                               
+
+                               ret++;
+                       }
+                       selected.pop_back();
+               }
+               return ret;
+       }
+       return 0;
+}
+
+int
+Action::KeyframeSet::scale_waypoints(const synfigapp::ValueDesc& value_desc,const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end)
+{
+       ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_static(value_desc.get_value_node()));
+       
+       std::vector<Waypoint*> selected;
+       std::vector<Waypoint*>::iterator iter;
+       
+       if(value_node->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;
+                               value_node->find(new_time);
+                               // If we found a waypoint point already at that time, then
+                               // we need to abort
+                               //synfig::info(_("old_begin: %s, old_end: %s"),old_begin.get_string().c_str(),old_end.get_string().c_str());
+                               //synfig::info(_("new_begin: %s, new_end: %s"),new_begin.get_string().c_str(),new_end.get_string().c_str());
+                               //throw Exception::BadTime(strprintf(_("Waypoint Conflict, old: %s, new: %s"),(*iter)->get_time().get_string().c_str(),new_time.get_string().c_str()));
+                       }
+                       catch(Exception::NotFound) { }
+               }
+               
+               int ret(0);
+               while(!selected.empty())
+               {
+                       if(selected.back()->get_time()!=old_2_new(selected.back()->get_time()))
+                       {
+                               Action::Handle action(Action::create("waypoint_set"));
+                               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_node",ValueNode::Handle::cast_static(value_node));
+                               
+                               Waypoint waypoint(*selected.back());
+                               waypoint.set_time(old_2_new(selected.back()->get_time()));
+
+                               action->set_param("waypoint",waypoint);
+
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                       
+                               add_action_front(action);                                               
+
+                               ret++;
+                       }
+                       selected.pop_back();
+               }
+               return ret;
+       }
+       return 0;
+}
+
+void
+Action::KeyframeSet::process_value_desc(const synfigapp::ValueDesc& value_desc)
+{      
+       if(value_desc.is_value_node())
+       {               
+               ValueNode::Handle value_node(value_desc.get_value_node());
+
+               //if(guid_set.count(value_node->get_guid()))
+               //      return;
+               //guid_set.insert(value_node->get_guid());
+
+               // If we are a dynamic list, then we need to update the ActivePoints
+               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node))
+               {
+                       ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node));
+                       int i;
+                       for(i=0;i<value_node->link_count();i++)
+                       {
+                               synfigapp::ValueDesc value_desc(value_node,i);
+                               if(new_time>keyframe_prev && new_time<keyframe_next)
+                               {
+                                       // In this circumstance, we need to adjust any
+                                       // activepoints between the previous and next
+                                       // keyframes
+                                       scale_activepoints(value_desc,keyframe_prev,old_time,keyframe_prev,new_time);
+                                       scale_activepoints(value_desc,old_time,keyframe_next,new_time,keyframe_next);
+                               }
+                               //else
+                               {       
+                                       Action::Handle action(ActivepointSetSmart::create());
+                                       
+                                       action->set_param("canvas",get_canvas());
+                                       action->set_param("canvas_interface",get_canvas_interface());
+                                       action->set_param("value_desc",value_desc);
+                                       
+                                       Activepoint activepoint;
+                                       try
+                                       {
+                                               activepoint=*value_node->list[i].find(old_time);
+                                               activepoint.set_time(new_time);
+                                       }
+                                       catch(...)
+                                       {
+                                               activepoint.set_time(new_time);
+                                               activepoint.set_state(value_node->list[i].status_at_time(old_time));
+                                               activepoint.set_priority(0);
+                                       }
+                                       action->set_param("activepoint",activepoint);
+       
+                                       assert(action->is_ready());
+                                       if(!action->is_ready())
+                                               throw Error(Error::TYPE_NOTREADY);
+                               
+                                       add_action_front(action);
+                               }
+                       }
+               }
+               else if(ValueNode_Animated::Handle::cast_dynamic(value_node))
+               {
+                       if(new_time>keyframe_prev && new_time<keyframe_next)
+                       {
+                                       // In this circumstance, we need to adjust any
+                                       // waypoints between the previous and next
+                                       // keyframes
+                                       scale_waypoints(value_desc,keyframe_prev,old_time,keyframe_prev,new_time);
+                                       scale_waypoints(value_desc,old_time,keyframe_next,new_time,keyframe_next);
+                       }
+                       //else
+                       {
+                               ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node));
+                               
+                               Action::Handle action(WaypointSetSmart::create());
+                               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_node",ValueNode::Handle(value_node));
+                               
+                               Waypoint waypoint;
+                               try
+                               {
+                                       waypoint=*value_node->find(old_time);
+                                       waypoint.set_time(new_time);
+                               }
+                               catch(...)
+                               {
+                                       waypoint.set_time(new_time);
+                                       waypoint.set_value((*value_node)(old_time));
+                               }
+                               action->set_param("waypoint",waypoint);
+               
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                       
+                               add_action_front(action);
+                       }
+               }
+       }
+}
+
+
+void
+Action::KeyframeSet::perform()
+{
+
+       old_time=get_canvas()->keyframe_list().find(keyframe)->get_time();
+       new_time=keyframe.get_time();
+       
+       try { get_canvas()->keyframe_list().find(keyframe);}
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find the given keyframe"));
+       }       
+       
+       // Check for colisions
+       if(old_time!=new_time)
+       {
+               try {
+                       get_canvas()->keyframe_list().find(new_time);
+                       throw Error(_("Cannot change keyframe time because another keyframe already exists with that time."));
+               }
+               catch(Exception::NotFound) { }
+       }
+       try { keyframe_next=get_canvas()->keyframe_list().find_next(old_time)->get_time(); }
+       catch(...) { keyframe_next=Time::end(); }
+       try { keyframe_prev=get_canvas()->keyframe_list().find_prev(old_time)->get_time(); }
+       catch(...) { keyframe_prev=Time::begin(); }
+
+       old_keyframe=*get_canvas()->keyframe_list().find(keyframe);
+       *get_canvas()->keyframe_list().find(keyframe)=keyframe;
+       
+       get_canvas()->keyframe_list().sync();
+
+       try{
+               Action::Super::perform();
+       } catch(...)
+       {
+               *get_canvas()->keyframe_list().find(old_keyframe)=old_keyframe;
+
+               get_canvas()->keyframe_list().sync();
+               throw;
+       }
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_changed()(keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::KeyframeSet::undo()
+{
+       Action::Super::undo();
+
+       *get_canvas()->keyframe_list().find(old_keyframe)=old_keyframe;
+
+       get_canvas()->keyframe_list().sync();
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_changed()(keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeset.h b/synfig-studio/trunk/src/synfigapp/actions/keyframeset.h
new file mode 100644 (file)
index 0000000..518e995
--- /dev/null
@@ -0,0 +1,88 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeset.h
+**     \brief Template File
+**
+**     $Id: keyframeset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_KEYFRAMESET_H
+#define __SYNFIG_APP_ACTION_KEYFRAMESET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/keyframe.h>
+#include <synfig/time.h>
+#include <synfig/guid.h>
+#include <set>
+
+/* === 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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class KeyframeSet :
+       public Super
+{
+private:
+
+       synfig::Keyframe keyframe;
+       synfig::Keyframe old_keyframe;
+       synfig::Time old_time;
+       synfig::Time new_time;
+
+       synfig::Time keyframe_prev,keyframe_next;
+       
+       std::set<synfig::GUID> guid_set;
+
+       void process_value_desc(const synfigapp::ValueDesc& value_desc);
+       
+       int scale_activepoints(const synfigapp::ValueDesc& value_desc,const synfig::Time& old_begin,const synfig::Time& old_end,const synfig::Time& new_begin,const synfig::Time& new_end);
+       int scale_waypoints(const synfigapp::ValueDesc& value_desc,const synfig::Time& old_begin,const synfig::Time& old_end,const synfig::Time& new_begin,const synfig::Time& new_end);
+
+public:
+
+       KeyframeSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframesetdelta.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframesetdelta.cpp
new file mode 100644 (file)
index 0000000..1ce46bd
--- /dev/null
@@ -0,0 +1,259 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeset.cpp
+**     \brief Template File
+**
+**     $Id: keyframesetdelta.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "keyframesetdelta.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_animated.h>
+#include "activepointsetsmart.h"
+#include "waypointsetsmart.h"
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::KeyframeSetDelta);
+ACTION_SET_NAME(Action::KeyframeSetDelta,"keyframe_set_delta");
+ACTION_SET_LOCAL_NAME(Action::KeyframeSetDelta,"Set Keyframe Delta");
+ACTION_SET_TASK(Action::KeyframeSetDelta,"set");
+ACTION_SET_CATEGORY(Action::KeyframeSetDelta,Action::CATEGORY_KEYFRAME|Action::CATEGORY_HIDDEN);
+ACTION_SET_PRIORITY(Action::KeyframeSetDelta,0);
+ACTION_SET_VERSION(Action::KeyframeSetDelta,"0.0");
+ACTION_SET_CVS_ID(Action::KeyframeSetDelta,"$Id: keyframesetdelta.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::KeyframeSetDelta::KeyframeSetDelta():
+       delta(0)
+{
+       keyframe.set_time(Time::end());
+       set_dirty(false);
+}
+
+Action::ParamVocab
+Action::KeyframeSetDelta::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
+               .set_local_name(_("Keyframe"))
+       );
+       ret.push_back(ParamDesc("delta",Param::TYPE_KEYFRAME)
+               .set_local_name(_("Delta"))
+       );
+
+       return ret;
+}
+
+bool
+Action::KeyframeSetDelta::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::KeyframeSetDelta::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
+       {
+               keyframe=param.get_keyframe();
+               return true;
+       }
+       if(name=="delta" && param.get_type()==Param::TYPE_TIME)
+       {
+               delta=param.get_time();
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::KeyframeSetDelta::is_ready()const
+{
+       if(keyframe.get_time()==Time::end())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::KeyframeSetDelta::prepare()
+{
+       clear();
+       value_desc_list.clear();
+       get_canvas_interface()->find_important_value_descs(value_desc_list);
+
+       
+       Time time(get_canvas()->keyframe_list().find(keyframe)->get_time());
+       
+       std::vector<synfigapp::ValueDesc>::iterator iter;
+               DEBUGPOINT();
+       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
+       {
+               ValueDesc& value_desc(*iter);
+               ValueNode_Animated::Handle value_node(
+                       ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())
+               );
+               
+               if(!value_node)
+                       continue;
+               
+               try{
+                       value_node->find(time);
+                       // if we got to this point, then we know that
+                       // a waypoint already exists here and we don't
+                       // need to add a new one.
+                       continue;
+               }catch(...)
+               {
+                       // Make sure there is something previous
+                       try{
+                               value_node->find_prev(time);
+                       }catch(...)
+                       {
+                               continue;
+                       }
+               }
+               Action::Handle action(Action::create("waypoint_set_smart"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_node",ValueNode::Handle::cast_static(value_node));
+
+               action->set_param("time",time);
+
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);                                             
+       }
+}
+
+void
+Action::KeyframeSetDelta::perform()
+{
+       if(!delta)
+               return;
+       Action::Super::perform();
+       
+//     Time location(keyframe.get_time());
+       Time location(get_canvas()->keyframe_list().find(keyframe)->get_time());        
+       Time delta(delta);
+       
+       get_canvas()->keyframe_list().insert_time(location,delta);
+
+       std::vector<synfigapp::ValueDesc>::iterator iter;
+       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
+       {
+               ValueDesc& value_desc(*iter);
+               if(!value_desc.is_value_node())
+                       continue;
+               ValueNode_Animated::Handle animated(
+                       ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())
+               );
+               if(animated)
+               {
+                       animated->insert_time(location,delta);
+                       continue;
+               }
+               ValueNode_DynamicList::Handle dyn_list(
+                       ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_value_node())
+               );
+               if(dyn_list)
+               {
+                       dyn_list->insert_time(location,delta);
+                       continue;
+               }
+       }
+
+       // Signal that something has changed
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_changed()(keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::KeyframeSetDelta::undo()
+{
+       if(!delta)
+               return;
+       
+//     Time location(keyframe.get_time());
+       Time location(get_canvas()->keyframe_list().find(keyframe)->get_time());        
+       Time delta(-delta);
+       
+       get_canvas()->keyframe_list().insert_time(location,delta);
+
+       std::vector<synfigapp::ValueDesc>::iterator iter;
+       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
+       {
+               ValueDesc& value_desc(*iter);
+               if(!value_desc.is_value_node())
+                       continue;
+               ValueNode_Animated::Handle animated(
+                       ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())
+               );
+               if(animated)
+               {
+                       animated->insert_time(location,delta);
+                       continue;
+               }
+               ValueNode_DynamicList::Handle dyn_list(
+                       ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_value_node())
+               );
+               if(dyn_list)
+               {
+                       dyn_list->insert_time(location,delta);
+                       continue;
+               }
+       }
+
+       Action::Super::undo();
+
+       // Signal that something has changed
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_keyframe_changed()(keyframe);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframesetdelta.h b/synfig-studio/trunk/src/synfigapp/actions/keyframesetdelta.h
new file mode 100644 (file)
index 0000000..d67dad4
--- /dev/null
@@ -0,0 +1,83 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeset.h
+**     \brief Template File
+**
+**     $Id: keyframesetdelta.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_KEYFRAMESETDELTA_H
+#define __SYNFIG_APP_ACTION_KEYFRAMESETDELTA_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/keyframe.h>
+#include <synfig/time.h>
+#include <synfig/guid.h>
+#include <set>
+
+/* === 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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class KeyframeSetDelta :
+       public Super
+{
+private:
+       synfig::Keyframe keyframe;
+       synfig::Time delta;
+
+       std::vector<synfigapp::ValueDesc> value_desc_list;
+
+       void process_value_desc(const synfigapp::ValueDesc& value_desc);
+       
+       int scale_activepoints(const synfigapp::ValueDesc& value_desc,const synfig::Time& old_begin,const synfig::Time& old_end,const synfig::Time& new_begin,const synfig::Time& new_end);
+       int scale_waypoints(const synfigapp::ValueDesc& value_desc,const synfig::Time& old_begin,const synfig::Time& old_end,const synfig::Time& new_begin,const synfig::Time& new_end);
+
+public:
+
+       KeyframeSetDelta();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframewaypointset.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframewaypointset.cpp
new file mode 100644 (file)
index 0000000..b1e787d
--- /dev/null
@@ -0,0 +1,176 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframeset.cpp
+**     \brief Template File
+**
+**     $Id: keyframewaypointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "keyframewaypointset.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_animated.h>
+#include "activepointsetsmart.h"
+#include "waypointsetsmart.h"
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::KeyframeWaypointSet);
+ACTION_SET_NAME(Action::KeyframeWaypointSet,"keyframe_waypoint_set");
+ACTION_SET_LOCAL_NAME(Action::KeyframeWaypointSet,"Set Waypoints at Keyframe");
+ACTION_SET_TASK(Action::KeyframeWaypointSet,"set");
+ACTION_SET_CATEGORY(Action::KeyframeWaypointSet,Action::CATEGORY_KEYFRAME);
+ACTION_SET_PRIORITY(Action::KeyframeWaypointSet,0);
+ACTION_SET_VERSION(Action::KeyframeWaypointSet,"0.0");
+ACTION_SET_CVS_ID(Action::KeyframeWaypointSet,"$Id: keyframewaypointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::KeyframeWaypointSet::KeyframeWaypointSet()
+{
+       keyframe.set_time(Time::begin()-1);
+       set_dirty(false);
+}
+
+Action::ParamVocab
+Action::KeyframeWaypointSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("keyframe",Param::TYPE_KEYFRAME)
+               .set_local_name(_("Keyframe"))
+       );
+
+       ret.push_back(ParamDesc("model",Param::TYPE_WAYPOINTMODEL)
+               .set_local_name(_("Waypoint Model"))
+       );
+
+       return ret;
+}
+
+bool
+Action::KeyframeWaypointSet::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::KeyframeWaypointSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="keyframe" && param.get_type()==Param::TYPE_KEYFRAME)
+       {
+               keyframe=param.get_keyframe();
+               
+               return true;
+       }
+       if(name=="model" && param.get_type()==Param::TYPE_WAYPOINTMODEL)
+       {
+               waypoint_model=param.get_waypoint_model();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::KeyframeWaypointSet::is_ready()const
+{
+       if(keyframe.get_time()==(Time::begin()-1) || waypoint_model.is_trivial())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::KeyframeWaypointSet::prepare()
+{
+       clear();
+
+       try { get_canvas()->keyframe_list().find(keyframe);}
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find the given keyframe"));
+       }       
+
+       {
+               std::vector<synfigapp::ValueDesc> value_desc_list;
+               get_canvas_interface()->find_important_value_descs(value_desc_list);
+               while(!value_desc_list.empty())
+               {
+                       process_value_desc(value_desc_list.back());
+                       value_desc_list.pop_back();
+               }
+       }
+}
+
+void
+Action::KeyframeWaypointSet::process_value_desc(const synfigapp::ValueDesc& value_desc)
+{      
+       if(value_desc.is_value_node())
+       {
+               ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node()));
+       
+               if(value_node)
+               {                       
+                       Action::Handle action(WaypointSetSmart::create());
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("value_node",ValueNode::Handle(value_node));
+                       
+                       Waypoint waypoint;
+                       try
+                       {
+                               waypoint=*value_node->find(keyframe.get_time());
+                       }
+                       catch(...)
+                       {
+                               waypoint.set_time(keyframe.get_time());
+                               waypoint.set_value((*value_node)(keyframe.get_time()));
+                       }
+                       waypoint.apply_model(waypoint_model);
+                       
+                       action->set_param("waypoint",waypoint);
+       
+                       assert(action->is_ready());
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+               
+                       add_action_front(action);                                               
+               }
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframewaypointset.h b/synfig-studio/trunk/src/synfigapp/actions/keyframewaypointset.h
new file mode 100644 (file)
index 0000000..1ed66a1
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file keyframewaypointset.h
+**     \brief Template File
+**
+**     $Id: keyframewaypointset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_KEYFRAMEWAYPOINTSET_H
+#define __SYNFIG_APP_ACTION_KEYFRAMESET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/keyframe.h>
+#include <synfig/waypoint.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class KeyframeWaypointSet :
+       public Super
+{
+private:
+
+       synfig::Keyframe keyframe;
+       synfig::Waypoint::Model waypoint_model;
+
+
+       void process_value_desc(const synfigapp::ValueDesc& value_desc);
+
+public:
+
+       KeyframeWaypointSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp b/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp
new file mode 100644 (file)
index 0000000..e4c034c
--- /dev/null
@@ -0,0 +1,198 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layeractivate.cpp
+**     \brief Template File
+**
+**     $Id: layeractivate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layeractivate.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+#define ACTION_INIT2(class) \
+       Action::Base* class::create() { return new class(); }   \
+       synfig::String class::get_name()const { return name__; }        
+
+ACTION_INIT2(Action::LayerActivate);
+ACTION_SET_NAME(Action::LayerActivate,"layer_activate");
+ACTION_SET_LOCAL_NAME(Action::LayerActivate,_("Activate Layer"));
+ACTION_SET_TASK(Action::LayerActivate,"activate");
+ACTION_SET_CATEGORY(Action::LayerActivate,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerActivate,0);
+ACTION_SET_VERSION(Action::LayerActivate,"0.0");
+ACTION_SET_CVS_ID(Action::LayerActivate,"$Id: layeractivate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerActivate::LayerActivate()
+{
+}
+
+synfig::String
+Action::LayerActivate::get_local_name()const
+{
+       if(!layer)
+               return _("Activate Layer");
+       String name;
+       if(layer->get_description().empty())
+               name=layer->get_local_name();
+       else
+               name=layer->get_description();
+
+       return (new_status?_("Activate "):_("Deactivate "))+name;
+}
+
+Action::ParamVocab
+Action::LayerActivate::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+       );
+
+       ret.push_back(ParamDesc("new_status",Param::TYPE_BOOL)
+               .set_local_name(_("New Status"))
+               .set_desc(_("The new status of the layer"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerActivate::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerActivate::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layer=param.get_layer();
+               
+               return true;
+       }
+
+       if(name=="new_status" && param.get_type()==Param::TYPE_BOOL)
+       {
+               new_status=param.get_bool();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerActivate::is_ready()const
+{
+       if(!layer)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerActivate::perform()
+{
+       Canvas::Handle subcanvas(layer->get_canvas());
+       
+       // Find the iterator for the layer
+       Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
+       
+       // If we couldn't find the layer in the canvas, then bail
+       if(*iter!=layer)
+               throw Error(_("This layer doesn't exist anymore."));
+
+       // If the subcanvas isn't the same as the canvas,
+       // then it had better be an inline canvas. If not,
+       // bail
+       //if(get_canvas()!=subcanvas && !subcanvas->is_inline())
+       //if(get_canvas()->get_root()!=subcanvas->get_root())
+       //      throw Error(_("This layer doesn't belong to this composition"));
+       
+       old_status=layer->active();
+       
+       // If we are changing the status to what it already is,
+       // the go ahead and return
+       if(new_status==old_status)
+       {
+               set_dirty(false);
+               return;
+       }
+       else
+               set_dirty();
+       
+       if(new_status)
+               layer->enable();
+       else
+               layer->disable();
+
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_status_changed()(layer,new_status);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::LayerActivate::undo()
+{
+       // If we are changing the status to what it already is,
+       // the go ahead and return
+       if(new_status==old_status)
+       {
+               set_dirty(false);
+               return;
+       }
+       else
+               set_dirty();
+
+       // restore the old status
+       if(old_status)
+               layer->enable();
+       else
+               layer->disable();
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_status_changed()(layer,old_status);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layeractivate.h b/synfig-studio/trunk/src/synfigapp/actions/layeractivate.h
new file mode 100644 (file)
index 0000000..41e15e3
--- /dev/null
@@ -0,0 +1,75 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layeractivate.h
+**     \brief Template File
+**
+**     $Id: layeractivate.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERACTIVATE_H
+#define __SYNFIG_APP_ACTION_LAYERACTIVATE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class LayerActivate :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Layer::Handle layer;
+       bool old_status;
+       bool new_status;
+
+public:
+
+       LayerActivate();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layeradd.cpp b/synfig-studio/trunk/src/synfigapp/actions/layeradd.cpp
new file mode 100644 (file)
index 0000000..d70aa6a
--- /dev/null
@@ -0,0 +1,145 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layeradd.cpp
+**     \brief Template File
+**
+**     $Id: layeradd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layeradd.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerAdd);
+ACTION_SET_NAME(Action::LayerAdd,"layer_add");
+ACTION_SET_LOCAL_NAME(Action::LayerAdd,"Add Layer");
+ACTION_SET_TASK(Action::LayerAdd,"add");
+ACTION_SET_CATEGORY(Action::LayerAdd,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerAdd,0);
+ACTION_SET_VERSION(Action::LayerAdd,"0.0");
+ACTION_SET_CVS_ID(Action::LayerAdd,"$Id: layeradd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerAdd::LayerAdd()
+{
+}
+
+Action::ParamVocab
+Action::LayerAdd::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("new",Param::TYPE_LAYER)
+               .set_local_name(_("New Layer"))
+               .set_desc(_("Layer to be added"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerAdd::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerAdd::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="new" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layer=param.get_layer();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerAdd::is_ready()const
+{
+       if(!layer)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerAdd::perform()
+{
+       // Set the layer's canvas
+       layer->set_canvas(get_canvas());
+               
+       // Push the layer onto the front of the canvas
+       get_canvas()->push_front(layer);        
+
+       // Mark ourselves as dirty if necessary
+       //set_dirty(layer->active());
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_inserted()(layer,0);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::LayerAdd::undo()
+{
+       // Find the iterator for the layer
+       Canvas::iterator iter=find(get_canvas()->begin(),get_canvas()->end(),layer);
+               
+       // If we couldn't find the layer in the canvas, then bail
+       if(*iter!=layer)
+               throw Error(_("This layer doesn't exist anymore."));
+       
+       // Remove the layer from the canvas
+       get_canvas()->erase(iter);
+
+       // Mark ourselves as dirty if necessary
+       //set_dirty(layer->active());
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_removed()(layer);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layeradd.h b/synfig-studio/trunk/src/synfigapp/actions/layeradd.h
new file mode 100644 (file)
index 0000000..c36f08f
--- /dev/null
@@ -0,0 +1,73 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layeradd.h
+**     \brief Template File
+**
+**     $Id: layeradd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERADD_H
+#define __SYNFIG_APP_ACTION_LAYERADD_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class LayerAdd :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Layer::Handle layer;
+
+public:
+
+       LayerAdd();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerduplicate.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerduplicate.cpp
new file mode 100644 (file)
index 0000000..502d901
--- /dev/null
@@ -0,0 +1,154 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerduplicate.cpp
+**     \brief Template File
+**
+**     $Id: layerduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerduplicate.h"
+#include "layeradd.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerDuplicate);
+ACTION_SET_NAME(Action::LayerDuplicate,"layer_duplicate");
+ACTION_SET_LOCAL_NAME(Action::LayerDuplicate,"Duplicate Layer");
+ACTION_SET_TASK(Action::LayerDuplicate,"duplicate");
+ACTION_SET_CATEGORY(Action::LayerDuplicate,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerDuplicate,0);
+ACTION_SET_VERSION(Action::LayerDuplicate,"0.0");
+ACTION_SET_CVS_ID(Action::LayerDuplicate,"$Id: layerduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerDuplicate::LayerDuplicate()
+{
+}
+
+Action::ParamVocab
+Action::LayerDuplicate::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be duplicated"))
+               .set_supports_multiple()
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerDuplicate::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerDuplicate::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layers.push_back(param.get_layer());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerDuplicate::is_ready()const
+{
+       if(layers.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerDuplicate::prepare()
+{
+       if(!first_time())
+               return;
+       
+       std::list<synfig::Layer::Handle>::const_iterator iter;
+       
+       for(iter=layers.begin();iter!=layers.end();++iter)
+       {
+               Layer::Handle layer(*iter);
+               
+               Canvas::Handle subcanvas(layer->get_canvas());
+               
+               // Find the iterator for the layer
+               Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
+               
+               // If we couldn't find the layer in the canvas, then bail
+               if(*iter!=layer)
+                       throw Error(_("This layer doesn't exist anymore."));
+       
+               // If the subcanvas isn't the same as the canvas,
+               // then it had better be an inline canvas. If not,
+               // bail
+               if(get_canvas()!=subcanvas && !subcanvas->is_inline())
+                       throw Error(_("This layer doesn't belong to this canvas anymore"));
+               
+               Layer::Handle new_layer(layer->clone(guid));
+               
+               {
+                       Action::Handle action(Action::create("layer_move"));
+                       
+                       action->set_param("canvas",subcanvas);
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("layer",new_layer);
+                       action->set_param("new_index",layers.front()->get_depth());
+                       
+                       add_action_front(action);
+               }
+               {
+                       Action::Handle action(Action::create("layer_add"));
+               
+                       action->set_param("canvas",subcanvas);
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("new",new_layer);
+                       
+                       add_action_front(action);
+               }
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerduplicate.h b/synfig-studio/trunk/src/synfigapp/actions/layerduplicate.h
new file mode 100644 (file)
index 0000000..2d5eeff
--- /dev/null
@@ -0,0 +1,72 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerduplicate.h
+**     \brief Template File
+**
+**     $Id: layerduplicate.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERDUPLICATE_H
+#define __SYNFIG_APP_ACTION_LAYERDUPLICATE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.h>
+#include <list>
+#include <synfig/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 synfigapp {
+
+namespace Action {
+
+class LayerDuplicate :
+       public Super
+{
+private:
+
+       synfig::GUID guid;
+       std::list<synfig::Layer::Handle> layers;
+
+public:
+
+       LayerDuplicate();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerencapsulate.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerencapsulate.cpp
new file mode 100644 (file)
index 0000000..473853c
--- /dev/null
@@ -0,0 +1,216 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerraise.cpp
+**     \brief Template File
+**
+**     $Id: layerencapsulate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerencapsulate.h"
+#include "layeradd.h"
+#include "layerremove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerEncapsulate);
+ACTION_SET_NAME(Action::LayerEncapsulate,"layer_encapsulate");
+ACTION_SET_LOCAL_NAME(Action::LayerEncapsulate,"Encapsulate");
+ACTION_SET_TASK(Action::LayerEncapsulate,"encapsulate");
+ACTION_SET_CATEGORY(Action::LayerEncapsulate,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerEncapsulate,0);
+ACTION_SET_VERSION(Action::LayerEncapsulate,"0.0");
+ACTION_SET_CVS_ID(Action::LayerEncapsulate,"$Id: layerencapsulate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerEncapsulate::LayerEncapsulate()
+{
+}
+
+Action::ParamVocab
+Action::LayerEncapsulate::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be encapsulated"))
+               .set_supports_multiple()
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerEncapsulate::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerEncapsulate::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layers.push_back(param.get_layer());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerEncapsulate::is_ready()const
+{
+       if(layers.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+int
+Action::LayerEncapsulate::lowest_depth()const
+{
+       std::list<synfig::Layer::Handle>::const_iterator iter;
+       int lowest_depth(0x7fffffff);
+       
+       for(iter=layers.begin();iter!=layers.end();++iter)
+       {
+               int depth((*iter)->get_depth());
+               if(depth<lowest_depth)
+                       lowest_depth=depth;
+       }
+       if(lowest_depth==0x7fffffff)
+               return 0;
+       return lowest_depth;
+}
+
+void
+Action::LayerEncapsulate::prepare()
+{
+
+       if(!first_time())
+               return;
+
+       if(layers.empty())
+               throw Error("No layers to encapsulate");
+               
+       // First create the new canvas and layer
+       if(!child_canvas)
+               child_canvas=Canvas::create_inline(get_canvas());
+       
+       Layer::Handle new_layer(Layer::create("PasteCanvas"));
+       
+       new_layer->set_param("canvas",child_canvas);
+       
+       int target_depth(lowest_depth());
+       
+       // Add the layer
+       {
+               Action::Handle action(LayerAdd::create());
+       
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("new",new_layer);
+               
+               add_action(action);
+       }       
+       
+       // Move the layer
+       {
+               Action::Handle action(Action::create("layer_move"));
+               
+               assert(action);
+       
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("layer",new_layer);
+               action->set_param("new_index",target_depth);
+               
+               add_action(action);
+       }               
+               
+       std::list<synfig::Layer::Handle>::reverse_iterator iter;
+       
+       for(iter=layers.rbegin();iter!=layers.rend();++iter)
+       {
+               Layer::Handle layer(*iter);
+               
+               Canvas::Handle subcanvas(layer->get_canvas());
+               
+               // Find the iterator for the layer
+               Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
+               
+               // If we couldn't find the layer in the canvas, then bail
+               if(*iter!=layer)
+                       throw Error(_("This layer doesn't exist anymore."));
+       
+               if(!subcanvas)
+                       throw Error(_("This layer doesn't have a parent canvas"));
+
+               // If the subcanvas isn't the same as the canvas,
+               // then it had better be an inline canvas. If not,
+               // bail
+               if(get_canvas()!=subcanvas && !subcanvas->is_inline())
+                       throw Error(_("This layer doesn't belong to this canvas anymore"));
+
+               if(get_canvas()!=subcanvas)
+                       throw Error(_("get_canvas()!=subcanvas"));
+               
+               // Remove the layer from the old canvas
+               {
+                       Action::Handle action(LayerRemove::create());
+                       
+                       action->set_param("canvas",subcanvas);
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("layer",layer);
+                       
+                       add_action(action);
+               }
+               // Add the layer to the new canvas
+               {
+                       Action::Handle action(LayerAdd::create());
+                       
+                       action->set_param("canvas",child_canvas);
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("new",layer);
+                       
+                       add_action(action);
+               }
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerencapsulate.h b/synfig-studio/trunk/src/synfigapp/actions/layerencapsulate.h
new file mode 100644 (file)
index 0000000..10c75e8
--- /dev/null
@@ -0,0 +1,73 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerencapsulate.h
+**     \brief Template File
+**
+**     $Id: layerencapsulate.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERENCAPSULATE_H
+#define __SYNFIG_APP_ACTION_LAYERENCAPSULATE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.h>
+#include <list>
+#include <synfig/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 synfigapp {
+
+namespace Action {
+
+class LayerEncapsulate :
+       public Super
+{
+private:
+       synfig::Canvas::Handle child_canvas;
+       std::list<synfig::Layer::Handle> layers;
+
+       int lowest_depth()const;
+
+public:
+
+       LayerEncapsulate();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerlower.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerlower.cpp
new file mode 100644 (file)
index 0000000..9dc5ad3
--- /dev/null
@@ -0,0 +1,155 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerlower.cpp
+**     \brief Template File
+**
+**     $Id: layerlower.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerlower.h"
+#include "layermove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerLower);
+ACTION_SET_NAME(Action::LayerLower,"layer_lower");
+ACTION_SET_LOCAL_NAME(Action::LayerLower,"Lower Layer");
+ACTION_SET_TASK(Action::LayerLower,"lower");
+ACTION_SET_CATEGORY(Action::LayerLower,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerLower,10);
+ACTION_SET_VERSION(Action::LayerLower,"0.0");
+ACTION_SET_CVS_ID(Action::LayerLower,"$Id: layerlower.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerLower::LayerLower()
+{
+}
+
+Action::ParamVocab
+Action::LayerLower::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be lowered"))
+               .set_supports_multiple()
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerLower::is_canidate(const ParamList &x)
+{
+       if(!canidate_check(get_param_vocab(),x))
+               return false;
+       
+       Layer::Handle layer(x.find("layer")->second.get_layer());
+       //synfig::info("layer->get_depth()= %d ; layer->get_canvas()->size()=%d ;",layer->get_depth(),layer->get_canvas()->size());
+       if(layer->get_depth()+1>=layer->get_canvas()->size())
+               return false;
+       return true;
+}
+
+bool
+Action::LayerLower::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layers.push_back(param.get_layer());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerLower::is_ready()const
+{
+       if(layers.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerLower::prepare()
+{
+       std::list<synfig::Layer::Handle>::const_iterator iter;
+
+       clear();
+       
+       for(iter=layers.begin();iter!=layers.end();++iter)
+       {
+               Layer::Handle layer(*iter);
+               
+               Canvas::Handle subcanvas(layer->get_canvas());
+               
+               // Find the iterator for the layer
+               Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
+               
+               // If we couldn't find the layer in the canvas, then bail
+               if(*iter!=layer)
+                       throw Error(_("This layer doesn't exist anymore."));
+       
+               // If the subcanvas isn't the same as the canvas,
+               // then it had better be an inline canvas. If not,
+               // bail
+               //if(get_canvas()!=subcanvas && !subcanvas->is_inline())
+               //      throw Error(_("This layer doesn't belong to this canvas anymore"));
+               
+               int new_index=iter-subcanvas->begin();
+                               
+               new_index++;
+               
+               // If this lowers the layer past the bottom then don't bother
+               if(new_index==subcanvas->size())
+                       continue;
+               
+               Action::Handle layer_move(LayerMove::create());
+               
+               layer_move->set_param("canvas",get_canvas());
+               layer_move->set_param("canvas_interface",get_canvas_interface());
+               layer_move->set_param("layer",layer);
+               layer_move->set_param("new_index",new_index);
+               
+               add_action_front(layer_move);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerlower.h b/synfig-studio/trunk/src/synfigapp/actions/layerlower.h
new file mode 100644 (file)
index 0000000..dea21a2
--- /dev/null
@@ -0,0 +1,70 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerlower.h
+**     \brief Template File
+**
+**     $Id: layerlower.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERLOWER_H
+#define __SYNFIG_APP_ACTION_LAYERLOWER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+namespace Action {
+
+class LayerLower :
+       public Super
+{
+private:
+
+       std::list<synfig::Layer::Handle> layers;
+
+public:
+
+       LayerLower();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layermove.cpp b/synfig-studio/trunk/src/synfigapp/actions/layermove.cpp
new file mode 100644 (file)
index 0000000..2e7839f
--- /dev/null
@@ -0,0 +1,260 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layermove.cpp
+**     \brief Template File
+**
+**     $Id: layermove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layermove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerMove);
+ACTION_SET_NAME(Action::LayerMove,"layer_move");
+ACTION_SET_LOCAL_NAME(Action::LayerMove,_("Move Layer"));
+ACTION_SET_TASK(Action::LayerMove,"move");
+ACTION_SET_CATEGORY(Action::LayerMove,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerMove,0);
+ACTION_SET_VERSION(Action::LayerMove,"0.0");
+ACTION_SET_CVS_ID(Action::LayerMove,"$Id: layermove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+static const int nindex=-1;
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerMove::LayerMove():
+       new_index(0xdeadbeef)
+{
+}
+
+Action::ParamVocab
+Action::LayerMove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be moved"))
+       );
+
+       ret.push_back(ParamDesc("new_index",Param::TYPE_INTEGER)
+               .set_local_name(_("New Index"))
+               .set_desc(_("Where the layer is to be moved to"))
+       );
+
+       ret.push_back(ParamDesc("dest_canvas",Param::TYPE_CANVAS)
+               .set_local_name(_("Destination Canvas"))
+               .set_desc(_("The canvas the layer is to be moved to"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerMove::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerMove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+
+               layer=param.get_layer();
+               
+               return true;
+       }
+
+       if(name=="new_index" && param.get_type()==Param::TYPE_INTEGER)
+       {
+               new_index=param.get_integer();
+               
+               return true;
+       }
+
+       if(name=="dest_canvas" && param.get_type()==Param::TYPE_CANVAS)
+       {
+               dest_canvas=param.get_canvas();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerMove::is_ready()const
+{
+       synfig::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
+       if(!layer || (unsigned)new_index==0xdeadbeef)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerMove::perform()
+{              
+       synfig::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
+
+       Canvas::Handle subcanvas(layer->get_canvas());
+       src_canvas=subcanvas;
+       if(!dest_canvas)
+               dest_canvas=subcanvas;
+               
+       // Find the iterator for the layer
+       Canvas::iterator iter=find(src_canvas->begin(),src_canvas->end(),layer);
+       
+       // If we couldn't find the layer in the canvas, then bail
+       if(*iter!=layer)
+               throw Error(_("This layer doesn't exist anymore."));
+
+       synfig::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
+
+       // If the subcanvas isn't the same as the canvas,
+       // then it had better be an inline canvas. If not,
+       // bail
+       //if(get_canvas()!=subcanvas && !subcanvas->is_inline())
+       if(get_canvas()->get_root()!=dest_canvas->get_root() || get_canvas()->get_root()!=src_canvas->get_root())
+               throw Error(_("You cannot directly move layers across compositions"));
+       
+       old_index=iter-src_canvas->begin();
+       int depth;
+       
+       if(new_index<0)
+               depth=dest_canvas->size()+new_index+1;
+       else
+               depth=new_index;
+       
+       set_dirty(layer->active());
+
+       synfig::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
+
+       // If we were to move it to where it is
+       if(old_index==depth && src_canvas==dest_canvas)
+               return;
+       
+       if(depth>dest_canvas->size())
+               depth=dest_canvas->size();
+       if(depth<0)
+               depth=0;
+               
+       src_canvas->erase(iter);
+       
+       dest_canvas->insert(dest_canvas->begin()+depth,layer);          
+       layer->set_canvas(dest_canvas);
+       
+       layer->changed();
+       dest_canvas->changed(); if(dest_canvas!=src_canvas) src_canvas->changed();
+       
+       synfig::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
+       
+       if(get_canvas_interface())
+       {
+               if(src_canvas==dest_canvas)
+               {
+                       if(new_index==old_index-1)      // Raise
+                               get_canvas_interface()->signal_layer_raised()(layer);
+                       else if(new_index==old_index+1) // Lower
+                               get_canvas_interface()->signal_layer_lowered()(layer);
+                       else            // Moved
+                       {
+                               get_canvas_interface()->signal_layer_moved()(layer,depth,dest_canvas);
+                       }
+               }
+               else
+               {
+                       get_canvas_interface()->signal_layer_moved()(layer,depth,dest_canvas);
+               }
+       }
+       else synfig::warning("CanvasInterface not set on action");
+
+       synfig::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());
+}
+
+void
+Action::LayerMove::undo()
+{
+       // Find the iterator for the layer
+       Canvas::iterator iter=find(dest_canvas->begin(),dest_canvas->end(),layer);
+       
+       // If we couldn't find the layer in the canvas, then bail
+       if(*iter!=layer || (get_canvas()!=dest_canvas && !dest_canvas->is_inline()))
+               throw Error(_("This layer doesn't exist anymore."));
+       
+       // If we were to move it to where it is
+       if(old_index==new_index && src_canvas==dest_canvas)
+               return;
+
+       // Mark ourselves as dirty if necessary
+       set_dirty(layer->active());
+
+       dest_canvas->erase(iter);
+       
+       src_canvas->insert(src_canvas->begin()+old_index,layer);
+       layer->set_canvas(src_canvas);
+
+       layer->changed();
+       dest_canvas->changed(); if(dest_canvas!=src_canvas) src_canvas->changed();
+       
+       // Execute any signals
+       if(get_canvas_interface())
+       {
+               if(src_canvas==dest_canvas)
+               {
+                       if(new_index==old_index+1)      // Raise
+                               get_canvas_interface()->signal_layer_raised()(layer);
+                       else if(new_index==old_index-1) // Lower
+                               get_canvas_interface()->signal_layer_lowered()(layer);
+                       else            // Moved
+                       {
+                       get_canvas_interface()->signal_layer_moved()(layer,old_index,src_canvas);
+                       }
+               }
+               else
+               {
+                       get_canvas_interface()->signal_layer_moved()(layer,old_index,src_canvas);
+                       //get_canvas_interface()->signal_layer_removed()(layer);        
+                       //get_canvas_interface()->signal_layer_inserted()(layer,old_index);
+               }
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layermove.h b/synfig-studio/trunk/src/synfigapp/actions/layermove.h
new file mode 100644 (file)
index 0000000..3826b44
--- /dev/null
@@ -0,0 +1,78 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layermove.h
+**     \brief Template File
+**
+**     $Id: layermove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERMOVE_H
+#define __SYNFIG_APP_ACTION_LAYERMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class LayerMove :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Layer::Handle layer;
+       int old_index;
+       int new_index;
+
+       synfig::Canvas::Handle src_canvas;
+       synfig::Canvas::Handle dest_canvas;
+
+public:
+
+       LayerMove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerparamconnect.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerparamconnect.cpp
new file mode 100644 (file)
index 0000000..fae6803
--- /dev/null
@@ -0,0 +1,187 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerparamconnect.cpp
+**     \brief Template File
+**
+**     $Id: layerparamconnect.cpp,v 1.2 2005/01/16 19:55:57 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerparamconnect.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerParamConnect);
+ACTION_SET_NAME(Action::LayerParamConnect,"layer_param_connect");
+ACTION_SET_LOCAL_NAME(Action::LayerParamConnect,_("Connect Layer Parameter"));
+ACTION_SET_TASK(Action::LayerParamConnect,"connect");
+ACTION_SET_CATEGORY(Action::LayerParamConnect,Action::CATEGORY_LAYER|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::LayerParamConnect,0);
+ACTION_SET_VERSION(Action::LayerParamConnect,"0.0");
+ACTION_SET_CVS_ID(Action::LayerParamConnect,"$Id: layerparamconnect.cpp,v 1.2 2005/01/16 19:55:57 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerParamConnect::LayerParamConnect()
+{
+}
+
+Action::ParamVocab
+Action::LayerParamConnect::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+       );
+
+       ret.push_back(ParamDesc("param",Param::TYPE_STRING)
+               .set_local_name(_("Param"))
+       );
+
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerParamConnect::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerParamConnect::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layer=param.get_layer();
+               
+               return true;
+       }
+
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=param.get_value_node();
+               
+               return true;
+       }
+
+       if(name=="param" && param.get_type()==Param::TYPE_STRING)
+       {
+               param_name=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerParamConnect::is_ready()const
+{
+       if(!layer)
+               synfig::warning("Action::LayerParamConnect: Missing \"layer\"");
+       if(!value_node)
+               synfig::warning("Action::LayerParamConnect: Missing \"value_node\"");
+       if(param_name.empty())
+               synfig::warning("Action::LayerParamConnect: Missing \"param\"");
+       
+       if(!layer || !value_node || param_name.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerParamConnect::perform()
+{
+       // See if the parameter is dynamic
+       if(layer->dynamic_param_list().count(param_name))
+               old_value_node=layer->dynamic_param_list().find(param_name)->second;
+       else
+       {
+               old_value_node=0;
+       }
+
+       old_value=layer->get_param(param_name);
+       if(!old_value.is_valid())
+               throw Error(_("Layer did not recognise parameter name"));               
+
+       if(!layer->set_param(param_name,(*value_node)(0)))
+               throw Error(_("Bad connection"));
+       
+       layer->connect_dynamic_param(param_name,value_node);
+
+       layer->changed();
+       value_node->changed();
+/*     if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
+               //get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+*/
+}
+
+void
+Action::LayerParamConnect::undo()
+{
+       if(old_value_node)
+               layer->connect_dynamic_param(param_name,old_value_node);
+       else
+       {
+               layer->disconnect_dynamic_param(param_name);
+               layer->set_param(param_name,old_value);
+       }
+       
+       layer->changed();
+       if(old_value_node)
+               old_value_node->changed();
+       /*
+       if(layer->active())
+               set_dirty(true);
+       else
+               set_dirty(false);
+       */
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
+               //if(old_value_node)get_canvas_interface()->signal_value_node_changed()(old_value_node);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerparamconnect.h b/synfig-studio/trunk/src/synfigapp/actions/layerparamconnect.h
new file mode 100644 (file)
index 0000000..dfa42a4
--- /dev/null
@@ -0,0 +1,78 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerparamconnect.h
+**     \brief Template File
+**
+**     $Id: layerparamconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERPARAMCONNECT_H
+#define __SYNFIG_APP_ACTION_LAYERPARAMCONNECT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class LayerParamConnect :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Layer::Handle layer;
+       synfig::String  param_name;
+       synfig::ValueNode::Handle       value_node;
+       synfig::ValueNode::Handle       old_value_node;
+       synfig::ValueBase old_value;
+
+
+public:
+
+       LayerParamConnect();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerparamdisconnect.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerparamdisconnect.cpp
new file mode 100644 (file)
index 0000000..d993ea3
--- /dev/null
@@ -0,0 +1,176 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerparamdisconnect.cpp
+**     \brief Template File
+**
+**     $Id: layerparamdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerparamdisconnect.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerParamDisconnect);
+ACTION_SET_NAME(Action::LayerParamDisconnect,"layer_param_disconnect");
+ACTION_SET_LOCAL_NAME(Action::LayerParamDisconnect,_("Disconnect Layer Parameter"));
+ACTION_SET_TASK(Action::LayerParamDisconnect,"disconnect");
+ACTION_SET_CATEGORY(Action::LayerParamDisconnect,Action::CATEGORY_LAYER|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::LayerParamDisconnect,0);
+ACTION_SET_VERSION(Action::LayerParamDisconnect,"0.0");
+ACTION_SET_CVS_ID(Action::LayerParamDisconnect,"$Id: layerparamdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerParamDisconnect::LayerParamDisconnect():
+       time(0)
+{
+       
+}
+
+Action::ParamVocab
+Action::LayerParamDisconnect::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+       );
+
+       ret.push_back(ParamDesc("param",Param::TYPE_STRING)
+               .set_local_name(_("Param"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_STRING)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerParamDisconnect::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerParamDisconnect::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layer=param.get_layer();
+               
+               return true;
+       }
+
+       if(name=="param" && param.get_type()==Param::TYPE_STRING)
+       {
+               param_name=param.get_string();
+               
+               return true;
+       }
+
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerParamDisconnect::is_ready()const
+{
+       if(!layer || param_name.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerParamDisconnect::perform()
+{
+       if(!layer->dynamic_param_list().count(param_name))
+               throw Error(_("Layer Parameter is not connected to anything"));
+
+       old_value_node=layer->dynamic_param_list().find(param_name)->second;
+       layer->disconnect_dynamic_param(param_name);
+       
+       if(new_value_node || ValueNode_DynamicList::Handle::cast_dynamic(old_value_node))
+       {
+               if(!new_value_node)
+                       new_value_node=old_value_node.clone();
+               layer->connect_dynamic_param(param_name,new_value_node);
+       }
+       else
+               layer->set_param(param_name,(*old_value_node)(time));
+       
+       layer->changed();
+       old_value_node->changed();
+
+       set_dirty(false);
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
+       }
+}
+
+void
+Action::LayerParamDisconnect::undo()
+{
+       layer->connect_dynamic_param(param_name,old_value_node);
+       
+/*     if(layer->active() && get_canvas()->get_time()!=time)
+               set_dirty(true);
+       else
+               set_dirty(false);
+*/
+       layer->changed();
+       old_value_node->changed();
+
+       set_dirty(false);
+
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerparamdisconnect.h b/synfig-studio/trunk/src/synfigapp/actions/layerparamdisconnect.h
new file mode 100644 (file)
index 0000000..f28f18d
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerparamdisconnect.h
+**     \brief Template File
+**
+**     $Id: layerparamdisconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERPARAMDISCONNECT_H
+#define __SYNFIG_APP_ACTION_LAYERPARAMDISCONNECT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class LayerParamDisconnect :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Layer::Handle layer;
+       synfig::String  param_name;
+       synfig::ValueNode::Handle       old_value_node;
+       synfig::ValueNode::Handle       new_value_node;
+       synfig::Time time;
+
+public:
+
+       LayerParamDisconnect();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerparamset.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerparamset.cpp
new file mode 100644 (file)
index 0000000..2b6fd1d
--- /dev/null
@@ -0,0 +1,170 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerparamset.cpp
+**     \brief Template File
+**
+**     $Id: layerparamset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerparamset.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerParamSet);
+ACTION_SET_NAME(Action::LayerParamSet,"layer_param_set");
+ACTION_SET_LOCAL_NAME(Action::LayerParamSet,_("Set Layer Parameter"));
+ACTION_SET_TASK(Action::LayerParamSet,"set");
+ACTION_SET_CATEGORY(Action::LayerParamSet,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerParamSet,0);
+ACTION_SET_VERSION(Action::LayerParamSet,"0.0");
+ACTION_SET_CVS_ID(Action::LayerParamSet,"$Id: layerparamset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerParamSet::LayerParamSet()
+{
+}
+
+Action::ParamVocab
+Action::LayerParamSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+       );
+
+       ret.push_back(ParamDesc("param",Param::TYPE_STRING)
+               .set_local_name(_("Param"))
+       );
+
+       ret.push_back(ParamDesc("new_value",Param::TYPE_VALUE)
+               .set_local_name(_("ValueBase"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerParamSet::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerParamSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layer=param.get_layer();
+               
+               return true;
+       }
+
+       if(name=="new_value" && param.get_type()==Param::TYPE_VALUE)
+       {
+               new_value=param.get_value();
+               
+               return true;
+       }
+
+       if(name=="param" && param.get_type()==Param::TYPE_STRING)
+       {
+               param_name=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerParamSet::is_ready()const
+{
+       if(!layer || !new_value.is_valid() || param_name.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerParamSet::perform()
+{
+       // See if the parameter is dynamic
+       if(layer->dynamic_param_list().count(param_name))
+               throw Error(_("ValueNode attached to Parameter."));
+
+       old_value=layer->get_param(param_name);
+       
+       if(!layer->set_param(param_name,new_value))
+               throw Error(_("Layer did not accept parameter."));
+
+       /*if(layer->active())
+               set_dirty(true);
+       else
+               set_dirty(false);
+       */
+       layer->changed();
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
+       }
+}
+
+void
+Action::LayerParamSet::undo()
+{
+       if(!layer->set_param(param_name,old_value))
+               throw Error(_("Layer did not accept parameter."));
+
+       /*
+       if(layer->active())
+               set_dirty(true);
+       else
+               set_dirty(false);
+       */
+       
+       layer->changed();
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_param_changed()(layer,param_name);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerparamset.h b/synfig-studio/trunk/src/synfigapp/actions/layerparamset.h
new file mode 100644 (file)
index 0000000..c3f941c
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerparamset.h
+**     \brief Template File
+**
+**     $Id: layerparamset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERPARAMSET_H
+#define __SYNFIG_APP_ACTION_LAYERPARAMSET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class LayerParamSet :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Layer::Handle layer;
+       synfig::String  param_name;
+       synfig::ValueBase       new_value;
+       synfig::ValueBase       old_value;
+
+
+public:
+
+       LayerParamSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerraise.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerraise.cpp
new file mode 100644 (file)
index 0000000..4c36f5e
--- /dev/null
@@ -0,0 +1,151 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerraise.cpp
+**     \brief Template File
+**
+**     $Id: layerraise.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerraise.h"
+#include "layermove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerRaise);
+ACTION_SET_NAME(Action::LayerRaise,"layer_raise");
+ACTION_SET_LOCAL_NAME(Action::LayerRaise,"Raise Layer");
+ACTION_SET_TASK(Action::LayerRaise,"raise");
+ACTION_SET_CATEGORY(Action::LayerRaise,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerRaise,9);
+ACTION_SET_VERSION(Action::LayerRaise,"0.0");
+ACTION_SET_CVS_ID(Action::LayerRaise,"$Id: layerraise.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerRaise::LayerRaise()
+{
+}
+
+Action::ParamVocab
+Action::LayerRaise::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be raised"))
+               .set_supports_multiple()
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerRaise::is_canidate(const ParamList &x)
+{
+       if(!canidate_check(get_param_vocab(),x))
+               return false;
+       if(x.find("layer")->second.get_layer()->get_depth()==0)
+               return false;
+       return true;
+}
+
+bool
+Action::LayerRaise::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layers.push_back(param.get_layer());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerRaise::is_ready()const
+{
+       if(layers.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerRaise::prepare()
+{
+       std::list<synfig::Layer::Handle>::reverse_iterator iter;
+
+       clear();
+       
+       for(iter=layers.rbegin();!(iter==layers.rend());++iter)
+       {
+               Layer::Handle layer(*iter);
+               
+               Canvas::Handle subcanvas(layer->get_canvas());
+               
+               // Find the iterator for the layer
+               Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
+               
+               // If we couldn't find the layer in the canvas, then bail
+               if(*iter!=layer)
+                       throw Error(_("This layer doesn't exist anymore."));
+       
+               // If the subcanvas isn't the same as the canvas,
+               // then it had better be an inline canvas. If not,
+               // bail
+               //if(get_canvas()!=subcanvas && !subcanvas->is_inline())
+               //      throw Error(_("This layer doesn't belong to this canvas anymore"));
+               
+               int new_index=iter-subcanvas->begin();
+               
+               if(new_index==0)
+                       continue;
+               
+               new_index--;
+               
+               Action::Handle layer_move(LayerMove::create());
+               
+               layer_move->set_param("canvas",get_canvas());
+               layer_move->set_param("canvas_interface",get_canvas_interface());
+               layer_move->set_param("layer",layer);
+               layer_move->set_param("new_index",new_index);
+               
+               add_action_front(layer_move);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerraise.h b/synfig-studio/trunk/src/synfigapp/actions/layerraise.h
new file mode 100644 (file)
index 0000000..38e45f9
--- /dev/null
@@ -0,0 +1,70 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layerraise.h
+**     \brief Template File
+**
+**     $Id: layerraise.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERRAISE_H
+#define __SYNFIG_APP_ACTION_LAYERRAISE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+namespace Action {
+
+class LayerRaise :
+       public Super
+{
+private:
+
+       std::list<synfig::Layer::Handle> layers;
+
+public:
+
+       LayerRaise();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp
new file mode 100644 (file)
index 0000000..ad6e72f
--- /dev/null
@@ -0,0 +1,180 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_layerremove.cpp
+**     \brief Template File
+**
+**     $Id: layerremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerremove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerRemove);
+ACTION_SET_NAME(Action::LayerRemove,"layer_remove");
+ACTION_SET_LOCAL_NAME(Action::LayerRemove,"Remove Layer");
+ACTION_SET_TASK(Action::LayerRemove,"remove");
+ACTION_SET_CATEGORY(Action::LayerRemove,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerRemove,0);
+ACTION_SET_VERSION(Action::LayerRemove,"0.0");
+ACTION_SET_CVS_ID(Action::LayerRemove,"$Id: layerremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerRemove::LayerRemove()
+{
+}
+
+Action::ParamVocab
+Action::LayerRemove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be deleted"))
+               .set_supports_multiple()
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerRemove::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerRemove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               std::pair<synfig::Layer::Handle,int> layer_pair;
+               layer_pair.first=param.get_layer();
+               layer_list.push_back(layer_pair);
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerRemove::is_ready()const
+{
+       if(layer_list.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerRemove::perform()
+{
+       std::list<std::pair<synfig::Layer::Handle,int> >::iterator iter;
+       for(iter=layer_list.begin();iter!=layer_list.end();++iter)
+       {
+               Layer::Handle layer(iter->first);
+//             int& depth(iter->second);
+               Canvas::Handle subcanvas(layer->get_canvas());
+
+               // Find the iterator for the layer
+               Canvas::iterator iter2=find(subcanvas->begin(),subcanvas->end(),layer);
+               
+               // If we couldn't find the layer in the canvas, then bail
+               if(*iter2!=layer)
+               {
+                       /*!     \fixme We should really undo all prior removals
+                       **      before we go throwing shit around */
+                       throw Error(_("This layer doesn't exist anymore."));
+               }
+               
+               // If the subcanvas isn't the same as the canvas,
+               // then it had better be an inline canvas. If not,
+               // bail
+               if(get_canvas()!=subcanvas && !subcanvas->is_inline())
+               {
+                       /*!     \fixme We should really undo all prior removals
+                       **      before we go throwing shit around */
+                       throw Error(_("This layer doesn't belong to this canvas anymore"));
+               }
+               
+               set_canvas(subcanvas);
+               
+               // Calculate the depth that the layer was at (For the undo)
+               iter->second=layer->get_depth();
+       
+               // Mark ourselves as dirty if necessary
+               set_dirty(layer->active());
+                       
+               // Remove the layer from the canvas
+               subcanvas->erase(iter2);
+               
+               // Signal that a layer has been removed
+               if(get_canvas_interface())
+                       get_canvas_interface()->signal_layer_removed()(layer);
+       }
+}
+
+void
+Action::LayerRemove::undo()
+{
+       std::list<std::pair<synfig::Layer::Handle,int> >::reverse_iterator iter;
+       for(iter=layer_list.rbegin();iter!=layer_list.rend();++iter)
+       {       
+               Layer::Handle layer(iter->first);
+               int& depth(iter->second);
+               
+               // Set the layer's canvas
+               layer->set_canvas(get_canvas());
+       
+               // Make sure that the depth is valid
+               if(get_canvas()->size()<depth)
+                       depth=get_canvas()->size();
+               
+               // Mark ourselves as dirty if necessary
+               set_dirty(layer->active());
+       
+               // Insert the layer into the canvas at the desired depth
+               get_canvas()->insert(get_canvas()->begin()+depth,layer);        
+               
+               // Signal that a layer has been inserted
+               if(get_canvas_interface())
+                       get_canvas_interface()->signal_layer_inserted()(layer,depth);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerremove.h b/synfig-studio/trunk/src/synfigapp/actions/layerremove.h
new file mode 100644 (file)
index 0000000..fde37dc
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file action_layerremove.h
+**     \brief Template File
+**
+**     $Id: layerremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERREMOVE_H
+#define __SYNFIG_APP_ACTION_LAYERREMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class LayerRemove :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       std::list<std::pair<synfig::Layer::Handle,int> > layer_list;
+       
+       //synfig::Layer::Handle layer;
+       //int depth;
+
+public:
+
+       LayerRemove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layersetdesc.cpp b/synfig-studio/trunk/src/synfigapp/actions/layersetdesc.cpp
new file mode 100644 (file)
index 0000000..e9597c1
--- /dev/null
@@ -0,0 +1,141 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layersetdesc.cpp
+**     \brief Template File
+**
+**     $Id: layersetdesc.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layersetdesc.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::LayerSetDesc);
+ACTION_SET_NAME(Action::LayerSetDesc,"layer_set_desc");
+ACTION_SET_LOCAL_NAME(Action::LayerSetDesc,_("Set Layer Description"));
+ACTION_SET_TASK(Action::LayerSetDesc,"set_desc");
+ACTION_SET_CATEGORY(Action::LayerSetDesc,Action::CATEGORY_LAYER);
+ACTION_SET_PRIORITY(Action::LayerSetDesc,0);
+ACTION_SET_VERSION(Action::LayerSetDesc,"0.0");
+ACTION_SET_CVS_ID(Action::LayerSetDesc,"$Id: layersetdesc.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+static const int nindex=-1;
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::LayerSetDesc::LayerSetDesc()
+{
+}
+
+Action::ParamVocab
+Action::LayerSetDesc::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
+               .set_local_name(_("Layer"))
+               .set_desc(_("Layer to be moved"))
+       );
+
+       ret.push_back(ParamDesc("new_description",Param::TYPE_STRING)
+               .set_local_name(_("New Description"))
+               .set_local_name(_("Enter a new description for this layer"))
+               .set_user_supplied()
+       );
+       
+       return ret;
+}
+
+bool
+Action::LayerSetDesc::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::LayerSetDesc::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="layer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               layer=param.get_layer();
+               
+               return true;
+       }
+
+       if(name=="new_description" && param.get_type()==Param::TYPE_STRING)
+       {
+               new_description=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::LayerSetDesc::is_ready()const
+{
+       if(!layer)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::LayerSetDesc::perform()
+{
+       old_description=layer->get_description();
+       layer->set_description(new_description);
+       set_dirty(false);
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_new_description()(layer,new_description);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::LayerSetDesc::undo()
+{
+       layer->set_description(old_description);
+       set_dirty(false);
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_layer_new_description()(layer,old_description);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/layersetdesc.h b/synfig-studio/trunk/src/synfigapp/actions/layersetdesc.h
new file mode 100644 (file)
index 0000000..7e646d0
--- /dev/null
@@ -0,0 +1,75 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file layersetdesc.h
+**     \brief Template File
+**
+**     $Id: layersetdesc.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_LAYERSETDSEC_H
+#define __SYNFIG_APP_ACTION_LAYERSETDSEC_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class LayerSetDesc :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Layer::Handle layer;
+       synfig::String old_description;
+       synfig::String new_description;
+
+public:
+
+       LayerSetDesc();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/timepointscopy.cpp b/synfig-studio/trunk/src/synfigapp/actions/timepointscopy.cpp
new file mode 100644 (file)
index 0000000..f13999b
--- /dev/null
@@ -0,0 +1,322 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file timepointscopy.cpp
+**     \brief Copy the Time Points File
+**
+**     $Id: timepointscopy.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "timepointscopy.h"
+#include <synfig/layer_pastecanvas.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_animated.h>
+
+#include "activepointsimpleadd.h"
+#include "waypointsimpleadd.h"
+#include <synfigapp/timegather.h>
+
+#include <typeinfo>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::TimepointsCopy);
+ACTION_SET_NAME(Action::TimepointsCopy,"timepoint_copy");
+ACTION_SET_LOCAL_NAME(Action::TimepointsCopy,"Copy Time Points");
+ACTION_SET_TASK(Action::TimepointsCopy,"copy");
+ACTION_SET_CATEGORY(Action::TimepointsCopy,Action::CATEGORY_WAYPOINT|Action::CATEGORY_ACTIVEPOINT);
+ACTION_SET_PRIORITY(Action::TimepointsCopy,0);
+ACTION_SET_VERSION(Action::TimepointsCopy,"0.0");
+ACTION_SET_CVS_ID(Action::TimepointsCopy,"$Id: timepointscopy.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::TimepointsCopy::TimepointsCopy()
+{
+       timedelta = 0;
+       set_dirty(false);
+}
+
+Action::ParamVocab
+Action::TimepointsCopy::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("addlayer",Param::TYPE_VALUE)
+               .set_local_name(_("New Selected Layer"))
+               .set_desc(_("A layer to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addcanvas",Param::TYPE_CANVAS)
+               .set_local_name(_("New Selected Canvas"))
+               .set_desc(_("A canvas to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addvaluedesc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("New Selected ValueBase"))
+               .set_desc(_("A valuenode's description to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addtime",Param::TYPE_TIME)
+               .set_local_name(_("New Selected Time Point"))
+               .set_desc(_("A time point to add to our selected list"))
+               .set_supports_multiple()
+       );
+       
+       ret.push_back(ParamDesc("deltatime",Param::TYPE_TIME)
+               .set_local_name(_("Time adjustment"))
+               .set_desc(_("The amount of time to adjust all the selected points"))
+       );
+
+       return ret;
+}
+
+bool
+Action::TimepointsCopy::is_canidate(const ParamList &x)
+{
+       if(!canidate_check(get_param_vocab(),x)) 
+               return false;
+       
+       if(     x.find("addlayer") == x.end() && 
+               x.find("addcanvas") == x.end() && 
+               x.find("addvaluedesc") == x.end())
+               return false;
+       return true;
+}
+
+bool
+Action::TimepointsCopy::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="addlayer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               //add a layer to the list
+               sel_layers.push_back(param.get_layer());
+               //synfig::info("action got layer");
+               
+               return true;
+       }
+       
+       if(name=="addcanvas" && param.get_type()==Param::TYPE_CANVAS)
+       {
+               //add a layer to the list
+               sel_canvases.push_back(param.get_canvas());
+               //synfig::info("action got canvas");
+               
+               return true;
+       }
+       
+       if(name=="addvaluedesc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               //add a layer to the list
+               sel_values.push_back(param.get_value_desc());
+               //synfig::info("action got valuedesc");
+               
+               return true;
+       }
+       
+       if(name=="addtime" && param.get_type()==Param::TYPE_TIME)
+       {
+               //add a layer to the list
+               sel_times.insert(param.get_time());
+               //synfig::info("action got time");
+               
+               return true;
+       }
+       
+       if(name=="deltatime" && param.get_type()==Param::TYPE_TIME)
+       {
+               timedelta = param.get_time();
+               //synfig::info("action got time to move");
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::TimepointsCopy::is_ready()const
+{
+       if((sel_layers.empty() && sel_canvases.empty() && sel_values.empty()) || sel_times.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::TimepointsCopy::prepare()
+{
+       clear();
+       
+       //synfig::info("Preparing TimepointsCopy by %f secs",(float)timemove);
+       
+       if(sel_times.empty()) return;
+       
+       //all our lists should be set correctly...
+
+       //build our sub-action list
+       //      and yes we do need to store it temporarily so we don't duplicate 
+       //              an operation on a specific valuenode, etc....
+       timepoints_ref  match;
+       
+       Time fps = get_canvas()->rend_desc().get_frame_rate();
+       
+       //std::vector<synfig::Layer::Handle>
+       //synfig::info("Layers %d", sel_layers.size());
+       {
+               std::vector<synfig::Layer::Handle>::iterator i = sel_layers.begin(),
+                                                                                                       end = sel_layers.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a layer");
+                       recurse_layer(*i,sel_times,match);
+               }
+       }
+       
+       //std::vector<synfig::Canvas::Handle>   sel_canvases;
+       //synfig::info("Canvases %d", sel_canvases.size());
+       {
+               std::vector<synfig::Canvas::Handle>::iterator   i = sel_canvases.begin(),
+                                                                                                               end = sel_canvases.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a canvas");
+                       recurse_canvas(*i,sel_times,match);
+               }
+       }
+       
+       //std::vector<synfigapp::ValueDesc>
+       //synfig::info("ValueBasedescs %d", sel_values.size());
+       {
+               std::vector<synfigapp::ValueDesc>::iterator     i = sel_values.begin(),
+                                                                                                       end = sel_values.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a valuedesc");
+                       recurse_valuedesc(*i,sel_times,match);
+               }
+       }
+       
+       //synfig::info("built list of waypoints/activepoints to modify");
+       //synfig::info("\t There are %d waypoint sets and %d activepointsets", 
+       //                              match.waypointbiglist.size(), match.actpointbiglist.size());
+       //process the hell out of em...
+       {
+               //must build from both lists
+               timepoints_ref::waytracker::const_iterator      i = match.waypointbiglist.begin(),
+                                                                                                       end = match.waypointbiglist.end();
+               for(; i != end; ++i)
+               {
+                       //iterate through each waypoint for this specific valuenode
+                       std::set<synfig::Waypoint>::const_iterator      j = i->waypoints.begin(),
+                                                                                                               end = i->waypoints.end();                       
+                       for(; j != end; ++j)
+                       {
+                               Action::Handle action(WaypointSimpleAdd::create());
+               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_node",ValueNode::Handle(i->val));
+                               
+                               //synfig::info("add waypoint mod...");
+                               //NOTE: We may want to store the old time for undoing the action...
+                               Waypoint neww;
+                               Waypoint w = *j;
+                               w.set_time((w.get_time() + timedelta).round(fps));
+                               w.mimic(neww); //make sure the new waypoint has a new id
+                               
+                               action->set_param("waypoint",w);
+                               
+                               //run the action now that we've added everything
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                               
+                               add_action_front(action);
+                       }
+               }
+       }
+       {
+               //must build from both lists
+               timepoints_ref::acttracker::const_iterator      i = match.actpointbiglist.begin(),
+                                                                                                       end = match.actpointbiglist.end();
+               for(; i != end; ++i)
+               {
+                       //iterate through each activepoint for this specific valuenode
+                       std::set<synfig::Activepoint>::const_iterator   j = i->activepoints.begin(),
+                                                                                                                       jend = i->activepoints.end();
+                       for(; j != jend; ++j)
+                       {
+                               Action::Handle action(ActivepointSimpleAdd::create());
+                                       
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_desc",i->val);
+                               
+                               //NOTE: We may want to store the old time for undoing the action...
+                               Activepoint newa;
+                               Activepoint a = *j;
+                               a.set_time((a.get_time() + timedelta).round(fps));
+                               a.mimic(newa); //make sure the new activepoint has a new id
+                               
+                               action->set_param("activepoint",a);
+                               
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                               {
+                                       throw Error(Error::TYPE_NOTREADY);
+                               }
+                       
+                               add_action_front(action);
+                       }
+               }
+       }
+}
+
+void
+Action::TimepointsCopy::perform()
+{
+       Action::Super::perform();
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/timepointscopy.h b/synfig-studio/trunk/src/synfigapp/actions/timepointscopy.h
new file mode 100644 (file)
index 0000000..ca4cb8c
--- /dev/null
@@ -0,0 +1,81 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file timepointscopy.h
+**     \brief Copy the Time Points Header
+**
+**     $Id: timepointscopy.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_TIMEPOINTSCOPY_H
+#define __SYNFIG_APP_ACTION_TIMEPOINTSCOPY_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/time.h>
+#include <synfig/layer.h>
+#include <synfig/canvas.h>
+#include <synfigapp/value_desc.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class TimepointsCopy :
+       public Super
+{
+private:
+       
+       //process all the value descriptions that are selected (or are in subselections)
+       std::vector<synfig::Layer::Handle>      sel_layers;
+       std::vector<synfig::Canvas::Handle>     sel_canvases;
+       std::vector<synfigapp::ValueDesc>       sel_values;
+       std::set<synfig::Time>                          sel_times;
+       
+       synfig::Time                                                    timedelta;
+
+public:
+
+       TimepointsCopy();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+       virtual void perform();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/timepointsdelete.cpp b/synfig-studio/trunk/src/synfigapp/actions/timepointsdelete.cpp
new file mode 100644 (file)
index 0000000..7762162
--- /dev/null
@@ -0,0 +1,285 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file timepointsdelete.cpp
+**     \brief Delete the Time Points File
+**
+**     $Id: timepointsdelete.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "timepointsdelete.h"
+#include <synfig/layer_pastecanvas.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_animated.h>
+
+#include "activepointremove.h"
+#include "waypointremove.h"
+#include <synfigapp/timegather.h>
+
+#include <typeinfo>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::TimepointsDelete);
+ACTION_SET_NAME(Action::TimepointsDelete,"timepoint_delete");
+ACTION_SET_LOCAL_NAME(Action::TimepointsDelete,"Delete Time Points");
+ACTION_SET_TASK(Action::TimepointsDelete,"delete");
+ACTION_SET_CATEGORY(Action::TimepointsDelete,Action::CATEGORY_WAYPOINT|Action::CATEGORY_ACTIVEPOINT);
+ACTION_SET_PRIORITY(Action::TimepointsDelete,0);
+ACTION_SET_VERSION(Action::TimepointsDelete,"0.0");
+ACTION_SET_CVS_ID(Action::TimepointsDelete,"$Id: timepointsdelete.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::TimepointsDelete::TimepointsDelete()
+{
+       set_dirty(false);
+}
+
+Action::ParamVocab
+Action::TimepointsDelete::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("addlayer",Param::TYPE_VALUE)
+               .set_local_name(_("New Selected Layer"))
+               .set_desc(_("A layer to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addcanvas",Param::TYPE_CANVAS)
+               .set_local_name(_("New Selected Canvas"))
+               .set_desc(_("A canvas to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addvaluedesc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("New Selected ValueBase"))
+               .set_desc(_("A valuenode's description to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addtime",Param::TYPE_TIME)
+               .set_local_name(_("New Selected Time Point"))
+               .set_desc(_("A time point to add to our selected list"))
+               .set_supports_multiple()
+       );
+       
+       return ret;
+}
+
+bool
+Action::TimepointsDelete::is_canidate(const ParamList &x)
+{
+       if(!canidate_check(get_param_vocab(),x)) 
+               return false;
+       
+       if(     x.find("addlayer") == x.end() && 
+               x.find("addcanvas") == x.end() && 
+               x.find("addvaluedesc") == x.end())
+               return false;
+       return true;
+}
+
+bool
+Action::TimepointsDelete::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="addlayer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               //add a layer to the list
+               sel_layers.push_back(param.get_layer());
+               
+               return true;
+       }
+       
+       if(name=="addcanvas" && param.get_type()==Param::TYPE_CANVAS)
+       {
+               //add a layer to the list
+               sel_canvases.push_back(param.get_canvas());
+               
+               return true;
+       }
+       
+       if(name=="addvaluedesc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               //add a layer to the list
+               sel_values.push_back(param.get_value_desc());
+               
+               return true;
+       }
+       
+       if(name=="addtime" && param.get_type()==Param::TYPE_TIME)
+       {
+               //add a layer to the list
+               sel_times.insert(param.get_time());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::TimepointsDelete::is_ready()const
+{
+       if((sel_layers.empty() && sel_canvases.empty() && sel_values.empty()) || sel_times.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::TimepointsDelete::prepare()
+{
+       clear();
+       
+       if(sel_times.empty()) return;
+       
+       //all our lists should be set correctly...
+
+       //build our sub-action list
+       //      and yes we do need to store it temporarily so we don't duplicate 
+       //              an operation on a specific valuenode, etc....
+       timepoints_ref  match;
+       
+       Time fps = get_canvas()->rend_desc().get_frame_rate();
+       
+       //std::vector<synfig::Layer::Handle>
+       //synfig::info("Layers %d", sel_layers.size());
+       {
+               std::vector<synfig::Layer::Handle>::iterator i = sel_layers.begin(),
+                                                                                                       end = sel_layers.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a layer");
+                       recurse_layer(*i,sel_times,match);
+               }
+       }
+       
+       //std::vector<synfig::Canvas::Handle>   sel_canvases;
+       //synfig::info("Canvases %d", sel_canvases.size());
+       {
+               std::vector<synfig::Canvas::Handle>::iterator   i = sel_canvases.begin(),
+                                                                                                               end = sel_canvases.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a canvas");
+                       recurse_canvas(*i,sel_times,match);
+               }
+       }
+       
+       //std::vector<synfigapp::ValueDesc>
+       //synfig::info("ValueBasedescs %d", sel_values.size());
+       {
+               std::vector<synfigapp::ValueDesc>::iterator     i = sel_values.begin(),
+                                                                                                       end = sel_values.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a valuedesc");
+                       recurse_valuedesc(*i,sel_times,match);
+               }
+       }
+       
+       //process the hell out of em...
+       {
+               //must build from both lists
+               timepoints_ref::waytracker::const_iterator      i = match.waypointbiglist.begin(),
+                                                                                                       end = match.waypointbiglist.end();
+               for(; i != end; ++i)
+               {
+                       //iterate through each waypoint for this specific valuenode
+                       std::set<synfig::Waypoint>::const_iterator      j = i->waypoints.begin(),
+                                                                                                               end = i->waypoints.end();                       
+                       for(; j != end; ++j)
+                       {
+                               Action::Handle action(WaypointRemove::create());
+               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_node",ValueNode::Handle(i->val));
+                               action->set_param("waypoint",*j);
+                               
+                               //run the action now that we've added everything
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                               
+                               add_action_front(action);
+                       }
+               }
+       }
+       {
+               //must build from both lists
+               timepoints_ref::acttracker::const_iterator      i = match.actpointbiglist.begin(),
+                                                                                                       end = match.actpointbiglist.end();
+               for(; i != end; ++i)
+               {
+                       //iterate through each activepoint for this specific valuenode
+                       std::set<synfig::Activepoint>::const_iterator   j = i->activepoints.begin(),
+                                                                                                                       jend = i->activepoints.end();
+                       for(; j != jend; ++j)
+                       {
+                               Action::Handle action(ActivepointRemove::create());
+                                       
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_desc",i->val);
+                               action->set_param("activepoint",*j);
+                               
+                               //run the action now that everything should be in order
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                               {
+                                       throw Error(Error::TYPE_NOTREADY);
+                               }
+                       
+                               add_action_front(action);
+                       }
+               }
+       }
+}
+
+void
+Action::TimepointsDelete::perform()
+{
+       Action::Super::perform();
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/timepointsdelete.h b/synfig-studio/trunk/src/synfigapp/actions/timepointsdelete.h
new file mode 100644 (file)
index 0000000..8476684
--- /dev/null
@@ -0,0 +1,79 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file timepointsdelete.h
+**     \brief Delete the Time Points Header
+**
+**     $Id: timepointsdelete.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_TIMEPOINTSDELETE_H
+#define __SYNFIG_APP_ACTION_TIMEPOINTSDELETE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/time.h>
+#include <synfig/layer.h>
+#include <synfig/canvas.h>
+#include <synfigapp/value_desc.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class TimepointsDelete :
+       public Super
+{
+private:
+       
+       //process all the value descriptions that are selected (or are in subselections)
+       std::vector<synfig::Layer::Handle>      sel_layers;
+       std::vector<synfig::Canvas::Handle>     sel_canvases;
+       std::vector<synfigapp::ValueDesc>       sel_values;
+       std::set<synfig::Time>                          sel_times;
+
+public:
+
+       TimepointsDelete();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+       virtual void perform();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/timepointsmove.cpp b/synfig-studio/trunk/src/synfigapp/actions/timepointsmove.cpp
new file mode 100644 (file)
index 0000000..2c95950
--- /dev/null
@@ -0,0 +1,327 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file timepointsmove.cpp
+**     \brief Move the Time Points File
+**
+**     $Id: timepointsmove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "timepointsmove.h"
+#include <synfig/layer_pastecanvas.h>
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_animated.h>
+
+#include "activepointset.h"
+#include "waypointset.h"
+#include <synfigapp/timegather.h>
+
+#include <typeinfo>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::TimepointsMove);
+ACTION_SET_NAME(Action::TimepointsMove,"timepoint_move");
+ACTION_SET_LOCAL_NAME(Action::TimepointsMove,"Move Time Points");
+ACTION_SET_TASK(Action::TimepointsMove,"move");
+ACTION_SET_CATEGORY(Action::TimepointsMove,Action::CATEGORY_WAYPOINT|Action::CATEGORY_ACTIVEPOINT);
+ACTION_SET_PRIORITY(Action::TimepointsMove,0);
+ACTION_SET_VERSION(Action::TimepointsMove,"0.0");
+ACTION_SET_CVS_ID(Action::TimepointsMove,"$Id: timepointsmove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::TimepointsMove::TimepointsMove()
+{
+       timemove = 0;
+       set_dirty(false);
+}
+
+Action::ParamVocab
+Action::TimepointsMove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("addlayer",Param::TYPE_VALUE)
+               .set_local_name(_("New Selected Layer"))
+               .set_desc(_("A layer to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addcanvas",Param::TYPE_CANVAS)
+               .set_local_name(_("New Selected Canvas"))
+               .set_desc(_("A canvas to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addvaluedesc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("New Selected ValueBase"))
+               .set_desc(_("A valuenode's description to add to our selected list"))
+               .set_supports_multiple()
+               .set_optional()
+       );
+       
+       ret.push_back(ParamDesc("addtime",Param::TYPE_TIME)
+               .set_local_name(_("New Selected Time Point"))
+               .set_desc(_("A time point to add to our selected list"))
+               .set_supports_multiple()
+       );
+       
+       ret.push_back(ParamDesc("deltatime",Param::TYPE_TIME)
+               .set_local_name(_("Time adjustment"))
+               .set_desc(_("The amount of time to adjust all the selected points"))
+       );
+
+       return ret;
+}
+
+bool
+Action::TimepointsMove::is_canidate(const ParamList &x)
+{
+       if(!canidate_check(get_param_vocab(),x)) 
+               return false;
+       
+       if(     x.find("addlayer") == x.end() && 
+               x.find("addcanvas") == x.end() && 
+               x.find("addvaluedesc") == x.end())
+               return false;
+       return true;
+}
+
+bool
+Action::TimepointsMove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="addlayer" && param.get_type()==Param::TYPE_LAYER)
+       {
+               //add a layer to the list
+               sel_layers.push_back(param.get_layer());
+               //synfig::info("action got layer");
+               
+               return true;
+       }
+       
+       if(name=="addcanvas" && param.get_type()==Param::TYPE_CANVAS)
+       {
+               //add a layer to the list
+               sel_canvases.push_back(param.get_canvas());
+               //synfig::info("action got canvas");
+               
+               return true;
+       }
+       
+       if(name=="addvaluedesc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               //add a layer to the list
+               sel_values.push_back(param.get_value_desc());
+               //synfig::info("action got valuedesc");
+               
+               return true;
+       }
+       
+       if(name=="addtime" && param.get_type()==Param::TYPE_TIME)
+       {
+               //add a layer to the list
+               sel_times.insert(param.get_time());
+               //synfig::info("action got time");
+               
+               return true;
+       }
+       
+       if(name=="deltatime" && param.get_type()==Param::TYPE_TIME)
+       {
+               timemove = param.get_time();
+               //synfig::info("action got time to move");
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::TimepointsMove::is_ready()const
+{
+       if((sel_layers.empty() && sel_canvases.empty() && sel_values.empty()) || sel_times.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::TimepointsMove::prepare()
+{
+       clear();
+       
+       //synfig::info("Preparing TimepointsMove by %f secs",(float)timemove);
+       
+       if(sel_times.empty()) return;
+       
+       //all our lists should be set correctly...
+       
+       /*{
+               std::set<synfig::Time>::iterator i = sel_times.begin(), end = sel_times.end();
+               
+               for(; i != end; ++i)
+               {
+                       synfig::info("Time %f", (float)*i);
+               }               
+       }*/
+
+       //build our sub-action list
+       //      and yes we do need to store it temporarily so we don't duplicate 
+       //              an operation on a specific valuenode, etc....
+       timepoints_ref  match;
+       
+       Time fps = get_canvas()->rend_desc().get_frame_rate();
+       
+       //std::vector<synfig::Layer::Handle>
+       //synfig::info("Layers %d", sel_layers.size());
+       {
+               std::vector<synfig::Layer::Handle>::iterator i = sel_layers.begin(),
+                                                                                                       end = sel_layers.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a layer");
+                       recurse_layer(*i,sel_times,match);
+               }
+       }
+       
+       //std::vector<synfig::Canvas::Handle>   sel_canvases;
+       //synfig::info("Canvases %d", sel_canvases.size());
+       {
+               std::vector<synfig::Canvas::Handle>::iterator   i = sel_canvases.begin(),
+                                                                                                               end = sel_canvases.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a canvas");
+                       recurse_canvas(*i,sel_times,match);
+               }
+       }
+       
+       //std::vector<synfigapp::ValueDesc>
+       //synfig::info("ValueBasedescs %d", sel_values.size());
+       {
+               std::vector<synfigapp::ValueDesc>::iterator     i = sel_values.begin(),
+                                                                                                       end = sel_values.end();
+               
+               for(; i != end; ++i)
+               {
+                       //synfig::info("Recurse through a valuedesc");
+                       recurse_valuedesc(*i,sel_times,match);
+               }
+       }
+       
+       //synfig::info("built list of waypoints/activepoints to modify");
+       //synfig::info("\t There are %d waypoint sets and %d activepointsets", 
+       //                              match.waypointbiglist.size(), match.actpointbiglist.size());
+       //process the hell out of em...
+       {
+               //must build from both lists
+               timepoints_ref::waytracker::const_iterator      i = match.waypointbiglist.begin(),
+                                                                                                       end = match.waypointbiglist.end();
+               for(; i != end; ++i)
+               {
+                       Action::Handle action(WaypointSet::create());
+               
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("value_node",ValueNode::Handle(i->val));
+                       
+                       //iterate through each waypoint for this specific valuenode
+                       std::set<synfig::Waypoint>::const_iterator      j = i->waypoints.begin(),
+                                                                                                               end = i->waypoints.end();                       
+                       for(; j != end; ++j)
+                       {                               
+                               //synfig::info("add waypoint mod...");
+                               //NOTE: We may want to store the old time for undoing the action...
+                               Waypoint w = *j;
+                               w.set_time((w.get_time() + timemove).round(fps));
+                               action->set_param("waypoint",w);
+                       }
+                       
+                       //run the action now that we've added everything
+                       assert(action->is_ready());
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+                       
+                       add_action_front(action);
+               }
+       }
+       {
+               //must build from both lists
+               timepoints_ref::acttracker::const_iterator      i = match.actpointbiglist.begin(),
+                                                                                                       end = match.actpointbiglist.end();
+               for(; i != end; ++i)
+               {
+                       Action::Handle action(ActivepointSet::create());
+                                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("value_desc",i->val);
+                       
+                       //iterate through each activepoint for this specific valuenode
+                       std::set<synfig::Activepoint>::const_iterator   j = i->activepoints.begin(),
+                                                                                                                       jend = i->activepoints.end();
+                       for(; j != jend; ++j)
+                       {
+                               //synfig::info("add activepoint mod...");
+                               
+                               //NOTE: We may want to store the old time for undoing the action...
+                               Activepoint a = *j;
+                               a.set_time((a.get_time() + timemove).round(fps));
+                               action->set_param("activepoint",a);
+                       }
+                       
+                       assert(action->is_ready());
+                       if(!action->is_ready())
+                       {
+                               throw Error(Error::TYPE_NOTREADY);
+                       }
+               
+                       add_action_front(action);
+               }
+       }
+}
+
+void
+Action::TimepointsMove::perform()
+{
+       Action::Super::perform();
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/timepointsmove.h b/synfig-studio/trunk/src/synfigapp/actions/timepointsmove.h
new file mode 100644 (file)
index 0000000..f48eb49
--- /dev/null
@@ -0,0 +1,84 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file timepointsmove.h
+**     \brief Move the Time Points Header
+**
+**     $Id: timepointsmove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_TIMEPOINTSMOVE_H
+#define __SYNFIG_APP_ACTION_TIMEPOINTSMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/time.h>
+#include <synfig/layer.h>
+#include <synfig/canvas.h>
+#include <synfigapp/value_desc.h>
+
+#include <vector>
+#include <set>
+
+/* === 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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class TimepointsMove :
+       public Super
+{
+private:
+       
+       //process all the value descriptions that are selected (or are in subselections)
+       std::vector<synfig::Layer::Handle>      sel_layers;
+       std::vector<synfig::Canvas::Handle>     sel_canvases;
+       std::vector<synfigapp::ValueDesc>       sel_values;
+       std::set<synfig::Time>                          sel_times;
+       
+       synfig::Time                                                    timemove;
+
+public:
+
+       TimepointsMove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+       virtual void perform();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.cpp
new file mode 100644 (file)
index 0000000..599d686
--- /dev/null
@@ -0,0 +1,216 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescconnect.cpp
+**     \brief Template File
+**
+**     $Id: valuedescconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerparamconnect.h"
+#include "valuenodelinkconnect.h"
+#include "valuenodereplace.h"
+
+#include "valuedescconnect.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueDescConnect);
+ACTION_SET_NAME(Action::ValueDescConnect,"value_desc_connect");
+ACTION_SET_LOCAL_NAME(Action::ValueDescConnect,"Connect");
+ACTION_SET_TASK(Action::ValueDescConnect,"connect");
+ACTION_SET_CATEGORY(Action::ValueDescConnect,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueDescConnect,0);
+ACTION_SET_VERSION(Action::ValueDescConnect,"0.0");
+ACTION_SET_CVS_ID(Action::ValueDescConnect,"$Id: valuedescconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueDescConnect::ValueDescConnect()
+{
+}
+
+Action::ParamVocab
+Action::ValueDescConnect::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("dest",Param::TYPE_VALUEDESC)
+               .set_local_name(_("Destination ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("src",Param::TYPE_VALUENODE)
+               .set_local_name(_("Source ValueNode"))
+               .set_mutual_exclusion("src_name")
+       );
+
+       ret.push_back(ParamDesc("src_name",Param::TYPE_STRING)
+               .set_local_name(_("Source ValueNode Name"))
+               .set_mutual_exclusion("src")
+               .set_user_supplied()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueDescConnect::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               if(x.count("src"))
+               {
+                       ValueDesc value_desc=x.find("dest")->second.get_value_desc();
+                       ValueNode::Handle value_node=x.find("src")->second.get_value_node();
+                       if(value_desc.get_value_type()==value_node->get_type()) 
+                               return true;
+               }
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueDescConnect::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="dest" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               value_desc=param.get_value_desc();
+               
+               return true;
+       }
+
+       if(name=="src" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=param.get_value_node();
+               
+               return true;
+       }
+
+       if(!value_node_name.empty() && !value_node && name=="canvas" && param.get_type()==Param::TYPE_CANVAS)
+       {
+               value_node=param.get_canvas()->find_value_node(value_node_name);
+       }
+       
+       if(name=="src_name" && param.get_type()==Param::TYPE_STRING)
+       {
+               value_node_name=param.get_string();
+               
+               if(get_canvas())
+               {
+                       value_node=get_canvas()->find_value_node(value_node_name);
+                       if(!value_node)
+                               return false;
+               }
+               
+               return true;
+       }
+       
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueDescConnect::is_ready()const
+{
+       if(!value_desc || !value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueDescConnect::prepare()
+{
+       clear();
+
+       if(value_desc.parent_is_canvas())
+       {                               
+               ValueNode::Handle dest_value_node;
+               dest_value_node=value_desc.get_value_node();
+
+               Action::Handle action(ValueNodeReplace::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("src",value_node);
+               action->set_param("dest",value_desc.get_value_node());
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       else
+       if(value_desc.parent_is_linkable_value_node())
+       {
+               Action::Handle action(ValueNodeLinkConnect::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("parent_value_node",value_desc.get_parent_value_node());
+               action->set_param("value_node", value_node);
+               action->set_param("index",value_desc.get_index());
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       else
+       if(value_desc.parent_is_layer_param())
+       {
+               Action::Handle action(LayerParamConnect::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("layer",value_desc.get_layer());
+               action->set_param("param",value_desc.get_param_name());
+               action->set_param("value_node",value_node);
+       
+               assert(action->is_ready());             
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       
+       throw Error(_("ValueDesc is not recognised or supported."));    
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.h b/synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.h
new file mode 100644 (file)
index 0000000..982fd80
--- /dev/null
@@ -0,0 +1,72 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescconnect.h
+**     \brief Template File
+**
+**     $Id: valuedescconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUEDESCCONNECT_H
+#define __SYNFIG_APP_ACTION_VALUEDESCCONNECT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.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 synfigapp {
+
+namespace Action {
+
+class ValueDescConnect :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::ValueNode::Handle value_node;
+       synfig::String value_node_name;
+
+public:
+
+       ValueDescConnect();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescconvert.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescconvert.cpp
new file mode 100644 (file)
index 0000000..4b9a59c
--- /dev/null
@@ -0,0 +1,224 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescconvert.cpp
+**     \brief Template File
+**
+**     $Id: valuedescconvert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodereplace.h"
+#include "layerparamconnect.h"
+#include "valuenodelinkconnect.h"
+*/
+
+#include "valuedescconnect.h"
+
+#include "valuedescconvert.h"
+
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_const.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueDescConvert);
+ACTION_SET_NAME(Action::ValueDescConvert,"value_desc_convert");
+ACTION_SET_LOCAL_NAME(Action::ValueDescConvert,"Convert");
+ACTION_SET_TASK(Action::ValueDescConvert,"convert");
+ACTION_SET_CATEGORY(Action::ValueDescConvert,Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ValueDescConvert,0);
+ACTION_SET_VERSION(Action::ValueDescConvert,"0.0");
+ACTION_SET_CVS_ID(Action::ValueDescConvert,"$Id: valuedescconvert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueDescConvert::ValueDescConvert()
+{
+}
+
+Action::ParamVocab
+Action::ValueDescConvert::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("type",Param::TYPE_STRING)
+               .set_local_name(_("Type"))
+               .set_desc(_("The type of ValueNode that you want to be converted to"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueDescConvert::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::ValueDescConvert::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               value_desc=param.get_value_desc();
+               
+               return true;
+       }
+
+       if(name=="type" && param.get_type()==Param::TYPE_STRING)
+       {
+               type=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueDescConvert::is_ready()const
+{
+       if(!value_desc || type.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueDescConvert::prepare()
+{
+       clear();
+
+       ValueBase value;
+       
+       if(value_desc.is_const())
+               value=value_desc.get_value();
+       else if(value_desc.is_value_node())
+               value=(*value_desc.get_value_node())(0);
+       else
+               throw Error(_("Unable to decipher ValueDesc (Bug?)"));
+       
+       ValueNode::Handle src_value_node(LinkableValueNode::create(type,value));
+
+       if(!src_value_node)
+               throw Error(_("Unable to create new value node"));
+
+       
+       ValueNode::Handle dest_value_node;
+       dest_value_node=value_desc.get_value_node();
+
+       Action::Handle action(ValueDescConnect::create());
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",get_canvas_interface());
+       action->set_param("src",src_value_node);
+       action->set_param("dest",value_desc);
+
+       assert(action->is_ready());
+       if(!action->is_ready())
+               throw Error(Error::TYPE_NOTREADY);
+
+       add_action_front(action);
+
+/*
+       return;         
+
+               
+       if(value_desc.parent_is_canvas())
+       {                               
+               ValueNode::Handle dest_value_node;
+               dest_value_node=value_desc.get_value_node();
+
+               Action::Handle action(ValueNodeReplace::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("src",src_value_node);
+               action->set_param("dest",dest_value_node);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       else
+       if(value_desc.parent_is_linkable_value_node())
+       {
+               Action::Handle action(ValueNodeLinkConnect::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("parent_value_node",value_desc.get_parent_value_node());
+               action->set_param("value_node", src_value_node);
+               action->set_param("index",value_desc.get_index());
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       else
+       if(value_desc.parent_is_layer_param())
+       {
+               Action::Handle action(LayerParamConnect::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("layer",value_desc.get_layer());
+               action->set_param("param",value_desc.get_param_name());
+               action->set_param("value_node",src_value_node);
+       
+               assert(action->is_ready());             
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       
+       
+       
+       throw Error(_("ValueDesc is not recognised or supported."));    
+*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescconvert.h b/synfig-studio/trunk/src/synfigapp/actions/valuedescconvert.h
new file mode 100644 (file)
index 0000000..98b65ed
--- /dev/null
@@ -0,0 +1,71 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescconvert.h
+**     \brief Template File
+**
+**     $Id: valuedescconvert.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUEDESCCONVERT_H
+#define __SYNFIG_APP_ACTION_VALUEDESCCONVERT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.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 synfigapp {
+
+namespace Action {
+
+class ValueDescConvert :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::String type;
+
+public:
+
+       ValueDescConvert();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescdisconnect.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescdisconnect.cpp
new file mode 100644 (file)
index 0000000..528eaeb
--- /dev/null
@@ -0,0 +1,193 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescdisconnect.cpp
+**     \brief Template File
+**
+**     $Id: valuedescdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerparamdisconnect.h"
+#include "valuenodelinkdisconnect.h"
+#include "valuenodereplace.h"
+
+#include "valuedescdisconnect.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_const.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueDescDisconnect);
+ACTION_SET_NAME(Action::ValueDescDisconnect,"value_desc_disconnect");
+ACTION_SET_LOCAL_NAME(Action::ValueDescDisconnect,"Disconnect");
+ACTION_SET_TASK(Action::ValueDescDisconnect,"disconnect");
+ACTION_SET_CATEGORY(Action::ValueDescDisconnect,Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ValueDescDisconnect,-100);
+ACTION_SET_VERSION(Action::ValueDescDisconnect,"0.0");
+ACTION_SET_CVS_ID(Action::ValueDescDisconnect,"$Id: valuedescdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueDescDisconnect::ValueDescDisconnect():
+       time(0)
+{
+}
+
+Action::ParamVocab
+Action::ValueDescDisconnect::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueDescDisconnect::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_canvas() && value_desc.is_value_node() && value_desc.get_value_node()->rcount()>1)
+                       return true;
+               if(value_desc.is_const())
+                       return false;
+               if(value_desc.is_value_node() && ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
+                       return false;
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueDescDisconnect::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               value_desc=param.get_value_desc();
+               
+               return true;
+       }
+
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueDescDisconnect::is_ready()const
+{
+       if(!value_desc)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueDescDisconnect::prepare()
+{
+       clear();
+
+       if(value_desc.parent_is_canvas())
+       {                               
+               ValueNode::Handle src_value_node;
+               src_value_node=ValueNode_Const::create((*value_desc.get_value_node())(time));
+
+               Action::Handle action(ValueNodeReplace::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("src",src_value_node);
+               action->set_param("dest",value_desc.get_value_node());
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       else
+       if(value_desc.parent_is_linkable_value_node())
+       {
+               Action::Handle action(ValueNodeLinkDisconnect::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("parent_value_node",value_desc.get_parent_value_node());
+               action->set_param("index",value_desc.get_index());
+               action->set_param("time",time);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       else
+       if(value_desc.parent_is_layer_param())
+       {
+               Action::Handle action(LayerParamDisconnect::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("layer",value_desc.get_layer());
+               action->set_param("param",value_desc.get_param_name());
+               action->set_param("time",time);
+       
+               assert(action->is_ready());             
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+               return;         
+       }
+       
+       throw Error(_("ValueDesc is not recognised or supported."));    
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescdisconnect.h b/synfig-studio/trunk/src/synfigapp/actions/valuedescdisconnect.h
new file mode 100644 (file)
index 0000000..076930d
--- /dev/null
@@ -0,0 +1,71 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescdisconnect.h
+**     \brief Template File
+**
+**     $Id: valuedescdisconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUEDESCDISCONNECT_H
+#define __SYNFIG_APP_ACTION_VALUEDESCDISCONNECT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.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 synfigapp {
+
+namespace Action {
+
+class ValueDescDisconnect :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::Time time;
+
+public:
+
+       ValueDescDisconnect();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescexport.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescexport.cpp
new file mode 100644 (file)
index 0000000..e63ded9
--- /dev/null
@@ -0,0 +1,199 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescset.cpp
+**     \brief Template File
+**
+**     $Id: valuedescexport.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodeadd.h"
+
+#include "canvasadd.h"
+#include "valuedescexport.h"
+#include "layerparamconnect.h"
+
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_const.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueDescExport);
+ACTION_SET_NAME(Action::ValueDescExport,"value_desc_export");
+ACTION_SET_LOCAL_NAME(Action::ValueDescExport,"Export");
+ACTION_SET_TASK(Action::ValueDescExport,"export");
+ACTION_SET_CATEGORY(Action::ValueDescExport,Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ValueDescExport,0);
+ACTION_SET_VERSION(Action::ValueDescExport,"0.0");
+ACTION_SET_CVS_ID(Action::ValueDescExport,"$Id: valuedescexport.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueDescExport::ValueDescExport()
+{
+}
+
+Action::ParamVocab
+Action::ValueDescExport::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("name",Param::TYPE_STRING)
+               .set_local_name(_("Name"))
+               .set_desc(_("The name that you want this value to be exported as"))
+               .set_user_supplied()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueDescExport::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc=x.find("value_desc")->second.get_value_desc();
+               if(!value_desc || value_desc.parent_is_canvas() || (value_desc.is_value_node() && value_desc.get_value_node()->is_exported()))
+                       return false;
+               return true;
+       }
+       return false;           
+}
+
+bool
+Action::ValueDescExport::set_param(const synfig::String& param_name, const Action::Param &param)
+{
+       if(param_name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               value_desc=param.get_value_desc();
+               
+               return true;
+       }
+
+       if(param_name=="name" && param.get_type()==Param::TYPE_STRING)
+       {
+               name=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(param_name,param);
+}
+
+bool
+Action::ValueDescExport::is_ready()const
+{
+       if(!value_desc || name.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueDescExport::prepare()
+{
+       clear();
+
+       ValueNode::Handle value_node;
+
+       if(value_desc.get_value_type()==ValueBase::TYPE_CANVAS)
+       {
+               if(!value_desc.is_const())
+                       throw Error(_("Can only export Canvas when used as constant parameter"));
+               Canvas::Handle canvas(value_desc.get_value().get(Canvas::Handle()));
+               
+               Action::Handle action(CanvasAdd::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("src",canvas);
+               action->set_param("id",name);
+       
+               assert(action->is_ready());             
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);               
+               
+               return;
+       }
+
+       
+       if(value_desc.is_value_node())
+       {
+               if(value_desc.get_value_node()->is_exported())
+                       throw Error(_("ValueBase is already exported"));
+
+               value_node=value_desc.get_value_node();
+       }
+       else
+       {
+               if(!value_desc.parent_is_layer_param())
+                       throw Error(_("Unable to export parameter. (Bug?)"));
+                       
+               value_node=ValueNode_Const::create(value_desc.get_value());
+               
+               Action::Handle action(LayerParamConnect::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("layer",value_desc.get_layer());
+               action->set_param("param",value_desc.get_param_name());
+               action->set_param("value_node",value_node);
+       
+               assert(action->is_ready());             
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);               
+       }
+       
+       Action::Handle action(ValueNodeAdd::create());
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",get_canvas_interface());
+       action->set_param("new",value_node);
+       action->set_param("name",name);
+
+       assert(action->is_ready());             
+       if(!action->is_ready())
+               throw Error(Error::TYPE_NOTREADY);
+
+       add_action_front(action);
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescexport.h b/synfig-studio/trunk/src/synfigapp/actions/valuedescexport.h
new file mode 100644 (file)
index 0000000..663fa05
--- /dev/null
@@ -0,0 +1,71 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescexport.h
+**     \brief Template File
+**
+**     $Id: valuedescexport.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUEDESCEXPORT_H
+#define __SYNFIG_APP_ACTION_VALUEDESCEXPORT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.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 synfigapp {
+
+namespace Action {
+
+class ValueDescExport :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::String name;
+
+public:
+
+       ValueDescExport();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedesclink.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedesclink.cpp
new file mode 100644 (file)
index 0000000..4fcdf7e
--- /dev/null
@@ -0,0 +1,244 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedesclink.cpp
+**     \brief Template File
+**
+**     $Id: valuedesclink.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuedesclink.h"
+
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_const.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueDescLink);
+ACTION_SET_NAME(Action::ValueDescLink,"value_desc_link");
+ACTION_SET_LOCAL_NAME(Action::ValueDescLink,"Link");
+ACTION_SET_TASK(Action::ValueDescLink,"connect");
+ACTION_SET_CATEGORY(Action::ValueDescLink,Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ValueDescLink,0);
+ACTION_SET_VERSION(Action::ValueDescLink,"0.0");
+ACTION_SET_CVS_ID(Action::ValueDescLink,"$Id: valuedesclink.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueDescLink::ValueDescLink()
+{
+       poison=false;
+}
+
+Action::ParamVocab
+Action::ValueDescLink::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc to link"))
+               .set_requires_multiple()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueDescLink::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::ValueDescLink::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               return true;
+       }
+       
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+                               
+               if(value_desc.is_value_node() && value_desc.get_value_node()->is_exported())
+               {
+                       if(link_value_node==value_desc.get_value_node())
+                               return true;
+                       
+                       if(link_value_node && link_value_node->is_exported())
+                       {
+                               poison=true;
+                               return false;
+                       }
+                                               
+                       link_value_node=value_desc.get_value_node();
+               }
+               else if(value_desc.is_value_node())
+               {
+                       if(!link_value_node)
+                       {
+                               link_value_node=value_desc.get_value_node();
+                       }
+
+                       // Use the one that is referenced more
+                       else if(link_value_node->rcount()<value_desc.get_value_node()->rcount())
+                       {
+                               link_value_node=value_desc.get_value_node();
+                       }
+
+                       // If the current link value node is a constant and
+                       // this one isn't, then give preference to the exotic
+                       else if(ValueNode_Const::Handle::cast_dynamic(link_value_node) && !ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
+                       {
+                               link_value_node=value_desc.get_value_node();
+                       }
+
+                       // If both are animated, and this one has more waypoints,
+                       // then use the one with more waypoints
+                       else if(
+                                       ValueNode_Animated::Handle::cast_dynamic(link_value_node)
+                               &&      ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())
+                               && (
+                                       ValueNode_Animated::Handle::cast_dynamic(link_value_node)->waypoint_list().size()
+                               <       ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node())->waypoint_list().size()
+                               )
+                       )
+                       {
+                               link_value_node=value_desc.get_value_node();
+                       }
+                       
+                       /*
+                       // Use the one that was most recently changed
+                       else if(link_value_node->get_time_last_changed()<value_desc.get_value_node()->get_time_last_changed())
+                       {
+                               link_value_node=value_desc.get_value_node();
+                       }
+                       */
+               }
+
+               
+               if(value_desc_list.size() && value_desc.get_value_type()!=value_desc_list.front().get_value_type())
+               {
+                       // Everything must be of the same type
+                       poison=true;
+                       return false;
+               }
+               value_desc_list.push_back(value_desc);
+
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueDescLink::is_ready()const
+{
+       if(poison || value_desc_list.size()<=1)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueDescLink::prepare()
+{
+       if(poison || value_desc_list.empty())
+               throw Error(Error::TYPE_NOTREADY);
+               
+       clear();
+
+       if(!link_value_node)
+       {
+               ValueDesc& value_desc(value_desc_list.front());
+               
+               link_value_node=ValueNode_Const::create(value_desc.get_value(time));
+               
+               Action::Handle action(Action::create("value_desc_connect"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("src",link_value_node);
+               action->set_param("dest",value_desc);
+       
+               assert(action->is_ready());             
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);               
+       }
+
+       /*
+       if(!link_value_node->is_exported())
+       {
+               Action::Handle action(Action::create("value_node_add"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("new",link_value_node);
+               action->set_param("name",strprintf(_("Unnamed%08d"),synfig::UniqueID().get_uid()));
+       
+               assert(action->is_ready());             
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);
+       }
+       */
+       
+       std::list<ValueDesc>::iterator iter;
+       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
+       {
+               ValueDesc& value_desc(*iter);
+               
+               if(value_desc.is_value_node() && value_desc.get_value_node()==link_value_node)
+                       continue;
+
+               Action::Handle action(Action::create("value_desc_connect"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("src",link_value_node);
+               action->set_param("dest",value_desc);
+       
+               assert(action->is_ready());             
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action_front(action);               
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedesclink.h b/synfig-studio/trunk/src/synfigapp/actions/valuedesclink.h
new file mode 100644 (file)
index 0000000..737b707
--- /dev/null
@@ -0,0 +1,72 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedesclink.h
+**     \brief Template File
+**
+**     $Id: valuedesclink.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUEDESCLINK_H
+#define __SYNFIG_APP_ACTION_VALUEDESCLINK_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.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 synfigapp {
+
+namespace Action {
+
+class ValueDescLink :
+       public Super
+{
+private:
+
+       std::list<ValueDesc> value_desc_list;
+       synfig::ValueNode::Handle link_value_node;
+       bool poison;
+       synfig::Time time;
+public:
+
+       ValueDescLink();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp
new file mode 100644 (file)
index 0000000..398713f
--- /dev/null
@@ -0,0 +1,532 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescset.cpp
+**     \brief Template File
+**
+**     $Id: valuedescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "layerparamset.h"
+#include "valuenodeconstset.h"
+#include "valuedescconnect.h"
+#include "waypointsetsmart.h"
+
+#include "valuedescset.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_composite.h>
+#include <synfig/valuenode_radialcomposite.h>
+#include <synfig/valuenode_reference.h>
+#include <synfigapp/main.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+#define ACTION_INIT2(class) \
+       Action::Base* class::create() { return new class(); }   \
+       synfig::String class::get_name()const { return name__; }        
+
+ACTION_INIT2(Action::ValueDescSet);
+ACTION_SET_NAME(Action::ValueDescSet,"value_desc_set");
+ACTION_SET_LOCAL_NAME(Action::ValueDescSet,"Set ValueDesc");
+ACTION_SET_TASK(Action::ValueDescSet,"set");
+ACTION_SET_CATEGORY(Action::ValueDescSet,Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ValueDescSet,0);
+ACTION_SET_VERSION(Action::ValueDescSet,"0.0");
+ACTION_SET_CVS_ID(Action::ValueDescSet,"$Id: valuedescset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueDescSet::ValueDescSet():
+       time(0)
+{
+}
+
+synfig::String
+Action::ValueDescSet::get_local_name()const
+{
+       String name("ValueDesc");
+       
+       if(!value_desc)
+       {
+       }
+       else if(value_desc.parent_is_layer_param())
+       {
+               if(value_desc.get_layer()->get_description().empty())
+                       name=value_desc.get_layer()->get_local_name();
+               else
+                       name=value_desc.get_layer()->get_description();
+               name+="->"+value_desc.get_param_name();
+       }
+       else if(value_desc.parent_is_value_node())
+       {
+               synfig::LinkableValueNode::Handle value_node(synfig::LinkableValueNode::Handle::cast_reinterpret(value_desc.get_parent_value_node()));
+               name=value_node->link_local_name(value_desc.get_index());
+               
+               synfig::Node* node;
+               for(node=value_node.get();!node->parent_set.empty() && !dynamic_cast<Layer*>(node);node=*node->parent_set.begin());
+               Layer::Handle parent_layer(dynamic_cast<Layer*>(node));
+               if(parent_layer)
+               {
+                       if(parent_layer->get_description().empty())
+                               name=parent_layer->get_local_name()+"=>"+name;
+                       else
+                               name=parent_layer->get_description()+"=>"+name;
+               }
+       }
+
+       return strprintf(_("Set %s"),name.c_str());
+}
+
+Action::ParamVocab
+Action::ValueDescSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       ret.push_back(ParamDesc("new_value",Param::TYPE_VALUE)
+               .set_local_name(_("ValueBase"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueDescSet::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::ValueDescSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               value_desc=param.get_value_desc();
+               
+               return true;
+       }
+
+       if(name=="new_value" && param.get_type()==Param::TYPE_VALUE)
+       {
+               value=param.get_value();
+               
+               return true;
+       }
+
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueDescSet::is_ready()const
+{
+       if(!value_desc || !value.is_valid())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueDescSet::prepare()
+{
+       clear();
+
+       // If our tangents are merged, and
+       // our first tangent is being manipulated,
+       // then we also need to adjust the other
+       // tangent.
+       if(     value_desc.parent_is_value_node()
+       &&      value_desc.get_parent_value_node()->get_type()==ValueBase::TYPE_BLINEPOINT
+       &&      value_desc.get_index()==4
+       &&      (*value_desc.get_parent_value_node())(time).get(BLinePoint()).get_split_tangent_flag()==false
+       )
+       {
+               DEBUGPOINT();
+               ValueNode_Composite::Handle parent_value_node;
+               parent_value_node=parent_value_node.cast_dynamic(value_desc.get_parent_value_node());
+               
+               assert(parent_value_node);
+               
+               Action::Handle action(Action::create("value_desc_set"));
+       
+               if(!action)
+                       throw Error(_("Unable to find action value_desc_set (bug)"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("time",time);
+               action->set_param("new_value",value);
+               action->set_param("value_desc",ValueDesc(parent_value_node,5));
+               
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);                     
+       }
+
+       // If we are a reference value node, then
+       // we need to distribute the changes to the
+       // referenced value node
+       if(value_desc.is_value_node() && ValueNode_Reference::Handle::cast_dynamic(value_desc.get_value_node()))
+       {
+               ValueDesc reference_value_desc(ValueNode_Reference::Handle::cast_dynamic(value_desc.get_value_node()),0);
+
+               Action::Handle action(Action::create("value_desc_set"));
+
+               if(!action)
+                       throw Error(_("Unable to find action value_desc_set (bug)"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("time",time);
+               action->set_param("new_value",value);
+               action->set_param("value_desc",reference_value_desc);
+               
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+
+               add_action(action);                     
+       
+               return;
+       }
+       
+       // If we are a composite value node, then
+       // we need to distribute the changes to the
+       // individual parts
+       if(value_desc.is_value_node() && ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()))
+       {
+               ValueBase components[6];
+               int n_components(0);
+               switch(value.get_type())
+               {
+               case ValueBase::TYPE_VECTOR:
+                       components[0]=value.get(Vector())[0];
+                       components[1]=value.get(Vector())[1];
+                       n_components=2;
+                       break;
+               case ValueBase::TYPE_COLOR:
+                       components[0]=value.get(Color()).get_r();
+                       components[1]=value.get(Color()).get_g();
+                       components[2]=value.get(Color()).get_b();
+                       components[3]=value.get(Color()).get_a();
+                       n_components=4;
+                       break;
+               case ValueBase::TYPE_SEGMENT:
+                       components[0]=value.get(Segment()).p1;
+                       components[1]=value.get(Segment()).t1;
+                       components[2]=value.get(Segment()).p2;
+                       components[3]=value.get(Segment()).t2;
+                       n_components=4;
+                       break;
+               case ValueBase::TYPE_BLINEPOINT:
+               {
+                       BLinePoint bline_point(value);
+                       components[0]=bline_point.get_vertex();
+                       components[1]=bline_point.get_width();
+                       components[2]=bline_point.get_origin();
+                       components[3]=bline_point.get_split_tangent_flag();
+                       components[4]=bline_point.get_tangent1();
+                       components[5]=bline_point.get_tangent2();
+                       n_components=6;
+                       break;
+               }
+               default:
+                       throw Error("Bad type for composite (%s)",ValueBase::type_name(value.get_type()).c_str());                      
+                       break;
+               }
+               
+               for(int i=0;i<n_components;i++)
+               {
+                       ValueDesc component_value_desc(ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()),i);
+
+                       Action::Handle action(Action::create("value_desc_set"));
+       
+                       if(!action)
+                               throw Error(_("Unable to find action value_desc_set (bug)"));
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("time",time);
+                       action->set_param("new_value",components[i]);
+                       action->set_param("value_desc",component_value_desc);
+                       
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+       
+                       add_action(action);                     
+               }
+               
+               return;
+       }
+
+       
+       // If we are a RADIAL composite value node, then
+       // we need to distribute the changes to the
+       // individual parts
+       if(value_desc.is_value_node() && ValueNode_RadialComposite::Handle::cast_dynamic(value_desc.get_value_node()))
+       {
+               ValueBase components[6];
+               int n_components(0);
+               switch(value.get_type())
+               {
+               case ValueBase::TYPE_VECTOR:
+               {
+                       Vector vect(value.get(Vector()));
+                       components[0]=vect.mag();
+                       components[1]=Angle(Angle::tan(vect[1],vect[0]));
+                       n_components=2;
+               }
+                       break;
+               case ValueBase::TYPE_COLOR:
+                       components[0]=value.get(Color()).get_y();
+                       components[1]=value.get(Color()).get_s();
+                       components[2]=value.get(Color()).get_hue();
+                       components[3]=value.get(Color()).get_a();
+                       n_components=4;
+                       break;
+               default:
+                       throw Error("Bad type for radial composite (%s)",ValueBase::type_name(value.get_type()).c_str());                       
+                       break;
+               }
+               for(int i=0;i<n_components;i++)
+               {
+                       ValueDesc component_value_desc(ValueNode_RadialComposite::Handle::cast_dynamic(value_desc.get_value_node()),i);
+
+                       Action::Handle action(Action::create("value_desc_set"));
+       
+                       if(!action)
+                               throw Error(_("Unable to find action value_desc_set (bug)"));
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("time",time);
+                       action->set_param("new_value",components[i]);
+                       action->set_param("value_desc",component_value_desc);
+                       
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+       
+                       add_action(action);                     
+               }
+               
+               return;
+       }
+
+       // If we are merging the tangents of a BLinePoint,
+       // we must also set the second tangent for things
+       // to interpolate properly
+       if(     value_desc.parent_is_value_node()
+       &&      value_desc.get_parent_value_node()->get_type()==ValueBase::TYPE_BLINEPOINT
+       &&      value_desc.get_index()==3
+//     &&      value.get(bool())==false        // Actually, we want to do this any time the split flag is tweaked with
+       )
+       {
+               ValueNode_Composite::Handle parent_value_node;
+               parent_value_node=parent_value_node.cast_dynamic(value_desc.get_parent_value_node());
+               
+               assert(parent_value_node);
+               
+               Action::Handle action(Action::create("value_desc_set"));
+       
+               if(!action)
+                       throw Error(_("Unable to find action value_desc_set (bug)"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("time",time);
+               action->set_param("new_value",(*parent_value_node->get_link(4))(time));
+               action->set_param("value_desc",ValueDesc(parent_value_node,5));
+               
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);                     
+       }
+
+/*     DEBUGPOINT();
+       if(     value_desc.parent_is_value_node())
+       {
+               DEBUGPOINT();
+               if(value_desc.get_parent_value_node()->get_type()==ValueBase::TYPE_BLINEPOINT)
+               {
+                       DEBUGPOINT();
+                       if(value_desc.get_index()==4)
+                       {
+                               DEBUGPOINT();
+                               if((*value_desc.get_parent_value_node())(time).get(BLinePoint()).get_split_tangent_flag()==false)
+                               {
+                                       DEBUGPOINT();
+                               }
+                       }
+               }
+       }
+*/     
+
+       
+       // If we are in animate editing mode
+       if(get_edit_mode()&MODE_ANIMATE)
+       {
+
+               ValueNode_Animated::Handle& value_node(value_node_animated);
+
+               // If this value isn't a ValueNode_Animated, but
+               // it is somewhat constant, then go ahead and convert
+               // it to a ValueNode_Animated.
+               if(!value_desc.is_value_node() || ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
+               {
+                       ValueBase value;
+                       if(value_desc.is_value_node())
+                               value=ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node())->get_value();
+                       else
+                               value=value_desc.get_value();
+                       
+                       if(!value_node)value_node=ValueNode_Animated::create(value,time);
+                       //if(!value_node)value_node=ValueNode_Animated::create(value.get_type());
+                       
+                       Action::Handle action;
+                       
+                       if(!value_desc.is_value_node())
+                       {
+                               action=(ValueDescConnect::create());
+                               action->set_param("dest",value_desc);
+                               action->set_param("src",ValueNode::Handle(value_node));
+                       }
+                       else
+                       {
+                               action=Action::create("value_node_replace");
+                               action->set_param("dest",value_desc.get_value_node());
+                               action->set_param("src",ValueNode::Handle(value_node));
+                       }
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+       
+                               DEBUGPOINT();
+                       add_action_front(action);
+               }
+               else
+               {
+                       value_node=value_node.cast_dynamic(value_desc.get_value_node());
+               }
+               
+                               DEBUGPOINT();
+               if(!value_node)
+                       throw Error(_("Direct manipulation of this ValueNode type is not yet supported"));              
+               
+               Action::Handle action(WaypointSetSmart::create());
+               
+               //Waypoint waypoint(value,time);
+               
+               Waypoint waypoint(value_node->new_waypoint_at_time(time));
+               waypoint.set_value(value);
+               
+               waypoint.set_before(synfigapp::Main::get_interpolation());
+               waypoint.set_after(synfigapp::Main::get_interpolation());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_node",ValueNode::Handle(value_node));
+               action->set_param("waypoint",waypoint);
+               
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+
+                               DEBUGPOINT();
+               add_action(action);
+               
+               return;
+       }
+       else
+       {
+               if(value_desc.is_value_node())
+               {
+                       if(ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
+                       {
+                               Action::Handle action(ValueNodeConstSet::create());
+                               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_node",value_desc.get_value_node());
+                               action->set_param("new_value",value);
+                               
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+               
+                               add_action_front(action);
+                               return;
+                       }
+                       else
+                       if(ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node()))
+                               throw Error(_("You must be in Animate-Editing-Mode to directly manipulate this value"));                
+                       else
+                               throw Error(_("Direct manipulation of this ValueNode type is not yet supported"));              
+               }
+               else
+               if(value_desc.parent_is_layer_param() && !value_desc.is_value_node())
+               {
+                       Action::Handle layer_param_set(LayerParamSet::create());
+                       
+                       layer_param_set->set_param("canvas",get_canvas());
+                       layer_param_set->set_param("canvas_interface",get_canvas_interface());
+                       layer_param_set->set_param("layer",value_desc.get_layer());
+                       layer_param_set->set_param("param",value_desc.get_param_name());
+                       layer_param_set->set_param("new_value",value);
+       
+                       if(!layer_param_set->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+                       
+                       add_action_front(layer_param_set);
+                       return;
+               }
+
+               throw Error(_("Unsupported ValueDesc type"));
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.h b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.h
new file mode 100644 (file)
index 0000000..79f30bd
--- /dev/null
@@ -0,0 +1,74 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuedescset.h
+**     \brief Template File
+**
+**     $Id: valuedescset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUEDESCSET_H
+#define __SYNFIG_APP_ACTION_VALUEDESCSET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/valuenode_animated.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 synfigapp {
+
+namespace Action {
+
+class ValueDescSet :
+       public Super
+{
+private:
+
+       ValueDesc value_desc;
+       synfig::ValueBase value;
+       synfig::Time time;
+       synfig::ValueNode_Animated::Handle value_node_animated;
+
+public:
+
+       ValueDescSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodeadd.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodeadd.cpp
new file mode 100644 (file)
index 0000000..7739c5f
--- /dev/null
@@ -0,0 +1,162 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodeadd.cpp
+**     \brief Template File
+**
+**     $Id: valuenodeadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodeadd.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeAdd);
+ACTION_SET_NAME(Action::ValueNodeAdd,"value_node_add");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeAdd,"Add ValueNode");
+ACTION_SET_TASK(Action::ValueNodeAdd,"add");
+ACTION_SET_CATEGORY(Action::ValueNodeAdd,Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeAdd,0);
+ACTION_SET_VERSION(Action::ValueNodeAdd,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeAdd,"$Id: valuenodeadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeAdd::ValueNodeAdd()
+{
+}
+
+Action::ParamVocab
+Action::ValueNodeAdd::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("new",Param::TYPE_VALUENODE)
+               .set_local_name(_("New ValueNode"))
+               .set_desc(_("ValueNode to be added"))
+       );
+
+       ret.push_back(ParamDesc("name",Param::TYPE_STRING)
+               .set_local_name(_("Name"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueNodeAdd::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::ValueNodeAdd::set_param(const synfig::String& param_name, const Action::Param &param)
+{
+       if(param_name=="new" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=param.get_value_node();
+               
+               return true;
+       }
+
+       if(param_name=="name" && param.get_type()==Param::TYPE_STRING)
+       {
+               name=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(param_name,param);
+}
+
+bool
+Action::ValueNodeAdd::is_ready()const
+{
+       if(!value_node || name.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeAdd::perform()
+{
+       if(value_node->is_exported())
+       {
+               throw Error(_("Parameter appears to already be exported"));
+       }
+       
+       try
+       {
+               get_canvas()->add_value_node(value_node,name);
+       }
+       catch(Exception::IDAlreadyExists)
+       {
+               throw Error(_("Another exported ValueBase with this name already exists"));
+       }
+       catch(...)
+       {
+               throw Error(_("Exception caught on Add ValueNode."));
+       }
+
+       set_dirty(false);
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_added()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
+
+void
+Action::ValueNodeAdd::undo()
+{
+       try { get_canvas()->remove_value_node(value_node); }
+       catch(...)
+       {
+               throw Error(_("Exception caught on Remove ValueNode."));
+       }
+
+       set_dirty(false);
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_deleted()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodeadd.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodeadd.h
new file mode 100644 (file)
index 0000000..7665e1e
--- /dev/null
@@ -0,0 +1,74 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodeadd.h
+**     \brief Template File
+**
+**     $Id: valuenodeadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEADD_H
+#define __SYNFIG_APP_ACTION_VALUENODEADD_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeAdd :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode::Handle value_node;
+       synfig::String name;
+
+public:
+
+       ValueNodeAdd();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodeconstset.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodeconstset.cpp
new file mode 100644 (file)
index 0000000..7f9eaf3
--- /dev/null
@@ -0,0 +1,147 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodeconstset.cpp
+**     \brief Template File
+**
+**     $Id: valuenodeconstset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodeconstset.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeConstSet);
+ACTION_SET_NAME(Action::ValueNodeConstSet,"value_node_const_set");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeConstSet,_("Set ValueNode_Const"));
+ACTION_SET_TASK(Action::ValueNodeConstSet,"set");
+ACTION_SET_CATEGORY(Action::ValueNodeConstSet,Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeConstSet,0);
+ACTION_SET_VERSION(Action::ValueNodeConstSet,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeConstSet,"$Id: valuenodeconstset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeConstSet::ValueNodeConstSet()
+{
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ValueNodeConstSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode_Const"))
+       );
+
+       ret.push_back(ParamDesc("new_value",Param::TYPE_VALUE)
+               .set_local_name(_("ValueBase"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueNodeConstSet::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               if(ValueNode_Const::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
+                       return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeConstSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=ValueNode_Const::Handle::cast_dynamic(param.get_value_node());
+               
+               return (bool)value_node;
+       }
+
+       if(name=="new_value" && param.get_type()==Param::TYPE_VALUE)
+       {
+               new_value=param.get_value();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeConstSet::is_ready()const
+{
+       if(!value_node || !new_value.is_valid())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeConstSet::perform()
+{
+       //set_dirty(true);
+       
+       old_value=value_node->get_value();
+
+       value_node->set_value(new_value);       
+       
+       // Signal that a layer has been inserted
+       /*if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }*/
+}
+
+void
+Action::ValueNodeConstSet::undo()
+{
+       //set_dirty(true);
+
+       value_node->set_value(old_value);       
+       
+       // Signal that a layer has been inserted
+       /*if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodeconstset.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodeconstset.h
new file mode 100644 (file)
index 0000000..fa42489
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodeconstset.h
+**     \brief Template File
+**
+**     $Id: valuenodeconstset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODECONSTSET_H
+#define __SYNFIG_APP_ACTION_VALUENODECONSTSET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/valuenode_const.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeConstSet :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode_Const::Handle value_node;
+       synfig::ValueBase       new_value;
+       synfig::ValueBase       old_value;
+
+
+public:
+
+       ValueNodeConstSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsert.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsert.cpp
new file mode 100644 (file)
index 0000000..f4ab116
--- /dev/null
@@ -0,0 +1,196 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistinsert.cpp
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistinsert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodedynamiclistinsert.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeDynamicListInsert);
+ACTION_SET_NAME(Action::ValueNodeDynamicListInsert,"value_node_dynamic_list_insert");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListInsert,"Insert Item");
+ACTION_SET_TASK(Action::ValueNodeDynamicListInsert,"insert");
+ACTION_SET_CATEGORY(Action::ValueNodeDynamicListInsert,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE|Action::CATEGORY_HIDDEN);
+ACTION_SET_PRIORITY(Action::ValueNodeDynamicListInsert,-20);
+ACTION_SET_VERSION(Action::ValueNodeDynamicListInsert,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeDynamicListInsert,"$Id: valuenodedynamiclistinsert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeDynamicListInsert::ValueNodeDynamicListInsert()
+{
+       index=0;
+       time=0;
+       origin=0.5f;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ValueNodeDynamicListInsert::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       ret.push_back(ParamDesc("origin",Param::TYPE_REAL)
+               .set_local_name(_("Origin"))
+               .set_optional()
+       );
+       ret.push_back(ParamDesc("item",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode to insert"))
+               .set_optional()
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeDynamicListInsert::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeDynamicListInsert::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+
+               index=value_desc.get_index();
+
+               value_node_bline=ValueNode_BLine::Handle::cast_dynamic(value_desc.get_parent_value_node());
+
+               list_entry=value_node->create_list_entry(index,time,origin);
+               if(item)
+                       list_entry.value_node=item;
+               
+               assert(list_entry.value_node.rcount()==1);
+                               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+       if(name=="item" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               item=param.get_value_node();
+               if(item)
+                       list_entry.value_node=item;
+               
+               return true;
+       }
+       if(name=="origin" && param.get_type()==Param::TYPE_REAL)
+       {
+               origin=param.get_real();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeDynamicListInsert::is_ready()const
+{
+       if(!value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeDynamicListInsert::perform()
+{      
+       if(index>value_node->link_count())
+               index=value_node->link_count();
+       
+       value_node->add(list_entry,index);
+       assert(list_entry.value_node.rcount()>=2);
+       
+       // Signal that a layer has been inserted
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
+
+void
+Action::ValueNodeDynamicListInsert::undo()
+{
+       assert(list_entry.value_node.rcount()>=2);
+       value_node->erase((value_node->list.begin()+index)->value_node);
+       assert(list_entry.value_node.rcount()>=1);
+       
+       // Signal that a layer has been inserted
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsert.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsert.h
new file mode 100644 (file)
index 0000000..4e21e6a
--- /dev/null
@@ -0,0 +1,82 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistinsert.h
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistinsert.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTINSERT_H
+#define __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTINSERT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_bline.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeDynamicListInsert :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       synfig::ValueNode_BLine::Handle value_node_bline;
+       synfig::ValueNode_DynamicList::ListEntry list_entry;
+       synfig::ValueNode::Handle item;
+       synfig::Time time;
+       synfig::Real origin;
+       int index;
+
+
+public:
+
+       ValueNodeDynamicListInsert();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsertsmart.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsertsmart.cpp
new file mode 100644 (file)
index 0000000..396773b
--- /dev/null
@@ -0,0 +1,269 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistinsertsmart.cpp
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistinsertsmart.cpp,v 1.3 2005/01/17 05:20:08 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodedynamiclistinsertsmart.h"
+#include "valuenodedynamiclistinsert.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeDynamicListInsertSmart);
+ACTION_SET_NAME(Action::ValueNodeDynamicListInsertSmart,"value_node_dynamic_list_insert_smart");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListInsertSmart,"Insert Item (Smart)");
+ACTION_SET_TASK(Action::ValueNodeDynamicListInsertSmart,"insert");
+ACTION_SET_CATEGORY(Action::ValueNodeDynamicListInsertSmart,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeDynamicListInsertSmart,-20);
+ACTION_SET_VERSION(Action::ValueNodeDynamicListInsertSmart,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeDynamicListInsertSmart,"$Id: valuenodedynamiclistinsertsmart.cpp,v 1.3 2005/01/17 05:20:08 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeDynamicListInsertSmart::ValueNodeDynamicListInsertSmart()
+{
+       index=0;
+       time=0;
+       origin=0.5f;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ValueNodeDynamicListInsertSmart::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       ret.push_back(ParamDesc("origin",Param::TYPE_REAL)
+               .set_local_name(_("Origin"))
+               .set_optional()
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeDynamicListInsertSmart::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeDynamicListInsertSmart::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+
+               index=value_desc.get_index();
+                               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+       if(name=="origin" && param.get_type()==Param::TYPE_REAL)
+       {
+               origin=param.get_real();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeDynamicListInsertSmart::is_ready()const
+{
+       if(!value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeDynamicListInsertSmart::prepare()
+{      
+       //clear();
+       // HACK
+       if(!first_time())
+               return;
+       
+       // If we are in animate editing mode
+       if(get_edit_mode()&MODE_ANIMATE)
+       {
+               int index(ValueNodeDynamicListInsertSmart::index);
+
+               // In this case we need to first determine if there is
+               // a currently disabled item in the list that we can
+               // turn on. If not, then we need to go ahead and create one.
+               synfig::info("ValueNodeDynamicListInsertSmart: index=%d",index);
+               synfig::info("ValueNodeDynamicListInsertSmart: value_node->list.size()=%d",value_node->list.size());
+               if(value_node->list.size()<=index && index>0)
+                       synfig::info("ValueNodeDynamicListInsertSmart: value_node->list[index-1].status_at_time(time)=%d",value_node->list[index-1].status_at_time(time));
+               
+               if(value_node->list.size()>=index && index>0 && !value_node->list[index-1].status_at_time(time))
+               {
+                       // Ok, we do not have to create a new
+                       // entry in the dynamic list after all.                 
+                       // However, we do need to set the
+                       // position and tangent of this point.
+                       ValueNode_DynamicList::ListEntry list_entry(value_node->create_list_entry(index,time,origin));
+                       ValueBase value((*list_entry.value_node)(time));
+                       index--;
+                       
+                       ValueDesc item_value_desc(value_node,index);
+
+                       Action::Handle action(Action::create("value_desc_set"));
+       
+                       if(!action)
+                               throw Error(_("Unable to find action value_desc_set (bug)"));
+                       
+                       action->set_param("edit_mode",get_edit_mode());
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("time",time);
+                       action->set_param("new_value",value);
+                       action->set_param("value_desc",ValueDesc(value_node,index));
+                       
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+       
+                       add_action(action);                     
+               }
+               else
+               {
+                       // Ok, not a big deal, we just need to
+                       // add a new item
+                       Action::Handle action(Action::create("value_node_dynamic_list_insert"));
+       
+                       if(!action)
+                               throw Error(_("Unable to find action (bug)"));
+                       
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("time",time);
+                       action->set_param("origin",origin);
+                       action->set_param("value_desc",ValueDesc(value_node,index));
+                       
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+       
+                       add_action(action);
+                       
+                       action=Action::create("activepoint_set_off");
+       
+                       if(!action)
+                               throw Error(_("Unable to find action \"activepoint_set_off\""));
+                       
+                       action->set_param("edit_mode",MODE_ANIMATE);
+                       action->set_param("canvas",get_canvas());
+                       action->set_param("canvas_interface",get_canvas_interface());
+                       action->set_param("time",Time::begin());
+                       action->set_param("origin",origin);
+                       action->set_param("value_desc",ValueDesc(value_node,index));
+                       
+                       if(!action->is_ready())
+                               throw Error(Error::TYPE_NOTREADY);
+       
+                       add_action(action);
+               }
+                       
+               // Now we set the activepoint up and then we'll be done
+               Action::Handle action(Action::create("activepoint_set_on"));
+
+               if(!action)
+                       throw Error(_("Unable to find action \"activepoint_set_on\""));
+               
+               action->set_param("edit_mode",get_edit_mode());
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("time",time);
+               action->set_param("origin",origin);
+               action->set_param("value_desc",ValueDesc(value_node,index));
+               
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+
+               add_action(action);
+       }
+       else
+       {
+               Action::Handle action(Action::create("value_node_dynamic_list_insert"));
+
+               if(!action)
+                       throw Error(_("Unable to find action (bug)"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("time",time);
+               action->set_param("origin",origin);
+               action->set_param("value_desc",ValueDesc(value_node,index));
+               
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+
+               add_action(action);     
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsertsmart.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistinsertsmart.h
new file mode 100644 (file)
index 0000000..f79c586
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistinsertsmart.h
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistinsertsmart.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTINSERTSMART_H
+#define __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTINSERTSMART_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_bline.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeDynamicListInsertSmart :
+       public Super
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       synfig::Time time;
+       synfig::Real origin;
+       int index;
+
+
+public:
+
+       ValueNodeDynamicListInsertSmart();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistloop.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistloop.cpp
new file mode 100644 (file)
index 0000000..d3d2414
--- /dev/null
@@ -0,0 +1,152 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistloop.cpp
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistloop.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodedynamiclistloop.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeDynamicListLoop);
+ACTION_SET_NAME(Action::ValueNodeDynamicListLoop,"value_node_dynamic_list_loop");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListLoop,"Loop");
+ACTION_SET_TASK(Action::ValueNodeDynamicListLoop,"loop");
+ACTION_SET_CATEGORY(Action::ValueNodeDynamicListLoop,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeDynamicListLoop,0);
+ACTION_SET_VERSION(Action::ValueNodeDynamicListLoop,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeDynamicListLoop,"$Id: valuenodedynamiclistloop.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeDynamicListLoop::ValueNodeDynamicListLoop()
+{
+}
+
+Action::ParamVocab
+Action::ValueNodeDynamicListLoop::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode"))
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeDynamicListLoop::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueNode::Handle value_node(x.find("value_node")->second.get_value_node());
+               if(!ValueNode_DynamicList::Handle::cast_dynamic(value_node))
+                       return false;
+               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)->get_loop()==true)
+                       return false;
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeDynamicListLoop::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(param.get_value_node());
+               
+               if(!value_node)
+                       return false;
+
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeDynamicListLoop::is_ready()const
+{
+       if(!value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeDynamicListLoop::perform()
+{      
+       old_loop_value=value_node->get_loop();
+       
+       if(old_loop_value==true)
+       {
+               set_dirty(false);
+               return;
+       }
+       set_dirty(true);
+       value_node->set_loop(true);
+               
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
+
+void
+Action::ValueNodeDynamicListLoop::undo()
+{
+       if(old_loop_value==value_node->get_loop())
+       {
+               set_dirty(false);
+               return;
+       }
+       set_dirty(true);
+       value_node->set_loop(old_loop_value);
+               
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistloop.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistloop.h
new file mode 100644 (file)
index 0000000..6a0efcf
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistloop.h
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistloop.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTLOOP_H
+#define __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTLOOP_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_bline.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeDynamicListLoop :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       bool old_loop_value;
+
+
+public:
+
+       ValueNodeDynamicListLoop();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp
new file mode 100644 (file)
index 0000000..8e471c6
--- /dev/null
@@ -0,0 +1,152 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistremove.cpp
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodedynamiclistremove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeDynamicListRemove);
+ACTION_SET_NAME(Action::ValueNodeDynamicListRemove,"value_node_dynamic_list_remove");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRemove,"Remove Item");
+ACTION_SET_TASK(Action::ValueNodeDynamicListRemove,"remove");
+ACTION_SET_CATEGORY(Action::ValueNodeDynamicListRemove,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE|Action::CATEGORY_HIDDEN);
+ACTION_SET_PRIORITY(Action::ValueNodeDynamicListRemove,-19);
+ACTION_SET_VERSION(Action::ValueNodeDynamicListRemove,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeDynamicListRemove,"$Id: valuenodedynamiclistremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeDynamicListRemove::ValueNodeDynamicListRemove()
+{
+       index=0;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ValueNodeDynamicListRemove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeDynamicListRemove::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeDynamicListRemove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+               
+               index=value_desc.get_index();
+               
+               return true;
+       }
+       
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeDynamicListRemove::is_ready()const
+{
+       if(!value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeDynamicListRemove::perform()
+{      
+       if(index>=value_node->link_count())
+               index=value_node->link_count()-1;
+
+       list_entry=value_node->list[index];
+       value_node->erase((value_node->list.begin()+index)->value_node);
+               
+       // Signal that a layer has been inserted
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
+
+void
+Action::ValueNodeDynamicListRemove::undo()
+{
+       value_node->add(list_entry,index);
+       
+       // Signal that a layer has been inserted
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.h
new file mode 100644 (file)
index 0000000..90c6190
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistremove.h
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTREMOVE_H
+#define __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTREMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeDynamicListRemove :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       synfig::ValueNode_DynamicList::ListEntry list_entry;
+       int index;
+
+
+public:
+
+       ValueNodeDynamicListRemove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremovesmart.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremovesmart.cpp
new file mode 100644 (file)
index 0000000..84245ff
--- /dev/null
@@ -0,0 +1,187 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistremovesmart.cpp
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistremovesmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodedynamiclistremovesmart.h"
+#include "valuenodedynamiclistremove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeDynamicListRemoveSmart);
+ACTION_SET_NAME(Action::ValueNodeDynamicListRemoveSmart,"value_node_dynamic_list_remove_smart");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRemoveSmart,"Remove Item (Smart)");
+ACTION_SET_TASK(Action::ValueNodeDynamicListRemoveSmart,"remove");
+ACTION_SET_CATEGORY(Action::ValueNodeDynamicListRemoveSmart,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeDynamicListRemoveSmart,-19);
+ACTION_SET_VERSION(Action::ValueNodeDynamicListRemoveSmart,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeDynamicListRemoveSmart,"$Id: valuenodedynamiclistremovesmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeDynamicListRemoveSmart::ValueNodeDynamicListRemoveSmart()
+{
+       index=0;
+       time=0;
+       origin=0.5f;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ValueNodeDynamicListRemoveSmart::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+       ret.push_back(ParamDesc("origin",Param::TYPE_REAL)
+               .set_local_name(_("Origin"))
+               .set_optional()
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeDynamicListRemoveSmart::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeDynamicListRemoveSmart::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+
+               index=value_desc.get_index();
+                               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+       if(name=="origin" && param.get_type()==Param::TYPE_REAL)
+       {
+               origin=param.get_real();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeDynamicListRemoveSmart::is_ready()const
+{
+       if(!value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeDynamicListRemoveSmart::prepare()
+{      
+       clear();
+       
+       // If we are in animate editing mode
+       if(get_edit_mode()&MODE_ANIMATE)
+       {
+               Action::Handle action(Action::create("activepoint_set_off"));
+
+               if(!action)
+                       throw Error(_("Unable to find action (bug)"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("time",time);
+               action->set_param("origin",origin);
+               action->set_param("value_desc",ValueDesc(value_node,index));
+               
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+
+               add_action(action);
+       }
+       else
+       {
+               Action::Handle action(Action::create("value_node_dynamic_list_remove"));
+
+               if(!action)
+                       throw Error(_("Unable to find action (bug)"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("time",time);
+               action->set_param("origin",origin);
+               action->set_param("value_desc",ValueDesc(value_node,index));
+               
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+
+               add_action(action);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremovesmart.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremovesmart.h
new file mode 100644 (file)
index 0000000..fae67f0
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistremovesmart.h
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistremovesmart.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTREMOVESMART_H
+#define __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTREMOVESMART_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_bline.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeDynamicListRemoveSmart :
+       public Super
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       synfig::Time time;
+       synfig::Real origin;
+       int index;
+
+
+public:
+
+       ValueNodeDynamicListRemoveSmart();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistrotateorder.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistrotateorder.cpp
new file mode 100644 (file)
index 0000000..a8c619d
--- /dev/null
@@ -0,0 +1,163 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistinsert.cpp
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistrotateorder.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodedynamiclistrotateorder.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeDynamicListRotateOrder);
+ACTION_SET_NAME(Action::ValueNodeDynamicListRotateOrder,"value_node_dynamic_list_rotate_order");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRotateOrder,"Rotate Order");
+ACTION_SET_TASK(Action::ValueNodeDynamicListRotateOrder,"rotate");
+ACTION_SET_CATEGORY(Action::ValueNodeDynamicListRotateOrder,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeDynamicListRotateOrder,0);
+ACTION_SET_VERSION(Action::ValueNodeDynamicListRotateOrder,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeDynamicListRotateOrder,"$Id: valuenodedynamiclistrotateorder.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeDynamicListRotateOrder::ValueNodeDynamicListRotateOrder()
+{
+       index=0;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::ValueNodeDynamicListRotateOrder::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
+               .set_local_name(_("ValueDesc"))
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeDynamicListRotateOrder::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
+                       return false;
+
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeDynamicListRotateOrder::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
+       {
+               ValueDesc value_desc(param.get_value_desc());
+               
+               if(!value_desc.parent_is_value_node())
+                       return false;
+               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
+               
+               if(!value_node)
+                       return false;
+
+               index=value_desc.get_index();
+
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeDynamicListRotateOrder::is_ready()const
+{
+       if(!value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeDynamicListRotateOrder::prepare()
+{
+       clear();
+       
+       for(int i(0);i<(value_node->link_count()-index)%value_node->link_count();++i)
+       {
+               ValueDesc value_desc(value_node,value_node->link_count()-1-i);
+               ValueNode::Handle child(value_desc.get_value_node());
+
+
+               Action::Handle action(Action::create("value_node_dynamic_list_remove"));
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",ValueDesc(value_node,value_node->link_count()-1));
+               
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+               
+               
+               action=Action::create("value_node_dynamic_list_insert");
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_desc",ValueDesc(value_node,0));
+               action->set_param("item",child);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+
+               
+               
+       
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistrotateorder.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistrotateorder.h
new file mode 100644 (file)
index 0000000..b28a646
--- /dev/null
@@ -0,0 +1,75 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistrotateorder.h
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistrotateorder.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTROTATEORDER_H
+#define __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTROTATEORDER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_bline.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeDynamicListRotateOrder :
+       public Super
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       int index;
+
+
+public:
+
+       ValueNodeDynamicListRotateOrder();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistunloop.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistunloop.cpp
new file mode 100644 (file)
index 0000000..7fbbf24
--- /dev/null
@@ -0,0 +1,154 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistunloop.cpp
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistunloop.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodedynamiclistunloop.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeDynamicListUnLoop);
+ACTION_SET_NAME(Action::ValueNodeDynamicListUnLoop,"value_node_dynamic_list_unloop");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListUnLoop,"Unloop");
+ACTION_SET_TASK(Action::ValueNodeDynamicListUnLoop,"unloop");
+ACTION_SET_CATEGORY(Action::ValueNodeDynamicListUnLoop,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeDynamicListUnLoop,0);
+ACTION_SET_VERSION(Action::ValueNodeDynamicListUnLoop,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeDynamicListUnLoop,"$Id: valuenodedynamiclistunloop.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeDynamicListUnLoop::ValueNodeDynamicListUnLoop()
+{
+}
+
+Action::ParamVocab
+Action::ValueNodeDynamicListUnLoop::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode"))
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeDynamicListUnLoop::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueNode::Handle value_node(x.find("value_node")->second.get_value_node());
+               if(!ValueNode_DynamicList::Handle::cast_dynamic(value_node))
+                       return false;
+               if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)->get_loop()==false)
+                       return false;
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeDynamicListUnLoop::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {               
+               value_node=ValueNode_DynamicList::Handle::cast_dynamic(param.get_value_node());
+               
+               if(!value_node)
+                       return false;
+
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeDynamicListUnLoop::is_ready()const
+{
+       if(!value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeDynamicListUnLoop::perform()
+{      
+       old_loop_value=value_node->get_loop();
+       
+       if(old_loop_value==false)
+       {
+               set_dirty(false);
+               return;
+       }
+
+       set_dirty(true);
+       value_node->set_loop(false);
+               
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
+
+void
+Action::ValueNodeDynamicListUnLoop::undo()
+{
+       if(old_loop_value==value_node->get_loop())
+       {
+               set_dirty(false);
+               return;
+       }
+
+       set_dirty(true);
+       value_node->set_loop(old_loop_value);
+               
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistunloop.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistunloop.h
new file mode 100644 (file)
index 0000000..bd1d4b1
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodedynamiclistunloop.h
+**     \brief Template File
+**
+**     $Id: valuenodedynamiclistunloop.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTUNLOOP_H
+#define __SYNFIG_APP_ACTION_VALUENODEDYNAMICLISTUNLOOP_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/activepoint.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/valuenode_bline.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeDynamicListUnLoop :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode_DynamicList::Handle value_node;
+       bool old_loop_value;
+
+
+public:
+
+       ValueNodeDynamicListUnLoop();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodelinkconnect.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodelinkconnect.cpp
new file mode 100644 (file)
index 0000000..8f1e9e1
--- /dev/null
@@ -0,0 +1,159 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodelinkconnect.cpp
+**     \brief Template File
+**
+**     $Id: valuenodelinkconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodelinkconnect.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeLinkConnect);
+ACTION_SET_NAME(Action::ValueNodeLinkConnect,"value_node_link_connect");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeLinkConnect,_("Connect ValueNode Link"));
+ACTION_SET_TASK(Action::ValueNodeLinkConnect,"connect");
+ACTION_SET_CATEGORY(Action::ValueNodeLinkConnect,Action::CATEGORY_LAYER|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeLinkConnect,0);
+ACTION_SET_VERSION(Action::ValueNodeLinkConnect,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeLinkConnect,"$Id: valuenodelinkconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeLinkConnect::ValueNodeLinkConnect():
+       index(-1)       // Initially set it to negative one so that we know when it has changed
+{
+}
+
+Action::ParamVocab
+Action::ValueNodeLinkConnect::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("parent_value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("Parent ValueNode"))
+       );
+
+       ret.push_back(ParamDesc("index",Param::TYPE_INTEGER)
+               .set_local_name(_("Index"))
+       );
+
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode to be connected"))
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeLinkConnect::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::ValueNodeLinkConnect::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="parent_value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               parent_value_node=LinkableValueNode::Handle::cast_dynamic(param.get_value_node());
+               
+               return static_cast<bool>(parent_value_node);
+       }
+
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               new_value_node=param.get_value_node();
+               
+               return true;
+       }
+
+       if(name=="index" && param.get_type()==Param::TYPE_INTEGER)
+       {
+               index=param.get_integer();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeLinkConnect::is_ready()const
+{
+       if(!new_value_node || !parent_value_node || index==-1)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeLinkConnect::perform()
+{
+       if(parent_value_node->link_count()<=index)
+               throw Error(_("Bad index, too big. LinkCount=%d, Index=%d"),parent_value_node->link_count(),index);             
+               
+       old_value_node=parent_value_node->get_link(index);
+
+       if(!parent_value_node->set_link(index,new_value_node))
+               throw Error(_("Parent would not accept link"));
+       
+       /*set_dirty(true);
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(parent_value_node);
+       }*/
+}
+
+void
+Action::ValueNodeLinkConnect::undo()
+{
+       if(parent_value_node->link_count()<=index)
+               throw Error(_("Bad index, too big. LinkCount=%d, Index=%d"),parent_value_node->link_count(),index);             
+               
+       if(!parent_value_node->set_link(index,old_value_node))
+               throw Error(_("Parent would not accept old link"));
+       
+       /*set_dirty(true);
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(parent_value_node);
+       }*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodelinkconnect.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodelinkconnect.h
new file mode 100644 (file)
index 0000000..1318489
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodelinkconnect.h
+**     \brief Template File
+**
+**     $Id: valuenodelinkconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODELINKCONNECT_H
+#define __SYNFIG_APP_ACTION_VALUENODELINKCONNECT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/valuenode.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeLinkConnect :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::LinkableValueNode::Handle       parent_value_node;
+       synfig::ValueNode::Handle       new_value_node;
+       synfig::ValueNode::Handle       old_value_node;
+       int index;
+
+
+public:
+
+       ValueNodeLinkConnect();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodelinkdisconnect.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodelinkdisconnect.cpp
new file mode 100644 (file)
index 0000000..0c6e6e2
--- /dev/null
@@ -0,0 +1,170 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodelinkdisconnect.cpp
+**     \brief Template File
+**
+**     $Id: valuenodelinkdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodelinkdisconnect.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/valuenode_const.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeLinkDisconnect);
+ACTION_SET_NAME(Action::ValueNodeLinkDisconnect,"value_node_link_disconnect");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeLinkDisconnect,_("Disconnect ValueNode Link"));
+ACTION_SET_TASK(Action::ValueNodeLinkDisconnect,"disconnect");
+ACTION_SET_CATEGORY(Action::ValueNodeLinkDisconnect,Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeLinkDisconnect,0);
+ACTION_SET_VERSION(Action::ValueNodeLinkDisconnect,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeLinkDisconnect,"$Id: valuenodelinkdisconnect.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeLinkDisconnect::ValueNodeLinkDisconnect():
+       index(-1),      // Initially set it to negative one so that we know when it has changed
+       time(0)
+{
+}
+
+Action::ParamVocab
+Action::ValueNodeLinkDisconnect::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("parent_value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("Parent ValueNode"))
+       );
+
+       ret.push_back(ParamDesc("index",Param::TYPE_INTEGER)
+               .set_local_name(_("Index"))
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_optional()
+       );
+
+       return ret;
+}
+
+bool
+Action::ValueNodeLinkDisconnect::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::ValueNodeLinkDisconnect::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="parent_value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               parent_value_node=LinkableValueNode::Handle::cast_dynamic(param.get_value_node());
+               
+               return static_cast<bool>(parent_value_node);
+       }
+
+       if(name=="index" && param.get_type()==Param::TYPE_INTEGER)
+       {
+               index=param.get_integer();
+               
+               return true;
+       }
+
+       if(name=="time" && param.get_type()==Param::TYPE_TIME)
+       {
+               time=param.get_time();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeLinkDisconnect::is_ready()const
+{
+       if(!parent_value_node || index==-1)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeLinkDisconnect::perform()
+{
+       if(parent_value_node->link_count()<=index)
+               throw Error(_("Bad index, too big. LinkCount=%d, Index=%d"),parent_value_node->link_count(),index);             
+               
+       old_value_node=parent_value_node->get_link(index);
+
+       if(!parent_value_node->set_link(index,ValueNode_Const::create((*old_value_node)(time))))
+               throw Error(_("Parent would not accept link"));
+       
+       /*
+       if(get_canvas()->get_time()!=time)
+               set_dirty(true);
+       else
+               set_dirty(false);
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(parent_value_node);
+       }
+       */
+}
+
+void
+Action::ValueNodeLinkDisconnect::undo()
+{
+       if(parent_value_node->link_count()<=index)
+               throw Error(_("Bad index, too big. LinkCount=%d, Index=%d"),parent_value_node->link_count(),index);             
+               
+       if(!parent_value_node->set_link(index,old_value_node))
+               throw Error(_("Parent would not accept old link"));
+       
+       /*if(get_canvas()->get_time()!=time)
+               set_dirty(true);
+       else
+               set_dirty(false);
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(parent_value_node);
+       }*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodelinkdisconnect.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodelinkdisconnect.h
new file mode 100644 (file)
index 0000000..e46a423
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodelinkdisconnect.h
+**     \brief Template File
+**
+**     $Id: valuenodelinkdisconnect.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODELINKDISCONNECT_H
+#define __SYNFIG_APP_ACTION_VALUENODELINKDISCONNECT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/valuenode.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeLinkDisconnect :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::LinkableValueNode::Handle       parent_value_node;
+       int index;
+       synfig::ValueNode::Handle       old_value_node;
+       synfig::Time time;
+
+public:
+
+       ValueNodeLinkDisconnect();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenoderemove.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenoderemove.cpp
new file mode 100644 (file)
index 0000000..696732e
--- /dev/null
@@ -0,0 +1,176 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenoderemove.cpp
+**     \brief Template File
+**
+**     $Id: valuenoderemove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenoderemove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeRemove);
+ACTION_SET_NAME(Action::ValueNodeRemove,"value_node_remove");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeRemove,_("Unexport"));
+ACTION_SET_TASK(Action::ValueNodeRemove,"remove");
+ACTION_SET_CATEGORY(Action::ValueNodeRemove,Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeRemove,0);
+ACTION_SET_VERSION(Action::ValueNodeRemove,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeRemove,"$Id: valuenoderemove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeRemove::ValueNodeRemove()
+{
+}
+
+Action::ParamVocab
+Action::ValueNodeRemove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueNodeRemove::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               ValueNode::Handle value_node=x.find("value_node")->second.get_value_node();
+               if(!value_node->is_exported())
+                       return false;
+//             if(value_node->rcount()!=1)
+//                     return false;
+               return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeRemove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=param.get_value_node();
+               
+               if(value_node && !value_node->is_exported())
+               {
+                       synfig::error("Action::ValueNodeRemove::set_param(): ValueBase node not exported!");
+                       value_node=0;
+               }
+               
+               return (bool)value_node;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeRemove::is_ready()const
+{
+       if(!value_node)
+               synfig::error("Action::ValueNodeRemove::is_ready(): ValueNode not set!");
+
+       if(!value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeRemove::perform()
+{      
+//     if(value_node->rcount()!=1)
+//             throw Error(_("ValueNode is still being used by something"));
+
+       old_name=value_node->get_id();
+       parent_canvas=value_node->get_parent_canvas();
+       parent_canvas->remove_value_node(value_node);
+
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_deleted()(value_node);
+       }
+       
+       //throw Error(_("Not yet implemented"));
+/*
+       assert(value_node->is_exported());
+
+       if(get_canvas()->value_node_list().count(new_name))
+               throw Error(_("A ValueNode with this ID already exists in this canvas"));
+       
+       old_name=value_node->get_id();
+
+       value_node->set_id(new_name);   
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+*/
+}
+
+void
+Action::ValueNodeRemove::undo()
+{
+       parent_canvas->add_value_node(value_node,old_name);
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_added()(value_node);
+       }
+       
+       //throw Error(_("Not yet implemented"));
+/*
+       assert(value_node->is_exported());
+
+       if(get_canvas()->value_node_list().count(old_name))
+               throw Error(_("A ValueNode with the old ID already exists in this canvas (BUG)"));
+       
+       value_node->set_id(old_name);   
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenoderemove.h b/synfig-studio/trunk/src/synfigapp/actions/valuenoderemove.h
new file mode 100644 (file)
index 0000000..a2fa7d7
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenoderemove.h
+**     \brief Template File
+**
+**     $Id: valuenoderemove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEREMOVE_H
+#define __SYNFIG_APP_ACTION_VALUENODEREMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/valuenode_const.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeRemove :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode::Handle value_node;
+       synfig::Canvas::Handle parent_canvas;
+       synfig::String new_name;
+       synfig::String old_name;
+
+
+public:
+
+       ValueNodeRemove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenoderename.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenoderename.cpp
new file mode 100644 (file)
index 0000000..8d4db5d
--- /dev/null
@@ -0,0 +1,164 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenoderename.cpp
+**     \brief Template File
+**
+**     $Id: valuenoderename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenoderename.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeRename);
+ACTION_SET_NAME(Action::ValueNodeRename,"value_node_rename");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeRename,_("Rename ValueNode"));
+ACTION_SET_TASK(Action::ValueNodeRename,"rename");
+ACTION_SET_CATEGORY(Action::ValueNodeRename,Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::ValueNodeRename,0);
+ACTION_SET_VERSION(Action::ValueNodeRename,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeRename,"$Id: valuenoderename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeRename::ValueNodeRename()
+{
+}
+
+Action::ParamVocab
+Action::ValueNodeRename::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode_Const"))
+       );
+
+       ret.push_back(ParamDesc("name",Param::TYPE_STRING)
+               .set_local_name(_("Name"))
+               .set_desc(_("The new name of the ValueNode"))
+               .set_user_supplied()
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueNodeRename::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               if(x.find("value_node")->second.get_value_node()->is_exported())
+                       return true;
+       }
+       return false;
+}
+
+bool
+Action::ValueNodeRename::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=param.get_value_node();
+               
+               if(value_node && !value_node->is_exported())
+               {
+                       synfig::error("Action::ValueNodeRename::set_param(): ValueBase node not exported!");
+                       value_node=0;
+               }
+               
+               return (bool)value_node;
+       }
+
+       if(name=="name" && param.get_type()==Param::TYPE_STRING)
+       {
+               new_name=param.get_string();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeRename::is_ready()const
+{
+       if(!value_node)
+               synfig::error("Action::ValueNodeRename::is_ready(): ValueNode not set!");
+
+       if(new_name.empty())
+               synfig::error("Action::ValueNodeRename::is_ready(): ValueNode not set!");
+
+       if(!value_node || new_name.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeRename::perform()
+{      
+       assert(value_node->is_exported());
+
+       if(get_canvas()->value_node_list().count(new_name))
+               throw Error(_("A ValueNode with this ID already exists in this canvas"));
+       
+       old_name=value_node->get_id();
+
+       value_node->set_id(new_name);   
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+}
+
+void
+Action::ValueNodeRename::undo()
+{
+       assert(value_node->is_exported());
+
+       if(get_canvas()->value_node_list().count(old_name))
+               throw Error(_("A ValueNode with the old ID already exists in this canvas (BUG)"));
+       
+       value_node->set_id(old_name);   
+       
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenoderename.h b/synfig-studio/trunk/src/synfigapp/actions/valuenoderename.h
new file mode 100644 (file)
index 0000000..856e11c
--- /dev/null
@@ -0,0 +1,76 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenoderename.h
+**     \brief Template File
+**
+**     $Id: valuenoderename.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODERENAME_H
+#define __SYNFIG_APP_ACTION_VALUENODERENAME_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/valuenode_const.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeRename :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode::Handle value_node;
+       synfig::String new_name;
+       synfig::String old_name;
+
+
+public:
+
+       ValueNodeRename();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp
new file mode 100644 (file)
index 0000000..ce0f0c1
--- /dev/null
@@ -0,0 +1,222 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodereplace.cpp
+**     \brief Template File
+**
+**     $Id: valuenodereplace.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "valuenodereplace.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::ValueNodeReplace);
+ACTION_SET_NAME(Action::ValueNodeReplace,"value_node_replace");
+ACTION_SET_LOCAL_NAME(Action::ValueNodeReplace,"Replace ValueNode");
+ACTION_SET_TASK(Action::ValueNodeReplace,"replace");
+ACTION_SET_CATEGORY(Action::ValueNodeReplace,Action::CATEGORY_VALUENODE|Action::CATEGORY_DRAG);
+ACTION_SET_PRIORITY(Action::ValueNodeReplace,0);
+ACTION_SET_VERSION(Action::ValueNodeReplace,"0.0");
+ACTION_SET_CVS_ID(Action::ValueNodeReplace,"$Id: valuenodereplace.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+void swap_guid(const ValueNode::Handle& a,const ValueNode::Handle& b)
+{
+       GUID old_a(a->get_guid());
+       a->set_guid(GUID());
+
+       GUID old_b(b->get_guid());
+       b->set_guid(GUID());
+       
+       a->set_guid(old_b);
+       b->set_guid(old_a);
+}
+
+/* === M E T H O D S ======================================================= */
+
+Action::ValueNodeReplace::ValueNodeReplace():
+       is_undoable(true)
+{
+}
+
+Action::ParamVocab
+Action::ValueNodeReplace::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("dest",Param::TYPE_VALUENODE)
+               .set_local_name(_("Destination ValueNode"))
+               .set_desc(_("ValueNode to replaced"))
+       );
+
+       ret.push_back(ParamDesc("src",Param::TYPE_VALUENODE)
+               .set_local_name(_("Source ValueNode"))
+               .set_desc(_("ValueNode that will replace the destination"))
+       );
+       
+       return ret;
+}
+
+bool
+Action::ValueNodeReplace::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::ValueNodeReplace::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="dest" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               dest_value_node=param.get_value_node();
+               
+               return true;
+       }
+
+       if(name=="src" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               src_value_node=param.get_value_node();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::ValueNodeReplace::is_ready()const
+{
+       if(!dest_value_node || !src_value_node)
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::ValueNodeReplace::perform()
+{
+       set_dirty(true);
+
+       if(dest_value_node == src_value_node)
+               throw Error(_("Attempted to replace valuenode with itself"));
+
+       if(dest_value_node->get_type() != src_value_node->get_type())
+               throw Error(_("You cannot replace ValueNodes with different types!"));
+       
+       is_undoable=true;
+       
+       if(!src_value_node->is_exported())
+       {
+               src_value_node->set_id(dest_value_node->get_id());
+               src_value_node->set_parent_canvas(dest_value_node->get_parent_canvas());
+
+               ValueNode::RHandle value_node(src_value_node);
+               
+               if(!value_node.runique() && value_node.rcount()>1)
+                       is_undoable=false;      // !!!
+       }
+       else
+               is_undoable=false;      // !!!
+       
+       if(!is_undoable)
+               synfig::warning("ValueNodeReplace: Circumstances make undoing this action impossible at the current time. :(");
+       
+       ValueNode::RHandle value_node(dest_value_node);
+       
+       if(value_node.runique() || value_node.rcount()<=1)
+               throw Error(_("Nothing to replace."));
+       
+       int replacements;
+               
+       replacements=value_node->replace(src_value_node);
+       assert(replacements);
+       if(!replacements)
+               throw Error(_("Action Failure. This is a bug. Please report it."));
+       swap_guid(dest_value_node,src_value_node);
+       
+       //src_value_node->parent_set.swap(dest_value_node->parent_set);
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_replaced()(dest_value_node,src_value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+       
+}
+
+void
+Action::ValueNodeReplace::undo()
+{
+       if(!is_undoable)
+               throw Error(_("This action cannot be undone under these circumstances."));
+               
+       set_dirty(true);
+
+       if(dest_value_node == src_value_node)
+               throw Error(_("Attempted to replace valuenode with itself"));
+
+       if(dest_value_node->get_type() != src_value_node->get_type())
+               throw Error(_("You cannot replace ValueNodes with different types!"));
+               
+       ValueNode::RHandle value_node(src_value_node);
+       
+       if(value_node.runique() || value_node.rcount()<=1)
+               throw Error(_("Nothing to replace."));
+       
+       int replacements;
+       
+       replacements=value_node->replace(dest_value_node);
+       assert(replacements);
+       if(!replacements)
+               throw Error(_("Action Failure. This is a bug. Please report it."));
+       swap_guid(dest_value_node,src_value_node);
+
+       //src_value_node->parent_set.swap(dest_value_node->parent_set);
+       
+       synfig::info(get_name()+_(": (Undo) ")+strprintf("Replaced %d ValueNode instances",replacements));
+
+       src_value_node->set_id(String());
+       src_value_node->set_parent_canvas(0);
+       
+       // Signal that a layer has been inserted
+       if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_replaced()(src_value_node,dest_value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");
+       
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.h b/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.h
new file mode 100644 (file)
index 0000000..71d8ae9
--- /dev/null
@@ -0,0 +1,75 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file valuenodereplace.h
+**     \brief Template File
+**
+**     $Id: valuenodereplace.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_VALUENODEREPLACE_H
+#define __SYNFIG_APP_ACTION_VALUENODEREPLACE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/layer.h>
+#include <synfigapp/action.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class ValueNodeReplace :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode::Handle src_value_node;
+       synfig::ValueNode::Handle dest_value_node;
+       bool is_undoable;
+
+public:
+
+       ValueNodeReplace();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointadd.cpp b/synfig-studio/trunk/src/synfigapp/actions/waypointadd.cpp
new file mode 100644 (file)
index 0000000..a5a1694
--- /dev/null
@@ -0,0 +1,213 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointadd.cpp
+**     \brief Template File
+**
+**     $Id: waypointadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "waypointadd.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfigapp/main.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::WaypointAdd);
+ACTION_SET_NAME(Action::WaypointAdd,"waypoint_add");
+ACTION_SET_LOCAL_NAME(Action::WaypointAdd,"Add Waypoint");
+ACTION_SET_TASK(Action::WaypointAdd,"add");
+ACTION_SET_CATEGORY(Action::WaypointAdd,Action::CATEGORY_WAYPOINT);
+ACTION_SET_PRIORITY(Action::WaypointAdd,0);
+ACTION_SET_VERSION(Action::WaypointAdd,"0.0");
+ACTION_SET_CVS_ID(Action::WaypointAdd,"$Id: waypointadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::WaypointAdd::WaypointAdd()
+{
+       waypoint.set_time(Time::begin()-1);
+       time_set=false;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::WaypointAdd::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("Destination ValueNode (Animated)"))
+       );
+
+       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
+               .set_local_name(_("New Waypoint"))
+               .set_desc(_("Waypoint to be added"))
+               .set_optional()
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_desc(_("Time where waypoint is to be added"))
+               .set_optional()
+       );
+
+       return ret;
+}
+
+bool
+Action::WaypointAdd::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               if(!ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
+                       return false;
+
+               // We need either a waypoint or a time.
+               if(x.count("waypoint") || x.count("time"))
+                       return true;
+       }
+       return false;
+}
+
+bool
+Action::WaypointAdd::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
+               if(time_set)
+                       calc_waypoint();
+               
+               return static_cast<bool>(value_node);
+       }
+       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT && !time_set)
+       {
+               waypoint=param.get_waypoint();
+               
+               return true;
+       }
+       if(name=="time" && param.get_type()==Param::TYPE_TIME && waypoint.get_time()==Time::begin()-1)
+       {
+               waypoint.set_time(param.get_time());
+               time_set=true;
+
+               if(value_node)
+                       calc_waypoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::WaypointAdd::is_ready()const
+{
+       if(!value_node || waypoint.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+// This function is called if a time is specified, but not 
+// a waypoint. In this case, we need to calculate the value
+// of the waypoint
+void
+Action::WaypointAdd::calc_waypoint()
+{      
+       Time time=waypoint.get_time();
+       Waypoint original(waypoint);
+       waypoint=value_node->new_waypoint_at_time(time);        
+       waypoint.mimic(original);
+       waypoint.set_before(synfigapp::Main::get_interpolation());
+       waypoint.set_after(synfigapp::Main::get_interpolation());
+
+/*
+       ValueNode_Animated::WaypointList &waypoint_list(value_node->waypoint_list());
+       ValueNode_Animated::WaypointList::iterator iter;
+       
+       if(waypoint_list.empty())
+       {
+               waypoint.set_value((*value_node)(time));
+               return;
+       }
+
+       ValueNode_Animated::WaypointList::iterator closest=waypoint_list.begin();
+               
+       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(!closest->is_static())
+               waypoint.set_value_node(closest->get_value_node());
+       else
+               waypoint.set_value((*value_node)(time));
+       */
+}
+
+void
+Action::WaypointAdd::perform()
+{              
+       try { value_node->find(waypoint.get_time()); throw Error(_("A Waypoint already exists at this point in time (%s)"),waypoint.get_time().get_string().c_str());}
+       catch(synfig::Exception::NotFound) { }  
+
+       try { if(value_node->find(waypoint)!=value_node->waypoint_list().end()) throw Error(_("This waypoint is already in the ValueNode"));}
+       catch(synfig::Exception::NotFound) { }  
+       
+       value_node->add(waypoint);
+       
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
+
+void
+Action::WaypointAdd::undo()
+{
+       value_node->erase(waypoint);
+       
+       value_node->changed();
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointadd.h b/synfig-studio/trunk/src/synfigapp/actions/waypointadd.h
new file mode 100644 (file)
index 0000000..5eed30b
--- /dev/null
@@ -0,0 +1,82 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointadd.h
+**     \brief Template File
+**
+**     $Id: waypointadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_WAYPOINTADD_H
+#define __SYNFIG_APP_ACTION_WAYPOINTADD_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/waypoint.h>
+#include <synfig/valuenode_animated.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class WaypointAdd :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::Waypoint waypoint;
+       
+       bool time_overwrite;
+       synfig::Waypoint overwritten_wp;
+
+       synfig::ValueNode_Animated::Handle value_node;
+       bool time_set;
+
+       void calc_waypoint();
+
+public:
+
+       WaypointAdd();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/waypointremove.cpp
new file mode 100644 (file)
index 0000000..f3b71c3
--- /dev/null
@@ -0,0 +1,188 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointremove.cpp
+**     \brief Template File
+**
+**     $Id: waypointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "waypointremove.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::WaypointRemove);
+ACTION_SET_NAME(Action::WaypointRemove,"waypoint_remove");
+ACTION_SET_LOCAL_NAME(Action::WaypointRemove,"Remove Waypoint");
+ACTION_SET_TASK(Action::WaypointRemove,"remove");
+ACTION_SET_CATEGORY(Action::WaypointRemove,Action::CATEGORY_WAYPOINT);
+ACTION_SET_PRIORITY(Action::WaypointRemove,0);
+ACTION_SET_VERSION(Action::WaypointRemove,"0.0");
+ACTION_SET_CVS_ID(Action::WaypointRemove,"$Id: waypointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::WaypointRemove::WaypointRemove()
+{
+       waypoint.set_time(Time::begin()-1);
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::WaypointRemove::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("ValueNode (Animated)"))
+       );
+
+       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
+               .set_local_name(_("Waypoint"))
+               .set_desc(_("Waypoint to be Removed"))
+       );
+
+       return ret;
+}
+
+bool
+Action::WaypointRemove::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::WaypointRemove::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
+               
+               return static_cast<bool>(value_node);
+       }
+       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT)
+       {
+               waypoint=param.get_waypoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::WaypointRemove::is_ready()const
+{
+       if(!value_node || waypoint.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::WaypointRemove::perform()
+{      
+       WaypointList::iterator iter(value_node->find(waypoint));
+
+       if((UniqueID)*iter!=(UniqueID)waypoint)
+               throw Error(_("UniqueID mismatch, iter=%d, waypoint=%d"),iter->get_uid(),waypoint.get_uid());
+
+       if(iter->get_time()!=waypoint.get_time())
+               throw Error(_("Time mismatch iter=%s, waypoint=%s"),iter->get_time().get_string().c_str(),waypoint.get_time().get_string().c_str());
+       
+       waypoint=*iter;
+       
+       value_node->erase(waypoint);
+
+       // In this case, we need to convert this to a
+       // constant value node
+       if(value_node->waypoint_list().size()==0)
+       {
+               if(!value_node_ref)
+               {
+                       value_node_ref=waypoint.get_value_node();
+                       if(!value_node_ref)
+                               throw Error(_("Unable to create ValueNode_Reference"));
+               }
+               
+               value_node->replace(value_node_ref);
+               value_node->waypoint_list().clear();
+               
+               if(get_canvas_interface())
+               {
+                       get_canvas_interface()->signal_value_node_replaced()(value_node,value_node_ref);
+               }
+       }
+
+       value_node->changed();
+}
+
+void
+Action::WaypointRemove::undo()
+{
+       if(value_node_ref)
+       {
+               if(value_node->waypoint_list().size()!=0)
+                       throw Error(_("This animated value node should be empty, but for some reason it isn't. This is a bug. (1)"));
+               
+               value_node_ref->replace(value_node);
+               
+               waypoint.set_value_node(value_node_ref);
+               
+               if(get_canvas_interface())
+                       get_canvas_interface()->signal_value_node_replaced()(value_node_ref,value_node);
+
+               if(value_node->waypoint_list().size()!=0)
+                       throw Error(_("This animated value node should be empty, but for some reason it isn't. This is a bug. (2)"));
+       }
+
+       if(value_node->waypoint_list().size()!=0)
+       {
+               try { value_node->find(waypoint.get_time()); throw Error(_("A Waypoint already exists at this point in time"));}
+               catch(synfig::Exception::NotFound) { }  
+               
+               try { if(value_node->find(waypoint)!=value_node->waypoint_list().end()) throw Error(_("This waypoint is already in the ValueNode"));}
+               catch(synfig::Exception::NotFound) { }  
+       }
+       
+       value_node->add(waypoint);
+       
+/*_if(get_canvas_interface())
+       {
+               get_canvas_interface()->signal_value_node_changed()(value_node);
+       }
+       else synfig::warning("CanvasInterface not set on action");*/
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointremove.h b/synfig-studio/trunk/src/synfigapp/actions/waypointremove.h
new file mode 100644 (file)
index 0000000..b45aea9
--- /dev/null
@@ -0,0 +1,77 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointremove.h
+**     \brief Template File
+**
+**     $Id: waypointremove.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_WAYPOINTREMOVE_H
+#define __SYNFIG_APP_ACTION_WAYPOINTREMOVE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/waypoint.h>
+#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_reference.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class WaypointRemove :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+
+       synfig::ValueNode_Animated::Handle value_node;
+       synfig::ValueNode::Handle value_node_ref;
+       synfig::Waypoint waypoint;
+
+public:
+
+       WaypointRemove();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointset.cpp b/synfig-studio/trunk/src/synfigapp/actions/waypointset.cpp
new file mode 100644 (file)
index 0000000..00c916a
--- /dev/null
@@ -0,0 +1,266 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointset.cpp
+**     \brief Template File
+**
+**     $Id: waypointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "waypointset.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::WaypointSet);
+ACTION_SET_NAME(Action::WaypointSet,"waypoint_set");
+ACTION_SET_LOCAL_NAME(Action::WaypointSet,"Set Waypoint");
+ACTION_SET_TASK(Action::WaypointSet,"set");
+ACTION_SET_CATEGORY(Action::WaypointSet,Action::CATEGORY_WAYPOINT);
+ACTION_SET_PRIORITY(Action::WaypointSet,0);
+ACTION_SET_VERSION(Action::WaypointSet,"0.0");
+ACTION_SET_CVS_ID(Action::WaypointSet,"$Id: waypointset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::WaypointSet::WaypointSet()
+{
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::WaypointSet::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("Destination ValueNode (Animated)"))
+       );
+
+       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
+               .set_local_name(_("Waypoint"))
+               .set_desc(_("Waypoint to be changed"))
+               .set_supports_multiple()
+       );
+
+       return ret;
+}
+
+bool
+Action::WaypointSet::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::WaypointSet::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
+               
+               return static_cast<bool>(value_node);
+       }
+       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT)
+       {
+               //NOTE: at the moment there is no error checking for multiple sets!!!
+               waypoints.push_back(param.get_waypoint());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::WaypointSet::is_ready()const
+{
+       if(!value_node || waypoints.empty())
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::WaypointSet::perform()
+{      
+       WaypointList::iterator iter;
+
+#if 1  
+       vector<WaypointList::iterator>  iters;
+       vector<Waypoint>::iterator i = waypoints.begin(), end = waypoints.end();        
+       
+       for(; i != end; ++i)
+       {
+               try { iters.push_back(value_node->find(*i)); }
+               catch(synfig::Exception::NotFound)
+               {
+                       throw Error(_("Unable to find waypoint"));
+               }
+       }
+       
+       //check to see which valuenodes are going to override because of the time...
+       ValueNode_Animated::findresult timeiter;
+       
+       for(i = waypoints.begin(); i != end; ++i)
+       {
+               timeiter = value_node->find_time(i->get_time());
+               
+               bool candelete = timeiter.second;
+       
+               //we only want to track overwrites (not waypoints that are also being modified)
+               if(candelete)
+               {
+                       for(vector<WaypointList::iterator>::iterator ii = iters.begin(); ii != iters.end(); ++ii)
+                       {
+                               if(timeiter.first == *ii)
+                               {
+                                       candelete = false;
+                                       break;
+                               }
+                       }
+               }
+               
+               //if we can still delete it after checking, record it, and then remove them all later
+               if(candelete)
+               {
+                       Waypoint w = *timeiter.first;
+                       overwritten_waypoints.push_back(w);
+               }
+       }
+       
+       //overwrite all the valuenodes we're supposed to set
+       {
+               i = waypoints.begin();
+               for(vector<WaypointList::iterator>::iterator ii = iters.begin(); ii != iters.end() && i != end; ++ii, ++i)
+               {
+                       old_waypoints.push_back(**ii);
+                       **ii = *i; //set the point to the corresponding point in the normal waypoint list
+               }
+       }
+       
+       //remove all the points we're supposed to be overwritting
+       {
+               vector<Waypoint>::iterator      oi = overwritten_waypoints.begin(),
+                                                                       oend = overwritten_waypoints.end();
+               for(; oi != oend; ++oi)
+               {
+                       value_node->erase(*oi);
+               }
+       }
+
+#else
+       try { iter=value_node->find(waypoint); }
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find waypoint"));
+       }
+
+       //find the value at the old time before we replace it
+       ValueNode_Animated::findresult timeiter;
+       timeiter = value_node->find_time(waypoint.get_time());
+       
+       //we only want to track overwrites (not inplace modifications)
+       if(timeiter.second && waypoint.get_uid() == timeiter.first->get_uid())
+       {
+               timeiter.second = false;                        
+       }
+               
+       //copy and overwrite
+       old_waypoint=*iter;
+       *iter=waypoint;
+       
+       //if we've found a unique one then we need to erase it, but store it first
+       if(timeiter.second)
+       {
+               time_overwrite = true;
+               overwritten_wp = *timeiter.first;
+               
+               value_node->erase(overwritten_wp);
+       }
+#endif
+       
+       // Signal that a valuenode has been changed
+       value_node->changed();
+}
+
+void
+Action::WaypointSet::undo()
+{
+       WaypointList::iterator iter;
+       
+#if 1
+       vector<Waypoint>::iterator i = old_waypoints.begin(), end = old_waypoints.end();        
+       
+       for(; i != end; ++i)
+       {
+               try { iter = value_node->find(*i); }
+               catch(synfig::Exception::NotFound)
+               {
+                       throw Error(_("Unable to find waypoint"));
+               }
+               
+               //overwrite with old one
+               *iter = *i;
+       }
+               
+       //add back in all the points that we removed before...
+       {
+               vector<Waypoint>::iterator      oi = overwritten_waypoints.begin(),
+                                                                       oend = overwritten_waypoints.end();
+               for(; oi != oend; ++oi)
+               {
+                       value_node->add(*oi);
+               }
+       }
+
+#else
+       try { iter=value_node->find(old_waypoint); }
+       catch(synfig::Exception::NotFound)
+       {
+               throw Error(_("Unable to find waypoint"));
+       }       
+
+       *iter=old_waypoint;
+       
+       if(time_overwrite)
+       {
+               value_node->add(overwritten_wp);
+       }
+#endif
+       
+       // Signal that a valuenode has been changed
+       value_node->changed();
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointset.h b/synfig-studio/trunk/src/synfigapp/actions/waypointset.h
new file mode 100644 (file)
index 0000000..4de30cd
--- /dev/null
@@ -0,0 +1,79 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointset.h
+**     \brief Template File
+**
+**     $Id: waypointset.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_WAYPOINTSET_H
+#define __SYNFIG_APP_ACTION_WAYPOINTSET_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/waypoint.h>
+#include <synfig/valuenode_animated.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class WaypointSet :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+       
+       synfig::ValueNode_Animated::Handle value_node;
+       
+       std::vector<synfig::Waypoint> waypoints;
+       std::vector<synfig::Waypoint> old_waypoints;    
+
+       std::vector<synfig::Waypoint> overwritten_waypoints;
+
+public:
+
+       WaypointSet();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointsetsmart.cpp b/synfig-studio/trunk/src/synfigapp/actions/waypointsetsmart.cpp
new file mode 100644 (file)
index 0000000..8d8c933
--- /dev/null
@@ -0,0 +1,467 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointsetsmart.cpp
+**     \brief Template File
+**
+**     $Id: waypointsetsmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "waypointsetsmart.h"
+#include "valuenodelinkconnect.h"
+#include "valuenodereplace.h"
+
+#include "waypointset.h"
+#include "waypointadd.h"
+
+#include "valuedescconnect.h"
+#include <synfigapp/canvasinterface.h>
+#include <synfig/exception.h>
+#include <synfigapp/main.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::WaypointSetSmart);
+ACTION_SET_NAME(Action::WaypointSetSmart,"waypoint_set_smart");
+ACTION_SET_LOCAL_NAME(Action::WaypointSetSmart,"Connect");
+ACTION_SET_TASK(Action::WaypointSetSmart,"set");
+ACTION_SET_CATEGORY(Action::WaypointSetSmart,Action::CATEGORY_WAYPOINT|Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE);
+ACTION_SET_PRIORITY(Action::WaypointSetSmart,0);
+ACTION_SET_VERSION(Action::WaypointSetSmart,"0.0");
+ACTION_SET_CVS_ID(Action::WaypointSetSmart,"$Id: waypointsetsmart.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+
+/*#ifdef DEBUGPOINT
+#undef DEBUGPOINT
+#endif
+#define DEBUGPOINT()
+*/
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::WaypointSetSmart::WaypointSetSmart()
+{
+       waypoint.set_time(Time::begin()-1);
+       time_set=false;
+       set_dirty(true);
+}
+
+Action::ParamVocab
+Action::WaypointSetSmart::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("Destination ValueNode (Animated)"))
+       );
+
+       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
+               .set_local_name(_("New Waypoint"))
+               .set_desc(_("Waypoint to be added"))
+               .set_optional()
+       );
+
+       ret.push_back(ParamDesc("waypoint_model",Param::TYPE_WAYPOINTMODEL)
+               .set_local_name(_("Waypoint Model"))
+               .set_optional()
+       );
+
+       ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+               .set_local_name(_("Time"))
+               .set_desc(_("Time where waypoint is to be added"))
+               .set_optional()
+       );
+       
+       return ret;
+}
+
+bool
+Action::WaypointSetSmart::is_canidate(const ParamList &x)
+{
+       if(canidate_check(get_param_vocab(),x))
+       {
+               if(!ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
+                       return false;
+               // We need either a waypoint or a time.
+               if(x.count("waypoint") || x.count("time"))
+                       return true;
+               return false;
+       }
+       return false;
+}
+
+bool
+Action::WaypointSetSmart::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
+               DEBUGPOINT();
+               if(time_set)
+                       calc_waypoint();
+               
+               return static_cast<bool>(value_node);
+       }
+       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT && !time_set)
+       {
+               waypoint=param.get_waypoint();
+               DEBUGPOINT();
+               
+               return true;
+       }
+
+       if(name=="time" && param.get_type()==Param::TYPE_TIME && waypoint.get_time()==(Time::begin()-1))
+       {
+               waypoint.set_time(param.get_time());
+               time_set=true;
+
+               if(value_node)
+                       calc_waypoint();
+               DEBUGPOINT();
+               
+               return true;
+       }
+
+       if(name=="model" && param.get_type()==Param::TYPE_WAYPOINTMODEL)
+       {
+               if(value_node)
+                       calc_waypoint();
+
+               waypoint.apply_model(param.get_waypoint_model());
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::WaypointSetSmart::is_ready()const
+{
+       if(!value_node)
+               synfig::error("Missing value_node");
+
+       if(waypoint.get_time()==(Time::begin()-1))
+               synfig::error("Missing waypoint");
+       
+       if(!value_node || waypoint.get_time()==(Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+// This function is called if a time is specified, but not 
+// a waypoint. In this case, we need to calculate the value
+// of the waypoint
+void
+Action::WaypointSetSmart::calc_waypoint()
+{
+       DEBUGPOINT();
+       Time time=waypoint.get_time();  
+       try
+       {
+               // Trivial case, we are sitting on a waypoint
+               waypoint=*value_node->find(waypoint.get_time());
+       }
+       catch(...)
+       {
+               waypoint=value_node->new_waypoint_at_time(time);        
+               waypoint.set_before(synfigapp::Main::get_interpolation());
+               waypoint.set_after(synfigapp::Main::get_interpolation());
+       }
+/*
+       Time time=waypoint.get_time();
+       ValueNode_Animated::WaypointList &waypoint_list(value_node->waypoint_list());
+       ValueNode_Animated::WaypointList::iterator iter;
+       
+       if(waypoint_list.empty())
+       {
+               waypoint.set_value((*value_node)(time));
+               return;
+       }
+
+       ValueNode_Animated::WaypointList::iterator closest=waypoint_list.begin();
+               
+       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(!closest->is_static())
+               waypoint.set_value_node(closest->get_value_node());
+       else
+               waypoint.set_value((*value_node)(time));
+*/
+}
+
+void
+Action::WaypointSetSmart::enclose_waypoint(const synfig::Waypoint& waypoint)
+{
+       times.insert(waypoint.get_time());                      
+       
+       try {
+               times.insert(value_node->find(waypoint)->get_time());
+//             synfig::info(__FILE__":%d: value_node->find(waypoint)->get_time()=%s",__LINE__,value_node->find(waypoint)->get_time().get_string().c_str());
+//             DEBUGPOINT();
+       }catch (...) { }
+       
+//     DEBUGPOINT();
+       // First we need to to add any waypoints necessary to
+       // maintain the integrity of the keyframes.     
+       if(get_edit_mode()&MODE_ANIMATE_PAST) try
+       {
+               Time curr_time(waypoint.get_time());
+               
+               //while(value_node->waypoint_list().front().get_time()<=curr_time)
+               {
+                       // Try to find prev keyframe
+                       Keyframe keyframe(*get_canvas()->keyframe_list().find_prev(curr_time));
+                       curr_time=keyframe.get_time();
+
+//                     synfig::info(__FILE__":%d: prev_keyframe->time=%s",__LINE__,keyframe.get_time().get_string().c_str());
+//                     synfig::info(__FILE__":%d: waypoint->time=%s",__LINE__,waypoint.get_time().get_string().c_str());
+                       
+//                     DEBUGPOINT();
+                       if(times.count(keyframe.get_time()))
+                       {
+//                             DEBUGPOINT();
+                               throw int();
+                       }
+                       if(waypoint.get_time().is_equal(keyframe.get_time()))
+                       {
+//                             DEBUGPOINT();
+                               throw int();
+                       }
+
+                       times.insert(keyframe.get_time());                      
+//                     DEBUGPOINT();
+                       try
+                       {
+                               value_node->find(keyframe.get_time());
+//                             synfig::info(__FILE__":%d: waypointtime=%s",__LINE__,value_node->find(keyframe.get_time())->get_time().get_string().c_str());
+                       }
+                       catch(synfig::Exception::NotFound)
+                       {
+                               Action::Handle action(WaypointAdd::create());
+                               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_node",ValueNode::Handle(value_node));
+                       
+                               if(!value_node->waypoint_list().empty())
+                               {       
+                                       action->set_param("time",keyframe.get_time());
+                               }
+                               else
+                               {
+                                       synfig::Waypoint tmp;
+                                       
+                                       tmp.set_value(waypoint.get_value());
+                                       tmp.set_time(keyframe.get_time());
+                                       action->set_param("waypoint",tmp);
+                               }
+       
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                       
+                               add_action(action);
+                       }                                               
+               }               
+       }
+       catch(Error x) { throw x; }
+       catch(synfig::Exception::NotFound) { DEBUGPOINT(); }
+       catch(int) { DEBUGPOINT(); }
+       catch(...) { DEBUGPOINT(); }
+                       //DEBUGPOINT();
+
+               //DEBUGPOINT();
+       if(get_edit_mode()&MODE_ANIMATE_FUTURE)try
+       {
+               Time curr_time(waypoint.get_time());
+               
+               //while(value_node->waypoint_list().back().get_time()>=curr_time)
+               {
+       
+                       //DEBUGPOINT();
+                       // Try to find next keyframe
+                       //synfig::info("FUTURE waypoint.get_time()=%s",waypoint.get_time().get_string().c_str());
+                       Keyframe keyframe(*get_canvas()->keyframe_list().find_next(curr_time));
+                       //synfig::info("FUTURE keyframe.get_time()=%s",keyframe.get_time().get_string().c_str());
+                       curr_time=keyframe.get_time();
+                       
+                       //DEBUGPOINT();
+                       if(times.count(keyframe.get_time())|| waypoint.get_time().is_equal(keyframe.get_time()))
+                               throw int();
+                       else
+                               times.insert(keyframe.get_time());                      
+                       //DEBUGPOINT();
+                       
+                       try
+                       {
+                               value_node->find(keyframe.get_time());
+                               synfig::info(__FILE__":%d: time=%s",__LINE__,keyframe.get_time().get_string().c_str());
+                               synfig::info(__FILE__":%d: waypointtime=%s",__LINE__,value_node->find(keyframe.get_time())->get_time().get_string().c_str());
+                               
+                       }
+                       catch(synfig::Exception::NotFound)
+                       {
+                               Action::Handle action(WaypointAdd::create());
+                               
+                               action->set_param("canvas",get_canvas());
+                               action->set_param("canvas_interface",get_canvas_interface());
+                               action->set_param("value_node",ValueNode::Handle(value_node));
+                       
+                               if(!value_node->waypoint_list().empty())
+                               {       
+                                       action->set_param("time",keyframe.get_time());
+                               }
+                               else
+                               {
+                                       synfig::Waypoint tmp;
+                                       
+                                       tmp.set_value(waypoint.get_value());
+                                       tmp.set_time(keyframe.get_time());
+                                       action->set_param("waypoint",tmp);
+                               }
+       
+                               assert(action->is_ready());
+                               if(!action->is_ready())
+                                       throw Error(Error::TYPE_NOTREADY);
+                       
+                               add_action(action);
+                       }
+               }
+                       //DEBUGPOINT();
+       }
+       catch(Error x) { throw x; }
+       catch(synfig::Exception::NotFound) { DEBUGPOINT(); }
+       catch(int) { DEBUGPOINT(); }
+       catch(...) { DEBUGPOINT(); }
+               //DEBUGPOINT();
+}
+
+void
+Action::WaypointSetSmart::prepare()
+{
+               //DEBUGPOINT();
+       clear();
+       times.clear();
+       
+       // First we need to to add any waypoints necessary to
+       // maintain the integrity of the keyframes.     
+       enclose_waypoint(waypoint);
+
+       try
+       {
+               //synfig::info("WaypointSetSmart: Move/Update?");
+               // Lets try to replace the old waypoint, if it exists
+               WaypointList::iterator iter(value_node->find(waypoint));
+               
+               if(iter == value_node->waypoint_list().end())
+                       throw int();
+               
+               enclose_waypoint(*iter);
+
+               Action::Handle action(WaypointSet::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_node",ValueNode::Handle(value_node));
+               action->set_param("waypoint",waypoint);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+               
+               return;
+       }
+       catch(synfig::Exception::NotFound){ } catch(int){ }
+
+       try
+       {
+               //synfig::info("WaypointSetSmart: Replace?");
+               //DEBUGPOINT();
+               // Check to see if a waypoint exists at this point in time
+               WaypointList::iterator iter=value_node->find(waypoint.get_time());
+               
+               waypoint.mimic(*iter);
+
+               enclose_waypoint(*iter);
+               
+               Action::Handle action(WaypointSet::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_node",ValueNode::Handle(value_node));
+               action->set_param("waypoint",waypoint);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+               
+               return;
+       }
+       catch(synfig::Exception::NotFound){ } catch(int){ }
+       
+       try
+       {
+               //synfig::info("WaypointSetSmart: Add?");
+               //DEBUGPOINT();
+               // At this point we know that the old waypoint doesn't exist,
+               // so we need to create it.
+               Action::Handle action(WaypointAdd::create());
+               
+               action->set_param("canvas",get_canvas());
+               action->set_param("canvas_interface",get_canvas_interface());
+               action->set_param("value_node",ValueNode::Handle(value_node));
+               action->set_param("waypoint",waypoint);
+       
+               assert(action->is_ready());
+               if(!action->is_ready())
+                       throw Error(Error::TYPE_NOTREADY);
+       
+               add_action(action);
+               
+               return;
+       }
+       catch(synfig::Exception::NotFound){ } catch(int){ }
+
+       throw Error(_("Unable to determine how to procede. This is a bug."));   
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointsetsmart.h b/synfig-studio/trunk/src/synfigapp/actions/waypointsetsmart.h
new file mode 100644 (file)
index 0000000..7faede9
--- /dev/null
@@ -0,0 +1,81 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointsetsmart.h
+**     \brief Template File
+**
+**     $Id: waypointsetsmart.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_ACTION_WAYPOINTSETSMART_H
+#define __SYNFIG_APP_ACTION_WAYPOINTSETSMART_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfigapp/value_desc.h>
+#include <synfig/valuenode_animated.h>
+
+#include <list>
+#include <set>
+
+/* === 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 synfigapp {
+
+namespace Action {
+
+class WaypointSetSmart :
+       public Super
+{
+private:
+
+       synfig::ValueNode_Animated::Handle value_node;
+       synfig::Waypoint waypoint;
+       //synfig::WaypointModel waypoint_model;
+       bool time_set;
+
+       void calc_waypoint();
+       void enclose_waypoint(const synfig::Waypoint& waypoint);
+
+       std::set<synfig::Time> times;
+
+public:
+
+       WaypointSetSmart();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void prepare();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.cpp b/synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.cpp
new file mode 100644 (file)
index 0000000..243b3b0
--- /dev/null
@@ -0,0 +1,156 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointsimpleadd.cpp
+**     \brief Simple add waypoint File
+**
+**     $Id: waypointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "waypointsimpleadd.h"
+#include <synfigapp/canvasinterface.h>
+
+#endif
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+using namespace Action;
+
+/* === M A C R O S ========================================================= */
+
+ACTION_INIT(Action::WaypointSimpleAdd);
+ACTION_SET_NAME(Action::WaypointSimpleAdd,"waypoint_simpleadd");
+ACTION_SET_LOCAL_NAME(Action::WaypointSimpleAdd,"Simply Add Waypoint");
+ACTION_SET_TASK(Action::WaypointSimpleAdd,"add");
+ACTION_SET_CATEGORY(Action::WaypointSimpleAdd,Action::CATEGORY_WAYPOINT);
+ACTION_SET_PRIORITY(Action::WaypointSimpleAdd,0);
+ACTION_SET_VERSION(Action::WaypointSimpleAdd,"0.0");
+ACTION_SET_CVS_ID(Action::WaypointSimpleAdd,"$Id: waypointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+Action::WaypointSimpleAdd::WaypointSimpleAdd()
+{
+       set_dirty(true);
+       waypoint.set_time(Time::begin()-1);
+}
+
+Action::ParamVocab
+Action::WaypointSimpleAdd::get_param_vocab()
+{
+       ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
+       
+       ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE)
+               .set_local_name(_("Destination ValueNode (Animated)"))
+       );
+
+       ret.push_back(ParamDesc("waypoint",Param::TYPE_WAYPOINT)
+               .set_local_name(_("Waypoint"))
+               .set_desc(_("Waypoint to be added"))
+       );
+
+       return ret;
+}
+
+bool
+Action::WaypointSimpleAdd::is_canidate(const ParamList &x)
+{
+       return canidate_check(get_param_vocab(),x);
+}
+
+bool
+Action::WaypointSimpleAdd::set_param(const synfig::String& name, const Action::Param &param)
+{
+       if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE)
+       {
+               value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node());
+               
+               return static_cast<bool>(value_node);
+       }
+       if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT)
+       {
+               waypoint = param.get_waypoint();
+               
+               return true;
+       }
+
+       return Action::CanvasSpecific::set_param(name,param);
+}
+
+bool
+Action::WaypointSimpleAdd::is_ready()const
+{
+       if(!value_node && waypoint.get_time() != (Time::begin()-1))
+               return false;
+       return Action::CanvasSpecific::is_ready();
+}
+
+void
+Action::WaypointSimpleAdd::perform()
+{      
+       //remove any pretenders that lie at our destination
+       ValueNode_Animated::findresult iter = value_node->find_time(waypoint.get_time());
+       
+       time_overwrite = false;
+       if(iter.second)
+       {
+               overwritten_wp = *iter.first;
+               time_overwrite = true;
+       }
+       
+       //add the value node in since it's safe
+       value_node->add(waypoint);
+       
+       // Signal that a valuenode has been changed
+       value_node->changed();
+}
+
+void
+Action::WaypointSimpleAdd::undo()
+{
+       //remove our old version...
+       ValueNode_Animated::findresult iter = value_node->find_uid(waypoint);
+       
+       if(!iter.second)
+       {
+               throw Error(_("The waypoint to remove no longer exists"));
+       }
+       
+       //remove the offending value
+       value_node->erase(*iter.first); //could also just use waypoint
+       
+       if(time_overwrite)
+       {
+               value_node->add(overwritten_wp);                                
+       }
+       
+       // Signal that a valuenode has been changed
+       value_node->changed();
+}
diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.h b/synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.h
new file mode 100644 (file)
index 0000000..409c8ec
--- /dev/null
@@ -0,0 +1,79 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file waypointsimpleadd.h
+**     \brief A simple add a waypoint function Header
+**
+**     $Id: waypointsimpleadd.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_WAYPOINTSIMPLEADD_H
+#define __SYNFIG_WAYPOINTSIMPLEADD_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfigapp/action.h>
+#include <synfig/waypoint.h>
+#include <synfig/valuenode_animated.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 synfigapp {
+
+class Instance;
+
+namespace Action {
+
+class WaypointSimpleAdd :
+       public Undoable,
+       public CanvasSpecific
+{
+private:
+       
+       synfig::ValueNode_Animated::Handle value_node;
+       
+       synfig::Waypoint waypoint;
+
+       bool time_overwrite;
+       synfig::Waypoint overwritten_wp;
+
+public:
+
+       WaypointSimpleAdd();
+
+       static ParamVocab get_param_vocab();
+       static bool is_canidate(const ParamList &x);
+
+       virtual bool set_param(const synfig::String& name, const Param &);
+       virtual bool is_ready()const;
+
+       virtual void perform();
+       virtual void undo();
+
+       ACTION_MODULE_EXT
+};
+
+}; // END of namespace action
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/blineconvert.cpp b/synfig-studio/trunk/src/synfigapp/blineconvert.cpp
new file mode 100644 (file)
index 0000000..724c2b8
--- /dev/null
@@ -0,0 +1,835 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file blineconvert.cpp
+**     \brief Template File
+**
+**     $Id: blineconvert.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "blineconvert.h"
+#include <vector>
+#include <ETL/gaussian>
+#include <ETL/hermite>
+#include <ETL/clock>
+#include <float.h>
+#include <algorithm>
+#include <synfig/general.h>
+#include <cassert>
+
+
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+
+/* === M A C R O S ========================================================= */
+
+#define EPSILON                (1e-10)
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+
+//Derivative Functions for numerical approximation
+
+//bias == 0 will get F' at f3, bias < 0 will get F' at f1, and bias > 0 will get F' at f5
+template < class T >
+inline void FivePointdt(T &df, const T &f1, const T &f2, const T &f3, const T &f4, const T &f5, int bias)
+{
+       if(bias == 0)
+       {
+               //middle
+               df = (f1 - f2*8 + f4*8 - f5)*(1/12.0f);
+       }else if(bias < 0)
+       {
+               //left
+               df = (-f1*25 + f2*48 - f3*36 + f4*16 - f5*3)*(1/12.0f);
+       }else
+       {
+               //right
+               df = (f1*3 - f2*16 + f3*36 - f4*48 + f5*25)*(1/12.0f);
+       }
+}
+
+template < class T >
+inline void ThreePointdt(T &df, const T &f1, const T &f2, const T &f3, int bias)
+{
+       if(bias == 0)
+       {
+               //middle
+               df = (-f1 + f3)*(1/2.0f);
+       }else if(bias < 0)
+       {
+               //left
+               df = (-f1*3 + f2*4 - f3)*(1/2.0f);
+       }else
+       {
+               //right
+               df = (f1 - f2*4 + f3*3)*(1/2.0f);
+       }
+}
+
+template < class T >
+inline void ThreePointddt(T &df, const T &f1, const T &f2, const T &f3, int bias)
+{
+       //a 3 point approximation pretends to have constant acceleration, so only one algorithm needed for left, middle, or right
+       df = (f1 -f2*2 + f3)*(1/2.0f);
+}
+
+// WARNING -- totaly broken
+template < class T >
+inline void FivePointddt(T &df, const T &f1, const T &f2, const T &f3, int bias)
+{
+       if(bias == 0)
+       {
+               assert(0); // !?
+               //middle
+               //df = (- f1 + f2*16 - f3*30 +  f4*16 - f5)*(1/12.0f);
+       }/*else if(bias < 0)
+       {
+               //left
+               df = (f1*7 - f2*26*4 + f3*19*6 - f4*14*4 + f5*11)*(1/12.0f);
+       }else
+       {
+               //right
+               df = (f1*3 - f2*16 + f3*36 - f4*48 + f5*25)*(1/12.0f);
+       }*/
+       //side ones don't work, use 3 point
+}
+
+//implement an arbitrary derivative
+//dumb algorithm
+template < class T >
+void DerivativeApprox(T &df, const T f[], const Real t[], int npoints, int indexval)
+{
+       /*
+       Lj(x) = PI_i!=j (x - xi) / PI_i!=j (xj - xi)
+       
+       so Lj'(x) = SUM_k PI_i!=j|k (x - xi) / PI_i!=j (xj - xi)
+       */
+       
+       unsigned int i,j,k,i0,i1;
+       
+       Real Lpj,mult,div,tj;
+       Real tval = t[indexval];
+                               
+       //sum k 
+       for(j=0;j<npoints;++j)
+       {
+               Lpj = 0;
+               div = 1;
+               tj = t[j];
+               
+               for(k=0;k<npoints;++k)
+               {
+                       if(k != j) //because there is no summand for k == j, since that term is missing from the original equation
+                       {
+                               //summation for k
+                               for(i=0;i<npoints;++i)
+                               {
+                                       if(i != k)
+                                       {
+                                               mult *= tval - t[i];
+                                       }
+                               }
+                               
+                               Lpj += mult; //add into the summation
+                               
+                               //since the ks follow the exact patern we need for the divisor (use that too)
+                               div *= tj - t[k];
+                       }
+               }
+               
+               //get the actual coefficient
+               Lpj /= div;
+               
+               //add it in to the equation
+               df += f[j]*Lpj;
+       }
+}
+
+//END numerical derivatives
+
+template < class T >
+inline int sign(T f, T tol)
+{
+       if(f < -tol) return -1;
+       if(f > tol) return 1;
+       return 0;
+}
+
+void GetFirstDerivatives(const std::vector<synfig::Point> &f, unsigned int left, unsigned int right, char *out, unsigned int dfstride)
+{
+       unsigned int current = left;
+
+       if(right - left < 2)
+               return;
+       else if(right - left < 3)
+       {
+               synfig::Vector v = f[left+1] - f[left];
+               
+               //set both to the one we want
+               *(synfig::Vector*)out = v;
+               out += dfstride;
+               *(synfig::Vector*)out = v;
+               out += dfstride;
+       }
+       else if(right - left < 6/*5*/) //should use 3 point
+       {
+               //left then middle then right
+               ThreePointdt(*(synfig::Vector*)out,f[left+0], f[left+1], f[left+2], -1);
+               current += 1;
+               out += dfstride;
+               
+               for(;current < right-1; current++, out += dfstride)
+               {
+                       ThreePointdt(*(synfig::Vector*)out,f[current-1], f[current], f[current+1], 0);
+               }
+
+               ThreePointdt(*(synfig::Vector*)out,f[right-3], f[right-2], f[right-1], 1);
+               current++;
+               out += dfstride;
+               
+       }else //can use 5 point
+       {
+               //left 2 then middle bunch then right two
+               //may want to use 3 point for inner edge ones
+               
+               FivePointdt(*(synfig::Vector*)out,f[left+0], f[left+1], f[left+2], f[left+3], f[left+4], -2);
+               out += dfstride;
+               FivePointdt(*(synfig::Vector*)out,f[left+1], f[left+2], f[left+3], f[left+4], f[left+5], -1);
+               out += dfstride;
+               current += 2;
+               
+               for(;current < right-2; current++, out += dfstride)
+               {
+                       FivePointdt(*(synfig::Vector*)out,f[current-2], f[current-1], f[current], f[current+1], f[current+2], 0);
+               }
+
+               FivePointdt(*(synfig::Vector*)out,f[right-5], f[right-4], f[right-3], f[right-2], f[right-1], 1);
+               out += dfstride;
+               FivePointdt(*(synfig::Vector*)out,f[right-6], f[right-5], f[right-4], f[right-3], f[right-2], 2);               
+               out += dfstride;
+               current += 2;
+       }
+}
+
+void GetSimpleDerivatives(const std::vector<synfig::Point> &f, int left, int right, 
+                                                       std::vector<synfig::Point> &df, int outleft,
+                                                       const std::vector<synfig::Real> &di)
+{
+       int i1,i2,i;
+       int offset = 2; //df = 1/2 (f[i+o]-f[i-o])
+       
+       assert((int)df.size() >= right-left+outleft); //must be big enough
+       
+       for(i = left; i < right; ++i)
+       {
+               //right now indices (figure out distance later)
+               i1 = std::max(left,i-offset);
+               i2 = std::max(left,i+offset);
+               
+               df[outleft++] = (f[i2] - f[i1])*0.5f;
+       }
+}
+
+//get the curve error from the double sample list of work points (hopefully that's enough)
+Real CurveError(const synfig::Point *pts, unsigned int n, std::vector<synfig::Point> &work, int left, int right)
+{
+       if(right-left < 2) return -1;
+               
+       int i,j;
+       
+       //get distances to each point
+       Real d,dtemp,dsum;
+       //synfig::Vector v,vt;
+       //synfig::Point p1,p2;
+       synfig::Point pi;
+       std::vector<synfig::Point>::const_iterator it;//,end = work.begin()+right;
+       
+       //unsigned int size = work.size();
+       
+       //for each line, get distance
+       d = 0; //starts at 0
+       for(i = 0; i < (int)n; ++i)
+       {               
+               pi = pts[i];
+               
+               dsum = FLT_MAX;
+               
+               it = work.begin()+left;
+               //p2 = *it++; //put it at left+1
+               for(j = left/*+1*/; j < right; ++j,++it)
+               {
+                       /*p1 = p2;
+                       p2 = *it;
+                       
+                       v = p2 - p1;                    
+                       vt = pi - p1;
+                       
+                       dtemp = 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(dtemp >= 1)  //use p+v
+                       {
+                               vt += v; //makes it pp - (p+v)  
+                       }else if(dtemp > 0)     //use vt-proj
+                       {
+                               vt -= v*dtemp; // vt - proj_v(vt)       //must normalize the projection vector to work
+                       }
+                       
+                       //else use p
+                       dtemp = vt.mag_squared();*/
+                       
+                       dtemp = (pi - *it).mag_squared();                       
+                       if(dtemp < dsum)
+                               dsum = dtemp;
+               }
+               
+               //accumulate the points' min distance from the curve
+               d += sqrt(dsum);
+       }
+       
+       return d;
+}
+
+typedef synfigapp::BLineConverter::cpindex cpindex;
+
+//has the index data and the tangent scale data (relevant as it may be)
+int tesselate_curves(const std::vector<cpindex> &inds, const std::vector<Point> &f, const std::vector<synfig::Vector> &df, std::vector<Point> &work)
+{
+       if(inds.size() < 2)
+               return 0;
+       
+       etl::hermite<Point>     curve;
+       int ntess = 0;
+       
+       std::vector<cpindex>::const_iterator j = inds.begin(),j2, end = inds.end();
+       
+       unsigned int ibase = inds[0].curind;
+               
+       j2 = j++;
+       for(; j != end; j2 = j++)
+       {
+               //if this curve has invalid error (in j) then retesselate it's work points (requires reparametrization, etc.)
+               if(j->error < 0)
+               {
+                       //get the stepsize etc. for the number of points in here
+                       unsigned int n = j->curind - j2->curind + 1; //thats the number of points in the span
+                       unsigned int k, kend, i0, i3;
+                       //so reset the right chunk
+                       
+                       Real t, dt = 1/(Real)(n*2-2); //assuming that they own only n points
+                       
+                       //start at first intermediate
+                       t = 0;
+
+                       i0 = j2->curind; i3 = j->curind;                        
+                       k = (i0-ibase)*2; //start on first intermediary point (2x+1)
+                       kend = (i3-ibase)*2; //last point to set (not intermediary)
+                       
+                       //build hermite curve, it's easier
+                       curve.p1() = f[i0];
+                       curve.p2() = f[i3];
+                       curve.t1() = df[i0]*(df[i0].mag_squared() > 1e-4 ? j2->tangentscale/df[i0].mag() : j2->tangentscale);
+                       curve.t2() = df[i3]*(df[i3].mag_squared() > 1e-4 ? j->tangentscale/df[i3].mag() : j->tangentscale);
+                       curve.sync();
+                                               
+                       //MUST include the end point (since we are ignoring left one)
+                       for(; k < kend; ++k, t += dt)
+                       {
+                               work[k] = curve(t);
+                       }
+                       
+                       work[k] = curve(1); //k == kend, t == 1 -> c(t) == p2
+                       ++ntess;
+               }
+       }
+       
+       return ntess;
+}
+
+synfigapp::BLineConverter::BLineConverter()
+{
+       pixelwidth = 1;
+       smoothness = 0.70f;
+       width = 0;
+};
+
+void 
+synfigapp::BLineConverter::clear()
+{
+       f.clear();
+       f_w.clear();
+       ftemp.clear();
+       df.clear();
+       cvt.clear();
+       brk.clear();
+       di.clear();
+       d_i.clear();
+       work.clear();
+       curind.clear();
+}
+
+void
+synfigapp::BLineConverter::operator () (std::list<synfig::BLinePoint> &out, const std::list<synfig::Point> &in,const std::list<synfig::Real> &in_w)
+{      
+       //Profiling information
+       /*etl::clock::value_type initialprocess=0, curveval=0, breakeval=0, disteval=0;
+       etl::clock::value_type preproceval=0, tesseval=0, erroreval=0, spliteval=0;
+       unsigned int                    numpre=0, numtess=0, numerror=0, numsplit=0;
+       etl::clock_realtime timer,total;*/
+
+       //total.reset();
+       if(in.size()<=1)
+               return;
+
+       clear();
+       
+       //removing digitization error harder than expected
+       
+       //intended to fix little pen errors caused by the way people draw (tiny juts in opposite direction)
+       //Different solutions
+       //      Average at both end points (will probably eliminate many points at each end of the samples)
+       //      Average after the break points are found (weird points would still affect the curve)
+       //      Just always get rid of breaks at the beginning and end if they are a certain distance apart
+       //              This is will be current approach so all we do now is try to remove duplicate points
+       
+       //remove duplicate points - very bad for fitting
+       
+       //timer.reset();
+       
+       {
+               std::list<synfig::Point>::const_iterator i = in.begin(), end = in.end();
+               std::list<synfig::Real>::const_iterator iw = in_w.begin();
+               synfig::Point   c;
+               
+               if(in.size() == in_w.size())
+               {
+                       for(;i != end; ++i,++iw)
+                       {       
+                               //eliminate duplicate points
+                               if(*i != c)
+                               {
+                                       f.push_back(c = *i);
+                                       f_w.push_back(*iw);
+                               }
+                       }
+               }else
+               {
+                       for(;i != end; ++i)
+                       {       
+                               //eliminate duplicate points
+                               if(*i != c)
+                               {
+                                       f.push_back(c = *i);
+                               }
+                       }
+               }
+       }
+       //initialprocess = timer();
+       
+       if(f.size()<=6)
+               return;
+       
+       //get curvature information
+       //timer.reset();
+       
+       {
+               int i,i0,i1;
+               synfig::Vector v1,v2;
+               
+               cvt.resize(f.size());
+               
+               cvt.front() = 1;
+               cvt.back() = 1;
+               
+               for(i = 1; i < (int)f.size()-1; ++i)
+               {
+                       i0 = std::max(0,i - 2);
+                       i1 = std::min((int)(f.size()-1),i + 2);
+                       
+                       v1 = f[i] - f[i0];
+                       v2 = f[i1] - f[i];
+       
+                       cvt[i] = (v1*v2)/(v1.mag()*v2.mag());
+               }
+       }
+       
+       //curveval = timer();
+       //synfig::info("calculated curvature");
+       
+       //find corner points and interpolate inside those
+       //timer.reset();
+       {               
+               //break at sharp derivative points
+               //TODO tolerance should be set based upon digitization resolution (length dependent index selection)
+               Real    tol = 0;                //break tolerance, for the cosine of the change in angle (really high curvature or something)
+               Real    fixdistsq = 4*width*width; //the distance to ignore breaks at the end points (for fixing stuff)
+               unsigned int i = 0;
+               
+               int             maxi = -1, last=0;
+               Real    minc = 1;
+               
+               brk.push_back(0);
+               
+               for(i = 1; i < cvt.size()-1; ++i)
+               {                       
+                       //insert if too sharp (we need to break the tangents to insert onto the break list)
+                       
+                       if(cvt[i] < tol)
+                       {
+                               if(cvt[i] < minc)
+                               {
+                                       minc = cvt[i];
+                                       maxi = i;
+                               }
+                       }else if(maxi >= 0)
+                       {
+                               if(maxi >= last + 8)
+                               {
+                                       //synfig::info("break: %d-%d",maxi+1,cvt.size());                                               
+                                       brk.push_back(maxi);
+                                       last = maxi;
+                               }
+                               maxi = -1;
+                               minc = 1;
+                       }
+               }
+               
+               brk.push_back(i);
+               
+               //postprocess for breaks too close to eachother
+               Real d = 0;
+               Point p = f[brk.front()];
+               
+               //first set
+               for(i = 1; i < brk.size()-1; ++i) //do not want to include end point...
+               {
+                       d = (f[brk[i]] - p).mag_squared();
+                       if(d > fixdistsq) break; //don't want to group breaks if we ever get over the dist... 
+               }
+               //want to erase all points before...
+               if(i != 1)
+                       brk.erase(brk.begin(),brk.begin()+i-1); 
+               
+               //end set
+               p = f[brk.back()];
+               for(i = brk.size()-2; i > 0; --i) //start at one in from the end
+               {
+                       d = (f[brk[i]] - p).mag_squared();
+                       if(d > fixdistsq) break; //don't want to group breaks if we ever get over the dist
+               }
+               if(i != brk.size()-2)
+                       brk.erase(brk.begin()+i+2,brk.end()); //erase all points that we found... found none if i has not advanced
+               //must not include the one we ended up on
+       }
+       //breakeval = timer();
+       //synfig::info("found break points: %d",brk.size());
+       
+       //get the distance calculation of the entire curve (for tangent scaling)
+
+       //timer.reset();
+       {
+               synfig::Point p1,p2;
+               
+               p1=p2=f[0];
+               
+               di.resize(f.size()); d_i.resize(f.size());
+               Real d = 0;
+               for(unsigned int i = 0; i < f.size();)
+               {
+                       d += (d_i[i] = (p2-p1).mag());
+                       di[i] = d;
+                       
+                       p1=p2;
+                       p2=f[++i];
+               }
+       }
+       //disteval = timer();
+       //synfig::info("calculated distance");
+               
+       //now break at every point - calculate new derivatives each time
+       
+       //TODO
+       //must be sure that the break points are 3 or more apart
+       //then must also store the breaks which are not smooth, etc.
+       //and figure out tangents between there
+       
+       //for each pair of break points (as long as they are far enough apart) recursively subdivide stuff
+       //ignore the detected intermediate points
+       {
+               unsigned int i0=0,i3=0,is=0;
+               int i=0,j=0;
+               
+               bool done = false;
+               
+               Real errortol = smoothness*pixelwidth; //???? what the hell should this value be
+               
+               BLinePoint a;
+               synfig::Vector v;
+               
+               //intemp = f; //don't want to smooth out the corners
+               
+               bool breaktan = false, setwidth;
+               a.set_split_tangent_flag(false);
+               //a.set_width(width);
+               a.set_width(1.0f);
+               
+               setwidth = (f.size() == f_w.size());
+               
+               for(j = 0; j < (int)brk.size() - 1; ++j)
+               {
+                       //for b[j] to b[j+1] subdivide and stuff
+                       i0 = brk[j];
+                       i3 = brk[j+1];
+                       
+                       unsigned int size = i3-i0+1; //must include the end points
+                       
+                       //new derivatives
+                       //timer.reset();
+                       ftemp.assign(f.begin()+i0, f.begin()+i3+1);
+                       for(i=0;i<20;++i)
+                               gaussian_blur_3(ftemp.begin(),ftemp.end(),false);
+                       
+                       df.resize(size);
+                       GetFirstDerivatives(ftemp,0,size,(char*)&df[0],sizeof(df[0]));
+                       //GetSimpleDerivatives(ftemp,0,size,df,0,di); 
+                       //< don't have to worry about indexing stuff as it is all being taken car of right now
+                       //preproceval += timer();
+                       //numpre++;
+                       
+                       work.resize(size*2-1); //guarantee that all points will be tesselated correctly (one point inbetween every 2 adjacent points)
+                       
+                       //if size of work is size*2-1, the step size should be 1/(size*2 - 2)
+                       //Real step = 1/(Real)(size*2 - 1);
+                       
+                       //start off with break points as indices
+                       curind.clear();
+                       curind.push_back(cpindex(i0,di[i3]-di[i0],0)); //0 error because no curve on the left
+                       curind.push_back(cpindex(i3,di[i3]-di[i0],-1)); //error needs to be reevaluated
+                       done = false; //we want to loop
+                       
+                       unsigned int dcount = 0;
+                       
+                       //while there are still enough points between us, and the error is too high subdivide (and invalidate neighbors that share tangents)            
+                       while(!done)
+                       {                                       
+                               //tesselate all curves with invalid error values
+                               work[0] = f[i0];
+                               
+                               //timer.reset();
+                               /*numtess += */tesselate_curves(curind,f,df,work);
+                               //tesseval += timer();
+                               
+                               //now get all error values
+                               //timer.reset();
+                               for(i = 1; i < (int)curind.size(); ++i)
+                               {
+                                       if(curind[i].error < 0) //must have been retesselated, so now recalculate error value
+                                       {
+                                               //evaluate error from points (starting at current index)
+                                               int size = curind[i].curind - curind[i-1].curind + 1;
+                                               curind[i].error = CurveError(&f[curind[i-1].curind], size,
+                                                                                                        work,(curind[i-1].curind - i0)*2,(curind[i].curind - i0)*2+1);
+                                               
+                                               /*if(curind[i].error > 1.0e5)
+                                               {
+                                                       synfig::info("Holy crap %d-%d error %f",curind[i-1].curind,curind[i].curind,curind[i].error);
+                                                       curind[i].error = -1;
+                                                       numtess += tesselate_curves(curind,f,df,work);
+                                                       curind[i].error = CurveError(&f[curind[i-1].curind], size,
+                                                                                                        work,0,work.size());//(curind[i-1].curind - i0)*2,(curind[i].curind - i0)*2+1);
+                                               }*/
+                                               //numerror++;
+                                       }
+                               }
+                               //erroreval += timer();
+                               
+                               //assume we're done
+                               done = true;
+                               
+                               //check each error to see if it's too big, if so, then subdivide etc.
+                               int indsize = (int)curind.size();
+                               Real maxrelerror = 0;
+                               int maxi = -1;//, numpoints;
+                               
+                               //timer.reset();
+                               //get the maximum error and split there
+                               for(i = 1; i < indsize; ++i)
+                               {
+                                       //numpoints = curind[i].curind - curind[i-1].curind + 1;
+                                       
+                                       if(curind[i].error > maxrelerror && curind[i].curind - curind[i-1].curind > 2) //only accept if it's valid
+                                       {
+                                               maxrelerror = curind[i].error;
+                                               maxi = i;
+                                       }
+                               }
+                               
+                               //split if error is too great
+                               if(maxrelerror > errortol)
+                               {
+                                       //add one to the left etc
+                                       unsigned int    ibase = curind[maxi-1].curind, itop = curind[maxi].curind,
+                                                                       ibreak = (ibase + itop)/2;
+                                       Real scale, scale2;
+                                       
+                                       assert(ibreak < f.size());
+                                       
+                                       //synfig::info("Split %d -%d- %d, error: %f", ibase,ibreak,itop,maxrelerror);
+                                       
+                                       if(ibase != itop)
+                                       {
+                                               //invalidate current error of the changed tangents and add an extra segment
+                                               //enforce minimum tangents property
+                                               curind[maxi].error = -1;
+                                               curind[maxi-1].error = -1;
+                                               if(maxi+1 < indsize) curind[maxi+1].error = -1; //if there is a curve segment beyond this it will be effected as well
+                                               
+                                               scale = di[itop] - di[ibreak];
+                                               scale2 = maxi+1 < indsize ? di[curind[maxi+1].curind] - di[itop] : scale; //to the right valid?
+                                               curind[maxi].tangentscale = std::min(scale, scale2);
+                                                                                               
+                                               scale = di[ibreak] - di[ibase];
+                                               scale2 = maxi >= 2 ? di[ibase] - di[curind[maxi-2].curind] : scale; // to the left valid -2 ?
+                                               curind[maxi-1].tangentscale = std::min(scale, scale2);
+                                               
+                                               scale = std::min(di[ibreak] - di[ibase], di[itop] - di[ibreak]);
+                                               
+                                               curind.insert(curind.begin()+maxi,cpindex(ibreak, scale, -1));
+                                               //curind.push_back(cpindex(ibreak, scale, -1));
+                                               //std::sort(curind.begin(), curind.end());
+                                               
+                                               done = false;
+                                               //numsplit++;
+                                       }
+                               }
+                               //spliteval += timer();
+                               
+                               dcount++;
+                       }
+       
+                       //insert the last point too (just set tangent for now                   
+                       is = curind[0].curind;
+                       
+                       //first point inherits current tangent status                   
+                       v = df[is - i0];
+                       if(v.mag_squared() > EPSILON)
+                               v *= (curind[0].tangentscale/v.mag());
+                                                       
+                       if(!breaktan)
+                               a.set_tangent(v);
+                       else a.set_tangent2(v);
+                       
+                       a.set_vertex(f[is]);
+                       if(setwidth)a.set_width(f_w[is]);
+                       
+                       out.push_back(a);
+                       a.set_split_tangent_flag(false); //won't need to break anymore
+                       breaktan = false;
+                       
+                       for(i = 1; i < (int)curind.size()-1; ++i)
+                       {
+                               is = curind[i].curind;
+                               
+                               //first point inherits current tangent status
+                               v = df[is-i0];
+                               if(v.mag_squared() > EPSILON)
+                                       v *= (curind[i].tangentscale/v.mag());
+                                                               
+                               a.set_tangent(v); // always inside, so guaranteed to be smooth
+                               a.set_vertex(f[is]);
+                               if(setwidth)a.set_width(f_w[is]);
+                               
+                               out.push_back(a);
+                       }
+                       
+                       //set the last point's data
+                       is = curind.back().curind; //should already be this
+                       
+                       v = df[is-i0];
+                       if(v.mag_squared() > EPSILON)
+                               v *= (curind.back().tangentscale/v.mag());
+                       
+                       a.set_tangent1(v);
+                       a.set_split_tangent_flag(true);
+                       breaktan = true;
+                       
+                       //will get the vertex and tangent 2 from next round
+               }
+               
+               a.set_vertex(f[i3]);
+               a.set_split_tangent_flag(false);
+               if(setwidth)
+                       a.set_width(f_w[i3]);
+               out.push_back(a);
+               
+               /*etl::clock::value_type totaltime = total(),
+                                                          misctime = totaltime - initialprocess - curveval - breakeval - disteval
+                                                                         - preproceval - tesseval - erroreval - spliteval;
+               
+               synfig::info(
+                       "Curve Convert Profile:\n"
+                       "\tInitial Preprocess:    %f\n"
+                       "\tCurvature Calculation: %f\n"
+                       "\tBreak Calculation:     %f\n"
+                       "\tDistance Calculation:  %f\n"
+                       "  Algorithm: (numtimes,totaltime)\n"
+                       "\tPreprocess step:      (%d,%f)\n"
+                       "\tTesselation step:     (%d,%f)\n"
+                       "\tError step:           (%d,%f)\n"
+                       "\tSplit step:           (%d,%f)\n"
+                       "  Num Input: %d, Num Output: %d\n"
+                       "  Total time: %f, Misc time: %f\n",
+                       initialprocess, curveval,breakeval,disteval,
+                       numpre,preproceval,numtess,tesseval,numerror,erroreval,numsplit,spliteval,
+                       in.size(),out.size(),
+                       totaltime,misctime);*/
+               
+               return;
+       }
+}
+
+void synfigapp::BLineConverter::EnforceMinWidth(std::list<synfig::BLinePoint> &bline, synfig::Real min_pressure)
+{
+       std::list<synfig::BLinePoint>::iterator i = bline.begin(),
+                                                                                       end = bline.end();
+       
+       for(i = bline.begin(); i != end; ++i)
+       {
+               if(i->get_width() < min_pressure)
+               {
+                       i->set_width(min_pressure);
+               }
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/blineconvert.h b/synfig-studio/trunk/src/synfigapp/blineconvert.h
new file mode 100644 (file)
index 0000000..519a278
--- /dev/null
@@ -0,0 +1,115 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file blineconvert.h
+**     \brief Template Header
+**
+**     $Id: blineconvert.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_BLINE_CONVERT_H
+#define __SYNFIG_BLINE_CONVERT_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/general.h>
+#include <synfig/blinepoint.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 synfigapp {
+       
+class BLineConverter
+{
+public:
+       struct cpindex
+       {
+               int             curind;
+               synfig::Real    tangentscale;
+               synfig::Real    error;  //negative error will indicate invalid;
+               
+               cpindex(int ci, synfig::Real s=0, synfig::Real e=-1) 
+               :curind(ci), tangentscale(s), error(e) 
+               {}
+               
+               cpindex(const cpindex & o)
+               :curind(o.curind), tangentscale(o.tangentscale), error(o.error) 
+               {}
+               
+               const cpindex & operator = (const cpindex & rhs)
+               {
+                       curind = rhs.curind;
+                       tangentscale = rhs.tangentscale;
+                       error = rhs.error;
+                       return *this;
+               }
+               
+               bool operator < (const cpindex &rhs) const
+               {
+                       return curind < rhs.curind;             
+               }
+               
+               //point is obviously in[curind]
+               //tangent scale will get reset to the smallest (or something else depending on experimentation)
+       };
+
+private:
+       //cached data
+       std::vector<synfig::Point>      f;      //the preprocessed input cache
+       std::vector<synfig::Real>       f_w;
+
+       //temporary point storage for vector calc
+       std::vector<synfig::Point>      ftemp;
+       
+       std::vector<synfig::Vector>     df; //the derivative cache      
+       std::vector<synfig::Real>       cvt; //the curvature cache
+       
+       std::vector<int>                        brk; //the break point cache
+       
+       std::vector<synfig::Real>       di,     //cumulative distance
+                                                               d_i; //distance between adjacent segments
+       
+       std::vector<synfig::Point>      work; //the working point cache for the entire curve
+       std::vector<cpindex>            curind;
+       
+       //function parameters
+       void clear();
+
+public:
+       synfig::Real width;
+
+       //Converter properties
+       synfig::Real pixelwidth;
+       synfig::Real smoothness; //actual error will be smoothness*pixelwidth (for global set pixelwidth = 1)
+
+       BLineConverter();
+
+       static void EnforceMinWidth(std::list<synfig::BLinePoint> &bline, synfig::Real min_pressure);
+       void operator ()(std::list<synfig::BLinePoint> &out, const std::list<synfig::Point> &in,const std::list<synfig::Real> &in_w);
+};
+       
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp
new file mode 100644 (file)
index 0000000..6d7e61a
--- /dev/null
@@ -0,0 +1,857 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file canvasinterface.cpp
+**     \brief Template File
+**
+**     $Id: canvasinterface.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 <iostream>
+
+#include <ETL/clock>
+#include <synfig/valuenode_scale.h>
+#include <synfig/valuenode_timedswap.h>
+#include <synfig/valuenode_composite.h>
+#include <synfig/valuenode_subtract.h>
+#include <synfig/valuenode_linear.h>
+#include <synfig/valuenode_reference.h>
+#include <synfig/valuenode_twotone.h>
+#include <synfig/valuenode_stripes.h>
+
+#include <synfig/waypoint.h>
+#include <synfig/loadcanvas.h>
+#include <synfig/importer.h>
+#include <synfig/guidset.h>
+
+#include "canvasinterface.h"
+#include "instance.h"
+
+#include "actions/layeradd.h"
+#include "actions/valuedescconvert.h"
+#include "actions/valuenodeadd.h"
+#include "actions/editmodeset.h"
+#include "action_system.h"
+
+#include "main.h"
+
+#include <synfig/gradient.h>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === 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 ======================================================= */
+
+CanvasInterface::CanvasInterface(loose_handle<Instance> instance,handle<Canvas> canvas):
+       instance_(instance),
+       canvas_(canvas),
+       cur_time_(canvas->rend_desc().get_frame_start()),
+       mode_(MODE_NORMAL|MODE_ANIMATE_PAST|MODE_ANIMATE_FUTURE)
+{
+       set_selection_manager(get_instance()->get_selection_manager());
+       set_ui_interface(get_instance()->get_ui_interface());
+}
+
+CanvasInterface::~CanvasInterface()
+{
+       synfig::info("synfigapp::CanvasInterface::~CanvasInterface(): Deleted");
+}
+
+void
+CanvasInterface::set_time(synfig::Time x)
+{
+       if(get_canvas()->rend_desc().get_frame_rate())
+       {
+               float fps(get_canvas()->rend_desc().get_frame_rate());
+               Time r(x.round(fps));
+               //synfig::info("CanvasInterface::set_time(): %s rounded to %s\n",x.get_string(fps).c_str(),r.get_string(fps).c_str());
+               x=r;
+       }
+       if(cur_time_.is_equal(x))
+               return;
+       cur_time_=x;
+       
+       signal_time_changed()();
+       signal_dirty_preview()();
+}
+       
+synfig::Time
+CanvasInterface::get_time()const
+{
+       return cur_time_;
+}
+
+void 
+CanvasInterface::refresh_current_values()
+{
+       get_canvas()->set_time(cur_time_);
+       signal_time_changed()();
+       signal_dirty_preview()();
+}
+
+etl::handle<CanvasInterface>
+CanvasInterface::create(loose_handle<Instance> instance,handle<Canvas> canvas)
+{
+       etl::handle<CanvasInterface> intrfc;
+       intrfc=new CanvasInterface(instance,canvas);
+       instance->canvas_interface_list().push_front(intrfc);
+       return intrfc;
+}
+
+void
+CanvasInterface::set_mode(Mode x)
+{
+       Action::Handle  action(Action::EditModeSet::create());
+
+       assert(action);
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("edit_mode",x);
+       
+       if(!action->is_ready())
+       {
+               get_ui_interface()->error(_("Action Not Ready, unable to change mode"));
+               assert(0);
+               return;
+       }
+       
+       if(!get_instance()->perform_action(action))
+               get_ui_interface()->error(_("Unable to change mode"));                  
+
+//     mode_=x;
+//     signal_mode_changed_(x);
+}
+
+CanvasInterface::Mode
+CanvasInterface::get_mode()const
+{
+       return mode_;
+}
+
+
+
+Layer::Handle
+CanvasInterface::add_layer_to(String name, Canvas::Handle canvas, int depth)
+{
+       synfigapp::Action::PassiveGrouper group(get_instance().get(),_("Add Layer To"));
+
+       Layer::Handle   layer(Layer::create(name));
+       
+       assert(layer);
+       
+       if(!layer)
+               return 0;
+
+       if(canvas!=get_canvas() && !canvas->is_inline())
+       {
+               synfig::error("Bad canvas passed to \"add_layer_to\"");
+               return 0;
+       }
+
+       layer->set_canvas(canvas);
+       
+       // Apply some defaults
+       if(layer->set_param("fg",synfigapp::Main::get_foreground_color()))
+               layer->set_param("bg",synfigapp::Main::get_background_color());
+       else
+               layer->set_param("color",synfigapp::Main::get_foreground_color());
+
+       layer->set_param("width",synfigapp::Main::get_bline_width().units(get_canvas()->rend_desc()));
+       layer->set_param("gradient",synfigapp::Main::get_gradient());
+       if(name!="zoom")
+               layer->set_param("amount",synfigapp::Main::get_opacity());
+       layer->set_param("blend_method",synfigapp::Main::get_blend_method());
+
+       {
+               // Grab the layer's list pf parameters
+               Layer::ParamList paramlist=layer->get_param_list();
+               Layer::ParamList::iterator iter;
+               for(iter=paramlist.begin();iter!=paramlist.end();++iter)
+               {
+                       ValueNode::Handle value_node;
+                       
+                       if(iter->second.get_type()==ValueBase::TYPE_LIST)
+                               value_node=LinkableValueNode::create("dynamic_list",iter->second);
+                       else if(LinkableValueNode::check_type("composite",iter->second.get_type()) &&
+                               (iter->second.get_type()!=ValueBase::TYPE_COLOR && iter->second.get_type()!=ValueBase::TYPE_VECTOR)
+                       )
+                               value_node=LinkableValueNode::create("composite",iter->second);
+                       
+                       if(value_node)
+                               layer->connect_dynamic_param(iter->first,value_node);
+               }
+       }
+
+       // Action to add the layer
+       Action::Handle  action(Action::LayerAdd::create());
+
+       assert(action);
+       if(!action)
+               return 0;
+       
+       action->set_param("canvas",canvas);
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("new",layer);
+       
+       if(!action->is_ready())
+       {
+               get_ui_interface()->error(_("Action Not Ready"));                       
+               return 0;
+       }
+       
+       if(!get_instance()->perform_action(action))
+       {
+               get_ui_interface()->error(_("Action Failed."));                 
+               return 0;
+       }
+
+       synfig::info("DEPTH=%d",depth);
+       // Action to move the layer (if necessary)
+       if(depth>0)
+       {
+               Action::Handle  action(Action::create("layer_move"));
+       
+               assert(action);
+               if(!action)
+                       return 0;
+               
+               action->set_param("canvas",canvas);
+               action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+               action->set_param("layer",layer);
+               action->set_param("new_index",depth);
+               
+               if(!action->is_ready())
+               {
+                       get_ui_interface()->error(_("Move Action Not Ready"));                  
+                       return 0;
+               }
+               
+               if(!get_instance()->perform_action(action))
+               {
+                       get_ui_interface()->error(_("Move Action Failed."));                    
+                       return 0;
+               }
+       }       
+       
+       
+       return layer;
+}
+
+
+bool
+CanvasInterface::convert(ValueDesc value_desc, String type)
+{
+       Action::Handle  action(Action::ValueDescConvert::create());
+
+       assert(action);
+       if(!action)
+               return 0;
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("value_desc",value_desc);
+       action->set_param("type",type);
+       
+       if(!action->is_ready())
+       {
+               get_ui_interface()->error(_("Action Not Ready"));                       
+               return 0;
+       }
+       
+       if(get_instance()->perform_action(action))
+               return true;
+       
+       get_ui_interface()->error(_("Action Failed."));                 
+       return false;
+}
+
+bool
+CanvasInterface::add_value_node(synfig::ValueNode::Handle value_node, synfig::String name)
+{
+       if(name.empty())
+       {
+               get_ui_interface()->error(_("Empty name!"));
+               return false;
+       }
+       
+       Action::Handle  action(Action::ValueNodeAdd::create());
+
+       assert(action);
+       if(!action)
+               return 0;
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("new",value_node);
+       action->set_param("name",name);
+       
+       if(!action->is_ready())
+       {
+               get_ui_interface()->error(_("Action Not Ready"));                       
+               return 0;
+       }
+       
+       if(get_instance()->perform_action(action))
+               return true;
+       
+       get_ui_interface()->error(_("Action Failed."));                 
+       return false;
+}
+
+Action::ParamList
+CanvasInterface::generate_param_list(const ValueDesc &value_desc)
+{
+       synfigapp::Action::ParamList param_list;
+       param_list.add("time",get_time());
+       param_list.add("canvas_interface",etl::handle<CanvasInterface>(this));
+       param_list.add("canvas",get_canvas());
+
+       param_list.add("value_desc",value_desc);
+
+       if(value_desc.parent_is_value_node())
+               param_list.add("parent_value_node",value_desc.get_parent_value_node());
+       
+       if(value_desc.is_value_node())
+               param_list.add("value_node",value_desc.get_value_node());
+       
+       if(value_desc.is_const())
+               param_list.add("value",value_desc.get_value());
+
+       if(value_desc.parent_is_layer_param())
+       {
+               param_list.add("parent_layer",value_desc.get_layer());
+               param_list.add("parent_layer_param",value_desc.get_param_name());
+       }
+
+       {
+               synfigapp::SelectionManager::ChildrenList children_list;
+               children_list=get_selection_manager()->get_selected_children();
+               if(!value_desc.parent_is_canvas() && children_list.size()==1)
+               {
+                       param_list.add("dest",value_desc);
+                       param_list.add("src",children_list.front().get_value_node());
+               }
+       }       
+       return param_list;
+}
+
+Action::ParamList
+CanvasInterface::generate_param_list(const std::list<synfigapp::ValueDesc> &value_desc_list)
+{
+       synfigapp::Action::ParamList param_list;
+       param_list.add("time",get_time());
+       param_list.add("canvas_interface",etl::handle<CanvasInterface>(this));
+       param_list.add("canvas",get_canvas());
+
+       std::list<synfigapp::ValueDesc>::const_iterator iter;
+       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
+       {
+               param_list.add("value_desc",*iter);
+               if(iter->is_value_node())
+               {
+                       param_list.add("value_node",iter->get_value_node());                    
+               }
+       }
+
+
+       return param_list;
+}
+
+void
+CanvasInterface::set_rend_desc(const synfig::RendDesc &rend_desc)
+{
+       Action::Handle  action(Action::create("canvas_rend_desc_set"));
+
+       assert(action);
+       if(!action)
+               return;
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("rend_desc",rend_desc);
+               
+       if(!get_instance()->perform_action(action))
+               get_ui_interface()->error(_("Action Failed."));                 
+}
+
+bool
+CanvasInterface::set_name(const String &x)
+{
+       //! \todo This needs to be converted into an action
+       get_canvas()->set_name(x);
+       signal_id_changed_();
+       return true;
+}
+
+bool
+CanvasInterface::set_description(const String &x)
+{
+       //! \todo This needs to be converted into an action
+       get_canvas()->set_description(x);
+       return true;
+}
+
+bool
+CanvasInterface::set_id(const String &x)
+{
+       //! \todo This needs to be converted into an action
+       get_canvas()->set_id(x);
+       signal_id_changed_();
+       return true;
+}
+
+
+void
+CanvasInterface::jump_to_next_keyframe()
+{
+       synfig::info("Current time: %s",get_time().get_string().c_str());
+       try
+       {
+               synfig::Keyframe keyframe(*get_canvas()->keyframe_list().find_next(get_time()));
+               synfig::info("Jumping to keyframe \"%s\" at %s",keyframe.get_description().c_str(),keyframe.get_time().get_string().c_str());
+               set_time(keyframe.get_time());
+       }
+       catch(...) { synfig::warning("Unable to find next keyframe"); }
+}
+
+void
+CanvasInterface::jump_to_prev_keyframe()
+{
+       synfig::info("Current time: %s",get_time().get_string().c_str());
+       try
+       {
+               synfig::Keyframe keyframe(*get_canvas()->keyframe_list().find_prev(get_time()));
+               synfig::info("Jumping to keyframe \"%s\" at %s",keyframe.get_description().c_str(),keyframe.get_time().get_string().c_str());
+               set_time(keyframe.get_time());
+       }
+       catch(...) { synfig::warning("Unable to find prev keyframe"); }
+}
+
+bool
+CanvasInterface::import(const synfig::String &filename, bool copy)
+{
+       Action::PassiveGrouper group(get_instance().get(),_("Import Image"));
+       
+       synfig::info("Attempting to import "+filename);
+
+
+       if(find(filename.begin(),filename.end(),'.')==filename.end())
+       {
+               get_ui_interface()->error("Filename must have an extension!");
+               return false;
+       }
+
+       String ext(String(filename.begin()+filename.find_last_of('.')+1,filename.end()));
+       std::transform(ext.begin(),ext.end(),ext.begin(),&::tolower);
+
+       // If this is a SIF file, then we need to do things slightly differently
+       if(ext=="sif" || ext=="sifz")try
+       {
+               
+               Canvas::Handle outside_canvas(synfig::open_canvas(filename));
+               if(!outside_canvas)
+                       throw String(_("Unable to open this composition"));
+
+               Layer::Handle layer(add_layer_to("PasteCanvas",get_canvas()));
+               if(!layer)
+                       throw String(_("Unable to create \"PasteCanvas\" layer"));
+               if(!layer->set_param("canvas",ValueBase(outside_canvas)))
+                       throw int();
+
+               //layer->set_description(basename(filename));
+               signal_layer_new_description()(layer,filename);
+               return true;
+       }
+       catch(String x)
+       {
+               get_ui_interface()->error(x+" -- "+filename);
+               return false;
+       }
+       catch(...)
+       {
+               get_ui_interface()->error(_("Uncaught exception when attempting\nto open this composition -- ")+filename);
+               return false;
+       }
+       
+       
+       
+       if(!Importer::book().count(ext))
+       {
+               get_ui_interface()->error(_("I don't know how to open images of this type -- ")+ext);
+               return false;
+       }
+
+       try
+       {
+               Layer::Handle layer(add_layer_to("Import",get_canvas()));
+               int w,h;
+               if(!layer)
+                       throw int();
+               if(!layer->set_param("filename",ValueBase(filename)))
+                       throw int();
+               w=layer->get_param("_width").get(int());
+               h=layer->get_param("_height").get(int());
+               if(w&&h)
+               {
+                       Vector size=ValueBase(get_canvas()->rend_desc().get_br()-get_canvas()->rend_desc().get_tl());
+                       Vector x;
+                       if(size[0]<size[1])
+                       {
+                               x[0]=size[0];
+                               x[1]=size[0]/w*h;
+                               if(size[0]<0 ^ size[1]<0)
+                                       x[1]=-x[1];
+                       }
+                       else
+                       {
+                               x[1]=size[1];
+                               x[0]=size[1]/h*w;
+                               if(size[0]<0 ^ size[1]<0)
+                                       x[0]=-x[0];
+                       }
+                       if(!layer->set_param("tl",ValueBase(-x/2)))
+                               throw int();
+                       if(!layer->set_param("br",ValueBase(x/2)))
+                               throw int();
+               }
+               else
+               {
+                       if(!layer->set_param("tl",ValueBase(get_canvas()->rend_desc().get_tl())))
+                               throw int();
+                       if(!layer->set_param("br",ValueBase(get_canvas()->rend_desc().get_br())))
+                               throw int();
+               }
+
+               layer->set_description(basename(filename));
+               signal_layer_new_description()(layer,filename);
+       
+               return true;            
+       }
+       catch(...)
+       {
+               get_ui_interface()->error("Unable to import "+filename);
+               group.cancel();
+               return false;
+       }
+}
+
+
+void
+CanvasInterface::waypoint_duplicate(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint)
+{
+       Action::Handle  action(Action::create("waypoint_set_smart"));
+
+       assert(action);
+       if(!action)
+               return;
+       
+       waypoint.make_unique();
+       waypoint.set_time(get_time());
+
+       ValueNode::Handle value_node(value_desc.get_value_node());
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("waypoint",waypoint);
+       action->set_param("time",get_time());
+       action->set_param("value_node",value_node);
+               
+       if(!get_instance()->perform_action(action))
+               get_ui_interface()->error(_("Action Failed."));                 
+}
+
+void
+CanvasInterface::waypoint_remove(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint)
+{
+       Action::Handle  action(Action::create("waypoint_remove"));
+
+       assert(action);
+       if(!action)
+               return;
+       
+       ValueNode::Handle value_node(value_desc.get_value_node());
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("waypoint",waypoint);
+       action->set_param("value_node",value_node);
+               
+       if(!get_instance()->perform_action(action))
+               get_ui_interface()->error(_("Action Failed."));                 
+}
+
+
+void
+CanvasInterface::auto_export(ValueNode::Handle value_node)
+{
+/*
+       // Check to see if we are already exported.
+       if(value_node->is_exported())
+               return;
+
+       Action::Handle  action(Action::create("value_node_add"));
+
+       assert(action);
+       if(!action)
+               return;
+       
+       String name(strprintf(_("Unnamed%08d"),synfig::UniqueID().get_uid()));
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("new",value_node);
+       action->set_param("name",name);
+               
+       if(!get_instance()->perform_action(action))
+               get_ui_interface()->error(_("Action Failed."));                 
+*/
+}
+
+void
+CanvasInterface::auto_export(const ValueDesc& value_desc)
+{      
+       // THIS FUNCTION IS DEPRECATED, AND IS NOW A STUB.
+#if 0  
+       // Check to see if we are already exported.
+       if(value_desc.is_exported())
+               return;
+
+       Action::Handle  action(Action::create("value_desc_export"));
+
+       assert(action);
+       if(!action)
+               return;
+       
+       String name(strprintf(_("Unnamed%08d"),synfig::UniqueID().get_uid()));
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("value_desc",value_desc);
+       action->set_param("name",name);
+               
+       if(!get_instance()->perform_action(action))
+               get_ui_interface()->error(_("Action Failed."));                 
+#endif
+}
+
+bool
+CanvasInterface::change_value(synfigapp::ValueDesc value_desc,synfig::ValueBase new_value)
+{
+       // If this isn't really a change, then don't bother
+       if(new_value==value_desc.get_value(get_time()))
+               return true;
+               
+       // If this change needs to take place elsewhere, then so be it.
+       if(value_desc.get_canvas() && value_desc.get_canvas()->get_root()!=get_canvas()->get_root())do
+       {
+               etl::handle<Instance> instance;
+               instance=find_instance(value_desc.get_canvas()->get_root());
+               
+               if(instance)
+                       return instance->find_canvas_interface(value_desc.get_canvas())->change_value(value_desc,new_value);
+               else
+               {
+                       get_ui_interface()->error(_("The value you are trying to edit is in a composition\nwhich doesn't seem to be open. Open that composition and you\nshould be able to edit this value as normal."));                       
+                       return false;
+               }
+       }while(0);
+#ifdef _DEBUG
+       else
+       { synfig::warning("Can't get canvas from value desc...?"); }
+#endif
+       
+       synfigapp::Action::Handle action(synfigapp::Action::create("value_desc_set"));
+       if(!action)
+       {
+               return false;
+       }
+       
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
+       action->set_param("time",get_time());
+       action->set_param("value_desc",value_desc);
+       action->set_param("new_value",new_value);
+
+       return get_instance()->perform_action(action);
+}
+
+void
+CanvasInterface::set_meta_data(const synfig::String& key,const synfig::String& data)
+{
+       get_canvas()->set_meta_data(key,data);
+}
+
+
+// this function goes with find_important_value_descs()
+static int
+_process_value_desc(const synfigapp::ValueDesc& value_desc,std::vector<synfigapp::ValueDesc>& out, synfig::GUIDSet& guid_set)
+{
+       int ret(0);
+
+       if(value_desc.get_value_type()==ValueBase::TYPE_CANVAS)
+       {
+               Canvas::Handle canvas;
+               canvas=value_desc.get_value().get(canvas);
+               if(!canvas || !canvas->is_inline())
+                       return ret;
+               ret+=CanvasInterface::find_important_value_descs(canvas,out,guid_set);
+       }
+       
+       if(value_desc.is_value_node())
+       {
+               ValueNode::Handle value_node(value_desc.get_value_node());
+
+               if(guid_set.count(value_node->get_guid()))
+                       return ret;
+               guid_set.insert(value_node->get_guid());
+               
+               if(LinkableValueNode::Handle::cast_dynamic(value_node))
+               {
+                       if(ValueNode_DynamicList::Handle::cast_dynamic(value_node))
+                       {
+                               out.push_back(value_desc);
+                               ret++;
+                       }
+                       // Process the linkable ValueNode's children
+                       LinkableValueNode::Handle value_node(LinkableValueNode::Handle::cast_dynamic(value_node));
+                       int i;
+                       for(i=0;i<value_node->link_count();i++)
+                       {
+                               ValueNode::Handle link(value_node->get_link(i));
+                               if(!link->is_exported())
+                                       ret+=_process_value_desc(ValueDesc(value_node,i),out,guid_set);
+                       }
+               }
+               else if(ValueNode_Animated::Handle::cast_dynamic(value_node))
+               {
+                       out.push_back(value_desc);
+                       ret++;
+               }
+       }
+       
+       return ret;
+}
+
+int
+CanvasInterface::find_important_value_descs(synfig::Canvas::Handle canvas,std::vector<synfigapp::ValueDesc>& out,synfig::GUIDSet& guid_set)
+{
+       int ret(0);
+       if(!canvas->is_inline())
+       {
+               ValueNodeList::const_iterator iter;
+       
+               for(
+                       iter=canvas->value_node_list().begin();
+                       iter!=canvas->value_node_list().end();
+                       ++iter)
+                       ret+=_process_value_desc(ValueDesc(canvas,(*iter)->get_id()),out,guid_set);
+       }
+
+       Canvas::const_iterator iter;
+       
+       for(iter=canvas->begin();iter!=canvas->end();++iter)
+       {
+               Layer::Handle layer(*iter);
+               
+               Layer::DynamicParamList::const_iterator iter;
+               for(
+                       iter=layer->dynamic_param_list().begin();
+                       iter!=layer->dynamic_param_list().end();
+                       ++iter)
+               {
+                       if(!iter->second->is_exported())
+                               ret+=_process_value_desc(ValueDesc(layer,iter->first),out,guid_set);
+               }
+               ValueBase value(layer->get_param("canvas"));
+               if(value.is_valid())
+                       ret+=_process_value_desc(ValueDesc(layer,"canvas"),out,guid_set);
+       }
+       
+       return ret;
+}
+
+int
+CanvasInterface::find_important_value_descs(std::vector<synfigapp::ValueDesc>& out)
+{
+       synfig::GUIDSet tmp;
+       return find_important_value_descs(get_canvas(),out,tmp);
+}
+
+void
+CanvasInterface::seek_frame(int frames)
+{
+       if(!frames)
+               return;
+       float fps(get_canvas()->rend_desc().get_frame_rate());
+       Time newtime(get_time()+(float)frames/fps);
+       newtime=newtime.round(fps);
+
+       if(newtime<=get_canvas()->rend_desc().get_frame_start())
+               newtime=get_canvas()->rend_desc().get_frame_start();
+       if(newtime>=get_canvas()->rend_desc().get_frame_end())
+               newtime=get_canvas()->rend_desc().get_frame_end();
+       set_time(newtime);
+}
+
+void
+CanvasInterface::seek_time(synfig::Time time)
+{
+       if(!time)
+               return;
+       
+       float fps(get_canvas()->rend_desc().get_frame_rate());
+
+       if(time>=synfig::Time::end())
+       {
+               set_time(get_canvas()->rend_desc().get_time_end());
+               return;
+       }
+       if(time<=synfig::Time::begin())
+       {
+               set_time(get_canvas()->rend_desc().get_time_end());
+               return;
+       }
+               
+       Time newtime(get_time()+time);
+       newtime=newtime.round(fps);
+
+       if(newtime<=get_canvas()->rend_desc().get_time_start())
+               newtime=get_canvas()->rend_desc().get_time_start();
+       if(newtime>=get_canvas()->rend_desc().get_time_end())
+               newtime=get_canvas()->rend_desc().get_time_end();
+       set_time(newtime);
+}
diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.h b/synfig-studio/trunk/src/synfigapp/canvasinterface.h
new file mode 100644 (file)
index 0000000..6def015
--- /dev/null
@@ -0,0 +1,308 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file canvasinterface.h
+**     \brief Template Header
+**
+**     $Id: canvasinterface.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_CANVASINTERFACE_H
+#define __SYNFIG_APP_CANVASINTERFACE_H
+
+/* === H E A D E R S ======================================================= */
+
+//#include <synfig/canvas.h>
+#include <synfig/value.h>
+#include <sigc++/signal.h>
+#include <sigc++/object.h>
+#include <list>
+#include "selectionmanager.h"
+#include "uimanager.h"
+#include "value_desc.h"
+#include "editmode.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 synfig { class ValueNode_DynamicList; class Waypoint; class GUIDSet; class Canvas; };
+
+namespace synfigapp {
+
+namespace Action { class ParamList; class Param; class EditModeSet; }; 
+
+class Instance;
+class ValueDesc;
+       
+class CanvasInterface : public etl::shared_object, public sigc::trackable
+{
+       friend class Instance;
+       friend class Action::EditModeSet;
+               
+public:
+
+       typedef EditMode Mode;
+
+private:
+       // Constructor is private to force the use of the "create()" constructor.
+       CanvasInterface(etl::loose_handle<Instance> instance,etl::handle<synfig::Canvas> canvas);
+
+private:
+       etl::loose_handle<Instance> instance_;
+       etl::handle<synfig::Canvas> canvas_;
+       etl::handle<SelectionManager> selection_manager_;
+       etl::handle<UIInterface> ui_interface_;
+       synfig::Time cur_time_;
+       Mode mode_;
+
+       sigc::signal<void,synfig::Layer::Handle> signal_layer_raised_;
+       sigc::signal<void,synfig::Layer::Handle> signal_layer_lowered_;
+       sigc::signal<void,synfig::Layer::Handle,int> signal_layer_inserted_;
+       sigc::signal<void,synfig::Layer::Handle,int,synfig::Canvas::Handle> signal_layer_moved_;
+       sigc::signal<void,synfig::Layer::Handle> signal_layer_removed_;
+       sigc::signal<void,synfig::Layer::Handle,bool> signal_layer_status_changed_;
+       sigc::signal<void,synfig::Layer::Handle,synfig::String> signal_layer_new_description_;
+       sigc::signal<void,synfig::Canvas::Handle> signal_canvas_added_;
+       sigc::signal<void,synfig::Canvas::Handle> signal_canvas_removed_;
+       
+       sigc::signal<void,synfig::ValueNode::Handle> signal_value_node_added_;
+       sigc::signal<void,synfig::ValueNode::Handle> signal_value_node_deleted_;
+       sigc::signal<void,synfig::ValueNode::Handle> signal_value_node_changed_;
+       sigc::signal<void,synfig::ValueNode::Handle,synfig::ValueNode::Handle> signal_value_node_replaced_;
+
+       sigc::signal<void,synfig::Keyframe> signal_keyframe_added_;
+       sigc::signal<void,synfig::Keyframe> signal_keyframe_removed_;
+       sigc::signal<void,synfig::Keyframe> signal_keyframe_changed_;
+
+       sigc::signal<void> signal_id_changed_;
+
+       sigc::signal<void> signal_time_changed_;
+
+       sigc::signal<void> signal_rend_desc_changed_;
+
+       sigc::signal<void,Mode> signal_mode_changed_;
+
+       //sigc::signal<void> signal_dirty_preview_;
+
+       sigc::signal<void,synfig::Layer::Handle,synfig::String> signal_layer_param_changed_;
+
+public:        // Signal Interface
+
+       sigc::signal<void,synfig::Layer::Handle,int,synfig::Canvas::Handle>& signal_layer_moved() { return signal_layer_moved_; }
+
+       sigc::signal<void,synfig::Layer::Handle,synfig::String>& signal_layer_new_description() { return signal_layer_new_description_; }
+
+       //! Signal called when layer is raised.
+       sigc::signal<void,synfig::Layer::Handle>& signal_layer_raised() { return signal_layer_raised_; }
+       
+       //! Signal called when layer is lowered.
+       sigc::signal<void,synfig::Layer::Handle>& signal_layer_lowered() { return signal_layer_lowered_; }
+       
+       //! Signal called when layer has been inserted at a given position.
+       sigc::signal<void,synfig::Layer::Handle,int>& signal_layer_inserted() { return signal_layer_inserted_; }
+
+       //! Signal called when a layer has been removed from the canvas.
+       sigc::signal<void,synfig::Layer::Handle>& signal_layer_removed() { return signal_layer_removed_; }
+
+       //! Signal called when the layer's active status has changed.
+       sigc::signal<void,synfig::Layer::Handle,bool>& signal_layer_status_changed() { return signal_layer_status_changed_; }
+
+       //! Signal called when a canvas has been added.
+       sigc::signal<void,etl::handle<synfig::Canvas> >& signal_canvas_added() { return signal_canvas_added_; }
+
+       //! Signal called when a canvas has been removed.
+       sigc::signal<void,etl::handle<synfig::Canvas> >& signal_canvas_removed() { return signal_canvas_removed_; }
+
+       //! Signal called when a layer's parameter has been changed
+       sigc::signal<void,synfig::Layer::Handle,synfig::String>& signal_layer_param_changed() { return signal_layer_param_changed_; }
+
+       //! Signal called when the canvas's preview needs to be updated
+       //sigc::signal<void>& signal_dirty_preview() { return signal_dirty_preview_; }
+       sigc::signal<void>& signal_dirty_preview() { return get_canvas()->signal_dirty(); }
+
+       sigc::signal<void,etl::handle<synfig::ValueNode>,etl::handle<synfig::ValueNode> >&
+               signal_value_node_child_added() { return get_canvas()->signal_value_node_child_added(); }
+       sigc::signal<void,etl::handle<synfig::ValueNode>,etl::handle<synfig::ValueNode> >&
+               signal_value_node_child_removed() { return get_canvas()->signal_value_node_child_removed(); }
+
+       //! Signal called when a ValueNode has changed
+       sigc::signal<void,etl::handle<synfig::ValueNode> >& signal_value_node_added() { return signal_value_node_added_; }
+
+       //! Signal called when a ValueNode has been deleted
+       sigc::signal<void,etl::handle<synfig::ValueNode> >& signal_value_node_deleted() { return signal_value_node_deleted_; }
+
+       //! Signal called when a ValueNode has been changed
+       sigc::signal<void,etl::handle<synfig::ValueNode> >& signal_value_node_changed() { return get_canvas()->signal_value_node_changed(); }
+       //sigc::signal<void,etl::handle<synfig::ValueNode> >& signal_value_node_changed() { return signal_value_node_changed_; }
+
+       //! Signal called when the mode has changed
+       sigc::signal<void,Mode> signal_mode_changed() { return signal_mode_changed_; }
+
+       //! Signal called when a the ID has been changed
+       sigc::signal<void>& signal_id_changed() { return signal_id_changed_; }
+
+       //! Signal called whenever the time changes
+       sigc::signal<void> signal_time_changed() { return signal_time_changed_; }
+
+       //! Signal called whenever a data node has been replaced.
+       /*!     Second ValueNode replaces first */
+       sigc::signal<void,synfig::ValueNode::Handle,synfig::ValueNode::Handle>& signal_value_node_replaced()
+               { return signal_value_node_replaced_; }
+
+       //! Signal called whenever the RendDesc changes
+       sigc::signal<void>& signal_rend_desc_changed() { return signal_rend_desc_changed_; }
+
+       sigc::signal<void,synfig::Keyframe>& signal_keyframe_added() { return signal_keyframe_added_; }
+
+       sigc::signal<void,synfig::Keyframe>& signal_keyframe_removed() { return signal_keyframe_removed_; }
+
+       sigc::signal<void,synfig::Keyframe>& signal_keyframe_changed() { return signal_keyframe_changed_; }
+
+public:
+
+       void auto_export(const ValueDesc& value_desc);
+
+       void auto_export(synfig::ValueNode::Handle value_node);
+
+       void set_meta_data(const synfig::String& key,const synfig::String& data);
+
+       //! Changes the current SelectionManager object
+       void set_selection_manager(const etl::handle<SelectionManager> &sm) { selection_manager_=sm; }
+       
+       //! Disables the selection manager
+       void unset_selection_manager() { selection_manager_=new NullSelectionManager(); }
+       
+       //! Returns a handle to the current SelectionManager
+       const etl::handle<SelectionManager> &get_selection_manager()const { return selection_manager_; }        
+
+       //! Changes the current UIInterface object
+       void set_ui_interface(const etl::handle<UIInterface> &uim) { ui_interface_=uim; }
+
+       //! Disables the UIInterface
+       void unset_ui_interface() { ui_interface_=new DefaultUIInterface(); }
+       
+       //! Returns a handle to the current UIInterface
+       const etl::handle<UIInterface> &get_ui_interface() { return ui_interface_; }    
+
+       //! Returns the Canvas associated with this interface
+       etl::handle<synfig::Canvas> get_canvas()const { return canvas_; }
+
+       //! Returns the Instance associated with this interface
+       etl::loose_handle<Instance> get_instance()const { return instance_; }
+
+       //! Changes the name of the canvas. Undoable.
+       bool set_name(const synfig::String &x);
+
+       //! Changes the description of the canvas. Undoable.
+       bool set_description(const synfig::String &x);
+
+       //! Changes the ID of the canvas. Undoable.
+       bool set_id(const synfig::String &x);
+       
+       //! Convience function to retrieve the name of the canvas
+       synfig::String get_name()const { return get_canvas()->get_name(); }
+
+       //! Convience function to retrieve the description of the canvas
+       synfig::String get_description()const { return get_canvas()->get_description(); }
+
+       //! Convience function to retrieve the ID of the canvas
+       synfig::String get_id()const { return get_canvas()->get_id(); }
+
+       //! Sets the current time
+       void set_time(synfig::Time x);
+       
+       //! Retrieves the current time
+       synfig::Time get_time()const;
+       
+       //! Changes the current time to the next keyframe
+       void jump_to_next_keyframe();
+
+       //! Changes the current time to the next keyframe
+       void jump_to_prev_keyframe();
+       
+       void seek_frame(int frames);
+
+       void seek_time(synfig::Time time);
+       
+       //! \writeme
+       void refresh_current_values();
+       
+       //! Sets the current editing mode
+       /*! \see Mode */
+       void set_mode(Mode x);
+
+       //! Retrieves the current editing mode
+       /*! \see Mode */
+       Mode get_mode()const;
+
+       //! Creates a new layer, of type \c id at the top of the layer stack
+       synfig::Layer::Handle add_layer(synfig::String id) { return add_layer_to(id,get_canvas()); }
+
+       synfig::Layer::Handle add_layer_to(synfig::String id,synfig::Canvas::Handle canvas, int depth=0);
+
+       bool convert(ValueDesc value_desc, synfig::String type);
+       //! Adds the given ValueNode to the canvas.
+       bool add_value_node(synfig::ValueNode::Handle value_node, synfig::String name);
+
+
+       Action::ParamList generate_param_list(const synfigapp::ValueDesc &);
+
+       Action::ParamList generate_param_list(const std::list<synfigapp::ValueDesc> &);
+
+       void set_rend_desc(const synfig::RendDesc &rend_desc);
+
+       bool import(const synfig::String &filename, bool copy=false);
+       
+       
+       void waypoint_duplicate(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint);
+
+       void waypoint_remove(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint);
+
+       bool change_value(synfigapp::ValueDesc value_desc,synfig::ValueBase new_value);
+
+
+       int find_important_value_descs(std::vector<synfigapp::ValueDesc>& out);
+       static int find_important_value_descs(synfig::Canvas::Handle canvas,std::vector<synfigapp::ValueDesc>& out,synfig::GUIDSet& guid_set);
+
+       ~CanvasInterface();
+
+       static etl::handle<CanvasInterface> create(etl::loose_handle<Instance> instance,etl::handle<synfig::Canvas> canvas);
+}; // END of class CanvasInterface
+
+/*!    \class PushMode
+**     \brief Class that changes the mode of a CanvasInterface, and restores it on destruction.
+*/
+class PushMode
+{
+       CanvasInterface* canvas_interface_;
+       CanvasInterface::Mode old_mode_;
+public:
+       PushMode(etl::loose_handle<CanvasInterface> c, CanvasInterface::Mode mode):
+               canvas_interface_(c.get()), old_mode_(canvas_interface_->get_mode())
+       { canvas_interface_->set_mode(mode); }
+       
+       ~PushMode() { canvas_interface_->set_mode(old_mode_); }
+}; // END of class PushMode
+
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/cvs.cpp b/synfig-studio/trunk/src/synfigapp/cvs.cpp
new file mode 100644 (file)
index 0000000..67dccca
--- /dev/null
@@ -0,0 +1,375 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file cvs.cpp
+**     \brief Template File
+**
+**     $Id: cvs.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "cvs.h"
+#include <ETL/stringf>
+#include <fstream>
+#include <iostream>
+#include <synfig/general.h>
+#include <stdlib.h>
+
+
+#include <sys/types.h>
+#include <sys/stat.h>
+//#include <unistd.h>
+
+#include <cassert>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === M A C R O S ========================================================= */
+
+#define cvs_command            synfig::String("cvs -z4")
+
+#ifndef WIN32
+#define HAVE_STRPTIME
+#endif
+
+#ifdef __APPLE__
+time_t _daylight_() { time_t t(time(0)); return localtime(&t)->tm_gmtoff; }
+#define daylight _daylight_()
+#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 ======================================================= */
+
+CVSInfo::CVSInfo(const synfig::String& file_name)
+{
+       update_available_=false;
+       set_file_name(file_name);
+}
+
+CVSInfo::CVSInfo()
+{
+       update_available_=false;
+}
+
+CVSInfo::~CVSInfo()
+{
+}
+
+void
+CVSInfo::set_file_name(const synfig::String& file_name)
+{
+       file_name_=file_name;
+       
+       std::ifstream file((dirname(file_name_)+"/CVS/Root").c_str());
+
+       if(file)
+       {
+               in_sandbox_=true;
+               calc_repository_info();
+       }
+       else
+               in_sandbox_=false;
+}
+
+void
+CVSInfo::calc_repository_info()
+{
+#ifdef _DEBUG
+       synfig::info("in_sandbox() = %d",in_sandbox());
+#endif
+       
+       if(!in_sandbox_)
+               return;
+       
+       std::ifstream file((dirname(file_name_)+"/CVS/Entries").c_str());
+
+       while(file)
+       {
+               String line;
+               getline(file,line);
+               if(line.find(basename(file_name_))!=String::npos)
+               {
+                       in_repository_=true;
+                       String::size_type s,f;
+                       
+                       // Grab the version
+                       s=line.find('/',1);
+                       assert(s!=String::npos);
+                       s++;
+                       f=line.find('/',s+1);
+                       assert(f!=String::npos);
+                       cvs_version_=String(line,s,f-s);
+                       
+                       // Grab the time
+#ifdef HAVE_STRPTIME
+                       s=f+1;
+                       f=line.find('/',s+1);
+                       assert(f!=String::npos);
+                       tm time_struct;
+                       strptime(String(line,s,f-s).c_str(),"%c",&time_struct);
+                       original_timestamp_=mktime(&time_struct);
+#endif
+                       
+                       if(
+                               system(strprintf(
+                                       "cd '%s' && cvs status '%s' | grep -q -e 'Needs Patch'",
+                                       dirname(file_name_).c_str(),
+                                       basename(file_name_).c_str()
+                               ).c_str())==0
+                       )
+                       {
+                               synfig::info("UPDATE_AVAILABLE=TRUE");
+                               update_available_=true;
+                       }
+                       else
+                       {
+                               system(strprintf(
+                                       "cd '%s' && cvs status '%s'",
+                                       dirname(file_name_).c_str(),
+                                       basename(file_name_).c_str()
+                               ).c_str());
+                               synfig::info("UPDATE_AVAILABLE=FALSE");
+                               update_available_=false;
+                       }
+                               
+                       
+#ifdef _DEBUG
+                       synfig::info("in_repository() = %d",in_repository());
+                       synfig::info("get_cvs_version() = %s",get_cvs_version().c_str());
+                       synfig::info("get_original_timestamp() = %s",ctime(&get_original_timestamp()));
+                       time_t t(get_current_timestamp());
+                       synfig::info("get_current_timestamp() = %s",ctime(&t));
+                       synfig::info("get_cvs_root() = %s",get_cvs_root().c_str());
+                       synfig::info("get_cvs_module() = %s",get_cvs_module().c_str());
+#endif                 
+                       return;
+               }
+       }
+
+       in_repository_=false;
+       cvs_version_.clear();
+       original_timestamp_=0;
+
+#ifdef _DEBUG
+       synfig::info("in_repository() = %d",in_repository());
+#endif
+}
+
+bool
+CVSInfo::in_sandbox()const
+{
+       return in_sandbox_;
+}
+
+bool
+CVSInfo::in_repository()const
+{
+       if(!in_sandbox_)
+               return false;
+       return in_repository_;
+}
+
+bool
+CVSInfo::is_modified()const
+{
+#ifdef _DEBUG
+       synfig::info("%d-%d=%d",get_current_timestamp(),get_original_timestamp(),get_current_timestamp()-get_original_timestamp());
+#endif
+       if(!in_sandbox() || !in_repository())
+               return false;
+       return get_current_timestamp()!=get_original_timestamp() && abs(get_current_timestamp()-get_original_timestamp())!=3600;
+}
+
+bool
+CVSInfo::is_updated()const
+{
+       return update_available_;
+}
+
+const synfig::String&
+CVSInfo::get_cvs_version()const
+{
+       return cvs_version_;
+}
+
+const time_t&
+CVSInfo::get_original_timestamp()const
+{
+       return original_timestamp_;
+}
+
+time_t
+CVSInfo::get_current_timestamp()const
+{
+       struct stat st;
+       if(stat(file_name_.c_str(),&st)<0)
+       {
+               synfig::error("Unable to get file stats");
+               return false;
+       }
+       return st.st_mtime+timezone+(daylight-1)*3600;
+}
+
+synfig::String
+CVSInfo::get_cvs_root()const
+{
+       if(!in_sandbox_)
+               return synfig::String();
+       
+       std::ifstream file((dirname(file_name_)+"/CVS/Root").c_str());
+
+       if(file)
+       {
+               String ret;
+               getline(file,ret);
+               return ret;
+       }
+
+       return synfig::String();
+}
+
+synfig::String
+CVSInfo::get_cvs_module()const
+{
+       if(!in_sandbox_)
+               return synfig::String();
+
+       std::ifstream file((dirname(file_name_)+"/CVS/Repository").c_str());
+
+       if(file)
+       {
+               String ret;
+               getline(file,ret);
+               return ret;
+       }
+
+       return synfig::String();
+}
+
+// This function pre-processes the message so that we
+// don't get any CVS syntax errors.
+inline synfig::String fix_msg(const synfig::String& message)
+{
+       synfig::String ret;
+       int i;
+       for(i=0;i<(int)message.size();i++)
+       {
+               if(message[i]=='\'')
+                       ret+="'\"'\"'";
+               else
+                       ret+=message[i];
+       }
+       return ret;
+}
+
+void
+CVSInfo::cvs_add(const synfig::String& message)
+{
+       if(!in_sandbox_)
+       {
+               synfig::error("cvs_add(): Not in a sand box");
+               throw int();
+               return;
+       }
+       
+       synfig::String command(strprintf("cd '%s' && %s add -m '%s' '%s'",dirname(file_name_).c_str(),cvs_command.c_str(),fix_msg(message).c_str(),basename(file_name_).c_str()));
+       
+       int ret(system(command.c_str()));
+       
+       calc_repository_info();
+
+       switch(ret)
+       {
+       case 0:
+               break;
+       default:
+               synfig::error("Unknown errorcode %d (\"%s\")",ret,command.c_str());
+               throw(ret);
+               break;
+       }
+}
+       
+void
+CVSInfo::cvs_update()
+{
+       if(!in_sandbox_)
+       {
+               synfig::error("cvs_update(): Not in a sand box");
+               throw int();
+               return;
+       }
+       
+       synfig::String command(strprintf("cd '%s' && %s update '%s'",dirname(file_name_).c_str(),cvs_command.c_str(),basename(file_name_).c_str()));
+       
+       int ret(system(command.c_str()));
+
+       calc_repository_info();
+       
+       switch(ret)
+       {
+       case 0:
+               break;
+       default:
+               synfig::error("Unknown errorcode %d (\"%s\")",ret,command.c_str());
+               throw(ret);
+               break;
+       }
+}
+       
+void
+CVSInfo::cvs_commit(const synfig::String& message)
+{
+       if(!in_sandbox_)
+       {
+               synfig::error("cvs_commit(): Not in a sand box");
+               throw int();
+               return;
+       }
+       
+       synfig::String command(strprintf("cd '%s' && %s commit -m '%s' '%s'",dirname(file_name_).c_str(),cvs_command.c_str(),fix_msg(message).c_str(),basename(file_name_).c_str()));
+       
+       int ret(system(command.c_str()));
+
+       calc_repository_info();
+       
+       switch(ret)
+       {
+       case 0:
+               break;
+       default:
+               synfig::error("Unknown errorcode %d (\"%s\")",ret,command.c_str());
+               if(is_modified())
+                       throw(ret);
+               break;
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/cvs.h b/synfig-studio/trunk/src/synfigapp/cvs.h
new file mode 100644 (file)
index 0000000..e90206e
--- /dev/null
@@ -0,0 +1,103 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file cvs.h
+**     \brief Template Header
+**
+**     $Id: cvs.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_CVS_H
+#define __SYNFIG_CVS_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/string.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 synfigapp {
+
+class CVSInfo
+{
+       synfig::String file_name_;
+
+       bool in_sandbox_;
+       bool in_repository_;
+       bool update_available_;
+       
+       synfig::String cvs_version_;
+       time_t original_timestamp_;
+       
+       
+public:
+       void calc_repository_info();
+       
+       CVSInfo(const synfig::String& file_name);
+       CVSInfo();
+       ~CVSInfo();
+
+       void set_file_name(const synfig::String& file_name);
+
+//     READ OPERATIONS --------------------------------------------------
+
+       //! Returns TRUE if \a file_name is in a sandbox
+       bool in_sandbox()const;
+       
+       //! Returns TRUE if \a file_name is in the repository
+       bool in_repository()const;
+
+       //! Returns TRUE if \a file_name has modifications not yet on the repository
+       bool is_modified()const;
+
+       //! Returns TRUE if there is a new version of \a file_name on the repository
+       bool is_updated()const;
+
+       //! Returns the CVS version string
+       const synfig::String& get_cvs_version()const;
+       
+       //! Returns the unix timestamp of the repository file
+       const time_t &get_original_timestamp()const;
+
+       //! Returns the unix timestamp of the checked out file
+       time_t get_current_timestamp()const;
+
+       //! Returns the Root
+       synfig::String get_cvs_root()const;
+
+       //! Returns the name of the module
+       synfig::String get_cvs_module()const;
+                       
+//     WRITE OPERATIONS -------------------------------------------------
+       
+       void cvs_add(const synfig::String& message=synfig::String());
+       
+       void cvs_update();
+       
+       void cvs_commit(const synfig::String& message=synfig::String());
+}; // END of class CVSInfo
+       
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/editmode.h b/synfig-studio/trunk/src/synfigapp/editmode.h
new file mode 100644 (file)
index 0000000..66e6f33
--- /dev/null
@@ -0,0 +1,83 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file editmode.h
+**     \brief Template Header
+**
+**     $Id: editmode.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_EDITMODE_H
+#define __SYNFIG_EDITMODE_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 synfigapp {
+       
+/*!    \enum EditMode
+**     \brief \writeme
+*/
+enum EditMode
+{
+       MODE_NORMAL                     =0,                     //!< Normal editing mode. Place holder.
+
+       MODE_ANIMATE            =(1<<0),        //!< Animated editing mode.
+       MODE_ANIMATE_FUTURE     =(1<<1),        //!< Respect <i>future</i> keyframes
+       MODE_ANIMATE_PAST       =(1<<2),        //!< Respect <i>past</i> keyframes
+       MODE_ANIMATE_ALL        =(3<<1),        //!< Respect <i>all</i> keyframes
+
+       MODE_UNDEFINED          =(~0)   //!< Undefined Mode
+}; // END of enum EditMode
+
+//! Combine Flags
+inline EditMode
+operator|(const EditMode& lhs, const EditMode& rhs)
+{ return static_cast<EditMode>(int(lhs)|int(rhs)); }
+
+//! Exclude Flags
+inline EditMode
+operator-(const EditMode& lhs, const EditMode& rhs)
+{ return static_cast<EditMode>(int(lhs)&~int(rhs)); }
+
+inline EditMode&
+operator|=(EditMode& lhs, const EditMode& rhs)
+{ *reinterpret_cast<int*>(&lhs)|=int(rhs); return lhs; }
+
+//!    Flag Comparison. THIS IS NOT LESS-THAN-OR-EQUAL-TO.
+/*!    This function will return true of all of the flags
+**     in the \a rhs are set in the \a lhs */
+inline EditMode
+operator&(const EditMode& lhs, const EditMode& rhs)
+{ return static_cast<EditMode>(int(lhs)&int(rhs)); }
+
+//!    Flag Comparison. THIS IS NOT LESS-THAN-OR-EQUAL-TO.
+/*!    This function will return true of all of the flags
+**     in the \a rhs are set in the \a lhs */
+inline bool
+operator<=(const EditMode& lhs, const EditMode& rhs)
+{ return lhs&rhs==int(rhs); }
+
+}; // END if namespace synfigapp
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/inputdevice.cpp b/synfig-studio/trunk/src/synfigapp/inputdevice.cpp
new file mode 100644 (file)
index 0000000..b6d7f2f
--- /dev/null
@@ -0,0 +1,195 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file inputdevice.cpp
+**     \brief Template File
+**
+**     $Id: inputdevice.cpp,v 1.2 2005/01/12 04:08:32 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "inputdevice.h"
+#include "settings.h"
+#include <cstdio>
+#include <ETL/stringf>
+#include "main.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+class DeviceSettings : public Settings
+{
+       InputDevice* input_device;
+public:
+       DeviceSettings(InputDevice* input_device):
+               input_device(input_device) { }
+               
+
+       virtual bool get_value(const synfig::String& key, synfig::String& value)const
+       {
+               if(key=="state")
+               {
+                       value=input_device->get_state();
+                       return true;
+               }
+               if(key=="bline_width")
+               {
+                       value=strprintf("%s",input_device->get_bline_width().get_string().c_str());
+                       return true;
+               }
+               if(key=="opacity")
+               {
+                       value=strprintf("%f",(float)input_device->get_opacity());
+                       return true;
+               }
+               if(key=="blend_method")
+               {
+                       value=strprintf("%i",(int)input_device->get_blend_method());
+                       return true;
+               }
+               if(key=="color")
+               {
+                       Color c(input_device->get_foreground_color());
+                       value=strprintf("%f %f %f %f",(float)c.get_r(),(float)c.get_g(),(float)c.get_b(),(float)c.get_a());
+
+                       return true;
+               }
+               
+               return Settings::get_value(key, value);
+       }
+       
+       virtual bool set_value(const synfig::String& key,const synfig::String& value)
+       {
+                       DEBUGPOINT();
+               if(key=="state")
+               {
+                       input_device->set_state(value);
+                       return true;
+               }
+               if(key=="bline_width")
+               {
+                       input_device->set_bline_width(synfig::Distance(value));
+                       return true;
+               }
+               if(key=="opacity")
+               {
+                       input_device->set_opacity(atof(value.c_str()));
+                       return true;
+               }
+               if(key=="blend_method")
+               {
+                       input_device->set_blend_method(Color::BlendMethod(atoi(value.c_str())));
+                       return true;
+               }
+               if(key=="color")
+               {
+                       float r=0,g=0,b=0,a=1;
+                       if(!strscanf(value,"%f %f %f %f",&r,&g,&b,&a))
+                               return false;
+                       input_device->set_foreground_color(synfig::Color(r,g,b,a));
+                       return true;
+               }
+               
+               return Settings::set_value(key, value);
+       }
+       
+       virtual KeyList get_key_list()const
+       {
+               KeyList ret(Settings::get_key_list());
+               ret.push_back("color");
+               ret.push_back("state");
+               ret.push_back("bline_width");
+               ret.push_back("blend_method");
+               ret.push_back("opacity");
+               return ret;
+       }
+};
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+InputDevice::InputDevice(const synfig::String id_, Type type_):
+       id_(id_),
+       type_(type_),
+       state_((type_==TYPE_PEN)?"sketch":"normal"),
+       foreground_color_(Color::black()),
+       background_color_(Color::white()),
+       bline_width_(Distance(1,Distance::SYSTEM_POINTS)),
+       opacity_(1.0f),
+       blend_method_(Color::BLEND_COMPOSITE)
+{
+       switch(type_)
+       {
+               case TYPE_MOUSE:
+                       state_="normal";
+                       break;
+
+               case TYPE_PEN:
+                       state_="draw";
+                       break;
+
+               case TYPE_ERASER:
+                       state_="normal";
+                       break;
+
+               case TYPE_CURSOR:
+                       state_="normal";
+                       break;
+
+               default:
+                       state_="normal";
+                       break;
+       }
+       
+       device_settings=new DeviceSettings(this);
+       Main::settings().add_domain(device_settings,"input_device."+id_);
+}
+
+InputDevice::~InputDevice()
+{
+       Main::settings().remove_domain("input_device."+id_);    
+       delete device_settings;
+}
+
+Settings&
+InputDevice::settings()
+{
+       return *device_settings;
+}
+
+const Settings&
+InputDevice::settings()const
+{
+       return *device_settings;
+}
diff --git a/synfig-studio/trunk/src/synfigapp/inputdevice.h b/synfig-studio/trunk/src/synfigapp/inputdevice.h
new file mode 100644 (file)
index 0000000..2380334
--- /dev/null
@@ -0,0 +1,101 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file template.h
+**     \brief Template Header
+**
+**     $Id: inputdevice.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_INPUTDEVICE_H
+#define __SYNFIG_INPUTDEVICE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/color.h>
+#include <synfig/vector.h>
+#include <synfig/distance.h>
+#include <synfig/string.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 ======================================= */
+
+class DeviceSettings;
+
+namespace synfigapp {
+class Settings;
+
+       
+class InputDevice : public etl::shared_object
+{
+public:
+       enum Type
+       {
+               TYPE_MOUSE,
+               TYPE_PEN,
+               TYPE_ERASER,
+               TYPE_CURSOR
+       };
+
+       typedef etl::handle<InputDevice> Handle;
+       
+private:
+       synfig::String id_;
+       Type type_;
+       synfig::String state_;
+       synfig::Color foreground_color_;
+       synfig::Color background_color_;
+       synfig::Distance        bline_width_;   
+       synfig::Real opacity_;
+       synfig::Color::BlendMethod blend_method_;
+
+       DeviceSettings* device_settings;
+
+public:
+       InputDevice(const synfig::String id_, Type type_=TYPE_MOUSE);
+       ~InputDevice();
+
+       const synfig::String& get_id()const { return id_; }
+       const synfig::String& get_state()const { return state_; }
+       const synfig::Color& get_foreground_color()const { return foreground_color_; }
+       const synfig::Color& get_background_color()const { return background_color_; }
+       const synfig::Distance& get_bline_width()const { return bline_width_; }
+       const synfig::Real& get_opacity()const { return opacity_; }
+       const synfig::Color::BlendMethod& get_blend_method()const { return blend_method_; }
+       Type get_type()const { return type_; }
+       
+       void set_state(const synfig::String& x) { state_=x; }
+       void set_foreground_color(const synfig::Color& x) { foreground_color_=x; }
+       void set_background_color(const synfig::Color& x) { background_color_=x; }
+       void set_bline_width(const synfig::Distance& x) { bline_width_=x; }
+       void set_blend_method(const synfig::Color::BlendMethod& x) { blend_method_=x; }
+       void set_opacity(const synfig::Real& x) { opacity_=x; }
+       void set_type(Type x) { type_=x; }
+       
+       Settings& settings();
+       const Settings& settings()const;
+}; // END of class InputDevice
+
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/instance.cpp b/synfig-studio/trunk/src/synfigapp/instance.cpp
new file mode 100644 (file)
index 0000000..f64cac4
--- /dev/null
@@ -0,0 +1,186 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file instance.cpp
+**     \brief Instance
+**
+**     $Id: instance.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "instance.h"
+#include "canvasinterface.h"
+#include <iostream>
+#include <synfig/loadcanvas.h>
+#include <synfig/savecanvas.h>
+#include <synfig/valuenode_composite.h>
+#include <synfig/valuenode_radialcomposite.h>
+#include <synfig/valuenode_reference.h>
+#include <map>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+static std::map<loose_handle<Canvas>, loose_handle<Instance> > instance_map_;
+
+/* === P R O C E D U R E S ================================================= */
+
+bool
+synfigapp::is_editable(synfig::ValueNode::Handle value_node)
+{
+       if(ValueNode_Const::Handle::cast_dynamic(value_node)
+               || ValueNode_TimedSwap::Handle::cast_dynamic(value_node)
+               || ValueNode_Animated::Handle::cast_dynamic(value_node)
+               || ValueNode_Composite::Handle::cast_dynamic(value_node)
+               || ValueNode_RadialComposite::Handle::cast_dynamic(value_node)
+               || ValueNode_Reference::Handle::cast_dynamic(value_node)
+       )
+               return true;
+       return false;
+}
+
+etl::handle<Instance>
+synfigapp::find_instance(etl::handle<synfig::Canvas> canvas)
+{
+       if(instance_map_.count(canvas)==0)
+               return 0;
+       return instance_map_[canvas];
+}
+
+/* === M E T H O D S ======================================================= */
+
+Instance::Instance(Canvas::Handle canvas):
+       CVSInfo(canvas->get_file_name()),
+       canvas_(canvas)
+{
+       assert(canvas->is_root());
+
+       unset_selection_manager();
+       
+       instance_map_[canvas]=this;
+} // END of synfigapp::Instance::Instance()
+
+handle<Instance>
+Instance::create(Canvas::Handle canvas)
+{
+       // Construct a new instance
+       handle<Instance> instance(new Instance(canvas));
+
+       return instance;
+} // END of synfigapp::Instance::create()
+
+synfig::String
+Instance::get_file_name()const
+{
+       return get_canvas()->get_file_name();
+}
+
+void
+Instance::set_file_name(const synfig::String &name)
+{
+       get_canvas()->set_file_name(name);
+       CVSInfo::set_file_name(name);
+}
+
+Instance::~Instance()
+{
+       instance_map_.erase(canvas_);
+       synfig::info("studio::Instance::~Instance(): Deleted");
+} // END of studio::Instance::~Instance()
+
+handle<CanvasInterface>
+Instance::find_canvas_interface(handle<Canvas> canvas)
+{
+       if(!canvas)
+               return 0;
+       while(canvas->is_inline())
+               canvas=canvas->parent();
+       
+       CanvasInterfaceList::iterator iter;
+
+       for(iter=canvas_interface_list().begin();iter!=canvas_interface_list().end();iter++)
+               if((*iter)->get_canvas()==canvas)
+                       return *iter;
+
+       return CanvasInterface::create(this,canvas);
+}
+
+bool
+Instance::save()const
+{
+       bool ret=save_canvas(get_file_name(),canvas_);
+       if(ret)
+       {
+               reset_action_count();
+               const_cast<sigc::signal<void>& >(signal_saved_)();
+       }
+       return ret;
+}
+
+bool
+Instance::save_as(const std::string &file_name)const
+{
+       bool ret=save_canvas(file_name,canvas_);
+       if(ret)
+       {
+               reset_action_count();
+               const_cast<sigc::signal<void>& >(signal_saved_)();
+       }
+       return ret;
+}
+
+bool
+Instance::save_as(const std::string &file_name)
+{
+       bool ret;
+
+       String old_file_name(get_file_name());
+       
+       set_file_name(file_name);
+
+       ret=save_canvas(file_name,canvas_);
+
+       if(ret)
+       {
+               reset_action_count();
+               signal_saved_();
+       }
+       else
+       {
+               set_file_name(old_file_name);
+       }
+
+       signal_filename_changed_();
+
+       return ret;
+}
diff --git a/synfig-studio/trunk/src/synfigapp/instance.h b/synfig-studio/trunk/src/synfigapp/instance.h
new file mode 100644 (file)
index 0000000..6c071d7
--- /dev/null
@@ -0,0 +1,140 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file instance.h
+**     \brief writeme
+**
+**     $Id: instance.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_INSTANCE_H
+#define __SYNFIG_APP_INSTANCE_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "action.h"
+#include <ETL/handle>
+#include <synfig/canvas.h>
+#include <synfig/string.h>
+#include <list>
+#include <sigc++/signal.h>
+#include <sigc++/object.h>
+#include "action_system.h"
+#include "selectionmanager.h"
+#include "cvs.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 synfigapp {
+
+class CanvasInterface;
+
+
+class Instance : public Action::System , public CVSInfo
+{
+       friend class PassiveGrouper;
+       /*
+ -- ** -- P U B L I C   T Y P E S ---------------------------------------------
+       */
+
+public:
+
+       typedef std::list< etl::handle<CanvasInterface> > CanvasInterfaceList;
+
+       using etl::shared_object::ref;
+       using etl::shared_object::unref;
+
+       /*
+ -- ** -- P U B L I C  D A T A ------------------------------------------------
+       */
+
+public:
+       
+       /*
+ -- ** -- P R I V A T E   D A T A ---------------------------------------------
+       */
+
+private:
+       //! Handle for root canvas
+       synfig::Canvas::Handle canvas_;
+
+
+       CanvasInterfaceList canvas_interface_list_;
+
+       sigc::signal<void> signal_filename_changed_;
+       sigc::signal<void> signal_saved_;
+       etl::handle<SelectionManager> selection_manager_;
+       
+protected:
+       Instance(etl::handle<synfig::Canvas>);
+
+       /*
+ -- ** -- P U B L I C   M E T H O D S -----------------------------------------
+       */
+
+public:
+
+       ~Instance();
+
+       void set_selection_manager(const etl::handle<SelectionManager> &sm) { assert(sm); selection_manager_=sm; }
+       void unset_selection_manager() { selection_manager_=new NullSelectionManager(); }
+       const etl::handle<SelectionManager> &get_selection_manager() { return selection_manager_; }     
+
+
+
+       etl::handle<CanvasInterface> find_canvas_interface(synfig::Canvas::Handle canvas);
+
+       synfig::Canvas::Handle get_canvas()const { return canvas_; }
+
+       //! Saves the instance to filename_
+       bool save()const;
+
+       bool save_as(const synfig::String &filename)const;
+
+       bool save_as(const synfig::String &filename);
+
+public:        // Interfaces to internal information
+       sigc::signal<void>& signal_filename_changed() { return signal_filename_changed_; }
+       sigc::signal<void>& signal_saved() { return signal_saved_; }
+
+       CanvasInterfaceList & canvas_interface_list() { return canvas_interface_list_; }
+       const CanvasInterfaceList & canvas_interface_list()const { return canvas_interface_list_; }
+
+       synfig::String get_file_name()const;
+
+       void set_file_name(const synfig::String &name);
+
+public:
+       
+
+public:        // Constructor interfaces
+       static etl::handle<Instance> create(etl::handle<synfig::Canvas> canvas);
+}; // END class Instance
+
+etl::handle<Instance> find_instance(etl::handle<synfig::Canvas> canvas);
+
+bool is_editable(synfig::ValueNode::Handle value_node);
+
+}; // END namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/main.cpp b/synfig-studio/trunk/src/synfigapp/main.cpp
new file mode 100644 (file)
index 0000000..9fa861d
--- /dev/null
@@ -0,0 +1,401 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file main.cpp
+**     \brief Template File
+**
+**     $Id: main.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "main.h"
+#include "action.h"
+
+#include <synfig/color.h>
+#include <synfig/gradient.h>
+
+#include <ETL/trivial>
+
+#include <list>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === M A C R O S ========================================================= */
+
+/* === S T A T I C S ======================================================= */
+
+static etl::reference_counter synfigapp_ref_count_(0);
+static synfigapp::Action::Main* action_main;
+
+static Color foreground_;
+static Color background_;
+static Gradient gradient_;
+static bool gradient_default_colors_;
+
+static synfig::Distance bline_width_;
+
+static Color::BlendMethod blend_method_;
+static Real opacity_;
+
+static synfigapp::InputDevice::Handle selected_input_device_;
+static list<synfigapp::InputDevice::Handle> input_devices_;
+
+trivial<sigc::signal<void> > signal_foreground_color_changed_;
+trivial<sigc::signal<void> > signal_background_color_changed_;
+trivial<sigc::signal<void> > signal_gradient_changed_;
+trivial<sigc::signal<void> > signal_bline_width_changed_;
+trivial<sigc::signal<void> > signal_blend_method_changed_;
+trivial<sigc::signal<void> > signal_opacity_changed_;
+trivial<sigc::signal<void> > signal_interpolation_changed_;
+
+trivial<Settings> settings_;
+
+static synfig::Waypoint::Interpolation interpolation_;
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+synfigapp::Main::Main(const synfig::String &basepath,ProgressCallback *cb):
+       synfig::Main(basepath,cb),
+       ref_count_(synfigapp_ref_count_)
+{
+       if(ref_count_.count())
+               return;
+
+       synfigapp_ref_count_.reset();
+       ref_count_=synfigapp_ref_count_;
+       
+       // Add initialization after this point
+       action_main=new synfigapp::Action::Main();
+
+       settings_.construct();
+       
+       signal_foreground_color_changed_.construct();
+       signal_background_color_changed_.construct();
+       signal_gradient_changed_.construct();
+       signal_opacity_changed_.construct();
+       signal_blend_method_changed_.construct();
+       signal_interpolation_changed_.construct();
+       
+       set_foreground_color(Color::black());
+       set_background_color(Color::white());
+       set_gradient_default_colors();
+       set_bline_width(Distance(1,Distance::SYSTEM_POINTS));
+       set_opacity(1.0);
+       set_blend_method(Color::BLEND_COMPOSITE);
+}
+
+synfigapp::Main::~Main()
+{
+       ref_count_.detach();
+       if(!synfigapp_ref_count_.unique())
+               return;
+       synfigapp_ref_count_.detach();
+       
+       // Add deinitialization after this point
+
+       delete action_main;     
+       
+       selected_input_device_=0;
+       input_devices_.clear();
+       
+       settings_.destruct();
+       signal_foreground_color_changed_.destruct();
+       signal_background_color_changed_.destruct();
+       signal_gradient_changed_.destruct();
+
+       signal_opacity_changed_.destruct();
+       signal_blend_method_changed_.destruct();
+       signal_interpolation_changed_.destruct();
+}
+
+Settings&
+synfigapp::Main::settings()
+{
+       return settings_;
+}
+
+sigc::signal<void>&
+synfigapp::Main::signal_foreground_color_changed()
+{
+       return signal_foreground_color_changed_;
+}
+
+sigc::signal<void>&
+synfigapp::Main::signal_background_color_changed()
+{
+       return signal_background_color_changed_;
+}
+
+sigc::signal<void>&
+synfigapp::Main::signal_gradient_changed()
+{
+       return signal_gradient_changed_;
+}
+
+sigc::signal<void>&
+synfigapp::Main::signal_bline_width_changed()
+{
+       return signal_bline_width_changed_;
+}
+
+sigc::signal<void>&
+synfigapp::Main::signal_blend_method_changed()
+{
+       return signal_blend_method_changed_;
+}
+
+sigc::signal<void>&
+synfigapp::Main::signal_opacity_changed()
+{
+       return signal_opacity_changed_;
+}
+
+sigc::signal<void>&
+synfigapp::Main::signal_interpolation_changed()
+{
+       return signal_interpolation_changed_;
+}
+
+const synfig::Color&
+synfigapp::Main::get_foreground_color()
+{
+       return foreground_;
+}
+
+const synfig::Color&
+synfigapp::Main::get_background_color()
+{
+       return background_;
+}
+
+const synfig::Gradient&
+synfigapp::Main::get_gradient()
+{
+       return gradient_;
+}
+
+const synfig::Real&
+synfigapp::Main::get_opacity()
+{
+       return opacity_;
+}
+
+synfig::Color::BlendMethod
+synfigapp::Main::get_blend_method()
+{
+       return blend_method_;
+}
+
+void
+synfigapp::Main::set_foreground_color(synfig::Color color)
+{
+       foreground_=color;
+       signal_foreground_color_changed()();
+       if(selected_input_device_)
+               selected_input_device_->set_foreground_color(foreground_);
+       if(gradient_default_colors_)
+       {
+               gradient_=Gradient(foreground_,background_);
+               signal_gradient_changed()();
+       }
+}
+
+void
+synfigapp::Main::set_background_color(synfig::Color color)
+{
+       background_=color;
+       signal_background_color_changed()();
+
+       if(selected_input_device_)
+               selected_input_device_->set_background_color(background_);
+
+       if(gradient_default_colors_)
+       {
+               gradient_=Gradient(foreground_,background_);
+               signal_gradient_changed()();
+       }
+}
+
+void
+synfigapp::Main::set_gradient(synfig::Gradient gradient)
+{
+       gradient_=gradient;
+       gradient_default_colors_=false;
+       signal_gradient_changed()();
+}
+
+void
+synfigapp::Main::set_gradient_default_colors()
+{
+       gradient_default_colors_=true;
+       gradient_=Gradient(foreground_,background_);
+       signal_gradient_changed()();
+}
+
+void
+synfigapp::Main::color_swap()
+{
+       const Color tmp(foreground_);
+       foreground_=background_;
+       background_=tmp;
+
+       if(selected_input_device_)
+       {
+               selected_input_device_->set_foreground_color(foreground_);
+               selected_input_device_->set_background_color(background_);
+       }
+
+       signal_foreground_color_changed()();
+       signal_background_color_changed()();
+
+       if(gradient_default_colors_)
+       {
+               gradient_=Gradient(foreground_,background_);
+               signal_gradient_changed()();
+       }
+}
+
+synfig::Waypoint::Interpolation
+synfigapp::Main::get_interpolation()
+{
+       return interpolation_;
+}
+
+
+void
+synfigapp::Main::set_interpolation(synfig::Waypoint::Interpolation x)
+{
+       if(interpolation_!=x)
+       {
+               interpolation_=x;
+               
+               signal_interpolation_changed();
+       }
+}
+
+const synfig::Distance&
+synfigapp::Main::get_bline_width()
+{
+       return bline_width_;
+}
+
+void
+synfigapp::Main::set_bline_width(synfig::Distance x)
+{
+       if(x<0)x=0;
+       if(x!=bline_width_)
+       {
+               bline_width_=x;
+               
+               if(selected_input_device_)
+                       selected_input_device_->set_bline_width(x);
+               
+               signal_bline_width_changed()();
+       }
+}
+
+void
+synfigapp::Main::set_opacity(synfig::Real x)
+{
+       opacity_=x;
+       if(selected_input_device_)
+               selected_input_device_->set_opacity(opacity_);
+       signal_opacity_changed()();
+}
+
+void
+synfigapp::Main::set_blend_method(synfig::Color::BlendMethod x)
+{
+       blend_method_=x;
+       if(selected_input_device_)
+               selected_input_device_->set_blend_method(x);
+       signal_blend_method_changed()();
+}
+
+
+InputDevice::Handle
+synfigapp::Main::add_input_device(const synfig::String id, InputDevice::Type type)
+{
+       input_devices_.push_back(new InputDevice(id,type));
+       return input_devices_.back();
+}
+
+InputDevice::Handle
+synfigapp::Main::find_input_device(const synfig::String id)
+{
+       list<InputDevice::Handle>::iterator iter;
+       for(iter=input_devices_.begin();iter!=input_devices_.end();++iter)
+               if((*iter)->get_id()==id)
+                       return *iter;
+       return 0;
+}
+
+InputDevice::Handle
+synfigapp::Main::select_input_device(const synfig::String id)
+{
+       InputDevice::Handle input_device(find_input_device(id));
+       if(!input_device)
+               return 0;
+       if(!select_input_device(input_device))
+               return 0;
+       return input_device;
+}
+
+bool
+synfigapp::Main::select_input_device(InputDevice::Handle input_device)
+{
+       assert(input_device);
+       
+       synfig::info("Input device changed to \"%s\"",input_device->get_id().c_str());
+       
+       selected_input_device_=input_device;
+
+       set_bline_width(input_device->get_bline_width());       
+       set_foreground_color(input_device->get_foreground_color());
+       set_opacity(input_device->get_opacity());       
+       set_blend_method(input_device->get_blend_method());     
+       
+       return true;
+}
+
+InputDevice::Handle
+synfigapp::Main::get_selected_input_device()
+{
+       return selected_input_device_;  
+}
+
+void
+synfigapp::Main::set_state(synfig::String state)
+{
+       if(selected_input_device_)
+               selected_input_device_->set_state(state);
+}
diff --git a/synfig-studio/trunk/src/synfigapp/main.h b/synfig-studio/trunk/src/synfigapp/main.h
new file mode 100644 (file)
index 0000000..6cdab6c
--- /dev/null
@@ -0,0 +1,112 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file main.h
+**     \brief Template Header
+**
+**     $Id: main.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIGAPP_MAIN_H
+#define __SYNFIGAPP_MAIN_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/ref_count>
+#include <synfig/string.h>
+#include <synfig/general.h>
+#include <synfig/main.h>
+#include <synfig/distance.h>
+#include <synfig/real.h>
+#include <synfig/waypoint.h>
+#include <sigc++/signal.h>
+#include <sigc++/object.h>
+#include "inputdevice.h"
+#include "settings.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 synfig {
+       class Color;
+       class Gradient;
+};
+
+namespace synfigapp {
+       
+/*!    \class synfigapp::Main
+**     \brief \writeme
+**
+**     \writeme
+*/
+class Main : public synfig::Main
+{
+       etl::reference_counter ref_count_;
+public:
+       Main(const synfig::String &basepath,synfig::ProgressCallback *cb=0);
+       ~Main();
+
+       const etl::reference_counter& ref_count()const { return ref_count_; }
+               
+       static const synfig::Color& get_foreground_color();
+       static const synfig::Color& get_background_color();
+       static const synfig::Gradient& get_gradient();
+       static const synfig::Distance& get_bline_width();
+       static synfig::Waypoint::Interpolation get_interpolation();
+
+
+       static void set_interpolation(synfig::Waypoint::Interpolation x);
+       static void set_bline_width(synfig::Distance x);        
+       static void set_foreground_color(synfig::Color color);
+       static void set_background_color(synfig::Color color);
+       static void set_gradient(synfig::Gradient gradient);
+       static void set_gradient_default_colors();
+       static void color_swap();       
+
+       static synfig::Color::BlendMethod get_blend_method();
+       static const synfig::Real& get_opacity();
+       static void set_blend_method(synfig::Color::BlendMethod);
+       static void set_opacity(synfig::Real);
+       static sigc::signal<void>& signal_blend_method_changed();
+       static sigc::signal<void>& signal_opacity_changed();
+       static sigc::signal<void>& signal_interpolation_changed();
+       
+       // Input Device stuff
+       static InputDevice::Handle add_input_device(const synfig::String id_, InputDevice::Type type_=InputDevice::TYPE_MOUSE);
+       static InputDevice::Handle find_input_device(const synfig::String id_);
+       static InputDevice::Handle select_input_device(const synfig::String id_);
+       static bool select_input_device(InputDevice::Handle input_device);
+       static InputDevice::Handle get_selected_input_device();
+       static void set_state(synfig::String state);
+
+       static Settings& settings();
+       
+       // Signal interfaces    
+       static sigc::signal<void>& signal_foreground_color_changed();
+       static sigc::signal<void>& signal_background_color_changed();
+       static sigc::signal<void>& signal_gradient_changed();
+       static sigc::signal<void>& signal_bline_width_changed();
+
+}; // END of class Main
+
+}; // END if namespace synfigapp
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/selectionmanager.h b/synfig-studio/trunk/src/synfigapp/selectionmanager.h
new file mode 100644 (file)
index 0000000..50e28b1
--- /dev/null
@@ -0,0 +1,146 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file template.h
+**     \brief Template Header
+**
+**     $Id: selectionmanager.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_SELECTIONMANAGER_H
+#define __SYNFIG_APP_SELECTIONMANAGER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <list>
+#include <set>
+#include <ETL/handle>
+#include <synfig/layer.h>
+#include <synfig/valuenode.h>
+#include "value_desc.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 synfigapp {
+
+class SelectionManager : public etl::shared_object
+{
+public:
+       typedef std::pair<synfig::Layer::Handle,synfig::String> LayerParam;
+       typedef std::list<LayerParam> LayerParamList;
+
+       typedef std::list<synfig::Layer::Handle> LayerList;
+       typedef std::list<ValueDesc> ChildrenList;
+       //typedef std::list<synfig::ValueNode::Handle> ValueNodeList;
+
+       virtual ~SelectionManager() { }
+
+       //! Returns the number of layers selected.
+       virtual int get_selected_layer_count()const=0;
+
+       //! Returns a list of the currently selected layers.
+       virtual LayerList get_selected_layers()const=0;
+       
+       //! Returns the first layer selected or an empty handle if none are selected.
+       virtual synfig::Layer::Handle get_selected_layer()const=0;
+       
+       //! Sets which layers should be selected
+       virtual void set_selected_layers(const LayerList &layer_list)=0;
+
+       //! Sets which layer should be selected. Empty handle if none.
+       virtual void set_selected_layer(const synfig::Layer::Handle &layer)=0;
+
+       //! Clears the layer selection list
+       virtual void clear_selected_layers()=0;
+
+
+
+       //! Returns the number of childrens selected.
+       virtual int get_selected_children_count()const=0;
+
+       //! Returns a list of the currently selected childrens.
+       virtual ChildrenList get_selected_children()const=0;
+       
+       //! Returns the first children selected or an empty handle if none are selected.
+       virtual ChildrenList::value_type get_selected_child()const=0;
+       
+       //! Sets which childrens should be selected
+       virtual void set_selected_children(const ChildrenList &children_list)=0;
+
+       //! Sets which children should be selected. Empty handle if none.
+       virtual void set_selected_child(const ChildrenList::value_type &children)=0;
+
+       //! Clears the children selection list
+       virtual void clear_selected_children()=0;
+
+
+       //! Returns the number of layer parameters selected.
+       virtual int get_selected_layer_parameter_count()const=0;
+
+       //! Returns a list of the currently selected layer parameters.
+       virtual LayerParamList get_selected_layer_parameters()const=0;
+       
+       //! Returns the first layer parameter selected or an empty handle if none are selected.
+       virtual LayerParam get_selected_layer_parameter()const=0;
+       
+       //! Sets which layer parameters should be selected
+       virtual void set_selected_layer_parameters(const LayerParamList &layer_param_list)=0;
+
+       //! Sets which layer parameter should be selected. Empty handle if none.
+       virtual void set_selected_layer_param(const LayerParam &layer_param)=0;
+
+       //! Clears the layer parameter selection list
+       virtual void clear_selected_layer_parameters()=0;
+}; // END of class SelectionManager
+
+//! A place holding selection manager that does nothing
+class NullSelectionManager : public SelectionManager
+{
+public:
+       int get_selected_layer_count()const { return 0; }
+       LayerList get_selected_layers()const { return LayerList(); }
+       synfig::Layer::Handle get_selected_layer()const { return 0; }
+       void set_selected_layers(const LayerList &layer_list) { return; }
+       void set_selected_layer(const synfig::Layer::Handle &layer) { return; }
+       void clear_selected_layers() { return; }
+
+
+       int get_selected_children_count()const { return 0; }
+       ChildrenList get_selected_children()const { return ChildrenList(); }
+       ChildrenList::value_type get_selected_child()const { return ChildrenList::value_type(); }
+       void set_selected_children(const ChildrenList &children_list) { return; }
+       void set_selected_child(const ChildrenList::value_type &child) { return; }
+       void clear_selected_children() { return; }
+
+       int get_selected_layer_parameter_count()const { return 0; }
+       LayerParamList get_selected_layer_parameters()const { return LayerParamList(); }
+       LayerParam get_selected_layer_parameter()const { return LayerParam(); }
+       void set_selected_layer_parameters(const LayerParamList &layer_param_list) { return; }
+       void set_selected_layer_param(const LayerParam &layer_param) { return; }
+       void clear_selected_layer_parameters() { return; }
+
+}; // END of class NullSelectionManager
+
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/settings.cpp b/synfig-studio/trunk/src/synfigapp/settings.cpp
new file mode 100644 (file)
index 0000000..06690a3
--- /dev/null
@@ -0,0 +1,237 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file template.cpp
+**     \brief Template File
+**
+**     $Id: settings.cpp,v 1.2 2005/01/12 04:08:32 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 <fstream>
+#include <iostream>
+#include "settings.h"
+#include <synfig/general.h>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === 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 ======================================================= */
+
+Settings::Settings()
+{
+}
+
+Settings::~Settings()
+{
+}
+
+synfig::String
+Settings::get_value(const synfig::String& key)const
+{
+       synfig::String value;
+       if(!get_value(key,value))
+               return synfig::String();
+       return value;
+}
+
+void
+Settings::add_domain(Settings* domain, const synfig::String& name)
+{
+       domain_map[name]=domain;
+}
+
+void
+Settings::remove_domain(const synfig::String& name)
+{
+       domain_map.erase(name);
+}
+
+bool
+Settings::get_value(const synfig::String& key, synfig::String& value)const
+{
+       // Search for the value in any children domains
+       DomainMap::const_iterator iter;
+       for(iter=domain_map.begin();iter!=domain_map.end();++iter)
+       {
+               // if we have a domain hit
+               if(key.size()>iter->first.size() && String(key.begin(),key.begin()+iter->first.size())==iter->first)
+               {
+                       synfig::String key_(key.begin()+iter->first.size()+1,key.end());
+                       
+                       // If the domain has it, then we have got a hit
+                       if(iter->second->get_value(key_,value))
+                               return true;
+               }
+       }
+
+       // Search for the value in our simple map
+       if(simple_value_map.count(key))
+       {
+               value=simple_value_map.find(key)->second;
+               return true;
+       }
+       
+       // key not found
+       return false;
+}
+
+bool
+Settings::set_value(const synfig::String& key,const synfig::String& value)
+{
+       // Search for the key in any children domains
+       DomainMap::iterator iter;
+       for(iter=domain_map.begin();iter!=domain_map.end();++iter)
+       {
+               // if we have a domain hit
+               if(key.size()>iter->first.size() && String(key.begin(),key.begin()+iter->first.size())==iter->first)
+               {
+                       synfig::String key_(key.begin()+iter->first.size()+1,key.end());
+                       
+                       return iter->second->set_value(key_,value);
+               }
+       }
+
+       simple_value_map[key]=value;
+       return true;
+}
+
+Settings::KeyList
+Settings::get_key_list()const
+{
+       KeyList key_list;
+
+       // Get keys from the domains
+       {
+               DomainMap::const_iterator iter;
+               for(iter=domain_map.begin();iter!=domain_map.end();++iter)
+               {
+                       KeyList sub_key_list(iter->second->get_key_list());
+                       KeyList::iterator key_iter;
+                       for(key_iter=sub_key_list.begin();key_iter!=sub_key_list.end();++key_iter)
+                               key_list.push_back(iter->first+'.'+*key_iter);
+               }
+       }
+       
+       // Get keys from the simple variables
+       {
+               ValueBaseMap::const_iterator iter;
+               for(iter=simple_value_map.begin();iter!=simple_value_map.end();++iter)
+                       key_list.push_back(iter->first);
+       }
+
+       // Sort the keys
+       key_list.sort();
+       
+       return key_list;
+}
+
+bool
+Settings::save_to_file(const synfig::String& filename)const
+{
+       synfig::String tmp_filename(filename+".TMP");
+       
+       try
+       {
+               std::ofstream file(tmp_filename.c_str());
+
+               if(!file)return false;
+       
+               KeyList key_list(get_key_list());
+               
+               // Save the keys
+               {
+                       KeyList::const_iterator iter;
+                       for(iter=key_list.begin();iter!=key_list.end();++iter)
+                       {
+                               if(!file)return false;
+                               file<<*iter<<'='<<get_value(*iter)<<endl;
+                       }
+               }
+       
+               if(!file)
+                       return false;
+       }catch(...) { return false; }
+       
+#ifdef _WIN32
+       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());
+               return false;
+       }
+       remove(old_file);
+#else
+       if(rename(tmp_filename.c_str(),filename.c_str())!=0)
+               return false;
+#endif
+       
+       return true;
+}
+
+bool
+Settings::load_from_file(const synfig::String& filename)
+{
+       std::ifstream file(filename.c_str());
+       if(!file)
+               return false;
+       while(file)
+       {
+               std::string line;
+               getline(file,line);
+               if(!line.empty() && ((line[0]>='a' && line[0]<='z')||(line[0]>='A' && line[0]<='Z')))
+               {
+                       std::string::iterator equal(find(line.begin(),line.end(),'='));
+                       if(equal==line.end())
+                               continue;
+                       std::string key(line.begin(),equal);
+                       std::string value(equal+1,line.end());
+                       
+                       //synfig::info("Settings::load_from_file(): Trying Key \"%s\" with a value of \"%s\".",key.c_str(),value.c_str());
+                       try{
+                       if(!set_value(key,value))
+                               synfig::warning("Settings::load_from_file(): Key \"%s\" with a value of \"%s\" was rejected.",key.c_str(),value.c_str());
+                       }
+                       catch(...)
+                       {
+                               synfig::error("Settings::load_from_file(): Attept to set key \"%s\" with a value of \"%s\" has thrown an exception.",key.c_str(),value.c_str());
+                               throw;
+                       }
+               }
+       }
+       return true;
+}
diff --git a/synfig-studio/trunk/src/synfigapp/settings.h b/synfig-studio/trunk/src/synfigapp/settings.h
new file mode 100644 (file)
index 0000000..a22bd48
--- /dev/null
@@ -0,0 +1,78 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file template.h
+**     \brief Template Header
+**
+**     $Id: settings.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_SETTINGS_H
+#define __SYNFIG_SETTINGS_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/string.h>
+#include <map>
+#include <list>
+#include <ETL/stringf>
+
+/* === 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 synfigapp {
+
+class Settings
+{
+public:
+       
+       typedef std::list<synfig::String> KeyList;
+       typedef std::map<synfig::String,synfig::String> ValueBaseMap;
+       typedef std::map<synfig::String,Settings*> DomainMap;
+       
+private:
+       ValueBaseMap simple_value_map;
+
+       DomainMap domain_map;
+
+public:
+       Settings();
+       virtual ~Settings();
+
+       virtual bool get_value(const synfig::String& key, synfig::String& value)const;
+       virtual bool set_value(const synfig::String& key,const synfig::String& value);
+       virtual KeyList get_key_list()const;
+
+       synfig::String get_value(const synfig::String& key)const;
+       void add_domain(Settings* domain, const synfig::String& name);
+       void remove_domain(const synfig::String& name);
+
+       bool load_from_string(const synfig::String& data);
+       bool save_to_string(synfig::String& data);
+
+       bool load_from_file(const synfig::String& filename);
+       bool save_to_file(const synfig::String& filename)const;
+}; // END of class Settings
+
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/timegather.cpp b/synfig-studio/trunk/src/synfigapp/timegather.cpp
new file mode 100644 (file)
index 0000000..7089f74
--- /dev/null
@@ -0,0 +1,311 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file timegather.cpp
+**     \brief Time Gather File
+**
+**     $Id: timegather.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "timegather.h"
+#include "value_desc.h"
+
+#include <synfig/layer_pastecanvas.h>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === 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 ================================================= */
+
+//! Definitions for build a list of accurate valuenode references
+
+void synfigapp::timepoints_ref::insert(synfig::ValueNode_Animated::Handle v, synfig::Waypoint w)
+{
+       ValueBaseTimeInfo       vt;
+       vt.val = v;
+       
+       waytracker::iterator i = waypointbiglist.find(vt);
+       
+       if(i != waypointbiglist.end())
+       {
+               i->waypoints.insert(w);
+       }else
+       {
+               vt.waypoints.insert(w);
+               waypointbiglist.insert(vt);
+       }
+}
+
+void synfigapp::timepoints_ref::insert(synfigapp::ValueDesc v, synfig::Activepoint a)
+{
+       ActiveTimeInfo  vt;
+       vt.val = v;
+       
+       acttracker::iterator i = actpointbiglist.find(vt);
+       
+       if(i != actpointbiglist.end())
+       {
+               i->activepoints.insert(a);
+               /*{ //if it fails...
+                       synfig::info("!!!!For some reason it wasn't able to insert the activepoint in the list (%s,%.4lg)",
+                                                       a.state?"true":"false", (double)a.time);
+               }*/
+       }else
+       {
+               vt.activepoints.insert(a);
+               actpointbiglist.insert(vt);
+               //synfig::info("Insert new activept list for valdesc");
+       }
+}
+
+//recursion functions
+void synfigapp::recurse_canvas(synfig::Canvas::Handle h, const std::set<Time> &tlist, 
+                                                               timepoints_ref &vals)
+{
+       
+       //synfig::info("Canvas...\n Recurse through layers");
+       // iterate through the layers
+
+       synfig::Canvas::iterator i = h->begin(), end = h->end();
+
+       for(; i != end; ++i)
+       {
+               const Node::time_set &tset = (*i)->get_times();
+               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
+               {
+                       recurse_layer(*i,tlist,vals);
+               }
+       }
+}
+
+void synfigapp::recurse_layer(synfig::Layer::Handle h, const std::set<Time> &tlist, 
+                                                               timepoints_ref &vals)
+{
+       // iterate through the layers
+       //check for special case of paste canvas
+       etl::handle<synfig::Layer_PasteCanvas> p = etl::handle<synfig::Layer_PasteCanvas>::cast_dynamic(h);
+       
+       //synfig::info("Layer...");
+       
+       if(p)
+       {
+               //synfig::info("We are a paste canvas so go into that");
+               //recurse into the canvas
+               const synfig::Node::time_set &tset = p->get_sub_canvas()->get_times();
+               
+               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
+               {
+                       //we have to offset the times so it won't wreck havoc if the canvas is imported more than once...
+                       // and so we get correct results when offsets are present
+                       std::set<Time>  tlistoff;                       
+                       std::set<Time>::iterator i = tlist.begin(), end = tlist.end();
+                       for(; i != end; ++i)
+                       {
+                               tlistoff.insert(*i - p->get_time_offset());
+                       }
+                       
+                       recurse_canvas(p->get_sub_canvas(),tlist,vals);
+               }
+       }
+
+       //check all the valuenodes regardless...
+       //synfig::info("Recurse all valuenodes");
+       synfig::Layer::DynamicParamList::const_iterator         i = h->dynamic_param_list().begin(),
+                                                                                                       end = h->dynamic_param_list().end();
+       for(; i != end; ++i)
+       {
+               const synfig::Node::time_set &tset = i->second->get_times();
+               
+               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
+               {
+                       recurse_valuedesc(ValueDesc(h,i->first),tlist,vals);
+               }
+       }
+}
+
+template < typename IT, typename CMP >
+static bool sorted(IT i,IT end, const CMP &cmp = CMP())
+{
+       if(i == end) return true;
+               
+       for(IT last = i++; i != end; last = i++)
+       {
+               if(!cmp(*last,*i))
+                       return false;
+       }
+       
+       return true;
+}
+
+void synfigapp::recurse_valuedesc(synfigapp::ValueDesc h, const std::set<Time> &tlist, 
+                                                               timepoints_ref &vals)
+{
+       //special cases for Animated, DynamicList, and Linkable
+       
+       //synfig::info("ValueBasenode... %p, %s", h.get_value_node().get(),typeid(*h.get_value_node()).name());
+       
+       
+       //animated case
+       {
+               synfig::ValueNode_Animated::Handle p = synfig::ValueNode_Animated::Handle::cast_dynamic(h.get_value_node());
+               
+               if(p)
+               {
+                       //loop through and determine which waypoint we will need to reference
+                       const synfig::WaypointList &w = p->waypoint_list();
+                       
+                       synfig::WaypointList::const_iterator i = w.begin(),
+                                                                                               end = w.end();
+                       
+                       std::set<Time>::const_iterator          j = tlist.begin(),
+                                                                                               jend = tlist.end();
+                       for(; i != end && j != jend;) 
+                       {
+                               //synfig::info("tpair t(%.3f) = %.3f", (float)*j, (float)(i->get_time()));
+                               
+                               if(j->is_equal(i->get_time()))
+                               {
+                                       vals.insert(p,*i);
+                                       ++i,++j;
+                               }else if(*i < *j) 
+                               {
+                                       ++i;
+                               }else ++j;
+                       }
+                       return;
+               }
+       }
+       
+       //parent dynamiclist case - just for active points for that object...
+       if(h.parent_is_value_node())
+       {
+               synfig::ValueNode_DynamicList::Handle p = synfig::ValueNode_DynamicList::Handle::cast_dynamic(h.get_parent_value_node());                                               
+                               
+               if(p)
+               {
+                       int index = h.get_index();
+                       
+                       //check all the active points in each list...
+                       const synfig::ActivepointList &a = p->list[index].timing_info;
+                       
+                       //synfig::info("Our parent = dynamic list, searching in %d activepts",a.size());
+                                               
+                       std::set<Time>::const_iterator                  i = tlist.begin(),
+                                                                                                       end = tlist.end();
+                       
+                       synfig::ActivepointList::const_iterator         j = a.begin(),
+                                                                                                       jend = a.end();
+                       
+                       for(; j != jend && i != end;)
+                       {
+                               double it = *i;
+                               double jt = j->get_time();
+                               double diff = (double)(it - jt);
+                               
+                               //synfig::info("\ttpair match(%.4lg) - %.4lg (diff = %lg",it,jt,diff);                          
+                               
+                               //
+                               if(abs(diff) < (double)Time::epsilon())
+                               {
+                                       //synfig::info("\tActivepoint to add being referenced (%x,%s,%.4lg)",
+                                       //                              (int)j->get_uid(),j->state?"true":"false", (double)j->time);
+                                       vals.insert(ValueDesc(p,index),*j);
+                                       ++i,++j;                                                
+                               }else if(it < jt)
+                               {
+                                       ++i;
+                                       //synfig::info("\tIncrementing time");
+                               }
+                               else 
+                               {
+                                       ++j;
+                                       //synfig::info("\tIncrementing actpt");
+                               }
+                       }
+               }
+       }
+       
+       //dynamiclist case - we must still make sure that we read from the list entries the time values
+       //                                              because just the linked valuenodes will not do that
+       {
+               synfig::ValueNode_DynamicList::Handle p = synfig::ValueNode_DynamicList::Handle::cast_dynamic(h.get_value_node());
+               
+               if(p)
+               {
+                       //synfig::info("Process dynamic list valuenode");
+                       int index = 0;
+                       
+                       std::vector<synfig::ValueNode_DynamicList::ListEntry>::const_iterator   
+                                                       i = p->list.begin(),
+                                                       end = p->list.end();
+                       
+                       for(; i != end; ++i, ++index)
+                       {
+                               const Node::time_set &tset = i->get_times();
+                               
+                               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
+                               {
+                                       recurse_valuedesc(ValueDesc(p,index),tlist,vals);
+                               }
+                       }
+                       return;
+               }
+       }
+       
+       //the linkable case...
+       {
+               etl::handle<synfig::LinkableValueNode> p = etl::handle<synfig::LinkableValueNode>::cast_dynamic(h.get_value_node());
+               
+               if(p)
+               {
+                       //synfig::info("Process Linkable ValueBasenode");
+                       int i = 0, size = p->link_count();
+                       
+                       for(; i < size; ++i)
+                       {
+                               ValueNode::Handle v = p->get_link(i);
+                               const Node::time_set &tset = v->get_times();
+                               
+                               if(check_intersect(tset.begin(),tset.end(),tlist.begin(),tlist.end()))
+                               {
+                                       recurse_valuedesc(ValueDesc(p,i),tlist,vals);
+                               }
+                       }
+               }
+       }
+}
diff --git a/synfig-studio/trunk/src/synfigapp/timegather.h b/synfig-studio/trunk/src/synfigapp/timegather.h
new file mode 100644 (file)
index 0000000..f944a71
--- /dev/null
@@ -0,0 +1,135 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file timegather.h
+**     \brief Time Gather Header
+**
+**     $Id: timegather.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2004 Adrian Bentley
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_TIMEGATHER_H
+#define __SYNFIG_TIMEGATHER_H
+
+/* === H E A D E R S ======================================================= */
+#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfig/time.h>
+#include "value_desc.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 synfigapp {
+
+class ValueDesc;
+class synfig::Time;
+
+struct ValueBaseTimeInfo
+{
+       synfig::ValueNode_Animated::Handle      val;
+       mutable std::set<synfig::Waypoint>      waypoints;
+       
+       bool operator<(const ValueBaseTimeInfo &rhs) const
+       {
+               return val < rhs.val;
+       }
+};
+
+struct ActiveTimeInfo
+{
+       struct actcmp
+       {
+               bool operator()(const synfig::Activepoint &lhs, const synfig::Activepoint &rhs) const
+               {
+                       return lhs.time < rhs.time;
+               }               
+       };
+       
+       synfigapp::ValueDesc                                            val;
+       
+       typedef std::set<synfig::Activepoint,actcmp>    set;
+       
+       mutable set activepoints;
+       
+       bool operator<(const ActiveTimeInfo &rhs) const
+       {
+               return val.get_parent_value_node() == rhs.val.get_parent_value_node() ? 
+                                               val.get_index() < rhs.val.get_index() : 
+                                               val.get_parent_value_node() < rhs.val.get_parent_value_node();
+       }
+};
+
+struct timepoints_ref
+{
+       typedef std::set<ValueBaseTimeInfo>             waytracker;     
+       typedef std::set<ActiveTimeInfo>        acttracker;
+       
+       waytracker              waypointbiglist;
+       acttracker              actpointbiglist;        
+       
+       void insert(synfig::ValueNode_Animated::Handle v, synfig::Waypoint w);  
+       void insert(synfigapp::ValueDesc v, synfig::Activepoint a);
+};
+
+//assumes they're sorted... (incremental advance)
+//checks the intersection of the two sets... might be something better in the stl
+template < typename I1, typename I2 >
+bool check_intersect(I1 b1, I1 end1, I2 b2, I2 end2)
+{
+       if(b1 == end1 || b2 == end2) 
+               return false;
+       
+       for(; b1 != end1 && b2 != end2;)
+       {
+               if(*b1 < *b2) ++b1;
+               else if(*b2 < *b1) ++b2;
+               else
+               {
+                       assert(*b1 == *b2);
+                       return true;
+               }
+       }
+       return false;
+}
+
+//pointer kind of a hack, gets the accurate times from a value desc 
+//     (deals with dynamic list member correctly... i.e. gathers activepoints)
+const synfig::Node::time_set *get_times_from_vdesc(const synfigapp::ValueDesc &v);
+
+//get's the closest time inside the set
+bool get_closest_time(const synfig::Node::time_set &tset, const synfig::Time &t, 
+                                               const synfig::Time &range, synfig::Time &out);
+
+//recursion functions based on time restrictions (can be expanded later)...
+//builds a list of relevant waypoints and activepoints inside the timepoints_ref structure
+void recurse_valuedesc(synfigapp::ValueDesc valdesc, const std::set<synfig::Time> &tlist,
+                                                               timepoints_ref &vals);
+void recurse_layer(synfig::Layer::Handle layer, const std::set<synfig::Time> &tlist, 
+                                                               timepoints_ref &vals);
+void recurse_canvas(synfig::Canvas::Handle canvas, const std::set<synfig::Time> &tlist, 
+                                                               timepoints_ref &vals);
+
+
+
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/uimanager.cpp b/synfig-studio/trunk/src/synfigapp/uimanager.cpp
new file mode 100644 (file)
index 0000000..06b438b
--- /dev/null
@@ -0,0 +1,157 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file uimanager.cpp
+**     \brief Template File
+**
+**     $Id: uimanager.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 "uimanager.h"
+#include <iostream>
+#include <string>
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === M A C R O S ========================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+UIInterface::Response
+ConsoleUIInterface::yes_no(const std::string &title, const std::string &message,Response dflt)
+{
+       cout<<title<<": "<<message<<' ';
+       if(dflt==RESPONSE_NO)
+               cout<<_("(no/yes)")<<endl;
+       else
+               cout<<_("(yes/no)")<<endl;
+       string resp;
+       cin>>resp;
+
+       if(dflt==RESPONSE_NO)
+       {
+               if(resp=="yes")
+                       return RESPONSE_YES;
+               else
+                       return RESPONSE_NO;
+       }
+       else
+       {
+               if(resp=="no")
+                       return RESPONSE_NO;
+               else
+                       return RESPONSE_YES;
+       }
+}
+
+UIInterface::Response
+ConsoleUIInterface::yes_no_cancel(const string &title, const string &message,Response dflt)
+{
+       cout<<title<<": "<<message<<' ';
+       if(dflt==RESPONSE_NO)
+               cout<<_("(no/yes)")<<endl;
+       else
+               cout<<_("(yes/no)")<<endl;
+       string resp;
+       cin>>resp;
+
+       if(dflt==RESPONSE_NO)
+       {
+               if(resp=="yes")
+                       return RESPONSE_YES;
+               else
+                       return RESPONSE_NO;
+       }
+       else
+       {
+               if(resp=="no")
+                       return RESPONSE_NO;
+               else
+                       return RESPONSE_YES;
+       }
+}
+
+UIInterface::Response
+ConsoleUIInterface::ok_cancel(const std::string &title, const std::string &message,Response dflt)
+{
+       cout<<title<<": "<<message<<' ';
+       if(dflt==RESPONSE_CANCEL)
+               cout<<_("(cancel/ok)")<<endl;
+       else
+               cout<<_("(ok/cancel)")<<endl;
+       string resp;
+       cin>>resp;
+
+       if(dflt==RESPONSE_CANCEL)
+       {
+               if(resp=="ok")
+                       return RESPONSE_OK;
+               else
+                       return RESPONSE_CANCEL;
+       }
+       else
+       {
+               if(resp=="cancel")
+                       return RESPONSE_CANCEL;
+               else
+                       return RESPONSE_OK;
+       }
+}
+       
+bool
+ConsoleUIInterface::task(const std::string &task)
+{
+       cout<<task<<endl;
+       return true;
+}
+
+bool
+ConsoleUIInterface::error(const std::string &task)
+{
+       cout<<_("error: ")<<task<<endl;
+       return true;
+}
+
+bool
+ConsoleUIInterface::warning(const std::string &task)
+{
+       cout<<_("warning: ")<<task<<endl;
+       return true;
+}
+
+bool
+ConsoleUIInterface::amount_complete(int current, int total)
+{
+       return true;
+}
+
+
+
diff --git a/synfig-studio/trunk/src/synfigapp/uimanager.h b/synfig-studio/trunk/src/synfigapp/uimanager.h
new file mode 100644 (file)
index 0000000..11693a5
--- /dev/null
@@ -0,0 +1,115 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file uimanager.h
+**     \brief User Interface Manager Class
+**
+**     $Id: uimanager.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_UIMANAGER_H
+#define __SYNFIG_APP_UIMANAGER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <ETL/handle>
+#include <synfig/general.h>
+#include <synfig/string.h>
+#include <sigc++/object.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 synfigapp {
+
+class UIInterface : public etl::shared_object, public synfig::ProgressCallback, public sigc::trackable
+{
+public:
+       enum Response
+       {
+               RESPONSE_CANCEL=-1,
+               RESPONSE_NO=0,
+               RESPONSE_YES=1,
+               RESPONSE_OK=2
+       };
+       virtual ~UIInterface() { }
+       virtual Response yes_no(const std::string &title, const std::string &message,Response dflt=RESPONSE_YES)=0;
+       virtual Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt=RESPONSE_YES)=0;
+       virtual Response ok_cancel(const std::string &title, const std::string &message,Response dflt=RESPONSE_OK)=0;
+};     
+
+class DefaultUIInterface : public UIInterface
+{
+public:
+       Response yes_no(const std::string &title, const std::string &message,Response dflt)
+               { return dflt; }
+       Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt)
+               { return dflt; }
+       Response ok_cancel(const std::string &title, const std::string &message,Response dflt)
+               { return dflt; }
+       
+       bool task(const std::string &task)
+               { return true; }
+       bool error(const std::string &task)
+               { return true; }
+       bool warning(const std::string &task)
+               { return true; }
+       bool amount_complete(int current, int total)
+               { return true; }
+};     
+
+class ConfidentUIInterface : public UIInterface
+{
+public:
+       Response yes_no(const std::string &title, const std::string &message,Response dflt)
+               { return RESPONSE_YES; }
+       Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt)
+               { return RESPONSE_YES; }
+       Response ok_cancel(const std::string &title, const std::string &message,Response dflt)
+               { return RESPONSE_OK; }
+       
+       bool task(const std::string &task)
+               { return true; }
+       bool error(const std::string &task)
+               { return true; }
+       bool warning(const std::string &task)
+               { return true; }
+       bool amount_complete(int current, int total)
+               { return true; }
+};     
+
+class ConsoleUIInterface : public UIInterface
+{
+public:
+       Response yes_no(const std::string &title, const std::string &message,Response dflt);
+       Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt);
+       Response ok_cancel(const std::string &title, const std::string &message,Response dflt);
+       
+       bool task(const std::string &task);
+       bool error(const std::string &task);
+       bool warning(const std::string &task);
+       bool amount_complete(int current, int total);
+};     
+
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/trunk/src/synfigapp/value_desc.h b/synfig-studio/trunk/src/synfigapp/value_desc.h
new file mode 100644 (file)
index 0000000..5b3d4a8
--- /dev/null
@@ -0,0 +1,182 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file value_desc.h
+**     \brief Template Header
+**
+**     $Id: value_desc.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     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 __SYNFIG_APP_VALUE_DESC_H
+#define __SYNFIG_APP_VALUE_DESC_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/valuenode.h>
+#include <synfig/string.h>
+#include <synfig/layer.h>
+#include <synfig/value.h>
+#include <synfig/valuenode_const.h>
+#include <synfig/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 synfigapp {
+
+class ValueDesc
+{
+       // Info for Layer parent
+       synfig::Layer::Handle layer;
+       synfig::String name;
+       
+       // Info for ValueNode parent
+       synfig::ValueNode::Handle parent_value_node;
+       int index;
+
+       // Info for exported ValueNode
+       synfig::Canvas::Handle canvas;
+       
+public:
+       bool operator==(const ValueDesc &rhs)const
+       {
+               if((layer||rhs.layer) && layer!=rhs.layer)
+                       return false;
+               if((!name.empty()||!rhs.name.empty()) && name!=rhs.name)
+                       return false;
+               if(layer)
+                       return true;
+               if((canvas||rhs.canvas) && canvas!=rhs.canvas)
+                       return false;
+               if((parent_value_node||rhs.parent_value_node) && parent_value_node!=rhs.parent_value_node)
+                       return false;
+               if((index>-1||rhs.index>-1) && index!=rhs.index)
+                       return false;
+               return true;
+       }
+       bool operator!=(const ValueDesc &rhs)const
+       {
+               return !operator==(rhs);
+       }
+
+       
+       ValueDesc(synfig::Layer::Handle layer,const synfig::String& param_name):
+               layer(layer),
+               name(param_name) { }
+
+       ValueDesc(synfig::Layer::LooseHandle layer,const synfig::String& param_name):
+               layer(layer),
+               name(param_name) { }
+
+       ValueDesc(synfig::LinkableValueNode::Handle parent_value_node,int index):
+               parent_value_node(parent_value_node),
+               index(index) { }
+
+//     ValueDesc(synfig::LinkableValueNode::Handle parent_value_node,const synfig::String& param_name):
+//             parent_value_node(parent_value_node),
+//             index(parent_value_node->get_link_index_from_name(param_name)) { }
+
+       ValueDesc(synfig::Canvas::Handle canvas,const synfig::String& name):
+               name(name),
+               canvas(canvas) { }
+
+       ValueDesc(synfig::ValueNode_Const::Handle parent_value_node):
+               parent_value_node(parent_value_node),
+               index(-1) { }
+
+       ValueDesc() { }
+
+       bool is_valid()const { return layer || parent_value_node || canvas; }
+       operator bool()const { return is_valid(); }
+
+       bool parent_is_layer_param()const { return (bool)layer; }
+       bool parent_is_value_node()const { return (bool)parent_value_node; }
+       bool parent_is_linkable_value_node()const { return parent_is_value_node() && index>=0; }
+       bool parent_is_value_node_const()const { return parent_is_value_node() && index==-1; }
+       bool parent_is_canvas()const { return (bool)canvas; }
+       
+       bool is_value_node()const { return parent_is_value_node() || parent_is_canvas() || (parent_is_layer_param() && (bool)layer->dynamic_param_list().count(name)); }
+       bool is_const()const { return (parent_is_layer_param() && !layer->dynamic_param_list().count(name)) || parent_is_value_node_const(); }
+       
+       synfig::Layer::Handle get_layer()const { assert(parent_is_layer_param()); return layer; }
+       const synfig::String& get_param_name()const { assert(parent_is_layer_param()); return name; }
+       
+       synfig::ValueNode::Handle get_parent_value_node()const { assert(parent_is_value_node()); return parent_value_node; }
+       int get_index()const { assert(parent_is_linkable_value_node()); return index; }
+       
+       const synfig::String& get_value_node_id()const { assert(parent_is_canvas()); return name; }
+
+       synfig::Canvas::Handle get_canvas()const
+       {
+               if(canvas)
+                       return canvas;
+               if(layer)
+                       return layer->get_canvas();
+               if(parent_value_node)
+                       return parent_value_node->get_root_canvas();
+               return 0;
+       }
+       
+       synfig::ValueNode::Handle
+       get_value_node()const
+       {
+               if(parent_is_canvas())
+                       return canvas->find_value_node(name);
+               if(parent_is_layer_param() && layer->dynamic_param_list().count(name))
+                       return layer->dynamic_param_list().find(name)->second;
+               if(parent_is_linkable_value_node())
+                       return synfig::LinkableValueNode::Handle::cast_reinterpret(parent_value_node)->get_link(index);
+//                     return reinterpret_cast<synfig::LinkableValueNode*>(parent_value_node.get())->get_link(index);
+               return 0;
+       }
+
+       synfig::ValueBase
+       get_value(synfig::Time time=0)const
+       {
+               if(parent_is_value_node_const() && parent_value_node)
+                       return (*parent_value_node)(0);
+               if(is_value_node() && get_value_node())
+                       return (*get_value_node())(time);
+               if(parent_is_layer_param() && layer)
+                       return layer->get_param(name);
+               return synfig::ValueBase();
+       }       
+
+       synfig::ValueBase::Type
+       get_value_type()const
+       {
+               synfig::ValueNode::Handle value_node=get_value_node();
+               if(value_node)
+                       return value_node->get_type();
+               return get_value().get_type();
+       }
+       
+       bool
+       is_exported()const
+       {
+               return is_value_node() && get_value_node()->is_exported();
+       }
+}; // END of class ValueDesc
+
+}; // END of namespace synfigapp_instance
+
+/* === E N D =============================================================== */
+
+#endif
index bcc31af..e508c3b 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.cpp
 **     \brief Template File
 **
@@ -38,7 +38,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 
 /* === M A C R O S ========================================================= */
 
index 841f657..d1a24fc 100644 (file)
@@ -1,4 +1,4 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file template.h
 **     \brief Template Header
 **
@@ -21,8 +21,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SINFG_TEMPLATE_H
-#define __SINFG_TEMPLATE_H
+#ifndef __SYNFIG_TEMPLATE_H
+#define __SYNFIG_TEMPLATE_H
 
 /* === H E A D E R S ======================================================= */
 
diff --git a/synfig-studio/trunk/synfigstudio.desktop.in b/synfig-studio/trunk/synfigstudio.desktop.in
new file mode 100644 (file)
index 0000000..b2ccafc
--- /dev/null
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=@PACKAGE_NAME@
+Comment=A Powerful 2D Animation and Composition Package
+Exec=@prefix@/bin/synfigstudio
+Terminal=1
+Type=Application
+Icon=@prefix@/share/pixmaps/synfig_icon.@imageext@
+Categories=Application;Graphics;
+StartupNotify=true
+Encoding=UTF-8
+MimeType=image/sif
diff --git a/synfig-studio/trunk/synfigstudio.keys.in b/synfig-studio/trunk/synfigstudio.keys.in
new file mode 100644 (file)
index 0000000..c0a384f
--- /dev/null
@@ -0,0 +1,23 @@
+
+image/sif:
+       open=@prefix@/bin/synfigstudio %f
+       view=@prefix@/bin/synfigstudio %f
+       icon-filename=@prefix@/share/pixmaps/sif_icon.@imageext@
+       description=SYNFIG Composition
+       default_action_type=application
+       short_list_application_ids_for_novice_user_level=synfigstudio
+       short_list_application_ids_for_intermediate_user_level=synfigstudio
+       short_list_application_ids_for_advanced_user_level=synfigstudio
+#    category=Images
+                                                                                
+
+image/sifz:
+       open=@prefix@/bin/synfigstudio %f
+       view=@prefix@/bin/synfigstudio %f
+       icon-filename=@prefix@/share/pixmaps/sif_icon.@imageext@
+       description=Compressed SYNFIG Composition
+       default_action_type=application
+       short_list_application_ids_for_novice_user_level=synfigstudio
+       short_list_application_ids_for_intermediate_user_level=synfigstudio
+       short_list_application_ids_for_advanced_user_level=synfigstudio
+#   category=Images
diff --git a/synfig-studio/trunk/synfigstudio.mime.in b/synfig-studio/trunk/synfigstudio.mime.in
new file mode 100644 (file)
index 0000000..852aac8
--- /dev/null
@@ -0,0 +1,7 @@
+# mime types for synfig studio
+
+image/sif
+       ext: sif SIF
+
+image/sifz
+       ext: sifZ SIFZ sif.gz SIF.GZ SIF.gz
index 633be38..f29135d 100644 (file)
@@ -62,8 +62,8 @@ Section "Synfig Studio"
   File "images\*.ico"
 
   SetOutPath "$INSTDIR\bin"
-  File "src\sinfgapp\.libs\libsinfgapp-0.dll"
-  File "src\gtkmm\.libs\sinfgstudio.exe"
+  File "src\synfigapp\.libs\libsynfigapp-0.dll"
+  File "src\gtkmm\.libs\synfigstudio.exe"
 
        FileOpen $0 $PROFILE\.gtkrc-2.0 a
        FileSeek $0 0 END
@@ -95,9 +95,9 @@ Section "Synfig Studio"
        WriteRegStr HKCR ".sif.gz" "PerceivedType" "image"
 
        WriteRegStr HKCR "Synfig.Composition" "" "Synfig Composition File"
-       WriteRegStr HKCR "Synfig.Composition\DefaultIcon" "" "$INSTDIR\bin\sinfgstudio.exe;1"
+       WriteRegStr HKCR "Synfig.Composition\DefaultIcon" "" "$INSTDIR\bin\synfigstudio.exe;1"
        WriteRegStr HKCR "Synfig.Composition\shell" "" "open"
-       WriteRegStr HKCR "Synfig.Composition\shell\open\command" "" '$INSTDIR\bin\sinfgstudio.exe "%1"'
+       WriteRegStr HKCR "Synfig.Composition\shell\open\command" "" '$INSTDIR\bin\synfigstudio.exe "%1"'
        
        System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
   WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
@@ -109,7 +109,7 @@ Section "Start Menu Shortcuts"
 
   CreateDirectory "$SMPROGRAMS\Voria"
   CreateShortCut "$SMPROGRAMS\Voria\Uninstall Synfig Studio.lnk" "$INSTDIR\uninstall-@PACKAGE_TARNAME@.exe" "" "$INSTDIR\uninstall-@PACKAGE_TARNAME@.exe" 0
-  CreateShortCut "$SMPROGRAMS\Voria\Synfig Studio.lnk" "$INSTDIR\bin\sinfgstudio.exe" "" "$INSTDIR\bin\sinfgstudio.exe" 0
+  CreateShortCut "$SMPROGRAMS\Voria\Synfig Studio.lnk" "$INSTDIR\bin\synfigstudio.exe" "" "$INSTDIR\bin\synfigstudio.exe" 0
   
 SectionEnd
 
@@ -132,8 +132,8 @@ Section "Uninstall"
 
   ; Remove files and uninstaller
        Delete "$INSTDIR\${PRODUCT_UNINSTALL_EXE}"
-  Delete $INSTDIR\bin\sinfgstudio.exe
-  Delete $INSTDIR\bin\libsinfgapp-0.dll
+  Delete $INSTDIR\bin\synfigstudio.exe
+  Delete $INSTDIR\bin\libsynfigapp-0.dll
   RMDir $INSTDIR\bin
 
   ; Remove shortcuts, if any