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/devel-api/adaptor-framework/application-extensions.h>
29 %include <dali/public-api/adaptor-framework/window.h>
31 #if defined(SWIGCSHARP)
33 // %include <arrays_csharp.i>
34 // CSHARP_ARRAYS(char **, string)
35 // %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[]"
36 // %apply int *INPUT { int *argc };
37 // %apply char **INPUT[] { char **argv[] };
40 // keep argcs and argv so they're always available to DALi
45 // Temporary hack to generate argv. Todo... support conversions from the C# strings[] in the argv that is generated below
47 %typemap(in) ( int* argc, char **argv[] ) {
49 // Todo generate argv data from the C# args
50 char **array; // two dimensional array
51 int numStrings = 1; // number of strings
52 int stringLength = 30; // max string length.
53 array = (char **)malloc( (numStrings + 1 )* sizeof(char *) );
56 // allocate the string data
57 for( int i=0; i < numStrings; i++)
59 array[i]=(char *)malloc( stringLength * sizeof(char *) );
61 array[ numStrings ] = NULL; // we allocated +1 for hold the NULL part
63 strcpy( array[0], "dali-csharp-app");
69 // add interop services to the file
70 //%typemap(csimports) Dali::Application "using System.Runtime.InteropServices;"
72 %csmethodmodifiers Dali::Application::New() "
74 * Outer::outer_method(int)
78 %typemap(in) ( int* argc, char **argv[] ) {
80 // Todo generate argv data from the C# args
81 char **array; // two dimensional array
82 int numStrings = 1; // number of strings
83 int stringLength = 30; // max string length.
84 array = (char **)malloc( (numStrings + 1 )* sizeof(char *) );
87 // allocate the string data
88 for( int i=0; i < numStrings; i++)
90 array[i]=(char *)malloc( stringLength * sizeof(char *) );
92 array[ numStrings ] = NULL; // we allocated +1 for hold the NULL part
94 strcpy( array[0], "dali-csharp-app");
100 %apply int* INPUT { int* argc };
104 %include <dali/public-api/adaptor-framework/application.h>
106 %template(ApplicationSignal) Dali::Signal<void(Dali::Application&)>;
107 %template(ApplicationControlSignal) Dali::Signal<void(Dali::Application&, void*)>;
108 %template(TimerSignalType) Dali::Signal<bool()>;
111 // Application specialisation
112 // Macro to convert from a void * callback to a DALi C# object