Enhance EvasObject and Widget
authorSeunghyun Choi <sh4682.choi@samsung.com>
Fri, 16 Jun 2017 01:55:08 +0000 (10:55 +0900)
committerSeunghyun Choi <sh4682.choi@samsung.com>
Wed, 21 Jun 2017 04:47:20 +0000 (13:47 +0900)
Change-Id: I7546fb163d364d0d06270ee741602ddead26b21a

src/ElmSharp/ElmSharp/EvasObject.cs
src/ElmSharp/ElmSharp/Widget.cs [changed mode: 0755->0644]
src/ElmSharp/Interop/Interop.Evas.cs

index 5bc3f7c..9236ba6 100644 (file)
@@ -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()
old mode 100755 (executable)
new mode 100644 (file)
index daa5731..d18e047
@@ -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>
index ee5d3c8..a48c377 100644 (file)
@@ -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)
         {