[dali_1.2.40] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / SWIG / gestures / hover.i
1 %rename(Hover) Dali::HoverEvent;
2
3 %csmethodmodifiers Dali::HoverEvent::points "private";
4 %csmethodmodifiers Dali::HoverEvent::time "private";
5
6 %typemap(cscode) Dali::HoverEvent %{
7   public static Hover GetHoverFromPtr(global::System.IntPtr cPtr) {
8     Hover ret = new Hover(cPtr, false);
9     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
10     return ret;
11   }
12
13   public uint Time
14   {
15     get
16     {
17       return time;
18     }
19   }
20
21   public int GetDeviceId(uint point) {
22     if( point < points.Count )
23     {
24       return points[(int)point].deviceId;
25     }
26     return -1;
27   }
28
29   public PointStateType GetState(uint point) {
30     if( point < points.Count )
31     {
32       return (Dali.PointStateType)(points[(int)point].state);
33     }
34     return PointStateType.FINISHED;
35   }
36
37   public Actor GetHitActor(uint point) {
38     if( point < points.Count )
39     {
40       return points[(int)point].hitActor;
41     }
42     else
43     {
44       // Return a native empty handle
45       Actor actor = new Actor();
46       actor.Reset();
47       return actor;
48     }
49   }
50
51   public Vector2 GetLocalPosition(uint point) {
52     if( point < points.Count )
53     {
54       return points[(int)point].local;
55     }
56     return new Vector2(0.0f, 0.0f);
57   }
58
59   public Vector2 GetScreenPosition(uint point) {
60     if( point < points.Count )
61     {
62       return points[(int)point].screen;
63     }
64     return new Vector2(0.0f, 0.0f);
65   }
66 %}