# studio::CanvasView Class Reference

`#include <canvasview.h>`

List of all members.

## Public Types

typedef etl::handle< CanvasView > | Handle
typedef etl::handle< const CanvasView > | ConstHandle
typedef etl::loose_handle < CanvasView > | LooseHandle
typedef LayerTreeStore::Model | LayerTreeModel
typedef ChildrenTreeStore::Model | ChildrenTreeModel
typedef synfigapp::CanvasInterface::Mode | Mode

## Public Member Functions

void | set_grid_snap_toggle (bool flag)
void | set_grid_show_toggle (bool flag)
WorkArea * | get_work_area ()
void | queue_rebuild_ducks ()
sigc::signal< void > & | signal_deleted ()
const synfig::TransformStack & | get_curr_transform_stack () const
const synfig::Rect & | get_bbox () const
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 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 synfig::String &x)
void | set_ext_widget (const synfig::String &x, Gtk::Widget *y)
void | popup_main_menu ()
Smach & | get_smach ()
const Smach & | get_smach () const
Smach::event_result | process_event_key (EventKey x)
void | popup_layer_menu (synfig::Layer::Handle layer)
virtual | ~CanvasView ()
void | set_mode (Mode x)
Mode | get_mode () const
Gtk::Adjustment & | time_adjustment ()
const Gtk::Adjustment & | time_adjustment () const
studio::Adjust_Window & | time_window_adjustment ()
const studio::Adjust_Window & | time_window_adjustment () const
etl::handle < synfigapp::UIInterface > | get_ui_interface ()
etl::handle < synfigapp::SelectionManager > | get_selection_manager ()
Glib::RefPtr< Gtk::TreeModel > | layer_tree_store ()
Glib::RefPtr< const Gtk::TreeModel > | layer_tree_store () const
Glib::RefPtr< Gtk::TreeModel > | children_tree_store ()
Glib::RefPtr< const Gtk::TreeModel > | children_tree_store () const
Glib::RefPtr< Gtk::TreeModel > | keyframe_tree_store ()
Glib::RefPtr< const Gtk::TreeModel > | keyframe_tree_store () const
void | set_time (synfig::Time t)
synfig::Time | get_time ()
etl::handle< synfig::Canvas > | get_canvas () const
etl::handle< Instance > | get_instance () const
etl::handle < synfigapp::CanvasInterface > | canvas_interface ()
etl::handle< const synfigapp::CanvasInterface > | canvas_interface () 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 | update_title ()
| Updates the title of the window.
bool | close_instance ()
| Closes this document.
bool | close_view ()
| Closes this canvas view.
void | stop ()
| Stops the currently executing action.
bool | get_cancel_status () const
| Returns the cancel status.
void | reset_cancel_status ()
| Resets the cancel status.
void | new_child_canvas ()
void | rebuild_tables ()
| Rebuilds layer_tree_store_ from the Canvas. Maintains selected items.
void | build_tables ()
| Builds layer_tree_store_ from the Canvas. Does not maintain selected items.
void | refresh_tables ()
| Refreshes the data for the tables.
void | rebuild_ducks ()
void | play ()
| Starts "playing" the animation in real-time.
void | show_tables ()
| Shows the tables (Layer/Children).
void | hide_tables ()
| Hides the tables (Layer/Children).
void | toggle_tables ()
| Toggles the tables.
bool | tables_are_visible ()
| Gets the table status.
void | show_timebar ()
| Shows the time bar.
void | hide_timebar ()
| Hides the time bar.
void | set_sensitive_timebar (bool sensitive)
void | time_zoom_in ()
void | time_zoom_out ()
void | add_layer (synfig::String x)
void | show_keyframe_dialog ()
void | play_audio (float t)
void | stop_audio ()
void | image_import ()
void | on_waypoint_clicked_canvasview (synfigapp::ValueDesc, std::set< synfig::Waypoint, std::less< synfig::UniqueID > >, int button)
void | preview_option ()
void | present ()
bool | is_playing ()
void | update_quality ()

## Static Public Member Functions

static etl::handle < studio::CanvasView > | create (etl::loose_handle< Instance > instance, etl::handle< synfig::Canvas > canvas)
static std::list< int > & | get_pixel_sizes ()

## Public Attributes

std::auto_ptr< WorkArea > | work_area
Gtk::Menu | mainmenu
bool | duck_refresh_flag
bool | duck_refresh_needed
int | working_depth
| This is for the IsWorking class.
bool | cancel
CanvasProperties | canvas_properties
CanvasOptions | canvas_options
RenderSettings | render_settings
Dialog_Waypoint | waypoint_dialog
Dialog_Keyframe | keyframe_dialog
std::auto_ptr< Dialog_Preview > | preview_dialog
std::auto_ptr< Dialog_SoundSelect > | sound_dialog

## Protected Member Functions

bool | close_instance_when_safe ()
bool | on_delete_event (GdkEventAny *event)

## Friends

class | UniversalScrubber
class | Dock_Layers
class | Dock_Children
class | Dock_Keyframes
class | CanvasViewUIInterface
class | CanvasViewSelectionManager
class | Duckmatic
class | IsWorking

## Classes

class | IsWorking
| Create an instance of this class whenever doing a longer task. More...

## Member Typedef Documentation

typedef etl::handle<CanvasView> studio::CanvasView::Handle

typedef etl::handle<const CanvasView> studio::CanvasView::ConstHandle

typedef etl::loose_handle<CanvasView> studio::CanvasView::LooseHandle

typedef LayerTreeStore::Model studio::CanvasView::LayerTreeModel

typedef ChildrenTreeStore::Model studio::CanvasView::ChildrenTreeModel

typedef synfigapp::CanvasInterface::Mode studio::CanvasView::Mode

## Constructor & Destructor Documentation

CanvasView::~CanvasView | ( |  | ) | `[virtual]`

References canvas_interface(), signal_deleted(), and studio::App::ui_manager().

## Member Function Documentation

void studio::CanvasView::set_grid_snap_toggle | ( | bool | flag | ) | `[inline]`

void studio::CanvasView::set_grid_show_toggle | ( | bool | flag | ) | `[inline]`

WorkArea* studio::CanvasView::get_work_area | ( |  | ) | `[inline]`

References work_area.

Referenced by close_instance().

void CanvasView::queue_rebuild_ducks | ( |  | ) |

References rebuild_ducks().

Referenced by rebuild_ducks().

sigc::signal<void>& studio::CanvasView::signal_deleted | ( |  | ) | `[inline]`

Referenced by ~CanvasView().

const synfig::TransformStack& studio::CanvasView::get_curr_transform_stack | ( |  | ) | const`[inline]`

const synfig::Rect& studio::CanvasView::get_bbox | ( |  | ) | const`[inline]`

Glib::RefPtr< Glib::ObjectBase > CanvasView::get_ref_obj | ( | const synfig::String & | x | ) |

Glib::RefPtr< const Glib::ObjectBase > CanvasView::get_ref_obj | ( | const synfig::String & | x | ) | const

void CanvasView::set_ref_obj | ( | const synfig::String & | x,
|  | Glib::RefPtr< Glib::ObjectBase > | y |
| ) |  |  |

Glib::RefPtr< Gtk::TreeModel > CanvasView::get_tree_model | ( | const synfig::String & | x | ) |

Referenced by children_tree_store(), keyframe_tree_store(), and layer_tree_store().

Glib::RefPtr< const Gtk::TreeModel > CanvasView::get_tree_model | ( | const synfig::String & | x | ) | const

void CanvasView::set_tree_model | ( | const synfig::String & | x,
|  | Glib::RefPtr< Gtk::TreeModel > | y |
| ) |  |  |

Gtk::Widget * CanvasView::get_ext_widget | ( | const synfig::String & | x | ) |

void CanvasView::set_ext_widget | ( | const synfig::String & | x,
|  | Gtk::Widget * | y |
| ) |  |  |

References studio::EVENT_LAYER_SELECTION_CHANGED, studio::EVENT_REFRESH_DUCKS, studio::ChildrenTree::get_selection(), studio::LayerTree::get_selection(), on_waypoint_clicked_canvasview(), studio::LayerTree::signal_layer_user_click(), studio::LayerTree::signal_param_user_click(), studio::ChildrenTree::signal_user_click(), studio::ChildrenTree::signal_waypoint_clicked_childrentree(), studio::LayerTree::signal_waypoint_clicked_layertree(), and SLOT_EVENT.

void CanvasView::popup_main_menu | ( |  | ) |

References studio::App::ui_manager().

Smach& studio::CanvasView::get_smach | ( |  | ) | `[inline]`

const Smach& studio::CanvasView::get_smach | ( |  | ) | const`[inline]`

Smach::event_result CanvasView::process_event_key | ( | EventKey | x | ) |

void CanvasView::popup_layer_menu | ( | synfig::Layer::Handle | layer | ) |

References _, synfigapp::Action::ParamList::add(), add_actions_to_menu(), canvas_interface(), synfigapp::Action::CATEGORY_LAYER, get_time(), and studio::LayerTree::select_all_children_layers().

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

void studio::CanvasView::set_mode | ( | Mode | x | ) | `[inline]`

References canvas_interface().

Mode studio::CanvasView::get_mode | ( |  | ) | const`[inline]`

References canvas_interface().

Gtk::Adjustment& studio::CanvasView::time_adjustment | ( |  | ) | `[inline]`

Referenced by play().

const Gtk::Adjustment& studio::CanvasView::time_adjustment | ( |  | ) | const`[inline]`

studio::Adjust_Window& studio::CanvasView::time_window_adjustment | ( |  | ) | `[inline]`

Referenced by play(), time_zoom_in(), and time_zoom_out().

const studio::Adjust_Window& studio::CanvasView::time_window_adjustment | ( |  | ) | const`[inline]`

etl::handle<synfigapp::UIInterface> studio::CanvasView::get_ui_interface | ( |  | ) | `[inline]`

References ui_interface_.

etl::handle<synfigapp::SelectionManager> studio::CanvasView::get_selection_manager | ( |  | ) | `[inline]`

Referenced by add_layer(), and rebuild_ducks().

Glib::RefPtr<Gtk::TreeModel> studio::CanvasView::layer_tree_store | ( |  | ) | `[inline]`

References get_tree_model().

Glib::RefPtr<const Gtk::TreeModel> studio::CanvasView::layer_tree_store | ( |  | ) | const`[inline]`

References get_tree_model().

Glib::RefPtr<Gtk::TreeModel> studio::CanvasView::children_tree_store | ( |  | ) | `[inline]`

References get_tree_model().

Glib::RefPtr<const Gtk::TreeModel> studio::CanvasView::children_tree_store | ( |  | ) | const`[inline]`

References get_tree_model().

Glib::RefPtr<Gtk::TreeModel> studio::CanvasView::keyframe_tree_store | ( |  | ) | `[inline]`

References get_tree_model().

Glib::RefPtr<const Gtk::TreeModel> studio::CanvasView::keyframe_tree_store | ( |  | ) | const`[inline]`

References get_tree_model().

void studio::CanvasView::set_time | ( | synfig::Time | t | ) | `[inline]`

synfig::Time studio::CanvasView::get_time | ( |  | ) | `[inline]`

Referenced by popup_layer_menu(), and rebuild_ducks().

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

Referenced by add_layer(), play(), rebuild_ducks(), time_zoom_in(), time_zoom_out(), and update_title().

etl::handle<Instance> studio::CanvasView::get_instance | ( |  | ) | const`[inline]`

Referenced by add_actions_to_menu(), close_instance(), close_view(), and update_title().

etl::handle<synfigapp::CanvasInterface> studio::CanvasView::canvas_interface | ( |  | ) | `[inline]`

Referenced by add_layer(), get_mode(), image_import(), popup_layer_menu(), set_mode(), and ~CanvasView().

etl::handle<const synfigapp::CanvasInterface> studio::CanvasView::canvas_interface | ( |  | ) | const`[inline]`

void CanvasView::add_actions_to_menu | ( | Gtk::Menu * | menu,
|  | const synfigapp::Action::ParamList & | param_list,
|  | synfigapp::Action::Category | category = `synfigapp::Action::CATEGORY_ALL` |
| ) |  |  | const

References get_instance().

Referenced by popup_layer_menu().

void CanvasView::update_title | ( |  | ) |

Updates the title of the window.

References _, get_canvas(), get_instance(), synfigapp::CVSInfo::in_repository(), synfigapp::CVSInfo::is_modified(), and synfigapp::CVSInfo::is_updated().

bool CanvasView::close_instance | ( |  | ) |

Closes this document.

References _close_instance(), get_instance(), and get_work_area().

Referenced by close_view().

bool CanvasView::close_view | ( |  | ) |

Closes this canvas view.

References close_instance(), and get_instance().

void studio::CanvasView::stop | ( |  | ) | `[inline]`

Stops the currently executing action.

See also:
  get_cancel_status(), reset_cancel_status(), IsWorking

References cancel.

bool studio::CanvasView::get_cancel_status | ( |  | ) | const`[inline]`

Returns the cancel status.

See also:
  stop(), reset_cancel_status(), IsWorking

References cancel.

Referenced by play().

void studio::CanvasView::reset_cancel_status | ( |  | ) | `[inline]`

Resets the cancel status.

See also:
  stop(), get_cancel_status(), IsWorking

References cancel.

void studio::CanvasView::new_child_canvas | ( |  | ) |

void CanvasView::rebuild_tables | ( |  | ) |

Rebuilds layer_tree_store_ from the Canvas. Maintains selected items.

void CanvasView::build_tables | ( |  | ) |

Builds layer_tree_store_ from the Canvas. Does not maintain selected items.

void CanvasView::refresh_tables | ( |  | ) |

Refreshes the data for the tables.

void CanvasView::rebuild_ducks | ( |  | ) |

Todo:
  This needs to be documented further.

References duck_refresh_flag, duck_refresh_needed, get_canvas(), get_selection_manager(), get_time(), queue_rebuild_ducks(), and work_area.

Referenced by queue_rebuild_ducks().

void CanvasView::play | ( |  | ) |

Starts "playing" the animation in real-time.

References get_cancel_status(), get_canvas(), time_adjustment(), time_window_adjustment(), work_area, and working_depth.

void CanvasView::show_tables | ( |  | ) |

Shows the tables (Layer/Children).

void CanvasView::hide_tables | ( |  | ) |

Hides the tables (Layer/Children).

void CanvasView::toggle_tables | ( |  | ) |

Toggles the tables.

bool CanvasView::tables_are_visible | ( |  | ) |

Gets the table status.

void CanvasView::show_timebar | ( |  | ) |

Shows the time bar.

References studio::ChildrenTree::set_show_timetrack(), and studio::LayerTree::set_show_timetrack().

void CanvasView::hide_timebar | ( |  | ) |

Hides the time bar.

References studio::ChildrenTree::set_show_timetrack(), and studio::LayerTree::set_show_timetrack().

void CanvasView::set_sensitive_timebar | ( | bool | sensitive | ) |

void CanvasView::time_zoom_in | ( |  | ) |

References get_canvas(), and time_window_adjustment().

void CanvasView::time_zoom_out | ( |  | ) |

References get_canvas(), and time_window_adjustment().

void CanvasView::add_layer | ( | synfig::String | x | ) |

References canvas_interface(), get_canvas(), and get_selection_manager().

void CanvasView::show_keyframe_dialog | ( |  | ) |

References studio::KeyframeTreeStore::Model::keyframe, keyframe_dialog, studio::KeyframeTree::model, and studio::Dialog_Keyframe::set_keyframe().

void CanvasView::play_audio | ( | float | t | ) |

void CanvasView::stop_audio | ( |  | ) |

void CanvasView::image_import | ( |  | ) |

References _, canvas_interface(), studio::App::dialog_open_file(), studio::App::dialog_warning_blocking(), IMAGE_DIR_PREFERENCE, and studio::App::resize_imported_images.

void studio::CanvasView::on_waypoint_clicked_canvasview | ( | synfigapp::ValueDesc | ,
|  | std::set< synfig::Waypoint, std::less< synfig::UniqueID > > | ,
|  | int | button |
| ) |  |  |

Referenced by studio::Dock_Timetrack::init_canvas_view_vfunc(), studio::Instance::make_param_menu(), and set_ext_widget().

void studio::CanvasView::preview_option | ( |  | ) | `[inline]`

void CanvasView::present | ( |  | ) |

bool studio::CanvasView::is_playing | ( |  | ) | `[inline]`

void CanvasView::update_quality | ( |  | ) |

References work_area.

bool studio::CanvasView::close_instance_when_safe | ( |  | ) | `[protected]`

bool studio::CanvasView::on_delete_event | ( | GdkEventAny * | event | ) | `[protected]`

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

std::list< int > & CanvasView::get_pixel_sizes | ( |  | ) | `[static]`

Referenced by init_ui_manager().

## Friends And Related Function Documentation

friend class UniversalScrubber`[friend]`

friend class Dock_Layers `[friend]`

friend class Dock_Children `[friend]`

friend class Dock_Keyframes `[friend]`

friend class CanvasViewUIInterface`[friend]`

friend class CanvasViewSelectionManager`[friend]`

friend class Duckmatic `[friend]`

friend class IsWorking `[friend]`

## Member Data Documentation

std::auto_ptr<WorkArea> studio::CanvasView::work_area

Referenced by get_work_area(), play(), rebuild_ducks(), and update_quality().

Gtk::Menu studio::CanvasView::mainmenu

bool studio::CanvasView::duck_refresh_flag

Referenced by rebuild_ducks().

bool studio::CanvasView::duck_refresh_needed

Referenced by rebuild_ducks().

int studio::CanvasView::working_depth

This is for the IsWorking class.

Referenced by studio::CanvasView::IsWorking::IsWorking(), play(), and studio::CanvasView::IsWorking::~IsWorking().

bool studio::CanvasView::cancel

Referenced by get_cancel_status(), studio::CanvasView::IsWorking::IsWorking(), studio::CanvasView::IsWorking::operator bool(), reset_cancel_status(), and stop().

CanvasProperties studio::CanvasView::canvas_properties

CanvasOptions studio::CanvasView::canvas_options

RenderSettings studio::CanvasView::render_settings

Dialog_Waypoint studio::CanvasView::waypoint_dialog

Dialog_Keyframe studio::CanvasView::keyframe_dialog

Referenced by show_keyframe_dialog().

std::auto_ptr<Dialog_Preview> studio::CanvasView::preview_dialog

std::auto_ptr<Dialog_SoundSelect> studio::CanvasView::sound_dialog

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

- canvasview.h
- canvasview.cpp