X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fduck.h;h=1366472023e43ff20fb5fef3e9df7599b2f887a6;hb=587d6ca07e817b7a98e8eb4833492b2388184df4;hp=c688031286b92db08560b82031ba9f2db2f13ff7;hpb=c34eaa5441242b3e9a7b7645e9ee4983d14eae85;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/duck.h b/synfig-studio/trunk/src/gtkmm/duck.h index c688031..1366472 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.h +++ b/synfig-studio/trunk/src/gtkmm/duck.h @@ -2,10 +2,11 @@ /*! \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 +** 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 @@ -44,20 +45,27 @@ /* === M A C R O S ========================================================= */ -#define HASH_MAP_H -#define HASH_SET_H - #ifdef HASH_MAP_H #include HASH_MAP_H +#include FUNCTIONAL_H + #ifndef __STRING_HASH__ #define __STRING_HASH__ class StringHash { - __gnu_cxx::hash hasher_; +# ifdef FUNCTIONAL_HASH_ON_STRING + HASH_MAP_NAMESPACE::hash hasher_; +# else // FUNCTIONAL_HASH_ON_STRING + HASH_MAP_NAMESPACE::hash 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 @@ -102,11 +110,13 @@ public: private: sigc::signal signal_edited_; + sigc::signal signal_edited_angle_; sigc::signal signal_user_click_[5]; Type type_; synfig::Point point; + synfig::Angle rotations; etl::smart_ptr shared_point; @@ -125,6 +135,8 @@ private: bool editable; bool radius_; bool tangent_; + bool hover_; + bool ignore_; synfig::TransformStack transform_stack_; @@ -138,6 +150,7 @@ public: ~Duck(); sigc::signal &signal_edited() { return signal_edited_; } + sigc::signal &signal_edited_angle() { return signal_edited_angle_; } sigc::signal &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; } @@ -157,6 +170,18 @@ public: //! \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& x) { connect_duck=x; } void set_box_duck(const etl::handle& x) { box_duck=x; } @@ -191,6 +216,8 @@ public: //! 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); @@ -246,9 +273,9 @@ operator&(const Duck::Type lhs, const Duck::Type rhs) class DuckMap : public #ifdef HASH_MAP_H -__gnu_cxx::hash_map,synfig::GUIDHash> +HASH_MAP_CLASS,synfig::GUIDHash> { - typedef __gnu_cxx::hash_map,synfig::GUIDHash> PARENT_TYPE; + typedef HASH_MAP_CLASS,synfig::GUIDHash> PARENT_TYPE; #else std::map > {