using System; using System.Collections.Generic; using System.Text; namespace ElmSharp.Wearable { /// /// The CircleSurface presents a surface for drawing the circular feature of circle widgets. /// /// preview public class CircleSurface { IntPtr _handle; /// /// Creates and initializes a new instance of the CircleSurface class with a surface on the Conformant widget. /// /// The Conformant widget to create a surface. /// preview public CircleSurface(Conformant conformant) { _handle = Interop.Eext.eext_circle_surface_conformant_add(conformant); } /// /// Creates and initializes a new instance of the CircleSurface class with a surface on the Layout widget. /// /// The Layout widget to create a surface. /// preview public CircleSurface(Layout layout) { _handle = Interop.Eext.eext_circle_surface_layout_add(layout); } /// /// Creates and initializes a new instance of the CircleSurface class with a surface on the Naviframe widget. /// /// The Naviframe widget to create a surface. /// preview public CircleSurface(Naviframe naviframe) { _handle = Interop.Eext.eext_circle_surface_naviframe_add(naviframe.RealHandle); } /// /// Creates and initializes a new instance of the CircleSurface class with no surface. /// /// preview public CircleSurface() { _handle = IntPtr.Zero; } /// /// Gets the handle for CircleSurface. /// /// preview public IntPtr Handle => _handle; /// /// Deletes the given CircleSurface. /// /// preview 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(); } } }