Commit 94b27633d262c51ee43c98af4eb81aa12d672ae4
[dali_1.0.31] Merge branch 'tizen'
Change-Id: Ibed89362a6744e820157af37583129fafa977d11
Showing
34 changed files
with
506 additions
and
803 deletions
README
build/tizen/.gitignore
| 1 | -/aclocal.m4 | |
| 2 | -/autom4te.cache | |
| 3 | -/compile | |
| 4 | -/config.guess | |
| 5 | -/config.log | |
| 6 | -/config.status | |
| 7 | -/config.sub | |
| 8 | -/configure | |
| 9 | -/depcomp | |
| 10 | -/install-sh | |
| 11 | -/libtool | |
| 12 | -/ltmain.sh | |
| 13 | -/missing | |
| 1 | +CMakeCache.txt | |
| 2 | +CMakeFiles/ | |
| 3 | +cmake_install.cmake | |
| 4 | +demo/dali-demo | |
| 5 | +install_manifest.txt | |
| 14 | 6 | /demo/dali-demo |
| 15 | 7 | /demo/dali-examples |
| 16 | 8 | /demo/dali-performance | ... | ... |
build/tizen/CMakeLists.txt
0 → 100644
| 1 | +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) | |
| 2 | +PROJECT(dali-demo C CXX) | |
| 3 | + | |
| 4 | +SET(dali-demo_VERSION_MAJOR 1) | |
| 5 | +SET(dali-demo_VERSION_MINOR 0) | |
| 6 | + | |
| 7 | +SET(ROOT_SRC_DIR ${CMAKE_SOURCE_DIR}/../..) | |
| 8 | + | |
| 9 | +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) | |
| 10 | + | |
| 11 | +IF(DEFINED DALI_APP_DIR) | |
| 12 | + SET(APP_DATA_DIR ${DALI_APP_DIR}) | |
| 13 | + SET(BINDIR ${APP_DATA_DIR}/bin) | |
| 14 | +ELSE() | |
| 15 | + SET(APP_DATA_DIR ${PREFIX}/share/com.samsung.dali-demo) | |
| 16 | + SET(BINDIR ${PREFIX}/bin) | |
| 17 | +ENDIF() | |
| 18 | + | |
| 19 | +SET(LOCAL_IMAGES_DIR ${ROOT_SRC_DIR}/demo/images) | |
| 20 | +SET(LOCAL_MODELS_DIR ${ROOT_SRC_DIR}/demo/models) | |
| 21 | +SET(LOCAL_SCRIPTS_DIR ${ROOT_SRC_DIR}/demo/scripts) | |
| 22 | + | |
| 23 | +SET(IMAGES_DIR ${APP_DATA_DIR}/images/) | |
| 24 | +SET(MODELS_DIR ${APP_DATA_DIR}/models/) | |
| 25 | +SET(SCRIPTS_DIR ${APP_DATA_DIR}/scripts/) | |
| 26 | + | |
| 27 | +SET(DALI_IMAGE_DIR \\"${IMAGES_DIR}\\") | |
| 28 | +SET(DALI_MODEL_DIR \\"${MODELS_DIR}\\") | |
| 29 | +SET(DALI_SCRIPT_DIR \\"${SCRIPTS_DIR}\\") | |
| 30 | +SET(DALI_EXAMPLE_BIN \\"${BINDIR}/\\") | |
| 31 | + | |
| 32 | +FILE(GLOB LOCAL_IMAGES_PNG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png") | |
| 33 | +FILE(GLOB LOCAL_IMAGES_JPG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg") | |
| 34 | +FILE(GLOB LOCAL_IMAGES_GIF RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.gif") | |
| 35 | +FILE(GLOB LOCAL_IMAGES_BMP RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.bmp") | |
| 36 | +FILE(GLOB LOCAL_IMAGES_ICO RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.ico") | |
| 37 | +FILE(GLOB LOCAL_IMAGES_WBMP RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.wbmp") | |
| 38 | + | |
| 39 | +SET(LOCAL_IMAGES_LIST ${LOCAL_IMAGES_PNG};${LOCAL_IMAGES_JPG};${LOCAL_IMAGES_GIF};${LOCAL_IMAGES_BMP};${LOCAL_IMAGES_ICO};${LOCAL_IMAGES_WBMP}) | |
| 40 | +FOREACH(flag ${LOCAL_IMAGES_LIST}) | |
| 41 | + INSTALL(FILES ../../demo/images/${flag} DESTINATION ${IMAGES_DIR}) | |
| 42 | +ENDFOREACH(flag) | |
| 43 | + | |
| 44 | +FILE(GLOB LOCAL_MODELS_LIST RELATIVE "${LOCAL_MODELS_DIR}" "${LOCAL_MODELS_DIR}/*") | |
| 45 | +FOREACH(flag ${LOCAL_MODELS_LIST}) | |
| 46 | + INSTALL(FILES ../../demo/models/${flag} DESTINATION ${MODELS_DIR}) | |
| 47 | +ENDFOREACH(flag) | |
| 48 | + | |
| 49 | +FILE(GLOB LOCAL_SCRIPTS_LIST RELATIVE "${LOCAL_SCRIPTS_DIR}" "${LOCAL_SCRIPTS_DIR}/*") | |
| 50 | +FOREACH(flag ${LOCAL_SCRIPTS_LIST}) | |
| 51 | + INSTALL(FILES ../../demo/scripts/${flag} DESTINATION ${SCRIPTS_DIR}) | |
| 52 | +ENDFOREACH(flag) | |
| 53 | + | |
| 54 | +SET(PKG_LIST dali | |
| 55 | + dali-toolkit) | |
| 56 | + | |
| 57 | +INCLUDE(FindPkgConfig) | |
| 58 | +pkg_check_modules(REQUIRED_PKGS REQUIRED ${PKG_LIST}) | |
| 59 | + | |
| 60 | +FOREACH(flag ${REQUIRED_PKGS_CFLAGS}) | |
| 61 | + SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}") | |
| 62 | +ENDFOREACH(flag) | |
| 63 | + | |
| 64 | +SET(DALI_DEMO_CFLAGS "-DDALI_IMAGE_DIR=${DALI_IMAGE_DIR} -DDALI_MODEL_DIR=${DALI_MODEL_DIR} -DDALI_SCRIPT_DIR=${DALI_SCRIPT_DIR} -DDALI_EXAMPLE_BIN=${DALI_EXAMPLE_BIN} -fvisibility=hidden -DHIDE_DALI_INTERNALS") | |
| 65 | + | |
| 66 | +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${REQUIRED_CFLAGS} ${DALI_DEMO_CFLAGS} -Werror -Wall") | |
| 67 | +SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") | |
| 68 | + | |
| 69 | +INCLUDE_DIRECTORIES(${ROOT_SRC_DIR}) | |
| 70 | +INCLUDE_DIRECTORIES(${DEMO_SRC_DIR}) | |
| 71 | + | |
| 72 | +ADD_SUBDIRECTORY(demo) | |
| 73 | +ADD_SUBDIRECTORY(examples) | ... | ... |
build/tizen/Makefile.am deleted
| 1 | -SUBDIRS = examples demo | |
| 2 | - | |
| 3 | -MAINTAINERCLEANFILES = \ | |
| 4 | - aclocal.m4 \ | |
| 5 | - autom4te.cache \ | |
| 6 | - config.guess \ | |
| 7 | - config.sub \ | |
| 8 | - configure \ | |
| 9 | - depcomp \ | |
| 10 | - install-sh \ | |
| 11 | - ltmain.sh \ | |
| 12 | - missing \ | |
| 13 | - `find "$(srcdir)" -type f -name Makefile.in -print` \ | |
| 14 | - `find . \( -name "*.gcov" -o -name "*.gcno" -o -name "*.gcda" \) -print` | |
| 15 | - | |
| 16 | -CLEANFILES = \ | |
| 17 | - `find . \( -name "*.gcov" -o -name "*.gcno" -o -name "*.gcda" \) -print` |
build/tizen/configure.ac deleted
| 1 | -# Copyright (c) 2014 Samsung Electronics Co., Ltd. | |
| 2 | - | |
| 3 | -# Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | -# you may not use this file except in compliance with the License. | |
| 5 | -# You may obtain a copy of the License at | |
| 6 | - | |
| 7 | -# http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | - | |
| 9 | -# Unless required by applicable law or agreed to in writing, software | |
| 10 | -# distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | -# See the License for the specific language governing permissions and | |
| 13 | -# limitations under the License. | |
| 14 | - | |
| 15 | - | |
| 16 | -m4_define([dali_version],[0.1.0]) | |
| 17 | -AC_INIT([dali], [dali_version]) | |
| 18 | -AM_INIT_AUTOMAKE([-Wall foreign]) | |
| 19 | - | |
| 20 | -AC_PROG_CXX | |
| 21 | -AC_PROG_LIBTOOL | |
| 22 | - | |
| 23 | -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | |
| 24 | - | |
| 25 | -LT_INIT | |
| 26 | - | |
| 27 | -DALI_VERSION=dali_version | |
| 28 | -AC_SUBST(DALI_VERSION) | |
| 29 | - | |
| 30 | -PKG_CHECK_MODULES(DALI, dali) | |
| 31 | -PKG_CHECK_MODULES(DALI_TOOLKIT, dali-toolkit) | |
| 32 | - | |
| 33 | -DALIDEMO_CFLAGS=-DPLATFORM_SLP | |
| 34 | - | |
| 35 | -AC_ARG_ENABLE([debug], | |
| 36 | - [AC_HELP_STRING([--enable-debug], | |
| 37 | - [Turns on debugging])], | |
| 38 | - [enable_debug=$enableval], | |
| 39 | - [enable_debug=no]) | |
| 40 | - | |
| 41 | -if test "x$enable_debug" = "xyes"; then | |
| 42 | - DALIDEMO_CFLAGS="$DALIDEMO_CFLAGS -DDEBUG_ENABLED" | |
| 43 | -fi | |
| 44 | - | |
| 45 | -if test x$DALI_APP_DIR != x; then | |
| 46 | - appdatadir=$DALI_APP_DIR | |
| 47 | - exedir=${appdatadir}/bin/ | |
| 48 | -else | |
| 49 | - appdatadir=${prefix}/share/com.samsung.dali-demo/ | |
| 50 | - exedir=${prefix}/bin/ | |
| 51 | -fi | |
| 52 | - | |
| 53 | -AC_SUBST(datadir) | |
| 54 | -AC_SUBST(appdatadir) | |
| 55 | -AC_SUBST(exedir) | |
| 56 | -AC_SUBST(DALIDEMO_CFLAGS) | |
| 57 | - | |
| 58 | -dnl ************************************************************************** | |
| 59 | -dnl ** Set Debian install Prefix ** | |
| 60 | -dnl ************************************************************************** | |
| 61 | -debian_prefix=${prefix#*/} | |
| 62 | -AC_SUBST(debian_prefix) | |
| 63 | - | |
| 64 | -AC_CONFIG_FILES([ | |
| 65 | - Makefile | |
| 66 | - demo/Makefile | |
| 67 | - examples/Makefile | |
| 68 | -]) | |
| 69 | - | |
| 70 | - | |
| 71 | -AC_OUTPUT | |
| 72 | - | |
| 73 | -echo " | |
| 74 | -Configuration | |
| 75 | -------------- | |
| 76 | - Prefix: $prefix | |
| 77 | - Debug Build: $enable_debug | |
| 78 | - Application Data Dir: $appdatadir | |
| 79 | - Application Exe Dir: $exedir | |
| 80 | - DALIDEMO_CFLAGS: ${DALIDEMO_CFLAGS} | |
| 81 | -" |
build/tizen/demo/CMakeLists.txt
0 → 100644
build/tizen/demo/Makefile.am deleted
| 1 | -# Copyright (c) 2014 Samsung Electronics Co., Ltd. | |
| 2 | - | |
| 3 | -# Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | -# you may not use this file except in compliance with the License. | |
| 5 | -# You may obtain a copy of the License at | |
| 6 | - | |
| 7 | -# http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | - | |
| 9 | -# Unless required by applicable law or agreed to in writing, software | |
| 10 | -# distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | -# See the License for the specific language governing permissions and | |
| 13 | -# limitations under the License. | |
| 14 | - | |
| 15 | - | |
| 16 | -bin_PROGRAMS = \ | |
| 17 | - dali-demo | |
| 18 | - | |
| 19 | -demo_src_dir = ../../../demo | |
| 20 | -include ../../../demo/file.list | |
| 21 | - | |
| 22 | -dalidemoimagesdir = $(appdatadir)/images/ | |
| 23 | -dalidemoimages_DATA = $(demo_image_files) | |
| 24 | - | |
| 25 | -dalidemomodelsdir = $(appdatadir)/models/ | |
| 26 | -dalidemomodels_DATA = $(demo_model_files) | |
| 27 | - | |
| 28 | -dalidemoshadersdir = $(appdatadir)/shaders/ | |
| 29 | -dalidemoshaders_DATA = $(demo_shader_files) | |
| 30 | - | |
| 31 | -dalidemoscriptsdir = $(appdatadir)/scripts/ | |
| 32 | -dalidemoscripts_DATA = $(demo_script_files) | |
| 33 | - | |
| 34 | - | |
| 35 | -DEMO_CXXFLAGS = -DDALI_IMAGE_DIR="\"$(dalidemoimagesdir)\"" \ | |
| 36 | - -DDALI_MODEL_DIR="\"$(dalidemomodelsdir)\"" \ | |
| 37 | - -DDALI_SCRIPT_DIR="\"$(dalidemoscriptsdir)\"" \ | |
| 38 | - -DDALI_SHADER_DIR="\"$(dalidemoshadersdir)\"" \ | |
| 39 | - -DDALI_EXAMPLE_BIN="\"$(exedir)\"" \ | |
| 40 | - -I../../../demo -I../../.. \ | |
| 41 | - $(DALIDEMO_CFLAGS) \ | |
| 42 | - $(DALI_TOOLKIT_CFLAGS) \ | |
| 43 | - $(DALI_CFLAGS) \ | |
| 44 | - $(AUL_CFLAGS) \ | |
| 45 | - -Werror -Wall | |
| 46 | - | |
| 47 | -DEMO_DEPS = | |
| 48 | - | |
| 49 | -DEMO_LDADD = $(DALI_LIBS) $(DALI_TOOLKIT_LIBS) $(AUL_LIBS) | |
| 50 | - | |
| 51 | -dali_demo_SOURCES = $(demo_src_files) | |
| 52 | -dali_demo_CXXFLAGS = $(DEMO_CXXFLAGS) | |
| 53 | -dali_demo_DEPENDENCIES = $(DEMO_DEPS) | |
| 54 | -dali_demo_LDADD = $(DEMO_LDADD) |
build/tizen/docs/Makefile.am deleted
build/tizen/examples/CMakeLists.txt
0 → 100644
| 1 | +SET(EXAMPLES_SRC_DIR ${ROOT_SRC_DIR}/examples) | |
| 2 | + | |
| 3 | +SET(BLOCKS_SRCS ${EXAMPLES_SRC_DIR}/blocks/blocks-example.cpp) | |
| 4 | +ADD_EXECUTABLE(blocks.example ${BLOCKS_SRCS}) | |
| 5 | +TARGET_LINK_LIBRARIES(blocks.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 6 | +INSTALL(TARGETS blocks.example DESTINATION ${BINDIR}) | |
| 7 | + | |
| 8 | +SET(BUBBLE_EFFECT_SRCS ${EXAMPLES_SRC_DIR}/shader-effect/bubble-effect-example.cpp) | |
| 9 | +ADD_EXECUTABLE(bubble-effect.example ${BUBBLE_EFFECT_SRCS}) | |
| 10 | +TARGET_LINK_LIBRARIES(bubble-effect.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 11 | +INSTALL(TARGETS bubble-effect.example DESTINATION ${BINDIR}) | |
| 12 | + | |
| 13 | +SET(CLUSTER_SRCS ${EXAMPLES_SRC_DIR}/cluster/cluster-example.cpp) | |
| 14 | +ADD_EXECUTABLE(cluster.example ${CLUSTER_SRCS}) | |
| 15 | +TARGET_LINK_LIBRARIES(cluster.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 16 | +INSTALL(TARGETS cluster.example DESTINATION ${BINDIR}) | |
| 17 | + | |
| 18 | +SET(CUBE_TRANSITION_EFFECT_SRCS ${EXAMPLES_SRC_DIR}/transition/cube-transition-effect-example.cpp) | |
| 19 | +ADD_EXECUTABLE(cube-transition-effect.example ${CUBE_TRANSITION_EFFECT_SRCS}) | |
| 20 | +TARGET_LINK_LIBRARIES(cube-transition-effect.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 21 | +INSTALL(TARGETS cube-transition-effect.example DESTINATION ${BINDIR}) | |
| 22 | + | |
| 23 | +SET(DISSOLVE_EFFECT_SRCS ${EXAMPLES_SRC_DIR}/shader-effect/dissolve-effect-example.cpp) | |
| 24 | +ADD_EXECUTABLE(dissolve-effect.example ${DISSOLVE_EFFECT_SRCS}) | |
| 25 | +TARGET_LINK_LIBRARIES(dissolve-effect.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 26 | +INSTALL(TARGETS dissolve-effect.example DESTINATION ${BINDIR}) | |
| 27 | + | |
| 28 | +SET(HELLO_WORLD_SRCS ${EXAMPLES_SRC_DIR}/hello-world/hello-world-example.cpp) | |
| 29 | +ADD_EXECUTABLE(hello-world.example ${HELLO_WORLD_SRCS}) | |
| 30 | +TARGET_LINK_LIBRARIES(hello-world.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 31 | +INSTALL(TARGETS hello-world.example DESTINATION ${BINDIR}) | |
| 32 | + | |
| 33 | +SET(ITEM_VIEW_SRCS ${EXAMPLES_SRC_DIR}/item-view/item-view-example.cpp) | |
| 34 | +ADD_EXECUTABLE(item-view.example ${ITEM_VIEW_SRCS}) | |
| 35 | +TARGET_LINK_LIBRARIES(item-view.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 36 | +INSTALL(TARGETS item-view.example DESTINATION ${BINDIR}) | |
| 37 | + | |
| 38 | +SET(MAGNIFIER_SRCS ${EXAMPLES_SRC_DIR}/magnifier/magnifier-example.cpp) | |
| 39 | +ADD_EXECUTABLE(magnifier.example ${MAGNIFIER_SRCS}) | |
| 40 | +TARGET_LINK_LIBRARIES(magnifier.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 41 | +INSTALL(TARGETS magnifier.example DESTINATION ${BINDIR}) | |
| 42 | + | |
| 43 | +SET(MOTION_BLUR_SRCS ${EXAMPLES_SRC_DIR}/motion/motion-blur-example.cpp) | |
| 44 | +ADD_EXECUTABLE(motion-blur.example ${MOTION_BLUR_SRCS}) | |
| 45 | +TARGET_LINK_LIBRARIES(motion-blur.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 46 | +INSTALL(TARGETS motion-blur.example DESTINATION ${BINDIR}) | |
| 47 | + | |
| 48 | +SET(MOTION_STRETCH_SRCS ${EXAMPLES_SRC_DIR}/motion/motion-stretch-example.cpp) | |
| 49 | +ADD_EXECUTABLE(motion-stretch.example ${MOTION_STRETCH_SRCS}) | |
| 50 | +TARGET_LINK_LIBRARIES(motion-stretch.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 51 | +INSTALL(TARGETS motion-stretch.example DESTINATION ${BINDIR}) | |
| 52 | + | |
| 53 | +SET(NEW_WINDOW_SRCS ${EXAMPLES_SRC_DIR}/new-window/new-window-example.cpp) | |
| 54 | +ADD_EXECUTABLE(new-window.example ${NEW_WINDOW_SRCS}) | |
| 55 | +TARGET_LINK_LIBRARIES(new-window.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 56 | +INSTALL(TARGETS new-window.example DESTINATION ${BINDIR}) | |
| 57 | + | |
| 58 | +SET(PAGE_TURN_VIEW_SRCS ${EXAMPLES_SRC_DIR}/page-turn-view/page-turn-view-example.cpp) | |
| 59 | +ADD_EXECUTABLE(page-turn-view.example ${PAGE_TURN_VIEW_SRCS}) | |
| 60 | +TARGET_LINK_LIBRARIES(page-turn-view.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 61 | +INSTALL(TARGETS page-turn-view.example DESTINATION ${BINDIR}) | |
| 62 | + | |
| 63 | +AUX_SOURCE_DIRECTORY(${EXAMPLES_SRC_DIR}/radial-menu RADIAL_MENU_SRCS) | |
| 64 | +ADD_EXECUTABLE(radial-menu.example ${RADIAL_MENU_SRCS}) | |
| 65 | +TARGET_LINK_LIBRARIES(radial-menu.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 66 | +INSTALL(TARGETS radial-menu.example DESTINATION ${BINDIR}) | |
| 67 | + | |
| 68 | +SET(REFRACTION_EFFECT_SRCS ${EXAMPLES_SRC_DIR}/shader-effect/refraction-effect-example.cpp) | |
| 69 | +ADD_EXECUTABLE(refraction-effect.example ${REFRACTION_EFFECT_SRCS}) | |
| 70 | +TARGET_LINK_LIBRARIES(refraction-effect.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 71 | +INSTALL(TARGETS refraction-effect.example DESTINATION ${BINDIR}) | |
| 72 | + | |
| 73 | +SET(SCROLL_VIEW_SRCS ${EXAMPLES_SRC_DIR}/scroll-view/scroll-view-example.cpp) | |
| 74 | +ADD_EXECUTABLE(scroll-view.example ${SCROLL_VIEW_SRCS}) | |
| 75 | +TARGET_LINK_LIBRARIES(scroll-view.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 76 | +INSTALL(TARGETS scroll-view.example DESTINATION ${BINDIR}) | |
| 77 | + | |
| 78 | +SET(SHADOW_BONE_LIGHTING_SRCS ${EXAMPLES_SRC_DIR}/shadows/shadow-bone-lighting-example.cpp) | |
| 79 | +ADD_EXECUTABLE(shadow-bone-lighting.example ${SHADOW_BONE_LIGHTING_SRCS}) | |
| 80 | +TARGET_LINK_LIBRARIES(shadow-bone-lighting.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 81 | +INSTALL(TARGETS shadow-bone-lighting.example DESTINATION ${BINDIR}) | |
| 82 | + | |
| 83 | +SET(DALI_BUILDER_SRCS ${EXAMPLES_SRC_DIR}/builder/dali-builder.cpp) | |
| 84 | +ADD_EXECUTABLE(dali-builder ${DALI_BUILDER_SRCS}) | |
| 85 | +TARGET_LINK_LIBRARIES(dali-builder ${REQUIRED_PKGS_LDFLAGS}) | |
| 86 | +INSTALL(TARGETS dali-builder DESTINATION ${BINDIR}) | |
| 87 | + | |
| 88 | +SET(BUILDER_SRCS ${EXAMPLES_SRC_DIR}/builder/examples.cpp) | |
| 89 | +ADD_EXECUTABLE(builder.example ${BUILDER_SRCS}) | |
| 90 | +TARGET_LINK_LIBRARIES(builder.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 91 | +INSTALL(TARGETS builder.example DESTINATION ${BINDIR}) | |
| 92 | + | |
| 93 | +SET(IMAGE_SCALING_IRREGULAR_GRID_SRCS ${EXAMPLES_SRC_DIR}/image/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp) | |
| 94 | +ADD_EXECUTABLE(image-scaling-irregular-grid.example ${IMAGE_SCALING_IRREGULAR_GRID_SRCS}) | |
| 95 | +TARGET_LINK_LIBRARIES(image-scaling-irregular-grid.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 96 | +INSTALL(TARGETS image-scaling-irregular-grid.example DESTINATION ${BINDIR}) | |
| 97 | + | |
| 98 | +SET(BUTTONS_SRCS ${EXAMPLES_SRC_DIR}/buttons/buttons-example.cpp) | |
| 99 | +ADD_EXECUTABLE(buttons.example ${BUTTONS_SRCS}) | |
| 100 | +TARGET_LINK_LIBRARIES(buttons.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 101 | +INSTALL(TARGETS buttons.example DESTINATION ${BINDIR}) | |
| 102 | + | |
| 103 | +SET(TEXT_VIEW_SRCS ${EXAMPLES_SRC_DIR}/text-view/text-view-example.cpp) | |
| 104 | +ADD_EXECUTABLE(text-view.example ${TEXT_VIEW_SRCS}) | |
| 105 | +TARGET_LINK_LIBRARIES(text-view.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 106 | +INSTALL(TARGETS text-view.example DESTINATION ${BINDIR}) | |
| 107 | + | |
| 108 | +SET(LOGGING_SRCS ${EXAMPLES_SRC_DIR}/logging/logging-example.cpp) | |
| 109 | +ADD_EXECUTABLE(logging.example ${LOGGING_SRCS}) | |
| 110 | +TARGET_LINK_LIBRARIES(logging.example ${REQUIRED_PKGS_LDFLAGS}) | |
| 111 | +INSTALL(TARGETS logging.example DESTINATION ${BINDIR}) | ... | ... |
build/tizen/examples/Makefile.am deleted
| 1 | -# Copyright (c) 2014 Samsung Electronics Co., Ltd. | |
| 2 | - | |
| 3 | -# Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | -# you may not use this file except in compliance with the License. | |
| 5 | -# You may obtain a copy of the License at | |
| 6 | - | |
| 7 | -# http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | - | |
| 9 | -# Unless required by applicable law or agreed to in writing, software | |
| 10 | -# distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | -# See the License for the specific language governing permissions and | |
| 13 | -# limitations under the License. | |
| 14 | - | |
| 15 | - | |
| 16 | -examples_src_dir = ../../../examples | |
| 17 | - | |
| 18 | -bin_PROGRAMS = \ | |
| 19 | - blocks.example \ | |
| 20 | - bubble-effect.example \ | |
| 21 | - cluster.example \ | |
| 22 | - cube-transition-effect.example \ | |
| 23 | - dissolve-effect.example \ | |
| 24 | - hello-world.example \ | |
| 25 | - item-view.example \ | |
| 26 | - magnifier.example \ | |
| 27 | - motion-blur.example \ | |
| 28 | - motion-stretch.example \ | |
| 29 | - new-window.example \ | |
| 30 | - page-turn-view.example \ | |
| 31 | - radial-menu.example \ | |
| 32 | - refraction-effect.example \ | |
| 33 | - scroll-view.example \ | |
| 34 | - shadow-bone-lighting.example \ | |
| 35 | - dali-builder \ | |
| 36 | - builder.example \ | |
| 37 | - image-scaling-irregular-grid.example \ | |
| 38 | - buttons.example \ | |
| 39 | - text-view.example \ | |
| 40 | - logging.example | |
| 41 | - | |
| 42 | - | |
| 43 | -daliimagedir = $(appdatadir)/images/ | |
| 44 | -dalimodeldir = $(appdatadir)/models/ | |
| 45 | -daliscriptdir = $(appdatadir)/scripts/ | |
| 46 | - | |
| 47 | -BASE_CXXFLAGS = -I../../../examples \ | |
| 48 | - -DDALI_IMAGE_DIR="\"${daliimagedir}\"" \ | |
| 49 | - -DDALI_MODEL_DIR="\"${dalimodeldir}\"" \ | |
| 50 | - -DDALI_SCRIPT_DIR="\"${daliscriptdir}\"" \ | |
| 51 | - $(DALIDEMO_CFLAGS) \ | |
| 52 | - $(ECORE_X_CFLAGS) \ | |
| 53 | - $(CAPI_MEDIA_PLAYER_CFLAGS) \ | |
| 54 | - $(CAPI_APPFW_APPLICATION_CFLAGS) \ | |
| 55 | - -I/usr/include/media \ | |
| 56 | - -Werror -Wall | |
| 57 | - | |
| 58 | -EXAMPLE_CXXFLAGS = $(DALI_CFLAGS) \ | |
| 59 | - $(DALI_TOOLKIT_CFLAGS) \ | |
| 60 | - $(BASE_CXXFLAGS) | |
| 61 | - | |
| 62 | - | |
| 63 | -EXAMPLE_DEPS = | |
| 64 | - | |
| 65 | -EXAMPLE_LDADD = $(DALI_LIBS) $(DALI_TOOLKIT_LIBS) $(ECORE_X_LIBS) $(CAPI_MEDIA_PLAYER_LIBS) $(CAPI_APPFW_APPLICATION_LIBS) -lrt -lEGL | |
| 66 | - | |
| 67 | - | |
| 68 | -blocks_example_SOURCES = $(examples_src_dir)/blocks/blocks-example.cpp | |
| 69 | -blocks_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 70 | -blocks_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 71 | -blocks_example_LDADD = $(EXAMPLE_LDADD) | |
| 72 | - | |
| 73 | -bubble_effect_example_SOURCES = $(examples_src_dir)/shader-effect/bubble-effect-example.cpp | |
| 74 | -bubble_effect_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 75 | -bubble_effect_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 76 | -bubble_effect_example_LDADD = $(EXAMPLE_LDADD) | |
| 77 | - | |
| 78 | -cluster_example_SOURCES = $(examples_src_dir)/cluster/cluster-example.cpp | |
| 79 | -cluster_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 80 | -cluster_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 81 | -cluster_example_LDADD = $(EXAMPLE_LDADD) | |
| 82 | - | |
| 83 | -cube_transition_effect_example_SOURCES = $(examples_src_dir)/transition/cube-transition-effect-example.cpp | |
| 84 | -cube_transition_effect_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 85 | -cube_transition_effect_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 86 | -cube_transition_effect_example_LDADD = $(EXAMPLE_LDADD) | |
| 87 | - | |
| 88 | -dissolve_effect_example_SOURCES = $(examples_src_dir)/shader-effect/dissolve-effect-example.cpp | |
| 89 | -dissolve_effect_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 90 | -dissolve_effect_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 91 | -dissolve_effect_example_LDADD = $(EXAMPLE_LDADD) | |
| 92 | - | |
| 93 | -hello_world_example_SOURCES = $(examples_src_dir)/hello-world/hello-world-example.cpp | |
| 94 | -hello_world_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 95 | -hello_world_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 96 | -hello_world_example_LDADD = $(EXAMPLE_LDADD) | |
| 97 | - | |
| 98 | -item_view_example_SOURCES = $(examples_src_dir)/item-view/item-view-example.cpp | |
| 99 | -item_view_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 100 | -item_view_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 101 | -item_view_example_LDADD = $(EXAMPLE_LDADD) | |
| 102 | - | |
| 103 | -magnifier_example_SOURCES = $(examples_src_dir)/magnifier/magnifier-example.cpp | |
| 104 | -magnifier_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 105 | -magnifier_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 106 | -magnifier_example_LDADD = $(EXAMPLE_LDADD) | |
| 107 | - | |
| 108 | -motion_blur_example_SOURCES = $(examples_src_dir)/motion/motion-blur-example.cpp | |
| 109 | -motion_blur_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 110 | -motion_blur_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 111 | -motion_blur_example_LDADD = $(EXAMPLE_LDADD) | |
| 112 | - | |
| 113 | -motion_stretch_example_SOURCES = $(examples_src_dir)/motion/motion-stretch-example.cpp | |
| 114 | -motion_stretch_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 115 | -motion_stretch_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 116 | -motion_stretch_example_LDADD = $(EXAMPLE_LDADD) | |
| 117 | - | |
| 118 | -new_window_example_SOURCES = $(examples_src_dir)/new-window/new-window-example.cpp | |
| 119 | -new_window_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 120 | -new_window_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 121 | -new_window_example_LDADD = $(EXAMPLE_LDADD) | |
| 122 | - | |
| 123 | -page_turn_view_example_SOURCES = $(examples_src_dir)/page-turn-view/page-turn-view-example.cpp | |
| 124 | -page_turn_view_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 125 | -page_turn_view_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 126 | -page_turn_view_example_LDADD = $(EXAMPLE_LDADD) | |
| 127 | - | |
| 128 | -radial_menu_example_SOURCES = $(examples_src_dir)/radial-menu/radial-menu-example.cpp \ | |
| 129 | - $(examples_src_dir)/radial-menu/radial-sweep-view.cpp \ | |
| 130 | - $(examples_src_dir)/radial-menu/radial-sweep-view-impl.cpp | |
| 131 | -radial_menu_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 132 | -radial_menu_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 133 | -radial_menu_example_LDADD = $(EXAMPLE_LDADD) | |
| 134 | - | |
| 135 | -refraction_effect_example_SOURCES = $(examples_src_dir)/shader-effect/refraction-effect-example.cpp | |
| 136 | -refraction_effect_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 137 | -refraction_effect_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 138 | -refraction_effect_example_LDADD = $(EXAMPLE_LDADD) | |
| 139 | - | |
| 140 | -scroll_view_example_SOURCES = $(examples_src_dir)/scroll-view/scroll-view-example.cpp | |
| 141 | -scroll_view_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 142 | -scroll_view_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 143 | -scroll_view_example_LDADD = $(EXAMPLE_LDADD) | |
| 144 | - | |
| 145 | -shadow_bone_lighting_example_SOURCES = $(examples_src_dir)/shadows/shadow-bone-lighting-example.cpp | |
| 146 | -shadow_bone_lighting_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 147 | -shadow_bone_lighting_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 148 | -shadow_bone_lighting_example_LDADD = $(EXAMPLE_LDADD) | |
| 149 | - | |
| 150 | -dali_builder_SOURCES = $(examples_src_dir)/builder/dali-builder.cpp | |
| 151 | -dali_builder_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 152 | -dali_builder_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 153 | -dali_builder_LDADD = $(EXAMPLE_LDADD) | |
| 154 | - | |
| 155 | -builder_example_SOURCES = $(examples_src_dir)/builder/examples.cpp | |
| 156 | -builder_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 157 | -builder_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 158 | -builder_example_LDADD = $(EXAMPLE_LDADD) | |
| 159 | - | |
| 160 | -image_scaling_irregular_grid_example_SOURCES = $(examples_src_dir)/image/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp | |
| 161 | -image_scaling_irregular_grid_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 162 | -image_scaling_irregular_grid_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 163 | -image_scaling_irregular_grid_example_LDADD = $(EXAMPLE_LDADD) | |
| 164 | - | |
| 165 | -buttons_example_SOURCES = $(examples_src_dir)/buttons/buttons-example.cpp | |
| 166 | -buttons_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 167 | -buttons_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 168 | -buttons_example_LDADD = $(EXAMPLE_LDADD) | |
| 169 | - | |
| 170 | -text_view_example_SOURCES = $(examples_src_dir)/text-view/text-view-example.cpp | |
| 171 | -text_view_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 172 | -text_view_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 173 | -text_view_example_LDADD = $(EXAMPLE_LDADD) | |
| 174 | - | |
| 175 | -logging_example_SOURCES = $(examples_src_dir)/logging/logging-example.cpp | |
| 176 | -logging_example_CXXFLAGS = $(EXAMPLE_CXXFLAGS) | |
| 177 | -logging_example_DEPENDENCIES = $(EXAMPLE_DEPS) | |
| 178 | -logging_example_LDADD = $(EXAMPLE_LDADD) |
demo/dali-table-view.cpp
| ... | ... | @@ -63,7 +63,7 @@ const float EFFECT_SNAP_DURATION = 0.66f; ///< Scroll Snap |
| 63 | 63 | const float EFFECT_FLICK_DURATION = 0.5f; ///< Scroll Flick Duration for Effects |
| 64 | 64 | const Vector3 ANGLE_CUBE_PAGE_ROTATE(Math::PI * 0.5f, Math::PI * 0.5f, 0.0f); |
| 65 | 65 | |
| 66 | -const int NUM_BACKGROUND_IMAGES = 20; | |
| 66 | +const int NUM_BACKGROUND_IMAGES = 18; | |
| 67 | 67 | const float BACKGROUND_SWIPE_SCALE = 0.025f; |
| 68 | 68 | const float BACKGROUND_SPREAD_SCALE = 1.5f; |
| 69 | 69 | const float SCALE_MOD = 1000.0f * Math::PI * 2.0f; |
| ... | ... | @@ -120,7 +120,7 @@ TextStyle GetTableTextStyle() |
| 120 | 120 | */ |
| 121 | 121 | ImageActor CreateBackground( std::string imagePath ) |
| 122 | 122 | { |
| 123 | - Image image = Image::New( imagePath ); | |
| 123 | + Image image = ResourceImage::New( imagePath ); | |
| 124 | 124 | ImageActor background = ImageActor::New( image ); |
| 125 | 125 | |
| 126 | 126 | background.SetAnchorPoint( AnchorPoint::CENTER ); |
| ... | ... | @@ -137,90 +137,40 @@ const float IMAGE_BORDER_TOP = IMAGE_BORDER_LEFT; |
| 137 | 137 | const float IMAGE_BORDER_BOTTOM = IMAGE_BORDER_LEFT; |
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | - * TableViewVisibilityConstraint | |
| 140 | + * Constraint to return a position for a bubble based on the scroll value and vertical wrapping. | |
| 141 | 141 | */ |
| 142 | -struct TableViewVisibilityConstraint | |
| 143 | -{ | |
| 144 | - bool operator()( const bool& current, | |
| 145 | - const PropertyInput& pagePositionProperty, | |
| 146 | - const PropertyInput& pageSizeProperty ) | |
| 147 | - { | |
| 148 | - // Only the tableview in the current page should be visible. | |
| 149 | - const Vector3& pagePosition = pagePositionProperty.GetVector3(); | |
| 150 | - const Vector3& pageSize = pageSizeProperty.GetVector3(); | |
| 151 | - return fabsf( pagePosition.x ) < pageSize.x; | |
| 152 | - } | |
| 153 | -}; | |
| 154 | - | |
| 155 | -/** | |
| 156 | - * Constraint to wrap an actor in y that is moving vertically | |
| 157 | - */ | |
| 158 | -Vector3 ShapeMovementConstraint( const Vector3& current, | |
| 159 | - const PropertyInput& shapeSizeProperty, | |
| 160 | - const PropertyInput& parentSizeProperty ) | |
| 161 | -{ | |
| 162 | - const Vector3& shapeSize = shapeSizeProperty.GetVector3(); | |
| 163 | - const Vector3& parentSize = parentSizeProperty.GetVector3(); | |
| 164 | - | |
| 165 | - Vector3 pos( current ); | |
| 166 | - if( pos.y + shapeSize.y * 0.5f < -parentSize.y * 0.5f ) | |
| 167 | - { | |
| 168 | - pos.y += parentSize.y + shapeSize.y; | |
| 169 | - } | |
| 170 | - | |
| 171 | - return pos; | |
| 172 | -} | |
| 173 | - | |
| 174 | -/** | |
| 175 | - * Constraint to return a position for the background based on the scroll value | |
| 176 | - */ | |
| 177 | -struct AnimScrollConstraint | |
| 142 | +struct AnimateBubbleConstraint | |
| 178 | 143 | { |
| 179 | 144 | public: |
| 180 | - | |
| 181 | - AnimScrollConstraint( const Vector3& initialPos, float scale ) | |
| 182 | - : mInitialPos( initialPos ), | |
| 183 | - mScale( scale ) | |
| 184 | - { | |
| 185 | - | |
| 186 | - } | |
| 187 | - | |
| 188 | - Vector3 operator()( const Vector3& current, const PropertyInput& scrollProperty ) | |
| 145 | + AnimateBubbleConstraint( const Vector3& initialPos, float scale, float size ) | |
| 146 | + : mInitialX( initialPos.x ), | |
| 147 | + mScale( scale ), | |
| 148 | + mShapeSize( size ) | |
| 189 | 149 | { |
| 190 | - float scrollPos = scrollProperty.GetVector3().x; | |
| 191 | - | |
| 192 | - return mInitialPos + Vector3( -scrollPos * mScale, 0.0f, 0.0f ); | |
| 193 | 150 | } |
| 194 | 151 | |
| 195 | -private: | |
| 196 | - Vector3 mInitialPos; | |
| 197 | - float mScale; | |
| 198 | -}; | |
| 199 | - | |
| 200 | -/** | |
| 201 | - * Constraint to return a tracked world position added to the constant local position | |
| 202 | - */ | |
| 203 | -struct TranslateLocalConstraint | |
| 204 | -{ | |
| 205 | -public: | |
| 206 | - | |
| 207 | - TranslateLocalConstraint( const Vector3& localPos ) | |
| 208 | - : mLocalPos( localPos ) | |
| 152 | + Vector3 operator()( const Vector3& current, const PropertyInput& scrollProperty, const PropertyInput& parentSize ) | |
| 209 | 153 | { |
| 210 | - } | |
| 154 | + Vector3 pos( current ); | |
| 211 | 155 | |
| 212 | - Vector3 operator()( const Vector3& current, const PropertyInput& pagePosProperty ) | |
| 213 | - { | |
| 214 | - Vector3 worldPos = pagePosProperty.GetVector3(); | |
| 156 | + // Wrap bubbles verically. | |
| 157 | + if( pos.y + mShapeSize * 0.5f < -parentSize.GetVector3().y * 0.5f ) | |
| 158 | + { | |
| 159 | + pos.y += parentSize.GetVector3().y + mShapeSize; | |
| 160 | + } | |
| 215 | 161 | |
| 216 | - return ( worldPos + mLocalPos ); | |
| 162 | + // Bubbles X position moves parallax to horizontal | |
| 163 | + // panning by a scale factor unique to each bubble. | |
| 164 | + pos.x = mInitialX + ( scrollProperty.GetVector3().x * mScale ); | |
| 165 | + return pos; | |
| 217 | 166 | } |
| 218 | 167 | |
| 219 | 168 | private: |
| 220 | - Vector3 mLocalPos; | |
| 169 | + float mInitialX; | |
| 170 | + float mScale; | |
| 171 | + float mShapeSize; | |
| 221 | 172 | }; |
| 222 | 173 | |
| 223 | - | |
| 224 | 174 | bool CompareByTitle( const Example& lhs, const Example& rhs ) |
| 225 | 175 | { |
| 226 | 176 | return lhs.title < rhs.title; |
| ... | ... | @@ -308,8 +258,9 @@ void DaliTableView::Initialize( Application& application ) |
| 308 | 258 | |
| 309 | 259 | mScrollView.SetAnchorPoint( AnchorPoint::CENTER ); |
| 310 | 260 | mScrollView.SetParentOrigin( ParentOrigin::CENTER ); |
| 311 | - mScrollView.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), | |
| 312 | - Dali::RelativeToConstraint( SCROLLVIEW_RELATIVE_SIZE ) ) ); | |
| 261 | + // Note: Currently, changing mScrollView to use SizeMode RELATIVE_TO_PARENT | |
| 262 | + // will cause scroll ends to appear in the wrong position. | |
| 263 | + mScrollView.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::RelativeToConstraint( SCROLLVIEW_RELATIVE_SIZE ) ) ); | |
| 313 | 264 | mScrollView.SetAxisAutoLock( true ); |
| 314 | 265 | mScrollView.ScrollCompletedSignal().Connect( this, &DaliTableView::OnScrollComplete ); |
| 315 | 266 | mScrollView.ScrollStartedSignal().Connect( this, &DaliTableView::OnScrollStart ); |
| ... | ... | @@ -406,7 +357,7 @@ void DaliTableView::Populate() |
| 406 | 357 | |
| 407 | 358 | page.SetAnchorPoint( AnchorPoint::CENTER ); |
| 408 | 359 | page.SetParentOrigin( ParentOrigin::CENTER ); |
| 409 | - page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 360 | + page.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 410 | 361 | |
| 411 | 362 | // add cells to table |
| 412 | 363 | const float margin = 4.0f; |
| ... | ... | @@ -507,31 +458,24 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 507 | 458 | tile.SetAnchorPoint( AnchorPoint::CENTER ); |
| 508 | 459 | tile.SetParentOrigin( ParentOrigin::CENTER ); |
| 509 | 460 | |
| 510 | - Actor content = Actor::New(); | |
| 511 | - content.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 512 | - content.SetParentOrigin( ParentOrigin::CENTER ); | |
| 513 | - content.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 514 | - tile.Add(content); | |
| 515 | - | |
| 516 | 461 | // create background image |
| 517 | 462 | if( addBackground ) |
| 518 | 463 | { |
| 519 | - Image bg = Image::New( TILE_BACKGROUND ); | |
| 464 | + Image bg = ResourceImage::New( TILE_BACKGROUND ); | |
| 520 | 465 | ImageActor image = ImageActor::New( bg ); |
| 521 | 466 | image.SetAnchorPoint( AnchorPoint::CENTER ); |
| 522 | 467 | image.SetParentOrigin( ParentOrigin::CENTER ); |
| 523 | 468 | // make the image 100% of tile |
| 524 | - image.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 469 | + image.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 525 | 470 | // move image back to get text appear in front |
| 526 | 471 | image.SetZ( -1 ); |
| 527 | 472 | image.SetStyle( ImageActor::STYLE_NINE_PATCH ); |
| 528 | 473 | image.SetNinePatchBorder( Vector4( IMAGE_BORDER_LEFT, IMAGE_BORDER_TOP, IMAGE_BORDER_RIGHT, IMAGE_BORDER_BOTTOM ) ); |
| 529 | - | |
| 530 | - content.Add( image ); | |
| 474 | + tile.Add( image ); | |
| 531 | 475 | |
| 532 | 476 | // Add stencil |
| 533 | 477 | ImageActor stencil = NewStencilImage(); |
| 534 | - stencil.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 478 | + stencil.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 535 | 479 | image.Add( stencil ); |
| 536 | 480 | } |
| 537 | 481 | |
| ... | ... | @@ -548,7 +492,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 548 | 492 | text.SetSize( 0.9f * parentSize.width, 0.9f * parentSize.height ); |
| 549 | 493 | text.SetStyleToCurrentText( GetTableTextStyle() ); |
| 550 | 494 | text.SetSnapshotModeEnabled( false ); |
| 551 | - content.Add( text ); | |
| 495 | + tile.Add( text ); | |
| 552 | 496 | |
| 553 | 497 | // Set the tile to be keyboard focusable |
| 554 | 498 | tile.SetKeyboardFocusable(true); |
| ... | ... | @@ -562,7 +506,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 562 | 506 | |
| 563 | 507 | ImageActor DaliTableView::NewStencilImage() |
| 564 | 508 | { |
| 565 | - Image alpha = Image::New( TILE_BACKGROUND_ALPHA ); | |
| 509 | + Image alpha = ResourceImage::New( TILE_BACKGROUND_ALPHA ); | |
| 566 | 510 | |
| 567 | 511 | ImageActor stencilActor = ImageActor::New( alpha ); |
| 568 | 512 | stencilActor.SetStyle( ImageActor::STYLE_NINE_PATCH ); |
| ... | ... | @@ -738,61 +682,25 @@ void DaliTableView::OnKeyEvent( const KeyEvent& event ) |
| 738 | 682 | } |
| 739 | 683 | } |
| 740 | 684 | |
| 741 | -Actor CreateBackgroundActor( const Vector2& size ) | |
| 742 | -{ | |
| 743 | - Actor layer = Actor::New(); | |
| 744 | - layer.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 745 | - layer.SetParentOrigin( ParentOrigin::CENTER ); | |
| 746 | - layer.SetSize( size ); | |
| 747 | - return layer; | |
| 748 | -} | |
| 749 | - | |
| 750 | -void DaliTableView::SetupBackground( Actor bubbleLayer, Actor backgroundLayer, const Vector2& size ) | |
| 685 | +void DaliTableView::SetupBackground( Actor bubbleContainer, Actor backgroundLayer, const Vector2& size ) | |
| 751 | 686 | { |
| 752 | - // Create distance field shape | |
| 687 | + // Create distance field shape. | |
| 753 | 688 | BitmapImage distanceField; |
| 754 | 689 | Size imageSize( 512, 512 ); |
| 755 | 690 | CreateShapeImage( CIRCLE, imageSize, distanceField ); |
| 756 | 691 | |
| 757 | - // Create layers | |
| 758 | - Actor backgroundAnimLayer0 = CreateBackgroundActor( size ); | |
| 759 | - Actor backgroundAnimLayer1 = CreateBackgroundActor( size ); | |
| 760 | - Actor backgroundAnimLayer2 = CreateBackgroundActor( size ); | |
| 761 | - | |
| 762 | - // Add constraints | |
| 763 | - Constraint animConstraint0 = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 764 | - Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), | |
| 765 | - AnimScrollConstraint( backgroundAnimLayer0.GetCurrentPosition(), 0.75f ) ); | |
| 766 | - backgroundAnimLayer0.ApplyConstraint( animConstraint0 ); | |
| 767 | - | |
| 768 | - Constraint animConstraint1 = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 769 | - Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), | |
| 770 | - AnimScrollConstraint( backgroundAnimLayer1.GetCurrentPosition(), 0.5f ) ); | |
| 771 | - backgroundAnimLayer1.ApplyConstraint( animConstraint1 ); | |
| 772 | - | |
| 773 | - Constraint animConstraint2 = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 774 | - Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), | |
| 775 | - AnimScrollConstraint( backgroundAnimLayer2.GetCurrentPosition(), 0.25f ) ); | |
| 776 | - backgroundAnimLayer2.ApplyConstraint( animConstraint2 ); | |
| 692 | + // Create solid background colour. | |
| 693 | + ImageActor backgroundColourActor = Dali::Toolkit::CreateSolidColorActor( BACKGROUND_COLOR ); | |
| 694 | + backgroundColourActor.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 695 | + backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER ); | |
| 696 | + backgroundColourActor.SetSize( size * BACKGROUND_SIZE_SCALE ); | |
| 697 | + backgroundColourActor.SetZ( BACKGROUND_Z ); | |
| 698 | + backgroundColourActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION ); | |
| 699 | + backgroundLayer.Add( backgroundColourActor ); | |
| 777 | 700 | |
| 778 | - // Background | |
| 779 | - ImageActor layer = Dali::Toolkit::CreateSolidColorActor( BACKGROUND_COLOR ); | |
| 780 | - layer.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 781 | - layer.SetParentOrigin( ParentOrigin::CENTER ); | |
| 782 | - layer.SetSize( size * BACKGROUND_SIZE_SCALE ); | |
| 783 | - layer.SetZ( BACKGROUND_Z ); | |
| 784 | - layer.SetPositionInheritanceMode( DONT_INHERIT_POSITION ); | |
| 785 | - backgroundLayer.Add( layer ); | |
| 786 | - | |
| 787 | - // Parent the layers | |
| 788 | - bubbleLayer.Add( backgroundAnimLayer0 ); | |
| 789 | - bubbleLayer.Add( backgroundAnimLayer1 ); | |
| 790 | - bubbleLayer.Add( backgroundAnimLayer2 ); | |
| 791 | - | |
| 792 | - // Add all the children | |
| 793 | - AddBackgroundActors( backgroundAnimLayer0, NUM_BACKGROUND_IMAGES / 3, distanceField, size ); | |
| 794 | - AddBackgroundActors( backgroundAnimLayer1, NUM_BACKGROUND_IMAGES / 3, distanceField, size ); | |
| 795 | - AddBackgroundActors( backgroundAnimLayer2, NUM_BACKGROUND_IMAGES / 3, distanceField, size ); | |
| 701 | + // Add bubbles to the bubbleContainer. | |
| 702 | + // Note: The bubbleContainer is parented externally to this function. | |
| 703 | + AddBackgroundActors( bubbleContainer, NUM_BACKGROUND_IMAGES, distanceField, size ); | |
| 796 | 704 | } |
| 797 | 705 | |
| 798 | 706 | void DaliTableView::AddBackgroundActors( Actor layer, int count, BitmapImage distanceField, const Dali::Vector2& size ) |
| ... | ... | @@ -822,11 +730,12 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count, BitmapImage dis |
| 822 | 730 | Random::Range( BUBBLE_MIN_Z, BUBBLE_MAX_Z ) ); |
| 823 | 731 | dfActor.SetPosition( actorPos ); |
| 824 | 732 | |
| 825 | - Constraint movementConstraint = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 826 | - LocalSource( Actor::SIZE ), | |
| 827 | - ParentSource( Actor::SIZE ), | |
| 828 | - ShapeMovementConstraint ); | |
| 829 | - dfActor.ApplyConstraint( movementConstraint ); | |
| 733 | + // Define bubble horizontal parallax and vertical wrapping | |
| 734 | + Constraint animConstraint = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 735 | + Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), | |
| 736 | + Dali::ParentSource( Dali::Actor::SIZE ), | |
| 737 | + AnimateBubbleConstraint( actorPos, Random::Range( -0.85f, 0.25f ), randSize ) ); | |
| 738 | + dfActor.ApplyConstraint( animConstraint ); | |
| 830 | 739 | |
| 831 | 740 | // Kickoff animation |
| 832 | 741 | Animation animation = Animation::New( Random::Range( 40.0f, 200.0f ) ); |
| ... | ... | @@ -908,7 +817,7 @@ void DaliTableView::GenerateCircle( const Size& size, std::vector< unsigned char |
| 908 | 817 | |
| 909 | 818 | ImageActor DaliTableView::CreateLogo( std::string imagePath ) |
| 910 | 819 | { |
| 911 | - Image image = Image::New( imagePath ); | |
| 820 | + Image image = ResourceImage::New( imagePath ); | |
| 912 | 821 | ImageActor logo = ImageActor::New( image ); |
| 913 | 822 | |
| 914 | 823 | logo.SetAnchorPoint( AnchorPoint::CENTER ); | ... | ... |
demo/scripts/table-view.json
examples/blocks/blocks-example.cpp
| ... | ... | @@ -423,7 +423,7 @@ private: |
| 423 | 423 | mLevelContainer = Actor::New(); |
| 424 | 424 | mLevelContainer.SetAnchorPoint( AnchorPoint::CENTER ); |
| 425 | 425 | mLevelContainer.SetParentOrigin( ParentOrigin::CENTER ); |
| 426 | - mLevelContainer.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 426 | + mLevelContainer.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 427 | 427 | mContentLayer.Add( mLevelContainer ); |
| 428 | 428 | |
| 429 | 429 | mBrickCount = 0; |
| ... | ... | @@ -591,7 +591,7 @@ private: |
| 591 | 591 | ImageAttributes attr; |
| 592 | 592 | attr.SetSize( 128, 64 ); |
| 593 | 593 | attr.SetScalingMode( ImageAttributes::ScaleToFill ); |
| 594 | - Image img = Image::New(BRICK_IMAGE_PATH[type], attr); | |
| 594 | + Image img = ResourceImage::New(BRICK_IMAGE_PATH[type], attr); | |
| 595 | 595 | ImageActor brick = ImageActor::New(img); |
| 596 | 596 | brick.SetParentOrigin(ParentOrigin::TOP_LEFT); |
| 597 | 597 | brick.SetAnchorPoint(AnchorPoint::CENTER); |
| ... | ... | @@ -623,7 +623,7 @@ private: |
| 623 | 623 | */ |
| 624 | 624 | ImageActor CreateImage(const std::string& filename) |
| 625 | 625 | { |
| 626 | - Image img = Image::New(filename); | |
| 626 | + Image img = ResourceImage::New(filename); | |
| 627 | 627 | ImageActor actor = ImageActor::New(img); |
| 628 | 628 | actor.SetParentOrigin(ParentOrigin::TOP_LEFT); |
| 629 | 629 | actor.SetAnchorPoint(AnchorPoint::CENTER); | ... | ... |
examples/builder/dali-builder.cpp
examples/builder/examples.cpp
| ... | ... | @@ -33,6 +33,7 @@ |
| 33 | 33 | #include <boost/scoped_ptr.hpp> |
| 34 | 34 | #include <dirent.h> |
| 35 | 35 | #include <stdio.h> |
| 36 | +#include <iostream> | |
| 36 | 37 | |
| 37 | 38 | //#include <boost/regex.hpp> |
| 38 | 39 | #include "sys/stat.h" |
| ... | ... | @@ -532,7 +533,7 @@ public: |
| 532 | 533 | |
| 533 | 534 | // Create an edit mode button. (left of toolbar) |
| 534 | 535 | Toolkit::PushButton editButton = Toolkit::PushButton::New(); |
| 535 | - editButton.SetBackgroundImage( Image::New( EDIT_IMAGE ) ); | |
| 536 | + editButton.SetBackgroundImage( ResourceImage::New( EDIT_IMAGE ) ); | |
| 536 | 537 | editButton.ClickedSignal().Connect( this, &ExampleApp::OnToolSelectLayout); |
| 537 | 538 | editButton.SetLeaveRequired( true ); |
| 538 | 539 | mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); | ... | ... |
examples/buttons/buttons-example.cpp
| ... | ... | @@ -142,7 +142,7 @@ class ButtonsController: public ConnectionTracker |
| 142 | 142 | |
| 143 | 143 | // Radio 1 |
| 144 | 144 | { |
| 145 | - ImageActor imageActor = ImageActor::New( Image::New( SMALL_IMAGE_1 ) ); | |
| 145 | + ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_1 ) ); | |
| 146 | 146 | imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 147 | 147 | mRadioButtonImage1 = Dali::Toolkit::RadioButton::New( imageActor ); |
| 148 | 148 | mRadioButtonImage1.SetParentOrigin( ParentOrigin::TOP_LEFT ); |
| ... | ... | @@ -157,7 +157,7 @@ class ButtonsController: public ConnectionTracker |
| 157 | 157 | { |
| 158 | 158 | radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING; |
| 159 | 159 | |
| 160 | - ImageActor imageActor = ImageActor::New( Image::New( SMALL_IMAGE_2 ) ); | |
| 160 | + ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_2 ) ); | |
| 161 | 161 | imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 162 | 162 | |
| 163 | 163 | mRadioButtonImage2 = Dali::Toolkit::RadioButton::New( imageActor ); |
| ... | ... | @@ -172,7 +172,7 @@ class ButtonsController: public ConnectionTracker |
| 172 | 172 | { |
| 173 | 173 | radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING; |
| 174 | 174 | |
| 175 | - ImageActor imageActor = ImageActor::New( Image::New( SMALL_IMAGE_3 ) ); | |
| 175 | + ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_3 ) ); | |
| 176 | 176 | imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 177 | 177 | |
| 178 | 178 | mRadioButtonImage3 = Dali::Toolkit::RadioButton::New( imageActor ); |
| ... | ... | @@ -191,18 +191,18 @@ class ButtonsController: public ConnectionTracker |
| 191 | 191 | mUpdateButton.SetLabel("Select"); |
| 192 | 192 | mUpdateButton.SetSize( DP(100), DP(BUTTON_HEIGHT) ); |
| 193 | 193 | |
| 194 | - mUpdateButton.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 195 | - mUpdateButton.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 196 | - mUpdateButton.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 194 | + mUpdateButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 195 | + mUpdateButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 196 | + mUpdateButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 197 | 197 | |
| 198 | 198 | mUpdateButton.ClickedSignal().Connect( this, &ButtonsController::OnButtonClicked ); |
| 199 | 199 | |
| 200 | 200 | radioButtonsGroup2.Add(mUpdateButton); |
| 201 | 201 | |
| 202 | 202 | // ImageActor to display selected image |
| 203 | - mBigImage1 = Image::New( BIG_IMAGE_1 ); | |
| 204 | - mBigImage2 = Image::New( BIG_IMAGE_2 ); | |
| 205 | - mBigImage3 = Image::New( BIG_IMAGE_3 ); | |
| 203 | + mBigImage1 = ResourceImage::New( BIG_IMAGE_1 ); | |
| 204 | + mBigImage2 = ResourceImage::New( BIG_IMAGE_2 ); | |
| 205 | + mBigImage3 = ResourceImage::New( BIG_IMAGE_3 ); | |
| 206 | 206 | |
| 207 | 207 | mImage = ImageActor::New( mBigImage1 ); |
| 208 | 208 | mImage.SetParentOrigin( ParentOrigin::TOP_RIGHT ); |
| ... | ... | @@ -239,7 +239,7 @@ class ButtonsController: public ConnectionTracker |
| 239 | 239 | alignment.Add( textView ); |
| 240 | 240 | tableView.AddChild( alignment, Toolkit::TableView::CellPosition( 0, 0 ) ); |
| 241 | 241 | |
| 242 | - ImageActor imageActor = ImageActor::New( Image::New( ENABLED_IMAGE ) ); | |
| 242 | + ImageActor imageActor = ImageActor::New( ResourceImage::New( ENABLED_IMAGE ) ); | |
| 243 | 243 | imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 244 | 244 | tableView.AddChild( imageActor, Toolkit::TableView::CellPosition( 0, 1 ) ); |
| 245 | 245 | tableView.SetFixedWidth( 1, DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| ... | ... | @@ -279,8 +279,8 @@ class ButtonsController: public ConnectionTracker |
| 279 | 279 | checkBoxBackground.SetSize( DP(430), DP(GROUP3_HEIGHT) ); |
| 280 | 280 | mContentLayer.Add( checkBoxBackground ); |
| 281 | 281 | |
| 282 | - Dali::Image unselected = Dali::Image::New( CHECKBOX_UNSELECTED_IMAGE ); | |
| 283 | - Dali::Image selected = Dali::Image::New( CHECKBOX_SELECTED_IMAGE ); | |
| 282 | + Dali::Image unselected = Dali::ResourceImage::New( CHECKBOX_UNSELECTED_IMAGE ); | |
| 283 | + Dali::Image selected = Dali::ResourceImage::New( CHECKBOX_SELECTED_IMAGE ); | |
| 284 | 284 | |
| 285 | 285 | int checkYPos = MARGIN_SIZE; |
| 286 | 286 | |
| ... | ... | @@ -368,9 +368,9 @@ class ButtonsController: public ConnectionTracker |
| 368 | 368 | toggleButton.SetLabel( "Unselected" ); |
| 369 | 369 | toggleButton.SetSize( DP(150), DP(BUTTON_HEIGHT) ); |
| 370 | 370 | |
| 371 | - toggleButton.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 372 | - toggleButton.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 373 | - toggleButton.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 371 | + toggleButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 372 | + toggleButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 373 | + toggleButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 374 | 374 | |
| 375 | 375 | toggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonSelected ); |
| 376 | 376 | ... | ... |
examples/cluster/cluster-example.cpp
| ... | ... | @@ -199,33 +199,6 @@ struct CarouselEffectOrientationConstraint |
| 199 | 199 | }; |
| 200 | 200 | |
| 201 | 201 | /** |
| 202 | - * RescaleConstraint | |
| 203 | - * Rescales the inputer scale by the ratio of the height:width of it's parent. | |
| 204 | - */ | |
| 205 | -struct RescaleConstraint | |
| 206 | -{ | |
| 207 | - /** | |
| 208 | - * Constructor | |
| 209 | - * @param[in] value0 Constant multiplication operand (K). | |
| 210 | - */ | |
| 211 | - RescaleConstraint() | |
| 212 | - { | |
| 213 | - } | |
| 214 | - | |
| 215 | - /** | |
| 216 | - * @param[in] current The object's current property value | |
| 217 | - * @param[in] property0 The first property to multiplication operand | |
| 218 | - * @return The object's new property value | |
| 219 | - */ | |
| 220 | - Vector3 operator()(const Vector3& current, | |
| 221 | - const PropertyInput& property0) | |
| 222 | - { | |
| 223 | - return current * Vector3( property0.GetVector3().y / property0.GetVector3().x, 1.0f, 1.0f ); | |
| 224 | - } | |
| 225 | - | |
| 226 | -}; | |
| 227 | - | |
| 228 | -/** | |
| 229 | 202 | * ShearEffectConstraint |
| 230 | 203 | * |
| 231 | 204 | * Constrains ShearEffect's tilt to be a function of scrollview's |
| ... | ... | @@ -493,10 +466,10 @@ public: |
| 493 | 466 | "" ); |
| 494 | 467 | |
| 495 | 468 | // Create a effect toggle button. (right of toolbar) |
| 496 | - mLayoutButtonImages[ NO_EFFECT ] = Image::New( LAYOUT_NONE_IMAGE ); | |
| 497 | - mLayoutButtonImages[ WOBBLE_EFFECT ] = Image::New( LAYOUT_WOBBLE_IMAGE ); | |
| 498 | - mLayoutButtonImages[ CAROUSEL_EFFECT ] = Image::New( LAYOUT_CAROUSEL_IMAGE ); | |
| 499 | - mLayoutButtonImages[ SPHERE_EFFECT ] = Image::New( LAYOUT_SPHERE_IMAGE ); | |
| 469 | + mLayoutButtonImages[ NO_EFFECT ] = ResourceImage::New( LAYOUT_NONE_IMAGE ); | |
| 470 | + mLayoutButtonImages[ WOBBLE_EFFECT ] = ResourceImage::New( LAYOUT_WOBBLE_IMAGE ); | |
| 471 | + mLayoutButtonImages[ CAROUSEL_EFFECT ] = ResourceImage::New( LAYOUT_CAROUSEL_IMAGE ); | |
| 472 | + mLayoutButtonImages[ SPHERE_EFFECT ] = ResourceImage::New( LAYOUT_SPHERE_IMAGE ); | |
| 500 | 473 | |
| 501 | 474 | mLayoutButton = Toolkit::PushButton::New(); |
| 502 | 475 | mLayoutButton.ClickedSignal().Connect( this, &ClusterController::OnEffectTouched ); |
| ... | ... | @@ -514,18 +487,14 @@ public: |
| 514 | 487 | mScrollView.SetAnchorPoint(AnchorPoint::CENTER); |
| 515 | 488 | mScrollView.SetParentOrigin(ParentOrigin::CENTER); |
| 516 | 489 | |
| 517 | - // Scale ScrollView to fit within parent (mContentLayer) | |
| 518 | - Constraint constraint = Constraint::New<Vector3>( Actor::SCALE, | |
| 519 | - LocalSource( Actor::SIZE ), | |
| 520 | - ParentSource( Actor::SIZE ), | |
| 521 | - ScaleToFitConstraint() ); | |
| 522 | - mScrollView.ApplyConstraint(constraint); | |
| 490 | + // Scale ScrollView to fit parent (mContentLayer) | |
| 491 | + mScrollView.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 523 | 492 | |
| 524 | 493 | // Add the scroll view to the content layer |
| 525 | 494 | mContentLayer.Add(mScrollView); |
| 526 | 495 | |
| 527 | 496 | // Create the image border shared by all the cluster image actors |
| 528 | - mClusterBorderImage = Image::New(CLUSTER_BORDER_IMAGE_PATH); | |
| 497 | + mClusterBorderImage = ResourceImage::New(CLUSTER_BORDER_IMAGE_PATH); | |
| 529 | 498 | |
| 530 | 499 | AddCluster( PEOPLE, ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle1) ); |
| 531 | 500 | AddCluster( TODAY, ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle2) ); |
| ... | ... | @@ -556,7 +525,7 @@ public: |
| 556 | 525 | DALI_ASSERT_ALWAYS(paths); |
| 557 | 526 | |
| 558 | 527 | // Add a background image to the cluster |
| 559 | - Image bg = Image::New( CLUSTER_BACKGROUND_IMAGE_PATH ); | |
| 528 | + Image bg = ResourceImage::New( CLUSTER_BACKGROUND_IMAGE_PATH ); | |
| 560 | 529 | ImageActor image = ImageActor::New(bg); |
| 561 | 530 | clusterActor.SetBackgroundImage(image); |
| 562 | 531 | |
| ... | ... | @@ -587,10 +556,9 @@ public: |
| 587 | 556 | ImageAttributes attribs = ImageAttributes::New(); |
| 588 | 557 | attribs.SetSize(CLUSTER_IMAGE_THUMBNAIL_WIDTH, CLUSTER_IMAGE_THUMBNAIL_HEIGHT); |
| 589 | 558 | attribs.SetScalingMode(Dali::ImageAttributes::ShrinkToFit); |
| 590 | - attribs.SetPixelFormat( Pixel::RGB888 ); | |
| 591 | 559 | |
| 592 | 560 | // Add a shadow image child actor |
| 593 | - Image shadowImage = Image::New( CLUSTER_SHADOW_IMAGE_PATH, attribs ); | |
| 561 | + Image shadowImage = ResourceImage::New( CLUSTER_SHADOW_IMAGE_PATH, attribs ); | |
| 594 | 562 | ImageActor shadowActor = ImageActor::New(shadowImage); |
| 595 | 563 | |
| 596 | 564 | // Shadow is not exactly located on the center of the image, so it is moved to a little |
| ... | ... | @@ -605,7 +573,7 @@ public: |
| 605 | 573 | actor.Add( shadowActor ); |
| 606 | 574 | |
| 607 | 575 | // Add a picture image actor to actor (with equal size to the parent). |
| 608 | - Image image = Image::New( imagePath, attribs ); | |
| 576 | + Image image = ResourceImage::New( imagePath, attribs ); | |
| 609 | 577 | ImageActor imageActor = ImageActor::New( image ); |
| 610 | 578 | imageActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 611 | 579 | imageActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| ... | ... | @@ -649,14 +617,7 @@ public: |
| 649 | 617 | mScrollView.Add(pageView); |
| 650 | 618 | pageView.SetParentOrigin(ParentOrigin::CENTER); |
| 651 | 619 | pageView.SetPosition(Vector3(stageSize.width * column, 0.0f, 0.0f)); |
| 652 | - pageView.SetSize(stageSize); | |
| 653 | - | |
| 654 | - // Resize pageView (which contains a Cluster) | |
| 655 | - Constraint constraintScale = Constraint::New<Vector3>( Actor::SCALE, | |
| 656 | - ParentSource( Actor::SCALE ), | |
| 657 | - RescaleConstraint() ); | |
| 658 | - constraintScale.SetRemoveAction(Constraint::Discard); | |
| 659 | - pageView.ApplyConstraint(constraintScale); | |
| 620 | + pageView.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 660 | 621 | |
| 661 | 622 | // Create cluster actors, add them to scroll view, and set the shear effect with the given center point. |
| 662 | 623 | Cluster cluster = CreateClusterActor(clusterType, style); | ... | ... |
examples/hello-world/hello-world-example.cpp
examples/image/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
| ... | ... | @@ -45,6 +45,7 @@ |
| 45 | 45 | #include <algorithm> |
| 46 | 46 | #include <map> |
| 47 | 47 | #include <dali-toolkit/dali-toolkit.h> |
| 48 | +#include <iostream> | |
| 48 | 49 | |
| 49 | 50 | // INTERNAL INCLUDES |
| 50 | 51 | #include "grid-flags.h" |
| ... | ... | @@ -182,7 +183,7 @@ Image CreateImage(const std::string& filename, unsigned int width, unsigned int |
| 182 | 183 | |
| 183 | 184 | attributes.SetSize( width, height ); |
| 184 | 185 | attributes.SetScalingMode( scalingMode ); |
| 185 | - Image image = Image::New( filename, attributes ); | |
| 186 | + Image image = ResourceImage::New( filename, attributes ); | |
| 186 | 187 | return image; |
| 187 | 188 | } |
| 188 | 189 | |
| ... | ... | @@ -307,7 +308,7 @@ public: |
| 307 | 308 | "" ); |
| 308 | 309 | |
| 309 | 310 | // Create an image scaling toggle button. (right of toolbar) |
| 310 | - Image toggleScalingImage = Image::New( TOGGLE_SCALING_IMAGE ); | |
| 311 | + Image toggleScalingImage = ResourceImage::New( TOGGLE_SCALING_IMAGE ); | |
| 311 | 312 | Toolkit::PushButton toggleScalingButton = Toolkit::PushButton::New(); |
| 312 | 313 | toggleScalingButton.SetBackgroundImage( toggleScalingImage ); |
| 313 | 314 | toggleScalingButton.ClickedSignal().Connect( this, &ImageScalingIrregularGridController::OnToggleScalingTouched ); |
| ... | ... | @@ -416,7 +417,7 @@ public: |
| 416 | 417 | // coordinates in a frame defined by a parent actor: |
| 417 | 418 | |
| 418 | 419 | Actor gridActor = Actor::New(); |
| 419 | - gridActor.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 420 | + gridActor.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 420 | 421 | gridActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 421 | 422 | gridActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| 422 | 423 | |
| ... | ... | @@ -472,7 +473,7 @@ public: |
| 472 | 473 | |
| 473 | 474 | ImageActor imageActor = ImageActor::DownCast( actor ); |
| 474 | 475 | Image oldImage = imageActor.GetImage(); |
| 475 | - Image newImage = CreateImage( oldImage.GetFilename(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode ); | |
| 476 | + Image newImage = CreateImage( ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode ); | |
| 476 | 477 | imageActor.SetImage( newImage ); |
| 477 | 478 | mScalingModes[id] = newMode; |
| 478 | 479 | } |
| ... | ... | @@ -514,7 +515,7 @@ public: |
| 514 | 515 | const Vector2 imageSize = mSizes[gridImageActor.GetId()]; |
| 515 | 516 | ImageAttributes::ScalingMode newMode = NextMode( mScalingModes[gridImageActor.GetId()] ); |
| 516 | 517 | Image oldImage = gridImageActor.GetImage(); |
| 517 | - Image newImage = CreateImage( oldImage.GetFilename(), imageSize.width, imageSize.height, newMode ); | |
| 518 | + Image newImage = CreateImage(ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width, imageSize.height, newMode ); | |
| 518 | 519 | gridImageActor.SetImage( newImage ); |
| 519 | 520 | |
| 520 | 521 | mScalingModes[gridImageActor.GetId()] = newMode; | ... | ... |
examples/item-view/item-view-example.cpp
| ... | ... | @@ -164,15 +164,6 @@ const Vector4 DEFAULT_TEXT_STYLE_COLOR(1.0f, 1.0f, 1.0f, 1.0f); |
| 164 | 164 | |
| 165 | 165 | const Vector3 INITIAL_OFFSCREEN_POSITION( 1000.0f, 0, -1000.0f ); |
| 166 | 166 | |
| 167 | -struct BorderSizeConstraintFunction | |
| 168 | -{ | |
| 169 | - Vector3 operator()(const Vector3& current, | |
| 170 | - const PropertyInput& parentSize) | |
| 171 | - { | |
| 172 | - return parentSize.GetVector3() + ITEM_BORDER_MARGIN_SIZE; | |
| 173 | - } | |
| 174 | -}; | |
| 175 | - | |
| 176 | 167 | static Vector3 DepthLayoutItemSizeFunctionPortrait(unsigned int numberOfColumns, float layoutWidth) |
| 177 | 168 | { |
| 178 | 169 | float width = (layoutWidth / static_cast<float>(numberOfColumns + 1)) * DEPTH_LAYOUT_ITEM_SIZE_FACTOR_PORTRAIT; |
| ... | ... | @@ -251,7 +242,7 @@ public: |
| 251 | 242 | Vector2 stageSize = Stage::GetCurrent().GetSize(); |
| 252 | 243 | |
| 253 | 244 | // Create a border image shared by all the item actors |
| 254 | - mBorderImage = Image::New(ITEM_BORDER_IMAGE_PATH); | |
| 245 | + mBorderImage = ResourceImage::New(ITEM_BORDER_IMAGE_PATH); | |
| 255 | 246 | |
| 256 | 247 | // Creates a default view with a default tool bar. |
| 257 | 248 | // The view is added to the stage. |
| ... | ... | @@ -266,14 +257,14 @@ public: |
| 266 | 257 | |
| 267 | 258 | // Create an edit mode button. (left of toolbar) |
| 268 | 259 | Toolkit::PushButton editButton = Toolkit::PushButton::New(); |
| 269 | - editButton.SetBackgroundImage( Image::New( EDIT_IMAGE ) ); | |
| 260 | + editButton.SetBackgroundImage( ResourceImage::New( EDIT_IMAGE ) ); | |
| 270 | 261 | editButton.ClickedSignal().Connect( this, &ItemViewExample::OnModeButtonClicked); |
| 271 | 262 | editButton.SetLeaveRequired( true ); |
| 272 | 263 | mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 273 | 264 | |
| 274 | 265 | // Create a layout toggle button. (right of toolbar) |
| 275 | 266 | mLayoutButton = Toolkit::PushButton::New(); |
| 276 | - mLayoutButton.SetBackgroundImage( Image::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 267 | + mLayoutButton.SetBackgroundImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 277 | 268 | mLayoutButton.ClickedSignal().Connect( this, &ItemViewExample::OnLayoutButtonClicked); |
| 278 | 269 | mLayoutButton.SetLeaveRequired( true ); |
| 279 | 270 | mToolBar.AddControl( mLayoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| ... | ... | @@ -284,8 +275,8 @@ public: |
| 284 | 275 | mDeleteButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); |
| 285 | 276 | mDeleteButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 286 | 277 | mDeleteButton.SetDrawMode( DrawMode::OVERLAY ); |
| 287 | - mDeleteButton.SetBackgroundImage( Image::New( TOOLBAR_IMAGE ) ); | |
| 288 | - mDeleteButton.SetButtonImage( Image::New( DELETE_IMAGE ) ); | |
| 278 | + mDeleteButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); | |
| 279 | + mDeleteButton.SetButtonImage( ResourceImage::New( DELETE_IMAGE ) ); | |
| 289 | 280 | mDeleteButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); |
| 290 | 281 | mDeleteButton.ClickedSignal().Connect( this, &ItemViewExample::OnDeleteButtonClicked); |
| 291 | 282 | mDeleteButton.SetLeaveRequired( true ); |
| ... | ... | @@ -298,8 +289,8 @@ public: |
| 298 | 289 | mInsertButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); |
| 299 | 290 | mInsertButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 300 | 291 | mInsertButton.SetDrawMode( DrawMode::OVERLAY ); |
| 301 | - mInsertButton.SetBackgroundImage( Image::New( TOOLBAR_IMAGE ) ); | |
| 302 | - mInsertButton.SetButtonImage( Image::New( INSERT_IMAGE ) ); | |
| 292 | + mInsertButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); | |
| 293 | + mInsertButton.SetButtonImage( ResourceImage::New( INSERT_IMAGE ) ); | |
| 303 | 294 | mInsertButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); |
| 304 | 295 | mInsertButton.ClickedSignal().Connect( this, &ItemViewExample::OnInsertButtonClicked); |
| 305 | 296 | mInsertButton.SetLeaveRequired( true ); |
| ... | ... | @@ -312,8 +303,8 @@ public: |
| 312 | 303 | mReplaceButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); |
| 313 | 304 | mReplaceButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 314 | 305 | mReplaceButton.SetDrawMode( DrawMode::OVERLAY ); |
| 315 | - mReplaceButton.SetBackgroundImage( Image::New( TOOLBAR_IMAGE ) ); | |
| 316 | - mReplaceButton.SetButtonImage( Image::New( REPLACE_IMAGE ) ); | |
| 306 | + mReplaceButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); | |
| 307 | + mReplaceButton.SetButtonImage( ResourceImage::New( REPLACE_IMAGE ) ); | |
| 317 | 308 | mReplaceButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); |
| 318 | 309 | mReplaceButton.ClickedSignal().Connect( this, &ItemViewExample::OnReplaceButtonClicked); |
| 319 | 310 | mReplaceButton.SetLeaveRequired( true ); |
| ... | ... | @@ -844,19 +835,19 @@ public: |
| 844 | 835 | { |
| 845 | 836 | case SPIRAL_LAYOUT: |
| 846 | 837 | { |
| 847 | - mLayoutButton.SetBackgroundImage( Image::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 838 | + mLayoutButton.SetBackgroundImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 848 | 839 | break; |
| 849 | 840 | } |
| 850 | 841 | |
| 851 | 842 | case GRID_LAYOUT: |
| 852 | 843 | { |
| 853 | - mLayoutButton.SetBackgroundImage( Image::New( GRID_LAYOUT_IMAGE ) ); | |
| 844 | + mLayoutButton.SetBackgroundImage( ResourceImage::New( GRID_LAYOUT_IMAGE ) ); | |
| 854 | 845 | break; |
| 855 | 846 | } |
| 856 | 847 | |
| 857 | 848 | case DEPTH_LAYOUT: |
| 858 | 849 | { |
| 859 | - mLayoutButton.SetBackgroundImage( Image::New( DEPTH_LAYOUT_IMAGE ) ); | |
| 850 | + mLayoutButton.SetBackgroundImage( ResourceImage::New( DEPTH_LAYOUT_IMAGE ) ); | |
| 860 | 851 | break; |
| 861 | 852 | } |
| 862 | 853 | |
| ... | ... | @@ -885,7 +876,7 @@ public: // From ItemFactory |
| 885 | 876 | virtual Actor NewItem(unsigned int itemId) |
| 886 | 877 | { |
| 887 | 878 | // Create an image actor for this item |
| 888 | - Image image = Image::New( IMAGE_PATHS[itemId % NUM_IMAGES] ); | |
| 879 | + Image image = ResourceImage::New( IMAGE_PATHS[itemId % NUM_IMAGES] ); | |
| 889 | 880 | Actor actor = ImageActor::New(image); |
| 890 | 881 | actor.SetPosition( INITIAL_OFFSCREEN_POSITION ); |
| 891 | 882 | |
| ... | ... | @@ -897,9 +888,8 @@ public: // From ItemFactory |
| 897 | 888 | borderActor.SetStyle( ImageActor::STYLE_NINE_PATCH ); |
| 898 | 889 | borderActor.SetNinePatchBorder( Vector4( ITEM_IMAGE_BORDER_LEFT, ITEM_IMAGE_BORDER_TOP, ITEM_IMAGE_BORDER_RIGHT, ITEM_IMAGE_BORDER_BOTTOM ) ); |
| 899 | 890 | borderActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); // darken with parent image-actor |
| 900 | - | |
| 901 | - Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), BorderSizeConstraintFunction() ); | |
| 902 | - borderActor.ApplyConstraint(constraint); | |
| 891 | + borderActor.SetSizeMode( SIZE_FIXED_OFFSET_FROM_PARENT ); | |
| 892 | + borderActor.SetSizeModeFactor( ITEM_BORDER_MARGIN_SIZE ); | |
| 903 | 893 | actor.Add(borderActor); |
| 904 | 894 | actor.SetKeyboardFocusable( true ); |
| 905 | 895 | |
| ... | ... | @@ -924,7 +914,7 @@ public: // From ItemFactory |
| 924 | 914 | } |
| 925 | 915 | actor.Add( checkbox ); |
| 926 | 916 | |
| 927 | - ImageActor tick = ImageActor::New( Image::New(SELECTED_IMAGE) ); | |
| 917 | + ImageActor tick = ImageActor::New( ResourceImage::New(SELECTED_IMAGE) ); | |
| 928 | 918 | tick.SetColorMode( USE_OWN_COLOR ); |
| 929 | 919 | tick.SetName( "Tick" ); |
| 930 | 920 | tick.SetParentOrigin( ParentOrigin::TOP_RIGHT ); | ... | ... |
examples/logging/logging-example.cpp
| ... | ... | @@ -286,9 +286,9 @@ class LoggingController: public ConnectionTracker |
| 286 | 286 | button.SetPosition( buttonXDP, 0 ); |
| 287 | 287 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 288 | 288 | |
| 289 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 290 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 291 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 289 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 290 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 291 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 292 | 292 | |
| 293 | 293 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 294 | 294 | |
| ... | ... | @@ -306,9 +306,9 @@ class LoggingController: public ConnectionTracker |
| 306 | 306 | button.SetPosition( buttonXDP, 0 ); |
| 307 | 307 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 308 | 308 | |
| 309 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 310 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 311 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 309 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 310 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 311 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 312 | 312 | |
| 313 | 313 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 314 | 314 | |
| ... | ... | @@ -337,9 +337,9 @@ class LoggingController: public ConnectionTracker |
| 337 | 337 | button.SetPosition( buttonXDP, 0 ); |
| 338 | 338 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 339 | 339 | |
| 340 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 341 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 342 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 340 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 341 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 342 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 343 | 343 | |
| 344 | 344 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 345 | 345 | |
| ... | ... | @@ -357,9 +357,9 @@ class LoggingController: public ConnectionTracker |
| 357 | 357 | button.SetPosition( buttonXDP, 0 ); |
| 358 | 358 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 359 | 359 | |
| 360 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 361 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 362 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 360 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 361 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 362 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 363 | 363 | |
| 364 | 364 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 365 | 365 | |
| ... | ... | @@ -388,9 +388,9 @@ class LoggingController: public ConnectionTracker |
| 388 | 388 | button.SetPosition( buttonXDP, 0 ); |
| 389 | 389 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 390 | 390 | |
| 391 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 392 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 393 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 391 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 392 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 393 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 394 | 394 | |
| 395 | 395 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 396 | 396 | |
| ... | ... | @@ -408,9 +408,9 @@ class LoggingController: public ConnectionTracker |
| 408 | 408 | button.SetPosition( buttonXDP, 0 ); |
| 409 | 409 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 410 | 410 | |
| 411 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 412 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 413 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 411 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 412 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 413 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 414 | 414 | |
| 415 | 415 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 416 | 416 | |
| ... | ... | @@ -520,9 +520,9 @@ class LoggingController: public ConnectionTracker |
| 520 | 520 | button.SetPosition( buttonXDP, 0 ); |
| 521 | 521 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 522 | 522 | |
| 523 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 524 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 525 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 523 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 524 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 525 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 526 | 526 | |
| 527 | 527 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 528 | 528 | ... | ... |
examples/motion/motion-blur-example.cpp
| ... | ... | @@ -149,8 +149,8 @@ public: |
| 149 | 149 | APPLICATION_TITLE ); |
| 150 | 150 | |
| 151 | 151 | //Add an effects icon on the right of the title |
| 152 | - mIconEffectsOff = Image::New( EFFECTS_OFF_ICON ); | |
| 153 | - mIconEffectsOn = Image::New( EFFECTS_ON_ICON ); | |
| 152 | + mIconEffectsOff = ResourceImage::New( EFFECTS_OFF_ICON ); | |
| 153 | + mIconEffectsOn = ResourceImage::New( EFFECTS_ON_ICON ); | |
| 154 | 154 | mActorEffectsButton = Toolkit::PushButton::New(); |
| 155 | 155 | mActorEffectsButton.SetBackgroundImage( mIconEffectsOff ); |
| 156 | 156 | mActorEffectsButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnEffectButtonClicked ); |
| ... | ... | @@ -158,7 +158,7 @@ public: |
| 158 | 158 | |
| 159 | 159 | // Creates a mode button. |
| 160 | 160 | // Create a effect toggle button. (right of toolbar) |
| 161 | - Image imageLayout = Image::New( LAYOUT_IMAGE ); | |
| 161 | + Image imageLayout = ResourceImage::New( LAYOUT_IMAGE ); | |
| 162 | 162 | Toolkit::PushButton layoutButton = Toolkit::PushButton::New(); |
| 163 | 163 | layoutButton.SetBackgroundImage(imageLayout); |
| 164 | 164 | layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked); |
| ... | ... | @@ -187,7 +187,7 @@ public: |
| 187 | 187 | // Motion blurred actor |
| 188 | 188 | // |
| 189 | 189 | |
| 190 | - Image image = Image::New( MOTION_BLUR_ACTOR_IMAGE1 ); | |
| 190 | + Image image = ResourceImage::New( MOTION_BLUR_ACTOR_IMAGE1 ); | |
| 191 | 191 | mMotionBlurImageActor = ImageActor::New(image); |
| 192 | 192 | mMotionBlurImageActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 193 | 193 | mMotionBlurImageActor.SetSize(MOTION_BLUR_ACTOR_WIDTH, MOTION_BLUR_ACTOR_HEIGHT); |
| ... | ... | @@ -478,7 +478,7 @@ public: |
| 478 | 478 | mCurrentImage = 0; |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | - Image blurImage = Image::New( MOTION_BLUR_ACTOR_IMAGES[mCurrentImage] ); | |
| 481 | + Image blurImage = ResourceImage::New( MOTION_BLUR_ACTOR_IMAGES[mCurrentImage] ); | |
| 482 | 482 | mMotionBlurImageActor.SetImage(blurImage); |
| 483 | 483 | } |
| 484 | 484 | ... | ... |
examples/motion/motion-stretch-example.cpp
| ... | ... | @@ -136,8 +136,8 @@ public: |
| 136 | 136 | APPLICATION_TITLE ); |
| 137 | 137 | |
| 138 | 138 | //Add an slideshow icon on the right of the title |
| 139 | - mIconEffectsOff = Image::New( EFFECTS_OFF_ICON ); | |
| 140 | - mIconEffectsOn = Image::New( EFFECTS_ON_ICON ); | |
| 139 | + mIconEffectsOff = ResourceImage::New( EFFECTS_OFF_ICON ); | |
| 140 | + mIconEffectsOn = ResourceImage::New( EFFECTS_ON_ICON ); | |
| 141 | 141 | mActorEffectsButton = Toolkit::PushButton::New(); |
| 142 | 142 | mActorEffectsButton.SetBackgroundImage( mIconEffectsOff ); |
| 143 | 143 | mActorEffectsButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnEffectButtonClicked ); |
| ... | ... | @@ -145,7 +145,7 @@ public: |
| 145 | 145 | |
| 146 | 146 | // Creates a mode button. |
| 147 | 147 | // Create a effect toggle button. (right of toolbar) |
| 148 | - Image imageLayout = Image::New( LAYOUT_IMAGE ); | |
| 148 | + Image imageLayout = ResourceImage::New( LAYOUT_IMAGE ); | |
| 149 | 149 | Toolkit::PushButton layoutButton = Toolkit::PushButton::New(); |
| 150 | 150 | layoutButton.SetBackgroundImage(imageLayout); |
| 151 | 151 | layoutButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnLayoutButtonClicked); |
| ... | ... | @@ -174,7 +174,7 @@ public: |
| 174 | 174 | // Motion stretched actor |
| 175 | 175 | // |
| 176 | 176 | |
| 177 | - Image image = Image::New( MOTION_STRETCH_ACTOR_IMAGE1 ); | |
| 177 | + Image image = ResourceImage::New( MOTION_STRETCH_ACTOR_IMAGE1 ); | |
| 178 | 178 | mMotionStretchImageActor = ImageActor::New(image); |
| 179 | 179 | mMotionStretchImageActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 180 | 180 | mMotionStretchImageActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| ... | ... | @@ -390,7 +390,7 @@ public: |
| 390 | 390 | mCurrentImage = 0; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - Image stretchImage = Image::New( MOTION_STRETCH_ACTOR_IMAGES[mCurrentImage] ); | |
| 393 | + Image stretchImage = ResourceImage::New( MOTION_STRETCH_ACTOR_IMAGES[mCurrentImage] ); | |
| 394 | 394 | mMotionStretchImageActor.SetImage(stretchImage); |
| 395 | 395 | } |
| 396 | 396 | ... | ... |
examples/new-window/new-window-example.cpp
| ... | ... | @@ -16,6 +16,8 @@ |
| 16 | 16 | |
| 17 | 17 | #include <dali-toolkit/dali-toolkit.h> |
| 18 | 18 | #include "../shared/view.h" |
| 19 | +#include <cstdio> | |
| 20 | +#include <iostream> | |
| 19 | 21 | |
| 20 | 22 | using namespace Dali; |
| 21 | 23 | using namespace Dali::Toolkit; |
| ... | ... | @@ -147,7 +149,7 @@ void NewWindowController::Create( Application& app ) |
| 147 | 149 | } |
| 148 | 150 | |
| 149 | 151 | mLoseContextButton = Toolkit::PushButton::New(); |
| 150 | - mLoseContextButton.SetBackgroundImage( Image::New( LOSE_CONTEXT_IMAGE ) ); | |
| 152 | + mLoseContextButton.SetBackgroundImage( ResourceImage::New( LOSE_CONTEXT_IMAGE ) ); | |
| 151 | 153 | mLoseContextButton.ClickedSignal().Connect( this, &NewWindowController::OnLoseContextButtonClicked ); |
| 152 | 154 | mToolBar.AddControl( mLoseContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 153 | 155 | |
| ... | ... | @@ -158,7 +160,7 @@ void NewWindowController::Create( Application& app ) |
| 158 | 160 | logoLayoutActor.SetScale(0.5f); |
| 159 | 161 | mContentLayer.Add(logoLayoutActor); |
| 160 | 162 | |
| 161 | - Image image = Image::New(DALI_IMAGE_DIR "dali-logo.png"); | |
| 163 | + Image image = ResourceImage::New(DALI_IMAGE_DIR "dali-logo.png"); | |
| 162 | 164 | mImageActor = ImageActor::New(image); |
| 163 | 165 | mImageActor.SetName("dali-logo"); |
| 164 | 166 | mImageActor.SetParentOrigin(ParentOrigin::CENTER); |
| ... | ... | @@ -194,7 +196,7 @@ bool NewWindowController::OnLoseContextButtonClicked( Toolkit::Button button ) |
| 194 | 196 | |
| 195 | 197 | void NewWindowController::CreateMeshActor() |
| 196 | 198 | { |
| 197 | - mEffectImage = Image::New(EFFECT_IMAGE); | |
| 199 | + mEffectImage = ResourceImage::New(EFFECT_IMAGE); | |
| 198 | 200 | |
| 199 | 201 | Material baseMaterial = Material::New( "Material1" ); |
| 200 | 202 | Dali::MeshActor meshActor = MeshActor::New( CreateMesh(true, baseMaterial) ); |
| ... | ... | @@ -220,7 +222,7 @@ void NewWindowController::CreateMeshActor() |
| 220 | 222 | FrameBufferImage NewWindowController::CreateMirrorImage(const char* imageName) |
| 221 | 223 | { |
| 222 | 224 | FrameBufferImage fbo; |
| 223 | - Image image = Image::New(imageName); | |
| 225 | + Image image = ResourceImage::New(imageName); | |
| 224 | 226 | fbo = CreateFrameBufferForImage(imageName, image, ShaderEffect()); |
| 225 | 227 | return fbo; |
| 226 | 228 | } |
| ... | ... | @@ -228,8 +230,8 @@ FrameBufferImage NewWindowController::CreateMirrorImage(const char* imageName) |
| 228 | 230 | ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName) |
| 229 | 231 | { |
| 230 | 232 | FrameBufferImage fbo; |
| 231 | - Image image = Image::New( imageName ); | |
| 232 | - Vector2 FBOSize = Image::GetImageSize(imageName); | |
| 233 | + Image image = ResourceImage::New( imageName ); | |
| 234 | + Vector2 FBOSize = ResourceImage::GetImageSize(imageName); | |
| 233 | 235 | fbo = FrameBufferImage::New( FBOSize.width, FBOSize.height, Pixel::RGBA8888); |
| 234 | 236 | GaussianBlurView gbv = GaussianBlurView::New(5, 2.0f, Pixel::RGBA8888, 0.5f, 0.5f, true); |
| 235 | 237 | gbv.SetBackgroundColor(Color::TRANSPARENT); |
| ... | ... | @@ -247,7 +249,7 @@ ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName) |
| 247 | 249 | FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imageName, Image image, ShaderEffect shaderEffect) |
| 248 | 250 | { |
| 249 | 251 | Stage stage = Stage::GetCurrent(); |
| 250 | - Vector2 FBOSize = Image::GetImageSize(imageName); | |
| 252 | + Vector2 FBOSize = ResourceImage::GetImageSize(imageName); | |
| 251 | 253 | |
| 252 | 254 | FrameBufferImage framebuffer = FrameBufferImage::New(FBOSize.x, FBOSize.y ); |
| 253 | 255 | |
| ... | ... | @@ -288,10 +290,10 @@ FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imag |
| 288 | 290 | void NewWindowController::CreateBubbles(Vector2 stageSize) |
| 289 | 291 | { |
| 290 | 292 | mEmitter = Toolkit::BubbleEmitter::New( stageSize, |
| 291 | - Image::New( DALI_IMAGE_DIR "bubble-ball.png" ), | |
| 293 | + ResourceImage::New( DALI_IMAGE_DIR "bubble-ball.png" ), | |
| 292 | 294 | 1000, Vector2( 5.0f, 5.0f ) ); |
| 293 | 295 | |
| 294 | - Image background = Image::New(BACKGROUND_IMAGE); | |
| 296 | + Image background = ResourceImage::New(BACKGROUND_IMAGE); | |
| 295 | 297 | mEmitter.SetBackground( background, mHSVDelta ); |
| 296 | 298 | Actor bubbleRoot = mEmitter.GetRootActor(); |
| 297 | 299 | mContentLayer.Add( bubbleRoot ); |
| ... | ... | @@ -376,7 +378,7 @@ void NewWindowController::CreateBlending() |
| 376 | 378 | blendShader.SetEffectImage( fb2 ); |
| 377 | 379 | blendShader.SetUniform("alpha", 0.5f); |
| 378 | 380 | |
| 379 | - mBaseImage = Image::New(BASE_IMAGE); | |
| 381 | + mBaseImage = ResourceImage::New(BASE_IMAGE); | |
| 380 | 382 | mBlendActor = ImageActor::New( mBaseImage ); |
| 381 | 383 | mBlendActor.SetParentOrigin(ParentOrigin::CENTER); |
| 382 | 384 | mBlendActor.SetPosition(Vector3(150.0f, 200.0f, 0.0f)); | ... | ... |
examples/page-turn-view/page-turn-view-example.cpp
| ... | ... | @@ -15,11 +15,12 @@ |
| 15 | 15 | * |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | +#include <dali/dali.h> | |
| 19 | +#include <dali-toolkit/dali-toolkit.h> | |
| 18 | 20 | #include <assert.h> |
| 19 | 21 | #include <cstdlib> |
| 20 | 22 | #include <string.h> |
| 21 | -#include <dali/dali.h> | |
| 22 | -#include <dali-toolkit/dali-toolkit.h> | |
| 23 | +#include <iostream> | |
| 23 | 24 | |
| 24 | 25 | using namespace Dali; |
| 25 | 26 | using namespace Dali::Toolkit; |
| ... | ... | @@ -79,11 +80,11 @@ class PortraitPageFactory : public PageFactory |
| 79 | 80 | { |
| 80 | 81 | if( pageId == 0 ) |
| 81 | 82 | { |
| 82 | - return ImageActor::New( Image::New( BOOK_COVER_PORTRAIT ) ); | |
| 83 | + return ImageActor::New( ResourceImage::New( BOOK_COVER_PORTRAIT ) ); | |
| 83 | 84 | } |
| 84 | 85 | else |
| 85 | 86 | { |
| 86 | - return ImageActor::New( Image::New( PAGE_IMAGES_PORTRAIT[ (pageId-1) % NUMBER_OF_PORTRAIT_IMAGE ] ) ); | |
| 87 | + return ImageActor::New( ResourceImage::New( PAGE_IMAGES_PORTRAIT[ (pageId-1) % NUMBER_OF_PORTRAIT_IMAGE ] ) ); | |
| 87 | 88 | } |
| 88 | 89 | } |
| 89 | 90 | }; |
| ... | ... | @@ -109,14 +110,14 @@ class LandscapePageFactory : public PageFactory |
| 109 | 110 | ImageActor pageBack; |
| 110 | 111 | if( pageId == 0 ) |
| 111 | 112 | { |
| 112 | - pageFront = ImageActor::New( Image::New( BOOK_COVER_LANDSCAPE ) ); | |
| 113 | - pageBack = ImageActor::New( Image::New( BOOK_COVER_BACK_LANDSCAPE ) ); | |
| 113 | + pageFront = ImageActor::New( ResourceImage::New( BOOK_COVER_LANDSCAPE ) ); | |
| 114 | + pageBack = ImageActor::New( ResourceImage::New( BOOK_COVER_BACK_LANDSCAPE ) ); | |
| 114 | 115 | } |
| 115 | 116 | else |
| 116 | 117 | { |
| 117 | 118 | unsigned int imageId = (pageId-1)*2; |
| 118 | - pageFront = ImageActor::New( Image::New( PAGE_IMAGES_LANDSCAPE[ imageId % NUMBER_OF_LANDSCAPE_IMAGE ] ) ); | |
| 119 | - pageBack = ImageActor::New( Image::New( PAGE_IMAGES_LANDSCAPE[ (imageId+1) % NUMBER_OF_LANDSCAPE_IMAGE ] ) ); | |
| 119 | + pageFront = ImageActor::New( ResourceImage::New( PAGE_IMAGES_LANDSCAPE[ imageId % NUMBER_OF_LANDSCAPE_IMAGE ] ) ); | |
| 120 | + pageBack = ImageActor::New( ResourceImage::New( PAGE_IMAGES_LANDSCAPE[ (imageId+1) % NUMBER_OF_LANDSCAPE_IMAGE ] ) ); | |
| 120 | 121 | } |
| 121 | 122 | pageFront.Add(pageBack); |
| 122 | 123 | return pageFront; | ... | ... |
examples/radial-menu/radial-menu-example.cpp
| ... | ... | @@ -135,8 +135,8 @@ void RadialMenuExample::OnInit(Application& app) |
| 135 | 135 | TOOLBAR_IMAGE, |
| 136 | 136 | APPLICATION_TITLE ); |
| 137 | 137 | |
| 138 | - mIconPlay = Image::New( PLAY_ICON ); | |
| 139 | - mIconStop = Image::New( STOP_ICON ); | |
| 138 | + mIconPlay = ResourceImage::New( PLAY_ICON ); | |
| 139 | + mIconStop = ResourceImage::New( STOP_ICON ); | |
| 140 | 140 | mPlayStopButton = Toolkit::PushButton::New(); |
| 141 | 141 | mPlayStopButton.SetBackgroundImage( mIconStop ); |
| 142 | 142 | |
| ... | ... | @@ -147,7 +147,7 @@ void RadialMenuExample::OnInit(Application& app) |
| 147 | 147 | Toolkit::Alignment::HorizontalRight, |
| 148 | 148 | DemoHelper::DEFAULT_PLAY_PADDING ); |
| 149 | 149 | |
| 150 | - Vector2 imgSize = Image::GetImageSize(TEST_OUTER_RING_FILENAME); | |
| 150 | + Vector2 imgSize = ResourceImage::GetImageSize(TEST_OUTER_RING_FILENAME); | |
| 151 | 151 | Vector2 stageSize = stage.GetSize(); |
| 152 | 152 | float minStageDimension = std::min(stageSize.width, stageSize.height); |
| 153 | 153 | |
| ... | ... | @@ -163,7 +163,7 @@ void RadialMenuExample::OnInit(Application& app) |
| 163 | 163 | mRadialSweepView3.SetInitialActorAngle(Degree(-110)); |
| 164 | 164 | mRadialSweepView3.SetFinalActorAngle(Degree(0)); |
| 165 | 165 | |
| 166 | - Image dial = Image::New( TEST_DIAL_FILENAME ); | |
| 166 | + Image dial = ResourceImage::New( TEST_DIAL_FILENAME ); | |
| 167 | 167 | mDialActor = ImageActor::New( dial ); |
| 168 | 168 | mDialActor.SetPositionInheritanceMode(USE_PARENT_POSITION); |
| 169 | 169 | mDialActor.SetScale(scale); |
| ... | ... | @@ -238,13 +238,13 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName, |
| 238 | 238 | Degree finalAngle) |
| 239 | 239 | { |
| 240 | 240 | // Create the image |
| 241 | - Image image = Image::New(imageName); | |
| 241 | + Image image = ResourceImage::New(imageName); | |
| 242 | 242 | mImageActor = ImageActor::New(image); |
| 243 | 243 | mImageActor.SetParentOrigin(ParentOrigin::CENTER); |
| 244 | 244 | mImageActor.SetAnchorPoint(AnchorPoint::CENTER); |
| 245 | 245 | |
| 246 | 246 | // Create the stencil |
| 247 | - Vector2 imageSize = Image::GetImageSize(imageName); | |
| 247 | + Vector2 imageSize = ResourceImage::GetImageSize(imageName); | |
| 248 | 248 | float diameter = std::max(imageSize.width, imageSize.height); |
| 249 | 249 | RadialSweepView radialSweepView = RadialSweepView::New(); |
| 250 | 250 | radialSweepView.SetDiameter( diameter ); | ... | ... |
examples/scroll-view/scroll-view-example.cpp
| ... | ... | @@ -194,11 +194,11 @@ public: |
| 194 | 194 | TOOLBAR_IMAGE, |
| 195 | 195 | "" ); |
| 196 | 196 | |
| 197 | - mEffectIcon[ DepthEffect ] = Image::New( EFFECT_DEPTH_IMAGE ); | |
| 198 | - mEffectIcon[ CubeEffect ] = Image::New( EFFECT_INNER_CUBE_IMAGE ); | |
| 199 | - mEffectIcon[ PageCarouselEffect ] = Image::New( EFFECT_CAROUSEL_IMAGE ); | |
| 200 | - mEffectIcon[ PageCubeEffect ] = Image::New( EFFECT_CAROUSEL_IMAGE ); | |
| 201 | - mEffectIcon[ PageSpiralEffect ] = Image::New( EFFECT_CAROUSEL_IMAGE ); | |
| 197 | + mEffectIcon[ DepthEffect ] = ResourceImage::New( EFFECT_DEPTH_IMAGE ); | |
| 198 | + mEffectIcon[ CubeEffect ] = ResourceImage::New( EFFECT_INNER_CUBE_IMAGE ); | |
| 199 | + mEffectIcon[ PageCarouselEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); | |
| 200 | + mEffectIcon[ PageCubeEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); | |
| 201 | + mEffectIcon[ PageSpiralEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); | |
| 202 | 202 | |
| 203 | 203 | // Create a effect change button. (right of toolbar) |
| 204 | 204 | mEffectChangeButton = Toolkit::PushButton::New(); |
| ... | ... | @@ -298,7 +298,7 @@ private: |
| 298 | 298 | Actor CreatePage() |
| 299 | 299 | { |
| 300 | 300 | Actor page = Actor::New(); |
| 301 | - page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 301 | + page.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 302 | 302 | page.SetParentOrigin( ParentOrigin::CENTER ); |
| 303 | 303 | page.SetAnchorPoint( AnchorPoint::CENTER ); |
| 304 | 304 | |
| ... | ... | @@ -450,7 +450,7 @@ private: |
| 450 | 450 | void ApplyEffectToPage(Actor page) |
| 451 | 451 | { |
| 452 | 452 | page.RemoveConstraints(); |
| 453 | - page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 453 | + page.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 454 | 454 | |
| 455 | 455 | switch( mEffectMode ) |
| 456 | 456 | { |
| ... | ... | @@ -563,7 +563,7 @@ private: |
| 563 | 563 | |
| 564 | 564 | attributes.SetSize(width, height); |
| 565 | 565 | attributes.SetScalingMode(ImageAttributes::ShrinkToFit); |
| 566 | - Image img = Image::New(filename, attributes); | |
| 566 | + Image img = ResourceImage::New(filename, attributes); | |
| 567 | 567 | ImageActor actor = ImageActor::New(img); |
| 568 | 568 | actor.SetName( filename ); |
| 569 | 569 | actor.SetParentOrigin(ParentOrigin::CENTER); | ... | ... |
examples/shader-effect/bubble-effect-example.cpp
| ... | ... | @@ -94,7 +94,7 @@ private: |
| 94 | 94 | |
| 95 | 95 | // Add a button to change background. (right of toolbar) |
| 96 | 96 | mChangeBackgroundButton = Toolkit::PushButton::New(); |
| 97 | - mChangeBackgroundButton.SetBackgroundImage( Image::New( CHANGE_BACKGROUND_ICON ) ); | |
| 97 | + mChangeBackgroundButton.SetBackgroundImage( ResourceImage::New( CHANGE_BACKGROUND_ICON ) ); | |
| 98 | 98 | mChangeBackgroundButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked ); |
| 99 | 99 | toolBar.AddControl( mChangeBackgroundButton, |
| 100 | 100 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -102,7 +102,7 @@ private: |
| 102 | 102 | DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 103 | 103 | // Add a button to change bubble shape. ( left of bar ) |
| 104 | 104 | mChangeBubbleShapeButton = Toolkit::PushButton::New(); |
| 105 | - mChangeBubbleShapeButton.SetBackgroundImage( Image::New( CHANGE_BUBBLE_SHAPE_ICON ) ); | |
| 105 | + mChangeBubbleShapeButton.SetBackgroundImage( ResourceImage::New( CHANGE_BUBBLE_SHAPE_ICON ) ); | |
| 106 | 106 | mChangeBubbleShapeButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked ); |
| 107 | 107 | toolBar.AddControl( mChangeBubbleShapeButton, |
| 108 | 108 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -111,10 +111,10 @@ private: |
| 111 | 111 | |
| 112 | 112 | // Create and initialize the BubbleEmitter object |
| 113 | 113 | mBubbleEmitter = Toolkit::BubbleEmitter::New( stageSize, |
| 114 | - Image::New( BUBBLE_SHAPE_IMAGES[mCurrentBubbleShapeImageId] ), | |
| 114 | + ResourceImage::New( BUBBLE_SHAPE_IMAGES[mCurrentBubbleShapeImageId] ), | |
| 115 | 115 | DEFAULT_NUMBER_OF_BUBBLES, |
| 116 | 116 | DEFAULT_BUBBLE_SIZE); |
| 117 | - mBackgroundImage = Image::New( BACKGROUND_IMAGES[mCurrentBackgroundImageId] ); | |
| 117 | + mBackgroundImage = ResourceImage::New( BACKGROUND_IMAGES[mCurrentBackgroundImageId] ); | |
| 118 | 118 | mBubbleEmitter.SetBackground( mBackgroundImage, mHSVDelta ); |
| 119 | 119 | |
| 120 | 120 | // Get the root actor of all bubbles, and add it to stage. |
| ... | ... | @@ -235,7 +235,7 @@ private: |
| 235 | 235 | { |
| 236 | 236 | if(button == mChangeBackgroundButton) |
| 237 | 237 | { |
| 238 | - mBackgroundImage = Image::New( BACKGROUND_IMAGES[ ++mCurrentBackgroundImageId % NUM_BACKGROUND_IMAGES ] ); | |
| 238 | + mBackgroundImage = ResourceImage::New( BACKGROUND_IMAGES[ ++mCurrentBackgroundImageId % NUM_BACKGROUND_IMAGES ] ); | |
| 239 | 239 | |
| 240 | 240 | mBubbleEmitter.SetBackground( mBackgroundImage, mHSVDelta ); |
| 241 | 241 | |
| ... | ... | @@ -243,7 +243,7 @@ private: |
| 243 | 243 | } |
| 244 | 244 | else if( button == mChangeBubbleShapeButton ) |
| 245 | 245 | { |
| 246 | - mBubbleEmitter.SetShapeImage( Image::New( BUBBLE_SHAPE_IMAGES[ ++mCurrentBubbleShapeImageId % NUM_BUBBLE_SHAPE_IMAGES ] ) ); | |
| 246 | + mBubbleEmitter.SetShapeImage( ResourceImage::New( BUBBLE_SHAPE_IMAGES[ ++mCurrentBubbleShapeImageId % NUM_BUBBLE_SHAPE_IMAGES ] ) ); | |
| 247 | 247 | } |
| 248 | 248 | return true; |
| 249 | 249 | } | ... | ... |
examples/shader-effect/dissolve-effect-example.cpp
| ... | ... | @@ -139,6 +139,7 @@ private: |
| 139 | 139 | Toolkit::ToolBar mToolBar; |
| 140 | 140 | Layer mContent; |
| 141 | 141 | Toolkit::TextView mTitleActor; |
| 142 | + Actor mParent; | |
| 142 | 143 | |
| 143 | 144 | ImageActor mCurrentImage; |
| 144 | 145 | ImageActor mNextImage; |
| ... | ... | @@ -192,8 +193,8 @@ void DissolveEffectApp::OnInit( Application& application ) |
| 192 | 193 | mContent = DemoHelper::CreateView( application, mView,mToolBar, "", TOOLBAR_IMAGE, "" ); |
| 193 | 194 | |
| 194 | 195 | // Add an effect-changing button on the right of the tool bar. |
| 195 | - mIconHighP = Image::New( EFFECT_HIGHP_IMAGE ); | |
| 196 | - mIconMediumP = Image::New( EFFECT_MEDIUMP_IMAGE ); | |
| 196 | + mIconHighP = ResourceImage::New( EFFECT_HIGHP_IMAGE ); | |
| 197 | + mIconMediumP = ResourceImage::New( EFFECT_MEDIUMP_IMAGE ); | |
| 197 | 198 | mEffectChangeButton = Toolkit::PushButton::New(); |
| 198 | 199 | mEffectChangeButton.SetBackgroundImage(mIconHighP); |
| 199 | 200 | mEffectChangeButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnEffectButtonClicked ); |
| ... | ... | @@ -206,8 +207,8 @@ void DissolveEffectApp::OnInit( Application& application ) |
| 206 | 207 | mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); |
| 207 | 208 | |
| 208 | 209 | // Add an slide-show button on the right of the title |
| 209 | - mIconPlay = Image::New( PLAY_ICON ); | |
| 210 | - mIconStop = Image::New( STOP_ICON ); | |
| 210 | + mIconPlay = ResourceImage::New( PLAY_ICON ); | |
| 211 | + mIconStop = ResourceImage::New( STOP_ICON ); | |
| 211 | 212 | mPlayStopButton = Toolkit::PushButton::New(); |
| 212 | 213 | mPlayStopButton.SetBackgroundImage( mIconPlay ); |
| 213 | 214 | mPlayStopButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnSildeshowButtonClicked ); |
| ... | ... | @@ -221,18 +222,24 @@ void DissolveEffectApp::OnInit( Application& application ) |
| 221 | 222 | mCurrentImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision); |
| 222 | 223 | mNextImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision); |
| 223 | 224 | |
| 224 | - | |
| 225 | 225 | mViewTimer = Timer::New( VIEWINGTIME ); |
| 226 | 226 | mViewTimer.TickSignal().Connect( this, &DissolveEffectApp::OnTimerTick ); |
| 227 | 227 | mTimerReady = true; |
| 228 | 228 | |
| 229 | + // Set size to stage size to avoid seeing a black border on transition | |
| 230 | + mParent = Actor::New(); | |
| 231 | + mParent.SetSize( Stage::GetCurrent().GetSize() ); | |
| 232 | + mParent.SetPositionInheritanceMode( USE_PARENT_POSITION ); | |
| 233 | + mContent.Add( mParent ); | |
| 234 | + | |
| 229 | 235 | mSizeConstraint= Constraint::New<Vector3>( Actor::SCALE, LocalSource( Actor::SIZE ), ParentSource( Actor::SIZE ), ScaleToFitKeepAspectRatioConstraint() ); |
| 230 | 236 | |
| 231 | 237 | // show the first image |
| 232 | - mCurrentImage = ImageActor::New( Image::New( IMAGES[mIndex] ) ); | |
| 238 | + mCurrentImage = ImageActor::New( ResourceImage::New( IMAGES[mIndex] ) ); | |
| 233 | 239 | mCurrentImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION); |
| 234 | 240 | mCurrentImage.ApplyConstraint( mSizeConstraint ); |
| 235 | - mContent.Add(mCurrentImage); | |
| 241 | + mParent.Add( mCurrentImage ); | |
| 242 | + | |
| 236 | 243 | mPanGestureDetector.Attach( mCurrentImage ); |
| 237 | 244 | } |
| 238 | 245 | |
| ... | ... | @@ -256,12 +263,12 @@ void DissolveEffectApp::OnPanGesture( Actor actor, const PanGesture& gesture ) |
| 256 | 263 | mIndex = (mIndex + NUM_IMAGES -1)%NUM_IMAGES; |
| 257 | 264 | } |
| 258 | 265 | |
| 259 | - Image image = Image::New( IMAGES[ mIndex ] ); | |
| 266 | + Image image = ResourceImage::New( IMAGES[ mIndex ] ); | |
| 260 | 267 | mNextImage = ImageActor::New( image ); |
| 261 | 268 | mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION); |
| 262 | 269 | mNextImage.ApplyConstraint( mSizeConstraint ); |
| 263 | 270 | mNextImage.SetZ(INITIAL_DEPTH); |
| 264 | - mContent.Add(mNextImage); | |
| 271 | + mParent.Add( mNextImage ); | |
| 265 | 272 | Vector2 size = Vector2( mCurrentImage.GetCurrentSize() ); |
| 266 | 273 | StartTransition( gesture.position / size, gesture.displacement * Vector2(1.0, size.x/size.y)); |
| 267 | 274 | } |
| ... | ... | @@ -332,7 +339,7 @@ bool DissolveEffectApp::OnSildeshowButtonClicked( Toolkit::Button button ) |
| 332 | 339 | if( mSlideshow ) |
| 333 | 340 | { |
| 334 | 341 | mPlayStopButton.SetBackgroundImage( mIconStop ); |
| 335 | - mPanGestureDetector.Detach( mContent ); | |
| 342 | + mPanGestureDetector.Detach( mParent ); | |
| 336 | 343 | mViewTimer.Start(); |
| 337 | 344 | mTimerReady = false; |
| 338 | 345 | } |
| ... | ... | @@ -340,7 +347,7 @@ bool DissolveEffectApp::OnSildeshowButtonClicked( Toolkit::Button button ) |
| 340 | 347 | { |
| 341 | 348 | mPlayStopButton.SetBackgroundImage( mIconPlay ); |
| 342 | 349 | mTimerReady = true; |
| 343 | - mPanGestureDetector.Attach( mContent ); | |
| 350 | + mPanGestureDetector.Attach( mParent ); | |
| 344 | 351 | } |
| 345 | 352 | return true; |
| 346 | 353 | } |
| ... | ... | @@ -349,7 +356,7 @@ void DissolveEffectApp::OnTransitionCompleted( Animation& source ) |
| 349 | 356 | { |
| 350 | 357 | mCurrentImage.RemoveShaderEffect(); |
| 351 | 358 | mNextImage.RemoveShaderEffect(); |
| 352 | - mContent.Remove(mCurrentImage); | |
| 359 | + mParent.Remove( mCurrentImage ); | |
| 353 | 360 | mPanGestureDetector.Detach( mCurrentImage ); |
| 354 | 361 | mCurrentImage = mNextImage; |
| 355 | 362 | mPanGestureDetector.Attach( mCurrentImage ); |
| ... | ... | @@ -368,13 +375,13 @@ bool DissolveEffectApp::OnTimerTick() |
| 368 | 375 | if(mSlideshow) |
| 369 | 376 | { |
| 370 | 377 | mIndex = (mIndex + 1)%NUM_IMAGES; |
| 371 | - Image image = Image::New( IMAGES[ mIndex ] ); | |
| 378 | + Image image = ResourceImage::New( IMAGES[ mIndex ] ); | |
| 372 | 379 | mNextImage = ImageActor::New( image ); |
| 373 | 380 | mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION); |
| 374 | 381 | mNextImage.ApplyConstraint( mSizeConstraint ); |
| 375 | 382 | mNextImage.SetZ(INITIAL_DEPTH); |
| 376 | - mContent.Add(mNextImage); | |
| 377 | - switch(mCentralLineIndex%4) | |
| 383 | + mParent.Add( mNextImage ); | |
| 384 | + switch( mCentralLineIndex%4 ) | |
| 378 | 385 | { |
| 379 | 386 | case 0: |
| 380 | 387 | { | ... | ... |
examples/shader-effect/refraction-effect-example.cpp
| ... | ... | @@ -318,7 +318,7 @@ private: |
| 318 | 318 | |
| 319 | 319 | // Add a button to change background. (right of toolbar) |
| 320 | 320 | mChangeTextureButton = Toolkit::PushButton::New(); |
| 321 | - mChangeTextureButton.SetBackgroundImage( Image::New( CHANGE_TEXTURE_ICON ) ); | |
| 321 | + mChangeTextureButton.SetBackgroundImage( ResourceImage::New( CHANGE_TEXTURE_ICON ) ); | |
| 322 | 322 | mChangeTextureButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeTexture ); |
| 323 | 323 | toolBar.AddControl( mChangeTextureButton, |
| 324 | 324 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -326,7 +326,7 @@ private: |
| 326 | 326 | DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 327 | 327 | // Add a button to change mesh pattern. ( left of bar ) |
| 328 | 328 | mChangeMeshButton = Toolkit::PushButton::New(); |
| 329 | - mChangeMeshButton.SetBackgroundImage( Image::New( CHANGE_MESH_ICON ) ); | |
| 329 | + mChangeMeshButton.SetBackgroundImage( ResourceImage::New( CHANGE_MESH_ICON ) ); | |
| 330 | 330 | mChangeMeshButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeMesh ); |
| 331 | 331 | toolBar.AddControl( mChangeMeshButton, |
| 332 | 332 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -338,7 +338,7 @@ private: |
| 338 | 338 | mNoEffect = NoEffect::New(); // used in the other situations, basic render shader |
| 339 | 339 | // Create the mesh from the obj file and add to stage |
| 340 | 340 | mMaterial = Material::New( "Material" ) ; |
| 341 | - mMaterial.SetDiffuseTexture(Image::New(TEXTURE_IMAGES[mCurrentTextureId])); | |
| 341 | + mMaterial.SetDiffuseTexture(ResourceImage::New(TEXTURE_IMAGES[mCurrentTextureId])); | |
| 342 | 342 | CreateSurface( MESH_FILES[mCurrentMeshId] ); |
| 343 | 343 | |
| 344 | 344 | // Connect the callback to the touch signal on the mesh actor |
| ... | ... | @@ -371,7 +371,7 @@ private: |
| 371 | 371 | bool OnChangeTexture( Toolkit::Button button ) |
| 372 | 372 | { |
| 373 | 373 | mCurrentTextureId = ( mCurrentTextureId + 1 ) % NUM_TEXTURE_IMAGES; |
| 374 | - mMaterial.SetDiffuseTexture(Image::New(TEXTURE_IMAGES[mCurrentTextureId])); | |
| 374 | + mMaterial.SetDiffuseTexture(ResourceImage::New(TEXTURE_IMAGES[mCurrentTextureId])); | |
| 375 | 375 | |
| 376 | 376 | return true; |
| 377 | 377 | } | ... | ... |
examples/shadows/shadow-bone-lighting-example.cpp
| ... | ... | @@ -20,6 +20,7 @@ |
| 20 | 20 | |
| 21 | 21 | #include <dali/dali.h> |
| 22 | 22 | #include <dali-toolkit/dali-toolkit.h> |
| 23 | +#include <iostream> | |
| 23 | 24 | |
| 24 | 25 | using namespace Dali; |
| 25 | 26 | using namespace Dali::Toolkit; |
| ... | ... | @@ -28,9 +29,6 @@ using namespace DemoHelper; |
| 28 | 29 | |
| 29 | 30 | namespace |
| 30 | 31 | { |
| 31 | -const char* gModelFile = DALI_MODEL_DIR "AlbumCute.dae"; | |
| 32 | -const char* gBinaryModelFile = DALI_MODEL_DIR "AlbumCute.dali-bin"; | |
| 33 | - | |
| 34 | 32 | const char* BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-default.png" ); |
| 35 | 33 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 36 | 34 | |
| ... | ... | @@ -41,6 +39,10 @@ const char* APPLICATION_TITLE_ROTATE_SCENE( "Lighting: Rotate Scene" ); |
| 41 | 39 | const char* CHANGE_EFFECT_IMAGE( DALI_IMAGE_DIR "icon-change.png" ); |
| 42 | 40 | const char* RESET_ICON( DALI_IMAGE_DIR "icon-reset.png" ); |
| 43 | 41 | |
| 42 | +const char* SCENE_IMAGE_1( DALI_IMAGE_DIR "gallery-small-10.jpg"); | |
| 43 | +const char* SCENE_IMAGE_2( DALI_IMAGE_DIR "gallery-small-42.jpg"); | |
| 44 | +const char* SCENE_IMAGE_3( DALI_IMAGE_DIR "gallery-small-48.jpg"); | |
| 45 | + | |
| 44 | 46 | const Quaternion JAUNTY_ROTATION(Math::PI/5.0f, Math::PI/5.0f, 0.0f); // Euler angles |
| 45 | 47 | const float MIN_PINCH_SCALE( 0.3f ); |
| 46 | 48 | const float MAX_PINCH_SCALE( 2.05f ); |
| ... | ... | @@ -56,7 +58,7 @@ const Vector2 DEFAULT_STAGE_SIZE( 480.0f, 800.0f ); |
| 56 | 58 | } |
| 57 | 59 | |
| 58 | 60 | /** |
| 59 | - * This example shows a fixed point light onto an animating model | |
| 61 | + * This example shows a fixed point light onto an animating set of images | |
| 60 | 62 | * casting a shadow onto a wall. The whole scene can be rotated. |
| 61 | 63 | */ |
| 62 | 64 | |
| ... | ... | @@ -118,6 +120,21 @@ public: |
| 118 | 120 | } |
| 119 | 121 | }; |
| 120 | 122 | |
| 123 | + struct RotationConstraint | |
| 124 | + { | |
| 125 | + RotationConstraint(float sign) | |
| 126 | + : mSign(sign) | |
| 127 | + { | |
| 128 | + } | |
| 129 | + | |
| 130 | + Quaternion operator()( const Quaternion& current, const PropertyInput& property ) | |
| 131 | + { | |
| 132 | + Degree angle(property.GetFloat()); | |
| 133 | + return Quaternion( Radian(angle) * mSign, Vector3::YAXIS ); | |
| 134 | + } | |
| 135 | + | |
| 136 | + float mSign; | |
| 137 | + }; | |
| 121 | 138 | |
| 122 | 139 | /** |
| 123 | 140 | * This method gets called once the main loop of application is up and running |
| ... | ... | @@ -128,11 +145,9 @@ public: |
| 128 | 145 | |
| 129 | 146 | Stage::GetCurrent().KeyEventSignal().Connect(this, &TestApp::OnKeyEvent); |
| 130 | 147 | |
| 131 | - mModel = Model::New(gBinaryModelFile); // trigger model load | |
| 132 | - mModel.LoadingFinishedSignal().Connect(this, &TestApp::BinaryModelLoaded); | |
| 133 | - | |
| 134 | 148 | CreateToolbarAndView(app); |
| 135 | 149 | CreateShadowViewAndLights(); |
| 150 | + CreateScene(); | |
| 136 | 151 | } |
| 137 | 152 | |
| 138 | 153 | void CreateToolbarAndView(Application& app) |
| ... | ... | @@ -148,7 +163,7 @@ public: |
| 148 | 163 | "" ); |
| 149 | 164 | |
| 150 | 165 | // Add an effect-changing button on the right of the tool bar. |
| 151 | - Image imageChangeEffect = Image::New( CHANGE_EFFECT_IMAGE ); | |
| 166 | + Image imageChangeEffect = ResourceImage::New( CHANGE_EFFECT_IMAGE ); | |
| 152 | 167 | Toolkit::PushButton effectChangeButton = Toolkit::PushButton::New(); |
| 153 | 168 | effectChangeButton.SetBackgroundImage(imageChangeEffect); |
| 154 | 169 | effectChangeButton.ClickedSignal().Connect( this, &TestApp::OnEffectButtonClicked ); |
| ... | ... | @@ -164,7 +179,7 @@ public: |
| 164 | 179 | mTitleActor.SetStyleToCurrentText( DemoHelper::GetDefaultTextStyle() ); |
| 165 | 180 | |
| 166 | 181 | //Add a reset button |
| 167 | - Image resetImage = Image::New( RESET_ICON ); | |
| 182 | + Image resetImage = ResourceImage::New( RESET_ICON ); | |
| 168 | 183 | Toolkit::PushButton resetButton = Toolkit::PushButton::New(); |
| 169 | 184 | resetButton.SetBackgroundImage( resetImage ); |
| 170 | 185 | resetButton.ClickedSignal().Connect( this, &TestApp::OnResetPressed ); |
| ... | ... | @@ -190,42 +205,7 @@ public: |
| 190 | 205 | mTapGestureDetector.DetectedSignal().Connect(this, &TestApp::OnTap); |
| 191 | 206 | } |
| 192 | 207 | |
| 193 | - /** | |
| 194 | - * This method gets called once the model is loaded by the resource manager | |
| 195 | - */ | |
| 196 | - void BinaryModelLoaded(Model model) | |
| 197 | - { | |
| 198 | - if( model.GetLoadingState() == ResourceLoadingSucceeded ) | |
| 199 | - { | |
| 200 | - std::cout << "Succeeded loading binary model" << std::endl; | |
| 201 | - | |
| 202 | - ModelReady(); | |
| 203 | - } | |
| 204 | - else | |
| 205 | - { | |
| 206 | - std::cout << "Failed loading binary model" << std::endl; | |
| 207 | - | |
| 208 | - mModel = Model::New(gModelFile); | |
| 209 | - mModel.LoadingFinishedSignal().Connect(this, &TestApp::ModelLoaded); | |
| 210 | - } | |
| 211 | - } | |
| 212 | - | |
| 213 | - void ModelLoaded(Model model) | |
| 214 | - { | |
| 215 | - if( model.GetLoadingState() == ResourceLoadingSucceeded ) | |
| 216 | - { | |
| 217 | - std::cout << "Succeeded loading collada model" << std::endl; | |
| 218 | - | |
| 219 | - model.Save(gBinaryModelFile); | |
| 220 | - ModelReady(); | |
| 221 | - } | |
| 222 | - else | |
| 223 | - { | |
| 224 | - std::cout << "Failed loading collada model" << std::endl; | |
| 225 | 208 | |
| 226 | - mApp.Quit(); | |
| 227 | - } | |
| 228 | - } | |
| 229 | 209 | |
| 230 | 210 | void CreateShadowViewAndLights() |
| 231 | 211 | { |
| ... | ... | @@ -233,11 +213,11 @@ public: |
| 233 | 213 | mShadowView.SetName("Container"); |
| 234 | 214 | mShadowView.SetParentOrigin(ParentOrigin::CENTER); |
| 235 | 215 | mShadowView.SetAnchorPoint(AnchorPoint::CENTER); |
| 236 | - mShadowView.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 216 | + mShadowView.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 237 | 217 | mShadowView.SetPointLightFieldOfView( Math::PI / 2.0f); |
| 238 | 218 | mContents.Add(mShadowView); |
| 239 | 219 | |
| 240 | - Image brickWall = Image::New(DALI_IMAGE_DIR "brick-wall.jpg"); | |
| 220 | + Image brickWall = ResourceImage::New(DALI_IMAGE_DIR "brick-wall.jpg"); | |
| 241 | 221 | mShadowPlaneBg = ImageActor::New(brickWall); |
| 242 | 222 | mShadowPlaneBg.SetParentOrigin(ParentOrigin::CENTER); |
| 243 | 223 | mShadowPlaneBg.SetAnchorPoint(AnchorPoint::CENTER); |
| ... | ... | @@ -255,7 +235,7 @@ public: |
| 255 | 235 | mLightAnchor.SetRotation(CalculateWorldRotation(Radian(mLightLongitudinal), Radian(mLightAxisTilt))); |
| 256 | 236 | |
| 257 | 237 | // Work out a scaling factor as the initial light position was calculated for desktop |
| 258 | - // Need to scale light position as model size is based on stage size (i.e. much bigger on device) | |
| 238 | + // Need to scale light position as scene actor size is based on stage size (i.e. much bigger on device) | |
| 259 | 239 | Vector2 stageSize( Stage::GetCurrent().GetSize() ); |
| 260 | 240 | float scaleFactor = stageSize.x / DEFAULT_STAGE_SIZE.x; |
| 261 | 241 | |
| ... | ... | @@ -281,44 +261,51 @@ public: |
| 281 | 261 | mShadowView.SetPointLight(mCastingLight); |
| 282 | 262 | } |
| 283 | 263 | |
| 284 | - void ModelReady() | |
| 264 | + void CreateScene() | |
| 285 | 265 | { |
| 286 | - mModelActor = ModelActorFactory::BuildActorTree(mModel, ""); // Gets root actor | |
| 266 | + mSceneActor = Actor::New(); | |
| 267 | + mSceneActor.SetParentOrigin(ParentOrigin::CENTER); | |
| 287 | 268 | |
| 288 | - if (mModelActor) | |
| 289 | - { | |
| 290 | - Vector2 stageSize(Stage::GetCurrent().GetSize()); | |
| 269 | + // Create and add images to the scene actor: | |
| 270 | + mImageActor1 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_1) ); | |
| 271 | + mImageActor2 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_2) ); | |
| 272 | + mImageActor3 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_3) ); | |
| 291 | 273 | |
| 292 | - mModelActor.SetSize(250.0f, 250.0f); | |
| 293 | - mModelActor.SetPosition(0.0f, 0.0f, 130.0f); | |
| 294 | 274 | |
| 295 | - //Create a Key light | |
| 296 | - Light keylight = Light::New("KeyLight"); | |
| 297 | - keylight.SetFallOff(Vector2(10000.0f, 10000.0f)); | |
| 298 | - //keylight.SetSpecularColor(Vector3::ZERO); | |
| 299 | - mKeyLightActor = LightActor::New(); | |
| 300 | - mKeyLightActor.SetParentOrigin(ParentOrigin::CENTER); | |
| 301 | - mKeyLightActor.SetName(keylight.GetName()); | |
| 275 | + mImageActor2.SetParentOrigin(ParentOrigin::CENTER); | |
| 302 | 276 | |
| 303 | - //Add all the actors to the stage | |
| 304 | - mCastingLight.Add(mKeyLightActor); | |
| 305 | - mKeyLightActor.SetLight(keylight); | |
| 277 | + mImageActor1.SetParentOrigin(ParentOrigin::CENTER_LEFT); | |
| 278 | + mImageActor1.SetAnchorPoint(AnchorPoint::CENTER_RIGHT); | |
| 306 | 279 | |
| 307 | - mShadowView.Add(mModelActor); | |
| 280 | + mImageActor3.SetParentOrigin(ParentOrigin::CENTER_RIGHT); | |
| 281 | + mImageActor3.SetAnchorPoint(AnchorPoint::CENTER_LEFT); | |
| 308 | 282 | |
| 283 | + mSceneActor.Add(mImageActor2); | |
| 284 | + mImageActor2.Add(mImageActor1); | |
| 285 | + mImageActor2.Add(mImageActor3); | |
| 309 | 286 | |
| 310 | - if (mModel.NumberOfAnimations()) | |
| 311 | - { | |
| 312 | - mModelAnimation = ModelActorFactory::BuildAnimation(mModel, mModelActor, 0); | |
| 313 | - mModelAnimation.SetDuration(4.0f); | |
| 314 | - mModelAnimation.SetLooping(true); | |
| 315 | - mModelAnimation.Play(); | |
| 316 | - } | |
| 287 | + Property::Index angleIndex = mImageActor2.RegisterProperty("angle", Property::Value(30.0f)); | |
| 288 | + Source angleSrc( mImageActor2, angleIndex ); | |
| 289 | + mImageActor1.ApplyConstraint(Constraint::New<Quaternion>( Actor::ROTATION, angleSrc, | |
| 290 | + RotationConstraint(-1.0f))); | |
| 291 | + mImageActor3.ApplyConstraint(Constraint::New<Quaternion>( Actor::ROTATION, angleSrc, | |
| 292 | + RotationConstraint(+1.0f))); | |
| 317 | 293 | |
| 318 | - //StartAnimation(); | |
| 319 | - } | |
| 294 | + mSceneAnimation = Animation::New(2.5f); | |
| 295 | + | |
| 296 | + // Want to animate angle from 30 => -30 and back again smoothly. | |
| 297 | + | |
| 298 | + mSceneAnimation.AnimateTo( Property( mImageActor2, angleIndex ), Property::Value(-30.0f), AlphaFunctions::Sin ); | |
| 299 | + | |
| 300 | + mSceneAnimation.SetLooping(true); | |
| 301 | + mSceneAnimation.Play(); | |
| 302 | + | |
| 303 | + mSceneActor.SetSize(250.0f, 250.0f); | |
| 304 | + mSceneActor.SetPosition(0.0f, 0.0f, 130.0f); | |
| 305 | + mShadowView.Add(mSceneActor); | |
| 320 | 306 | } |
| 321 | 307 | |
| 308 | + | |
| 322 | 309 | Quaternion CalculateWorldRotation(Radian longitude, Radian axisTilt ) |
| 323 | 310 | { |
| 324 | 311 | Quaternion q(longitude, Vector3::YAXIS); |
| ... | ... | @@ -328,17 +315,18 @@ public: |
| 328 | 315 | |
| 329 | 316 | void OnTap(Dali::Actor actor, const TapGesture& gesture) |
| 330 | 317 | { |
| 331 | - if( ! mPaused ) | |
| 332 | - { | |
| 333 | - //mAnimation.Pause(); | |
| 334 | - mModelAnimation.Pause(); | |
| 335 | - mPaused = true; | |
| 336 | - } | |
| 337 | - else | |
| 318 | + if( mSceneAnimation ) | |
| 338 | 319 | { |
| 339 | - //mAnimation.Play(); | |
| 340 | - mModelAnimation.Play(); | |
| 341 | - mPaused = false; | |
| 320 | + if( ! mPaused ) | |
| 321 | + { | |
| 322 | + mSceneAnimation.Pause(); | |
| 323 | + mPaused = true; | |
| 324 | + } | |
| 325 | + else | |
| 326 | + { | |
| 327 | + mSceneAnimation.Play(); | |
| 328 | + mPaused = false; | |
| 329 | + } | |
| 342 | 330 | } |
| 343 | 331 | } |
| 344 | 332 | |
| ... | ... | @@ -380,7 +368,7 @@ public: |
| 380 | 368 | mObjectLongitudinal += gesture.displacement.x/4.0f; |
| 381 | 369 | mObjectAxisTilt -= gesture.displacement.y/6.0f; |
| 382 | 370 | mObjectAxisTilt = Clamp<float>(mObjectAxisTilt, -90.0f, 90.0f); |
| 383 | - mModelActor.SetRotation(CalculateWorldRotation(Radian(mObjectLongitudinal), Radian(mObjectAxisTilt))); | |
| 371 | + mSceneActor.SetRotation(CalculateWorldRotation(Radian(mObjectLongitudinal), Radian(mObjectAxisTilt))); | |
| 384 | 372 | break; |
| 385 | 373 | } |
| 386 | 374 | } |
| ... | ... | @@ -409,13 +397,9 @@ public: |
| 409 | 397 | |
| 410 | 398 | void Terminate(Application& app) |
| 411 | 399 | { |
| 412 | - if( mModelActor ) | |
| 413 | - { | |
| 414 | - Stage::GetCurrent().Remove(mModelActor); | |
| 415 | - } | |
| 416 | - if( mKeyLightActor ) | |
| 400 | + if( mSceneActor ) | |
| 417 | 401 | { |
| 418 | - Stage::GetCurrent().Remove(mKeyLightActor); | |
| 402 | + Stage::GetCurrent().Remove(mSceneActor); | |
| 419 | 403 | } |
| 420 | 404 | if( mView ) |
| 421 | 405 | { |
| ... | ... | @@ -472,6 +456,7 @@ public: |
| 472 | 456 | // Reset translation |
| 473 | 457 | mTranslation = Vector3::ZERO; |
| 474 | 458 | mContents.SetPosition(mTranslation); |
| 459 | + | |
| 475 | 460 | // Align scene so that light anchor orientation is Z Axis |
| 476 | 461 | mAxisTilt = -mLightAxisTilt; |
| 477 | 462 | mLongitudinal = -mLightLongitudinal; |
| ... | ... | @@ -484,18 +469,18 @@ private: |
| 484 | 469 | Application& mApp; |
| 485 | 470 | Toolkit::View mView; |
| 486 | 471 | Layer mContents; |
| 487 | - Model mModel; | |
| 488 | - Actor mModelActor; | |
| 489 | - LightActor mKeyLightActor; | |
| 472 | + Actor mSceneActor; | |
| 490 | 473 | Animation mAnimation; |
| 491 | - Animation mModelAnimation; | |
| 474 | + Animation mSceneAnimation; | |
| 492 | 475 | bool mPaused; |
| 493 | 476 | Toolkit::ShadowView mShadowView; |
| 494 | 477 | ImageActor mShadowPlaneBg; |
| 495 | 478 | ImageActor mShadowPlane; |
| 496 | 479 | Actor mCastingLight; |
| 497 | 480 | Actor mLightAnchor; |
| 498 | - | |
| 481 | + ImageActor mImageActor1; | |
| 482 | + ImageActor mImageActor2; | |
| 483 | + ImageActor mImageActor3; | |
| 499 | 484 | PanGestureDetector mPanGestureDetector; |
| 500 | 485 | PinchGestureDetector mPinchGestureDetector; |
| 501 | 486 | TapGestureDetector mTapGestureDetector; |
| ... | ... | @@ -509,6 +494,9 @@ private: |
| 509 | 494 | float mPinchScale; |
| 510 | 495 | float mScaleAtPinchStart; |
| 511 | 496 | |
| 497 | + Property::Index mAngle1Index; | |
| 498 | + Property::Index mAngle3Index; | |
| 499 | + | |
| 512 | 500 | Toolkit::TextView mTitleActor; |
| 513 | 501 | |
| 514 | 502 | enum PanState | ... | ... |
examples/shared/view.h
| ... | ... | @@ -93,14 +93,14 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, |
| 93 | 93 | toolBarLayer.RaiseToTop(); |
| 94 | 94 | |
| 95 | 95 | // Tool bar |
| 96 | - Dali::Image image = Dali::Image::New( toolbarImagePath ); | |
| 96 | + Dali::Image image = Dali::ResourceImage::New( toolbarImagePath ); | |
| 97 | 97 | Dali::ImageActor toolBarBackground = Dali::ImageActor::New( image ); |
| 98 | 98 | toolBar = Dali::Toolkit::ToolBar::New(); |
| 99 | 99 | toolBar.SetBackground( toolBarBackground ); |
| 100 | 100 | toolBar.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER ); |
| 101 | 101 | toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); |
| 102 | - toolBar.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::EqualToConstraint() ) ); | |
| 103 | 102 | toolBar.SetSize( 0.0f, style.mToolBarHeight ); |
| 103 | + toolBar.SetSizeMode( Dali::SIZE_EQUAL_TO_PARENT ); | |
| 104 | 104 | toolBarBackground.SetSortModifier(1.0f); |
| 105 | 105 | |
| 106 | 106 | // Add the tool bar to the too bar layer. |
| ... | ... | @@ -145,7 +145,7 @@ Dali::Layer CreateView( Dali::Application& application, |
| 145 | 145 | // Set background image. |
| 146 | 146 | if ( ! backgroundImagePath.empty() ) |
| 147 | 147 | { |
| 148 | - Dali::Image backgroundImage = Dali::Image::New( backgroundImagePath ); | |
| 148 | + Dali::Image backgroundImage = Dali::ResourceImage::New( backgroundImagePath ); | |
| 149 | 149 | Dali::ImageActor backgroundImageActor = Dali::ImageActor::New( backgroundImage ); |
| 150 | 150 | view.SetBackground( backgroundImageActor ); |
| 151 | 151 | } |
| ... | ... | @@ -166,7 +166,7 @@ Dali::Layer CreateView( Dali::Application& application, |
| 166 | 166 | Dali::Layer contentLayer = Dali::Layer::New(); |
| 167 | 167 | contentLayer.SetAnchorPoint( Dali::AnchorPoint::CENTER ); |
| 168 | 168 | contentLayer.SetParentOrigin( Dali::ParentOrigin::CENTER ); |
| 169 | - contentLayer.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::EqualToConstraint() ) ); | |
| 169 | + contentLayer.SetSizeMode( Dali::SIZE_EQUAL_TO_PARENT ); | |
| 170 | 170 | view.AddContentLayer( contentLayer ); |
| 171 | 171 | contentLayer.LowerBelow( toolBarLayer ); |
| 172 | 172 | ... | ... |
examples/transition/cube-transition-effect-example.cpp
| ... | ... | @@ -120,7 +120,7 @@ private: |
| 120 | 120 | * Start the transition |
| 121 | 121 | * @param[in] image The image content of the imageActor for transition |
| 122 | 122 | */ |
| 123 | - void OnImageLoaded(Image image); | |
| 123 | + void OnImageLoaded(ResourceImage image); | |
| 124 | 124 | /** |
| 125 | 125 | * Main key event handler |
| 126 | 126 | */ |
| ... | ... | @@ -209,9 +209,9 @@ void CubeTransitionApp::OnInit( Application& application ) |
| 209 | 209 | mContent = DemoHelper::CreateView( application, mView, mToolBar, "", TOOLBAR_IMAGE, "" ); |
| 210 | 210 | |
| 211 | 211 | // Add an effect-changing button on the right of the tool bar. |
| 212 | - mImageWave = Image::New( EFFECT_WAVE_IMAGE ); | |
| 213 | - mImageCross = Image::New( EFFECT_CROSS_IMAGE ); | |
| 214 | - mImageFold = Image::New( EFFECT_FOLD_IMAGE ); | |
| 212 | + mImageWave = ResourceImage::New( EFFECT_WAVE_IMAGE ); | |
| 213 | + mImageCross = ResourceImage::New( EFFECT_CROSS_IMAGE ); | |
| 214 | + mImageFold = ResourceImage::New( EFFECT_FOLD_IMAGE ); | |
| 215 | 215 | mEffectChangeButton = Toolkit::PushButton::New(); |
| 216 | 216 | mEffectChangeButton.SetBackgroundImage(mImageWave); |
| 217 | 217 | mEffectChangeButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked ); |
| ... | ... | @@ -222,8 +222,8 @@ void CubeTransitionApp::OnInit( Application& application ) |
| 222 | 222 | mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); |
| 223 | 223 | |
| 224 | 224 | //Add an slideshow icon on the right of the title |
| 225 | - mIconSlideshowStart = Image::New( SLIDE_SHOW_START_ICON ); | |
| 226 | - mIconSlideshowStop = Image::New( SLIDE_SHOW_STOP_ICON ); | |
| 225 | + mIconSlideshowStart = ResourceImage::New( SLIDE_SHOW_START_ICON ); | |
| 226 | + mIconSlideshowStop = ResourceImage::New( SLIDE_SHOW_STOP_ICON ); | |
| 227 | 227 | mSlideshowButton = Toolkit::PushButton::New(); |
| 228 | 228 | mSlideshowButton.SetBackgroundImage( mIconSlideshowStart ); |
| 229 | 229 | mSlideshowButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnSildeshowButtonClicked ); |
| ... | ... | @@ -266,7 +266,7 @@ void CubeTransitionApp::OnInit( Application& application ) |
| 266 | 266 | // show the first image |
| 267 | 267 | mImageConstraint = Constraint::New<Vector3>( Actor::SCALE, LocalSource( Actor::SIZE ), ParentSource( Actor::SIZE ), ScaleToFitKeepAspectRatioConstraint() ); |
| 268 | 268 | |
| 269 | - mCurrentImage = ImageActor::New( Image::New( IMAGES[mIndex] ) ); | |
| 269 | + mCurrentImage = ImageActor::New( ResourceImage::New( IMAGES[mIndex] ) ); | |
| 270 | 270 | mCurrentImage.SetPositionInheritanceMode( USE_PARENT_POSITION ); |
| 271 | 271 | mCurrentImage.ApplyConstraint( mImageConstraint ); |
| 272 | 272 | mParent.Add( mCurrentImage ); |
| ... | ... | @@ -308,23 +308,24 @@ void CubeTransitionApp::OnPanGesture( Actor actor, const PanGesture& gesture ) |
| 308 | 308 | |
| 309 | 309 | void CubeTransitionApp::GoToNextImage() |
| 310 | 310 | { |
| 311 | - Image image = Image::New( IMAGES[ mIndex ] ); | |
| 311 | + ResourceImage image = ResourceImage::New( IMAGES[ mIndex ] ); | |
| 312 | 312 | mNextImage = ImageActor::New( image ); |
| 313 | 313 | mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION); |
| 314 | 314 | mNextImage.ApplyConstraint( mImageConstraint ); |
| 315 | 315 | mCurrentEffect.SetTargetImage(mNextImage); |
| 316 | - mIsImageLoading = true; | |
| 317 | 316 | if( image.GetLoadingState() == ResourceLoadingSucceeded ) |
| 318 | 317 | { |
| 319 | - OnImageLoaded( image ); | |
| 318 | + mIsImageLoading = false; | |
| 319 | + OnImageLoaded( image ); | |
| 320 | 320 | } |
| 321 | 321 | else |
| 322 | 322 | { |
| 323 | + mIsImageLoading = true; | |
| 323 | 324 | image.LoadingFinishedSignal().Connect( this, &CubeTransitionApp::OnImageLoaded ); |
| 324 | 325 | } |
| 325 | 326 | } |
| 326 | 327 | |
| 327 | -void CubeTransitionApp::OnImageLoaded(Image image) | |
| 328 | +void CubeTransitionApp::OnImageLoaded(ResourceImage image) | |
| 328 | 329 | { |
| 329 | 330 | mIsImageLoading = false; |
| 330 | 331 | mCurrentEffect.StartTransition( mPanPosition, mPanDisplacement ); | ... | ... |
packaging/com.samsung.dali-demo.spec
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | Name: com.samsung.dali-demo |
| 4 | 4 | Summary: The OpenGLES Canvas Core Demo |
| 5 | -Version: 1.0.30 | |
| 5 | +Version: 1.0.31 | |
| 6 | 6 | Release: 1 |
| 7 | 7 | Group: System/Libraries |
| 8 | 8 | License: Apache-2.0 |
| ... | ... | @@ -14,6 +14,7 @@ Requires(postun): /sbin/ldconfig |
| 14 | 14 | Requires: dali |
| 15 | 15 | Requires: dali-adaptor |
| 16 | 16 | Requires: dali-toolkit |
| 17 | +BuildRequires: cmake | |
| 17 | 18 | BuildRequires: boost-devel |
| 18 | 19 | BuildRequires: pkgconfig |
| 19 | 20 | BuildRequires: pkgconfig(capi-appfw-application) |
| ... | ... | @@ -47,13 +48,10 @@ CXXFLAGS+=" -Wall -g -O2" |
| 47 | 48 | LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -fPIC" |
| 48 | 49 | |
| 49 | 50 | %ifarch %{arm} |
| 50 | -EXTRA_CONFIGURE_OPTIONS=" --host=arm" | |
| 51 | 51 | CXXFLAGS+=" -D_ARCH_ARM_" |
| 52 | 52 | %endif |
| 53 | 53 | |
| 54 | -libtoolize --force | |
| 55 | -cd %{_builddir}/%{name}-%{version}/build/tizen && autoreconf --install | |
| 56 | -cd %{_builddir}/%{name}-%{version}/build/tizen && CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS DALI_APP_DIR=%{dali_app_ro_dir} ./configure --prefix=$PREFIX $EXTRA_CONFIGURE_OPTIONS | |
| 54 | +cd %{_builddir}/%{name}-%{version}/build/tizen && cmake -DDALI_APP_DIR=%{dali_app_ro_dir} . | |
| 57 | 55 | |
| 58 | 56 | make %{?jobs:-j%jobs} |
| 59 | 57 | |
| ... | ... | @@ -65,9 +63,6 @@ rm -rf %{buildroot} |
| 65 | 63 | cd build/tizen |
| 66 | 64 | %make_install DALI_APP_DIR=%{dali_app_ro_dir} |
| 67 | 65 | |
| 68 | -mkdir -p %{buildroot}/%{dali_app_exe_dir} | |
| 69 | -mv %{buildroot}/%{_bindir}/* %{buildroot}/%{dali_app_exe_dir} | |
| 70 | - | |
| 71 | 66 | mkdir -p %{buildroot}%{dali_xml_file_dir} |
| 72 | 67 | cp -f %{_builddir}/%{name}-%{version}/%{name}.xml %{buildroot}%{dali_xml_file_dir} |
| 73 | 68 | ... | ... |