2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 %ignore *::Application(Internal::Adaptor::Application*);
19 %ignore *::DragAndDropDetector(Internal::Adaptor::DragAndDropDetector*);
20 %ignore *::Timer(Internal::Adaptor::Timer*);
21 %ignore *::Window(Internal::Adaptor::Window*);
23 %rename(StyleChangeType) Dali::StyleChange::Type;
25 %include <dali/public-api/adaptor-framework/style-change.h>
26 %include <dali/public-api/adaptor-framework/timer.h>
27 %include <dali/devel-api/adaptor-framework/drag-and-drop-detector.h>
28 %include <dali/public-api/adaptor-framework/window.h>
30 #if defined(SWIGCSHARP)
32 // %include <arrays_csharp.i>
33 // CSHARP_ARRAYS(char **, string)
34 // %typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray, SizeParamIndex=0, ArraySubType=global::System.Runtime.InteropServices.UnmanagedType.LPStr)]") char **INPUT[] "string[]"
35 // %apply int *INPUT { int *argc };
36 // %apply char **INPUT[] { char **argv[] };
39 // keep argcs and argv so they're always available to DALi
44 // Temporary hack to generate argv. Todo... support conversions from the C# strings[] in the argv that is generated below
46 %typemap(in) ( int* argc, char **argv[] ) {
48 // Todo generate argv data from the C# args
49 char **array; // two dimensional array
50 int numStrings = 1; // number of strings
51 int stringLength = 30; // max string length.
52 array = (char **)malloc( (numStrings + 1 )* sizeof(char *) );
55 // allocate the string data
56 for( int i=0; i < numStrings; i++)
58 array[i]=(char *)malloc( stringLength * sizeof(char *) );
60 array[ numStrings ] = NULL; // we allocated +1 for hold the NULL part
62 strcpy( array[0], "dali-csharp-app");
68 // add interop services to the file
69 //%typemap(csimports) Dali::Application "using System.Runtime.InteropServices;"
71 %csmethodmodifiers Dali::Application::New() "
73 * Outer::outer_method(int)
77 %typemap(in) ( int* argc, char **argv[] ) {
79 // Todo generate argv data from the C# args
80 char **array; // two dimensional array
81 int numStrings = 1; // number of strings
82 int stringLength = 30; // max string length.
83 array = (char **)malloc( (numStrings + 1 )* sizeof(char *) );
86 // allocate the string data
87 for( int i=0; i < numStrings; i++)
89 array[i]=(char *)malloc( stringLength * sizeof(char *) );
91 array[ numStrings ] = NULL; // we allocated +1 for hold the NULL part
93 strcpy( array[0], "dali-csharp-app");
99 %apply int* INPUT { int* argc };
103 %include <dali/public-api/adaptor-framework/application.h>
105 %template(ApplicationSignal) Dali::Signal<void(Dali::Application&)>;
106 %template(ApplicationControlSignal) Dali::Signal<void(Dali::Application&, void*)>;
107 %template(TimerSignalType) Dali::Signal<bool()>;
110 // Application specialisation
111 // Macro to convert from a void * callback to a DALi C# object