X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Fcanvasinterface.cpp;h=87971c0f95dc6328141be7044cb2fe76ae836e5f;hb=c2813b4d63804cac9b4067146a9e6eca717cb3e4;hp=1757952669647fc0b1c9c7f718320eb4610d0ad7;hpb=6fc1a2c4d3eb4de9e3c9c88b7a770e4feb7f5243;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp index 1757952..87971c0 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -59,6 +60,8 @@ #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -76,7 +79,7 @@ using namespace synfigapp; /* === M E T H O D S ======================================================= */ -CanvasInterface::CanvasInterface(loose_handle instance,handle canvas): +CanvasInterface::CanvasInterface(etl::loose_handle instance,etl::handle canvas): instance_(instance), canvas_(canvas), cur_time_(canvas->rend_desc().get_frame_start()), @@ -103,7 +106,14 @@ CanvasInterface::set_time(synfig::Time x) } if(cur_time_.is_equal(x)) return; - cur_time_=x; + get_canvas()->set_time(cur_time_=x); + + // update the time in all the child canvases + Canvas::Children children = get_canvas()->get_root()->children(); + handle interface; + for (Canvas::Children::iterator iter = children.begin(); iter != children.end(); iter++) + if ((interface = get_instance()->find_canvas_interface(*iter)) != this) + interface->set_time(interface->get_canvas()->get_time()); signal_time_changed()(); signal_dirty_preview()(); @@ -124,7 +134,7 @@ CanvasInterface::refresh_current_values() } etl::handle -CanvasInterface::create(loose_handle instance,handle canvas) +CanvasInterface::create(etl::loose_handle instance, etl::handle canvas) { etl::handle intrfc; intrfc=new CanvasInterface(instance,canvas); @@ -166,7 +176,7 @@ CanvasInterface::get_mode()const Layer::Handle -CanvasInterface::add_layer_to(String name, Canvas::Handle canvas, int depth) +CanvasInterface::add_layer_to(synfig::String name, synfig::Canvas::Handle canvas, int depth) { synfigapp::Action::PassiveGrouper group(get_instance().get(),_("Add Layer To")); @@ -198,7 +208,7 @@ CanvasInterface::add_layer_to(String name, Canvas::Handle canvas, int depth) layer->set_param("blend_method",synfigapp::Main::get_blend_method()); { - // Grab the layer's list pf parameters + // Grab the layer's list of parameters Layer::ParamList paramlist=layer->get_param_list(); Layer::ParamList::iterator iter; for(iter=paramlist.begin();iter!=paramlist.end();++iter) @@ -274,7 +284,7 @@ CanvasInterface::add_layer_to(String name, Canvas::Handle canvas, int depth) bool -CanvasInterface::convert(ValueDesc value_desc, String type) +CanvasInterface::convert(ValueDesc value_desc, synfig::String type) { Action::Handle action(Action::ValueDescConvert::create()); @@ -410,7 +420,7 @@ CanvasInterface::set_rend_desc(const synfig::RendDesc &rend_desc) } bool -CanvasInterface::set_name(const String &x) +CanvasInterface::set_name(const synfig::String &x) { //! \todo This needs to be converted into an action get_canvas()->set_name(x); @@ -419,7 +429,7 @@ CanvasInterface::set_name(const String &x) } bool -CanvasInterface::set_description(const String &x) +CanvasInterface::set_description(const synfig::String &x) { //! \todo This needs to be converted into an action get_canvas()->set_description(x); @@ -427,7 +437,7 @@ CanvasInterface::set_description(const String &x) } bool -CanvasInterface::set_id(const String &x) +CanvasInterface::set_id(const synfig::String &x) { //! \todo This needs to be converted into an action get_canvas()->set_id(x); @@ -469,14 +479,14 @@ CanvasInterface::import(const synfig::String &filename, bool /*copy*/) synfig::info("Attempting to import "+filename); - - if(find(filename.begin(),filename.end(),'.')==filename.end()) + if (filename_extension(filename) == "") { - get_ui_interface()->error("Filename must have an extension!"); + get_ui_interface()->error(_("Filename must have an extension!")); return false; } - String ext(String(filename.begin()+filename.find_last_of('.')+1,filename.end())); + String ext(filename_extension(filename)); + if (ext.size()) ext = ext.substr(1); // skip initial '.' std::transform(ext.begin(),ext.end(),ext.begin(),&::tolower); // If this is a SIF file, then we need to do things slightly differently @@ -615,7 +625,7 @@ CanvasInterface::waypoint_remove(synfigapp::ValueDesc value_desc,synfig::Waypoin void -CanvasInterface::auto_export(ValueNode::Handle /*value_node*/) +CanvasInterface::auto_export(synfig::ValueNode::Handle /*value_node*/) { /* // Check to see if we are already exported.