Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26730.8
+VisualStudioVersion = 15.0.26730.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp.Wearable", "ElmSharp.Wearable.csproj", "{01AE2E3A-C08E-431C-97B3-A18D536FCD52}"
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp.Wearable.Test", "..\..\test\ElmSharp.Wearable.Test\ElmSharp.Wearable.Test.csproj", "{DC7126DF-8ED8-448A-B7D8-15C7441B6929}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.UI", "..\Tizen.Applications.UI\Tizen.Applications.UI.csproj", "{21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{E26744AF-0991-410E-8AD8-81AD65749036}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EC21B79B-8EC3-4324-B8B0-F541D37FA0C7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {21EEB0B3-BCE2-4BF7-A826-F62F3E97A42F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E26744AF-0991-410E-8AD8-81AD65749036}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E26744AF-0991-410E-8AD8-81AD65749036}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E26744AF-0991-410E-8AD8-81AD65749036}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E26744AF-0991-410E-8AD8-81AD65749036}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1E463DAD-F3CA-47B7-8D02-C53873D8D0F2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// The Circle DateTime Selector is a widget to display and handle datetime value by rotary event
/// Inherits <see cref="DateTimeSelector"/>
/// </summary>
- public class CircleDateTimeSelector : DateTimeSelector
+ public class CircleDateTimeSelector : DateTimeSelector, IRotaryActionWidget
{
- IntPtr circleHandle;
+ IntPtr _circleHandle;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the Circle DateTime class
/// </summary>
/// <param name="parent">The parent of new Circle DateTime instance</param>
- public CircleDateTimeSelector(EvasObject parent) : base(parent) { }
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleDateTimeSelector(EvasObject parent, CircleSurface surface) : base()
+ {
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
+ }
+
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => _circleHandle;
/// <summary>
- /// Sets or gets the disabled state of the Circle DateTime Selector
+ /// Gets the handle for Circle Surface used in this widget
/// </summary>
- public bool Disabled
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(circleHandle);
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(circleHandle, "default", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(circleHandle, "default", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
}
}
{
var handle = base.CreateHandle(parent);
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
-
- circleHandle = Interop.Eext.eext_circle_object_datetime_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(circleHandle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_datetime_add(RealHandle == IntPtr.Zero ? Handle : RealHandle , CircleSurface.Handle);
return handle;
}
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// The Circle GenList Selector is a widget to display and handle genlist items by rotary event
/// Inherits <see cref="GenList"/>
/// </summary>
- public class CircleGenList : GenList
+ public class CircleGenList : GenList, IRotaryActionWidget
{
- IntPtr circleHandle;
+ IntPtr _circleHandle;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the Circle GenList class
/// </summary>
/// <param name="parent">The parent of new Circle GenList instance</param>
- public CircleGenList(EvasObject parent) : base(parent) { }
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleGenList(EvasObject parent, CircleSurface surface) : base()
+ {
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
+ }
+
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => _circleHandle;
/// <summary>
- /// Sets or gets the disabled state of the Circle GenList Selector
+ /// Gets the handle for Circle Surface used in this widget
/// </summary>
- public bool Disabled
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(circleHandle);
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(circleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(circleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "vertical,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "vertical,scroll,bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "vertical,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "vertical,scroll,bg", value);
}
}
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(circleHandle, "default", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(circleHandle, "default", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
}
}
get
{
int policy;
- Interop.Eext.eext_circle_object_genlist_scroller_policy_get(circleHandle, IntPtr.Zero, out policy);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_get(CircleHandle, IntPtr.Zero, out policy);
return (ScrollBarVisiblePolicy)policy;
}
set
{
int h;
- Interop.Eext.eext_circle_object_genlist_scroller_policy_get(circleHandle, out h, IntPtr.Zero);
- Interop.Eext.eext_circle_object_genlist_scroller_policy_set(circleHandle, (int)h, (int)value);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_get(CircleHandle, out h, IntPtr.Zero);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_set(CircleHandle, (int)h, (int)value);
}
}
protected override IntPtr CreateHandle(EvasObject parent)
{
var handle = base.CreateHandle(parent);
-
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
-
- circleHandle = Interop.Eext.eext_circle_object_genlist_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while(!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(circleHandle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_genlist_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle);
return handle;
}
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// <summary>
/// The Circle ProgressBar is a widget for visually representing the progress status of a given job/task with the circular design.
/// </summary>
- public class CircleProgressBar : EvasObject
+ public class CircleProgressBar : Widget, ICircleWidget
{
+ CircleSurface _surface;
+
/// <summary>
/// Creates and initializes a new instance of the Circle Progressbar class.
/// </summary>
/// <param name="parent">The parent of new Circle Progressbar instance</param>
- public CircleProgressBar(EvasObject parent) : base(parent)
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleProgressBar(EvasObject parent, CircleSurface surface) : base()
{
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
}
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => Handle;
+
+ /// <summary>
+ /// Gets the handle for Circle Surface used in this widget
+ /// </summary>
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ public override bool IsEnabled
+ {
+ get
+ {
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
+ }
+ set
+ {
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
+ }
+ }
/// <summary>
/// Sets or gets the value of ProgressBar.
{
get
{
- return Interop.Eext.eext_circle_object_value_get(Handle);
+ return Interop.Eext.eext_circle_object_value_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_value_set(Handle, value);
+ Interop.Eext.eext_circle_object_value_set(CircleHandle, value);
}
}
{
double max = 0;
double min = 0;
- Interop.Eext.eext_circle_object_value_min_max_get(Handle, out min, out max);
+ Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
return max;
}
set
{
double min = Minimum;
- Interop.Eext.eext_circle_object_value_min_max_set(Handle, min, value);
+ Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, min, value);
}
}
{
double max = 0;
double min = 0;
- Interop.Eext.eext_circle_object_value_min_max_get(Handle, out min, out max);
+ Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
return min;
}
set
{
double max = Maximum;
- Interop.Eext.eext_circle_object_value_min_max_set(Handle, value, max);
+ Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, value, max);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_angle_get(Handle);
+ return Interop.Eext.eext_circle_object_angle_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_angle_set(Handle, value);
+ Interop.Eext.eext_circle_object_angle_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_angle_get(Handle, "bg");
+ return Interop.Eext.eext_circle_object_item_angle_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_angle_set(Handle, "bg", value);
+ Interop.Eext.eext_circle_object_item_angle_set(CircleHandle, "bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_angle_offset_get(Handle);
+ return Interop.Eext.eext_circle_object_angle_offset_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_angle_offset_set(Handle, value);
+ Interop.Eext.eext_circle_object_angle_offset_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_angle_offset_get(Handle, "bg");
+ return Interop.Eext.eext_circle_object_item_angle_offset_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_angle_offset_set(Handle, "bg", value);
+ Interop.Eext.eext_circle_object_item_angle_offset_set(CircleHandle, "bg", value);
}
}
{
double max = 0;
double min = 0;
- Interop.Eext.eext_circle_object_angle_min_max_get(Handle, out min, out max);
+ Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
return max;
}
set
{
double min = BarAngleMinimum;
- Interop.Eext.eext_circle_object_angle_min_max_set(Handle, min, value);
+ Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, min, value);
}
}
{
double max = 0;
double min = 0;
- Interop.Eext.eext_circle_object_angle_min_max_get(Handle, out min, out max);
+ Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
return min;
}
set
{
double max = BarAngleMaximum;
- Interop.Eext.eext_circle_object_angle_min_max_set(Handle, value, max);
- }
- }
-
- /// <summary>
- /// Sets or gets disable status of Circle ProgressBar.
- /// </summary>
- public bool Disabled
- {
- get
- {
- return Interop.Eext.eext_circle_object_disabled_get(Handle);
- }
- set
- {
- Interop.Eext.eext_circle_object_disabled_set(Handle, value);
+ Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, value, max);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_color_get(Handle, out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_color_get(CircleHandle, out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_color_set(Handle, value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_color_set(CircleHandle, value.R, value.G, value.B, value.A);
}
}
/// <summary>
/// Sets or gets color of Background ProgressBar.
/// </summary>
- public Color BackgroundColor
+ public override Color BackgroundColor
{
get
{
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(Handle, "bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "bg", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(Handle, "bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "bg", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_line_width_get(Handle); ;
+ return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_line_width_set(Handle, value);
+ Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(Handle, "bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(Handle, "bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_radius_get(Handle); ;
+ return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_radius_set(Handle, value);
+ Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(Handle, "bg"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(Handle, "bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "bg", value);
}
}
/// <returns>Handle IntPtr</returns>
protected override IntPtr CreateHandle(EvasObject parent)
{
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent.Handle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent.Handle);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
-
- var handle = Interop.Eext.eext_circle_object_progressbar_add(parent.Handle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(handle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(handle, true);
- return handle;
+ return Interop.Eext.eext_circle_object_progressbar_add(parent, CircleSurface.Handle);
}
}
}
\ No newline at end of file
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// <summary>
/// Circle scroller provides scrollbar with circular movement and is scrolled by rotary event.
/// </summary>
- public class CircleScroller : Scroller
+ public class CircleScroller : Scroller, IRotaryActionWidget
{
- private IntPtr _circleHandle;
+ IntPtr _circleHandle;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the CircleScroller class.
/// </summary>
/// <param name="parent">The <see cref="EvasObject"/> to which the new CircleScroller will be attached as a child.</param>
- public CircleScroller(EvasObject parent) : base(parent)
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleScroller(EvasObject parent, CircleSurface surface) : base()
{
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
}
/// <summary>
- /// Sets or gets disabled state of the circle scroller object.
+ /// Gets the handle for Circle Widget.
/// </summary>
- public bool Disabled
+ public virtual IntPtr CircleHandle => _circleHandle;
+
+ /// <summary>
+ /// Gets the handle for Circle Surface used in this widget
+ /// </summary>
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(_circleHandle); ;
+ return !Interop.Eext.eext_circle_object_disabled_get(Handle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(Handle, !value);
}
}
get
{
int policy;
- Interop.Eext.eext_circle_object_scroller_policy_get(_circleHandle, out policy, IntPtr.Zero);
+ Interop.Eext.eext_circle_object_scroller_policy_get(CircleHandle, out policy, IntPtr.Zero);
return (ScrollBarVisiblePolicy)policy;
}
set
{
ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy;
- Interop.Eext.eext_circle_object_scroller_policy_set(_circleHandle, (int)value, (int)v);
+ Interop.Eext.eext_circle_object_scroller_policy_set(CircleHandle, (int)value, (int)v);
}
}
get
{
int policy;
- Interop.Eext.eext_circle_object_scroller_policy_get(_circleHandle, IntPtr.Zero, out policy);
+ Interop.Eext.eext_circle_object_scroller_policy_get(CircleHandle, IntPtr.Zero, out policy);
return (ScrollBarVisiblePolicy)policy;
}
set
{
ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy;
- Interop.Eext.eext_circle_object_scroller_policy_set(_circleHandle, (int)h, (int)value);
+ Interop.Eext.eext_circle_object_scroller_policy_set(CircleHandle, (int)h, (int)value);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_color_get(_circleHandle, out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_color_get(CircleHandle, out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_color_set(_circleHandle, value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_color_set(CircleHandle, value.R, value.G, value.B, value.A);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "horizontal,scroll,bar", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "horizontal,scroll,bar", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "horizontal,scroll,bar", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "horizontal,scroll,bar", value.R, value.G, value.B, value.A);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "horizontal,scroll,bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "horizontal,scroll,bg", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "horizontal,scroll,bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "horizontal,scroll,bg", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_line_width_get(_circleHandle); ;
+ return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_line_width_set(_circleHandle, value);
+ Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "horizontal,scroll,bar");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "horizontal,scroll,bar");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "horizontal,scroll,bar", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "horizontal,scroll,bar", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "vertical,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "vertical,scroll,bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "horizontal,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "horizontal,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "horizontal,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "horizontal,scroll,bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_radius_get(_circleHandle); ;
+ return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_radius_set(_circleHandle, value);
+ Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "horizontal,scroll,bar"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "horizontal,scroll,bar");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "horizontal,scroll,bar", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "horizontal,scroll,bar", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "vertical,scroll,bg"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "vertical,scroll,bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "horizontal,scroll,bg"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "horizontal,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "horizontal,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "horizontal,scroll,bg", value);
}
}
protected override IntPtr CreateHandle(EvasObject parent)
{
IntPtr handle = base.CreateHandle(parent);
- IntPtr surface = IntPtr.Zero;
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
-
- _circleHandle = Interop.Eext.eext_circle_object_scroller_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(_circleHandle, w, h);
- }
- Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_scroller_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle);
return handle;
}
}
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// <summary>
/// Circle slider is circular designed widget to select a value in a range by rotary event.
/// </summary>
- public class CircleSlider : EvasObject
+ public class CircleSlider : Widget, IRotaryActionWidget
{
- /// <summary>
- /// Changed will be triggered when the circle slider value changes.
- /// </summary>
- public event EventHandler Changed;
-
SmartEvent _changedEvent;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the CircleSlider class.
/// </summary>
/// <param name="parent">The EvasObject to which the new CircleSlider will be attached as a child.</param>
- public CircleSlider(EvasObject parent) : base(parent)
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleSlider(EvasObject parent, CircleSurface surface) : base()
{
- _changedEvent = new SmartEvent(this, "value,changed");
-
- _changedEvent.On += (s, e) => Changed?.Invoke(this, EventArgs.Empty);
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
}
/// <summary>
+ /// Changed will be triggered when the circle slider value changes.
+ /// </summary>
+ public event EventHandler ValueChanged;
+
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => RealHandle;
+
+ /// <summary>
+ /// Gets the handle for Circle Surface used in this widget
+ /// </summary>
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
/// Sets or gets the step by which the circle slider bar moves.
/// </summary>
/// <remarks>
{
get
{
- return Interop.Eext.eext_circle_object_slider_step_get(RealHandle);
+ return Interop.Eext.eext_circle_object_slider_step_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_slider_step_set(RealHandle, (double)value);
+ Interop.Eext.eext_circle_object_slider_step_set(CircleHandle, (double)value);
}
}
/// <summary>
- /// Sets or gets disabled state of the circle slider object.
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
/// </summary>
- public bool Disabled
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(RealHandle); ;
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_color_get(RealHandle, out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_color_get(CircleHandle, out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_color_set(RealHandle, value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_color_set(CircleHandle, value.R, value.G, value.B, value.A);
}
}
/// <summary>
/// Sets or gets color of the circle slider background.
/// </summary>
- public Color BackgroundColor
+ public override Color BackgroundColor
{
get
{
int g = 0;
int b = 0;
int a = 0;
- Interop.Eext.eext_circle_object_item_color_get(RealHandle, "bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "bg", out r, out g, out b, out a);
return Color.FromRgba(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(RealHandle, "bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "bg", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_line_width_get(RealHandle); ;
+ return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_line_width_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(RealHandle, "bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(RealHandle, "bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_angle_get(RealHandle); ;
+ return Interop.Eext.eext_circle_object_angle_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_angle_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_angle_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_angle_get(RealHandle, "bg");
+ return Interop.Eext.eext_circle_object_item_angle_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_angle_set(RealHandle, "bg", value);
+ Interop.Eext.eext_circle_object_item_angle_set(CircleHandle, "bg", value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_angle_offset_get(RealHandle); ;
+ return Interop.Eext.eext_circle_object_angle_offset_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_angle_offset_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_angle_offset_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_angle_offset_get(RealHandle, "bg");
+ return Interop.Eext.eext_circle_object_item_angle_offset_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_angle_offset_set(RealHandle, "bg", value);
+ Interop.Eext.eext_circle_object_item_angle_offset_set(CircleHandle, "bg", value);
}
}
{
double min;
double max;
- Interop.Eext.eext_circle_object_angle_min_max_get(RealHandle, out min, out max);
+ Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
return min;
}
set
{
double max = BarAngleMaximum;
- Interop.Eext.eext_circle_object_angle_min_max_set(RealHandle, (double)value, max);
+ Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, (double)value, max);
}
}
{
double min;
double max;
- Interop.Eext.eext_circle_object_angle_min_max_get(RealHandle, out min, out max);
+ Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
return max;
}
set
{
double min = BarAngleMinimum;
- Interop.Eext.eext_circle_object_angle_min_max_set(RealHandle, min, (double)value);
+ Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, min, (double)value);
}
}
{
double min;
double max;
- Interop.Eext.eext_circle_object_value_min_max_get(RealHandle, out min, out max);
+ Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
return min;
}
set
{
double max = Maximum;
- Interop.Eext.eext_circle_object_value_min_max_set(RealHandle, (double)value, max);
+ Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, (double)value, max);
}
}
{
double min;
double max;
- Interop.Eext.eext_circle_object_value_min_max_get(RealHandle, out min, out max);
+ Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
return max;
}
set
{
double min = Minimum;
- Interop.Eext.eext_circle_object_value_min_max_set(RealHandle, min, (double)value);
+ Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, min, (double)value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_value_get(RealHandle);
+ return Interop.Eext.eext_circle_object_value_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_value_set(RealHandle, (double)value);
+ Interop.Eext.eext_circle_object_value_set(CircleHandle, (double)value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_radius_get(RealHandle); ;
+ return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_radius_set(RealHandle, value);
+ Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(RealHandle, "bg"); ;
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(RealHandle, "bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "bg", value);
}
}
/// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _changedEvent = new SmartEvent(this, "value,changed");
+ _changedEvent.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+ }
+
+ /// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">Parent EvasObject</param>
/// <returns>Handle IntPtr</returns>
protected override IntPtr CreateHandle(EvasObject parent)
{
- IntPtr surface = IntPtr.Zero;
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
-
- IntPtr handle = Interop.Eext.eext_circle_object_slider_add(parent, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(handle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(handle, true);
- return handle;
+ return Interop.Eext.eext_circle_object_slider_add(parent, CircleSurface.Handle);
}
}
}
\ No newline at end of file
*/
using System;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// The Circle Spinner is a widget to display and handle spinner value by rotary event
/// Inherits <see cref="Spinner"/>.
/// </summary>
- public class CircleSpinner : Spinner
+ public class CircleSpinner : Spinner, IRotaryActionWidget
{
- private IntPtr _circleHandle;
- private double _angleRatio = 1.0;
+ IntPtr _circleHandle;
+ double _angleRatio = 1.0;
+ CircleSurface _surface;
/// <summary>
/// Creates and initializes a new instance of the Circle Spinner class.
/// </summary>
/// <param name="parent">The parent of new Circle Spinner instance</param>
- public CircleSpinner(EvasObject parent) : base(parent)
+ /// <param name="surface">The surface for drawing circle features for this widget.</param>
+ public CircleSpinner(EvasObject parent, CircleSurface surface) : base()
{
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
}
/// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ public virtual IntPtr CircleHandle => RealHandle;
+
+ /// <summary>
+ /// Gets the handle for Circle Surface used in this widget
+ /// </summary>
+ public virtual CircleSurface CircleSurface => _surface;
+
+ /// <summary>
/// Sets or gets the circle spinner angle per each spinner value.
/// </summary>
public double AngleRatio
set
{
_angleRatio = value;
- Interop.Eext.eext_circle_object_spinner_angle_set(_circleHandle, _angleRatio);
+ Interop.Eext.eext_circle_object_spinner_angle_set(CircleHandle, _angleRatio);
}
}
/// <summary>
- /// Sets or gets disabled state of the circle spinner object.
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
/// </summary>
- public bool Disabled
+ public override bool IsEnabled
{
get
{
- return Interop.Eext.eext_circle_object_disabled_get(_circleHandle); ;
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
}
}
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(_circleHandle, "default", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(_circleHandle, "default", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
}
}
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
}
}
protected override IntPtr CreateHandle(EvasObject parent)
{
IntPtr handle = base.CreateHandle(parent);
-
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent.Handle);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent.Handle);
- }
-
- _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while (!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(_circleHandle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle);
return handle;
}
}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+ /// <summary>
+ /// The CircleSurface presents a surface for drawing circular feature of circle widgets
+ /// </summary>
+ public class CircleSurface
+ {
+ IntPtr _handle;
+
+ /// <summary>
+ /// Creates and initializes a new instance of the CircleSurface class with surface on the Conformant widget.
+ /// </summary>
+ /// <param name="conformant">Conformant widget to create a surface.</param>
+ 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 surface on the Layout widget.
+ /// </summary>
+ /// <param name="layout">Layout widget to create a surface.</param>
+ 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 surface on the Naviframe widget.
+ /// </summary>
+ /// <param name="naviframe">Naviframe widget to create a surface.</param>
+ public CircleSurface(Naviframe naviframe)
+ {
+ _handle = Interop.Eext.eext_circle_surface_naviframe_add(naviframe);
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of the CircleSurface class with no surface
+ /// </summary>
+ public CircleSurface()
+ {
+ _handle = IntPtr.Zero;
+ }
+
+ public IntPtr Handle => _handle;
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ElmSharp.Wearable
+{
+ /// <summary>
+ /// The ICircleWidget is the interface for a widget to display and handle with circle surface
+ /// </summary>
+ public interface ICircleWidget
+ {
+ /// <summary>
+ /// Gets the handle for Circle Widget.
+ /// </summary>
+ IntPtr CircleHandle { get; }
+
+ /// <summary>
+ /// Gets the CircleSurface used in this widget
+ /// </summary>
+ CircleSurface CircleSurface { get; }
+ }
+
+ /// <summary>
+ /// The IRotaryActionWidget is the interface for a widget has action by rotary event
+ /// </summary>
+ public interface IRotaryActionWidget : ICircleWidget
+ {
+ }
+}
/// <summary>
/// RotaryEventManager serve extension functions for Rotary event to EvasObject on device like Galaxy Gear.
/// </summary>
- public static class EvasObjectExtensions
+ public static class RotaryEventExtensions
{
static Dictionary<EvasObject, RotaryEventHandler> s_rotaryObjectEventHandlers = new Dictionary<EvasObject, RotaryEventHandler>();
static Dictionary<EvasObject, Interop.Eext.Eext_Rotary_Event_Cb> s_rotaryObjectEventMap = new Dictionary<EvasObject, Interop.Eext.Eext_Rotary_Event_Cb>();
}
/// <summary>
+ /// Activate this circle widget can take Rotary event.
+ /// </summary>
+ /// <param name="widget">Target circle widget</param>
+ public static void Activate(this IRotaryActionWidget widget)
+ {
+ Interop.Eext.eext_rotary_object_event_activated_set(widget.CircleHandle, true);
+ }
+
+ /// <summary>
+ /// Deactivate this circle widget is blocked from Rotary event.
+ /// </summary>
+ /// <param name="widget">Target circle widget</param>
+ public static void Deactivate(this IRotaryActionWidget widget)
+ {
+ Interop.Eext.eext_rotary_object_event_activated_set(widget.CircleHandle, false);
+ }
+
+ /// <summary>
/// Activate this object can take Rotary event.
/// </summary>
/// <param name="obj">Target object</param>
}
/// <summary>
+ /// Creates and initializes a new instance of Container class.
+ /// </summary>
+ protected Container() : base()
+ {
+ }
+
+ /// <summary>
/// Sets the background color of a given Container.
/// </summary>
public override Color BackgroundColor
///as a child.It's <see cref="EvasObject"/> type.</param>
public DateTimeSelector(EvasObject parent) : base(parent)
{
- _changed = new SmartEvent(this, this.RealHandle, "changed");
- _changed.On += (s, e) =>
- {
- DateTime newDateTime = DateTime;
- DateTimeChanged?.Invoke(this, new DateChangedEventArgs(_cacheDateTime, newDateTime));
- DateTime = newDateTime;
- };
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of DateTimeSelector class.
+ /// </summary>
+ protected DateTimeSelector() : base()
+ {
}
/// <summary>
}
/// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _changed = new SmartEvent(this, this.RealHandle, "changed");
+ _changed.On += (s, e) =>
+ {
+ DateTime newDateTime = DateTime;
+ DateTimeChanged?.Invoke(this, new DateChangedEventArgs(_cacheDateTime, newDateTime));
+ DateTime = newDateTime;
+ };
+ }
+
+ /// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">Parent EvasObject</param>
/// <param name="parent">The parent is a given container which will be attached by GenList as a child. It's <see cref="EvasObject"/> type.</param>
public GenList(EvasObject parent) : base(parent)
{
- ListMode = GenListMode.Compress;
- InitializeSmartEvent();
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of GenList class.
+ /// </summary>
+ protected GenList() : base()
+ {
}
/// <summary>
}
/// <summary>
+ /// The callback of Unrealize Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ ListMode = GenListMode.Compress;
+ InitializeSmartEvent();
+ }
+
+ /// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">Parent EvasObject</param>
/// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param>
public Layout(EvasObject parent) : base(parent)
{
- _languageChanged = new SmartEvent(this, this.RealHandle, "language,changed");
- _languageChanged.On += (s, e) =>
- {
- LanguageChanged?.Invoke(this, EventArgs.Empty);
- };
+ }
- _themeChanged = new SmartEvent(this, this.RealHandle, "theme,changed");
- _themeChanged.On += (s, e) =>
- {
- ThemeChanged?.Invoke(this, EventArgs.Empty);
- };
+ /// <summary>
+ /// Creates and initializes a new instance of Layout class.
+ /// </summary>
+ protected Layout() : base()
+ {
}
/// <summary>
}
/// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _languageChanged = new SmartEvent(this, this.RealHandle, "language,changed");
+ _languageChanged.On += (s, e) =>
+ {
+ LanguageChanged?.Invoke(this, EventArgs.Empty);
+ };
+
+ _themeChanged = new SmartEvent(this, this.RealHandle, "theme,changed");
+ _themeChanged.On += (s, e) =>
+ {
+ ThemeChanged?.Invoke(this, EventArgs.Empty);
+ };
+ }
+
+ /// <summary>
/// Sets the content at a part of a given container widget.
/// </summary>
/// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param>
/// <param name="parent">The <see cref="EvasObject"/> to which the new Scroller will be attached as a child.</param>
public Scroller(EvasObject parent) : base(parent)
{
- _scroll = new SmartEvent(this, this.RealHandle, "scroll");
- _dragStart = new SmartEvent(this, this.RealHandle, "scroll,drag,start");
- _dragStop = new SmartEvent(this, this.RealHandle, "scroll,drag,stop");
- _scrollpage = new SmartEvent(this, this.RealHandle, "scroll,page,changed");
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of the Scroller class.
+ /// </summary>
+ public Scroller() : base()
+ {
}
/// <summary>
}
}
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _scroll = new SmartEvent(this, this.RealHandle, "scroll");
+ _dragStart = new SmartEvent(this, this.RealHandle, "scroll,drag,start");
+ _dragStop = new SmartEvent(this, this.RealHandle, "scroll,drag,stop");
+ _scrollpage = new SmartEvent(this, this.RealHandle, "scroll,page,changed");
+ }
+
/// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">The parent of new Spinner instance</param>
public Spinner(EvasObject parent) : base(parent)
{
- _changed = new SmartEvent(this, this.RealHandle, "changed");
- _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+ }
- _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed");
- _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
+ /// <summary>
+ /// Creates and initializes a new instance of Layout class.
+ /// </summary>
+ protected Spinner() : base()
+ {
}
/// <summary>
}
/// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _changed = new SmartEvent(this, this.RealHandle, "changed");
+ _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+
+ _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed");
+ _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
+ }
+
+ /// <summary>
/// Creates a widget handle.
/// </summary>
/// <param name="parent">Parent EvasObject</param>
/// <param name="parent">The parent of new Widget instance</param>
protected Widget(EvasObject parent) : base(parent)
{
- _focused = new SmartEvent(this, "focused");
- _focused.On += (s, e) => Focused?.Invoke(this, EventArgs.Empty);
-
- _unfocused = new SmartEvent(this, "unfocused");
- _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty);
}
/// <summary>
/// <summary>
/// Sets or gets the state of the widget, which might be enabled or disabled.
/// </summary>
- public bool IsEnabled
+ public virtual bool IsEnabled
{
get
{
return a;
}
+ /// <summary>
+ /// The callback of Realized Event
+ /// </summary>
+ protected override void OnRealized()
+ {
+ base.OnRealized();
+ _focused = new SmartEvent(this, "focused");
+ _focused.On += (s, e) => Focused?.Invoke(this, EventArgs.Empty);
+
+ _unfocused = new SmartEvent(this, "unfocused");
+ _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty);
+ }
+
internal IntPtr GetPartContent(string part)
{
return Interop.Elementary.elm_object_part_content_get(RealHandle, part);
<ProjectReference Include="..\..\src\Tizen\Tizen.csproj" />
</ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
conformant.SetContent(layout);
- DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
+ var surface = new CircleSurface(conformant);
+
+ DateTimeSelector datetime = new CircleDateTimeSelector(conformant, surface)
{
MinimumDateTime = new DateTime(2015, 1, 1),
MaximumDateTime = DateTime.Now,
conformant.SetContent(layout);
- DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
+ var surface = new CircleSurface(conformant);
+
+ DateTimeSelector datetime = new CircleDateTimeSelector(conformant, surface)
{
DateTime = DateTime.Now,
Style = "timepicker/circle"
conformant.SetContent(layout);
- DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
+ var surface = new CircleSurface(conformant);
+
+ DateTimeSelector datetime = new CircleDateTimeSelector(conformant, surface)
{
DateTime = DateTime.Now,
Style = "timepicker/circle",
- Disabled = true
+ IsEnabled = false
};
layout.SetContent(datetime);
conformant.SetContent(layout);
- DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
+ var surface = new CircleSurface(conformant);
+
+ DateTimeSelector datetime = new CircleDateTimeSelector(conformant, surface)
{
DateTime = DateTime.Now,
Style = "timepicker/circle",
Conformant conformant = new Conformant(window);
conformant.Show();
- var list = new CircleGenList(conformant)
+ var surface = new CircleSurface(conformant);
+
+ var list = new CircleGenList(conformant, surface)
{
Homogeneous = true,
VerticalScrollBarColor = Color.Red,
layout.Move(0, 0);
layout.Resize(360, 360);
- var list = new CircleGenList(layout)
+ var surface = new CircleSurface(layout);
+
+ var list = new CircleGenList(layout, surface)
{
Homogeneous = true,
VerticalScrollBackgroundRadius = 165,
conformant.SetContent(naviframe);
- var list = new CircleGenList(naviframe)
+ var surface = new CircleSurface(naviframe);
+
+ var list = new CircleGenList(naviframe, surface)
{
Homogeneous = true,
VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto,
- Disabled = true,
+ IsEnabled = false,
};
var item = naviframe.Push(list);
public override void Run(Window window)
{
- var list = new CircleGenList(window)
+ var surface = new CircleSurface();
+
+ var list = new CircleGenList(window, surface)
{
Homogeneous = true,
VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
Conformant conformant = new Conformant(window);
conformant.Show();
- CircleProgressBar pb1 = new CircleProgressBar(conformant)
+ var surface = new CircleSurface(conformant);
+
+ CircleProgressBar pb1 = new CircleProgressBar(conformant, surface)
{
AlignmentX = -1,
AlignmentY = -1,
Conformant conformant = new Conformant(window);
conformant.Show();
- CircleProgressBar pb1 = new CircleProgressBar(conformant)
+ var surface = new CircleSurface(conformant);
+ CircleProgressBar pb1 = new CircleProgressBar(conformant, surface)
{
AlignmentX = -1,
AlignmentY = -1,
Conformant conformant = new Conformant(window);
conformant.Show();
- CircleProgressBar pb1 = new CircleProgressBar(conformant)
+ var surface = new CircleSurface(conformant);
+ CircleProgressBar pb1 = new CircleProgressBar(conformant, surface)
{
AlignmentX = -1,
AlignmentY = -1,
Conformant conformant = new Conformant(window);
conformant.Show();
- CircleProgressBar pb1 = new CircleProgressBar(conformant)
+ var surface = new CircleSurface(conformant);
+ CircleProgressBar pb1 = new CircleProgressBar(conformant, surface)
{
AlignmentX = -1,
AlignmentY = -1,
if (pb1.Value == pb1.Maximum/2)
{
// Test purpose : set disable
- pb1.Disabled = true;
+ pb1.IsEnabled = false;
}
if (pb1.Value == pb1.Maximum)
Conformant conformant = new Conformant(window);
conformant.Show();
- CircleScroller circleScroller = new CircleScroller(conformant)
+ var surface = new CircleSurface(conformant);
+ CircleScroller circleScroller = new CircleScroller(conformant, surface)
{
AlignmentX = -1,
AlignmentY = -1,
layout.Move(0, 0);
layout.Resize(360, 360);
- CircleScroller circleScroller = new CircleScroller(layout)
+ var surface = new CircleSurface(layout);
+ CircleScroller circleScroller = new CircleScroller(layout, surface)
{
AlignmentX = -1,
AlignmentY = -1,
Naviframe naviframe = new Naviframe(conformant);
- CircleScroller circleScroller = new CircleScroller(naviframe)
+ var surface = new CircleSurface(naviframe);
+ CircleScroller circleScroller = new CircleScroller(naviframe, surface)
{
AlignmentX = -1,
AlignmentY = -1,
public override void Run(Window window)
{
+ var surface = new CircleSurface();
- CircleScroller circleScroller = new CircleScroller(window)
+ CircleScroller circleScroller = new CircleScroller(window, surface)
{
AlignmentX = -1,
AlignmentY = -1,
Conformant conformant = new Conformant(window);
conformant.Show();
-
- CircleSlider circleSlider = new CircleSlider(conformant)
+ var surface = new CircleSurface(conformant);
+ CircleSlider circleSlider = new CircleSlider(conformant, surface)
{
AlignmentX = -1,
AlignmentY = -1,
label1.Move(170, window.ScreenSize.Height / 2 - 20);
label1.Show();
- circleSlider.Changed += (s, e) =>
+ circleSlider.ValueChanged += (s, e) =>
{
label1.Text = string.Format("{0}", circleSlider.Value);
};
Conformant conformant = new Conformant(window);
conformant.Show();
-
- CircleSlider circleSlider = new CircleSlider(conformant)
+ var surface = new CircleSurface(conformant);
+ CircleSlider circleSlider = new CircleSlider(conformant, surface)
{
AlignmentX = -1,
AlignmentY = -1,
Log.Debug(TestName, "CircleSliderTest2 step:" + circleSlider.Step);
- circleSlider.Changed += (s, e) =>
+ circleSlider.ValueChanged += (s, e) =>
{
label1.Text = string.Format("{0:F1}", circleSlider.Value);
};
layout.SetTheme("layout", "circle", "spinner");
conformant.SetContent(layout);
- CircleSpinner spn1 = new CircleSpinner(conformant)
+ var surface = new CircleSurface(conformant);
+ CircleSpinner spn1 = new CircleSpinner(conformant, surface)
{
Text = "Spinner Test",
LabelFormat = "%d Value",
btn.Clicked += (s, e) =>
{
- spn1.Disabled = true;
+ spn1.IsEnabled = false;
spn1.Text = "100 match";
spn1.Value = 0;
};
layout.SetTheme("layout", "circle", "spinner");
conformant.SetContent(layout);
- CircleSpinner spn1 = new CircleSpinner(conformant)
+ var surface = new CircleSurface(conformant);
+ CircleSpinner spn1 = new CircleSpinner(conformant, surface)
{
Text = "Slider Test",
LabelFormat = "%d Value",