X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Fdali-swig%2Fmanual%2Fcsharp%2FSize.cs;h=07934ff71b905ef6a1f86391d39b78388558d76d;hb=96f93586302a663ae43a654c7bcfcf301f08b9b3;hp=f553d5dbfbc557b732607cb50549b07bcd6d1e5e;hpb=baeb5ad3a0b2b1535c48dfb25f3d7ace66cde857;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/plugins/dali-swig/manual/csharp/Size.cs b/plugins/dali-swig/manual/csharp/Size.cs index f553d5d..07934ff 100644 --- a/plugins/dali-swig/manual/csharp/Size.cs +++ b/plugins/dali-swig/manual/csharp/Size.cs @@ -1,152 +1,160 @@ namespace Dali { - namespace CSharp { - using System; - public class Size { - public float[] v; +using System; - /** - * @brief default constructor - * - * @since 1.0.0 - */ - public Size() - { - v = new float[2]; - } +public class Size : Vector2 + { - /** - * @brief constructor - * - * @since 1.0.0 - * @param [in] a Width value . - * @param [in] b Height value. - */ - public Size(float a, float b):this() - { - v[0] = a; - v[1] = b; - } + /** + * @brief constructor + * + * @since 1.0.0 + * @param [in] a Width value . + * @param [in] b Height value. + */ + public Size(float a, float b) + : base(a, b) + { + } + /** + * @brief default constructor + * + * @since 1.0.0 + */ + public Size() + : base() + { + } - /** - * @brief constructor with vector2 class object - * - * @since 1.0.0 - * @param [in] o The Vector2 with Width, Height values. - */ - public Size(Vector2 o) - : this(o.x, o.y) - { - } + /** + * @brief constructor with base class object + * + * @since 1.0.0 + * @param [in] o The Vector2 with Width, Height values. + */ + public Size(Vector2 o) + : base(o.x, o.y) + { + + } - /** - * @brief Copy constructor - * - * @since 1.0.0 - * @param [in] o The Size having Width & Y. - */ - public Size(Size a) - : this(a.v[0], a.v[1]) - { - } + /** + * @brief Copy constructor + * + * @since 1.0.0 + * @param [in] o The Size having Width & Y. + */ + public Size(Size a) + : base(a.width, a.height) + { + } - ///< name "W", type float (Size Width value) - //@since 1.0.0 - public float W - { - get { return v[0]; } - set { v[0] = value; } - } + ///< name "W", type float (Size Width value) + //@since 1.0.0 + public float W + { + get { return width; } + set { width = value; } + } - ///< name "H", type float (Size Height value) - //@since 1.0.0 - public float H - { - get { return v[1]; } - set { v[1] = value; } - } + ///< name "H", type float (Size Height value) + //@since 1.0.0 + public float H + { + get { return height; } + set { height = value; } + } - /** - * @brief operator+ - * - * @since 1.0.0 - * @param [in] l The Size to add. - * @param [in] r The Size to add - * @return A reference to this - */ - public static Size operator +(Size l, Size r) - { - return new Size(l.W + r.W, l.H + r.H); - } + /** + * @brief operator+ + * + * @since 1.0.0 + * @param [in] l The Size to add. + * @param [in] r The Size to add + * @return A reference to this + */ + public static Size operator +(Size l, Size r) + { + return new Size(l.W + r.W, l.H + r.H); + } - /** - * @brief operator- - * - * @since 1.0.0 - * @param [in] l The Size to substract. - * @param [in] r The Size to substract - * @return A reference to this - */ - public static Size operator -(Size l, Size r) - { - return new Size(l.W - r.W, l.H - r.H); - } + /** + * @brief operator- + * + * @since 1.0.0 + * @param [in] l The Size to substract. + * @param [in] r The Size to substract + * @return A reference to this + */ + public static Size operator -(Size l, Size r) + { + return new Size(l.W - r.W, l.H - r.H); + } - /** - * @brief operator* - * - * @since 1.0.0 - * @param [in] a The Size to multiply - * @param [in] b The Size to multiply - * @return A reference to this - */ - public static Size operator *(Size a, double b) - { - return new Size((float)(a.W * b), (float)(a.H * b)); - } + /** + * @brief operator* + * + * @since 1.0.0 + * @param [in] a The Size to multiply + * @param [in] b The Size to multiply + * @return A reference to this + */ + public static Size operator *(Size a, double b) + { + return new Size((int)(a.W * b), (int)(a.H * b)); + } - /** - * @brief operator/ - * - * @since 1.0.0 - * @param [in] a The Size to divide. - * @param [in] b The Size to divide - * @return float of the size division - */ - public static float operator /(Size a, Size b) - { - return (float)System.Math.Sqrt((a.W / b.W) * (a.H / b.H)); - } + /** + * @brief operator/ + * + * @since 1.0.0 + * @param [in] a The Size to divide. + * @param [in] b The Size to divide + * @return float of the size division + */ + public static float operator /(Size a, Size b) + { + return (float)System.Math.Sqrt((a.W / b.W) * (a.H / b.H)); + } - /** - * @brief Equals - * - * @since 1.0.0 - * @param [in] obj The Size object to compare. - * @return bool, whether object equal or not - */ - public override bool Equals(object obj) - { - Size that = obj as Size; - if (that == null) - { - return false; - } - return this.W == that.W && this.H == that.H; - } + /** + * @brief Equals + * + * @since 1.0.0 + * @param [in] obj The Size object to compare. + * @return bool, whether object equal or not + */ + public override bool Equals(object obj) + { + Size that = obj as Size; + if (that == null) + { + return false; + } + return this.W == that.W && this.H == that.H; + } + /** + * @brief GetHashCode + * + * @since 1.0.0 + * @return int, hascode of Size + */ + public override int GetHashCode() + { + return (int)(W + H); + } - /** - * @brief Clone - * - * @since 1.0.0 - * @return returns a copy of Size object - */ - public Size Clone() - { - Size copy = new Size(W, H); - return copy; - } - } - } + /** + * @brief Clone + * + * @since 1.0.0 + * @return returns a copy of Size object + */ + public Size Clone() + { + Size copy = new Size(W, H); + return copy; + } + } }