X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Fcanvasinterface.h;h=5bb3ec0e3124250bad6892fb0eb9ef0d733bc7c9;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=6def015df63c0743e2c38f04f464e7ea9fc57ea0;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.h b/synfig-studio/trunk/src/synfigapp/canvasinterface.h index 6def015..5bb3ec0 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.h +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.h @@ -2,19 +2,21 @@ /*! \file canvasinterface.h ** \brief Template Header ** -** $Id: canvasinterface.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007, 2008 Chris Moore ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -46,16 +48,16 @@ namespace synfig { class ValueNode_DynamicList; class Waypoint; class GUIDSet; c namespace synfigapp { -namespace Action { class ParamList; class Param; class EditModeSet; }; +namespace Action { class ParamList; class Param; class EditModeSet; }; class Instance; class ValueDesc; - + class CanvasInterface : public etl::shared_object, public sigc::trackable { friend class Instance; friend class Action::EditModeSet; - + public: typedef EditMode Mode; @@ -81,10 +83,9 @@ private: sigc::signal signal_layer_new_description_; sigc::signal signal_canvas_added_; sigc::signal signal_canvas_removed_; - + sigc::signal signal_value_node_added_; sigc::signal signal_value_node_deleted_; - sigc::signal signal_value_node_changed_; sigc::signal signal_value_node_replaced_; sigc::signal signal_keyframe_added_; @@ -111,10 +112,10 @@ public: // Signal Interface //! Signal called when layer is raised. sigc::signal& signal_layer_raised() { return signal_layer_raised_; } - + //! Signal called when layer is lowered. sigc::signal& signal_layer_lowered() { return signal_layer_lowered_; } - + //! Signal called when layer has been inserted at a given position. sigc::signal& signal_layer_inserted() { return signal_layer_inserted_; } @@ -150,7 +151,9 @@ public: // Signal Interface //! Signal called when a ValueNode has been changed sigc::signal >& signal_value_node_changed() { return get_canvas()->signal_value_node_changed(); } - //sigc::signal >& signal_value_node_changed() { return signal_value_node_changed_; } + + //! Signal called when a ValueNode has been renamed + sigc::signal >& signal_value_node_renamed() { return get_canvas()->signal_value_node_renamed(); } //! Signal called when the mode has changed sigc::signal signal_mode_changed() { return signal_mode_changed_; } @@ -185,21 +188,21 @@ public: //! Changes the current SelectionManager object void set_selection_manager(const etl::handle &sm) { selection_manager_=sm; } - + //! Disables the selection manager void unset_selection_manager() { selection_manager_=new NullSelectionManager(); } - + //! Returns a handle to the current SelectionManager - const etl::handle &get_selection_manager()const { return selection_manager_; } + const etl::handle &get_selection_manager()const { return selection_manager_; } //! Changes the current UIInterface object void set_ui_interface(const etl::handle &uim) { ui_interface_=uim; } //! Disables the UIInterface void unset_ui_interface() { ui_interface_=new DefaultUIInterface(); } - + //! Returns a handle to the current UIInterface - const etl::handle &get_ui_interface() { return ui_interface_; } + const etl::handle &get_ui_interface() { return ui_interface_; } //! Returns the Canvas associated with this interface etl::handle get_canvas()const { return canvas_; } @@ -208,42 +211,42 @@ public: etl::loose_handle get_instance()const { return instance_; } //! Changes the name of the canvas. Undoable. - bool set_name(const synfig::String &x); + void set_name(const synfig::String &x); //! Changes the description of the canvas. Undoable. - bool set_description(const synfig::String &x); + void set_description(const synfig::String &x); //! Changes the ID of the canvas. Undoable. - bool set_id(const synfig::String &x); - - //! Convience function to retrieve the name of the canvas + void set_id(const synfig::String &x); + + //! Convenience function to retrieve the name of the canvas synfig::String get_name()const { return get_canvas()->get_name(); } - //! Convience function to retrieve the description of the canvas + //! Convenience function to retrieve the description of the canvas synfig::String get_description()const { return get_canvas()->get_description(); } - //! Convience function to retrieve the ID of the canvas + //! Convenience function to retrieve the ID of the canvas synfig::String get_id()const { return get_canvas()->get_id(); } //! Sets the current time void set_time(synfig::Time x); - + //! Retrieves the current time synfig::Time get_time()const; - + //! Changes the current time to the next keyframe void jump_to_next_keyframe(); //! Changes the current time to the next keyframe void jump_to_prev_keyframe(); - + void seek_frame(int frames); void seek_time(synfig::Time time); - + //! \writeme void refresh_current_values(); - + //! Sets the current editing mode /*! \see Mode */ void set_mode(Mode x); @@ -253,7 +256,7 @@ public: Mode get_mode()const; //! Creates a new layer, of type \c id at the top of the layer stack - synfig::Layer::Handle add_layer(synfig::String id) { return add_layer_to(id,get_canvas()); } + // synfig::Layer::Handle add_layer(synfig::String id) { return add_layer_to(id,get_canvas()); } synfig::Layer::Handle add_layer_to(synfig::String id,synfig::Canvas::Handle canvas, int depth=0); @@ -268,12 +271,14 @@ public: void set_rend_desc(const synfig::RendDesc &rend_desc); - bool import(const synfig::String &filename, bool copy=false); - - + 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); @@ -297,7 +302,7 @@ public: PushMode(etl::loose_handle c, CanvasInterface::Mode mode): canvas_interface_(c.get()), old_mode_(canvas_interface_->get_mode()) { canvas_interface_->set_mode(mode); } - + ~PushMode() { canvas_interface_->set_mode(old_mode_); } }; // END of class PushMode