X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvalue.h;h=0195db53d4fbfa87f0ec6a5e2f22c790e9571a7c;hb=1a5b665468b32fc50f15b381dbc4964600428e38;hp=3e843a647ad1fa6f11c826165a65c844aa638696;hpb=2cd9008c7de44187fe5f7caded1a3050d223a3ae;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/value.h b/synfig-core/trunk/src/synfig/value.h index 3e843a6..0195db5 100644 --- a/synfig-core/trunk/src/synfig/value.h +++ b/synfig-core/trunk/src/synfig/value.h @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 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 @@ -204,14 +205,20 @@ public: { const Type testtype(get_type(x)); - return same_type_as(testtype); + return same_type_as(type, testtype); } bool same_type_as(const Type testtype)const { - if(testtype==type)return true; - if( (type==TYPE_REAL || type==TYPE_TIME) && - (testtype==TYPE_REAL || testtype==TYPE_TIME) ) + return same_type_as(type, testtype); + } + + //! Compares two types. Returns true if they are the same type. + static bool same_type_as(const Type type1, const Type type2) + { + if (type1 == type2) return true; + if ((type1 == TYPE_REAL || type1 == TYPE_TIME) && + (type2 == TYPE_REAL || type2 == TYPE_TIME)) return true; return false; } @@ -253,6 +260,7 @@ public: void set(const float &x) { _set(Real(x)); } void set(const list_type &x); void set(const char* x); + void set(char* x); void set(Canvas*x); void set(etl::loose_handle x); void set(etl::handle x); @@ -272,6 +280,9 @@ public: //! Returns a string containing the name of the given Type static String type_name(Type id); + //! Returns a string containing the translated name of the given Type + static String type_local_name(Type id); + //! Returns a the corresponding Type of the described type static Type ident_type(const String &str); @@ -294,9 +305,9 @@ public: static const Type get_type(const etl::loose_handle&) { return TYPE_CANVAS; } static const Type get_type(const list_type&) { return TYPE_LIST; } - template static const Type get_type(const std::vector &x) + template static const Type get_type(const std::vector &/*x*/) { return TYPE_LIST; } - template static const Type get_type(const std::list &x) + template static const Type get_type(const std::list &/*x*/) { return TYPE_LIST; } // ========================================================================