# studio::App Class Reference

`#include <app.h>`

Inheritance diagram for studio::App:

List of all members.

## Public Member Functions

| App (int *argc, char ***argv)
virtual | ~App ()

## Static Public Member Functions

static DockManager * | get_dock_manager ()
static sigc::signal< void > & | signal_present_all ()
static sigc::signal< void > & | signal_recent_files_changed ()
static sigc::signal< void, etl::loose_handle< CanvasView > > & | signal_canvas_view_focus ()
static sigc::signal< void, etl::handle< Instance > > & | signal_instance_selected ()
static sigc::signal< void, etl::handle< Instance > > & | signal_instance_created ()
static sigc::signal< void, etl::handle< Instance > > & | signal_instance_deleted ()
static StateManager * | get_state_manager ()
static Glib::RefPtr< UIManager > & | ui_manager ()
static void | set_recent_file_window_size (etl::handle< Instance > instance)
| set the instance's canvas(es) position and size to be those specified in the first entry of recent_files_window_size
static void | add_recent_file (const etl::handle< Instance > instance)
static synfig::String | get_base_path ()
static void | save_settings ()
static void | load_settings ()
static void | reset_initial_window_configuration ()
static const std::list < std::string > & | get_recent_files ()
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< synfig::Canvas > canvas)
static etl::loose_handle < Instance > | get_selected_instance ()
static etl::loose_handle < CanvasView > | get_selected_canvas_view ()
static bool | open (std::string filename)
static bool | open_as (std::string filename, std::string as)
static void | new_instance ()
static void | dialog_open (std::string filename="")
static void | dialog_about ()
static void | quit ()
static void | show_setup ()
static void | undo ()
static void | redo ()
static int | get_max_recent_files ()
static void | set_max_recent_files (int x)
static synfig::Time::Format | get_time_format ()
static void | set_time_format (synfig::Time::Format x)
static bool | shutdown_request (GdkEventAny *bleh=NULL)
static bool | dialog_open_file (const std::string &title, std::string &filename, std::string preference)
static bool | dialog_save_file (const std::string &title, std::string &filename, std::string preference)
static void | dialog_error_blocking (const std::string &title, const std::string &message)
static void | dialog_warning_blocking (const std::string &title, const std::string &message)
static bool | dialog_entry (const std::string &title, const std::string &message, std::string &text)
static bool | dialog_paragraph (const std::string &title, const std::string &message, std::string &text)
static bool | dialog_yes_no (const std::string &title, const std::string &message)
static int | dialog_yes_no_cancel (const std::string &title, const std::string &message)
static void | dialog_not_implemented ()
static void | dialog_help ()
static void | open_url (const std::string &url)
static synfig::String | get_user_app_directory ()
static synfig::String | get_config_file (const synfig::String &file)

## Static Public Attributes

static Gtk::InputDialog * | dialog_input
static DeviceTracker * | device_tracker = 0
static AutoRecover * | auto_recover = NULL
static DockManager * | dock_manager = 0
static Dialog_Setup * | dialog_setup
static Dialog_Gradient * | dialog_gradient
static Dialog_Color * | dialog_color
static Dialog_ToolOptions * | dialog_tool_options
static synfig::Distance::System | distance_system
static synfig::Gamma | gamma
static About * | about = NULL
static Toolbox * | toolbox = NULL
static std::list< etl::handle < Instance > > | instance_list
static bool | shutdown_in_progress
static bool | use_colorspace_gamma = true
static bool | restrict_radius_ducks = false
static bool | resize_imported_images = false
static synfig::String | browser_command
static synfig::String | custom_filename_prefix
static int | preferred_x_size = 480
static int | preferred_y_size = 270
static synfig::String | predefined_size
static synfig::String | predefined_fps
static float | preferred_fps = 24.0

## Friends

class | Preferences
class | Dialog_Setup

## Classes

struct | Busy

## Constructor & Destructor Documentation

App::App | ( | int * | argc,
|  | char *** | argv |
| ) |  |  |

References _, about, studio::StateManager::add_state(), app_base_path_, auto_recover, synfigapp::Action::create(), device_tracker, dialog_color, dialog_error_blocking(), dialog_gradient, dialog_input, dialog_setup, dialog_tool_options, distance_system, dock_manager, studio::Splash::get_callback(), get_ui_interface(), get_user_app_directory(), init_ui_manager(), studio::DeviceTracker::load_preferences(), load_settings(), module_list_, new_instance(), open(), studio::AutoRecover::recover(), studio::AutoRecover::recovery_needed(), studio::DockManager::register_dockable(), synfigapp::UIInterface::RESPONSE_OK, studio::DeviceTracker::save_preferences(), synfigapp::Main::settings(), shutdown_in_progress, studio::state_bline, studio::state_circle, studio::state_draw, studio::state_eyedrop, studio::state_fill, studio::state_gradient, studio::state_normal, studio::state_polygon, studio::state_rectangle, studio::state_rotate, studio::state_scale, studio::state_sketch, studio::state_smooth_move, studio::state_star, studio::state_text, studio::state_width, studio::state_zoom, toolbox, and ui_interface_.

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

References about, auto_recover, dialog_color, dialog_gradient, dialog_input, dialog_setup, dock_manager, instance_list, module_list_, save_settings(), synfigapp::Main::settings(), shutdown_in_progress, and toolbox.

## Member Function Documentation

static DockManager* studio::App::get_dock_manager | ( |  | ) | `[inline, static]`

References dock_manager.

Referenced by studio::ModPalette::start_vfunc(), and studio::ModPalette::stop_vfunc().

sigc::signal< void > & App::signal_present_all | ( |  | ) | `[static]`

References signal_present_all_.

Referenced by studio::DockDialog::DockDialog(), studio::IPC::process_command(), and studio::Toolbox::Toolbox().

sigc::signal< void > & App::signal_recent_files_changed | ( |  | ) | `[static]`

References signal_recent_files_changed_.

Referenced by studio::Toolbox::Toolbox().

sigc::signal< void, etl::loose_handle< CanvasView > > & App::signal_canvas_view_focus | ( |  | ) | `[static]`

References signal_canvas_view_focus_.

Referenced by set_selected_canvas_view().

sigc::signal< void, etl::handle< Instance > > & App::signal_instance_selected | ( |  | ) | `[static]`

References signal_instance_selected_.

Referenced by studio::CompView::CompView(), studio::Dock_Canvases::Dock_Canvases(), studio::Dock_History::Dock_History(), set_selected_canvas_view(), set_selected_instance(), studio::Toolbox::Toolbox(), and studio::Widget_CompSelect::Widget_CompSelect().

sigc::signal< void, etl::handle< Instance > > & App::signal_instance_created | ( |  | ) | `[static]`

References signal_instance_created_.

Referenced by studio::CompView::CompView(), studio::Instance::create(), studio::Dock_Canvases::Dock_Canvases(), studio::Dock_CanvasSpecific::Dock_CanvasSpecific(), and studio::Widget_CompSelect::Widget_CompSelect().

sigc::signal< void, etl::handle< Instance > > & App::signal_instance_deleted | ( |  | ) | `[static]`

References signal_instance_deleted_.

Referenced by studio::Instance::close(), studio::CompView::CompView(), studio::Dock_Canvases::Dock_Canvases(), studio::Dock_History::Dock_History(), and studio::Widget_CompSelect::Widget_CompSelect().

StateManager * App::get_state_manager | ( |  | ) | `[static]`

Referenced by studio::ModMirror::start_vfunc().

static Glib::RefPtr<UIManager>& studio::App::ui_manager | ( |  | ) | `[inline, static]`

Referenced by studio::StateManager::add_state(), studio::Dialog_Color::Dialog_Color(), studio::Dialog_Gradient::Dialog_Gradient(), studio::Dock_History::Dock_History(), studio::Dock_Keyframes::Dock_Keyframes(), studio::Dock_LayerGroups::Dock_LayerGroups(), studio::Dock_Layers::Dock_Layers(), studio::Dock_PalEdit::Dock_PalEdit(), studio::DockDialog::DockDialog(), init_ui_manager(), studio::CanvasView::popup_main_menu(), studio::StateManager::StateManager(), studio::Toolbox::Toolbox(), studio::CanvasView::~CanvasView(), and studio::StateManager::~StateManager().

void App::set_recent_file_window_size | ( | etl::handle< Instance > | instance | ) | `[static]`

set the instance's canvas(es) position and size to be those specified in the first entry of recent_files_window_size

References recent_files_window_size, and SCALE_FACTOR.

Referenced by open_as().

void App::add_recent_file | ( | const etl::handle< Instance > | instance | ) | `[static]`

References SCALE_FACTOR.

synfig::String studio::App::get_base_path | ( |  | ) | `[static]`

References app_base_path_.

Referenced by studio::About::About(), and studio::Splash::Splash().

void App::save_settings | ( |  | ) | `[static]`

References get_config_file(), recent_files, recent_files_window_size, and synfigapp::Main::settings().

Referenced by studio::AutoRecover::auto_backup(), and ~App().

void App::load_settings | ( |  | ) | `[static]`

References gamma, get_config_file(), recent_files, recent_files_window_size, reset_initial_window_configuration(), and synfigapp::Main::settings().

Referenced by App().

void App::reset_initial_window_configuration | ( |  | ) | `[static]`

References DEFAULT_FILENAME_PREFIX, DEFAULT_PREDEFINED_FPS, DEFAULT_PREDEFINED_SIZE, and synfigapp::Main::settings().

Referenced by load_settings(), and studio::Toolbox::Toolbox().

const std::list< std::string > & App::get_recent_files | ( |  | ) | `[static]`

References recent_files.

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

References ui_interface_.

Referenced by App(), studio::Instance::create(), and quit().

void App::set_selected_instance | ( | etl::loose_handle< Instance > | instance | ) | `[static]`

References get_instance(), get_selected_canvas_view(), set_selected_canvas_view(), and signal_instance_selected().

Referenced by studio::Instance::close(), studio::Instance::create(), studio::CompView::new_instance(), studio::Widget_CompSelect::refresh(), and studio::CompView::refresh_instances().

void App::set_selected_canvas_view | ( | etl::loose_handle< CanvasView > | canvas_view | ) | `[static]`

References signal_canvas_view_focus(), and signal_instance_selected().

Referenced by studio::Instance::close(), and set_selected_instance().

etl::loose_handle< Instance > App::get_instance | ( | etl::handle< synfig::Canvas > | canvas | ) | `[static]`

References instance_list.

Referenced by open_as(), and set_selected_instance().

static etl::loose_handle<Instance> studio::App::get_selected_instance | ( |  | ) | `[inline, static]`

Referenced by studio::Instance::close(), close_selected_instance(), save_as_selected_instance(), save_selected_instance(), studio::Toolbox::update_undo_redo(), and studio::Dock_History::update_undo_redo().

static etl::loose_handle<CanvasView> studio::App::get_selected_canvas_view | ( |  | ) | `[inline, static]`

Referenced by studio::Toolbox::change_state(), studio::Dock_CanvasSpecific::get_canvas_view(), set_selected_instance(), and studio::Toolbox::update_undo_redo().

bool App::open | ( | std::string | filename | ) | `[static]`

References open_as().

Referenced by App(), and studio::IPC::process_command().

bool App::open_as | ( | std::string | filename,
|  | std::string | as |
| ) |  |  | `[static]`

References _, studio::Instance::create(), custom_filename_prefix, dialog_error_blocking(), dialog_warning_blocking(), dialog_yes_no(), get_instance(), and set_recent_file_window_size().

Referenced by open(), and studio::AutoRecover::recover().

void App::new_instance | ( |  | ) | `[static]`

References synfigapp::Action::create(), custom_filename_prefix, DPI2DPM, studio::Instance::get_count(), preferred_fps, preferred_x_size, and preferred_y_size.

Referenced by App(), studio::IPC::process_command(), and studio::Toolbox::Toolbox().

static void studio::App::dialog_open | ( | std::string | filename = `""` | ) | `[static]`

Referenced by studio::Instance::open(), and studio::Toolbox::Toolbox().

void App::dialog_about | ( |  | ) | `[static]`

References about.

Referenced by studio::Toolbox::Toolbox().

void App::quit | ( |  | ) | `[static]`

References _, auto_recover, studio::App::Busy::count, dialog_error_blocking(), get_ui_interface(), instance_list, studio::AutoRecover::normal_shutdown(), and shutdown_in_progress.

Referenced by studio::IPC::process_command(), shutdown_request(), and studio::Toolbox::Toolbox().

void App::show_setup | ( |  | ) | `[static]`

References dialog_setup, and studio::Dialog_Setup::refresh().

Referenced by studio::Toolbox::Toolbox().

void studio::App::undo | ( |  | ) | `[static]`

Referenced by studio::Dock_History::Dock_History(), and studio::Toolbox::Toolbox().

void studio::App::redo | ( |  | ) | `[static]`

Referenced by studio::Dock_History::Dock_History(), and studio::Toolbox::Toolbox().

int studio::App::get_max_recent_files | ( |  | ) | `[static]`

References max_recent_files_.

Referenced by studio::Dialog_Setup::refresh().

void studio::App::set_max_recent_files | ( | int | x | ) | `[static]`

References max_recent_files_.

Time::Format App::get_time_format | ( |  | ) | `[static]`

References _App_time_format().

Referenced by studio::Widget_Time::on_focus_in_event(), studio::Widget_Timeslider::redraw(), studio::Dialog_Setup::refresh(), studio::Widget_Time::refresh_text(), studio::CellRenderer_ValueBase::render_vfunc(), studio::CellRenderer_Time::render_vfunc(), and studio::CellRenderer_Time::start_editing_vfunc().

void App::set_time_format | ( | synfig::Time::Format | x | ) | `[static]`

References _App_time_format().

bool App::shutdown_request | ( | GdkEventAny * | bleh = `NULL` | ) | `[static]`

References quit().

Referenced by studio::Toolbox::Toolbox().

bool App::dialog_open_file | ( | const std::string & | title,
|  | std::string & | filename,
|  | std::string | preference |
| ) |  |  | `[static]`

References toolbox.

Referenced by studio::CanvasView::image_import().

bool App::dialog_save_file | ( | const std::string & | title,
|  | std::string & | filename,
|  | std::string | preference |
| ) |  |  | `[static]`

References _, ANIMATION_DIR_PREFERENCE, studio::Widget_Enum::get_value(), studio::Widget_Enum::set_param_desc(), studio::Widget_Enum::set_value(), and toolbox.

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

void App::dialog_error_blocking | ( | const std::string & | title,
|  | const std::string & | message |
| ) |  |  | `[static]`

Referenced by App(), studio::Instance::dialog_cvs_add(), studio::Instance::dialog_cvs_commit(), studio::Instance::dialog_cvs_revert(), studio::Instance::dialog_cvs_update(), studio::Instance::dialog_save_as(), open_as(), quit(), studio::Instance::safe_close(), studio::Instance::save(), and studio::LayerParamTreeStore::set_value_impl().

void App::dialog_warning_blocking | ( | const std::string & | title,
|  | const std::string & | message |
| ) |  |  | `[static]`

Referenced by studio::CanvasView::image_import(), and open_as().

bool App::dialog_entry | ( | const std::string & | title,
|  | const std::string & | message,
|  | std::string & | text |
| ) |  |  | `[static]`

Referenced by studio::Instance::dialog_cvs_commit(), and studio::Instance::process_action().

bool App::dialog_paragraph | ( | const std::string & | title,
|  | const std::string & | message,
|  | std::string & | text |
| ) |  |  | `[static]`

References synfigapp::Action::create().

bool App::dialog_yes_no | ( | const std::string & | title,
|  | const std::string & | message |
| ) |  |  | `[static]`

Referenced by studio::Dock_History::clear_redo(), studio::Dock_History::clear_undo(), studio::Dock_History::clear_undo_and_redo(), studio::Instance::dialog_cvs_commit(), studio::Instance::dialog_cvs_revert(), studio::Instance::dialog_cvs_update(), studio::Instance::dialog_save_as(), open_as(), and studio::Instance::safe_revert().

int App::dialog_yes_no_cancel | ( | const std::string & | title,
|  | const std::string & | message |
| ) |  |  | `[static]`

void App::dialog_not_implemented | ( |  | ) | `[static]`

References _.

void App::dialog_help | ( |  | ) | `[static]`

References _, and try_open_url().

Referenced by studio::Toolbox::Toolbox().

void App::open_url | ( | const std::string & | url | ) | `[static]`

References _, and try_open_url().

Referenced by studio::About::on_link_clicked().

String App::get_user_app_directory | ( |  | ) | `[static]`

Todo:
  do we need locale_from_utf8() on non-Windows boxes too? (bug #1837445)

References SYNFIG_USER_APP_DIR.

Referenced by App(), studio::IPC::fifo_path(), get_config_file(), and studio::AutoRecover::get_shadow_directory().

synfig::String App::get_config_file | ( | const synfig::String & | file | ) | `[static]`

References get_user_app_directory().

Referenced by studio::AutoRecover::auto_backup(), load_settings(), studio::AutoRecover::normal_shutdown(), studio::AutoRecover::recover(), studio::AutoRecover::recovery_needed(), and save_settings().

## Friends And Related Function Documentation

friend class Preferences`[friend]`

friend class Dialog_Setup `[friend]`

## Member Data Documentation

Gtk::InputDialog * studio::App::dialog_input `[static]`

Referenced by App(), and ~App().

studio::DeviceTracker * studio::App::device_tracker = 0`[static]`

Referenced by App().

studio::AutoRecover * studio::App::auto_recover = NULL`[static]`

Referenced by App(), studio::Instance::close(), quit(), studio::Dialog_Setup::refresh(), and ~App().

studio::DockManager * studio::App::dock_manager = 0`[static]`

Referenced by App(), studio::DockDialog::DockDialog(), get_dock_manager(), studio::DockBook::set_contents(), studio::Toolbox::Toolbox(), ~App(), and studio::DockDialog::~DockDialog().

studio::Dialog_Setup * App::dialog_setup `[static]`

Referenced by App(), show_setup(), and ~App().

studio::Dialog_Gradient * studio::App::dialog_gradient `[static]`

Referenced by App(), and ~App().

studio::Dialog_Color * studio::App::dialog_color `[static]`

Referenced by App(), and ~App().

studio::Dialog_ToolOptions * studio::App::dialog_tool_options `[static]`

Referenced by App().

synfig::Distance::System App::distance_system `[static]`

Referenced by App(), studio::Dialog_Setup::refresh(), studio::WorkArea::refresh_dimension_info(), studio::Renderer_Ducks::render_vfunc(), studio::CellRenderer_ValueBase::render_vfunc(), studio::Widget_Vector::set_value(), and studio::Widget_ValueBase::set_value().

synfig::Gamma App::gamma `[static]`

Referenced by studio::colorconv_synfig2gdk(), load_settings(), studio::Dialog_Setup::refresh(), and studio::render_gradient_to_window().

studio::About * studio::App::about = NULL`[static]`

Referenced by App(), dialog_about(), and ~App().

studio::Toolbox * studio::App::toolbox = NULL`[static]`

Referenced by studio::StateManager::add_state(), App(), dialog_open_file(), dialog_save_file(), studio::DockDialog::DockDialog(), ~App(), and studio::Toolbox::~Toolbox().

std::list< etl::handle< Instance > > App::instance_list `[static]`

Referenced by studio::AutoRecover::auto_backup(), studio::Instance::close(), studio::Instance::create(), get_instance(), quit(), studio::AutoRecover::recover(), studio::Widget_CompSelect::refresh(), studio::CompView::refresh_instances(), studio::CompView::set_selected_instance(), and ~App().

bool App::shutdown_in_progress `[static]`

Referenced by App(), studio::CompView::delete_instance(), studio::CompView::new_instance(), quit(), studio::Widget_CompSelect::refresh(), studio::CompView::refresh_instances(), studio::CompView::set_selected_instance(), and ~App().

bool studio::App::use_colorspace_gamma = true`[static]`

Referenced by studio::Dialog_Setup::refresh().

bool studio::App::restrict_radius_ducks = false`[static]`

Referenced by studio::Renderer_Ducks::render_vfunc(), and studio::Duckmatic::signal_edited_selected_ducks().

bool studio::App::resize_imported_images = false`[static]`

Referenced by studio::CanvasView::image_import(), and studio::Dialog_Setup::refresh().

String studio::App::browser_command `[static]`

Referenced by studio::Dialog_Setup::refresh(), and try_open_url().

String studio::App::custom_filename_prefix `[static]`

Referenced by studio::Instance::has_real_filename(), new_instance(), open_as(), and studio::Dialog_Setup::refresh().

int studio::App::preferred_x_size = 480`[static]`

Referenced by new_instance(), and studio::Dialog_Setup::refresh().

int studio::App::preferred_y_size = 270`[static]`

Referenced by new_instance().

String studio::App::predefined_size `[static]`

String studio::App::predefined_fps `[static]`

Referenced by studio::Dialog_Setup::refresh().

float studio::App::preferred_fps = 24.0`[static]`

Referenced by new_instance(), and studio::Dialog_Setup::refresh().

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

- app.h
- app.cpp