summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-06-22 12:00:39 +0000
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2017-06-22 12:00:40 +0000
commite0b161876ee30280653bde512a250176167d3b26 (patch)
treeb2c376383374e3ac68badc85a9c43aa2cd60c7e3
parent73e069209202c276c9e252bce4068bf3214b9487 (diff)
parent3447c39e86a7e6de83f22688f448837eb51ce285 (diff)
downloadelm-sharp-e0b161876ee30280653bde512a250176167d3b26.tar.gz
elm-sharp-e0b161876ee30280653bde512a250176167d3b26.tar.bz2
elm-sharp-e0b161876ee30280653bde512a250176167d3b26.zip
Merge "Enhance EvasObject and Widget" into tizen
-rw-r--r--ElmSharp/ElmSharp/EvasObject.cs118
-rw-r--r--[-rwxr-xr-x]ElmSharp/ElmSharp/Widget.cs46
-rw-r--r--ElmSharp/Interop/Interop.Evas.cs19
3 files changed, 169 insertions, 14 deletions
diff --git a/ElmSharp/ElmSharp/EvasObject.cs b/ElmSharp/ElmSharp/EvasObject.cs
index 5bc3f7c..9236ba6 100644
--- a/ElmSharp/ElmSharp/EvasObject.cs
+++ b/ElmSharp/ElmSharp/EvasObject.cs
@@ -34,6 +34,15 @@ namespace ElmSharp
BottomRight,
}
+ public enum AspectControl
+ {
+ None = 0, /* Preference on scaling unset */
+ Neither = 1, /* Same effect as unset preference on scaling */
+ Horizontal = 2, /* Use all horizontal container space to place an object, using the given aspect */
+ Vertical = 3, /* Use all vertical container space to place an object, using the given aspect */
+ Both = 4 /* Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */
+ }
+
/// <summary>
/// The EcasObject is a base class for other widget class
/// </summary>
@@ -535,6 +544,36 @@ namespace ElmSharp
}
/// <summary>
+ /// Sets or gets whether an Evas object is to freeze (discard) events.
+ /// </summary>
+ public bool AllEventsFrozen
+ {
+ get
+ {
+ return Interop.Evas.evas_object_freeze_events_get(RealHandle);
+ }
+ set
+ {
+ Interop.Evas.evas_object_freeze_events_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
+ /// Sets or gets the layer of its canvas that the given object will be part of.
+ /// </summary>
+ public int Layer
+ {
+ get
+ {
+ return Interop.Evas.evas_object_layer_get(Handle);
+ }
+ set
+ {
+ Interop.Evas.evas_object_layer_set(Handle, value);
+ }
+ }
+
+ /// <summary>
/// Clips one object to another.
/// </summary>
/// <param name="clip">The object to clip object by</param>
@@ -697,6 +736,85 @@ namespace ElmSharp
}
/// <summary>
+ /// Sets the hints for an object's aspect ratio.
+ /// </summary>
+ /// <param name="aspect">The policy or type of aspect ratio to apply to object</param>
+ /// <param name="w">The integer to use as aspect width ratio term</param>
+ /// <param name="h">The integer to use as aspect height ratio term</param>
+ public void SetSizeHintAspect(AspectControl aspect, int w, int h)
+ {
+ Interop.Evas.evas_object_size_hint_aspect_set(Handle, (int)aspect, w, h);
+ }
+
+ /// <summary>
+ /// Gets the hints for an object's aspect ratio.
+ /// </summary>
+ /// <param name="aspect">The policy or type of aspect ratio to apply to object</param>
+ /// <param name="w">The integer to use as aspect width ratio term</param>
+ /// <param name="h">The integer to use as aspect height ratio term</param>
+ public void GetSizeHintAspect(out AspectControl aspect, out int w, out int h)
+ {
+ int aspectRatio;
+ Interop.Evas.evas_object_size_hint_aspect_get(Handle, out aspectRatio, out w, out h);
+ aspect = (AspectControl)aspectRatio;
+ }
+
+ /// <summary>
+ /// Stack immediately below anchor.
+ /// </summary>
+ /// <param name="anchor">The object below which to stack.</param>
+ public void StackBelow(EvasObject anchor)
+ {
+ Interop.Evas.evas_object_stack_below(Handle, anchor);
+ }
+
+ /// <summary>
+ /// Stack immediately above anchor.
+ /// </summary>
+ /// <param name="anchor">The object above which to stack.</param>
+ public void StackAbove(EvasObject anchor)
+ {
+ Interop.Evas.evas_object_stack_above(Handle, anchor);
+ }
+
+ /// <summary>
+ /// Raise to the top of its layer.
+ /// </summary>
+ public void RaiseTop()
+ {
+ Interop.Evas.evas_object_raise(Handle);
+ }
+
+ /// <summary>
+ /// Get the geometry of a line number.
+ /// </summary>
+ /// <param name="lineNumber">the line number.</param>
+ /// <param name="x">x coord of the line.</param>
+ /// <param name="y">y coord of the line.</param>
+ /// <param name="w">w coord of the line.</param>
+ /// <param name="h">h coord of the line.</param>
+ /// <returns></returns>
+ public bool GetTextBlockGeometryByLineNumber(int lineNumber, out int x, out int y, out int w, out int h)
+ {
+ return Interop.Evas.evas_object_textblock_line_number_geometry_get(RealHandle, lineNumber, out x, out y, out w, out h);
+ }
+
+ internal IntPtr GetData(string key)
+ {
+ return Interop.Evas.evas_object_data_get(RealHandle, key);
+ }
+
+ internal void SetData(string key, IntPtr data)
+ {
+ Interop.Evas.evas_object_data_set(RealHandle, key, data);
+ }
+
+ internal IntPtr DeleteData(string key)
+ {
+ return Interop.Evas.evas_object_data_del(RealHandle, key);
+ }
+
+ /// <summary>
/// The callback of Invalidate Event
/// </summary>
protected virtual void OnInvalidate()
diff --git a/ElmSharp/ElmSharp/Widget.cs b/ElmSharp/ElmSharp/Widget.cs
index daa5731..d18e047 100755..100644
--- a/ElmSharp/ElmSharp/Widget.cs
+++ b/ElmSharp/ElmSharp/Widget.cs
@@ -221,6 +221,52 @@ namespace ElmSharp
}
/// <summary>
+ /// Sets or gets whether a widget and its children are focusable or not.
+ /// </summary>
+ public bool AllowTreeFocus
+ {
+ get
+ {
+ return Interop.Elementary.elm_object_tree_focus_allow_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_object_tree_focus_allow_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
+ /// Sets or gets the widget's mirrored mode.
+ /// </summary>
+ public bool IsMirroredMode
+ {
+ get
+ {
+ return Interop.Elementary.elm_object_mirrored_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_object_mirrored_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
+ /// Sets or gets the widget's mirrored mode setting.
+ /// When widget set automatic mode(true), it follows the system mirrored mode.
+ /// </summary>
+ public bool IsAutoMirroredMode
+ {
+ get
+ {
+ return Interop.Elementary.elm_object_mirrored_automatic_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_object_mirrored_automatic_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
/// Sets the widget to be focused or not.
/// </summary>
/// <param name="isFocus">Weather be focused</param>
diff --git a/ElmSharp/Interop/Interop.Evas.cs b/ElmSharp/Interop/Interop.Evas.cs
index e0a19b2..ce76066 100644
--- a/ElmSharp/Interop/Interop.Evas.cs
+++ b/ElmSharp/Interop/Interop.Evas.cs
@@ -111,15 +111,6 @@ internal static partial class Interop
Mul = 11 /* d = d*s */
}
- public enum AspectControl
- {
- None = 0, /* Preference on scaling unset */
- Neither = 1, /* Same effect as unset preference on scaling */
- Horizontal = 2, /* Use all horizontal container space to place an object, using the given aspect */
- Vertical = 3, /* Use all vertical container space to place an object, using the given aspect */
- Both = 4 /* Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */
- }
-
public enum ObjectCallbackPriority
{
After = 100,
@@ -475,7 +466,7 @@ internal static partial class Interop
internal static extern string evas_load_error_str(LoadError error);
[DllImport(Libraries.Evas)]
- internal static extern void evas_object_data_del(IntPtr obj, string key);
+ internal static extern IntPtr evas_object_data_del(IntPtr obj, string key);
[DllImport(Libraries.Evas)]
internal static extern void evas_object_focus_set(IntPtr obj, bool focus);
@@ -541,7 +532,7 @@ internal static partial class Interop
internal static extern void evas_object_render_op_set(IntPtr obj, RenderOp op);
[DllImport(Libraries.Evas)]
- internal static extern void evas_object_size_hint_aspect_set(IntPtr obj, AspectControl aspect, int w, int h);
+ internal static extern void evas_object_size_hint_aspect_set(IntPtr obj, int aspect, int w, int h);
[DllImport(Libraries.Evas)]
internal static extern IntPtr evas_object_smart_add(IntPtr obj, IntPtr smart);
@@ -637,7 +628,7 @@ internal static partial class Interop
internal static extern void evas_object_text_style_set(IntPtr obj, TextStyleType type);
[DllImport(Libraries.Evas)]
- internal static extern bool evas_object_textblock_line_number_geometry_get(IntPtr obj, int line, int x, int y, int w, int h);
+ internal static extern bool evas_object_textblock_line_number_geometry_get(IntPtr obj, int line, out int x, out int y, out int w, out int h);
[DllImport(Libraries.Evas)]
internal static extern void evas_object_textblock_valign_set(IntPtr obj, double align);
@@ -688,7 +679,7 @@ internal static partial class Interop
internal static extern void evas_object_stack_below(IntPtr obj, IntPtr below);
[DllImport(Libraries.Evas)]
- internal static extern void evas_object_size_hint_aspect_get(IntPtr obj, out AspectControl aspect, out int w, out int h);
+ internal static extern void evas_object_size_hint_aspect_get(IntPtr obj, out int aspect, out int w, out int h);
internal static void SetX(IntPtr obj, int x)
{
@@ -811,4 +802,4 @@ internal static partial class Interop
evas_object_color_set(obj, r * a / 255, g * a / 255, b * a / 255, a);
}
}
-} \ No newline at end of file
+}