From: Ravi Nanjundappa Date: Mon, 24 Oct 2016 16:11:54 +0000 (+0530) Subject: DALi C# binding - adding property for Animation LoopCount and others. X-Git-Tag: dali_1.2.12~10^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=cb9a06d0a6d5f8c80baa0436fa6906acb86f20c3 DALi C# binding - adding property for Animation LoopCount and others. Implemented setters and getters for the property LoopCount in Animation Class and the X,Y,W and H properties in RectInteger Class. Combined the opacity and CurrentOpacity properties in Actor class. The properties Size(from Stage class) and Visibility(from Actor class) are already present. The Patch also contain the Changed order of the types in the generic parameters to match the declaration in AnimateBy and AnimateTo APIs. Change-Id: I8286f4ae19c40b3911e0d12f6874f7c2b184c26c Signed-off-by: Ravi Nanjundappa --- diff --git a/plugins/dali-swig/SWIG/dali.i b/plugins/dali-swig/SWIG/dali.i index e76ba22..e7d633f 100755 --- a/plugins/dali-swig/SWIG/dali.i +++ b/plugins/dali-swig/SWIG/dali.i @@ -200,6 +200,7 @@ using namespace Dali::Toolkit; %include events/pangesture-event.i %include events/propertynotification-event.i %include events/longpressgesture-event.i +%include events/rectinteger.i %include events/resourceimage-event.i %include events/scrollable-event.i %include events/scrollbar-event.i diff --git a/plugins/dali-swig/SWIG/events/actor-event.i b/plugins/dali-swig/SWIG/events/actor-event.i index 4a5f51f..7eca466 100644 --- a/plugins/dali-swig/SWIG/events/actor-event.i +++ b/plugins/dali-swig/SWIG/events/actor-event.i @@ -610,16 +610,12 @@ { SetOpacity(value); } - } - - public float CurrentOpacity - { get { float ret = GetCurrentOpacity(); return ret; } - } + } public bool StateFocusEnable { diff --git a/plugins/dali-swig/SWIG/events/animation-event.i b/plugins/dali-swig/SWIG/events/animation-event.i index 323a6fc..4690317 100644 --- a/plugins/dali-swig/SWIG/events/animation-event.i +++ b/plugins/dali-swig/SWIG/events/animation-event.i @@ -207,56 +207,69 @@ using System.Runtime.InteropServices; } } - public void AnimateBy(Actor target, U propertyIndex, T relativeValue) + public int LoopCount + { + set + { + SetLoopCount(value); + } + get + { + int ret = GetLoopCount(); + return ret; + } + } + + public void AnimateBy(Actor target, T propertyIndex, U relativeValue) { dynamic var = (object)(propertyIndex); dynamic obj = (object)(relativeValue); AnimateBy(new Property(target, var), new Property.Value(obj)); } - public void AnimateBy(Actor target, U propertyIndex, T relativeValue, AlphaFunction alpha) + public void AnimateBy(Actor target, T propertyIndex, U relativeValue, AlphaFunction alpha) { dynamic var = (object)(propertyIndex); dynamic obj = (object)(relativeValue); AnimateBy(new Property(target, var), new Property.Value(obj), alpha); } - public void AnimateBy(Actor target, U propertyIndex, T relativeValue, TimePeriod period) + public void AnimateBy(Actor target, T propertyIndex, U relativeValue, TimePeriod period) { dynamic var = (object)(propertyIndex); dynamic obj = (object)(relativeValue); AnimateBy(new Property(target, var), new Property.Value(obj), period); } - public void AnimateBy(Actor target, U propertyIndex, T relativeValue, AlphaFunction alpha, TimePeriod period) + public void AnimateBy(Actor target, T propertyIndex, U relativeValue, AlphaFunction alpha, TimePeriod period) { dynamic var = (object)(propertyIndex); dynamic obj = (object)(relativeValue); AnimateBy(new Property(target, var), new Property.Value(obj), alpha, period); } - public void AnimateTo(Actor target, U propertyIndex, T destinationValue) + public void AnimateTo(Actor target, T propertyIndex, U destinationValue) { dynamic var = (object)(propertyIndex); dynamic obj = (object)(destinationValue); AnimateTo(new Property(target, var), new Property.Value(obj)); } - public void AnimateTo(Actor target, U propertyIndex, T destinationValue, AlphaFunction alpha) + public void AnimateTo(Actor target, T propertyIndex, U destinationValue, AlphaFunction alpha) { dynamic var = (object)(propertyIndex); dynamic obj = (object)(destinationValue); AnimateTo(new Property(target, var), new Property.Value(obj), alpha); } - public void AnimateTo(Actor target, U propertyIndex, T destinationValue, TimePeriod period) + public void AnimateTo(Actor target, T propertyIndex, U destinationValue, TimePeriod period) { dynamic var = (object)(propertyIndex); dynamic obj = (object)(destinationValue); AnimateTo(new Property(target, var), new Property.Value(obj), period); } - public void AnimateTo(Actor target, U propertyIndex, T destinationValue, AlphaFunction alpha, TimePeriod period) + public void AnimateTo(Actor target, T propertyIndex, U destinationValue, AlphaFunction alpha, TimePeriod period) { dynamic var = (object)(propertyIndex); dynamic obj = (object)(destinationValue); diff --git a/plugins/dali-swig/SWIG/events/rectinteger.i b/plugins/dali-swig/SWIG/events/rectinteger.i new file mode 100644 index 0000000..b89d1f5 --- /dev/null +++ b/plugins/dali-swig/SWIG/events/rectinteger.i @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +%define DALI_RECTINTEGER_PROPERTY_PARAM(NameSpace,ClassName) + %typemap(cscode) NameSpace::ClassName %{ + + public int X { + set { + NDalicPINVOKE.RectInteger_x_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get { + int ret = NDalicPINVOKE.RectInteger_x_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public int Y { + set { + NDalicPINVOKE.RectInteger_y_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get { + int ret = NDalicPINVOKE.RectInteger_y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public int W { + set { + NDalicPINVOKE.RectInteger_width_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get { + int ret = NDalicPINVOKE.RectInteger_width_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public int H { + set { + NDalicPINVOKE.RectInteger_height_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get { + int ret = NDalicPINVOKE.RectInteger_height_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + +%} + +%enddef + +namespace Dali +{ + DALI_RECTINTEGER_PROPERTY_PARAM( Dali, Rect); +}