From 8e7863e9e3f7d4c7678fa404d5cd2d04bdf5123b Mon Sep 17 00:00:00 2001 From: Xianbing Teng Date: Thu, 21 Jun 2018 18:27:26 +0800 Subject: [PATCH] [NUI] Add Absolute/Flex/Linear layout class (#305) --- .../src/internal/Layouting/AbsoluteLayout.cs | 104 ++++++++ src/Tizen.NUI/src/internal/Layouting/FlexLayout.cs | 283 +++++++++++++++++++++ .../src/internal/Layouting/LayoutPINVOKE.cs | 114 ++++++++- .../src/internal/Layouting/LinearLayout.cs | 167 ++++++++++++ 4 files changed, 667 insertions(+), 1 deletion(-) create mode 100755 src/Tizen.NUI/src/internal/Layouting/AbsoluteLayout.cs create mode 100755 src/Tizen.NUI/src/internal/Layouting/FlexLayout.cs create mode 100755 src/Tizen.NUI/src/internal/Layouting/LinearLayout.cs diff --git a/src/Tizen.NUI/src/internal/Layouting/AbsoluteLayout.cs b/src/Tizen.NUI/src/internal/Layouting/AbsoluteLayout.cs new file mode 100755 index 0000000..d4a84da --- /dev/null +++ b/src/Tizen.NUI/src/internal/Layouting/AbsoluteLayout.cs @@ -0,0 +1,104 @@ +/** Copyright (c) 2018 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. +* +*/ +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class AbsoluteLayout : LayoutGroupWrapper + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal AbsoluteLayout(global::System.IntPtr cPtr, bool cMemoryOwn) : base(LayoutPINVOKE.AbsoluteLayout_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AbsoluteLayout obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + LayoutPINVOKE.delete_AbsoluteLayout(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(type); + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public AbsoluteLayout() : this(LayoutPINVOKE.AbsoluteLayout_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AbsoluteLayout DownCast(BaseHandle handle) + { + AbsoluteLayout ret = new AbsoluteLayout(LayoutPINVOKE.AbsoluteLayout_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal AbsoluteLayout(AbsoluteLayout other) : this(LayoutPINVOKE.new_AbsoluteLayout__SWIG_1(AbsoluteLayout.getCPtr(other)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal AbsoluteLayout Assign(AbsoluteLayout other) + { + AbsoluteLayout ret = new AbsoluteLayout(LayoutPINVOKE.AbsoluteLayout_Assign(swigCPtr, AbsoluteLayout.getCPtr(other)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal enum PropertyRange + { + CHILD_PROPERTY_START_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX, + CHILD_PROPERTY_END_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000 + } + + } + +} diff --git a/src/Tizen.NUI/src/internal/Layouting/FlexLayout.cs b/src/Tizen.NUI/src/internal/Layouting/FlexLayout.cs new file mode 100755 index 0000000..9ab4035 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Layouting/FlexLayout.cs @@ -0,0 +1,283 @@ +/** Copyright (c) 2018 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. +* +*/ +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class FlexLayout : LayoutGroupWrapper + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal FlexLayout(global::System.IntPtr cPtr, bool cMemoryOwn) : base(LayoutPINVOKE.FlexLayout_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FlexLayout obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + LayoutPINVOKE.delete_FlexLayout(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(type); + } + + + public FlexLayout() : this(LayoutPINVOKE.FlexLayout_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static FlexLayout DownCast(BaseHandle handle) + { + FlexLayout ret = new FlexLayout(LayoutPINVOKE.FlexLayout_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal FlexLayout(FlexLayout other) : this(LayoutPINVOKE.new_FlexLayout__SWIG_1(FlexLayout.getCPtr(other)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal FlexLayout Assign(FlexLayout other) + { + FlexLayout ret = new FlexLayout(LayoutPINVOKE.FlexLayout_Assign(swigCPtr, FlexLayout.getCPtr(other)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetFlexDirection(FlexLayout.FlexDirection flexDirection) + { + LayoutPINVOKE.FlexLayout_SetFlexDirection(swigCPtr, (int)flexDirection); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal FlexLayout.FlexDirection GetFlexDirection() + { + FlexLayout.FlexDirection ret = (FlexLayout.FlexDirection)LayoutPINVOKE.FlexLayout_GetFlexDirection(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetFlexJustification(FlexLayout.FlexJustification flexJustification) + { + LayoutPINVOKE.FlexLayout_SetFlexJustification(swigCPtr, (int)flexJustification); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal FlexLayout.FlexJustification GetFlexJustification() + { + FlexLayout.FlexJustification ret = (FlexLayout.FlexJustification)LayoutPINVOKE.FlexLayout_GetFlexJustification(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetFlexWrap(FlexLayout.FlexWrapType flexWrap) + { + LayoutPINVOKE.FlexLayout_SetFlexWrap(swigCPtr, (int)flexWrap); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal FlexLayout.FlexWrapType GetFlexWrap() + { + FlexLayout.FlexWrapType ret = (FlexLayout.FlexWrapType)LayoutPINVOKE.FlexLayout_GetFlexWrap(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetFlexAlignment(FlexLayout.AlignmentType flexAlignment) + { + LayoutPINVOKE.FlexLayout_SetFlexAlignment(swigCPtr, (int)flexAlignment); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal FlexLayout.AlignmentType GetFlexAlignment() + { + FlexLayout.AlignmentType ret = (FlexLayout.AlignmentType)LayoutPINVOKE.FlexLayout_GetFlexAlignment(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetFlexItemsAlignment(FlexLayout.AlignmentType flexAlignment) + { + LayoutPINVOKE.FlexLayout_SetFlexItemsAlignment(swigCPtr, (int)flexAlignment); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal FlexLayout.AlignmentType GetFlexItemsAlignment() + { + FlexLayout.AlignmentType ret = (FlexLayout.AlignmentType)LayoutPINVOKE.FlexLayout_GetFlexItemsAlignment(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal enum PropertyRange + { + CHILD_PROPERTY_START_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX, + CHILD_PROPERTY_END_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000 + } + + internal class ChildProperty + { + internal static readonly int FLEX = LayoutPINVOKE.FlexLayout_ChildProperty_FLEX_get(); + internal static readonly int ALIGN_SELF = LayoutPINVOKE.FlexLayout_ChildProperty_ALIGN_SELF_get(); + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public FlexDirection Direction + { + get + { + return GetFlexDirection(); + } + set + { + SetFlexDirection(value); + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public FlexJustification Justification + { + get + { + return GetFlexJustification(); + } + set + { + SetFlexJustification(value); + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public FlexWrapType WrapType + { + get + { + return GetFlexWrap(); + } + set + { + SetFlexWrap(value); + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public AlignmentType Alignment + { + get + { + return GetFlexAlignment(); + } + set + { + SetFlexAlignment(value); + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public AlignmentType ItemsAlignment + { + get + { + return GetFlexItemsAlignment(); + } + set + { + SetFlexItemsAlignment(value); + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum FlexDirection + { + Column, + ColumnReverse, + Row, + RowReverse + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum FlexJustification + { + FlexStart, + Center, + FlexEnd, + SpaceBetween, + SpaceAround + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum FlexWrapType + { + NoWrap, + Wrap + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum AlignmentType + { + Auto, + FlexStart, + Center, + FlexEnd, + Stretch + } + } +} diff --git a/src/Tizen.NUI/src/internal/Layouting/LayoutPINVOKE.cs b/src/Tizen.NUI/src/internal/Layouting/LayoutPINVOKE.cs index 3faeb59..4ed3f03 100755 --- a/src/Tizen.NUI/src/internal/Layouting/LayoutPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/Layouting/LayoutPINVOKE.cs @@ -638,7 +638,7 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_LayoutItemPtr_GetPadding")] public static extern global::System.IntPtr LayoutItemPtr_GetPadding(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint = "CSharp_Dali_LayoutItemPtr_SetMeasuredDimensions")] + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_LayoutItemPtr_SetMeasuredDimensions")] public static extern void LayoutItemPtr_SetMeasuredDimensions(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_LayoutItemPtr_DoAction")] @@ -661,5 +661,117 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_LayoutItemPtr_ReferenceCount")] public static extern int LayoutItemPtr_ReferenceCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AbsoluteLayout_SWIGUpcast")] + public static extern global::System.IntPtr AbsoluteLayout_SWIGUpcast(global::System.IntPtr jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_AbsoluteLayout__SWIG_0")] + public static extern global::System.IntPtr new_AbsoluteLayout__SWIG_0(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AbsoluteLayout_New")] + public static extern global::System.IntPtr AbsoluteLayout_New(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AbsoluteLayout_DownCast")] + public static extern global::System.IntPtr AbsoluteLayout_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_AbsoluteLayout__SWIG_1")] + public static extern global::System.IntPtr new_AbsoluteLayout__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AbsoluteLayout_Assign")] + public static extern global::System.IntPtr AbsoluteLayout_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_AbsoluteLayout")] + public static extern void delete_AbsoluteLayout(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_SWIGUpcast")] + public static extern global::System.IntPtr FlexLayout_SWIGUpcast(global::System.IntPtr jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_ChildProperty_FLEX_get")] + public static extern int FlexLayout_ChildProperty_FLEX_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_ChildProperty_ALIGN_SELF_get")] + public static extern int FlexLayout_ChildProperty_ALIGN_SELF_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_FlexLayout__SWIG_0")] + public static extern global::System.IntPtr new_FlexLayout__SWIG_0(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_New")] + public static extern global::System.IntPtr FlexLayout_New(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_DownCast")] + public static extern global::System.IntPtr FlexLayout_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_FlexLayout__SWIG_1")] + public static extern global::System.IntPtr new_FlexLayout__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_Assign")] + public static extern global::System.IntPtr FlexLayout_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_FlexLayout")] + public static extern void delete_FlexLayout(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_SetFlexDirection")] + public static extern void FlexLayout_SetFlexDirection(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_GetFlexDirection")] + public static extern int FlexLayout_GetFlexDirection(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_SetFlexJustification")] + public static extern void FlexLayout_SetFlexJustification(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_GetFlexJustification")] + public static extern int FlexLayout_GetFlexJustification(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_SetFlexWrap")] + public static extern void FlexLayout_SetFlexWrap(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_GetFlexWrap")] + public static extern int FlexLayout_GetFlexWrap(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_SetFlexAlignment")] + public static extern void FlexLayout_SetFlexAlignment(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_GetFlexAlignment")] + public static extern int FlexLayout_GetFlexAlignment(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_SetFlexItemsAlignment")] + public static extern void FlexLayout_SetFlexItemsAlignment(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_FlexLayout_GetFlexItemsAlignment")] + public static extern int FlexLayout_GetFlexItemsAlignment(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LinearLayout_SWIGUpcast")] + public static extern global::System.IntPtr LinearLayout_SWIGUpcast(global::System.IntPtr jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_LinearLayout__SWIG_0")] + public static extern global::System.IntPtr new_LinearLayout__SWIG_0(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LinearLayout_New")] + public static extern global::System.IntPtr LinearLayout_New(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LinearLayout_DownCast")] + public static extern global::System.IntPtr LinearLayout_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_LinearLayout__SWIG_1")] + public static extern global::System.IntPtr new_LinearLayout__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LinearLayout_Assign")] + public static extern global::System.IntPtr LinearLayout_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_LinearLayout")] + public static extern void delete_LinearLayout(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LinearLayout_SetCellPadding")] + public static extern void LinearLayout_SetCellPadding(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LinearLayout_GetCellPadding")] + public static extern global::System.IntPtr LinearLayout_GetCellPadding(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LinearLayout_SetOrientation")] + public static extern void LinearLayout_SetOrientation(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LinearLayout_GetOrientation")] + public static extern int LinearLayout_GetOrientation(global::System.Runtime.InteropServices.HandleRef jarg1); + } } diff --git a/src/Tizen.NUI/src/internal/Layouting/LinearLayout.cs b/src/Tizen.NUI/src/internal/Layouting/LinearLayout.cs new file mode 100755 index 0000000..0bdc36d --- /dev/null +++ b/src/Tizen.NUI/src/internal/Layouting/LinearLayout.cs @@ -0,0 +1,167 @@ +/** Copyright (c) 2018 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. +* +*/ +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class LinearLayout : LayoutGroupWrapper + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal LinearLayout(global::System.IntPtr cPtr, bool cMemoryOwn) : base(LayoutPINVOKE.LinearLayout_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LinearLayout obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + LayoutPINVOKE.delete_LinearLayout(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(); + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public LinearLayout() : this(LayoutPINVOKE.LinearLayout_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public new static LinearLayout DownCast(BaseHandle handle) + { + LinearLayout ret = new LinearLayout(LayoutPINVOKE.LinearLayout_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal LinearLayout(LinearLayout other) : this(LayoutPINVOKE.new_LinearLayout__SWIG_1(LinearLayout.getCPtr(other)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal LinearLayout Assign(LinearLayout other) + { + LinearLayout ret = new LinearLayout(LayoutPINVOKE.LinearLayout_Assign(swigCPtr, LinearLayout.getCPtr(other)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetCellPadding(LayoutSize size) + { + LayoutPINVOKE.LinearLayout_SetCellPadding(swigCPtr, LayoutSize.getCPtr(size)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal LayoutSize GetCellPadding() + { + LayoutSize ret = new LayoutSize(LayoutPINVOKE.LinearLayout_GetCellPadding(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + + internal void SetOrientation(LinearLayout.Orientation orientation) + { + LayoutPINVOKE.LinearLayout_SetOrientation(swigCPtr, (int)orientation); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal LinearLayout.Orientation GetOrientation() + { + LinearLayout.Orientation ret = (LinearLayout.Orientation)LayoutPINVOKE.LinearLayout_GetOrientation(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal enum PropertyRange + { + CHILD_PROPERTY_START_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX, + CHILD_PROPERTY_END_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000 + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public LinearLayout.Orientation LinearOrientation + { + get + { + return GetOrientation(); + } + set + { + SetOrientation(value); + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public LayoutSize CellPadding + { + get + { + return GetCellPadding(); + } + set + { + SetCellPadding(value); + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum Orientation + { + Horizontal, + Vertical + } + + } + +} -- 2.7.4