/*
* Copyright(c) 2021 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;
using System.ComponentModel;
namespace Tizen.NUI
{
///
/// Simple class for window position pairs of integers.
/// Use this for integer position with window coordinates.
///
internal class IntPair : Disposable
{
internal IntPair(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
Interop.IntPair.DeleteIntPair(swigCPtr);
}
///
/// Default constructor for the(0, 0) tuple.
///
public IntPair() : this(Interop.IntPair.NewIntPair(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Default constructor for the(0, 0) tuple.
///
/// The X dimension of the tuple.
/// The Y dimension of the tuple.
public IntPair(int x, int y) : this(Interop.IntPair.NewIntPair(x, y), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Sets the x dimension.
///
/// The x dimension to be stored in this 2-tuple.
public void SetX(int x)
{
Interop.IntPair.SetX(SwigCPtr, x);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Get the x dimension.
///
///
/// The x dimension stored in this 2-tuple.
///
public int GetX()
{
int ret = Interop.IntPair.GetX(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
///
/// Sets the y dimension.
///
/// The y dimension to be stored in this 2-tuple.
public void SetY(int y)
{
Interop.IntPair.SetY(SwigCPtr, y);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Get the y dimension.
///
///
/// The y dimension stored in this 2-tuple.
///
public int GetY()
{
int ret = Interop.IntPair.GetY(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
}