2 using System.Collections.Generic;
7 public class EcoreTimelineAnimator
11 Action _timelineCallback;
12 Interop.Ecore.EcoreTimelineCallback _nativeCallback;
15 public event EventHandler Finished;
18 public EcoreTimelineAnimator(double runtime, Action timelineCallback)
21 _nativeCallback = NativeCallback;
22 _timelineCallback = timelineCallback;
26 public bool IsRunning { get; private set; }
27 public double Position => _position;
32 _animator = Interop.Ecore.ecore_animator_timeline_add(_runtime, _nativeCallback, IntPtr.Zero);
38 _animator = IntPtr.Zero;
43 Interop.Ecore.ecore_animator_freeze(_animator);
48 Interop.Ecore.ecore_animator_thaw(_animator);
51 protected void OnTimeline()
56 bool NativeCallback(IntPtr data, double pos)
59 if (!IsRunning) return false;
64 _animator = IntPtr.Zero;
65 Finished?.Invoke(this, EventArgs.Empty);