/*
* 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.Diagnostics;
using System.Runtime.CompilerServices;
namespace Tizen.NUI
{
namespace Constants
{
///
/// Enumeration for texture types.
///
/// 3
public enum TextureType
{
///
/// One 2D image
///
/// 3
Texture2D = Tizen.NUI.TextureType.TEXTURE_2D,
///
/// Six 2D images arranged in a cube-shape
///
/// 3
TextureCube = Tizen.NUI.TextureType.TEXTURE_CUBE
}
///
/// Enumeration for the direction
///
/// 3
public struct Direction
{
///
/// Enumeration for the Direction types.
///
/// 3
public enum Type
{
///
/// from Left to Right
///
/// 3
LeftToRight = Tizen.NUI.DirectionType.LEFT_TO_RIGHT,
///
/// from Right to Left
///
/// 3
RightToLeft = Tizen.NUI.DirectionType.RIGHT_TO_LEFT
}
}
///
/// Tooltip
///
/// 3
public struct Tooltip
{
///
/// The properties used for a Tooltip.
///
/// 3
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1716: Identifiers should not match keywords")]
public struct Property
{
///
/// The content to display.
///
/// 3
public static readonly int Content = NDalic.TooltipContent;
///
/// The layout of the content.
/// \
/// 3
public static readonly int Layout = NDalic.TooltipLayout;
///
/// Time to wait in seconds before a tooltip is shown while the is movement is within the allowed threshold.
///
/// 3
public static readonly int WaitTime = NDalic.TooltipWaitTime;
///
/// The background of the tooltip.
///
/// 3
public static readonly int Background = NDalic.TooltipBackground;
///
/// The tail used by the tooltip.
///
/// 3
public static readonly int Tail = NDalic.TooltipTail;
///
/// The position of the tooltip in relation to the control.
///
/// 3
public static readonly int Position = NDalic.TooltipPosition;
///
/// If Tooltip::Position::HOVER_POINT is used for the POSITION, then this is the offset the tooltip is displayed at from the hover point.
///
/// 3
public static readonly int HoverPointOffset = NDalic.TooltipHoverPointOffset;
///
/// The movement threshold allowed before showing (or hiding a popup).
///
/// 3
public static readonly int MovementThreshold = NDalic.TooltipMovementThreshold;
///
/// If true, the tooltip will disappear after hover movement beyond a certain distance.
///
/// 3
public static readonly int DisappearOnMovement = NDalic.TooltipDisappearOnMovement;
}
///
/// Background Property
///
/// 3
public struct BackgroundProperty
{
///
/// The image to use as the background.
///
/// 3
public static readonly int Visual = NDalic.TooltipBackgroundVisual;
///
/// The size of the borders in the order: left, right, bottom, top.
///
/// 3
public static readonly int Border = NDalic.TooltipBackgroundBorder;
}
///
/// The properties of the tail used by the tooltip.
///
/// 3
public struct TailProperty
{
///
/// Whether to show the tail or not.
///
/// 3
public static readonly int Visibility = NDalic.TooltipTailVisibility;
///
/// The image used for the tail if it is above the tooltip.
///
/// 3
public static readonly int AboveVisual = NDalic.TooltipTailAboveVisual;
///
/// The image used for the tail if it is below the tooltip.
///
/// 3
public static readonly int BelowVisual = NDalic.TooltipTailBelowVisual;
}
}
///
/// Enumeration for stereoscopic view modes.
///
/// 3
///
/// Deprecated.(API Level 6) Not used.
///
[Obsolete("Do not use this ViewMode(Deprecated).")]
public enum ViewMode
{
///
/// Monoscopic (single camera). This is the default.
///
/// 3
///
/// Deprecated.(API Level 6) Not used.
///
[Obsolete("Do not use this ViewMode.Mono(Deprecated).")]
Mono,
///
/// Stereoscopic. Frame buffer is split horizontally with the left and right camera views in their respective sides.
///
/// 3
///
/// Deprecated.(API Level 6) Not used.
///
[Obsolete("Do not use this ViewMode.StereoHorizontal(Deprecated).")]
StereoHorizontal,
///
/// Stereoscopic. Frame buffer is split vertically with the left camera view at the top and the right camera view at the bottom.
///
/// 3
///
/// Deprecated.(API Level 6) Not used.
///
[Obsolete("Do not use this ViewMode.StereoVertical(Deprecated).")]
StereoVertical,
///
/// Stereoscopic. Left/Right camera views are rendered into the framebuffer on alternate frames.
///
/// 3
///
/// Deprecated.(API Level 6) Not used.
///
[Obsolete("Do not use this ViewMode.StereoInterlaced(Deprecated).")]
StereoInterlaced
}
} // namespace Constants
internal class NUILog
{
[Conditional("NUI_DEBUG_ON")]
public static void Debug(string msg,
[CallerLineNumber] int lineNum = 0,
[CallerMemberName] string caller = null,
[CallerFilePath] string file = null
)
{
Tizen.Log.Error("NUI", $"{msg} (at line {lineNum} of {caller} in {file})\n");
}
public static void Error(string msg,
[CallerLineNumber] int lineNum = 0,
[CallerMemberName] string caller = null,
[CallerFilePath] string file = null
)
{
Tizen.Log.Error("NUI", $"{msg} (at line {lineNum} of {caller} in {file})\n");
}
public static void ErrorBacktrace(string msg,
[CallerLineNumber] int lineNum = 0,
[CallerMemberName] string caller = null,
[CallerFilePath] string file = null
)
{
Tizen.Log.Error("NUI", $"[ERR]{msg} (at line {lineNum} of {caller} in {file})\n");
Tizen.Log.Error("NUI", $"[ERR] Back Trace =>");
global::System.Diagnostics.StackTrace st = new global::System.Diagnostics.StackTrace(true);
for (int i = 0; i < st.FrameCount; i++)
{
global::System.Diagnostics.StackFrame sf = st.GetFrame(i);
Tizen.Log.Error("NUI", " Method " + sf.GetMethod());
}
}
}
}