From 6eaaeda7321c0c06f561687350a7494d3895290e Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Thu, 9 Mar 2017 18:12:34 +0000 Subject: [PATCH] Add C# bindings for Actor's POSITION_USES_ANCHOR_POINT property Change-Id: Ibb229a530b8c6ef7ddfe8d5e71ee75e689ffcaeb --- plugins/dali-swig/SWIG/devel-properties.i | 1 + plugins/dali-swig/SWIG/events/actor-event.i | 26 +++++++++++++++++----- .../dali-swig/manual/cpp/devel-property-wrap.cpp | 5 +++++ plugins/dali-swig/manual/csharp/ManualPINVOKE.cs | 5 ++++- plugins/dali-swig/manual/csharp/View.cs | 3 +++ 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/plugins/dali-swig/SWIG/devel-properties.i b/plugins/dali-swig/SWIG/devel-properties.i index ac9f032..30a2dfc 100755 --- a/plugins/dali-swig/SWIG/devel-properties.i +++ b/plugins/dali-swig/SWIG/devel-properties.i @@ -30,6 +30,7 @@ public static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get(); public static readonly int OPACITY = NDalicManualPINVOKE.Actor_Property_OPACITY_get(); public static readonly int SCREEN_POSITION = NDalicManualPINVOKE.Actor_Property_SCREEN_POSITION_get(); + public static readonly int POSITION_USES_ANCHOR_POINT = NDalicManualPINVOKE.Actor_Property_POSITION_USES_ANCHOR_POINT_get(); %} %typemap(cscode) Dali::Toolkit::Control::Property %{ diff --git a/plugins/dali-swig/SWIG/events/actor-event.i b/plugins/dali-swig/SWIG/events/actor-event.i index 273ec47..fbf5a8e 100755 --- a/plugins/dali-swig/SWIG/events/actor-event.i +++ b/plugins/dali-swig/SWIG/events/actor-event.i @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -83,26 +83,40 @@ } } - public Vector2 ScreenPosition - { + public Vector2 ScreenPosition + { get { Vector2 temp = new Vector2( 0.0f, 0.0f ); GetProperty( Actor.Property.SCREEN_POSITION ).Get( temp ); return temp; } - } + } - public bool StateFocusEnable + protected bool PositionUsesAnchorPoint { + get + { + bool temp = false; + GetProperty( Actor.Property.POSITION_USES_ANCHOR_POINT ).Get( ref temp ); + return temp; + } set { - SetKeyboardFocusable(value); + SetProperty( Actor.Property.POSITION_USES_ANCHOR_POINT, new Dali.Property.Value( value ) ); } + } + + public bool StateFocusEnable + { get { return IsKeyboardFocusable(); } + set + { + SetKeyboardFocusable(value); + } } public bool IsOnStage diff --git a/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp b/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp index f4fffbd..a1d85dd 100755 --- a/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp +++ b/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp @@ -48,6 +48,11 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_SCREEN_POSITION_get() { return Dali::DevelActor::Property::SCREEN_POSITION; } +SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_POSITION_USES_ANCHOR_POINT_get() { + + return Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT; +} + SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_TOOLTIP_get() { int jresult ; int result; diff --git a/plugins/dali-swig/manual/csharp/ManualPINVOKE.cs b/plugins/dali-swig/manual/csharp/ManualPINVOKE.cs index f439851..6694174 100755 --- a/plugins/dali-swig/manual/csharp/ManualPINVOKE.cs +++ b/plugins/dali-swig/manual/csharp/ManualPINVOKE.cs @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -196,6 +196,9 @@ namespace Dali [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_SCREEN_POSITION_get")] public static extern int Actor_Property_SCREEN_POSITION_get(); + [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_POSITION_USES_ANCHOR_POINT_get")] + public static extern int Actor_Property_POSITION_USES_ANCHOR_POINT_get(); + [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_TOOLTIP_get")] public static extern int View_Property_TOOLTIP_get(); diff --git a/plugins/dali-swig/manual/csharp/View.cs b/plugins/dali-swig/manual/csharp/View.cs index e4b1a02..fbc408f 100644 --- a/plugins/dali-swig/manual/csharp/View.cs +++ b/plugins/dali-swig/manual/csharp/View.cs @@ -28,6 +28,9 @@ public class View : CustomActor { // Register this instance of view in the view registry. ViewRegistry.RegisterView(this); + + // By default, we do not want the position to use the anchor point + this.PositionUsesAnchorPoint = false; } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) { -- 2.7.4