X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Fsrc%2Fgui%2Fduckmatic.h;h=c97bbb6d49eddc4f266abc44002dc2df60040829;hb=8463caf8ebf84825997a120eb137cf1b910c9ac9;hp=e10db0ce5141d765cdca38652b2e4965ceb421bf;hpb=5db17dd500c44a59e62bc52cf1c22392edc972a8;p=synfig.git diff --git a/synfig-studio/src/gui/duckmatic.h b/synfig-studio/src/gui/duckmatic.h index e10db0c..c97bbb6 100644 --- a/synfig-studio/src/gui/duckmatic.h +++ b/synfig-studio/src/gui/duckmatic.h @@ -82,7 +82,7 @@ public: /* === C L A S S E S & S T R U C T S ======================================= */ -namespace synfigapp { class ValueDesc; } +namespace synfigapp { class ValueDesc; class CanvasInterface; } namespace synfig { class ParamDesc; } namespace studio @@ -118,7 +118,6 @@ public: ** the work area that the user may want to interact with. ** This includes ducks, beziers, and strokes ** -** \note At some point I'll probably rename this class to "DuckOMatic". */ class Duckmatic { @@ -159,6 +158,8 @@ typedef std::map > DuckDataMap; private: + etl::loose_handle canvas_interface; + Type type_mask; DuckMap duck_map; @@ -236,7 +237,7 @@ private: public: - Duckmatic(); + Duckmatic(etl::loose_handle canvas_interface); virtual ~Duckmatic(); sigc::signal& signal_duck_selection_changed() { return signal_duck_selection_changed_; } @@ -322,15 +323,31 @@ public: void unselect_duck(const etl::handle &duck); + //! Begin dragging ducks + /*! \param offset Canvas coordinates of the mouse when the drag began */ void start_duck_drag(const synfig::Vector& offset); + + //! Continue dragging the selected ducks + /*! The overall vector of the drag is vector-offset + * (where offset was given in start_duck_drag) + * \param vector Canvas coordinates of the mouse at this moment */ void translate_selected_ducks(const synfig::Vector& vector); + + //! Update the coordinates of tangents and linked-to-bline ducks void update_ducks(); - bool end_duck_drag(); - void signal_edited_selected_ducks(); + //! Ends the duck drag + bool end_duck_drag(); + //! Signals to each selected duck that it has been clicked void signal_user_click_selected_ducks(int button); + //! Calls all of the ducks' edited signals + /*! Updates corresponding valuenodes after a drag */ + void signal_edited_selected_ducks(); + + bool on_duck_changed(const synfig::Point &value,const synfigapp::ValueDesc& value_desc); + bool on_duck_angle_changed(const synfig::Angle &rotation,const synfigapp::ValueDesc& value_desc); etl::handle find_similar_duck(etl::handle duck); etl::handle add_similar_duck(etl::handle duck); @@ -375,10 +392,10 @@ public: bool add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handle canvas_view, const synfig::TransformStack& transform_stack_, synfig::ParamDesc *param_desc=0, int multiple=0); - //! \writeme + //! Set the type mask, which determines what types of ducks are shown void set_type_mask(Type x) { type_mask=x; } - //! \writeme + //! Get the type mask, which determines what types of ducks are shown Type get_type_mask()const { return type_mask; } void select_all_ducks();