Skip to content

Commit

Permalink
[NUI] PivotPoint - Remove unnecessary PInvoke calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Woochan Lee committed Jan 8, 2025
1 parent e414820 commit 530ea6f
Showing 1 changed file with 38 additions and 135 deletions.
173 changes: 38 additions & 135 deletions src/Tizen.NUI/src/public/Common/NUIConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1424,198 +1424,101 @@ public struct ParentOrigin
/// <since_tizen> 3 </since_tizen>
public struct PivotPoint
{
private static readonly Position topLeft = new Position(Top, Left, Middle);
private static readonly Position topCenter = new Position(Top, Middle, Middle);
private static readonly Position topRight = new Position(Top, Right, Middle);
private static readonly Position centerLeft = new Position(Middle, Left, Middle);
private static readonly Position center = new Position(Middle, Middle, Middle);
private static readonly Position centerRight = new Position(Middle, Right, Middle);
private static readonly Position bottomLeft = new Position(Bottom, Left, Middle);
private static readonly Position bottomCenter = new Position(Bottom, Middle, Middle);
private static readonly Position bottomRight = new Position(Bottom, Right, Middle);

/// <summary>
/// Top
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static float Top
{
get
{
float ret = Interop.NDalicAnchorPoint.AnchorPointTopGet();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static float Top => 0.0f;

/// <summary>
/// Bottom
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static float Bottom
{
get
{
float ret = Interop.NDalicAnchorPoint.AnchorPointBottomGet();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static float Bottom => 1.0f;

/// <summary>
/// Left
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static float Left
{
get
{
float ret = Interop.NDalicAnchorPoint.AnchorPointLeftGet();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static float Left => 0.0f;

/// <summary>
/// Right
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static float Right
{
get
{
float ret = Interop.NDalicAnchorPoint.AnchorPointRightGet();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static float Right => 1.0f;

/// <summary>
/// Middle
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static float Middle
{
get
{
float ret = Interop.NDalicAnchorPoint.AnchorPointMiddleGet();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static float Middle => 0.5f;

/// <summary>
/// TopLeft
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position TopLeft
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopLeftGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position TopLeft => topLeft;

/// <summary>
/// TopCenter
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position TopCenter
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopCenterGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position TopCenter => topCenter;

/// <summary>
/// TopRight
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position TopRight
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopRightGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position TopRight => topRight;

/// <summary>
/// CenterLeft
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position CenterLeft
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterLeftGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position CenterLeft => centerLeft;

/// <summary>
/// Center
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position Center
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position Center => center;

/// <summary>
/// CenterRight
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position CenterRight
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterRightGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position CenterRight => centerRight;

/// <summary>
/// BottomLeft
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position BottomLeft
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomLeftGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position BottomLeft => bottomLeft;

/// <summary>
/// BottomCenter
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position BottomCenter
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomCenterGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position BottomCenter => bottomCenter;

/// <summary>
/// BottomRight
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Position BottomRight
{
get
{
global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomRightGet();
Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
}
public static Position BottomRight => bottomRight;
}

/// <summary>
/// PositionAxis constants.
/// </summary>
Expand Down

0 comments on commit 530ea6f

Please sign in to comment.