From 8062788ca518c64fd5bd6da8f344199be8e6203c Mon Sep 17 00:00:00 2001 From: adun Date: Fri, 9 Mar 2018 10:15:29 +0800 Subject: [PATCH] [Tizen] Add codes for Dali Windows Backend 1. Remove the macro Win32 in CMakeLists.txt. 2. Fix the build error of Abrabic text cpp file. 3. Fix the problem that some picture can't show correctly. Change-Id: I2e4023e2d5a7bda85cfdba597a0ad10857dbcd2d --- .gitignore | 2 + CMakeLists.txt | 86 +++++++++++++++ .../refraction-effect-example.cpp | 4 +- examples/text-fonts/text-fonts-example.cpp | 2 +- examples/text-label/text-label-example.cpp | 2 +- main/main-example.cpp | 117 +++++++++++++++++++++ prebuild.bat | 31 ++++++ shared/multi-language-strings.h | 2 +- 8 files changed, 242 insertions(+), 4 deletions(-) create mode 100755 CMakeLists.txt mode change 100644 => 100755 examples/refraction-effect/refraction-effect-example.cpp mode change 100644 => 100755 examples/text-fonts/text-fonts-example.cpp mode change 100644 => 100755 examples/text-label/text-label-example.cpp create mode 100755 main/main-example.cpp create mode 100755 prebuild.bat mode change 100644 => 100755 shared/multi-language-strings.h diff --git a/.gitignore b/.gitignore index c714b70..146c707 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ simple-image-wall.js /debugfiles.list /debuglinks.list /debugsources.list +/CMakeCache.txt +/CMakeFiles diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..8358791 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,86 @@ +cmake_minimum_required(VERSION 3.11) + +PROJECT (dali) + +add_subdirectory(dali-core) +add_subdirectory(dali-adaptor) +add_subdirectory(dali-toolkit) + +SET( SOURCES ${SOURCES} +dali-demo/main/main-example.cpp +) + +ADD_DEFINITIONS( +#-D _CRT_SECURE_NO_WARNINGS +-DAPP_DATA_RES_DIR="${dali_SOURCE_DIR}/dali-env/opt/share/com.samsung.dali-demo/res" +-DIMAGES_DIR=APP_DATA_RES_DIR"/images/" +-DSTYLE_DIR=APP_DATA_RES_DIR"/style/" +-DDEMO_THEME_PATH=STYLE_DIR"demo-theme.json" +-DDEMO_IMAGE_DIR=IMAGES_DIR +-DdataReadOnlyDir="${dali_SOURCE_DIR}/dali-env/opt/share/dali/" +-Ddaliimagedir=dataReadOnlyDir"toolkit/images/" +-DDALI_IMAGE_DIR=daliimagedir +-DDEMO_STYLE_DIR=APP_DATA_RES_DIR"/style/" +-DAPPLICATION_RESOURCE_PATH="${dali_SOURCE_DIR}/dali-env/opt/share/com.samsung.dali-demo/res" +-DDEMO_VIDEO_DIR="${dali_SOURCE_DIR}/dali-env/opt/share/com.samsung.dali-demo/res/videos/" +-DDEMO_MODEL_DIR="${dali_SOURCE_DIR}/dali-env/opt/share/com.samsung.dali-demo/res/models/" +-DDEMO_SHADER_DIR="${dali_SOURCE_DIR}/dali-env/opt/share/com.samsung.dali-demo/res/shaders/" +-DDEMO_SCRIPT_DIR="${dali_SOURCE_DIR}/dali-env/opt/share/com.samsung.dali-demo/res/scripts/" +-DDEMO_GAME_DIR="${dali_SOURCE_DIR}/dali-env/opt/share/com.samsung.dali-demo/res/game" +/vmg +/FI"${dali_SOURCE_DIR}/dali-adaptor/dali-windows-backend/ExInclude/PreprocessorDefinitions.h" +/FI"${dali_SOURCE_DIR}/dali-adaptor/dali-windows-backend/ExInclude/DaliDemoPreDefine.h" +-Dssize_t=size_t +/Gz +) +#head file path +INCLUDE_DIRECTORIES( +${dali_SOURCE_DIR}/dali-demo +${dali_SOURCE_DIR}/dali-env/opt/include +${dali_SOURCE_DIR}/dali-demo/examples/text-label-emojis +${dali_SOURCE_DIR}/dali-core +${dali_SOURCE_DIR}/dali-adaptor +${dali_SOURCE_DIR}/dali-toolkit +${dali_SOURCE_DIR}/dali-adaptor/dali-windows-backend/ExInclude +) + +link_directories( +${dali_SOURCE_DIR}/dali-adaptor/dali-windows-backend/ExLib +${dali_SOURCE_DIR}/bin +) + +set(EXECUTABLE_OUTPUT_PATH bin) + +add_executable(dali-demo ${SOURCES}) + +target_link_libraries(dali-demo dali-core.lib) +target_link_libraries(dali-demo dali-adaptor.lib) +target_link_libraries(dali-demo dali-toolkit.lib) +target_link_libraries(dali-demo Win32File.lib) +target_link_libraries(dali-demo WindowsPlatform.lib) +target_link_libraries(dali-demo libjpeg.lib) +target_link_libraries(dali-demo libcurl_a.lib) +target_link_libraries(dali-demo turbojpeg.lib) +target_link_libraries(dali-demo getopt.lib) +target_link_libraries(dali-demo giflib.lib) +target_link_libraries(dali-demo libEGL.lib) +target_link_libraries(dali-demo libexif.lib) +target_link_libraries(dali-demo libGLESv2.lib) +target_link_libraries(dali-demo pthread.lib) +target_link_libraries(dali-demo libpng.lib) +target_link_libraries(dali-demo zlibstat.lib) +target_link_libraries(dali-demo legacy_stdio_definitions.lib) +target_link_libraries(dali-demo freetype.lib) +target_link_libraries(dali-demo FontConfig.lib) +target_link_libraries(dali-demo libexpat.lib) +target_link_libraries(dali-demo fribidi.lib) +target_link_libraries(dali-demo harfbuzz-1.4.7.lib) +target_link_libraries(dali-demo dlfcn.lib) +target_link_libraries(dali-demo Iphlpapi.lib) +target_link_libraries(dali-demo Psapi.lib) +target_link_libraries(dali-demo Userenv.lib) + +add_dependencies(dali-demo dali-core) +add_dependencies(dali-demo dali-adaptor) +add_dependencies(dali-demo dali-toolkit) + diff --git a/examples/refraction-effect/refraction-effect-example.cpp b/examples/refraction-effect/refraction-effect-example.cpp old mode 100644 new mode 100755 index 14c4878..ad10428 --- a/examples/refraction-effect/refraction-effect-example.cpp +++ b/examples/refraction-effect/refraction-effect-example.cpp @@ -509,7 +509,9 @@ private: } std::istringstream iss(line.substr(2), std::istringstream::in); - unsigned int indices[ numOfInt ]; + + std::vector indices( numOfInt ); + unsigned int i=0; while( iss >> indices[i++] && i < numOfInt); unsigned int step = (i+1) / 3; diff --git a/examples/text-fonts/text-fonts-example.cpp b/examples/text-fonts/text-fonts-example.cpp old mode 100644 new mode 100755 index 1519b87..876b55f --- a/examples/text-fonts/text-fonts-example.cpp +++ b/examples/text-fonts/text-fonts-example.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/examples/text-label/text-label-example.cpp b/examples/text-label/text-label-example.cpp old mode 100644 new mode 100755 index 63f1c36..955466b --- a/examples/text-label/text-label-example.cpp +++ b/examples/text-label/text-label-example.cpp @@ -213,7 +213,7 @@ public: mContainer = Control::New(); mContainer.SetName( "Container" ); mContainer.SetParentOrigin( ParentOrigin::CENTER ); - mLayoutSize = Vector2(mStageSize.width*0.6f, mStageSize.width*0.6f); + mLayoutSize = Vector2(mStageSize.width*0.6f, mStageSize.height*0.6f); mContainer.SetSize( mLayoutSize ); stage.Add( mContainer ); diff --git a/main/main-example.cpp b/main/main-example.cpp new file mode 100755 index 0000000..290d87a --- /dev/null +++ b/main/main-example.cpp @@ -0,0 +1,117 @@ +//#include "examples/Alpha-Blending-Cpu/Alpha-Blending-Cpu-example.cpp" +//#include "examples/Animated-Shapes/Animated-Shapes-example.cpp" +//#include "examples/Benchmark/Benchmark.cpp" +//#include "examples/Blocks/Blocks-example.cpp" +#include "examples/Bubble-Effect/Bubble-Effect-example.cpp" +//#include "examples/Buttons/Buttons-example.cpp" + +//#include "examples/Clipping/Clipping-example.cpp" +//#include "examples/Clipping/clipping-item-factory.cpp" + +//#include "examples/Clipping-Draw-Order/Clipping-Draw-Order.cpp" +//#include "examples/Compressed-Texture-Formats/Compressed-Texture-Formats-example.cpp" + +//#include "examples/Contact-Cards/Contact-Cards-example.cpp" +//#include "examples/Contact-Cards/clipped-image.cpp" +//#include "examples/Contact-Cards/contact-card.cpp" +//#include "examples/Contact-Cards/contact-card-layouter.cpp" +//#include "examples/Contact-Cards/contact-data.cpp" + +//#include "examples/compressed-texture-formats/compressed-texture-formats-example.cpp" + +//#include "examples/Cube-Transition-Effect/Cube-Transition-Effect-example.cpp" +//#include "examples/Effects-View/Effects-View-example.cpp" +//#include "examples/Flex-Container/Flex-Container-example.cpp" +//#include "examples/Focus-Integration/Focus-Integration.cpp" + + +//#include "examples/Gradients/Gradients-example.cpp" +//#include "examples/Hello-World/Hello-World-example.cpp" +//#include "examples/Homescreen-Benchmark/Homescreen-Benchmark.cpp" +//#include "examples/Image-Scaling-And-Filtering/Image-Scaling-And-Filtering-example.cpp" +//#include "examples/Image-Scaling-Irregular-Grid/Image-Scaling-Irregular-Grid-example.cpp" +//#include "examples/Image-View/Image-View-example.cpp" +//#include "examples/Image-View-Alpha-Blending/Image-View-Alpha-Blending-example.cpp" +//#include "examples/Image-View-Pixel-Area/Image-View-Pixel-Area-example.cpp" +//#include "examples/Image-View-Svg/Image-View-Svg-example.cpp" +//#include "examples/Image-View-Url/Image-View-Url-example.cpp" +//#include "examples/Item-View/Item-View-example.cpp" +//#include "examples/Line-Mesh/Line-Mesh-example.cpp" +//#include "examples/Magnifier/Magnifier-example.cpp" +//#include "examples/Mesh-Morph/Mesh-Morph-example.cpp" +//#include "examples/Mesh-Visual/Mesh-Visual-example.cpp" +//#include "examples/Model3d-View/Model3d-View-example.cpp" +//#include "examples/Motion-Blur/Motion-Blur-example.cpp" +//#include "examples/Motion-Stretch/Motion-Stretch-example.cpp" +//#include "examples/Native-Image-Source/Native-Image-Source-example.cpp" +//#include "examples/Perf-Scroll/Perf-Scroll.cpp" +//#include "examples/Pivot/Pivot-example.cpp" +//#include "examples/Point-mesh/Point-mesh-example.cpp" +//#include "examples/Popup/Popup-example.cpp" +//#include "examples/Primitive-Shapes/Primitive-Shapes-example.cpp" +//#include "examples/Progress-Bar/Progress-Bar-example.cpp" +//#include "examples/Property-Notification/Property-Notification-example.cpp" +//#include "examples/Ray-Marching/Ray-Marching-example.cpp" +//#include "examples/refraction-effect/refraction-effect-example.cpp" +//#include "examples/Remote-Image-Loading/Remote-Image-Loading-example.cpp" +//#include "examples/Renderer-Stencil/Renderer-Stencil-example.cpp" +//#include "examples/Rendering-Basic-Light/Rendering-Basic-Light-example.cpp" + +//#include "examples/Rendering-Basic-Pbr/Rendering-Basic-Pbr-example.cpp" +//#include "examples/Rendering-Basic-Pbr/ktx-loader.cpp" +//#include "examples/Rendering-Basic-Pbr/model-pbr.cpp" +//#include "examples/Rendering-Basic-Pbr/model-skybox.cpp" +//#include "examples/Rendering-Basic-Pbr/obj-loader.cpp" + +//#include "examples/rendering-skybox/look-camera.cpp" +//#include "examples/rendering-skybox/rendering-skybox.cpp" + +//#include "examples/Rendering-Cube/Rendering-Cube.cpp" +//#include "examples/Rendering-Line/Rendering-Line.cpp" + +//#include "examples/Rendering-Textured-Cube/Rendering-Textured-Cube.cpp" +//#include "examples/Rendering-Triangle/Rendering-Triangle.cpp" +//#include "examples/Scroll-View/Scroll-View-example.cpp" +//#include "examples/Shadows-And-Lights/Shadows-And-Lights-example.cpp" +//#include "examples/Size-Negotiation/Size-Negotiation-example.cpp" + +//#include "examples/simple-visuals-control/my-control.cpp" +//#include "examples/simple-visuals-control/my-control-impl.cpp" +//#include "examples/simple-visuals-control/simple-visuals-application.cpp" +//#include "examples/simple-visuals-control/simple-visuals-example.cpp" + +//#include "examples/Sparkle/Sparkle-Effect-example.cpp" + +//#include "examples/styling/Style-example.cpp" +//#include "examples/styling/image-channel-control.cpp" +//#include "examples/styling/image-channel-control-impl.cpp" +//#include "examples/styling/styling-application.cpp" + +//#include "examples/Text-Editor/Text-Editor-example.cpp" + +//#include "examples/text-fonts/text-fonts-example.cpp" + +//#include "examples/text-label/expanding-buttons.cpp" +//#include "examples/text-label/expanding-buttons-impl.cpp" +//#include "examples/text-label/text-label-example.cpp" + +//#include "examples/text-label-multi-language/text-label-multi-language-example.cpp" + +//#include "examples/Text-Label-Emojis/Text-Label-Emojis.cpp" +//#include "examples/Text-Memory-Profiling/Text-Memory-Profiling-example.cpp" +//#include "examples/Text-Overlap/Text-Overlap-example.cpp" +//#include "examples/Text-Scrolling/Text-Scrolling-example.cpp" +//#include "examples/Textured-Mesh/Textured-Mesh-example.cpp" +//#include "examples/Tilt/Tilt-example.cpp" +//#include "examples/Tooltip/Tooltip-example.cpp" + +//#include "examples/Transitions/Transition-example.cpp" +//#include "examples/Transitions/shadow-button.cpp" +//#include "examples/Transitions/shadow-button-impl.cpp" +//#include "examples/Transitions/transition-application.cpp" + +//#include "examples/Visual-Transitions/Transition-example.cpp" +//#include "examples/Visual-Transitions/beat-control.cpp" +//#include "examples/Visual-Transitions/beat-control-impl.cpp" +//#include "examples/Visual-Transitions/transition-application.cpp" + diff --git a/prebuild.bat b/prebuild.bat new file mode 100755 index 0000000..cab182f --- /dev/null +++ b/prebuild.bat @@ -0,0 +1,31 @@ +xcopy /s/y/i/f/d "..\dali-adaptor\dali\integration-api\*.h" "..\dali-env\opt\include\dali\integration-api\adaptors" +xcopy /s/y/i/f/d "..\dali-env\opt\include\dali\integration-api\adaptors\windows\*.*" "..\dali-env\opt\include\dali\integration-api\adaptors" +copy /d "..\dali-adaptor\dali\public-api\dali.h" "..\dali-env\opt\include\dali\dali.h" + +xcopy /s/y/i/f/d "..\dali-toolkit\dali-toolkit\styles\*.json" "..\dali-env\opt\share\dali\toolkit\styles" +xcopy /s/y/i/f/d "..\dali-toolkit\dali-toolkit\styles\480x800\*.json" "..\dali-env\opt\share\dali\toolkit\styles" +xcopy /s/y/i/f/d "..\dali-toolkit\dali-toolkit\styles\480x800\images\*.png" "..\dali-env\opt\share\dali\toolkit\styles\images" +xcopy /s/y/i/f/d "..\dali-toolkit\dali-toolkit\styles\images-common\*.png" "..\dali-env\opt\share\dali\toolkit\images" +xcopy /s/y/i/f/d "..\dali-toolkit\dali-toolkit\sounds\*.ogg" "..\dali-env\opt\share\dali\toolkit\sounds" + +xcopy /s/y/i/f/d "resources\game\*.*" "..\dali-env\opt\share\com.samsung.dali-demo\res\game" +xcopy /s/y/i/f/d "resources\images\*.*" "..\dali-env\opt\share\com.samsung.dali-demo\res\images" +xcopy /s/y/i/f/d "resources\models\*.*" "..\dali-env\opt\share\com.samsung.dali-demo\res\models" +xcopy /s/y/i/f/d "resources\scripts\*.json" "..\dali-env\opt\share\com.samsung.dali-demo\res\scripts" +xcopy /s/y/i/f/d "resources\shaders\*.*" "..\dali-env\opt\share\com.samsung.dali-demo\res\shaders" +xcopy /s/y/i/f/d "resources\style\*.json" "..\dali-env\opt\share\com.samsung.dali-demo\res\style" +xcopy /s/y/i/f/d "resources\style\images\*.png" "..\dali-env\opt\share\com.samsung.dali-demo\res\style\images" +xcopy /s/y/i/f/d "resources\videos\*.*" "..\dali-env\opt\share\com.samsung.dali-demo\res\videos" +xcopy /s/y/i/f/d "..\dali-adaptor\dali-windows-backend\ExDll\*.dll" "..\bin\Debug" + +copy "CMakeLists.txt" "../CMakeLists.txt" + +cd .. +set appPackage=%envDir%"/opt/share/com.samsung.dali-demo/res" +set csharpDemoDir=%cd%\"dali-windows-backend\csharp-demo" + +setx dali_csharp-demo %csharpDemoDir:\=/% +setx DALI_APPLICATION_PACKAGE %appPackage:\=/% +setx DALI_WINDOW_WIDTH 1920 +setx DALI_WINDOW_HEIGHT 1080 +@pause \ No newline at end of file diff --git a/shared/multi-language-strings.h b/shared/multi-language-strings.h old mode 100644 new mode 100755 index f5f1675..0946908 --- a/shared/multi-language-strings.h +++ b/shared/multi-language-strings.h @@ -1,4 +1,4 @@ -#ifndef __DALI_DEMO_MULTI_LANGUAGE_STRINGS_H__ +#ifndef __DALI_DEMO_MULTI_LANGUAGE_STRINGS_H__ #define __DALI_DEMO_MULTI_LANGUAGE_STRINGS_H__ /* -- 2.7.4