Blame synfig-studio/src/gui/duck.h

Carlos Lopez a09598
/* === S Y N F I G ========================================================= */
Carlos Lopez a09598
/*!	\file duck.h
Carlos Lopez a09598
**	\brief Template Header
Carlos Lopez a09598
**
Carlos Lopez a09598
**	$Id$
Carlos Lopez a09598
**
Carlos Lopez a09598
**	\legal
Carlos Lopez a09598
**	Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
Carlos Lopez a09598
**	Copyright (c) 2007, 2008 Chris Moore
Carlos Lopez 233516
**	Copyright (c) 2009 Nikita Kitaev
Carlos Lopez a09598
**
Carlos Lopez a09598
**	This package is free software; you can redistribute it and/or
Carlos Lopez a09598
**	modify it under the terms of the GNU General Public License as
Carlos Lopez a09598
**	published by the Free Software Foundation; either version 2 of
Carlos Lopez a09598
**	the License, or (at your option) any later version.
Carlos Lopez a09598
**
Carlos Lopez a09598
**	This package is distributed in the hope that it will be useful,
Carlos Lopez a09598
**	but WITHOUT ANY WARRANTY; without even the implied warranty of
Carlos Lopez a09598
**	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Carlos Lopez a09598
**	General Public License for more details.
Carlos Lopez a09598
**	\endlegal
Carlos Lopez a09598
*/
Carlos Lopez a09598
/* ========================================================================= */
Carlos Lopez a09598
Carlos Lopez a09598
/* === S T A R T =========================================================== */
Carlos Lopez a09598
Carlos Lopez a09598
#ifndef __SYNFIG_DUCKMATIC_DUCK_H
Carlos Lopez a09598
#define __SYNFIG_DUCKMATIC_DUCK_H
Carlos Lopez a09598
Carlos Lopez a09598
/* === H E A D E R S ======================================================= */
Carlos Lopez a09598
82ffbe
#include <map></map>
82ffbe
#include <set></set>
Carlos Lopez a09598
#include <list></list>
Carlos Lopez a09598
82ffbe
#include <sigc++ sigc++.h=""></sigc++>
82ffbe
Carlos Lopez a09598
#include <etl smart_ptr=""></etl>
Carlos Lopez a09598
#include <etl handle=""></etl>
Carlos Lopez a09598
Carlos Lopez a09598
#include <synfig vector.h=""></synfig>
Carlos Lopez a09598
#include <synfig string.h=""></synfig>
Carlos Lopez a09598
#include <synfig real.h=""></synfig>
Carlos Lopez a09598
#include <synfig time.h=""></synfig>
Carlos Lopez a09598
#include <synfig transform.h=""></synfig>
Carlos Lopez a09598
82ffbe
#include <synfigapp value_desc.h=""></synfigapp>
Carlos Lopez a09598
82ffbe
/* === M A C R O S ========================================================= */
Carlos Lopez a09598
Carlos Lopez a09598
/* === T Y P E D E F S ===================================================== */
Carlos Lopez a09598
Carlos Lopez a09598
/* === C L A S S E S & S T R U C T S ======================================= */
Carlos Lopez a09598
Carlos Lopez a09598
namespace studio {
Carlos Lopez a09598
class Duckmatic;
Carlos Lopez a09598
Carlos Lopez a09598
/*! \class Duck
Carlos Lopez a09598
**	\writeme */
Carlos Lopez a09598
class Duck : public etl::shared_object
Carlos Lopez a09598
{
Carlos Lopez a09598
	friend class Duckmatic;
Carlos Lopez a09598
Carlos Lopez a09598
public:
Carlos Lopez a09598
	enum Type
Carlos Lopez a09598
	{
2483eb
		TYPE_NONE					=	(0),		//    0
2483eb
		TYPE_POSITION				=	(1 <<  0),	//    1
2483eb
		TYPE_TANGENT				=	(1 <<  1),	//    2
2483eb
		TYPE_RADIUS					=	(1 <<  2),	//    4
2483eb
		TYPE_WIDTH					=	(1 <<  3),	//    8
2483eb
		TYPE_ANGLE					=	(1 <<  4),	//   16
2483eb
		TYPE_VERTEX					=	(1 <<  5),	//   32
7e2370
		TYPE_BONE_RECURSIVE			=	(1 <<  6),	//   64
7e2370
		TYPE_WIDTHPOINT_POSITION	=	(1 <<  7),	//  128
7e2370
		TYPE_SCALE					=	(1 <<  8),	//  256
7e2370
		TYPE_SCALE_X				=	(1 <<  9),	//  512
7e2370
		TYPE_SCALE_Y				=	(1 << 10),	// 1024
be843e
		TYPE_SKEW					=	(1 << 11),	// 2048
Carlos Lopez a09598
[d.j.a.y] Jerome Blanchi 50f93d
		TYPE_ALL					=	(~0),
Carlos Lopez a09598
[d.j.a.y] Jerome Blanchi 50f93d
		TYPE_DEFAULT				=	0xdefadefa
[d.j.a.y] Jerome Blanchi 50f93d
	};
[d.j.a.y] Jerome Blanchi 50f93d
	//used for preference/interface handle tooltip flag
[d.j.a.y] Jerome Blanchi 50f93d
	enum Structure
[d.j.a.y] Jerome Blanchi 50f93d
	{
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_NONE					=	(0),		//    0
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_BLINEPOINT			=	(1 <<  0),	//    1
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_TRANSFORMATION		=	(1 <<  1),	//    2
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_WIDTHPOINT			=	(1 <<  2),	//    4
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_BONE					=	(1 <<  3),	//    8
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_GRADIENT				=	(1 <<  4),	//   16
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_TEXT					=	(1 <<  5),	//   32
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_RADIUS				=	(1 <<  6),	//   64
[d.j.a.y] Jerome Blanchi b85adb
		STRUCT_TRANSFO_BY_VALUE		=	(1 <<  7),	//  128
[d.j.a.y] Jerome Blanchi 50f93d
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_ALL					=	(~0),
[d.j.a.y] Jerome Blanchi 50f93d
[d.j.a.y] Jerome Blanchi 50f93d
		STRUCT_DEFAULT				=	0x44 //STRUCT_RADIUS+STRUCT_WIDTHPOINT
Carlos Lopez a09598
	};
Carlos Lopez a09598
	typedef etl::handle<duck> Handle;</duck>
Carlos Lopez a09598
	typedef etl::loose_handle<duck> LooseHandle;</duck>
Carlos Lopez a09598
Carlos Lopez a09598
private:
Carlos Lopez a09598
65a3ce
	sigc::signal<bool,const &="" duck=""> signal_edited_;</bool,const>
Carlos Lopez a09598
	sigc::signal<void> signal_user_click_[5];</void>
Carlos Lopez a09598
Carlos Lopez a09598
be843e
	// information about represented value
Carlos Lopez a09598
be843e
	synfig::GUID guid_;
Carlos Lopez a09598
	synfig::String name;
be843e
	Type type_;
be843e
	synfigapp::ValueDesc value_desc_;
be843e
	synfigapp::ValueDesc alternative_value_desc_;
Carlos Lopez a09598
Carlos Lopez a09598
Carlos Lopez a09598
	// Flags
be843e
be843e
	bool editable_;
be843e
	bool alternative_editable_;
6a4234
	bool edit_immediatelly_;
Carlos Lopez a09598
	bool radius_;
Carlos Lopez a09598
	bool tangent_;
Carlos Lopez a09598
	bool hover_;
Carlos Lopez a09598
	bool ignore_;
7dd8a3
	bool exponential_;
be843e
	bool track_axes_;
fa7ea9
	bool lock_aspect_;
8520cc
	bool move_origin_;
be843e
be843e
	// positioning
Nikita Kitaev dc5e35
Carlos Lopez a09598
	synfig::TransformStack transform_stack_;
Carlos Lopez a09598
be843e
	synfig::Real scalar_;
be843e
be843e
	synfig::Point origin_;
be843e
	Handle origin_duck_;
be843e
be843e
	Handle axis_x_angle_duck_;
be843e
	synfig::Angle axis_x_angle_;
be843e
be843e
	Handle axis_x_mag_duck_;
be843e
	synfig::Real axis_x_mag_;
be843e
be843e
	Handle axis_y_angle_duck_;
be843e
	synfig::Angle axis_y_angle_;
be843e
be843e
	Handle axis_y_mag_duck_;
be843e
	synfig::Real axis_y_mag_;
be843e
be843e
	Handle connect_duck_;
be843e
	Handle box_duck_;
be843e
be843e
	// value
be843e
be843e
	synfig::Point point_;
be843e
	etl::smart_ptr<synfig::point> shared_point_;</synfig::point>
4c3d45
	etl::smart_ptr<synfig::angle> shared_angle_;</synfig::angle>
4c3d45
	etl::smart_ptr<synfig::real> shared_mag_;</synfig::real>
be843e
	synfig::Angle rotations_;
fa7ea9
	synfig::Point aspect_point_;
Carlos Lopez a09598
Carlos Lopez a09598
	static int duck_count;
Carlos Lopez a09598
public:
be843e
be843e
	// constructors
be843e
Carlos Lopez a09598
	Duck();
2b5909
	explicit Duck(const synfig::Point &point);
Carlos Lopez a09598
	Duck(const synfig::Point &point,const synfig::Point &origin);
Carlos Lopez a09598
	~Duck();
Carlos Lopez a09598
be843e
be843e
	// signals
be843e
be843e
	sigc::signal<bool,const &="" duck=""> &signal_edited()</bool,const>
be843e
		{ return signal_edited_; }
be843e
	sigc::signal<void> &signal_user_click(int i=0)</void>
be843e
		{ assert(i>=0); assert(i<5); return signal_user_click_[i]; }
be843e
be843e
be843e
	// information about represented value
Carlos Lopez a09598
Carlos Lopez a09598
	void set_guid(const synfig::GUID& x) { guid_=x; }
Carlos Lopez a09598
	const synfig::GUID& get_guid()const { return guid_; }
Carlos Lopez a09598
	synfig::GUID get_data_guid()const;
Carlos Lopez a09598
be843e
	//! Sets the name of the duck
be843e
	void set_name(const synfig::String &x);
be843e
	//! Retrieves the name of the duck
be843e
	synfig::String get_name()const { return name; }
be843e
be843e
	void set_type(Type x) { type_=x; }
be843e
	Type get_type()const { return type_; }
be843e
be843e
#ifdef _DEBUG
be843e
	//!	Returns a string containing the name of the given Type
be843e
	static synfig::String type_name(Type id);
be843e
	//!	Returns a string containing the name of the type
be843e
	synfig::String type_name()const { return type_name(get_type()); }
be843e
#endif	// _DEBUG
be843e
561714
	void set_value_desc(const synfigapp::ValueDesc &x)
be843e
		{ value_desc_=x; }
561714
	const synfigapp::ValueDesc& get_value_desc() const
be843e
		{ return value_desc_; }
561714
	void set_alternative_value_desc(const synfigapp::ValueDesc &x)
be843e
		{ alternative_value_desc_=x; }
be843e
	const synfigapp::ValueDesc& get_alternative_value_desc() const
be843e
		{ return alternative_value_desc_; }
be843e
be843e
be843e
	// flags
be843e
a0e387
	bool get_editable(bool is_alternative_mode)const
a0e387
	{
a0e387
		if (alternative_value_desc_.is_valid())
be843e
			return is_alternative_mode ? alternative_editable_ : editable_;
be843e
		return editable_;
a0e387
	}
a0e387
	//! Changes the editable flag.
be843e
	void set_editable(bool x)
be843e
		{ editable_=x; }
Carlos Lopez a09598
	//! Retrieves the status of the editable flag
be843e
	bool get_editable()const
be843e
		{ return editable_; }
a0e387
	//! Changes the editable_alternative flag.
be843e
	void set_alternative_editable(bool x)
be843e
		{ alternative_editable_=x; }
a0e387
	//! Retrieves the status of the editable_alternative flag
be843e
	bool get_alternative_editable()const
be843e
		{ return alternative_editable_; }
be843e
be843e
	bool is_radius()const
be843e
		{ return radius_; }
be843e
	void set_radius(bool r)
be843e
		{ radius_=r; }
a0e387
6a4234
	//! If set, the duck will send signal_edited while moving.
6a4234
	//! If not set, the duck will send signal_edited when button released.
be843e
	void set_edit_immediatelly(bool x)
be843e
		{ edit_immediatelly_=x; }
be843e
	bool get_edit_immediatelly()const
be843e
		{ return edit_immediatelly_; }
6a4234
be843e
	void set_tangent(bool x)
be843e
		{ tangent_=x; if (x) type_=TYPE_TANGENT; }
be843e
	bool get_tangent()const
be843e
		{ return tangent_; }
Carlos Lopez a09598
Carlos Lopez a09598
	//! Sets whether to show the duck as if it is being hovered over
be843e
	void set_hover(bool h)
be843e
		{ hover_=h; }
Carlos Lopez a09598
	//! Retrieves whether to show the duck as if it is being hovered over
be843e
	bool get_hover()const
be843e
		{ return hover_; }
Carlos Lopez a09598
Carlos Lopez a09598
	//! Sets whether to ignore the duck when checking for user interaction
be843e
	void set_ignore(bool i)
be843e
		{ ignore_=i; }
Carlos Lopez a09598
	//! Retrieves whether to ignore the duck when checking for user interaction
be843e
	bool get_ignore()const
be843e
		{ return ignore_; }
[d.j.a.y] Jerome Blanchi 50f93d
7dd8a3
	//! Sets if the duck is using the exponential function
7dd8a3
	/*!	Such representation allows to set the Real values in the range from \c -inf to \c inf . */
be843e
	void set_exponential(bool n)
be843e
		{ exponential_=n; }
7dd8a3
	//! Retrieves the exponential value
be843e
	bool get_exponential()const
be843e
		{ return exponential_; }
Carlos Lopez a09598
be843e
	//! draw projection lines onto axes
be843e
	bool is_axes_tracks()const
be843e
		{ return track_axes_; }
be843e
	void set_track_axes(bool r)
be843e
		{ track_axes_=r; }
Carlos Lopez a09598
fa7ea9
	bool is_aspect_locked()const
fa7ea9
		{ return lock_aspect_; }
fa7ea9
	void set_lock_aspect(bool r)
fa7ea9
		{ if (!lock_aspect_ && r) aspect_point_=point_.norm(); lock_aspect_=r; }
fa7ea9
8520cc
	void set_move_origin(bool x)
8520cc
		{ move_origin_=x; }
8520cc
	//! Retrieves the exponential value
8520cc
	bool get_move_origin()const
8520cc
		{ return move_origin_; }
8520cc
be843e
	// positioning
Carlos Lopez a09598
be843e
	void set_transform_stack(const synfig::TransformStack& x)
be843e
		{ transform_stack_=x; }
be843e
	const synfig::TransformStack& get_transform_stack()const
be843e
		{ return transform_stack_; }
Carlos Lopez a09598
Carlos Lopez a09598
	//! Sets the scalar multiplier for the duck with respect to the origin
be843e
	void set_scalar(synfig::Vector::value_type n)
be843e
		{ scalar_=n; }
Carlos Lopez a09598
	//! Retrieves the scalar value
be843e
	synfig::Vector::value_type get_scalar()const
be843e
		{ return scalar_; }
Carlos Lopez a09598
be843e
	//! Sets the origin point.
be843e
	void set_origin(const synfig::Point &x)
be843e
		{ origin_=x; origin_duck_=NULL; }
be843e
	//! Sets the origin point as another duck
be843e
	void set_origin(const Handle &x)
be843e
		{ origin_duck_=x; }
be843e
	//! Retrieves the origin location
be843e
	synfig::Point get_origin()const
be843e
		{ return origin_duck_?origin_duck_->get_point():origin_; }
be843e
	//! Retrieves the origin duck
be843e
	const Handle& get_origin_duck() const
be843e
		{ return origin_duck_; }
be843e
be843e
	void set_axis_x_angle(const synfig::Angle &a)
be843e
		{ axis_x_angle_=a; axis_x_angle_duck_=NULL; }
be843e
	void set_axis_x_angle(const Handle &duck, const synfig::Angle angle = synfig::Angle::zero())
be843e
		{ axis_x_angle_duck_=duck; axis_x_angle_=angle; }
be843e
	synfig::Angle get_axis_x_angle()const
be843e
		{ return axis_x_angle_duck_?get_sub_trans_point(axis_x_angle_duck_,false).angle()+axis_x_angle_:axis_x_angle_; }
be843e
	const Handle& get_axis_x_angle_duck()const
be843e
		{ return axis_x_angle_duck_; }
be843e
be843e
	void set_axis_x_mag(const synfig::Real &m)
be843e
		{ axis_x_mag_=m; axis_x_mag_duck_=NULL; }
be843e
	void set_axis_x_mag(const Handle &duck)
be843e
		{ axis_x_mag_duck_=duck; }
be843e
	synfig::Real get_axis_x_mag()const
be843e
		{ return axis_x_mag_duck_?get_sub_trans_point(axis_x_mag_duck_,false).mag():axis_x_mag_; }
be843e
	const Handle& get_axis_x_mag_duck()const
be843e
		{ return axis_x_mag_duck_; }
be843e
be843e
	synfig::Point get_axis_x()const
be843e
		{ return synfig::Point(get_axis_x_mag(), get_axis_x_angle()); }
be843e
be843e
	void set_axis_y_angle(const synfig::Angle &a)
be843e
		{ axis_y_angle_=a; axis_y_angle_duck_=NULL; }
be843e
	void set_axis_y_angle(const Handle &duck, const synfig::Angle angle = synfig::Angle::zero())
be843e
		{ axis_y_angle_duck_=duck; axis_y_angle_=angle; }
be843e
	synfig::Angle get_axis_y_angle()const
be843e
		{ return axis_y_angle_duck_?get_sub_trans_point(axis_y_angle_duck_,false).angle()+axis_y_angle_:axis_y_angle_; }
be843e
	const Handle& get_axis_y_angle_duck()const
be843e
		{ return axis_y_angle_duck_; }
be843e
be843e
	void set_axis_y_mag(const synfig::Real &m)
be843e
		{ axis_y_mag_=m; axis_y_mag_duck_=NULL; }
be843e
	void set_axis_y_mag(const Handle &duck)
be843e
		{ axis_y_mag_duck_=duck; }
be843e
	synfig::Real get_axis_y_mag()const
be843e
		{ return axis_y_mag_duck_?get_sub_trans_point(axis_y_mag_duck_,false).mag():axis_y_mag_; }
be843e
	const Handle& get_axis_y_mag_duck()const
be843e
		{ return axis_y_mag_duck_; }
be843e
be843e
	synfig::Point get_axis_y()const
be843e
		{ return synfig::Point(get_axis_y_mag(), get_axis_y_angle()); }
be843e
be843e
	//! linear ducks moves along specified axis only (angle locked)
be843e
	bool is_linear()const
be843e
		{ return !get_axis_y_mag_duck() && get_axis_y_mag() == 0; }
be843e
	void set_linear(bool r)
be843e
		{ if (is_linear() != r) set_axis_y_mag(r?0:1); }
be843e
	void set_linear(bool r, const synfig::Angle &a)
be843e
		{ set_linear(r); set_axis_x_angle(a); }
be843e
	void set_linear(bool r, const Handle &duck)
be843e
		{ set_linear(r); set_axis_x_angle(duck); }
be843e
	synfig::Angle get_linear_angle()const
be843e
		{ return get_axis_x_angle(); }
be843e
	const Handle& get_linear_duck()const
be843e
		{ return get_axis_x_angle_duck(); }
be843e
be843e
be843e
	// guidelines to other ducks
be843e
be843e
	//! draw line from specified duck to this duck
be843e
	void set_connect_duck(const Handle& x)
be843e
		{ connect_duck_=x; }
be843e
	const Handle& get_connect_duck()const
be843e
		{ return connect_duck_; }
be843e
be843e
	//! draw rectangle by two points - from this duck and from specified duck
be843e
	void set_box_duck(const Handle& x)
be843e
		{ box_duck_=x; }
be843e
	const Handle& get_box_duck()const
be843e
		{ return box_duck_; }
be843e
be843e
be843e
	// value
Carlos Lopez a09598
be843e
	//! Sets the location of the duck with respect to the origin
6f6d2e
	void set_point(const synfig::Point &x);
Carlos Lopez a09598
	//! Returns the location of the duck
6f6d2e
	synfig::Point get_point()const;
Carlos Lopez a09598
be843e
	void set_shared_point(const etl::smart_ptr<synfig::point>&x)</synfig::point>
be843e
		{ shared_point_=x; }
be843e
	const etl::smart_ptr<synfig::point>& get_shared_point()const</synfig::point>
be843e
		{ return shared_point_; }
Carlos Lopez 3a3762
4c3d45
	void set_shared_angle(const etl::smart_ptr<synfig::angle>&x)</synfig::angle>
4c3d45
		{ shared_angle_=x; }
4c3d45
	const etl::smart_ptr<synfig::angle>& get_shared_angle()const</synfig::angle>
4c3d45
		{ return shared_angle_; }
4c3d45
4c3d45
	void set_shared_mag(const etl::smart_ptr<synfig::real>&x)</synfig::real>
4c3d45
		{ shared_mag_=x; }
4c3d45
	const etl::smart_ptr<synfig::real>& get_shared_mag()const</synfig::real>
4c3d45
		{ return shared_mag_; }
4c3d45
be843e
	//! Returns the rotations of the duck
be843e
	//! For angle and tangent ducks, rotations are used instead of the location
be843e
	//! so that the duck can me rotated more than 180 degrees
be843e
	synfig::Angle get_rotations()const
be843e
		{ return rotations_; };
Nikita Kitaev f9108d
	//! Sets the rotations of the duck
be843e
	void set_rotations(const synfig::Angle &x)
be843e
		{ rotations_=x; };
be843e
be843e
be843e
	// calculation of position of duck at workarea
Carlos Lopez a09598
Carlos Lopez a09598
	synfig::Point get_trans_point()const;
8520cc
	synfig::Point get_trans_point(const synfig::Point &x)const;
Carlos Lopez a09598
Carlos Lopez a09598
	void set_trans_point(const synfig::Point &x);
Nikita Kitaev 668411
	void set_trans_point(const synfig::Point &x, const synfig::Time &time);
Carlos Lopez a09598
be843e
	synfig::Point get_sub_trans_point(const synfig::Point &x)const;
Carlos Lopez a09598
	synfig::Point get_sub_trans_point()const;
be843e
	synfig::Point get_sub_trans_point_without_offset(const synfig::Point &x)const;
be843e
	synfig::Point get_sub_trans_point_without_offset()const;
Carlos Lopez a09598
	void set_sub_trans_point(const synfig::Point &x);
Nikita Kitaev 668411
	void set_sub_trans_point(const synfig::Point &x, const synfig::Time &time);
be843e
	synfig::Point get_sub_trans_point(const Handle &duck, const synfig::Point &def, bool translate = true)const;
be843e
	synfig::Point get_sub_trans_point(const Handle &duck, bool translate = true)const
be843e
		{ return get_sub_trans_point(duck, synfig::Point(0,0), translate); }
Carlos Lopez a09598
	synfig::Point get_sub_trans_origin()const;
Carlos Lopez a09598
Carlos Lopez a09598
	//! Retrieves the origin location
Carlos Lopez a09598
	synfig::Point get_trans_origin()const;
Carlos Lopez a09598
Carlos Lopez a09598
be843e
	// operators
Carlos Lopez a09598
Carlos Lopez a09598
	bool operator==(const Duck &rhs)const;
Carlos Lopez a09598
}; // END of class Duck
Carlos Lopez a09598
Carlos Lopez a09598
//! Combine Flags
Carlos Lopez a09598
inline Duck::Type
Carlos Lopez a09598
operator|(Duck::Type lhs, const Duck::Type rhs)
Carlos Lopez a09598
{ return static_cast<duck::type>(int(lhs)|int(rhs)); }</duck::type>
Carlos Lopez a09598
Carlos Lopez a09598
//! Exclude Flags
Carlos Lopez a09598
inline Duck::Type
Carlos Lopez a09598
operator-(Duck::Type lhs, const Duck::Type rhs)
Carlos Lopez a09598
{ return static_cast<duck::type>(int(lhs)&~int(rhs)); }</duck::type>
Carlos Lopez a09598
Carlos Lopez a09598
inline Duck::Type&
Carlos Lopez a09598
operator|=(Duck::Type& lhs, const Duck::Type rhs)
Carlos Lopez a09598
{ *reinterpret_cast<int*>(&lhs)|=int(rhs); return lhs; }</int*>
Carlos Lopez a09598
Carlos Lopez a09598
inline Duck::Type
Carlos Lopez a09598
operator&(const Duck::Type lhs, const Duck::Type rhs)
Carlos Lopez a09598
{ return static_cast<duck::type>(int(lhs)&int(rhs)); }</duck::type>
Carlos Lopez a09598
d363e8
class DuckMap : public std::map<synfig::guid,etl::handle<studio::duck> ></synfig::guid,etl::handle<studio::duck>
Carlos Lopez a09598
{
Carlos Lopez a09598
	typedef std::map<synfig::guid,etl::handle<studio::duck> > PARENT_TYPE;</synfig::guid,etl::handle<studio::duck>
Carlos Lopez a09598
public:
Carlos Lopez a09598
	void insert(const Duck::Handle& x) { operator[](x->get_guid())=x;  }
Carlos Lopez a09598
}; // END of class DuckMap
Carlos Lopez a09598
Carlos Lopez a09598
typedef std::list<duck::handle> DuckList;</duck::handle>
Carlos Lopez a09598
Carlos Lopez a09598
}; // END of namespace studio
Carlos Lopez a09598
Carlos Lopez a09598
/* === E N D =============================================================== */
Carlos Lopez a09598
Carlos Lopez a09598
#endif