Update SWIG interface files to create binding for TextVisual and KeyInputFocusManager
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / SWIG / dali.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 #if defined(SWIGCSHARP)
19 %module(directors="1") NDalic
20 #define DALI_EXPORT_API
21 #define DALI_IMPORT_API
22 #define DALI_INTERNAL
23 #else
24 %module Dali
25 #endif
26
27 %include exception.i
28
29 %exception {
30     try {
31         $action
32     } catch (std::out_of_range& e) {
33         SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
34     } catch (std::exception& e) {
35         SWIG_exception(SWIG_RuntimeError,const_cast<char*>(e.what()));
36     } catch (...) {
37         SWIG_exception(SWIG_UnknownError,"unknown error");
38     }
39 }
40
41 #if defined(SWIGCSHARP)
42 %{
43 #define SWIGSTDCALL
44 %}
45 #endif
46
47 %{
48 #include <dali/dali.h>
49 #include <dali-toolkit/dali-toolkit.h>
50
51 #include <dali/public-api/math/matrix.h>
52 #include <dali/public-api/math/matrix3.h>
53 #include <dali/public-api/math/viewport.h>
54 #include <dali/public-api/object/property-key.h>
55
56 #include <dali/public-api/adaptor-framework/timer.h>
57 #include <dali/public-api/adaptor-framework/window.h>
58 #include <dali/public-api/adaptor-framework/style-change.h>
59 #include <dali/devel-api/adaptor-framework/drag-and-drop-detector.h>
60 #include <dali/devel-api/adaptor-framework/application-extensions.h>
61
62 #include <dali/devel-api/images/nine-patch-image.h>
63
64 #include <dali-toolkit/devel-api/builder/builder.h>
65
66 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
67 #include <dali-toolkit/devel-api/controls/popup/popup.h>
68 #include <dali-toolkit/devel-api/controls/progress-bar/progress-bar.h>
69 #include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
70 #include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h>
71 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h>
72 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h>
73 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h>
74
75 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
76 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
77 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
78
79 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view-declarations.h>
80
81 // add here SWIG version check
82
83 #if defined(_MSC_VER)         // Microsoft Visual C++ 6.0
84 // disable Swig-dependent warnings
85
86 // 'identifier1' has C-linkage specified,
87 // but returns UDT 'identifier2' which is incompatible with C
88 #pragma warning(disable: 4190)
89
90 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
91 #pragma warning(disable: 4800)
92
93 // debug info too long etc etc
94 #pragma warning(disable: 4786)
95 #endif
96 %}
97
98 %include stl.i
99 %include exception.i
100 %include typemaps.i
101 %include std_common.i
102 %include carrays.i
103
104 %include cpointer.i
105 %pointer_class(float, floatp);
106 %pointer_class(int, intp);
107 %pointer_class(double, doublep);
108 %pointer_class(unsigned int, uintp);
109 %pointer_class(unsigned short, ushortp);
110 %pointer_cast(int, unsigned int, int_to_uint);
111
112 %apply unsigned char { uint8_t };
113 %apply unsigned short int { uint16_t };
114 %apply unsigned int { uint32_t };
115 %apply int { int32_t };
116
117 #if defined(SWIGCSHARP)
118
119 %typemap(ctype)  void * "void *"
120 %typemap(imtype) void * "System.IntPtr"
121 %typemap(cstype) void * "System.IntPtr"
122 %typemap(csin)   void * "$csinput"
123 %typemap(in)     void * %{ $1 = $input; %}
124 %typemap(out)    void * %{ $result = $1; %}
125 %typemap(csout)  void * { return $imcall; }
126
127 #endif
128
129 #if defined(SWIGCSHARP)
130
131 // string &
132 %typemap(ctype) std::string & "char**"
133 %typemap(imtype) std::string & "out string"
134 %typemap(cstype) std::string & "out string"
135
136 //C++
137 %typemap(in, canthrow=1) std::string &
138 %{
139   //typemap in
140   std::string temp;
141   $1 = &temp;
142 %}
143
144 %typemap(argout) std::string &
145 %{
146   //Typemap argout in c++ file.
147   //This will convert c++ string to c# string
148   *$input = SWIG_csharp_string_callback($1->c_str());
149 %}
150
151 %typemap(argout) const std::string &
152 %{
153   //argout typemap for const std::string&
154 %}
155
156 %typemap(csin) std::string & "out $csinput"
157
158 %typemap(throws, canthrow=1) string &
159 %{
160   SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str());
161   return $null;
162 %}
163
164 #endif
165
166 %ignore operator<<;
167 %ignore *::GetImplementation();
168 %ignore *::GetImplementation(Dali::BaseHandle&);
169
170 %{
171 using namespace Dali;
172 using namespace Dali::Toolkit;
173 %}
174
175 //%feature("director") Dali::Internal::CustomActorImpl;
176 //%feature("notabstract") Dali::Internal::CustomActorImpl;
177 //%feature("director") Dali::Toolkit::Internal::Control;
178 //%feature("notabstract") Dali::Toolkit::Internal::Control;
179 %feature("notabstract") Dali::Toolkit::FixedRuler;
180 %feature("notabstract") Dali::Toolkit::DefaultRuler;
181
182 // Note... all the typemap declarations have to be included before the DALi C++ head files are include otherwise
183 // they have no effect.
184
185 %include signal-parameters.i
186 %include signals.i
187
188 %include events/actor-event.i
189 %include events/accessibilitymanager-event.i
190 %include events/application-event.i
191 %include events/animation-event.i
192 %include events/button-event.i
193 %include events/builder-event.i
194 %include events/control-event.i
195 %include events/gaussian-blur-view-event.i
196 %include events/image-event.i
197 %include events/itemview-event.i
198 %include events/keyboardFocusManager-event.i
199 %include events/objectregistry-event.i
200 %include events/popup-event.i
201 %include events/pinchgesture-event.i
202 %include events/pageturnview-event.i
203 %include events/pangesture-event.i
204 %include events/propertynotification-event.i
205 %include events/longpressgesture-event.i
206 %include events/rectinteger.i
207 %include events/resourceimage-event.i
208 %include events/scrollable-event.i
209 %include events/scrollbar-event.i
210 %include events/scrollview-event.i
211 %include events/slider-event.i
212 %include events/stage-event.i
213 %include events/stylemanager-event.i
214 %include events/tapgesture-event.i
215 %include events/texteditor-event.i
216 %include events/textfield-event.i
217 %include events/timer-event.i
218 %include events/videoview-event.i
219
220 %include alphafunction.i
221
222 %include dali-operator.i
223 %include dali-core.i
224 %include dali-adaptor.i
225 %include dali-toolkit.i
226