# studio::Instance Class Reference

`#include <instance.h>`

Inheritance diagram for studio::Instance:

List of all members.

## Public Types

enum | Status { STATUS_OK, STATUS_ERROR, STATUS_CANCEL }
typedef std::list< etl::handle < CanvasView > > | CanvasViewList

## Public Member Functions

sigc::signal< void > & | signal_undo_redo_status_changed ()
| ~Instance ()
sigc::signal< void, CanvasView * > & | signal_canvas_view_created ()
sigc::signal< void, CanvasView * > & | signal_canvas_view_deleted ()
bool | get_undo_status () const
bool | get_redo_status () const
int | get_visible_canvases () const
Glib::RefPtr< Gtk::TreeStore > | canvas_tree_store ()
Glib::RefPtr< const Gtk::TreeStore > | canvas_tree_store () const
Glib::RefPtr< HistoryTreeStore > | history_tree_store ()
Glib::RefPtr< const HistoryTreeStore > | history_tree_store () const
etl::handle< CanvasView > | find_canvas_view (etl::handle< synfig::Canvas > canvas)
void | focus (etl::handle< synfig::Canvas > canvas)
| Sets the focus to a specific canvas.
CanvasViewList & | canvas_view_list ()
const CanvasViewList & | canvas_view_list () const
bool | save_as (const synfig::String &filename)
bool | has_real_filename ()
| returns true if the instance has a real filename associated with it, rather than the made up "synfig animation 1" or some such
bool | dialog_save_as ()
void | open ()
Status | save ()
void | dialog_cvs_commit ()
void | dialog_cvs_add ()
void | dialog_cvs_update ()
void | dialog_cvs_revert ()
void | close ()
| Closes the instance of this composition.
void | revert ()
void | update_all_titles ()
void | refresh_canvas_tree ()
bool | safe_revert ()
bool | safe_close ()
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, synfig::String &ui_info, const synfigapp::Action::ParamList &param_list, synfigapp::Action::Category category=synfigapp::Action::CATEGORY_ALL) const
void | process_action (synfig::String name, synfigapp::Action::ParamList param_list)
void | make_param_menu (Gtk::Menu *menu, synfig::Canvas::Handle canvas, synfigapp::ValueDesc value_desc, float location=0.5f, bool bezier=false)
void | make_param_menu (Gtk::Menu *menu, synfig::Canvas::Handle canvas, const std::list< synfigapp::ValueDesc > &value_desc_list)

## Static Public Member Functions

static int | get_count ()
| Returns the number of instances that are currently open in the program.
static void | edit_waypoint (synfigapp::ValueDesc value_desc, synfig::Waypoint waypoint)
static etl::handle< Instance > | create (synfig::Canvas::Handle canvas)

## Public Attributes

studio::Instance::CanvasTreeModel | canvas_tree_model

## Protected Member Functions

| Instance (synfig::Canvas::Handle)

## Classes

class | CanvasTreeModel

## Member Typedef Documentation

typedef std::list< etl::handle<CanvasView> > studio::Instance::CanvasViewList

## Member Enumeration Documentation

enum studio::Instance::Status

Enumerator:

  STATUS_OK |
  STATUS_ERROR |
  STATUS_CANCEL |

## Constructor & Destructor Documentation

Instance::Instance | ( | synfig::Canvas::Handle | canvas | ) | `[protected]`

References studio::AutoRecover::auto_backup(), canvas_tree_model, synfigapp::Action::create(), refresh_canvas_tree(), synfigapp::Instance::signal_filename_changed(), synfigapp::Action::System::signal_redo_status(), synfigapp::Instance::signal_saved(), synfigapp::Action::System::signal_undo_status(), synfigapp::Action::System::signal_unsaved_status_changed(), and update_all_titles().

Referenced by create().

Instance::~Instance | ( |  | ) |

Reimplemented from synfigapp::Instance.

## Member Function Documentation

sigc::signal<void>& studio::Instance::signal_undo_redo_status_changed | ( |  | ) | `[inline]`

sigc::signal<void,CanvasView*>& studio::Instance::signal_canvas_view_created | ( |  | ) | `[inline]`

sigc::signal<void,CanvasView*>& studio::Instance::signal_canvas_view_deleted | ( |  | ) | `[inline]`

bool studio::Instance::get_undo_status | ( |  | ) | const`[inline]`

bool studio::Instance::get_redo_status | ( |  | ) | const`[inline]`

int Instance::get_visible_canvases | ( |  | ) | const

Glib::RefPtr<Gtk::TreeStore> studio::Instance::canvas_tree_store | ( |  | ) | `[inline]`

Referenced by refresh_canvas_tree().

Glib::RefPtr<const Gtk::TreeStore> studio::Instance::canvas_tree_store | ( |  | ) | const`[inline]`

Glib::RefPtr<HistoryTreeStore> studio::Instance::history_tree_store | ( |  | ) | `[inline]`

Glib::RefPtr<const HistoryTreeStore> studio::Instance::history_tree_store | ( |  | ) | const`[inline]`

static int studio::Instance::get_count | ( |  | ) | `[inline, static]`

Returns the number of instances that are currently open in the program.

Referenced by studio::App::new_instance().

handle< CanvasView > Instance::find_canvas_view | ( | etl::handle< synfig::Canvas > | canvas | ) |

References canvas_view_list(), and synfigapp::Action::create().

Referenced by focus(), make_param_menu(), and safe_close().

void Instance::focus | ( | etl::handle< synfig::Canvas > | canvas | ) |

Sets the focus to a specific canvas.

References find_canvas_view().

CanvasViewList& studio::Instance::canvas_view_list | ( |  | ) | `[inline]`

Referenced by close(), find_canvas_view(), save_as(), and update_all_titles().

const CanvasViewList& studio::Instance::canvas_view_list | ( |  | ) | const`[inline]`

bool studio::Instance::save_as | ( | const synfig::String & | filename | ) |

Reimplemented from synfigapp::Instance.

References canvas_view_list(), and synfigapp::Instance::save_as().

Referenced by dialog_save_as().

bool studio::Instance::has_real_filename | ( |  | ) |

returns true if the instance has a real filename associated with it, rather than the made up "synfig animation 1" or some such

References studio::App::custom_filename_prefix, and synfigapp::Instance::get_file_name().

Referenced by dialog_save_as(), and save().

bool studio::Instance::dialog_save_as | ( |  | ) |

Opens a "Save As" dialog, and then saves the composition to that file returns true if the save was successful

References _, ANIMATION_DIR_PREFERENCE, studio::App::dialog_error_blocking(), studio::App::dialog_save_file(), studio::App::dialog_yes_no(), synfigapp::Instance::get_canvas(), synfigapp::Instance::get_file_name(), has_real_filename(), and save_as().

Referenced by save().

void studio::Instance::open | ( |  | ) |

References studio::App::dialog_open(), and synfigapp::Instance::get_file_name().

Instance::Status studio::Instance::save | ( |  | ) |

References _, studio::App::dialog_error_blocking(), dialog_save_as(), synfigapp::Instance::get_file_name(), has_real_filename(), synfigapp::Instance::save(), STATUS_CANCEL, STATUS_ERROR, and STATUS_OK.

Referenced by dialog_cvs_commit(), dialog_cvs_update(), and safe_close().

void Instance::dialog_cvs_commit | ( |  | ) |

References _, synfigapp::CVSInfo::calc_repository_info(), synfigapp::CVSInfo::cvs_commit(), studio::App::dialog_entry(), studio::App::dialog_error_blocking(), studio::App::dialog_yes_no(), synfigapp::Action::System::get_action_count(), synfigapp::CVSInfo::in_repository(), synfigapp::CVSInfo::is_modified(), save(), and update_all_titles().

Referenced by safe_close().

void Instance::dialog_cvs_add | ( |  | ) |

References _, synfigapp::CVSInfo::calc_repository_info(), synfigapp::CVSInfo::cvs_add(), studio::App::dialog_error_blocking(), synfigapp::CVSInfo::in_repository(), and update_all_titles().

void Instance::dialog_cvs_update | ( |  | ) |

References _, synfigapp::CVSInfo::calc_repository_info(), synfigapp::CVSInfo::cvs_update(), studio::App::dialog_error_blocking(), studio::App::dialog_yes_no(), synfigapp::Action::System::get_action_count(), synfigapp::Instance::get_file_name(), synfigapp::CVSInfo::get_original_timestamp(), synfigapp::CVSInfo::in_repository(), synfigapp::CVSInfo::is_updated(), revert(), and save().

void Instance::dialog_cvs_revert | ( |  | ) |

References _, synfigapp::CVSInfo::calc_repository_info(), synfigapp::CVSInfo::cvs_update(), studio::App::dialog_error_blocking(), studio::App::dialog_yes_no(), synfigapp::Instance::get_file_name(), synfigapp::CVSInfo::in_repository(), and revert().

void Instance::close | ( |  | ) |

Closes the instance of this composition.

References studio::App::auto_recover, canvas_view_list(), studio::AutoRecover::clear_backup(), synfigapp::Instance::get_canvas(), studio::App::get_selected_instance(), studio::App::instance_list, studio::App::set_selected_canvas_view(), studio::App::set_selected_instance(), and studio::App::signal_instance_deleted().

Referenced by safe_close().

void Instance::revert | ( |  | ) |

Referenced by dialog_cvs_revert(), dialog_cvs_update(), and safe_revert().

void Instance::update_all_titles | ( |  | ) |

References canvas_view_list().

Referenced by dialog_cvs_add(), dialog_cvs_commit(), and Instance().

void Instance::refresh_canvas_tree | ( |  | ) |

References canvas_tree_store(), and synfigapp::Instance::get_canvas().

Referenced by Instance().

bool Instance::safe_revert | ( |  | ) |

References _, studio::App::dialog_yes_no(), synfigapp::Action::System::get_action_count(), and revert().

bool Instance::safe_close | ( |  | ) |

References _, close(), dialog_cvs_commit(), studio::App::dialog_error_blocking(), find_canvas_view(), synfigapp::Action::System::get_action_count(), synfigapp::Instance::get_canvas(), synfigapp::Instance::get_file_name(), synfigapp::CVSInfo::is_modified(), synfigapp::UIInterface::RESPONSE_CANCEL, synfigapp::UIInterface::RESPONSE_NO, synfigapp::UIInterface::RESPONSE_YES, save(), STATUS_CANCEL, and STATUS_OK.

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

References synfigapp::Action::CATEGORY_HIDDEN, synfigapp::Action::compile_candidate_list(), studio::get_action_stock_id(), and process_action().

Referenced by make_param_menu().

void Instance::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

References synfigapp::Action::CATEGORY_HIDDEN, synfigapp::Action::compile_candidate_list(), synfigapp::Action::CandidateList::find(), studio::get_action_stock_id(), and process_action().

void 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 = `synfigapp::Action::CATEGORY_ALL` |
| ) |  |  | const

References synfigapp::Action::CATEGORY_HIDDEN, synfigapp::Action::compile_candidate_list(), synfigapp::Action::create(), studio::get_action_stock_id(), and process_action().

void Instance::process_action | ( | synfig::String | name,
|  | synfigapp::Action::ParamList | param_list |
| ) |  |  |

References synfigapp::Action::book(), studio::App::dialog_entry(), synfigapp::Action::BookEntry::factory, synfigapp::Action::BookEntry::get_param_vocab, synfigapp::Action::BookEntry::local_name, synfigapp::Action::System::perform_action(), and synfigapp::Action::Param::TYPE_STRING.

Referenced by add_actions_to_group(), and add_actions_to_menu().

void Instance::make_param_menu | ( | Gtk::Menu * | menu,
|  | synfig::Canvas::Handle | canvas,
|  | synfigapp::ValueDesc | value_desc,
|  | float | location = `0.5f`,
|  | bool | bezier = `false` |
| ) |  |  |

References _, synfigapp::Action::ParamList::add(), add_actions_to_menu(), synfigapp::Action::book(), synfigapp::Action::CATEGORY_BEZIER, synfigapp::Action::CATEGORY_VALUEDESC, synfigapp::Action::CATEGORY_VALUENODE, synfigapp::CanvasInterface::convert(), synfigapp::Instance::find_canvas_interface(), find_canvas_view(), synfigapp::ValueDesc::get_layer(), synfigapp::ValueDesc::get_param_name(), synfigapp::ValueDesc::get_value_node(), synfigapp::ValueDesc::get_value_type(), synfigapp::ValueDesc::is_valid(), synfigapp::ValueDesc::is_value_node(), studio::CanvasView::on_waypoint_clicked_canvasview(), synfigapp::ValueDesc::parent_is_layer_param(), and synfigapp::ValueDesc::parent_is_value_node().

void Instance::make_param_menu | ( | Gtk::Menu * | menu,
|  | synfig::Canvas::Handle | canvas,
|  | const std::list< synfigapp::ValueDesc > & | value_desc_list |
| ) |  |  |

References _, add_actions_to_menu(), synfigapp::Action::CATEGORY_VALUEDESC, synfigapp::Action::CATEGORY_VALUENODE, edit_several_waypoints(), synfigapp::Instance::find_canvas_interface(), and find_canvas_view().

static void studio::Instance::edit_waypoint | ( | synfigapp::ValueDesc | value_desc,
|  | synfig::Waypoint | waypoint |
| ) |  |  | `[static]`

handle< Instance > Instance::create | ( | synfig::Canvas::Handle | canvas | ) | `[static]`

References studio::App::get_ui_interface(), Instance(), studio::App::instance_list, studio::App::set_selected_instance(), and studio::App::signal_instance_created().

Referenced by studio::App::open_as().

## Member Data Documentation

studio::Instance::CanvasTreeModel studio::Instance::canvas_tree_model

Referenced by Instance().

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

- gtkmm/instance.h
- gtkmm/instance.cpp