72430cc489e2b4f8638e3da613fc40d2ed7c56e9
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / SWIG / events / actor-event.i
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 %define ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG(NameSpace, ClassName)
19 %typemap(csimports) NameSpace::ClassName %{
20     using System;
21     using System.Runtime.InteropServices;
22 %}
23
24 %enddef
25
26 %define ACTOR_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
27   %typemap(cscode) NameSpace::ClassName %{
28
29     public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
30       ClassName ret = new ClassName(cPtr, false);
31       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
32       return ret;
33     }
34
35     public IntPtr GetPtrfrom ## ClassName ()
36     {
37        return (IntPtr)swigCPtr;
38     }
39
40     public Actor Parent
41     {
42       get
43       {
44         Actor parent = GetParent();
45         return parent;
46       }
47     }
48
49    public bool Visibility
50    {
51       get
52       {
53         bool visibility = IsVisible();
54         return visibility;
55       }
56     }
57
58    public float Opacity
59    {
60       set
61       {
62         SetOpacity(value);
63       }
64     }
65
66    public float CurrentOpacity
67    {
68       get
69       {
70         float ret = GetCurrentOpacity();
71         return ret;
72       }
73     }
74
75     public bool StateFocusEnable
76     {
77       set
78       {
79         SetKeyboardFocusable(value);
80       }
81       get
82       {
83         bool focusable = IsKeyboardFocusable();
84         return focusable;
85       }
86     }
87
88 %}
89
90 %enddef
91
92 %define DALI_ACTOR_EVENTHANDLER_PARAM( NameSpace, ClassName)
93
94 ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
95 ACTOR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
96
97 %enddef
98
99 namespace Dali
100 {
101   DALI_ACTOR_EVENTHANDLER_PARAM( Dali, Actor);
102 }