summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjh5.cho <jh5.cho@samsung.com>2017-03-24 08:27:09 (GMT)
committerjh5.cho <jh5.cho@samsung.com>2017-03-24 10:09:11 (GMT)
commit100744230e0dc754ec4ffc9324f001ac68353107 (patch)
treef6a16bcd6e5ec61140b78ebd52ac62b4f878266d
parent48cdd049dc259e6f27093a173c887e71e9a426e9 (diff)
downloadelm-sharp-accepted/tizen_ivi.zip
elm-sharp-accepted/tizen_ivi.tar.gz
elm-sharp-accepted/tizen_ivi.tar.bz2
- RenderPost event is implemented as EvasEvent, not EvasObjectEvent, due to the malfuntion under TCT execute envirenment - Update Version to Beta-018 Change-Id: Idaf0137f094674d016f1bdf248b8b8ff007a6660
-rwxr-xr-xElmSharp/ElmSharp/EvasObject.cs31
-rwxr-xr-x[-rw-r--r--]ElmSharp/Interop/Interop.Evas.cs8
-rw-r--r--packaging/elm-sharp.spec2
3 files changed, 36 insertions, 5 deletions
diff --git a/ElmSharp/ElmSharp/EvasObject.cs b/ElmSharp/ElmSharp/EvasObject.cs
index f9cf919..0b3d8ef 100755
--- a/ElmSharp/ElmSharp/EvasObject.cs
+++ b/ElmSharp/ElmSharp/EvasObject.cs
@@ -45,7 +45,8 @@ namespace ElmSharp
EvasObjectEvent<EvasKeyEventArgs> _keydown;
EvasObjectEvent _moved;
EvasObjectEvent _resized;
- EvasObjectEvent _renderPost;
+ EventHandler _renderPost;
+ Interop.Evas.EvasCallback _renderPostCallback = null;
readonly HashSet<IInvalidatable> _eventStore = new HashSet<IInvalidatable>();
@@ -103,13 +104,30 @@ namespace ElmSharp
add { _resized.On += value; }
remove { _resized.On -= value; }
}
+
/// <summary>
/// Current widget RenderPost Event Handler
/// </summary>
public event EventHandler RenderPost
{
- add { _renderPost.On += value; }
- remove { _renderPost.On -= value; }
+ add
+ {
+ _renderPost += value;
+ if (_renderPostCallback == null)
+ {
+ _renderPostCallback = new Interop.Evas.EvasCallback((o, e, d) => _renderPost?.Invoke(this, EventArgs.Empty));
+ Interop.Evas.evas_event_callback_add(Interop.Evas.evas_object_evas_get(Handle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback, IntPtr.Zero);
+ }
+ }
+ remove
+ {
+ _renderPost -= value;
+ if (_renderPost?.GetInvocationList().Length == 0)
+ {
+ Interop.Evas.evas_event_callback_del(Interop.Evas.evas_object_evas_get(Handle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback);
+ _renderPostCallback = null;
+ }
+ }
}
/// <summary>
@@ -510,7 +528,6 @@ namespace ElmSharp
_keyup = new EvasObjectEvent<EvasKeyEventArgs>(this, EvasObjectCallbackType.KeyUp, EvasKeyEventArgs.Create);
_moved = new EvasObjectEvent(this, EvasObjectCallbackType.Move);
_resized = new EvasObjectEvent(this, EvasObjectCallbackType.Resize);
- _renderPost = new EvasObjectEvent(this, Interop.Evas.evas_object_evas_get(Handle), EvasObjectCallbackType.RenderPost);
_deleted.On += (s, e) => MakeInvalidate();
_keydown.On += (s, e) => KeyDown?.Invoke(this, e);
@@ -525,6 +542,12 @@ namespace ElmSharp
{
if (IsRealized)
{
+ if(_renderPostCallback != null)
+ {
+ Interop.Evas.evas_event_callback_del(Interop.Evas.evas_object_evas_get(Handle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback);
+ _renderPostCallback = null;
+ }
+
OnUnrealize();
IntPtr toBeDeleted = Handle;
Handle = IntPtr.Zero;
diff --git a/ElmSharp/Interop/Interop.Evas.cs b/ElmSharp/Interop/Interop.Evas.cs
index bbc2b99..6adbb98 100644..100755
--- a/ElmSharp/Interop/Interop.Evas.cs
+++ b/ElmSharp/Interop/Interop.Evas.cs
@@ -62,6 +62,14 @@ internal static partial class Interop
}
internal delegate void EventCallback(IntPtr data, IntPtr evas, IntPtr obj, IntPtr info);
+ internal delegate void EvasCallback(IntPtr data, IntPtr evas, IntPtr info);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_event_callback_add(IntPtr obj, ObjectCallbackType type, EvasCallback func, IntPtr data);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_event_callback_del(IntPtr obj, ObjectCallbackType type, EvasCallback func);
+
[DllImport(Libraries.Evas)]
internal static extern void evas_object_event_callback_add(IntPtr obj, ObjectCallbackType type, EventCallback func, IntPtr data);
[DllImport(Libraries.Evas)]
diff --git a/packaging/elm-sharp.spec b/packaging/elm-sharp.spec
index 1df2f6c..2f140ee 100644
--- a/packaging/elm-sharp.spec
+++ b/packaging/elm-sharp.spec
@@ -1,4 +1,4 @@
-%define DEV_VERSION beta-017
+%define DEV_VERSION beta-018
Name: elm-sharp
Summary: C# Binding for Elementary