/
CircleSurface.cs
executable file
·81 lines (73 loc) · 2.82 KB
/
CircleSurface.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using System.Collections.Generic;
using System.Text;
namespace ElmSharp.Wearable
{
/// <summary>
/// The CircleSurface presents a surface for drawing the circular feature of circle widgets.
/// </summary>
/// <since_tizen> preview </since_tizen>
public class CircleSurface
{
IntPtr _handle;
/// <summary>
/// Creates and initializes a new instance of the CircleSurface class with a surface on the Conformant widget.
/// </summary>
/// <param name="conformant">The Conformant widget to create a surface.</param>
/// <since_tizen> preview </since_tizen>
public CircleSurface(Conformant conformant)
{
_handle = Interop.Eext.eext_circle_surface_conformant_add(conformant);
}
/// <summary>
/// Creates and initializes a new instance of the CircleSurface class with a surface on the Layout widget.
/// </summary>
/// <param name="layout">The Layout widget to create a surface.</param>
/// <since_tizen> preview </since_tizen>
public CircleSurface(Layout layout)
{
_handle = Interop.Eext.eext_circle_surface_layout_add(layout);
}
/// <summary>
/// Creates and initializes a new instance of the CircleSurface class with a surface on the Naviframe widget.
/// </summary>
/// <param name="naviframe">The Naviframe widget to create a surface.</param>
/// <since_tizen> preview </since_tizen>
public CircleSurface(Naviframe naviframe)
{
_handle = Interop.Eext.eext_circle_surface_naviframe_add(naviframe.RealHandle);
}
/// <summary>
/// Creates and initializes a new instance of the CircleSurface class with no surface.
/// </summary>
/// <since_tizen> preview </since_tizen>
public CircleSurface()
{
_handle = IntPtr.Zero;
}
/// <summary>
/// Gets the handle for CircleSurface.
/// </summary>
/// <since_tizen> preview </since_tizen>
public IntPtr Handle => _handle;
/// <summary>
/// Deletes the given CircleSurface.
/// </summary>
/// <since_tizen> preview </since_tizen>
public void Delete()
{
if (Handle != IntPtr.Zero)
{
Interop.Eext.eext_circle_surface_del(Handle);
_handle = IntPtr.Zero;
}
}
internal static CircleSurface CreateCircleSurface(EvasObject obj)
{
if (obj is Conformant) return new CircleSurface(obj as Conformant);
else if (obj is Naviframe) return new CircleSurface(obj as Naviframe);
else if (obj is Layout) return new CircleSurface(obj as Layout);
else return new CircleSurface();
}
}
}