X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fduck.h;h=9ba7b00c503379f627ab9ba1c7afa635a260e29c;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=179fba7fe6f3bda35cc2c47aa0aab6cf03ce57b1;hpb=72dc78092947e9abef71cc98651a11495682bbaf;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/duck.h b/synfig-studio/trunk/src/gtkmm/duck.h index 179fba7..9ba7b00 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.h +++ b/synfig-studio/trunk/src/gtkmm/duck.h @@ -6,6 +6,7 @@ ** ** \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 @@ -90,13 +91,13 @@ class Duck : public etl::shared_object 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), @@ -134,6 +135,8 @@ private: bool editable; bool radius_; bool tangent_; + bool hover_; + bool ignore_; synfig::TransformStack transform_stack_; @@ -167,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; } @@ -236,6 +251,15 @@ public: synfig::String get_name()const { return name; } bool operator==(const Duck &rhs)const; + +#ifdef _DEBUG + //! Returns a string containing the name of the given Type + static synfig::String type_name(Type id); + + //! Returns a string containing the name of the type + synfig::String type_name()const { return type_name(get_type()); } +#endif // _DEBUG + }; // END of class Duck //! Combine Flags