From: Umar Date: Wed, 12 Apr 2017 18:07:26 +0000 (+0100) Subject: Build bindings, csharp library and examples in new directory structure for C# X-Git-Tag: dali_1.2.36~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=abaced20e6d1836f03e2087f8e73675bc0b9b65a Build bindings, csharp library and examples in new directory structure for C# Change-Id: Ida122e8a96cd9bda60fb90c3a2191f2cf1ecbfcf --- diff --git a/plugins/dali-sharp/build/Makefile.am b/plugins/dali-sharp/build/Makefile.am new file mode 100644 index 0000000..796c15c --- /dev/null +++ b/plugins/dali-sharp/build/Makefile.am @@ -0,0 +1,90 @@ +# Copyright (c) 2017 Samsung Electronics Co., Ltd. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CLEANFILES = ./dali-bindings/*.o *.so *.dll \ + ../examples/*.so ../examples/*.dll examples/*.exe + +BUILT_SOURCES = ../dali-bindings/dali_wrap.cpp ../dali-bindings/dali_wrap.h + +if HAVE_MCS +if BUILD_MCS + +DALI_BINDINGS_DIR = ./dali-bindings + +all-local: libNDalic.so NDali.dll + +libNDalic.so: ./dali-bindings/dali_wrap.o ./dali-bindings/keyboard_focus_manager_wrap.o ./dali-bindings/view-wrapper-impl-wrap.o ./dali-bindings/event-thread-callback-wrap.o ./dali-bindings/devel-property-wrap.o + g++ -shared ./dali-bindings/dali_wrap.o ./dali-bindings/keyboard_focus_manager_wrap.o ./dali-bindings/view-wrapper-impl-wrap.o ./dali-bindings/event-thread-callback-wrap.o ./dali-bindings/devel-property-wrap.o -o libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS) + +$(DALI_BINDINGS_DIR): + mkdir -p $@ + +./dali-bindings/dali_wrap.o: $(BUILT_SOURCES) $(DALI_BINDINGS_DIR) + g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) ../dali-bindings/dali_wrap.cpp -o ./dali-bindings/dali_wrap.o + +./dali-bindings/keyboard_focus_manager_wrap.o: $(BUILT_SOURCES) $(DALI_BINDINGS_DIR) + g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) ../dali-bindings/keyboard_focus_manager_wrap.cpp -o ./dali-bindings/keyboard_focus_manager_wrap.o + +./dali-bindings/view-wrapper-impl-wrap.o: $(BUILT_SOURCES) $(DALI_BINDINGS_DIR) + g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) ../dali-bindings/view-wrapper-impl-wrap.cpp -o ./dali-bindings/view-wrapper-impl-wrap.o + +./dali-bindings/event-thread-callback-wrap.o: $(BUILT_SOURCES) $(DALI_BINDINGS_DIR) + g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) ../dali-bindings/event-thread-callback-wrap.cpp -o ./dali-bindings/event-thread-callback-wrap.o + +./dali-bindings/devel-property-wrap.o: $(BUILT_SOURCES) $(DALI_BINDINGS_DIR) + g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) ../dali-bindings/devel-property-wrap.cpp -o ./dali-bindings/devel-property-wrap.o + +NDali.dll: $(BUILT_SOURCES) + $(MCS) -nologo -target:library -out:NDali.dll ../sharp/internal/*.cs ../sharp/public/*.cs + +check-local: examples/hello-world.exe \ + examples/scroll-view.exe \ + examples/control-dashboard.exe \ + examples/user-alphafunction.exe \ + examples/image-view.exe \ + examples/visuals-example.exe \ + examples/visuals-using-custom-view.exe \ + examples/libNDalic.so examples/NDali.dll + +examples/hello-world.exe: ../examples/hello-world.cs + $(MCS) -nologo -target:exe -out:../$@ -reference:NDali.dll $< + +examples/scroll-view.exe: ../examples/scroll-view.cs + $(MCS) -nologo -target:exe -out:../$@ -reference:NDali.dll $< + +examples/control-dashboard.exe: ../examples/control-dashboard.cs + $(MCS) -nologo -target:exe -out:../$@ -reference:NDali.dll $< + +examples/user-alphafunction.exe: ../examples/user-alphafunction.cs + $(MCS) -nologo -target:exe -out:../$@ -reference:NDali.dll $< + +examples/image-view.exe: ../examples/image-view.cs + $(MCS) -nologo -target:exe -out:../$@ -reference:NDali.dll $< + +examples/visuals-example.exe: ../examples/visuals-example.cs + $(MCS) -nologo -target:exe -out:../$@ -reference:NDali.dll $< + +examples/visuals-using-custom-view.exe: ../examples/visuals-using-custom-view/*.cs + $(MCS) -nologo -target:exe -out:../$@ -reference:NDali.dll $^ + +examples/libNDalic.so: + cd ../examples && ln -sf ../build/libNDalic.so + +examples/NDali.dll: + cd ../examples && ln -sf ../build/NDali.dll + +endif +endif + + diff --git a/plugins/dali-sharp/build/configure.ac b/plugins/dali-sharp/build/configure.ac new file mode 100644 index 0000000..df6317d --- /dev/null +++ b/plugins/dali-sharp/build/configure.ac @@ -0,0 +1,49 @@ +# Copyright (c) 2017 Samsung Electronics Co., Ltd. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Process this file with autoconf to produce a configure script. +AC_INIT([Dali-SHARP], [0.1.1], + [Dali-SHARP]) +AC_PREREQ(2.50) +AC_CONFIG_AUX_DIR([config]) +AM_INIT_AUTOMAKE([-Wall foreign]) + +# check target +AC_MSG_CHECKING([system]) +target=`uname` +AC_MSG_RESULT([$target]) + +# check compiler +AC_LANG([C++]) + +# check for Dali libraries +PKG_CHECK_MODULES(DALICORE, dali-core) +PKG_CHECK_MODULES(DALIADAPTOR, dali-adaptor) +PKG_CHECK_MODULES(DALITOOLKIT, dali-toolkit) + +AC_PATH_PROGS([MCS], [gmcs mcs gmcs2]) +AM_CONDITIONAL(HAVE_MCS, test "x${MCS}" != "x") + +AC_ARG_ENABLE([csharp], + AC_HELP_STRING([--disable-csharp], + [If disabled, the C# module + will not be built]), + [build_mcs=$enableval], + [build_mcs=yes]) +AM_CONDITIONAL(BUILD_MCS, test "$build_mcs" != "no") + +# done, output the configured files +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT + diff --git a/plugins/dali-sharp/dali-bindings/DaliWrapper.cpp b/plugins/dali-sharp/dali-bindings/DaliWrapper.cpp deleted file mode 100644 index 20e8103..0000000 --- a/plugins/dali-sharp/dali-bindings/DaliWrapper.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// DaliWrapper.cpp : Defines the entry point for the DLL application. -// - -#include "stdafx.h" -#include "DaliWrapper.h" - -BOOL APIENTRY DllMain( HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - -// This is an example of an exported variable -DALIWRAPPER_API int nDaliWrapper=0; - -// This is an example of an exported function. -DALIWRAPPER_API int fnDaliWrapper(void) -{ - return 18; -} - -// This is the constructor of a class that has been exported. -// see DaliWrapper.h for the class definition -CDaliWrapper::CDaliWrapper() -{ - return; -} diff --git a/plugins/dali-sharp/dali-bindings/DaliWrapper.h b/plugins/dali-sharp/dali-bindings/DaliWrapper.h deleted file mode 100644 index 2b49d4f..0000000 --- a/plugins/dali-sharp/dali-bindings/DaliWrapper.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// The following ifdef block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the DALIWRAPPER_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// DALIWRAPPER_API functions as being imported from a DLL, whereas this DLL sees symbols -// defined with this macro as being exported. - -#ifdef DALIWRAPPER_EXPORTS -#define DALIWRAPPER_API __declspec(dllexport) -#else -#define DALIWRAPPER_API __declspec(dllimport) -#endif - -// This class is exported from the DaliWrapper.dll -class DALIWRAPPER_API CDaliWrapper -{ - -public: - CDaliWrapper(void); - // TODO: add your methods here. - -}; - -extern DALIWRAPPER_API int nDaliWrapper; - -DALIWRAPPER_API int fnDaliWrapper(void); diff --git a/plugins/dali-sharp/dali-bindings/stdafx.h b/plugins/dali-sharp/dali-bindings/stdafx.h deleted file mode 100644 index 24647c1..0000000 --- a/plugins/dali-sharp/dali-bindings/stdafx.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include - -// TODO: reference additional headers your program requires here diff --git a/plugins/dali-sharp/sharp/internal/ViewRegistryHelper.cs b/plugins/dali-sharp/sharp/internal/ViewRegistryHelper.cs index 8e9e19a..320f58a 100644 --- a/plugins/dali-sharp/sharp/internal/ViewRegistryHelper.cs +++ b/plugins/dali-sharp/sharp/internal/ViewRegistryHelper.cs @@ -8,7 +8,7 @@ namespace Dali static public void Initialize() { // Register all views with the type registry - System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(Dali.Spin).TypeHandle); + //System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(Dali.Spin).TypeHandle); } } } diff --git a/plugins/dali-sharp/sharp/public/README.txt b/plugins/dali-sharp/sharp/public/README.txt new file mode 100644 index 0000000..1551175 --- /dev/null +++ b/plugins/dali-sharp/sharp/public/README.txt @@ -0,0 +1 @@ +helloe