# synfigapp::CanvasInterface Class Reference

`#include <canvasinterface.h>`

List of all members.

## Public Types

typedef EditMode | Mode

## Public Member Functions

sigc::signal< void, synfig::Layer::Handle, int, synfig::Canvas::Handle > & | signal_layer_moved ()
sigc::signal< void, synfig::Layer::Handle, synfig::String > & | signal_layer_new_description ()
sigc::signal< void, synfig::Layer::Handle > & | signal_layer_raised ()
| Signal called when layer is raised.
sigc::signal< void, synfig::Layer::Handle > & | signal_layer_lowered ()
| Signal called when layer is lowered.
sigc::signal< void, synfig::Layer::Handle, int > & | signal_layer_inserted ()
| Signal called when layer has been inserted at a given position.
sigc::signal< void, synfig::Layer::Handle > & | signal_layer_removed ()
| Signal called when a layer has been removed from the canvas.
sigc::signal< void, synfig::Layer::Handle, bool > & | signal_layer_status_changed ()
| Signal called when the layer's active status has changed.
sigc::signal< void, etl::handle< synfig::Canvas > > & | signal_canvas_added ()
| Signal called when a canvas has been added.
sigc::signal< void, etl::handle< synfig::Canvas > > & | signal_canvas_removed ()
| Signal called when a canvas has been removed.
sigc::signal< void, synfig::Layer::Handle, synfig::String > & | signal_layer_param_changed ()
| Signal called when a layer's parameter has been changed.
sigc::signal< void > & | signal_dirty_preview ()
| Signal called when the canvas's preview needs to be updated.
sigc::signal< void, etl::handle< synfig::ValueNode > , etl::handle < synfig::ValueNode > > & | signal_value_node_child_added ()
sigc::signal< void, etl::handle< synfig::ValueNode > , etl::handle < synfig::ValueNode > > & | signal_value_node_child_removed ()
sigc::signal< void, etl::handle< synfig::ValueNode > > & | signal_value_node_added ()
| Signal called when a ValueNode has changed.
sigc::signal< void, etl::handle< synfig::ValueNode > > & | signal_value_node_deleted ()
| Signal called when a ValueNode has been deleted.
sigc::signal< void, etl::handle< synfig::ValueNode > > & | signal_value_node_changed ()
| Signal called when a ValueNode has been changed.
sigc::signal< void, etl::handle< synfig::ValueNode > > & | signal_value_node_renamed ()
| Signal called when a ValueNode has been renamed.
sigc::signal< void, Mode > | signal_mode_changed ()
| Signal called when the mode has changed.
sigc::signal< void > & | signal_id_changed ()
| Signal called when a the ID has been changed.
sigc::signal< void > | signal_time_changed ()
| Signal called whenever the time changes.
sigc::signal< void, synfig::ValueNode::Handle, synfig::ValueNode::Handle > & | signal_value_node_replaced ()
| Signal called whenever a data node has been replaced.
sigc::signal< void > & | signal_rend_desc_changed ()
| Signal called whenever the RendDesc changes.
sigc::signal< void, synfig::Keyframe > & | signal_keyframe_added ()
sigc::signal< void, synfig::Keyframe > & | signal_keyframe_removed ()
sigc::signal< void, synfig::Keyframe > & | signal_keyframe_changed ()
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)
void | set_selection_manager (const etl::handle< SelectionManager > &sm)
| Changes the current SelectionManager object.
void | unset_selection_manager ()
| Disables the selection manager.
const etl::handle < SelectionManager > & | get_selection_manager () const
| Returns a handle to the current SelectionManager.
void | set_ui_interface (const etl::handle< UIInterface > &uim)
| Changes the current UIInterface object.
void | unset_ui_interface ()
| Disables the UIInterface.
const etl::handle< UIInterface > & | get_ui_interface ()
| Returns a handle to the current UIInterface.
etl::handle< synfig::Canvas > | get_canvas () const
| Returns the Canvas associated with this interface.
etl::loose_handle< Instance > | get_instance () const
| Returns the Instance associated with this interface.
void | set_name (const synfig::String &x)
| Changes the name of the canvas. Undoable.
void | set_description (const synfig::String &x)
| Changes the description of the canvas. Undoable.
void | set_id (const synfig::String &x)
| Changes the ID of the canvas. Undoable.
synfig::String | get_name () const
| Convenience function to retrieve the name of the canvas.
synfig::String | get_description () const
| Convenience function to retrieve the description of the canvas.
synfig::String | get_id () const
| Convenience function to retrieve the ID of the canvas.
void | set_time (synfig::Time x)
| Sets the current time.
synfig::Time | get_time () const
| Retrieves the current time.
void | jump_to_next_keyframe ()
| Changes the current time to the next keyframe.
void | jump_to_prev_keyframe ()
| Changes the current time to the next keyframe.
void | seek_frame (int frames)
void | seek_time (synfig::Time time)
void | refresh_current_values ()
void | set_mode (Mode x)
| Sets the current editing mode.
Mode | get_mode () const
| Retrieves the current editing mode.
synfig::Layer::Handle | add_layer_to (synfig::String id, synfig::Canvas::Handle canvas, int depth=0)
| Creates a new layer, of type `id` at the top of the layer stack.
bool | convert (ValueDesc value_desc, synfig::String type)
bool | add_value_node (synfig::ValueNode::Handle value_node, synfig::String name)
| Adds the given ValueNode to the canvas.
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, synfig::String &errors, synfig::String &warnings, bool resize_image=false)
void | waypoint_duplicate (synfigapp::ValueDesc value_desc, synfig::Waypoint waypoint)
void | waypoint_duplicate (synfig::ValueNode::Handle value_node, synfig::Waypoint waypoint)
void | waypoint_remove (synfigapp::ValueDesc value_desc, synfig::Waypoint waypoint)
void | waypoint_remove (synfig::ValueNode::Handle value_node, synfig::Waypoint waypoint)
bool | change_value (synfigapp::ValueDesc value_desc, synfig::ValueBase new_value)
int | find_important_value_descs (std::vector< synfigapp::ValueDesc > &out)
| ~CanvasInterface ()

## Static Public Member Functions

static int | find_important_value_descs (synfig::Canvas::Handle canvas, std::vector< synfigapp::ValueDesc > &out, synfig::GUIDSet &guid_set)
static etl::handle < CanvasInterface > | create (etl::loose_handle< Instance > instance, etl::handle< synfig::Canvas > canvas)

## Friends

class | Instance
class | Action::EditModeSet

## Member Typedef Documentation

typedef EditMode synfigapp::CanvasInterface::Mode

## Constructor & Destructor Documentation

CanvasInterface::~CanvasInterface | ( |  | ) |

## Member Function Documentation

sigc::signal<void,synfig::Layer::Handle,int,synfig::Canvas::Handle>& synfigapp::CanvasInterface::signal_layer_moved | ( |  | ) | `[inline]`

sigc::signal<void,synfig::Layer::Handle,synfig::String>& synfigapp::CanvasInterface::signal_layer_new_description | ( |  | ) | `[inline]`

Referenced by import().

sigc::signal<void,synfig::Layer::Handle>& synfigapp::CanvasInterface::signal_layer_raised | ( |  | ) | `[inline]`

Signal called when layer is raised.

sigc::signal<void,synfig::Layer::Handle>& synfigapp::CanvasInterface::signal_layer_lowered | ( |  | ) | `[inline]`

Signal called when layer is lowered.

sigc::signal<void,synfig::Layer::Handle,int>& synfigapp::CanvasInterface::signal_layer_inserted | ( |  | ) | `[inline]`

Signal called when layer has been inserted at a given position.

sigc::signal<void,synfig::Layer::Handle>& synfigapp::CanvasInterface::signal_layer_removed | ( |  | ) | `[inline]`

Signal called when a layer has been removed from the canvas.

sigc::signal<void,synfig::Layer::Handle,bool>& synfigapp::CanvasInterface::signal_layer_status_changed | ( |  | ) | `[inline]`

Signal called when the layer's active status has changed.

sigc::signal<void,etl::handle<synfig::Canvas> >& synfigapp::CanvasInterface::signal_canvas_added | ( |  | ) | `[inline]`

Signal called when a canvas has been added.

sigc::signal<void,etl::handle<synfig::Canvas> >& synfigapp::CanvasInterface::signal_canvas_removed | ( |  | ) | `[inline]`

Signal called when a canvas has been removed.

sigc::signal<void,synfig::Layer::Handle,synfig::String>& synfigapp::CanvasInterface::signal_layer_param_changed | ( |  | ) | `[inline]`

Signal called when a layer's parameter has been changed.

sigc::signal<void>& synfigapp::CanvasInterface::signal_dirty_preview | ( |  | ) | `[inline]`

Signal called when the canvas's preview needs to be updated.

References get_canvas().

Referenced by refresh_current_values(), and set_time().

sigc::signal<void,etl::handle<synfig::ValueNode>,etl::handle<synfig::ValueNode> >& synfigapp::CanvasInterface::signal_value_node_child_added | ( |  | ) | `[inline]`

References get_canvas().

sigc::signal<void,etl::handle<synfig::ValueNode>,etl::handle<synfig::ValueNode> >& synfigapp::CanvasInterface::signal_value_node_child_removed | ( |  | ) | `[inline]`

References get_canvas().

sigc::signal<void,etl::handle<synfig::ValueNode> >& synfigapp::CanvasInterface::signal_value_node_added | ( |  | ) | `[inline]`

Signal called when a ValueNode has changed.

sigc::signal<void,etl::handle<synfig::ValueNode> >& synfigapp::CanvasInterface::signal_value_node_deleted | ( |  | ) | `[inline]`

Signal called when a ValueNode has been deleted.

sigc::signal<void,etl::handle<synfig::ValueNode> >& synfigapp::CanvasInterface::signal_value_node_changed | ( |  | ) | `[inline]`

Signal called when a ValueNode has been changed.

References get_canvas().

sigc::signal<void,etl::handle<synfig::ValueNode> >& synfigapp::CanvasInterface::signal_value_node_renamed | ( |  | ) | `[inline]`

Signal called when a ValueNode has been renamed.

References get_canvas().

sigc::signal<void,Mode> synfigapp::CanvasInterface::signal_mode_changed | ( |  | ) | `[inline]`

Signal called when the mode has changed.

sigc::signal<void>& synfigapp::CanvasInterface::signal_id_changed | ( |  | ) | `[inline]`

Signal called when a the ID has been changed.

sigc::signal<void> synfigapp::CanvasInterface::signal_time_changed | ( |  | ) | `[inline]`

Signal called whenever the time changes.

Referenced by refresh_current_values(), and set_time().

sigc::signal<void,synfig::ValueNode::Handle,synfig::ValueNode::Handle>& synfigapp::CanvasInterface::signal_value_node_replaced | ( |  | ) | `[inline]`

Signal called whenever a data node has been replaced.

Second ValueNode replaces first

sigc::signal<void>& synfigapp::CanvasInterface::signal_rend_desc_changed | ( |  | ) | `[inline]`

Signal called whenever the RendDesc changes.

sigc::signal<void,synfig::Keyframe>& synfigapp::CanvasInterface::signal_keyframe_added | ( |  | ) | `[inline]`

sigc::signal<void,synfig::Keyframe>& synfigapp::CanvasInterface::signal_keyframe_removed | ( |  | ) | `[inline]`

sigc::signal<void,synfig::Keyframe>& synfigapp::CanvasInterface::signal_keyframe_changed | ( |  | ) | `[inline]`

void CanvasInterface::auto_export | ( | const ValueDesc & | value_desc | ) |

References _, synfigapp::Action::create(), get_canvas(), get_instance(), and get_ui_interface().

void CanvasInterface::auto_export | ( | synfig::ValueNode::Handle | value_node | ) |

void CanvasInterface::set_meta_data | ( | const synfig::String & | key,
|  | const synfig::String & | data |
| ) |  |  |

References get_canvas().

void synfigapp::CanvasInterface::set_selection_manager | ( | const etl::handle< SelectionManager > & | sm | ) | `[inline]`

Changes the current SelectionManager object.

void synfigapp::CanvasInterface::unset_selection_manager | ( |  | ) | `[inline]`

Disables the selection manager.

const etl::handle<SelectionManager>& synfigapp::CanvasInterface::get_selection_manager | ( |  | ) | const`[inline]`

Returns a handle to the current SelectionManager.

Referenced by generate_param_list().

void synfigapp::CanvasInterface::set_ui_interface | ( | const etl::handle< UIInterface > & | uim | ) | `[inline]`

Changes the current UIInterface object.

References ui_interface_.

void synfigapp::CanvasInterface::unset_ui_interface | ( |  | ) | `[inline]`

Disables the UIInterface.

References ui_interface_.

const etl::handle<UIInterface>& synfigapp::CanvasInterface::get_ui_interface | ( |  | ) | `[inline]`

Returns a handle to the current UIInterface.

References ui_interface_.

Referenced by add_layer_to(), add_value_node(), auto_export(), change_value(), convert(), import(), set_description(), set_id(), set_mode(), set_name(), and set_rend_desc().

etl::handle<synfig::Canvas> synfigapp::CanvasInterface::get_canvas | ( |  | ) | const`[inline]`

Returns the Canvas associated with this interface.

Referenced by add_layer_to(), add_value_node(), auto_export(), change_value(), convert(), find_important_value_descs(), generate_param_list(), get_description(), get_id(), get_name(), import(), jump_to_next_keyframe(), jump_to_prev_keyframe(), refresh_current_values(), seek_frame(), seek_time(), set_description(), set_id(), set_meta_data(), set_mode(), set_name(), set_rend_desc(), set_time(), signal_dirty_preview(), signal_value_node_changed(), signal_value_node_child_added(), signal_value_node_child_removed(), and signal_value_node_renamed().

etl::loose_handle<Instance> synfigapp::CanvasInterface::get_instance | ( |  | ) | const`[inline]`

Returns the Instance associated with this interface.

Referenced by add_layer_to(), add_value_node(), auto_export(), change_value(), convert(), import(), set_description(), set_id(), set_mode(), set_name(), set_rend_desc(), and set_time().

void CanvasInterface::set_name | ( | const synfig::String & | x | ) |

Changes the name of the canvas. Undoable.

References _, synfigapp::Action::create(), get_canvas(), get_instance(), and get_ui_interface().

void CanvasInterface::set_description | ( | const synfig::String & | x | ) |

Changes the description of the canvas. Undoable.

References _, synfigapp::Action::create(), get_canvas(), get_instance(), and get_ui_interface().

void CanvasInterface::set_id | ( | const synfig::String & | x | ) |

Changes the ID of the canvas. Undoable.

References _, synfigapp::Action::create(), get_canvas(), get_instance(), and get_ui_interface().

synfig::String synfigapp::CanvasInterface::get_name | ( |  | ) | const`[inline]`

Convenience function to retrieve the name of the canvas.

References get_canvas().

synfig::String synfigapp::CanvasInterface::get_description | ( |  | ) | const`[inline]`

Convenience function to retrieve the description of the canvas.

References get_canvas().

synfig::String synfigapp::CanvasInterface::get_id | ( |  | ) | const`[inline]`

Convenience function to retrieve the ID of the canvas.

References get_canvas().

void CanvasInterface::set_time | ( | synfig::Time | x | ) |

Sets the current time.

References get_canvas(), get_instance(), signal_dirty_preview(), and signal_time_changed().

Referenced by jump_to_next_keyframe(), jump_to_prev_keyframe(), seek_frame(), and seek_time().

synfig::Time CanvasInterface::get_time | ( |  | ) | const

Retrieves the current time.

Referenced by change_value(), convert(), generate_param_list(), jump_to_next_keyframe(), jump_to_prev_keyframe(), seek_frame(), and seek_time().

void CanvasInterface::jump_to_next_keyframe | ( |  | ) |

Changes the current time to the next keyframe.

References get_canvas(), get_time(), and set_time().

void CanvasInterface::jump_to_prev_keyframe | ( |  | ) |

Changes the current time to the next keyframe.

References get_canvas(), get_time(), and set_time().

void CanvasInterface::seek_frame | ( | int | frames | ) |

References get_canvas(), get_time(), and set_time().

void CanvasInterface::seek_time | ( | synfig::Time | time | ) |

References get_canvas(), get_time(), and set_time().

void CanvasInterface::refresh_current_values | ( |  | ) |

Todo:
  This needs to be documented further.

References get_canvas(), signal_dirty_preview(), and signal_time_changed().

void CanvasInterface::set_mode | ( | Mode | x | ) |

Sets the current editing mode.

See also:
  Mode

References _, synfigapp::Action::create(), get_canvas(), get_instance(), and get_ui_interface().

Referenced by synfigapp::PushMode::PushMode(), and synfigapp::PushMode::~PushMode().

CanvasInterface::Mode CanvasInterface::get_mode | ( |  | ) | const

Retrieves the current editing mode.

See also:
  Mode

Layer::Handle CanvasInterface::add_layer_to | ( | synfig::String | id,
|  | synfig::Canvas::Handle | canvas,
|  | int | depth = `0` |
| ) |  |  |

Creates a new layer, of type `id` at the top of the layer stack.

References _, add_value_node(), synfigapp::Action::create(), synfigapp::Main::get_blend_method(), synfigapp::Main::get_bline_width(), get_canvas(), synfigapp::Main::get_fill_color(), synfigapp::Main::get_gradient(), get_instance(), synfigapp::Main::get_opacity(), synfigapp::Main::get_outline_color(), and get_ui_interface().

Referenced by import().

bool CanvasInterface::convert | ( | ValueDesc | value_desc,
|  | synfig::String | type |
| ) |  |  |

References _, synfigapp::Action::create(), get_canvas(), get_instance(), get_time(), and get_ui_interface().

Referenced by studio::Instance::make_param_menu().

bool CanvasInterface::add_value_node | ( | synfig::ValueNode::Handle | value_node,
|  | synfig::String | name |
| ) |  |  |

Adds the given ValueNode to the canvas.

References _, synfigapp::Action::create(), get_canvas(), get_instance(), and get_ui_interface().

Referenced by add_layer_to().

Action::ParamList CanvasInterface::generate_param_list | ( | const synfigapp::ValueDesc & | value_desc | ) |

References synfigapp::Action::ParamList::add(), get_canvas(), synfigapp::ValueDesc::get_layer(), synfigapp::ValueDesc::get_param_name(), synfigapp::ValueDesc::get_parent_value_node(), get_selection_manager(), get_time(), synfigapp::ValueDesc::get_value(), synfigapp::ValueDesc::get_value_node(), synfigapp::ValueDesc::get_value_type(), synfigapp::ValueDesc::is_const(), synfigapp::ValueDesc::is_value_node(), synfigapp::ValueDesc::parent_is_canvas(), synfigapp::ValueDesc::parent_is_layer_param(), and synfigapp::ValueDesc::parent_is_value_node().

Action::ParamList CanvasInterface::generate_param_list | ( | const std::list< synfigapp::ValueDesc > & | value_desc_list | ) |

References synfigapp::Action::ParamList::add(), get_canvas(), and get_time().

void CanvasInterface::set_rend_desc | ( | const synfig::RendDesc & | rend_desc | ) |

References _, synfigapp::Action::create(), get_canvas(), get_instance(), and get_ui_interface().

bool CanvasInterface::import | ( | const synfig::String & | filename,
|  | synfig::String & | errors,
|  | synfig::String & | warnings,
|  | bool | resize_image = `false` |
| ) |  |  |

References _, add_layer_to(), synfigapp::Action::book(), synfigapp::Action::PassiveGrouper::cancel(), get_canvas(), get_instance(), get_ui_interface(), and signal_layer_new_description().

void CanvasInterface::waypoint_duplicate | ( | synfigapp::ValueDesc | value_desc,
|  | synfig::Waypoint | waypoint |
| ) |  |  |

References synfigapp::ValueDesc::get_value_node().

void synfigapp::CanvasInterface::waypoint_duplicate | ( | synfig::ValueNode::Handle | value_node,
|  | synfig::Waypoint | waypoint |
| ) |  |  |

void CanvasInterface::waypoint_remove | ( | synfigapp::ValueDesc | value_desc,
|  | synfig::Waypoint | waypoint |
| ) |  |  |

References synfigapp::ValueDesc::get_value_node().

void synfigapp::CanvasInterface::waypoint_remove | ( | synfig::ValueNode::Handle | value_node,
|  | synfig::Waypoint | waypoint |
| ) |  |  |

bool CanvasInterface::change_value | ( | synfigapp::ValueDesc | value_desc,
|  | synfig::ValueBase | new_value |
| ) |  |  |

References _, synfigapp::Action::create(), synfigapp::find_instance(), get_canvas(), synfigapp::ValueDesc::get_canvas(), get_instance(), get_time(), get_ui_interface(), and synfigapp::ValueDesc::get_value().

Referenced by studio::Dock_Layers::init_canvas_view_vfunc().

int CanvasInterface::find_important_value_descs | ( | std::vector< synfigapp::ValueDesc > & | out | ) |

References get_canvas().

Referenced by _process_value_desc().

int CanvasInterface::find_important_value_descs | ( | synfig::Canvas::Handle | canvas,
|  | std::vector< synfigapp::ValueDesc > & | out,
|  | synfig::GUIDSet & | guid_set |
| ) |  |  | `[static]`

References _process_value_desc().

etl::handle< CanvasInterface > CanvasInterface::create | ( | etl::loose_handle< Instance > | instance,
|  | etl::handle< synfig::Canvas > | canvas |
| ) |  |  | `[static]`

## Friends And Related Function Documentation

friend class Instance `[friend]`

friend class Action::EditModeSet `[friend]`

The documentation for this class was generated from the following files:

- canvasinterface.h
- canvasinterface.cpp