projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revision 1494 introduced a bug in the bline tool. Dragging a tangent while drawing...
[synfig.git]
/
synfig-studio
/
trunk
/
src
/
gtkmm
/
duck.h
diff --git
a/synfig-studio/trunk/src/gtkmm/duck.h
b/synfig-studio/trunk/src/gtkmm/duck.h
index
8be49d6
..
5ea5446
100644
(file)
--- a/
synfig-studio/trunk/src/gtkmm/duck.h
+++ b/
synfig-studio/trunk/src/gtkmm/duck.h
@@
-2,7
+2,7
@@
/*! \file duck.h
** \brief Template Header
**
/*! \file duck.h
** \brief Template Header
**
-** $Id
: duck.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp
$
+** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
@@
-44,20
+44,27
@@
/* === M A C R O S ========================================================= */
/* === 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
#ifdef HASH_MAP_H
#include HASH_MAP_H
+#include FUNCTIONAL_H
+
#ifndef __STRING_HASH__
#define __STRING_HASH__
class StringHash
{
#ifndef __STRING_HASH__
#define __STRING_HASH__
class StringHash
{
- __gnu_cxx::hash<const char*> hasher_;
+# ifdef FUNCTIONAL_HASH_ON_STRING
+ HASH_MAP_NAMESPACE::hash<const 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
{
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());
return hasher_(x.c_str());
+# endif // FUNCTIONAL_HASH_ON_STRING
}
};
#endif
}
};
#endif
@@
-73,13
+80,13
@@
public:
namespace studio {
class Duckmatic;
namespace studio {
class Duckmatic;
-
+
/*! \class Duck
** \writeme */
class Duck : public etl::shared_object
{
friend class Duckmatic;
/*! \class Duck
** \writeme */
class Duck : public etl::shared_object
{
friend class Duckmatic;
-
+
public:
enum Type
{
public:
enum Type
{
@@
-98,18
+105,20
@@
public:
typedef etl::handle<Duck> Handle;
typedef etl::loose_handle<Duck> LooseHandle;
typedef etl::handle<Duck> Handle;
typedef etl::loose_handle<Duck> LooseHandle;
-
+
private:
sigc::signal<bool,const synfig::Point &> signal_edited_;
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];
sigc::signal<void> signal_user_click_[5];
-
+
Type type_;
synfig::Point point;
Type type_;
synfig::Point point;
+ synfig::Angle rotations;
etl::smart_ptr<synfig::Point> shared_point;
etl::smart_ptr<synfig::Point> shared_point;
-
+
synfig::Point origin;
synfig::String name;
synfig::Real scalar;
synfig::Point origin;
synfig::String name;
synfig::Real scalar;
@@
-119,13
+128,13
@@
private:
etl::handle<Duck> connect_duck;
etl::handle<Duck> box_duck;
etl::handle<Duck> connect_duck;
etl::handle<Duck> box_duck;
- synfig::GUID guid_;
+ synfig::GUID guid_;
// Flags
bool editable;
bool radius_;
bool tangent_;
// Flags
bool editable;
bool radius_;
bool tangent_;
-
+
synfig::TransformStack transform_stack_;
synfigapp::ValueDesc value_desc_;
synfig::TransformStack transform_stack_;
synfigapp::ValueDesc value_desc_;
@@
-136,8
+145,9
@@
public:
Duck(const synfig::Point &point);
Duck(const synfig::Point &point,const synfig::Point &origin);
~Duck();
Duck(const synfig::Point &point);
Duck(const synfig::Point &point,const synfig::Point &origin);
~Duck();
-
+
sigc::signal<bool,const synfig::Point &> &signal_edited() { return signal_edited_; }
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; }
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; }
@@
-170,7
+180,7
@@
public:
void set_transform_stack(const synfig::TransformStack& x) { transform_stack_=x; }
const synfig::TransformStack& get_transform_stack()const { return transform_stack_; }
void set_transform_stack(const synfig::TransformStack& x) { transform_stack_=x; }
const synfig::TransformStack& get_transform_stack()const { return transform_stack_; }
-
+
//! \writeme
void set_type(Type x) { type_=x; }
//! \writeme
void set_type(Type x) { type_=x; }
@@
-187,12
+197,14
@@
public:
//! Sets the location of the duck with respect to the origin
void set_point(const synfig::Point &x) { (shared_point?*shared_point:point)=x; }
//! Sets the location of the duck with respect to the origin
void set_point(const synfig::Point &x) { (shared_point?*shared_point:point)=x; }
-
+
//! Returns the location of the duck
synfig::Point get_point()const { return shared_point?*shared_point:point; }
//! 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;
synfig::Point get_trans_point()const;
-
+
void set_trans_point(const synfig::Point &x);
synfig::Point get_sub_trans_point()const;
void set_trans_point(const synfig::Point &x);
synfig::Point get_sub_trans_point()const;
@@
-207,22
+219,22
@@
public:
//! Retrieves the origin location
synfig::Point get_origin()const;
//! Retrieves the origin location
synfig::Point get_origin()const;
-
+
//! Retrieves the origin duck
//! Retrieves the origin duck
- const etl::handle<Duck> & get_origin_duck() const;
+ const etl::handle<Duck> & get_origin_duck() const;
//! Retrieves the origin location
synfig::Point get_trans_origin()const;
void set_radius(bool r) { radius_=r; }
bool is_radius()const { return radius_; }
//! Retrieves the origin location
synfig::Point get_trans_origin()const;
void set_radius(bool r) { radius_=r; }
bool is_radius()const { return radius_; }
-
+
//! Sets the name of the duck
void set_name(const synfig::String &x);
//! Retrieves the name of the duck
synfig::String get_name()const { return name; }
//! Sets the name of the duck
void set_name(const synfig::String &x);
//! Retrieves the name of the duck
synfig::String get_name()const { return name; }
-
+
bool operator==(const Duck &rhs)const;
}; // END of class Duck
bool operator==(const Duck &rhs)const;
}; // END of class Duck
@@
-246,9
+258,9
@@
operator&(const Duck::Type lhs, const Duck::Type rhs)
class DuckMap : public
#ifdef HASH_MAP_H
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> >
{
#else
std::map<synfig::GUID,etl::handle<studio::Duck> >
{