From: shiva.jm Date: Thu, 27 Oct 2016 11:16:43 +0000 (+0530) Subject: Added Doxygen Comments and updated sample application X-Git-Tag: dali_1.2.12~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=74cda010c61b1e6992347e44a48aa2ee9f3b9572 Added Doxygen Comments and updated sample application Change-Id: I35f6834d28dd83a430f78ea3775a9eae4e24d029 Signed-off-by: shiva.jm --- diff --git a/plugins/dali-swig/SWIG/events/stage-event.i b/plugins/dali-swig/SWIG/events/stage-event.i index c370aae..74693cd 100644 --- a/plugins/dali-swig/SWIG/events/stage-event.i +++ b/plugins/dali-swig/SWIG/events/stage-event.i @@ -524,6 +524,8 @@ public class SceneCreatedEventArgs : EventArgs } } + ///< name "Size", type Dali.Size (Stage Size value) + //@since 1.0.0 public Dali.Size Size { get @@ -534,6 +536,8 @@ public class SceneCreatedEventArgs : EventArgs } } + ///< name "BackgroundColor", type Dali.Color (Stage background color value) + //@since 1.0.0 public Dali.Color BackgroundColor { set diff --git a/plugins/dali-swig/examples/dali-test.cs b/plugins/dali-swig/examples/dali-test.cs index 2ad3b17..27b04bf 100644 --- a/plugins/dali-swig/examples/dali-test.cs +++ b/plugins/dali-swig/examples/dali-test.cs @@ -48,15 +48,15 @@ namespace MyCSharpExample handle.GetProperty(myPropertyIndex).Get(ref myProperty); Console.WriteLine( "myProperty value: " + myProperty ); - int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Vector2(5.0f, 5.0f)), Property.AccessMode.READ_WRITE); - Vector2 myProperty2 = new Vector2(0.0f, 0.0f); + int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Size(5.0f, 5.0f)), Property.AccessMode.READ_WRITE); + Size myProperty2 = new Size(0.0f, 0.0f); handle.GetProperty(myPropertyIndex2).Get(myProperty2); Console.WriteLine( "myProperty2 value: " + myProperty2.x + ", " + myProperty2.y ); Actor actor = new Actor(); - actor.Size = new Vector3(200.0f, 200.0f, 0.0f); + actor.Size = new Position(200.0f, 200.0f, 0.0f); actor.Name = "MyActor"; - actor.Color = new Vector4(1.0f, 0.0f, 1.0f, 0.8f); + actor.Color = new Color(1.0f, 0.0f, 1.0f, 0.8f); Console.WriteLine("Actor id: {0}", actor.GetId()); Console.WriteLine("Actor size: " + actor.Size.x + ", " + actor.Size.y); Console.WriteLine("Actor name: " + actor.Name); @@ -140,29 +140,29 @@ namespace MyCSharpExample Console.WriteLine( " Size width = " + Size[0] + ", height = " + Size[1] ); Console.WriteLine( " *************************" ); - Vector3 vector3 = new Vector3(20, 100, 50); - Console.WriteLine( " Created " + vector3 ); - Console.WriteLine( " Vector3 x = " + vector3.x + ", y = " + vector3.y + ", z = " + vector3.z ); - vector3 += new Vector3(20, 20, 20); - Console.WriteLine( " Vector3 x = " + vector3[0] + ", y = " + vector3[1] + ", z = " + vector3[2] ); - vector3.x += 10; - vector3.y += 10; - vector3.z += 10; - Console.WriteLine( " Vector3 width = " + vector3.width + ", height = " + vector3.height + ", depth = " + vector3.depth ); - Vector3 parentOrigin = NDalic.ParentOriginBottomRight; + Position Position = new Position(20, 100, 50); + Console.WriteLine( " Created " + Position ); + Console.WriteLine( " Position x = " + Position.x + ", y = " + Position.y + ", z = " + Position.z ); + Position += new Position(20, 20, 20); + Console.WriteLine( " Position x = " + Position[0] + ", y = " + Position[1] + ", z = " + Position[2] ); + Position.x += 10; + Position.y += 10; + Position.z += 10; + Console.WriteLine( " Position width = " + Position.width + ", height = " + Position.height + ", depth = " + Position.depth ); + Position parentOrigin = new Dali.Position(NDalic.ParentOriginBottomRight); Console.WriteLine( " parentOrigin x = " + parentOrigin.x + ", y = " + parentOrigin.y + ", z = " + parentOrigin.z ); Console.WriteLine( " *************************" ); - Vector4 vector4 = new Vector4(20, 100, 50, 200); - Console.WriteLine( " Created " + vector4 ); - Console.WriteLine( " Vector4 x = " + vector4.x + ", y = " + vector4.y + ", z = " + vector4.z + ", w = " + vector4.w ); - vector4 += new Vector4(20, 20, 20, 20); - Console.WriteLine( " Vector4 x = " + vector4[0] + ", y = " + vector4[1] + ", z = " + vector4[2] + ", w = " + vector4[3] ); - vector4.x += 10; - vector4.y += 10; - vector4.z += 10; - vector4.w += 10; - Console.WriteLine( " Vector4 r = " + vector4.r + ", g = " + vector4.g + ", b = " + vector4.b + ", a = " + vector4.a ); + Color Color = new Color(20, 100, 50, 200); + Console.WriteLine( " Created " + Color ); + Console.WriteLine( " Color x = " + Color.x + ", y = " + Color.y + ", z = " + Color.z + ", w = " + Color.w ); + Color += new Color(20, 20, 20, 20); + Console.WriteLine( " Color x = " + Color[0] + ", y = " + Color[1] + ", z = " + Color[2] + ", w = " + Color[3] ); + Color.x += 10; + Color.y += 10; + Color.z += 10; + Color.w += 10; + Console.WriteLine( " Color r = " + Color.r + ", g = " + Color.g + ", b = " + Color.b + ", a = " + Color.a ); } diff --git a/plugins/dali-swig/manual/csharp/Color.cs b/plugins/dali-swig/manual/csharp/Color.cs index 2d8ef92..0082950 100644 --- a/plugins/dali-swig/manual/csharp/Color.cs +++ b/plugins/dali-swig/manual/csharp/Color.cs @@ -24,12 +24,12 @@ public class Color : Vector4 public Color(float red, float green, float blue, float alpha) : base(red, green, blue, alpha) { } - + /** * @brief constructor * * @since 1.0.0 - * @param [in] o The Vector Position r, g, b, a. + * @param [in] o The Vector4 having r g b a components */ public Color(Vector4 o) : base(o.x, o.y, o.z, o.w) @@ -95,32 +95,41 @@ public class Color : Vector4 a = alpha; } - ///< name "R", type float (Color R value) - //@since 1.0.0 + /** + * @brief name "R", type float (Color's Red component) + * @SINCE_1_0.0 + */ + public float R { get { return r; } set { r = value; } } - ///< name "G", type float (Color G value) - //@since 1.0.0 + /** + * @brief name "G", type float (Color's Green component) + * @SINCE_1_0.0 + */ public float G { get { return g; } set { g = value; } } - ///< name "B", type float (Color B value) - //@since 1.0.0 + /** + * @brief name "B", type float (Color's Blue component) + * @SINCE_1_0.0 + */ public float B { get { return b; } set { b = value; } } - ///< name "A", type float (Color A value) - //@since 1.0.0 + /** + * @brief name "A", type float (Color's Alpha value) + * @SINCE_1_0.0 + */ public float A { get { return a; } @@ -128,6 +137,58 @@ public class Color : Vector4 } /** + * @brief operator+ + * + * @since 1.0.0 + * @param [in] l The Color to add. + * @param [in] r The Color to add + * @return A reference to this + */ + public static Color operator +(Color l, Color r) + { + return new Color(l.R + r.R, l.G + r.G, l.B + r.B, l.A + r.A); + } + + /** + * @brief operator- + * + * @since 1.0.0 + * @param [in] l The Color to substract. + * @param [in] r The Color to substract + * @return A reference to this + */ + public static Color operator -(Color l, Color r) + { + return new Color(l.R - r.R, l.G - r.G, l.B - r.B, l.A - r.A); + } + + /** + * @brief operator* + * + * @since 1.0.0 + * @param [in] a The Color to multiply. + * @param [in] b The Color to multiply + * @return A reference to this + */ + public static Color operator *(Color a, double b) + { + return new Color((int)(a.R * b), (int)(a.G * b), (int)(a.B * b), (int)(a.A * b)); + } + + /** + * @brief operator/ + * + * @since 1.0.0 + * @param [in] a The Color to divide. + * @param [in] b The Color to divide + * @return float value of division operation + */ + public static float operator /(Color a, Color b) + { + return (float)System.Math.Sqrt((a.R / b.R) * (a.G / b.G) * (a.B / b.B) * (a.A / b.A)); + } + + /** * @brief Equals * * @since 1.0.0 diff --git a/plugins/dali-swig/manual/csharp/Position.cs b/plugins/dali-swig/manual/csharp/Position.cs index 0cde598..d56c414 100644 --- a/plugins/dali-swig/manual/csharp/Position.cs +++ b/plugins/dali-swig/manual/csharp/Position.cs @@ -80,8 +80,8 @@ public class Position : Vector3 * @brief operator- * * @since 1.0.0 - * @param [in] l The Position to add. - * @param [in] r The Position to add + * @param [in] l The Position to substract. + * @param [in] r The Position to substract * @return A reference to this */ public static Position operator -(Position l, Position r) @@ -93,8 +93,8 @@ public class Position : Vector3 * @brief operator* * * @since 1.0.0 - * @param [in] l The Position to add. - * @param [in] r The Position to add + * @param [in] a The Position to multiply. + * @param [in] b The Position to multiply * @return A reference to this */ public static Position operator *(Position a, double b) @@ -106,9 +106,9 @@ public class Position : Vector3 * @brief operator/ * * @since 1.0.0 - * @param [in] l The Position to add. - * @param [in] r The Position to add - * @return A reference to this + * @param [in] a The Position to divide. + * @param [in] b The Position to divide + * @return float value of division operation */ public static float operator /(Position a, Position b) { @@ -120,7 +120,6 @@ public class Position : Vector3 * * @since 1.0.0 * @param [in] o The Position object to compare. - * @param [in] r The Position to add * @return bool, whether object equal or not */ public override bool Equals(object obj) @@ -148,7 +147,7 @@ public class Position : Vector3 * @brief Clone * * @since 1.0.0 - * @return Positin object + * @return Position object */ public Position Clone() { diff --git a/plugins/dali-swig/manual/csharp/Size.cs b/plugins/dali-swig/manual/csharp/Size.cs index 79f2dff..07934ff 100644 --- a/plugins/dali-swig/manual/csharp/Size.cs +++ b/plugins/dali-swig/manual/csharp/Size.cs @@ -9,15 +9,15 @@ public class Size : Vector2 * @brief constructor * * @since 1.0.0 - * @param [in] a The Size X. - * @param [in] b The Size Y. + * @param [in] a Width value . + * @param [in] b Height value. */ public Size(float a, float b) : base(a, b) { } /** - * @brief constructor + * @brief default constructor * * @since 1.0.0 */ @@ -27,10 +27,10 @@ public class Size : Vector2 } /** - * @brief constructor + * @brief constructor with base class object * * @since 1.0.0 - * @param [in] o The Vector Size X, Y. + * @param [in] o The Vector2 with Width, Height values. */ public Size(Vector2 o) : base(o.x, o.y) @@ -39,17 +39,17 @@ public class Size : Vector2 } /** - * @brief constructor + * @brief Copy constructor * * @since 1.0.0 - * @param [in] o The Size X, Y. + * @param [in] o The Size having Width & Y. */ public Size(Size a) : base(a.width, a.height) { } - ///< name "W", type float (Size W value) + ///< name "W", type float (Size Width value) //@since 1.0.0 public float W { @@ -57,7 +57,7 @@ public class Size : Vector2 set { width = value; } } - ///< name "H", type float (Size W value) + ///< name "H", type float (Size Height value) //@since 1.0.0 public float H { @@ -82,8 +82,8 @@ public class Size : Vector2 * @brief operator- * * @since 1.0.0 - * @param [in] l The Size to add. - * @param [in] r The Size to add + * @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) @@ -95,8 +95,8 @@ public class Size : Vector2 * @brief operator* * * @since 1.0.0 - * @param [in] l The Size to add. - * @param [in] r The Size to add + * @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) @@ -108,9 +108,9 @@ public class Size : Vector2 * @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 + * @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) { @@ -121,8 +121,7 @@ public class Size : Vector2 * @brief Equals * * @since 1.0.0 - * @param [in] o The Size object to compare. - * @param [in] r The Size to add + * @param [in] obj The Size object to compare. * @return bool, whether object equal or not */ public override bool Equals(object obj) @@ -150,7 +149,7 @@ public class Size : Vector2 * @brief Clone * * @since 1.0.0 - * @return Size object + * @return returns a copy of Size object */ public Size Clone() {