Added C# bindings for Window focus event and NPatchVisual property
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / SWIG / signal-parameters.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  /**
19   * WARNING: The macro below may be over-ridden by any other typemap(cscode)
20   * customisation for a class.
21   *
22   * MACRO to inject a  C# function in to a SWIG generated DALi C# wrapper class.
23   * The MACRO allow you to create a C# wrapper class for a DALi C++ object (passed as a C PTR).
24   *
25   * Required to get access to any data passed as a parameter in a Signal ( in C# they are delegate parameters).
26   * E.g.
27   *
28   * CREATE_CSHARP_WRAPPER_FROM_C_PTR_FUNCTION( Touch );
29   * Creates a function called GetTouchFromPtr which allows you to:
30   *
31   * static void OnStageTouched(IntPtr data)
32   * {
33   *    Touch touch = Touch.GetTouchFromPtr( data );
34   * }
35   *
36   * ## means concat in a SWIG macro
37   */
38
39 %define DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( NameSpace, ClassName )
40
41  %typemap(cscode) NameSpace::ClassName %{
42  public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
43     ClassName ret = new ClassName(cPtr, false);
44         if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
45     return ret;
46   }
47 %}
48
49 %enddef
50
51 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, Application );
52
53 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, Actor );
54 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, Image );
55 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, ResourceImage );
56 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, Animation );
57 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, PropertyNotification );
58 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, BaseHandle );
59 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, RefObject );
60 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, RenderTask );
61 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, Vector2 );
62
63 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, AccessibilityManager );
64 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali, StyleManager );
65 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, Control );
66 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, Button );
67 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, GaussianBlurView );
68 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, PageTurnView );
69 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, TextEditor );
70 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, TextField );
71
72 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, TextField );
73 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, VideoView );
74 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit, Slider );
75 DALI_CREATE_C_PTR_TO_CSHARP_FUNCTION( Dali::Toolkit::ScrollView, SnapEvent );
76  
77   
78
79