**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2007, 2008 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
/* === M A C R O S ========================================================= */
-#define HASH_MAP_H <ext/hash_map>
-#define HASH_SET_H <ext/hash_set>
-
#ifdef HASH_MAP_H
#include HASH_MAP_H
+#include FUNCTIONAL_H
+
#ifndef __STRING_HASH__
#define __STRING_HASH__
class StringHash
{
- __gnu_cxx::hash<const char*> hasher_;
+# ifdef FUNCTIONAL_HASH_ON_STRING
+ HASH_MAP_NAMESPACE::hash<synfig::String> hasher_;
+# else // FUNCTIONAL_HASH_ON_STRING
+ HASH_MAP_NAMESPACE::hash<const char*> hasher_;
+# endif // FUNCTIONAL_HASH_ON_STRING
public:
size_t operator()(const synfig::String& x)const
{
+# ifdef FUNCTIONAL_HASH_ON_STRING
+ return hasher_(x);
+# else // FUNCTIONAL_HASH_ON_STRING
return hasher_(x.c_str());
+# endif // FUNCTIONAL_HASH_ON_STRING
}
};
#endif
public:
enum Type
{
- TYPE_NONE = (0),
- TYPE_POSITION = (1<<0),
- TYPE_TANGENT = (1<<1),
- TYPE_RADIUS = (1<<2),
- TYPE_WIDTH = (1<<3),
- TYPE_ANGLE = (1<<4),
- TYPE_VERTEX = (1<<5),
+ TYPE_NONE = (0), // 0
+ TYPE_POSITION = (1<<0), // 1
+ TYPE_TANGENT = (1<<1), // 2
+ TYPE_RADIUS = (1<<2), // 4
+ TYPE_WIDTH = (1<<3), // 8
+ TYPE_ANGLE = (1<<4), // 16
+ TYPE_VERTEX = (1<<5), // 32
TYPE_ALL = (~0),
private:
sigc::signal<bool,const synfig::Point &> signal_edited_;
+ sigc::signal<bool,const synfig::Angle &> signal_edited_angle_;
sigc::signal<void> signal_user_click_[5];
Type type_;
synfig::Point point;
+ synfig::Angle rotations;
etl::smart_ptr<synfig::Point> shared_point;
bool editable;
bool radius_;
bool tangent_;
+ bool hover_;
+ bool ignore_;
synfig::TransformStack transform_stack_;
~Duck();
sigc::signal<bool,const synfig::Point &> &signal_edited() { return signal_edited_; }
+ sigc::signal<bool,const synfig::Angle &> &signal_edited_angle() { return signal_edited_angle_; }
sigc::signal<void> &signal_user_click(int i=0) { assert(i>=0); assert(i<5); return signal_user_click_[i]; }
void set_guid(const synfig::GUID& x) { guid_=x; }
//! \writeme
bool get_tangent()const { return tangent_; }
+ //! Sets whether to show the duck as if it is being hovered over
+ void set_hover(bool h) { hover_=h; }
+
+ //! Retrieves whether to show the duck as if it is being hovered over
+ bool get_hover()const { return hover_; }
+
+ //! Sets whether to ignore the duck when checking for user interaction
+ void set_ignore(bool i) { ignore_=i; }
+
+ //! Retrieves whether to ignore the duck when checking for user interaction
+ bool get_ignore()const { return ignore_; }
+
void set_connect_duck(const etl::handle<Duck>& x) { connect_duck=x; }
void set_box_duck(const etl::handle<Duck>& x) { box_duck=x; }
//! Returns the location of the duck
synfig::Point get_point()const { return shared_point?*shared_point:point; }
+ synfig::Angle get_rotations()const { return rotations; };
+
synfig::Point get_trans_point()const;
void set_trans_point(const synfig::Point &x);
class DuckMap : public
#ifdef HASH_MAP_H
-__gnu_cxx::hash_map<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash>
+HASH_MAP_CLASS<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash>
{
- typedef __gnu_cxx::hash_map<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash> PARENT_TYPE;
+ typedef HASH_MAP_CLASS<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash> PARENT_TYPE;
#else
std::map<synfig::GUID,etl::handle<studio::Duck> >
{