diff --git a/.gitignore b/.gitignore index 2168e3c..6e2e2b0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ dali-builder *.creator.user /build/desktop /packaging/home* +*.mo diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 8819ff8..2f68697 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -20,15 +20,27 @@ SET(RESOURCE_DIR ${ROOT_SRC_DIR}/resources) SET(LOCAL_IMAGES_DIR ${RESOURCE_DIR}/images) SET(LOCAL_MODELS_DIR ${RESOURCE_DIR}/models) SET(LOCAL_SCRIPTS_DIR ${RESOURCE_DIR}/scripts) +IF(NOT DEFINED LOCAL_STYLE_DIR) + SET(LOCAL_STYLE_DIR ${RESOURCE_DIR}/style) +ENDIF() SET(IMAGES_DIR ${APP_DATA_DIR}/images/) SET(MODELS_DIR ${APP_DATA_DIR}/models/) SET(SCRIPTS_DIR ${APP_DATA_DIR}/scripts/) +SET(STYLE_DIR ${APP_DATA_DIR}/style/) + +IF(NOT DEFINED LOCALE_DIR) + SET(LOCALE_DIR ${PREFIX}/share/locale) +ENDIF() SET(DALI_IMAGE_DIR \\"${IMAGES_DIR}\\") SET(DALI_MODEL_DIR \\"${MODELS_DIR}\\") SET(DALI_SCRIPT_DIR \\"${SCRIPTS_DIR}\\") +SET(DALI_STYLE_DIR \\"${STYLE_DIR}\\") +SET(DALI_DEMO_THEME_PATH \\"${STYLE_DIR}/demo-theme.json\\") SET(DALI_EXAMPLE_BIN \\"${BINDIR}/\\") +SET(DALI_LOCALE_DIR \\"${LOCALE_DIR}\\") +SET(DALI_LANG \\"${LANG}\\") FILE(GLOB LOCAL_IMAGES_PNG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png") FILE(GLOB LOCAL_IMAGES_JPG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg") @@ -52,6 +64,8 @@ FOREACH(flag ${LOCAL_SCRIPTS_LIST}) INSTALL(FILES ${LOCAL_SCRIPTS_DIR}/${flag} DESTINATION ${SCRIPTS_DIR}) ENDFOREACH(flag) +INSTALL(FILES ${LOCAL_STYLE_DIR}/demo-theme.json DESTINATION ${STYLE_DIR}) + SET(PKG_LIST dali dali-toolkit) @@ -62,7 +76,7 @@ FOREACH(flag ${REQUIRED_PKGS_CFLAGS}) SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}") ENDFOREACH(flag) -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") +SET(DALI_DEMO_CFLAGS "-DDALI_IMAGE_DIR=${DALI_IMAGE_DIR} -DDALI_MODEL_DIR=${DALI_MODEL_DIR} -DDALI_SCRIPT_DIR=${DALI_SCRIPT_DIR} -DDALI_DEMO_THEME_PATH=${DALI_DEMO_THEME_PATH} -DDALI_EXAMPLE_BIN=${DALI_EXAMPLE_BIN} -DDALI_LOCALE_DIR=${DALI_LOCALE_DIR} -fvisibility=hidden -DHIDE_DALI_INTERNALS -DDALI_LANG=${DALI_LANG}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${REQUIRED_CFLAGS} ${DALI_DEMO_CFLAGS} -Werror -Wall") SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") diff --git a/build/tizen/demo/CMakeLists.txt b/build/tizen/demo/CMakeLists.txt index 83fe747..c5f967a 100644 --- a/build/tizen/demo/CMakeLists.txt +++ b/build/tizen/demo/CMakeLists.txt @@ -6,3 +6,27 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${DEMO_SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_PKGS_LDFLAGS}) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) + +# Internationalization + +SET(PO_DIR ${DEMO_SRC_DIR}/po) + +FILE(GLOB PO_FILES RELATIVE "${PO_DIR}" "${PO_DIR}/*.po") + +SET(MSGFMT "/usr/bin/msgfmt") + +FOREACH(PO_FILE ${PO_FILES}) + SET(PO_FILE ${PO_DIR}/${PO_FILE}) + MESSAGE("PO: ${PO_FILE}") + GET_FILENAME_COMPONENT(ABS_PO_FILE ${PO_FILE} ABSOLUTE) + GET_FILENAME_COMPONENT(lang ${ABS_PO_FILE} NAME_WE) + SET(MO_FILE ${PO_DIR}/${lang}.mo) + ADD_CUSTOM_COMMAND(OUTPUT ${MO_FILE} + COMMAND ${MSGFMT} -o ${MO_FILE} ${ABS_PO_FILE} + DEPENDS ${ABS_PO_FILE}) + INSTALL(FILES ${MO_FILE} DESTINATION ${LOCALE_DIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo) + SET(MO_FILES ${MO_FILES} ${MO_FILE}) +ENDFOREACH(PO_FILE) + +MESSAGE(".mo files: ${MO_FILES}") +ADD_CUSTOM_TARGET(po ALL DEPENDS ${MO_FILES}) diff --git a/build/tizen/docs/.gitignore b/build/tizen/docs/.gitignore deleted file mode 100644 index 37cfe18..0000000 --- a/build/tizen/docs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -doxygen-errors.txt diff --git a/build/tizen/docs/dali.doxy.in b/build/tizen/docs/dali.doxy.in deleted file mode 100644 index a2a2d3e..0000000 --- a/build/tizen/docs/dali.doxy.in +++ /dev/null @@ -1,1566 +0,0 @@ -# Doxyfile 1.5.8 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = Dali - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = @DOXYGEN_DOCS_DIR@/generated - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, -# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, -# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, -# Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = . - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it parses. -# With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this tag. -# The format is ext=language, where ext is a file extension, and language is one of -# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = YES - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = NO - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = NO - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = NO - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The create the layout file that represents -# doxygen's defaults, run doxygen with the -l option. You can optionally specify a -# file name after the option, if omitted DoxygenLayout.xml will be used as the name -# of the layout file. - -LAYOUT_FILE = @DOXYGEN_DOCS_DIR@/DaliLayout.xml - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = @DOXYGEN_DOCS_DIR@/content \ - @prefix@/include/dali/public-api \ - @prefix@/include/dali-toolkit/public-api - - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.vhd \ - *.vhdl - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = dali/integration-api - - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = DaliInternal \ - Dali::Internal \ - Dali::Integration \ - Impl \ - ApplicationImpl - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = @DOXYGEN_ROOT_DIR@/examples - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = YES - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = @DOXYGEN_DOCS_DIR@/content/images - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = @DOXYGEN_DOCS_DIR@/api_footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = YES - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = dali.chm - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to FRAME, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. Other possible values -# for this tag are: HIERARCHIES, which will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list; -# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which -# disables this behavior completely. For backwards compatibility with previous -# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE -# respectively. - -GENERATE_TREEVIEW = NONE - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = DALI_IMPORT_API DALI_INTERNAL \ - __attribute__ ((visibility ("default"))) \ - __attribute__ ((visibility ("hidden"))) - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Options related to the search engine -#--------------------------------------------------------------------------- - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -# SERVER_BASED_SEARCH = NO diff --git a/com.samsung.dali-demo.xml b/com.samsung.dali-demo.xml index 0a5488a..c47a615 100644 --- a/com.samsung.dali-demo.xml +++ b/com.samsung.dali-demo.xml @@ -73,8 +73,17 @@ - - + + + + + + + + + + + diff --git a/demo/dali-demo.cpp b/demo/dali-demo.cpp index 31ddbd0..a7b456d 100644 --- a/demo/dali-demo.cpp +++ b/demo/dali-demo.cpp @@ -15,39 +15,53 @@ * */ +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES #include "dali-table-view.h" +#include "shared/dali-demo-strings.h" using namespace Dali; int main(int argc, char **argv) { + // Configure gettext for internalization + bindtextdomain(DALI_DEMO_DOMAIN_LOCAL, DALI_LOCALE_DIR); + textdomain(DALI_DEMO_DOMAIN_LOCAL); + setlocale(LC_ALL, DALI_LANG); + Application app = Application::New(&argc, &argv); + // Create the demo launcher DaliTableView demo(app); - demo.AddExample(Example("bubble-effect.example", "Bubbles")); - demo.AddExample(Example("blocks.example", "Blocks")); - demo.AddExample(Example("cluster.example", "Cluster control")); - demo.AddExample(Example("cube-transition-effect.example", "Cube Transition")); - demo.AddExample(Example("dissolve-effect.example", "Dissolve Transition")); - demo.AddExample(Example("item-view.example", "Item View")); - demo.AddExample(Example("magnifier.example", "Magnifier")); - demo.AddExample(Example("motion-blur.example", "Motion Blur")); - demo.AddExample(Example("motion-stretch.example", "Motion Stretch")); - demo.AddExample(Example("page-turn-view.example", "Page Turn View")); - demo.AddExample(Example("radial-menu.example", "Radial Menu")); - demo.AddExample(Example("refraction-effect.example", "Refraction")); - demo.AddExample(Example("scroll-view.example", "Scroll View")); - demo.AddExample(Example("shadow-bone-lighting.example", "Lights and shadows")); -// demo.AddExample(Example("builder.example", "Script Based UI")); - demo.AddExample(Example("image-scaling-irregular-grid.example", "Image Scaling Modes")); - demo.AddExample(Example("text-view.example", "Text View")); - demo.AddExample(Example("animated-shapes.example", "Animated Shapes")); - demo.AddExample(Example("path-animation.example", "Path Animation")); + demo.AddExample(Example("bubble-effect.example", DALI_DEMO_STR_TITLE_BUBBLES)); + demo.AddExample(Example("blocks.example", DALI_DEMO_STR_TITLE_BLOCKS)); + demo.AddExample(Example("cluster.example", DALI_DEMO_STR_TITLE_CLUSTER)); + demo.AddExample(Example("cube-transition-effect.example", DALI_DEMO_STR_TITLE_CUBE_TRANSITION)); + demo.AddExample(Example("dissolve-effect.example", DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION)); + demo.AddExample(Example("item-view.example", DALI_DEMO_STR_TITLE_ITEM_VIEW)); + demo.AddExample(Example("magnifier.example", DALI_DEMO_STR_TITLE_MAGNIFIER)); + demo.AddExample(Example("motion-blur.example", DALI_DEMO_STR_TITLE_MOTION_BLUR)); + demo.AddExample(Example("motion-stretch.example", DALI_DEMO_STR_TITLE_MOTION_STRETCH)); + demo.AddExample(Example("page-turn-view.example", DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW)); + demo.AddExample(Example("radial-menu.example", DALI_DEMO_STR_TITLE_RADIAL_MENU)); + demo.AddExample(Example("refraction-effect.example", DALI_DEMO_STR_TITLE_REFRACTION)); + demo.AddExample(Example("scroll-view.example", DALI_DEMO_STR_TITLE_SCROLL_VIEW)); + demo.AddExample(Example("shadow-bone-lighting.example", DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS)); + demo.AddExample(Example("builder.example", DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI)); + demo.AddExample(Example("image-scaling-irregular-grid.example", DALI_DEMO_STR_TITLE_IMAGE_SCALING)); + demo.AddExample(Example("text-label.example", DALI_DEMO_STR_TITLE_TEXT_LABEL)); + demo.AddExample(Example("text-label-multi-language.example", DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE)); + demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT)); + demo.AddExample(Example("animated-shapes.example", DALI_DEMO_STR_TITLE_ANIMATED_SHAPES)); + demo.AddExample(Example("path-animation.example", DALI_DEMO_STR_TITLE_PATH_ANIMATION)); demo.AddExample(Example("size-negotiation.example", "Size Negotiation")); demo.SortAlphabetically( true ); + // Start the event loop app.MainLoop(); return 0; diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp index 8deff1c..54490fb 100644 --- a/demo/dali-table-view.cpp +++ b/demo/dali-table-view.cpp @@ -86,17 +86,7 @@ const Vector2 POSITION_SWING_3DEFFECT( 0.55f, 0.4f ); ///< Position const Vector3 ANCHOR_3DEFFECT_STYLE0( -105.0f, 30.0f, -240.0f ); ///< Rotation Anchor position for 3D Effect (Style 0) const Vector3 ANCHOR_3DEFFECT_STYLE1( 65.0f, -70.0f, -500.0f ); ///< Rotation Anchor position for 3D Effect (Style 1) -const std::string DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNeue"); -const std::string DEFAULT_TEXT_STYLE_FONT_STYLE("Regular"); -const Dali::PointSize DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); -const Dali::TextStyle::Weight DEFAULT_TEXT_STYLE_WEIGHT(Dali::TextStyle::REGULAR); -const Dali::Vector4 DEFAULT_TEXT_STYLE_COLOR(0.7f, 0.7f, 0.7f, 1.0f); - -const std::string TABLE_TEXT_STYLE_FONT_FAMILY("HelveticaNeue"); -const std::string TABLE_TEXT_STYLE_FONT_STYLE("Regular"); -const Dali::PointSize TABLE_TEXT_STYLE_POINT_SIZE( 8.0f ); -const Dali::TextStyle::Weight TABLE_TEXT_STYLE_WEIGHT(Dali::TextStyle::LIGHT); -const Dali::Vector4 TABLE_TEXT_STYLE_COLOR(0.0f, 0.0f, 0.0f, 1.0f); +const Dali::Vector4 TABLE_TEXT_STYLE_COLOR(0.0f, 0.0f, 0.0f, 1.0f); Vector3 ScalePointSize(const Vector3& vec) { @@ -105,17 +95,6 @@ Vector3 ScalePointSize(const Vector3& vec) #define DP(x) DemoHelper::ScalePointSize(x) -TextStyle GetTableTextStyle() -{ - TextStyle textStyle; - textStyle.SetFontName(TABLE_TEXT_STYLE_FONT_FAMILY); - textStyle.SetFontStyle(TABLE_TEXT_STYLE_FONT_STYLE); - textStyle.SetFontPointSize( Dali::PointSize(DemoHelper::ScalePointSize(TABLE_TEXT_STYLE_POINT_SIZE))); - textStyle.SetWeight(TABLE_TEXT_STYLE_WEIGHT); - textStyle.SetTextColor(TABLE_TEXT_STYLE_COLOR); - return textStyle; -} - /** * Creates the background image */ @@ -151,20 +130,19 @@ public: { } - Vector3 operator()( const Vector3& current, const PropertyInput& scrollProperty, const PropertyInput& parentSize ) + void operator()( Vector3& position, const PropertyInputContainer& inputs ) { - Vector3 pos( current ); - const float parentHeight = parentSize.GetVector3().height; + const Vector3& parentSize = inputs[1]->GetVector3(); - // Wrap bubbles vertically - if( pos.y + mShapeSize * 0.5f < -parentHeight * 0.5f ) + // Wrap bubbles verically. + if( position.y + mShapeSize * 0.5f < -parentSize.y * 0.5f ) { - pos.y = parentHeight * 0.5f + mShapeSize * 0.5f; + position.y = parentSize.y * 0.5f + mShapeSize * 0.5f; } - // Bubbles X position moves parallax to horizontal panning by a scale factor unique to each bubble - pos.x = mInitialX + ( scrollProperty.GetVector3().x * mScale ); - return pos; + // Bubbles X position moves parallax to horizontal + // panning by a scale factor unique to each bubble. + position.x = mInitialX + ( inputs[0]->GetVector3().x * mScale ); } private: @@ -236,6 +214,8 @@ void DaliTableView::SortAlphabetically( bool sortAlphabetically ) void DaliTableView::Initialize( Application& application ) { + DemoHelper::RequestThemeChange(); + Stage::GetCurrent().KeyEventSignal().Connect( this, &DaliTableView::OnKeyEvent ); const Vector2 stageSize = Stage::GetCurrent().GetSize(); @@ -256,8 +236,7 @@ void DaliTableView::Initialize( Application& application ) Dali::Layer toolBarLayer = DemoHelper::CreateToolbar(toolbar, DEFAULT_TOOLBAR_IMAGE_PATH, DEFAULT_TOOLBAR_TEXT, - DemoHelper::DEFAULT_VIEW_STYLE, - DemoHelper::GetDefaultTextStyle()); + DemoHelper::DEFAULT_VIEW_STYLE); mRootActor.AddChild( toolBarLayer, TableView::CellPosition( 0, 0 ) ); mRootActor.SetFitHeight( 0 ); @@ -538,20 +517,16 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit image.Add( stencil ); } - TextView text = TextView::New( title ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); - text.SetWidthExceedPolicy( Toolkit::TextView::ShrinkToFit ); - text.SetMultilinePolicy( Toolkit::TextView::SplitByWord ); - text.SetLineJustification( Toolkit::TextView::Center ); - text.SetTextAlignment( Toolkit::Alignment::Type( Alignment::HorizontalCenter | Alignment::VerticalCenter ) ); - text.SetZ( 1 ); - // make the text 90% of tile - text.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS ); - text.SetSizeModeFactor( Vector3( 0.9f, 0.9f, 0.0f ) ); - text.SetStyleToCurrentText( GetTableTextStyle() ); - text.SetSnapshotModeEnabled( false ); - content.Add( text ); + TextLabel label = TextLabel::New(); + label.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + label.SetProperty( Control::Property::STYLE_NAME, "launcherlabel" ); + label.SetProperty( TextLabel::Property::MULTI_LINE, true ); + label.SetProperty( TextLabel::Property::TEXT, title ); + label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); + label.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); + label.SetResizePolicy( FILL_TO_PARENT, HEIGHT ); + label.SetColor( TABLE_TEXT_STYLE_COLOR ); + content.Add( label ); // Set the tile to be keyboard focusable content.SetKeyboardFocusable(true); @@ -780,11 +755,10 @@ void DaliTableView::InitialiseBackgroundActors( Actor actor ) child.SetPosition( childPos ); // Define bubble horizontal parallax and vertical wrapping - Constraint animConstraint = Constraint::New < Vector3 > ( Actor::Property::POSITION, - Source( mScrollView, ScrollView::Property::SCROLL_POSITION ), - Dali::ParentSource( Dali::Actor::Property::SIZE ), - AnimateBubbleConstraint( childPos, Random::Range( -0.85f, 0.25f ), childSize.height ) ); - child.ApplyConstraint( animConstraint ); + Constraint animConstraint = Constraint::New < Vector3 > ( child, Actor::Property::POSITION, AnimateBubbleConstraint( childPos, Random::Range( -0.85f, 0.25f ), childSize.height ) ); + animConstraint.AddSource( Source( mScrollView, ScrollView::Property::SCROLL_POSITION ) ); + animConstraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) ); + animConstraint.Apply(); // Kickoff animation Animation animation = Animation::New( Random::Range( 40.0f, 80.0f ) ); diff --git a/demo/po/as.po b/demo/po/as.po new file mode 100755 index 0000000..8dfe3d0 --- /dev/null +++ b/demo/po/as.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "বেলুন" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "অৱৰুদ্ধ কৰক" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "থুপ" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "ঘনক পৰিৱৰ্তনীয় প্ৰভাৱ" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "পৰিৱৰ্তনীয় প্ৰভাৱ" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "আইটেম দর্শন" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "পৰিবৰ্দ্ধক" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "অস্পষ্ট" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "বিস্তাৰ" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "পৃষ্ঠা লেআউট" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "ৰেডিয়েল নক্সা" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "প্ৰতিফলিত কৰক" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "স্ক্ৰ'ল কৰক" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "ছাঁয়া" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "লিপি" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "প্ৰতিচ্ছবি স্কেল কৰক" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "লেৱেল কৰক" diff --git a/demo/po/de.po b/demo/po/de.po new file mode 100755 index 0000000..e75f9de --- /dev/null +++ b/demo/po/de.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "Schaumbildung" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "Blöcke" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "Cluster" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "Würfel Übergangseffekt" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "Auflösen Übergangseffekt" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "Item-Ansicht" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "Bildschirmlupe" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "Bewegungsunschärfe" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "Bewegung Strecke" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "Seite wechseln" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "Radialmenü" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "Brechung" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "Scroll-Ansicht" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "Licht und Schatten" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "Scripting" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "Bildskalierung" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "Beschriftung" diff --git a/demo/po/en.po b/demo/po/en.po new file mode 100755 index 0000000..a2ec3fa --- /dev/null +++ b/demo/po/en.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "Bubbles" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "Blocks" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "Cluster" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "Cube Transition" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "Dissolve Transition" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "Item View" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "Magnifier" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "Motion Blur" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "Motion Stretch" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "Page Turn View" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "Radial Menu" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "Refraction" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "Scroll View" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "Lights and shadows" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "Script Based UI" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "Image Scaling Modes" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "Text Label" diff --git a/demo/po/en_GB.po b/demo/po/en_GB.po new file mode 100755 index 0000000..a2ec3fa --- /dev/null +++ b/demo/po/en_GB.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "Bubbles" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "Blocks" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "Cluster" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "Cube Transition" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "Dissolve Transition" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "Item View" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "Magnifier" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "Motion Blur" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "Motion Stretch" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "Page Turn View" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "Radial Menu" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "Refraction" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "Scroll View" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "Lights and shadows" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "Script Based UI" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "Image Scaling Modes" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "Text Label" diff --git a/demo/po/en_US.po b/demo/po/en_US.po new file mode 100755 index 0000000..a2ec3fa --- /dev/null +++ b/demo/po/en_US.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "Bubbles" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "Blocks" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "Cluster" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "Cube Transition" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "Dissolve Transition" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "Item View" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "Magnifier" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "Motion Blur" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "Motion Stretch" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "Page Turn View" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "Radial Menu" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "Refraction" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "Scroll View" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "Lights and shadows" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "Script Based UI" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "Image Scaling Modes" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "Text Label" diff --git a/demo/po/es.po b/demo/po/es.po new file mode 100644 index 0000000..179a69e --- /dev/null +++ b/demo/po/es.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "Burbujas" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "Bloques" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "Agrupación" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "Transición cubos" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "Transición disolver" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "Vista de elementos" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "Lupa" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "Desenfoque de movimiento" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "Movimiento con deformación" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "Vista de páginas" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "Menú radial" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "Refracción" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "Vista de desplazamiento" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "Luces y sombras" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "Interfaz definida por Script" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "Modos de escalado de imagen" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "Etiqueta de texto" diff --git a/demo/po/ko.po b/demo/po/ko.po new file mode 100755 index 0000000..78f5987 --- /dev/null +++ b/demo/po/ko.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "방울" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "블록" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "클러스터" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "입방체 전환" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "디졸브 전환" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "아이템 뷰" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "돋보기" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "모션 블러" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "늘이기" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "책장 넘기기" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "레이디 얼 메뉴" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "굴절 효과" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "스크롤 뷰" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "빛과 그림자" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "스크립팅" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "이미지 확대" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "텍스트 라벨" diff --git a/demo/po/ml.po b/demo/po/ml.po new file mode 100755 index 0000000..90049da --- /dev/null +++ b/demo/po/ml.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "കുമിള" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "തടയപ്പെട്ട" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "ക്ലസ്റ്റര്" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "സമചതുരക്കട്ട സംക്രമണ ഇഫക്ട്" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "സ്ഥാനാന്തരം സംക്രമണ ഇഫക്ട്" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "ഇനം കാഴ്ച" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "ഭൂതക്കണ്ണാടി" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "അവ്യക്തമാക്കല്" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "സ്ട്രെച്ച്" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "പേജ് ലേഔട്ട്" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "റേഡിയല് രേഖാചിത്രം" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "പ്രതിഫലിക്കുക" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "സ്ക്രോള്ചെയ്യുക കാഴ്ച" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "നിഴല്" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "സ്ക്രിപ്റ്റ്" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "ഇമേജിംഗ്" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "ലേബലുചെയ്യുക" diff --git a/demo/po/ur.po b/demo/po/ur.po new file mode 100644 index 0000000..b2c3302 --- /dev/null +++ b/demo/po/ur.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "بلبلے" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "اینٹیں" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "کلسٹر" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "کیوب منتقلی" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "حل منتقلی" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "چیزوں کی فہرست" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "مکبر" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "دھندلانے کی حرکت" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "کھینچھنے کی حرکت" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "کتاب" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "ریڈیل مینو" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "رفراکشن" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "سکرول ویو" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "روشنی اور سائے" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "سکرپٹ" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "تصویر پیمائی" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "لیبل" diff --git a/demo/po/zn_CH.po b/demo/po/zn_CH.po new file mode 100755 index 0000000..f136c4b --- /dev/null +++ b/demo/po/zn_CH.po @@ -0,0 +1,50 @@ +msgid "DALI_DEMO_STR_TITLE_BUBBLES" +msgstr "气泡" + +msgid "DALI_DEMO_STR_TITLE_BLOCKS" +msgstr "块体" + +msgid "DALI_DEMO_STR_TITLE_CLUSTER" +msgstr "叢集" + +msgid "DALI_DEMO_STR_TITLE_CUBE_TRANSITION" +msgstr "方块 切换效果" + +msgid "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION" +msgstr "冰消瓦解 切换效果" + +msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW" +msgstr "項目 檢視" + +msgid "DALI_DEMO_STR_TITLE_MAGNIFIER" +msgstr "放大鏡" + +msgid "DALI_DEMO_STR_TITLE_MOTION_BLUR" +msgstr "动作 模糊" + +msgid "DALI_DEMO_STR_TITLE_MOTION_STRETCH" +msgstr "动作 拉伸" + +msgid "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW" +msgstr "页面" + +msgid "DALI_DEMO_STR_TITLE_RADIAL_MENU" +msgstr "射线图" + +msgid "DALI_DEMO_STR_TITLE_REFRACTION" +msgstr "折光" + +msgid "DALI_DEMO_STR_TITLE_SCROLL_VIEW" +msgstr "捲動" + +msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS" +msgstr "阴影" + +msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" +msgstr "指令檔" + +msgid "DALI_DEMO_STR_TITLE_IMAGE_SCALING" +msgstr "图像 制定級數" + +msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL" +msgstr "标签" diff --git a/examples/animated-shapes/animated-shapes-example.cpp b/examples/animated-shapes/animated-shapes-example.cpp index fa98009..5eb6f36 100644 --- a/examples/animated-shapes/animated-shapes-example.cpp +++ b/examples/animated-shapes/animated-shapes-example.cpp @@ -18,6 +18,8 @@ #include #include +#include "shared/view.h" + using namespace Dali; namespace @@ -47,6 +49,8 @@ public: // The Init signal is received once (only) during the Application lifetime void Create( Application& application ) { + DemoHelper::RequestThemeChange(); + // Get a handle to the stage Stage stage = Stage::GetCurrent(); diff --git a/examples/atlas/atlas-example.cpp b/examples/atlas/atlas-example.cpp index bdabc2e..c126da9 100644 --- a/examples/atlas/atlas-example.cpp +++ b/examples/atlas/atlas-example.cpp @@ -209,7 +209,6 @@ private: Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - Toolkit::TextView mTitleActor; ///< The Toolbar's Title. Layer mContentLayer; ///< Content layer (scrolling cluster content) Toolkit::PushButton mLoseContextButton; Atlas mAtlas; diff --git a/examples/blocks/blocks-example.cpp b/examples/blocks/blocks-example.cpp index 5412b0d..9aa0894 100644 --- a/examples/blocks/blocks-example.cpp +++ b/examples/blocks/blocks-example.cpp @@ -73,65 +73,6 @@ const int TOTAL_LEVELS(3); ///< // constraints //////////////////////////////////////////////////////////////// /** - * CollisionConstraint generates a collision vector - * between two actors a and b, assuming they're rectangular - * based on their size. - */ -struct CollisionConstraint -{ - /** - * Collision Constraint constructor - * The adjust (optional) parameter can be used to add a margin - * to the actors. A +ve size will result in larger collisions, - * while a -ve size will result in tighter collisions. - * - * @param[in] adjust (optional) Adjusts the rectangular size detection - */ - CollisionConstraint(Vector3 adjust = Vector3::ZERO) - : mAdjust(adjust) - { - } - - /** - * Generates collision vector indicating whether Actor's A and B - * have overlapped eachother, and the relative position of Actor B to A. - * - * @param[in] current The current collision-property (ignored) - * @param[in] propertyA Actor A's Position property. - * @param[in] propertyB Actor B's Position property. - * @param[in] propertySizeA Actor A's Size property. - * @param[in] propertySizeB Actor B's Size property. - * @return The collision vector is returned. - */ - Vector3 operator()(const Vector3& current, - const PropertyInput& propertyA, - const PropertyInput& propertyB, - const PropertyInput& propertySizeA, - const PropertyInput& propertySizeB) - { - const Vector3& a = propertyA.GetVector3(); - const Vector3& b = propertyB.GetVector3(); - const Vector3& sizeA = propertySizeA.GetVector3(); - const Vector3& sizeB = propertySizeB.GetVector3(); - const Vector3 sizeComb = (sizeA + sizeB + mAdjust) * 0.5f; - - // get collision relative to a. - Vector3 delta = b - a; - - // Check if not overlapping Actors. - if( (fabsf(delta.x) > sizeComb.width) || - (fabsf(delta.y) > sizeComb.height) ) - { - delta = Vector3::ZERO; // not overlapping - } - - return delta; // overlapping, return overlap vector relative to actor a. - } - - const Vector3 mAdjust; ///< Size Adjustment value -}; - -/** * CollisionCircleRectangleConstraint generates a collision vector * between two actors a (circle) and b (rectangle) */ @@ -157,23 +98,20 @@ struct CollisionCircleRectangleConstraint * Generates collision vector indicating whether Actor's A and B * have overlapped eachother, and the relative position of Actor B to A. * - * @param[in] current The current collision-property (ignored) - * @param[in] propertyA Actor A's Position property. - * @param[in] propertyB Actor B's Position property. - * @param[in] propertySizeA Actor A's Size property. - * @param[in] propertySizeB Actor B's Size property. + * @param[in,out] current The current collision-property + * @param[in] inputs Contains: + * Actor A's Position property. + * Actor B's Position property. + * Actor A's Size property. + * Actor B's Size property. * @return The collision vector is returned. */ - Vector3 operator()(const Vector3& current, - const PropertyInput& propertyA, - const PropertyInput& propertyB, - const PropertyInput& propertySizeA, - const PropertyInput& propertySizeB) + void operator()( Vector3& current, const PropertyInputContainer& inputs ) { - const Vector3& a = propertyA.GetVector3(); - const Vector3 b = propertyB.GetVector3() + mAdjustPosition; - const Vector3& sizeA = propertySizeA.GetVector3(); - const Vector3& sizeB = propertySizeB.GetVector3(); + const Vector3& a = inputs[0]->GetVector3(); + const Vector3 b = inputs[1]->GetVector3() + mAdjustPosition; + const Vector3& sizeA = inputs[2]->GetVector3(); + const Vector3& sizeB = inputs[3]->GetVector3(); const Vector3 sizeA2 = sizeA * 0.5f; // circle radius const Vector3 sizeB2 = (sizeB + mAdjustSize) * 0.5f; // rectangle half rectangle. @@ -211,10 +149,12 @@ struct CollisionCircleRectangleConstraint if(delta.Length() < sizeA2.x) { delta.Normalize(); - return delta; + current = delta; + } + else + { + current = Vector3::ZERO; } - - return Vector3::ZERO; } const Vector3 mAdjustPosition; ///< Position Adjustment value @@ -243,20 +183,17 @@ struct WobbleConstraint } /** - * @param[in] current The current rotation property (ignored) - * @param[in] propertyWobble The wobble property (value from 0.0f to 1.0f) + * @param[in,out] current The current rotation property + * @param[in] inputs Contains the wobble property (value from 0.0f to 1.0f) * @return The rotation (quaternion) is generated. */ - Quaternion operator()(const Quaternion& current, - const PropertyInput& propertyWobble) + void operator()( Quaternion& current, const PropertyInputContainer& inputs ) { - const float& wobble = propertyWobble.GetFloat(); + const float& wobble = inputs[0]->GetFloat(); float f = sinf(wobble * 10.0f) * (1.0f-wobble); - Quaternion q(mDeviation * f, Vector3::ZAXIS); - - return q; + current = Quaternion(mDeviation * f, Vector3::ZAXIS); } const float mDeviation; ///< Deviation factor in radians. @@ -289,6 +226,8 @@ public: */ void Create(Application& application) { + DemoHelper::RequestThemeChange(); + Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); // Creates a default view with a default tool bar. @@ -346,10 +285,9 @@ private: mPaddleImage.SetSize( mPaddleFullSize ); mWobbleProperty = mPaddle.RegisterProperty(WOBBLE_PROPERTY_NAME, 0.0f); - Constraint wobbleConstraint = Constraint::New( Actor::Property::ORIENTATION, - LocalSource(mWobbleProperty), - WobbleConstraint(10.0f)); - mPaddle.ApplyConstraint(wobbleConstraint); + Constraint wobbleConstraint = Constraint::New( mPaddle, Actor::Property::ORIENTATION, WobbleConstraint(10.0f)); + wobbleConstraint.AddSource( LocalSource(mWobbleProperty) ); + wobbleConstraint.Apply(); mPaddle.SetPosition( stageSize * Vector3( PADDLE_START_POSITION ) ); mContentLayer.Add(mPaddle); @@ -375,13 +313,12 @@ private: Actor delegate = Actor::New(); stage.Add(delegate); Property::Index property = delegate.RegisterProperty(COLLISION_PROPERTY_NAME, Vector3::ZERO); - Constraint constraint = Constraint::New( property, - Source(mBall, Actor::Property::POSITION), - Source(mPaddle, Actor::Property::POSITION), - Source(mBall, Actor::Property::SIZE), - Source(mPaddle, Actor::Property::SIZE), - CollisionCircleRectangleConstraint( -Vector3(0.0f, mPaddleHitMargin.height * 0.575f, 0.0f),-Vector3(mPaddleHitMargin) )); - delegate.ApplyConstraint(constraint); + Constraint constraint = Constraint::New( delegate, property, CollisionCircleRectangleConstraint( -Vector3(0.0f, mPaddleHitMargin.height * 0.575f, 0.0f),-Vector3(mPaddleHitMargin) ) ); + constraint.AddSource( Source(mBall, Actor::Property::POSITION) ); + constraint.AddSource( Source(mPaddle, Actor::Property::POSITION) ); + constraint.AddSource( Source(mBall, Actor::Property::SIZE) ); + constraint.AddSource( Source(mPaddle, Actor::Property::SIZE) ); + constraint.Apply(); PropertyNotification paddleNotification = delegate.AddPropertyNotification( property, GreaterThanCondition(0.0f) ); paddleNotification.NotifySignal().Connect( this, &ExampleController::OnHitPaddle ); @@ -600,13 +537,12 @@ private: // Add a constraint on the brick between it and the ball generating a collision-property Property::Index property = brick.RegisterProperty(COLLISION_PROPERTY_NAME, Vector3::ZERO); - Constraint constraint = Constraint::New( property, - Source(mBall, Actor::Property::POSITION), - Source(brick, Actor::Property::POSITION), - Source(mBall, Actor::Property::SIZE), - Source(brick, Actor::Property::SIZE), - CollisionCircleRectangleConstraint(BRICK_COLLISION_MARGIN)); - brick.ApplyConstraint(constraint); + Constraint constraint = Constraint::New( brick, property, CollisionCircleRectangleConstraint(BRICK_COLLISION_MARGIN) ); + constraint.AddSource( Source(mBall, Actor::Property::POSITION) ); + constraint.AddSource( Source(brick, Actor::Property::POSITION) ); + constraint.AddSource( Source(mBall, Actor::Property::SIZE) ); + constraint.AddSource( Source(brick, Actor::Property::SIZE) ); + constraint.Apply(); // Now add a notification on this collision-property diff --git a/examples/bubble-effect/bubble-effect-example.cpp b/examples/bubble-effect/bubble-effect-example.cpp index f86daa4..db2a52e 100644 --- a/examples/bubble-effect/bubble-effect-example.cpp +++ b/examples/bubble-effect/bubble-effect-example.cpp @@ -95,6 +95,8 @@ private: // The Init signal is received once (only) during the Application lifetime void Create(Application& app) { + DemoHelper::RequestThemeChange(); + Stage stage = Stage::GetCurrent(); Vector2 stageSize = stage.GetSize(); diff --git a/examples/builder/examples.cpp b/examples/builder/examples.cpp index 41d2162..e00c114 100644 --- a/examples/builder/examples.cpp +++ b/examples/builder/examples.cpp @@ -59,7 +59,7 @@ std::string JSON_BROKEN(" \ 'stage': \ [ \ { \ - 'type':'TextView', \ + 'type':'TextLabel', \ 'size': [50,50,1], \ 'parent-origin': 'CENTER', \ 'text':'COULD NOT LOAD JSON FILE' \ @@ -243,15 +243,12 @@ public: { if(!mTitleActor) { - mTitleActor = TextView::New(); + mTitleActor = DemoHelper::CreateToolBarLabel( "" ); // Add title to the tool bar. mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); } - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + mTitleActor.SetProperty( TextLabel::Property::TEXT, title ); } bool OnToolSelectLayout( Toolkit::Button button ) @@ -396,23 +393,14 @@ public: Actor MenuItem(const std::string& text) { - TextView t = TextView::New(); - t.SetResizePolicy( FILL_TO_PARENT, WIDTH ); - t.SetMarkupProcessingEnabled(true); - - int size = static_cast(DemoHelper::ScalePointSize(6)); - - std::ostringstream fontString; - fontString << ""<< ShortName( text ) << ""; - - t.SetText( fontString.str() ); - - t.SetTextAlignment( Alignment::HorizontalLeft ); + TextLabel label = TextLabel::New( ShortName( text ) ); + label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "builderlabel" ); + label.SetResizePolicy( FILL_TO_PARENT, WIDTH ); // Hook up tap detector - mTapDetector.Attach( t ); + mTapDetector.Attach( label ); - return t; + return label; } bool OnTimer() @@ -516,6 +504,8 @@ public: void Create(Application& app) { + DemoHelper::RequestThemeChange(); + Stage stage = Stage::GetCurrent(); Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleApp::OnKeyEvent); @@ -605,7 +595,7 @@ private: unsigned int mOrientation; Toolkit::ToolBar mToolBar; - TextView mTitleActor; ///< The Toolbar's Title. + TextLabel mTitleActor; ///< The Toolbar's Title. Layer mBuilderLayer; diff --git a/examples/buttons/buttons-example.cpp b/examples/buttons/buttons-example.cpp index d4a03a6..297dbfb 100644 --- a/examples/buttons/buttons-example.cpp +++ b/examples/buttons/buttons-example.cpp @@ -108,6 +108,8 @@ class ButtonsController: public ConnectionTracker { // The Init signal is received once (only) during the Application lifetime + DemoHelper::RequestThemeChange(); + // Respond to key events Stage::GetCurrent().KeyEventSignal().Connect(this, &ButtonsController::OnKeyEvent); @@ -238,8 +240,8 @@ class ButtonsController: public ConnectionTracker tableView.SetSize( DP(260), 0.0f ); tableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT ); - Toolkit::TextView textView = Toolkit::TextView::New( "Select enabled" ); - tableView.AddChild( textView, Toolkit::TableView::CellPosition( 0, 0 ) ); + Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( "Select enabled" ); + tableView.AddChild( textLabel, Toolkit::TableView::CellPosition( 0, 0 ) ); ImageActor imageActor = ImageActor::New( ResourceImage::New( ENABLED_IMAGE ) ); imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); diff --git a/examples/cluster/cluster-example.cpp b/examples/cluster/cluster-example.cpp index 6053b7a..5558b79 100644 --- a/examples/cluster/cluster-example.cpp +++ b/examples/cluster/cluster-example.cpp @@ -183,15 +183,16 @@ struct CarouselEffectOrientationConstraint * @param[in] current The object's current property value * @return The object's new property value */ - Vector2 operator()(const Vector2& current, - const PropertyInput& propertyOrientation) + void operator()( Vector2& current, const PropertyInputContainer& inputs ) { Vector3 axis; float angle; - propertyOrientation.GetQuaternion().ToAxisAngle( axis, angle ); - Vector2 direction( cosf(angle), sinf(angle) ); + inputs[0]->GetQuaternion().ToAxisAngle( axis, angle ); + + current.x = cosf(angle); + current.y = sinf(angle); - return mAngleSweep * direction; + current *= mAngleSweep; } Vector2 mAngleSweep; @@ -220,16 +221,13 @@ struct ShearEffectConstraint } /** - * @param[in] current The current shear effect Angle. - * @param[in] scrollOvershootProperty The overshoot property from ScrollView - * @param[in] propertyViewOrientation The orientation of the view e.g. Portrait, Landscape. + * @param[in,out] current The current shear effect Angle. + * @param[in] inputs Contains the overshoot property from ScrollView and the orientation of the view e.g. Portrait, Landscape. * @return angle to provide ShearShaderEffect */ - float operator()(const float& current, - const PropertyInput& scrollOvershootProperty, - const PropertyInput& propertyViewOrientation) + void operator()( float& current, const PropertyInputContainer& inputs ) { - float f = scrollOvershootProperty.GetVector3().x; + float f = inputs[0]->GetVector3().x; float mag = fabsf(f); float halfWidth = mStageSize.x * 0.5f; @@ -245,11 +243,11 @@ struct ShearEffectConstraint // the component mask passed in. Vector3 axis; float angle; - propertyViewOrientation.GetQuaternion().ToAxisAngle( axis, angle ); + inputs[1]->GetQuaternion().ToAxisAngle( axis, angle ); Vector2 direction( cosf(angle), sinf(angle) ); float yield = direction.x * mComponentMask.x + direction.y * mComponentMask.y; - return overshoot * mMaxOvershoot * yield; + current = overshoot * mMaxOvershoot * yield; } Vector2 mStageSize; @@ -276,15 +274,15 @@ struct ShearEffectCenterConstraint } /** - * @param[in] current The current center - * @param[in] propertyViewSize The current view size + * @param[in,out] current The current center + * @param[in] inputs Contains the current view size * @return vector to provide ShearShaderEffect */ - Vector2 operator()(const Vector2& current, - const PropertyInput& propertyViewSize) + void operator()( Vector2& current, const PropertyInputContainer& inputs ) { - float f = propertyViewSize.GetVector3().width / mStageSize.width; - return Vector2( f * mCenter.x, mCenter.y ); + float f = inputs[0]->GetVector3().width / mStageSize.width; + current.x = f * mCenter.x; + current.y = mCenter.y; } Vector2 mStageSize; @@ -313,9 +311,9 @@ struct SphereEffectOffsetConstraint * @param[in] propertyViewSize The current view size * @return vector to provide SphereShaderEffect */ - float operator()(const float& current) + void operator()( float& current, const PropertyInputContainer& /* inputs */ ) { - return current + mOffset; + current += mOffset; } float mOffset; @@ -375,11 +373,11 @@ struct ClusterInfo } - Cluster mCluster; ///< Cluster instance - int mIndex; ///< Cluster index - Vector3 mPosition; ///< Cluster original position - Vector3 mSize; ///< Cluster original size - ActiveConstraint mEffectConstraint; ///< Cluster constraint + Cluster mCluster; ///< Cluster instance + int mIndex; ///< Cluster index + Vector3 mPosition; ///< Cluster original position + Vector3 mSize; ///< Cluster original size + Constraint mEffectConstraint; ///< Cluster constraint }; /** @@ -447,6 +445,8 @@ public: */ void Create(Application& application) { + DemoHelper::RequestThemeChange(); + Stage::GetCurrent().KeyEventSignal().Connect(this, &ClusterController::OnKeyEvent); Vector2 stageSize = Stage::GetCurrent().GetSize(); @@ -689,7 +689,7 @@ public: RemoveShaderEffectRecursively( cluster ); if( i->mEffectConstraint ) { - cluster.RemoveConstraint(i->mEffectConstraint); + i->mEffectConstraint.Remove(); i->mEffectConstraint.Reset(); } } @@ -719,10 +719,10 @@ public: Vector2 shearCenter( Vector2(position.x + size.width * shearAnchor.x, position.y + size.height * shearAnchor.y) ); Property::Index centerProperty = shaderEffect.GetPropertyIndex(shaderEffect.GetCenterPropertyName()); - Constraint constraint = Constraint::New( centerProperty, - Source(mView, Actor::Property::SIZE), - ShearEffectCenterConstraint(stageSize, shearCenter) ); - shaderEffect.ApplyConstraint(constraint); + Constraint constraint = Constraint::New( shaderEffect, centerProperty, ShearEffectCenterConstraint(stageSize, shearCenter) ); + constraint.AddSource( Source(mView, Actor::Property::SIZE) ); + + constraint.Apply(); SetShaderEffectRecursively( cluster,shaderEffect ); @@ -731,16 +731,15 @@ public: Property::Index angleXAxisProperty = shaderEffect.GetPropertyIndex(shaderEffect.GetAngleXAxisPropertyName()); Property::Index angleYAxisProperty = shaderEffect.GetPropertyIndex(shaderEffect.GetAngleYAxisPropertyName()); - constraint = Constraint::New( angleXAxisProperty, - Source(mScrollView, scrollOvershootProperty), - Source(mView, Actor::Property::ORIENTATION), - ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::XAXIS) ); - shaderEffect.ApplyConstraint(constraint); - constraint = Constraint::New( angleYAxisProperty, - Source(mScrollView, scrollOvershootProperty), - Source(mView, Actor::Property::ORIENTATION), - ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::YAXIS) ); - shaderEffect.ApplyConstraint(constraint); + constraint = Constraint::New( shaderEffect, angleXAxisProperty, ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::XAXIS) ); + constraint.AddSource( Source(mScrollView, scrollOvershootProperty) ); + constraint.AddSource( Source(mView, Actor::Property::ORIENTATION) ); + constraint.Apply(); + + constraint = Constraint::New( shaderEffect, angleYAxisProperty, ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::YAXIS ) ); + constraint.AddSource( Source(mScrollView, scrollOvershootProperty) ); + constraint.AddSource( Source(mView, Actor::Property::ORIENTATION) ); + constraint.Apply(); } @@ -764,9 +763,9 @@ public: CAROUSEL_EFFECT_ANGLE_SWEEP / stageSize.width ); Property::Index anglePerUnit = shaderEffect.GetPropertyIndex( shaderEffect.GetAnglePerUnitPropertyName() ); - shaderEffect.ApplyConstraint( Constraint::New( anglePerUnit, - Source(mView, Actor::Property::ORIENTATION), - CarouselEffectOrientationConstraint( angleSweep ) ) ); + Constraint constraint = Constraint::New( shaderEffect, anglePerUnit, CarouselEffectOrientationConstraint( angleSweep ) ); + constraint.AddSource( Source(mView, Actor::Property::ORIENTATION) ); + constraint.Apply(); break; } @@ -792,11 +791,11 @@ public: // dont apply shader effect to scrollview as it might override internal shaders for bounce effect etc for( std::vector::iterator i = mClusterInfo.begin(); i != mClusterInfo.end(); ++i ) { - Constraint constraint = Constraint::New(Actor::Property::POSITION_Z, SphereEffectOffsetConstraint(SPHERE_EFFECT_POSITION_Z)); - constraint.SetRemoveAction(Constraint::Discard); Cluster cluster = i->mCluster; + i->mEffectConstraint = Constraint::New( cluster, Actor::Property::POSITION_Z, SphereEffectOffsetConstraint( SPHERE_EFFECT_POSITION_Z ) ); + i->mEffectConstraint.SetRemoveAction(Constraint::Discard); SetShaderEffectRecursively( cluster, shaderEffect ); - i->mEffectConstraint = cluster.ApplyConstraint(constraint); + i->mEffectConstraint.Apply(); } break; } @@ -825,15 +824,13 @@ public: { if(!mTitleActor) { - mTitleActor = TextView::New(); + mTitleActor = DemoHelper::CreateToolBarLabel( "" ); + // Add title to the tool bar. mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); } - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + mTitleActor.SetProperty( TextLabel::Property::TEXT, title ); } /** @@ -855,7 +852,7 @@ private: Application& mApplication; ///< Application instance Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - TextView mTitleActor; ///< The Toolbar's Title. + TextLabel mTitleActor; ///< The Toolbar's Title. Layer mContentLayer; ///< Content layer (scrolling cluster content) diff --git a/examples/cube-transition-effect/cube-transition-effect-example.cpp b/examples/cube-transition-effect/cube-transition-effect-example.cpp index aa146e6..cd0e389 100644 --- a/examples/cube-transition-effect/cube-transition-effect-example.cpp +++ b/examples/cube-transition-effect/cube-transition-effect-example.cpp @@ -26,6 +26,8 @@ using namespace Dali; +using Dali::Toolkit::TextLabel; + // LOCAL STUFF namespace { @@ -173,7 +175,7 @@ private: Toolkit::View mView; Toolkit::ToolBar mToolBar; Layer mContent; - Toolkit::TextView mTitleActor; + Toolkit::TextLabel mTitleActor; Actor mParent; Vector2 mViewSize; @@ -221,6 +223,8 @@ CubeTransitionApp::~CubeTransitionApp() void CubeTransitionApp::OnInit( Application& application ) { + DemoHelper::RequestThemeChange(); + Stage::GetCurrent().KeyEventSignal().Connect(this, &CubeTransitionApp::OnKeyEvent); // Creates a default view with a default tool bar, the view is added to the stage. @@ -236,7 +240,7 @@ void CubeTransitionApp::OnInit( Application& application ) mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Add title to the tool bar. - mTitleActor = Toolkit::TextView::New(); + mTitleActor = DemoHelper::CreateToolBarLabel( APPLICATION_TITLE_WAVE ); mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); //Add an slideshow icon on the right of the title @@ -290,11 +294,6 @@ void CubeTransitionApp::OnInit( Application& application ) mCurrentEffect = mCubeWaveEffect; mCurrentEffect.SetCurrentImage( mCurrentImage ); - - // Set Title text - mTitleActor.SetText( APPLICATION_TITLE_WAVE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_WAVE ) ); - mTitleActor.SetStyleToCurrentText( DemoHelper::GetDefaultTextStyle() ); } // signal handler, called when the pan gesture is detected @@ -359,26 +358,22 @@ bool CubeTransitionApp::OnEffectButtonClicked( Toolkit::Button button ) if(mCurrentEffect == mCubeWaveEffect) { mCurrentEffect = mCubeCrossEffect; - mTitleActor.SetText( APPLICATION_TITLE_CROSS ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_CROSS ) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_CROSS) ); mEffectChangeButton.SetBackgroundImage(mImageCross); } else if(mCurrentEffect == mCubeCrossEffect) { mCurrentEffect = mCubeFoldEffect; - mTitleActor.SetText( APPLICATION_TITLE_FOLD ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_FOLD ) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_FOLD) ); mEffectChangeButton.SetBackgroundImage(mImageFold); } else { mCurrentEffect = mCubeWaveEffect; - mTitleActor.SetText( APPLICATION_TITLE_WAVE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_WAVE ) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_WAVE) ); mEffectChangeButton.SetBackgroundImage(mImageWave); } - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); // Set the current image to cube transition effect // only need to set at beginning or change from another effect diff --git a/examples/dissolve-effect/dissolve-effect-example.cpp b/examples/dissolve-effect/dissolve-effect-example.cpp index 8d0f90f..93b96ad 100644 --- a/examples/dissolve-effect/dissolve-effect-example.cpp +++ b/examples/dissolve-effect/dissolve-effect-example.cpp @@ -26,6 +26,8 @@ using namespace Dali; +using Dali::Toolkit::TextLabel; + // LOCAL STUFF namespace { @@ -157,7 +159,7 @@ private: Toolkit::View mView; Toolkit::ToolBar mToolBar; Layer mContent; - Toolkit::TextView mTitleActor; + Toolkit::TextLabel mTitleActor; Actor mParent; ImageActor mCurrentImage; @@ -205,6 +207,8 @@ DissolveEffectApp::~DissolveEffectApp() void DissolveEffectApp::OnInit( Application& application ) { + DemoHelper::RequestThemeChange(); + Stage::GetCurrent().KeyEventSignal().Connect(this, &DissolveEffectApp::OnKeyEvent); // Creates a default view with a default tool bar, the view is added to the stage. @@ -219,9 +223,7 @@ void DissolveEffectApp::OnInit( Application& application ) mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Add title to the tool bar. - mTitleActor = Toolkit::TextView::New(); - mTitleActor.SetText( APPLICATION_TITLE_HIGHP ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + mTitleActor = DemoHelper::CreateToolBarLabel( APPLICATION_TITLE_HIGHP ); mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); // Add an slide-show button on the right of the title @@ -340,15 +342,14 @@ bool DissolveEffectApp::OnEffectButtonClicked( Toolkit::Button button ) mCurrentImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision); if(mUseHighPrecision) { - mTitleActor.SetText( APPLICATION_TITLE_HIGHP ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_HIGHP) ); mEffectChangeButton.SetBackgroundImage(mIconHighP); } else { - mTitleActor.SetText( APPLICATION_TITLE_MEDIUMP ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_MEDIUMP) ); mEffectChangeButton.SetBackgroundImage(mIconMediumP); } - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); return true; } diff --git a/examples/hello-world/hello-world-example.cpp b/examples/hello-world/hello-world-example.cpp index 3685333..9dea8ac 100644 --- a/examples/hello-world/hello-world-example.cpp +++ b/examples/hello-world/hello-world-example.cpp @@ -15,10 +15,10 @@ * */ -#include -#include +#include using namespace Dali; +using Dali::Toolkit::TextLabel; // This example shows how to create and display Hello World! using a simple TextActor // @@ -29,8 +29,6 @@ public: HelloWorldController( Application& application ) : mApplication( application ) { - std::cout << "HelloWorldController::HelloWorldController" << std::endl; - // Connect to the Application's Init signal mApplication.InitSignal().Connect( this, &HelloWorldController::Create ); } @@ -43,19 +41,13 @@ public: // The Init signal is received once (only) during the Application lifetime void Create( Application& application ) { - std::cout << "HelloWorldController::Create" << std::endl; - - // Initialize the actor - TextActor textActor = TextActor::New( "Hello World" ); - - // Reposition the actor - textActor.SetParentOrigin( ParentOrigin::CENTER ); - // Get a handle to the stage Stage stage = Stage::GetCurrent(); - // Display the actor on the stage - stage.Add( textActor ); + TextLabel textLabel = TextLabel::New( "Hello World" ); + textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + textLabel.SetName( "hello-world-label" ); + stage.Add( textLabel ); // Respond to a click anywhere on the stage stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch ); diff --git a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp index 3b9e0df..17ceccd 100644 --- a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp +++ b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp @@ -291,6 +291,8 @@ public: { std::cout << "ImageScalingScaleToFillController::Create" << std::endl; + DemoHelper::RequestThemeChange(); + // Get a handle to the stage: Stage stage = Stage::GetCurrent(); @@ -539,15 +541,12 @@ public: { if(!mTitleActor) { - mTitleActor = TextView::New(); + mTitleActor = DemoHelper::CreateToolBarLabel( "" ); // Add title to the tool bar. mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); } - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + mTitleActor.SetProperty( TextLabel::Property::TEXT, title ); } /** @@ -576,7 +575,7 @@ private: Layer mContentLayer; ///< The content layer (contains non gui chrome actors) Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - TextView mTitleActor; ///< The Toolbar's Title. + TextLabel mTitleActor; ///< The Toolbar's Title. Actor mGridActor; ///< The container for the grid of images ScrollView mScrollView; ///< ScrollView UI Component bool mScrolling; ///< ScrollView scrolling state (true = scrolling, false = stationary) diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index 54c49af..448735c 100644 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -160,12 +160,6 @@ const float BUTTON_BORDER = -10.0f; const float MENU_OPTION_HEIGHT(140.0f); const float LABEL_TEXT_SIZE_Y = 20.0f; -const char* DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNue"); -const char* DEFAULT_TEXT_STYLE_FONT_STYLE("Regular"); -const PointSize DEFAULT_TEXT_STYLE_POINT_SIZE( 5.0f ); -const TextStyle::Weight DEFAULT_TEXT_STYLE_WEIGHT(Dali::TextStyle::MEDIUM); -const Vector4 DEFAULT_TEXT_STYLE_COLOR(1.0f, 1.0f, 1.0f, 1.0f); - const Vector3 INITIAL_OFFSCREEN_POSITION( 1000.0f, 0, -1000.0f ); static Vector3 DepthLayoutItemSizeFunctionPortrait(unsigned int numberOfColumns, float layoutWidth) @@ -240,6 +234,8 @@ public: */ void OnInit(Application& app) { + DemoHelper::RequestThemeChange(); + Stage stage = Dali::Stage::GetCurrent(); stage.KeyEventSignal().Connect(this, &ItemViewExample::OnKeyEvent); @@ -972,15 +968,12 @@ private: { if(!mTitleActor) { - mTitleActor = TextView::New(); + mTitleActor = DemoHelper::CreateToolBarLabel( "" ); // Add title to the tool bar. mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); } - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + mTitleActor.SetProperty( TextLabel::Property::TEXT, title ); } void ShowMenu() @@ -1008,30 +1001,20 @@ private: slider.ValueChangedSignal().Connect( this, &ItemViewExample::SliderValueChange ); tableView.AddChild( slider, TableView::CellPosition( 0, 0 ) ); - TextStyle defaultTextStyle; - defaultTextStyle.SetFontName(DEFAULT_TEXT_STYLE_FONT_FAMILY); - defaultTextStyle.SetFontStyle(DEFAULT_TEXT_STYLE_FONT_STYLE); - defaultTextStyle.SetFontPointSize(DEFAULT_TEXT_STYLE_POINT_SIZE); - defaultTextStyle.SetWeight(DEFAULT_TEXT_STYLE_WEIGHT); - defaultTextStyle.SetTextColor(DEFAULT_TEXT_STYLE_COLOR); - - TextView text = TextView::New( "Duration" ); + TextLabel text = TextLabel::New( "Duration" ); text.SetAnchorPoint( ParentOrigin::TOP_LEFT ); text.SetParentOrigin( ParentOrigin::TOP_LEFT ); - text.SetTextAlignment( Dali::Toolkit::Alignment::HorizontalLeft ); - text.SetStyleToCurrentText( defaultTextStyle ); text.SetResizePolicy( FILL_TO_PARENT, WIDTH ); - text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y ); - text.SetZ( -0.9f ); + text.SetResizePolicy( FIXED, HEIGHT ); + text.SetSize( Vector2( 0.0f, LABEL_TEXT_SIZE_Y ) ); slider.Add( text ); Actor textContainer = Actor::New(); textContainer.SetRelayoutEnabled( true ); textContainer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - mAlphaFunctionText = TextView::New( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] ); + mAlphaFunctionText = TextLabel::New( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] ); mAlphaFunctionText.SetAnchorPoint( ParentOrigin::CENTER ); mAlphaFunctionText.SetParentOrigin( ParentOrigin::CENTER ); - mAlphaFunctionText.SetTextAlignment( Toolkit::Alignment::VerticalCenter ); textContainer.Add( mAlphaFunctionText ); tableView.AddChild( textContainer, TableView::CellPosition( 1, 0 ) ); @@ -1039,11 +1022,9 @@ private: mTapDetector.Attach(mAlphaFunctionText); mTapDetector.DetectedSignal().Connect( this, &ItemViewExample::ChangeAlphaFunctionOnTap ); - text = TextView::New( "Alpha Function" ); + text = TextLabel::New( "Alpha Function" ); text.SetAnchorPoint( ParentOrigin::TOP_LEFT ); text.SetParentOrigin( ParentOrigin::TOP_LEFT ); - text.SetTextAlignment( Dali::Toolkit::Alignment::HorizontalLeft ); - text.SetStyleToCurrentText( defaultTextStyle ); text.SetResizePolicy( FILL_TO_PARENT, WIDTH ); text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y ); textContainer.Add( text ); @@ -1069,7 +1050,7 @@ private: if( mAlphaFunctionText ) { - mAlphaFunctionText.SetText( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] ); + mAlphaFunctionText.SetProperty( TextLabel::Property::TEXT, std::string(ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex]) ); } if( mItemView ) @@ -1133,7 +1114,7 @@ private: unsigned int mOrientation; Toolkit::ToolBar mToolBar; - TextView mTitleActor; ///< The Toolbar's Title. + TextLabel mTitleActor; ///< The Toolbar's Title. ItemView mItemView; Image mBorderImage; @@ -1154,7 +1135,7 @@ private: Toolkit::PushButton mReplaceButton; unsigned int mAlphaFuncIndex; - TextView mAlphaFunctionText; + TextLabel mAlphaFunctionText; BufferImage mWhiteImage; }; diff --git a/examples/logging/logging-example.cpp b/examples/logging/logging-example.cpp index 0c44ed1..184deb2 100644 --- a/examples/logging/logging-example.cpp +++ b/examples/logging/logging-example.cpp @@ -156,6 +156,8 @@ class LoggingController: public ConnectionTracker { // The Init signal is received once (only) during the Application lifetime + DemoHelper::RequestThemeChange(); + mCurrentLogger = 0; mPerformanceLoggers.reserve( NUM_LOGGERS ); mPerformanceLoggers.resize( NUM_LOGGERS ); @@ -198,7 +200,7 @@ class LoggingController: public ConnectionTracker // Label { - Toolkit::TextView label = Toolkit::TextView::New( LOGGER_TEXT ); + Toolkit::TextLabel label = Toolkit::TextLabel::New( LOGGER_TEXT ); label.SetParentOrigin( ParentOrigin::TOP_LEFT ); label.SetAnchorPoint( AnchorPoint::TOP_LEFT ); label.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) ); @@ -431,7 +433,7 @@ class LoggingController: public ConnectionTracker // Label { - Toolkit::TextView label = Toolkit::TextView::New( FREQUENCY_TEXT ); + Toolkit::TextLabel label = Toolkit::TextLabel::New( FREQUENCY_TEXT ); label.SetParentOrigin( ParentOrigin::TOP_LEFT ); label.SetAnchorPoint( AnchorPoint::TOP_LEFT ); label.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) ); @@ -541,16 +543,9 @@ class LoggingController: public ConnectionTracker << ", " << ((mLoggerStates[i].isTiming) ? "Started" : "Stopped") << ", " << ((mLoggerStates[i].isEnabled) ? "Enabled" : "Disabled"); - Dali::TextStyle textStyle; - textStyle.SetFontName( "HelveticaNue" ); - textStyle.SetFontStyle( "Regular" ); - textStyle.SetFontPointSize( Dali::PointSize( DemoHelper::ScalePointSize( 7.0f ) ) ); - textStyle.SetWeight( Dali::TextStyle::REGULAR ); - - Toolkit::TextView textView = Toolkit::TextView::New( ss.str() ); - textView.SetStyleToCurrentText( textStyle ); + Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( ss.str() ); - mLogRadioButtons[i].SetLabel( textView ); + mLogRadioButtons[i].SetLabel( textLabel ); } } diff --git a/examples/magnifier/magnifier-example.cpp b/examples/magnifier/magnifier-example.cpp index f28529b..4c8ea21 100644 --- a/examples/magnifier/magnifier-example.cpp +++ b/examples/magnifier/magnifier-example.cpp @@ -57,20 +57,16 @@ struct MagnifierPathConstraint { } - Vector3 operator()(const Vector3& current, - const PropertyInput& sizeProperty, - const PropertyInput& animationTimeProperty) + void operator()( Vector3& current, const PropertyInputContainer& inputs ) { - float time = animationTimeProperty.GetFloat(); - const Vector3& size = sizeProperty.GetVector3(); + float time = inputs[1]->GetFloat(); + const Vector3& size = inputs[0]->GetVector3(); - Vector3 range(mStageSize - size - Vector3::ONE * MAGNIFIER_INDENT * 2.0f); - Vector3 position(mOffset); + current = mOffset; - position.x += 0.5f * sinf(time * 0.471f) * range.width; - position.y += 0.5f * sinf(time * 0.8739f) * range.height; - - return position; + Vector3 range( mStageSize - size - Vector3::ONE * MAGNIFIER_INDENT * 2.0f ); + current.x += 0.5f * sinf(time * 0.471f) * range.width; + current.y += 0.5f * sinf(time * 0.8739f) * range.height; } Vector3 mStageSize; ///< Keep track of the stage size for determining path within stage bounds @@ -103,23 +99,19 @@ struct ConfinementConstraint { } - Vector3 operator()(const Vector3& constPosition, - const PropertyInput& sizeProperty, - const PropertyInput& parentOriginProperty, - const PropertyInput& anchorPointProperty, - const PropertyInput& referenceSizeProperty) + void operator()( Vector3& current, const PropertyInputContainer& inputs ) { - const Vector3& size = sizeProperty.GetVector3(); - const Vector3 origin = parentOriginProperty.GetVector3(); - const Vector3& anchor = anchorPointProperty.GetVector3(); - const Vector3& referenceSize = referenceSizeProperty.GetVector3(); + const Vector3& size = inputs[0]->GetVector3(); + const Vector3 origin = inputs[1]->GetVector3(); + const Vector3& anchor = inputs[2]->GetVector3(); + const Vector3& referenceSize = inputs[3]->GetVector3(); Vector3 offset(mOffsetOrigin * referenceSize); - Vector3 newPosition( constPosition + offset ); - // Get actual position of Actor relative to parent's Top-Left. - Vector3 position(constPosition + offset + origin * referenceSize); + Vector3 position(current + offset + origin * referenceSize); + + current += offset; // if top-left corner is outside of Top-Left bounds, then push back in screen. Vector3 corner(position - size * anchor - mMinIndent); @@ -127,17 +119,17 @@ struct ConfinementConstraint if(mFlipHorizontal && corner.x < 0.0f) { corner.x = 0.0f; - newPosition.x += size.width; + current.x += size.width; } if(mFlipVertical && corner.y < 0.0f) { corner.y = 0.0f; - newPosition.y += size.height; + current.y += size.height; } - newPosition.x -= std::min(corner.x, 0.0f); - newPosition.y -= std::min(corner.y, 0.0f); + current.x -= std::min(corner.x, 0.0f); + current.y -= std::min(corner.y, 0.0f); // if bottom-right corner is outside of Bottom-Right bounds, then push back in screen. corner += size - referenceSize + mMinIndent + mMaxIndent; @@ -145,19 +137,17 @@ struct ConfinementConstraint if(mFlipHorizontal && corner.x > 0.0f) { corner.x = 0.0f; - newPosition.x -= size.width; + current.x -= size.width; } if(mFlipVertical && corner.y > 0.0f) { corner.y = 0.0f; - newPosition.y -= size.height; + current.y -= size.height; } - newPosition.x -= std::max(corner.x, 0.0f); - newPosition.y -= std::max(corner.y, 0.0f); - - return newPosition; + current.x -= std::max(corner.x, 0.0f); + current.y -= std::max(corner.y, 0.0f); } Vector3 mOffsetOrigin; ///< Manual Parent Offset Origin. @@ -203,6 +193,8 @@ public: */ void Create( Application& application ) { + DemoHelper::RequestThemeChange(); + Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); mStageSize = Stage::GetCurrent().GetSize(); @@ -242,14 +234,13 @@ public: overlay.Add( mMagnifier ); // Apply constraint to animate the position of the magnifier. - Constraint constraint = Constraint::New(Actor::Property::POSITION, - LocalSource(Actor::Property::SIZE), - LocalSource(Actor::Property::PARENT_ORIGIN), - LocalSource(Actor::Property::ANCHOR_POINT), - ParentSource(Actor::Property::SIZE), - ConfinementConstraint(ParentOrigin::CENTER, Vector2::ONE * MAGNIFIER_INDENT, Vector2::ONE * MAGNIFIER_INDENT)); + Constraint constraint = Constraint::New( mMagnifier, Actor::Property::POSITION, ConfinementConstraint(ParentOrigin::CENTER, Vector2::ONE * MAGNIFIER_INDENT, Vector2::ONE * MAGNIFIER_INDENT) ); + constraint.AddSource( LocalSource(Actor::Property::SIZE) ); + constraint.AddSource( LocalSource(Actor::Property::PARENT_ORIGIN) ); + constraint.AddSource( LocalSource(Actor::Property::ANCHOR_POINT) ); + constraint.AddSource( ParentSource(Actor::Property::SIZE) ); constraint.SetRemoveAction(Constraint::Discard); - mMagnifier.ApplyConstraint( constraint ); + constraint.Apply(); // Create bouncing magnifier automatically bounces around screen. mBouncingMagnifier = Toolkit::Magnifier::New(); @@ -263,18 +254,16 @@ public: ContinueAnimation(); // Apply constraint to animate the position of the magnifier. - constraint = Constraint::New(Actor::Property::POSITION, - LocalSource(Actor::Property::SIZE), - LocalSource(mAnimationTimeProperty), - MagnifierPathConstraint(mStageSize, mStageSize * 0.5f)); - mBouncingMagnifier.ApplyConstraint( constraint ); + constraint = Constraint::New( mBouncingMagnifier, Actor::Property::POSITION, MagnifierPathConstraint(mStageSize, mStageSize * 0.5f) ); + constraint.AddSource( LocalSource(Actor::Property::SIZE) ); + constraint.AddSource( LocalSource(mAnimationTimeProperty) ); + constraint.Apply(); // Apply constraint to animate the source of the magnifier. - constraint = Constraint::New(mBouncingMagnifier.GetPropertyIndex( Toolkit::Magnifier::SOURCE_POSITION_PROPERTY_NAME ), - LocalSource(Actor::Property::SIZE), - LocalSource(mAnimationTimeProperty), - MagnifierPathConstraint(mStageSize)); - mBouncingMagnifier.ApplyConstraint( constraint ); + constraint = Constraint::New( mBouncingMagnifier, mBouncingMagnifier.GetPropertyIndex( Toolkit::Magnifier::SOURCE_POSITION_PROPERTY_NAME ), MagnifierPathConstraint(mStageSize) ); + constraint.AddSource( LocalSource(Actor::Property::SIZE) ); + constraint.AddSource( LocalSource(mAnimationTimeProperty) ); + constraint.Apply(); } /** diff --git a/examples/motion-blur/motion-blur-example.cpp b/examples/motion-blur/motion-blur-example.cpp index 2e695b4..b1528af 100644 --- a/examples/motion-blur/motion-blur-example.cpp +++ b/examples/motion-blur/motion-blur-example.cpp @@ -509,7 +509,6 @@ private: Application& mApplication; ///< Application instance Toolkit::View mView; Toolkit::ToolBar mToolBar; - TextView mTitleActor; ///< The Toolbar's Title. Image mIconEffectsOff; Image mIconEffectsOn; diff --git a/examples/motion-stretch/motion-stretch-example.cpp b/examples/motion-stretch/motion-stretch-example.cpp index 7d22589..98a8380 100644 --- a/examples/motion-stretch/motion-stretch-example.cpp +++ b/examples/motion-stretch/motion-stretch-example.cpp @@ -124,6 +124,8 @@ public: { // The Init signal is received once (only) during the Application lifetime + DemoHelper::RequestThemeChange(); + Stage::GetCurrent().KeyEventSignal().Connect(this, &MotionStretchExampleApp::OnKeyEvent); // Creates a default view with a default tool bar. @@ -400,7 +402,6 @@ private: Application& mApplication; ///< Application instance Toolkit::View mView; Toolkit::ToolBar mToolBar; - TextView mTitleActor; ///< The Toolbar's Title. Image mIconEffectsOff; Image mIconEffectsOn; Layer mContentLayer; ///< Content layer (contains actor for this stretch demo) diff --git a/examples/new-window/new-window-example.cpp b/examples/new-window/new-window-example.cpp index 3d4f72d..877aa2d 100644 --- a/examples/new-window/new-window-example.cpp +++ b/examples/new-window/new-window-example.cpp @@ -80,7 +80,7 @@ public: private: Application mApplication; Actor mCastingLight; - TextActor mTextActor; + TextLabel mTextActor; ImageActor mImageActor; ImageActor mBlendActor; Image mEffectImage; @@ -90,7 +90,7 @@ private: Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - TextView mTitleActor; ///< The Toolbar's Title. + TextLabel mTitleActor; ///< The Toolbar's Title. Layer mContentLayer; ///< Content layer (scrolling cluster content) Toolkit::PushButton mLoseContextButton; Vector3 mHSVDelta; @@ -116,6 +116,8 @@ NewWindowController::NewWindowController( Application& application ) void NewWindowController::Create( Application& app ) { + DemoHelper::RequestThemeChange(); + Stage stage = Stage::GetCurrent(); stage.SetBackgroundColor(Color::YELLOW); @@ -379,7 +381,7 @@ void NewWindowController::CreateBlending() void NewWindowController::CreateText() { - mTextActor = TextActor::New("Some text"); + mTextActor = TextLabel::New("Some text"); mTextActor.SetParentOrigin(ParentOrigin::CENTER); mTextActor.SetColor(Color::RED); mTextActor.SetName("PushMe text"); diff --git a/examples/page-turn-view/page-turn-view-example.cpp b/examples/page-turn-view/page-turn-view-example.cpp index 8f5d147..33498cd 100644 --- a/examples/page-turn-view/page-turn-view-example.cpp +++ b/examples/page-turn-view/page-turn-view-example.cpp @@ -22,6 +22,8 @@ #include #include +#include "shared/view.h" + using namespace Dali; using namespace Dali::Toolkit; @@ -226,6 +228,8 @@ void PageTurnController::OnInit( Application& app ) { // The Init signal is received once ( only ) during the Application lifetime + DemoHelper::RequestThemeChange(); + Stage::GetCurrent().KeyEventSignal().Connect(this, &PageTurnController::OnKeyEvent); Stage stage = Stage::GetCurrent(); diff --git a/examples/path-animation/path-animation.cpp b/examples/path-animation/path-animation.cpp index c602254..369f0b0 100644 --- a/examples/path-animation/path-animation.cpp +++ b/examples/path-animation/path-animation.cpp @@ -64,9 +64,10 @@ public: */ Actor CreateVectorComponentControl( const std::string& label, const Vector3& size, bool(PathController::*callback)(Slider,float) ) { - Dali::TextActor textActor = TextActor::New(label); - textActor.SetColor( Vector4(0.0f,0.0f,0.0f,1.0f)); - textActor.SetSize(size.y,size.y,0.0f); + TextLabel text = TextLabel::New(label); + text.SetResizePolicy( USE_NATURAL_SIZE, WIDTH ); + text.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT ); + text.SetColor( Vector4(0.0f,0.0f,0.0f,1.0f)); Slider slider = Slider::New(); slider.SetRelayoutEnabled( false ); @@ -88,8 +89,8 @@ public: slider.SetSize(size); slider.SetScale( 0.5f ); slider.ValueChangedSignal().Connect(this,callback); - textActor.Add( slider ); - return textActor; + text.Add( slider ); + return text; } /** @@ -437,6 +438,8 @@ public: */ void Create( Application& application ) { + DemoHelper::RequestThemeChange(); + // Get a handle to the stage: Stage stage = Stage::GetCurrent(); @@ -456,12 +459,8 @@ public: mContentLayer.TouchedSignal().Connect(this, &PathController::OnTouchLayer); //Title - TextView title = TextView::New(); + TextLabel title = DemoHelper::CreateToolBarLabel( APPLICATION_TITLE ); toolBar.AddControl( title, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); - Font font = Font::New(); - title.SetText( APPLICATION_TITLE ); - title.SetSize( font.MeasureText( APPLICATION_TITLE ) ); - title.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); //Path mPath = Dali::Path::New(); diff --git a/examples/radial-menu/radial-menu-example.cpp b/examples/radial-menu/radial-menu-example.cpp index 40bf308..028265a 100644 --- a/examples/radial-menu/radial-menu-example.cpp +++ b/examples/radial-menu/radial-menu-example.cpp @@ -121,6 +121,8 @@ RadialMenuExample::~RadialMenuExample() void RadialMenuExample::OnInit(Application& app) { + DemoHelper::RequestThemeChange(); + Stage stage = Dali::Stage::GetCurrent(); // The Init signal is received once (only) during the Application lifetime diff --git a/examples/radial-menu/radial-sweep-view-impl.cpp b/examples/radial-menu/radial-sweep-view-impl.cpp index 6289962..bc9925c 100644 --- a/examples/radial-menu/radial-sweep-view-impl.cpp +++ b/examples/radial-menu/radial-sweep-view-impl.cpp @@ -26,9 +26,8 @@ namespace * Method to project a point on a circle of radius halfSide at given * angle onto a square of side 2 * halfSide */ -Vector3 CircleSquareProjection( Degree angle, float halfSide ) +void CircleSquareProjection( Vector3& position, Degree angle, float halfSide ) { - Vector3 position(0.0f, 0.0f, 0.0f); Radian angleInRadians(angle); // 135 90 45 @@ -58,7 +57,8 @@ Vector3 CircleSquareProjection( Degree angle, float halfSide ) position.x = halfSide; position.y = -halfSide * sinf(angleInRadians) / cosf(angleInRadians); } - return position; + + position.z = 0.0f; } float HoldZeroFastEaseInOutHoldOne(float progress) @@ -88,9 +88,9 @@ struct SquareFanConstraint { } - Vector3 operator()( const Vector3& current, const PropertyInput& start, const PropertyInput& rotation ) + void operator()( Vector3& current, const PropertyInputContainer& inputs ) { - float degree = fmodf((start.GetFloat() + rotation.GetFloat()), 360.0f); + float degree = fmodf((inputs[0]->GetFloat() + inputs[1]->GetFloat()), 360.0f); if(degree < 0.0f) { degree += 360.0f; @@ -100,15 +100,17 @@ struct SquareFanConstraint float endAngle = (90.0f*mSideIndex)+45.0f; if(degree < startAngle) { - return Vector3::ZERO; + current = Vector3::ZERO; } - else if( degree >= endAngle ) + else { - degree = endAngle; + if( degree >= endAngle ) + { + degree = endAngle; + } + CircleSquareProjection( current, Degree(degree), 0.5f ); + current.x = -current.x; // Inverting X makes the animation go anti clockwise from left center } - Vector3 pos = CircleSquareProjection(Degree(degree), 0.5f); - pos.x = -pos.x; // Inverting X makes the animation go anti clockwise from left center - return pos; } int mSideIndex; @@ -362,18 +364,35 @@ void RadialSweepViewImpl::CreateStencil( Degree initialSector ) // Constrain the vertices of the square mesh to sweep out a sector as the // rotation angle is animated. - mMesh.ApplyConstraint(Constraint::New( mMesh.GetPropertyIndex(1, AnimatableVertex::Property::POSITION), - srcStart, srcStart, SquareFanConstraint(0))); - mMesh.ApplyConstraint(Constraint::New( mMesh.GetPropertyIndex(2, AnimatableVertex::Property::POSITION), - srcStart, srcRot, SquareFanConstraint(0))); - mMesh.ApplyConstraint(Constraint::New( mMesh.GetPropertyIndex(3, AnimatableVertex::Property::POSITION), - srcStart, srcRot, SquareFanConstraint(1))); - mMesh.ApplyConstraint(Constraint::New( mMesh.GetPropertyIndex(4, AnimatableVertex::Property::POSITION), - srcStart, srcRot, SquareFanConstraint(2))); - mMesh.ApplyConstraint(Constraint::New( mMesh.GetPropertyIndex(5, AnimatableVertex::Property::POSITION), - srcStart, srcRot, SquareFanConstraint(3))); - mMesh.ApplyConstraint(Constraint::New( mMesh.GetPropertyIndex(6, AnimatableVertex::Property::POSITION), - srcStart, srcRot, SquareFanConstraint(4))); + Constraint constraint = Constraint::New( mMesh, mMesh.GetPropertyIndex(1, AnimatableVertex::Property::POSITION), SquareFanConstraint(0) ); + constraint.AddSource( srcStart ); + constraint.AddSource( srcStart ); + constraint.Apply(); + + constraint = Constraint::New( mMesh, mMesh.GetPropertyIndex(2, AnimatableVertex::Property::POSITION), SquareFanConstraint(0) ); + constraint.AddSource( srcStart ); + constraint.AddSource( srcRot ); + constraint.Apply(); + + constraint = Constraint::New( mMesh, mMesh.GetPropertyIndex(3, AnimatableVertex::Property::POSITION), SquareFanConstraint(1) ); + constraint.AddSource( srcStart ); + constraint.AddSource( srcRot ); + constraint.Apply(); + + constraint = Constraint::New( mMesh, mMesh.GetPropertyIndex(4, AnimatableVertex::Property::POSITION), SquareFanConstraint(2) ); + constraint.AddSource( srcStart ); + constraint.AddSource( srcRot ); + constraint.Apply(); + + constraint = Constraint::New( mMesh, mMesh.GetPropertyIndex(5, AnimatableVertex::Property::POSITION), SquareFanConstraint(3) ); + constraint.AddSource( srcStart ); + constraint.AddSource( srcRot ); + constraint.Apply(); + + constraint = Constraint::New( mMesh, mMesh.GetPropertyIndex(6, AnimatableVertex::Property::POSITION), SquareFanConstraint(4) ); + constraint.AddSource( srcStart ); + constraint.AddSource( srcRot ); + constraint.Apply(); mStencilActor.SetDrawMode( DrawMode::STENCIL ); mStencilActor.SetPositionInheritanceMode(USE_PARENT_POSITION); diff --git a/examples/refraction-effect/refraction-effect-example.cpp b/examples/refraction-effect/refraction-effect-example.cpp index 7a3a290..cf43e1f 100644 --- a/examples/refraction-effect/refraction-effect-example.cpp +++ b/examples/refraction-effect/refraction-effect-example.cpp @@ -56,10 +56,13 @@ struct LightOffsetConstraint { } - Vector2 operator()( const Vector2& current, const PropertyInput& spinAngleProperty) + void operator()( Vector2& current, const PropertyInputContainer& inputs ) { - float spinAngle = spinAngleProperty.GetFloat(); - return Vector2( cos(spinAngle ), sin( spinAngle ) ) * mRadius; + float spinAngle = inputs[0]->GetFloat(); + current.x = cos( spinAngle ); + current.y = sin( spinAngle ); + + current *= mRadius; } float mRadius; @@ -254,10 +257,9 @@ public: handle.SetUniform( "uLightIntensity", 2.5f ); Dali::Property::Index index = handle.RegisterProperty( "uSpinAngle", 0.f ); - Constraint constraint = Constraint::New( handle.GetPropertyIndex("uLightSpinOffset"), - LocalSource(index), - LightOffsetConstraint(stageSize.x*0.1f)); - handle.ApplyConstraint( constraint ); + Constraint constraint = Constraint::New( handle, handle.GetPropertyIndex("uLightSpinOffset"), LightOffsetConstraint(stageSize.x*0.1f) ); + constraint.AddSource( LocalSource(index) ); + constraint.Apply(); return handle; } @@ -318,6 +320,8 @@ private: // The Init signal is received once (only) during the Application lifetime void Create(Application& application) { + DemoHelper::RequestThemeChange(); + Stage stage = Stage::GetCurrent(); mStageHalfSize = stage.GetSize() * 0.5f; diff --git a/examples/scripting/launcher.cpp b/examples/scripting/launcher.cpp index 6c11537..9c48b3f 100644 --- a/examples/scripting/launcher.cpp +++ b/examples/scripting/launcher.cpp @@ -23,9 +23,12 @@ #include #include +// INTERNAL INCLUDES +#include "shared/view.h" using namespace Dali; +using namespace Dali::Toolkit; #define TOKEN_STRING(x) #x @@ -55,7 +58,9 @@ Launcher::~Launcher() void Launcher::Create( Dali::Application& application ) { - TextActor textActor = TextActor::New( "JSON & JavaScript Launcher..." ); + DemoHelper::RequestThemeChange(); + + TextLabel textActor = TextLabel::New( "JSON & JavaScript Launcher..." ); // Reposition the actor textActor.SetParentOrigin( ParentOrigin::TOP_LEFT ); diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp index d8d7fa1..6a083be 100644 --- a/examples/scroll-view/scroll-view-example.cpp +++ b/examples/scroll-view/scroll-view-example.cpp @@ -179,6 +179,8 @@ public: */ void OnInit(Application& app) { + DemoHelper::RequestThemeChange(); + Stage stage = Dali::Stage::GetCurrent(); stage.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); @@ -640,15 +642,12 @@ private: { if(!mTitleActor) { - mTitleActor = TextView::New(); + mTitleActor = DemoHelper::CreateToolBarLabel( "" ); // Add title to the tool bar. mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); } - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + mTitleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, title ); } /** @@ -670,7 +669,7 @@ private: Application& mApplication; ///< Application instance Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - TextView mTitleActor; ///< The Toolbar's Title. + TextLabel mTitleActor; ///< The Toolbar's Title. Layer mContentLayer; ///< The content layer (contains game actors) ScrollView mScrollView; ///< ScrollView UI Component bool mScrolling; ///< ScrollView scrolling state (true = scrolling, false = stationary) diff --git a/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp b/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp index 8aa17a2..9ddadcb 100644 --- a/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp +++ b/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp @@ -100,23 +100,10 @@ public: { } - Vector3 operator()( const Vector3& current, const PropertyInput& property ) + void operator()( Vector3& current, const PropertyInputContainer& inputs ) { - Vector3 position = property.GetVector3(); - position.z += 1.0f; - return position; - } - }; - - struct QuaternionEqualToConstraint - { - QuaternionEqualToConstraint() - { - } - - Quaternion operator()( const Quaternion& current, const PropertyInput& property ) - { - return property.GetQuaternion(); + current = inputs[0]->GetVector3(); + current.z += 1.0f; } }; @@ -127,10 +114,10 @@ public: { } - Quaternion operator()( const Quaternion& current, const PropertyInput& property ) + void operator()( Quaternion& current, const PropertyInputContainer& inputs ) { - Degree angle(property.GetFloat()); - return Quaternion( Radian(angle) * mSign, Vector3::YAXIS ); + Degree angle( inputs[0]->GetFloat() ); + current = Quaternion( Radian(angle) * mSign, Vector3::YAXIS ); } float mSign; @@ -141,6 +128,8 @@ public: */ void Create(Application& app) { + DemoHelper::RequestThemeChange(); + srand(0); // Want repeatable path Stage::GetCurrent().KeyEventSignal().Connect(this, &TestApp::OnKeyEvent); @@ -170,13 +159,11 @@ public: toolBar.AddControl( effectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Add title to the tool bar. - mTitleActor = Toolkit::TextView::New(); + mTitleActor = DemoHelper::CreateToolBarLabel( "" ); toolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); // Set Title text - mTitleActor.SetText( APPLICATION_TITLE_PAN_SCENE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_PAN_SCENE ) ); - mTitleActor.SetStyleToCurrentText( DemoHelper::GetDefaultTextStyle() ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_SCENE) ); //Add a reset button Image resetImage = ResourceImage::New( RESET_ICON ); @@ -245,14 +232,8 @@ public: mCastingLight.SetAnchorPoint(AnchorPoint::CENTER); mCastingLight.SetPosition( Vector3( 0.0f, 0.0f, 800.0f ) * scaleFactor ); - TextStyle style; - style.SetFontPointSize( PointSize(DemoHelper::ScalePointSize(20.0f)) ); - style.SetFontName("Times New Roman"); - style.SetFontStyle("Book"); - - TextActorParameters parameters( style, TextActorParameters::FONT_DETECTION_ON ); - TextActor text = TextActor::New("Light", parameters); - text.SetColor(Color::BLUE); + TextLabel text = TextLabel::New( "Light" ); + text.SetColor( Color::BLUE ); mCastingLight.Add(text); mLightAnchor.Add(mCastingLight); @@ -290,10 +271,14 @@ public: Property::Index angleIndex = mImageActor2.RegisterProperty("angle", Property::Value(30.0f)); Source angleSrc( mImageActor2, angleIndex ); - mImageActor1.ApplyConstraint(Constraint::New( Actor::Property::ORIENTATION, angleSrc, - RotationConstraint(-1.0f))); - mImageActor3.ApplyConstraint(Constraint::New( Actor::Property::ORIENTATION, angleSrc, - RotationConstraint(+1.0f))); + + Constraint constraint = Constraint::New( mImageActor1, Actor::Property::ORIENTATION, RotationConstraint(-1.0f) ); + constraint.AddSource( angleSrc ); + constraint.Apply(); + + constraint = Constraint::New( mImageActor3, Actor::Property::ORIENTATION, RotationConstraint(+1.0f) ); + constraint.AddSource( angleSrc ); + constraint.Apply(); mSceneAnimation = Animation::New(2.5f); @@ -428,30 +413,24 @@ public: { case PAN_SCENE: mPanState = ROTATE_SCENE; - mTitleActor.SetText( APPLICATION_TITLE_ROTATE_SCENE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_ROTATE_SCENE ) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_ROTATE_SCENE) ); break; case ROTATE_SCENE: mPanState = PAN_LIGHT; - mTitleActor.SetText( APPLICATION_TITLE_PAN_LIGHT ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_PAN_LIGHT ) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_LIGHT) ); break; case PAN_LIGHT: mPanState = PAN_OBJECT; - mTitleActor.SetText( APPLICATION_TITLE_PAN_OBJECT ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_PAN_OBJECT ) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_OBJECT) ); break; case PAN_OBJECT: mPanState = PAN_SCENE; - mTitleActor.SetText( APPLICATION_TITLE_PAN_SCENE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_PAN_SCENE ) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_SCENE) ); break; default: break; } - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); - return true; } @@ -501,7 +480,7 @@ private: Property::Index mAngle1Index; Property::Index mAngle3Index; - Toolkit::TextView mTitleActor; + Toolkit::TextLabel mTitleActor; enum PanState { diff --git a/examples/size-negotiation/size-negotiation-example.cpp b/examples/size-negotiation/size-negotiation-example.cpp index 473f16a..c9a5026 100644 --- a/examples/size-negotiation/size-negotiation-example.cpp +++ b/examples/size-negotiation/size-negotiation-example.cpp @@ -21,6 +21,8 @@ using namespace Dali; +using Dali::Toolkit::TextLabel; + // Define this so that it is interchangeable // "DP" stands for Device independent Pixels #define DP(x) DemoHelper::ScalePointSize(x) @@ -155,6 +157,8 @@ public: { // The Init signal is received once (only) during the Application lifetime + DemoHelper::RequestThemeChange(); + Stage stage = Stage::GetCurrent(); // Respond to key events @@ -169,8 +173,7 @@ public: TOOLBAR_IMAGE, std::string("") ); - mTitleActor = Dali::Toolkit::TextView::New(); - mTitleActor.SetName( "CUSTOM_TOOLBAR_TITLE" ); + mTitleActor = DemoHelper::CreateToolBarLabel( "CUSTOM_TOOLBAR_TITLE" ); SetTitle(); @@ -231,8 +234,7 @@ public: } } - mTitleActor.SetText( std::string( TOOLBAR_TITLE ) + ": " + subTitle ); - mTitleActor.SetStyleToCurrentText( DemoHelper::GetDefaultTextStyle() ); + mTitleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, std::string( std::string( TOOLBAR_TITLE ) + ": " + subTitle ) ); } bool OnMenu( Toolkit::Button button ) @@ -341,9 +343,6 @@ public: { mPopup = CreatePopup(); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_TITLE_ID ) @@ -351,9 +350,6 @@ public: mPopup = CreatePopup(); mPopup.SetTitle( "Popup!" ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_BUTTONS_1_ID ) @@ -370,9 +366,6 @@ public: mPopup.AddButton( okayButton ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_BUTTONS_2_ID ) @@ -399,9 +392,6 @@ public: mPopup.AddButton( okayButton ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_TITLE_BUTTONS_ID ) @@ -429,30 +419,22 @@ public: mPopup.AddButton( okayButton ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_CONTENT_TEXT_ID ) { mPopup = CreatePopup(); - Toolkit::TextView text = Toolkit::TextView::New(); + TextLabel text = TextLabel::New( CONTENT_TEXT ); text.SetName( "POPUP_CONTENT_TEXT" ); - text.SetText( CONTENT_TEXT ); - text.SetMultilinePolicy( Toolkit::TextView::SplitByWord ); - text.SetWidthExceedPolicy( Toolkit::TextView::Split ); - text.SetLineJustification( Toolkit::TextView::Center ); - text.SetResizePolicy( FILL_TO_PARENT, WIDTH ); - text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT ); + text.SetProperty( TextLabel::Property::MULTI_LINE, true ); + text.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); + text.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); + text.SetResizePolicy( FILL_TO_PARENT, Dali::HEIGHT ); text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) ); mPopup.Add( text ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_ID ) @@ -466,9 +448,6 @@ public: mPopup.Add( image ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID ) @@ -483,9 +462,6 @@ public: mPopup.Add( image ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID ) @@ -501,9 +477,6 @@ public: mPopup.Add( image ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID ) @@ -519,9 +492,6 @@ public: mPopup.Add( image ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_ID ) @@ -529,21 +499,14 @@ public: mPopup = CreatePopup(); mPopup.SetTitle( "Popup!" ); - Toolkit::TextView text = Toolkit::TextView::New(); + Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT ); text.SetName( "POPUP_CONTENT_TEXT" ); - text.SetText( CONTENT_TEXT ); - text.SetMultilinePolicy( Toolkit::TextView::SplitByWord ); - text.SetWidthExceedPolicy( Toolkit::TextView::Split ); - text.SetLineJustification( Toolkit::TextView::Center ); text.SetResizePolicy( FILL_TO_PARENT, WIDTH ); text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT ); text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) ); mPopup.Add( text ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_BUTTONS_ID ) @@ -551,12 +514,8 @@ public: mPopup = CreatePopup(); mPopup.SetTitle( "Popup!" ); - Toolkit::TextView text = Toolkit::TextView::New(); + Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT ); text.SetName( "POPUP_CONTENT_TEXT" ); - text.SetText( CONTENT_TEXT ); - text.SetMultilinePolicy( Toolkit::TextView::SplitByWord ); - text.SetWidthExceedPolicy( Toolkit::TextView::Split ); - text.SetLineJustification( Toolkit::TextView::Left ); text.SetResizePolicy( FILL_TO_PARENT, WIDTH ); text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT ); text.SetPadding( Padding( 10.0f, 10.0f, 20.0f, 0.0f ) ); @@ -583,9 +542,6 @@ public: mPopup.AddButton( okayButton ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == POPUP_BUTTON_COMPLEX_ID ) @@ -604,11 +560,7 @@ public: // Text { - Toolkit::TextView text = Toolkit::TextView::New(); - text.SetText( "Do you really want to quit?" ); - text.SetMultilinePolicy( Toolkit::TextView::SplitByWord ); - text.SetWidthExceedPolicy( Toolkit::TextView::Split ); - text.SetLineJustification( Toolkit::TextView::Left ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Do you really want to quit?" ); text.SetResizePolicy( FILL_TO_PARENT, WIDTH ); text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT ); @@ -643,15 +595,13 @@ public: root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) ); - Toolkit::TextView text = Toolkit::TextView::New(); - text.SetText( "Don't show again" ); - text.SetLineJustification( Toolkit::TextView::Left ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Don't show again" ); Actor textActor = text; textActor.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 10.0f ) ); root.AddChild( text, Toolkit::TableView::CellPosition( 0, 1 ) ); - content.AddChild( root, Toolkit::TableView::CellPosition( 1, 0, 0, 2 ) ); // Column span 2 + content.AddChild( root, Toolkit::TableView::CellPosition( 1, 0 ) ); } mPopup.Add( content ); @@ -677,9 +627,6 @@ public: mPopup.AddButton( okayButton ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_EMPTY_ID ) @@ -694,9 +641,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID ) @@ -716,9 +660,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID ) @@ -749,9 +690,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID ) @@ -817,9 +755,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID ) @@ -836,7 +771,7 @@ public: { Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fixed" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -845,7 +780,7 @@ public: { Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fill" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -854,7 +789,7 @@ public: { Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fill" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -863,9 +798,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID ) @@ -883,7 +815,7 @@ public: { Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fixed" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -892,7 +824,7 @@ public: { Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fill" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -901,7 +833,7 @@ public: { Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fixed" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -910,9 +842,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID ) @@ -932,7 +861,7 @@ public: backing.SetResizePolicy( FILL_TO_PARENT, WIDTH ); backing.SetSize( 0.0f, 100.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -943,7 +872,7 @@ public: Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fill" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -955,7 +884,7 @@ public: backing.SetResizePolicy( FILL_TO_PARENT, WIDTH ); backing.SetSize( 0.0f, 100.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -965,9 +894,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID ) @@ -984,7 +910,7 @@ public: Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fill" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -996,7 +922,7 @@ public: backing.SetResizePolicy( FILL_TO_PARENT, WIDTH ); backing.SetSize( 0.0f, 200.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1007,7 +933,7 @@ public: Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fill" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1017,9 +943,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID ) @@ -1041,7 +964,7 @@ public: backing.SetResizePolicy( FILL_TO_PARENT, WIDTH ); backing.SetSize( 0.0f, 100.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1053,7 +976,7 @@ public: backing.SetResizePolicy( FILL_TO_PARENT, WIDTH ); backing.SetSize( 0.0f, 200.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1065,7 +988,7 @@ public: backing.SetResizePolicy( FILL_TO_PARENT, WIDTH ); backing.SetSize( 0.0f, 300.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1075,9 +998,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID ) @@ -1099,7 +1019,7 @@ public: backing.SetResizePolicy( FIXED, HEIGHT ); backing.SetSize( 0.0f, 100.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1111,7 +1031,7 @@ public: backing.SetResizePolicy( FILL_TO_PARENT, WIDTH ); backing.SetSize( 0.0f, 200.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1121,9 +1041,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID ) @@ -1143,7 +1060,7 @@ public: Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) ); backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - TextActor text = TextActor::New( "Fixed" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1155,7 +1072,7 @@ public: backing.SetResizePolicy( FILL_TO_PARENT, WIDTH ); backing.SetSize( 0.0f, 200.0f ); - TextActor text = TextActor::New( "Fit" ); + Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" ); text.SetAnchorPoint( AnchorPoint::CENTER ); text.SetParentOrigin( ParentOrigin::CENTER ); backing.Add( text ); @@ -1165,9 +1082,6 @@ public: mPopup.Add( table ); - // The popup is not yet on the stage so needs to be flaged as dirty - mPopup.MarkDirtyForRelayout(); - mPopup.Show(); } else if( button.GetName() == OKAY_BUTTON_ID || button.GetName() == CANCEL_BUTTON_ID ) @@ -1291,7 +1205,7 @@ private: Toolkit::ToolBar mToolBar; ///< The View's Toolbar. Layer mContentLayer; ///< Content layer - Toolkit::TextView mTitleActor; ///< Title text + Toolkit::TextLabel mTitleActor; ///< Title text Toolkit::Popup mMenu; ///< The navigation menu bool mMenuShown; ///< If the navigation menu is currently being displayed or not diff --git a/examples/text-field/text-field-example.cpp b/examples/text-field/text-field-example.cpp new file mode 100644 index 0000000..cbce666 --- /dev/null +++ b/examples/text-field/text-field-example.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file text-field-example.cpp + * @brief Basic usage of TextField control + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include "shared/view.h" + +using namespace Dali; +using namespace Dali::Toolkit; + +namespace +{ + +const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; + +const float BORDER_WIDTH = 4.0f; + +} // unnamed namespace + +/** + * @brief The main class of the demo. + */ +class TextFieldExample : public ConnectionTracker +{ +public: + + TextFieldExample( Application& application ) + : mApplication( application ) + { + // Connect to the Application's Init signal + mApplication.InitSignal().Connect( this, &TextFieldExample::Create ); + } + + ~TextFieldExample() + { + // Nothing to do here. + } + + /** + * One-time setup in response to Application InitSignal. + */ + void Create( Application& application ) + { + DemoHelper::RequestThemeChange(); + + Stage stage = Stage::GetCurrent(); + + stage.KeyEventSignal().Connect(this, &TextFieldExample::OnKeyEvent); + + Vector2 stageSize = stage.GetSize(); + + mContainer = Control::New(); + mContainer.SetName( "Container" ); + mContainer.SetParentOrigin( ParentOrigin::CENTER ); + mContainer.SetResizePolicy( FIXED, ALL_DIMENSIONS ); + mContainer.SetSize( Vector2(stageSize.width*0.6f, stageSize.width*0.6f) ); + mContainer.SetBackgroundImage( ResourceImage::New( BACKGROUND_IMAGE ) ); + mContainer.GetChildAt(0).SetZ(-1.0f); + stage.Add( mContainer ); + + TextField field = TextField::New(); + field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + field.SetResizePolicy( FILL_TO_PARENT, WIDTH ); + field.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT ); + + mContainer.Add( field ); + + field.SetProperty( TextField::Property::TEXT, "Hello" ); + + Property::Value fieldText = field.GetProperty( TextField::Property::TEXT ); + std::cout << "Displaying text: " << fieldText.Get< std::string >() << std::endl; + } + + /** + * Main key event handler + */ + void OnKeyEvent(const KeyEvent& event) + { + if(event.state == KeyEvent::Down) + { + if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) + { + mApplication.Quit(); + } + } + } + +private: + + Application& mApplication; + + Control mContainer; +}; + +void RunTest( Application& application ) +{ + TextFieldExample test( application ); + + application.MainLoop(); +} + +/** Entry point for Linux & Tizen applications */ +int main( int argc, char **argv ) +{ + Application application = Application::New( &argc, &argv ); + + RunTest( application ); + + return 0; +} diff --git a/examples/text-label-emojis/emoji-strings.h b/examples/text-label-emojis/emoji-strings.h new file mode 100644 index 0000000..81c8a6f --- /dev/null +++ b/examples/text-label-emojis/emoji-strings.h @@ -0,0 +1,103 @@ +#ifndef __DALI_DEMO_EMOJI_STRINGS_H__ +#define __DALI_DEMO_EMOJI_STRINGS_H__ + +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +namespace EmojiStrings +{ + struct Emoji + { + uint32_t mUnicode; + std::string mUTF8; + std::string mDescription; + }; + + const Emoji EMOJIS[] = { + + { 0x1F601,"\xF0\x9F\x98\x81","grinning face with smiling eyes" }, + { 0x1F602,"\xF0\x9F\x98\x82","face with tears of joy" }, + //{ 0x1F603,"\xF0\x9F\x98\x83","smiling face with open mouth" }, + //{ 0x1F604,"\xF0\x9F\x98\x84","smiling face with open mouth and smiling eyes" }, + { 0x1F605,"\xF0\x9F\x98\x85","smiling face with open mouth and cold sweat" }, + //{ 0x1F606,"\xF0\x9F\x98\x86","smiling face with open mouth and tightly-closed eyes" }, + { 0x1F609,"\xF0\x9F\x98\x89","winking face" }, + { 0x1F60A,"\xF0\x9F\x98\x8A","smiling face with smiling eyes" }, + { 0x1F60B,"\xF0\x9F\x98\x8B","face savouring delicious food" }, + { 0x1F60C,"\xF0\x9F\x98\x8C","relieved face" }, + { 0x1F60D,"\xF0\x9F\x98\x8D","smiling face with heart-shaped eyes" }, + { 0x1F60F,"\xF0\x9F\x98\x8F","smirking face" }, + //{ 0x1F612,"\xF0\x9F\x98\x92","unamused face" }, + //{ 0x1F613,"\xF0\x9F\x98\x93","face with cold sweat" }, + //{ 0x1F614,"\xF0\x9F\x98\x94","pensive face" }, + //{ 0x1F616,"\xF0\x9F\x98\x96","confounded face" }, + { 0x1F618,"\xF0\x9F\x98\x98","face throwing a kiss" }, + { 0x1F61A,"\xF0\x9F\x98\x9A","kissing face with closed eyes" }, + //{ 0x1F61C,"\xF0\x9F\x98\x9C","face with stuck-out tongue and winking eye" }, + //{ 0x1F61D,"\xF0\x9F\x98\x9D","face with stuck-out tongue and tightly-closed eyes" }, + //{ 0x1F61E,"\xF0\x9F\x98\x9E","disappointed face" }, + { 0x1F620,"\xF0\x9F\x98\xA0","angry face" }, + + /* + { "POUTING FACE", + { "CRYING FACE", + { "PERSEVERING FACE", + { "FACE WITH LOOK OF TRIUMPH", + { "DISAPPOINTED BUT RELIEVED FACE", + { "FEARFUL FACE", + { "WEARY FACE", + { "SLEEPY FACE", + { "TIRED FACE", + { "LOUDLY CRYING FACE", + { "FACE WITH OPEN MOUTH AND COLD SWEAT", + { "FACE SCREAMING IN FEAR", + { "ASTONISHED FACE", + { "FLUSHED FACE", + { "DIZZY FACE", + { "FACE WITH MEDICAL MASK", + { "GRINNING CAT FACE WITH SMILING EYES", + { "CAT FACE WITH TEARS OF JOY", + { "SMILING CAT FACE WITH OPEN MOUTH", + { "SMILING CAT FACE WITH HEART-SHAPED EYES", + { "CAT FACE WITH WRY SMILE", + { "KISSING CAT FACE WITH CLOSED EYES", + { "POUTING CAT FACE", + { "CRYING CAT FACE", + { "WEARY CAT FACE", + { "FACE WITH NO GOOD GESTURE", + { "FACE WITH OK GESTURE", + { "PERSON BOWING DEEPLY", + { "SEE-NO-EVIL MONKEY", + { "HEAR-NO-EVIL MONKEY", + { "SPEAK-NO-EVIL MONKEY", + { "HAPPY PERSON RAISING ONE HAND", + { "PERSON RAISING BOTH HANDS IN CELEBRATION", + { "PERSON FROWNING", + { "PERSON WITH POUTING FACE", + { "PERSON WITH FOLDED HANDS", + */ + + }; + + const unsigned int NUMBER_OF_EMOJIS = 12; + +} // EmojiStrings + +#endif // __DALI_DEMO_EMOJI_STRINGS_H__ diff --git a/examples/text-label-emojis/text-label-emojis.cpp b/examples/text-label-emojis/text-label-emojis.cpp new file mode 100644 index 0000000..af33376 --- /dev/null +++ b/examples/text-label-emojis/text-label-emojis.cpp @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES +#include "emoji-strings.h" + +using namespace Dali; +using namespace Dali::Toolkit; +using namespace EmojiStrings; + + // TODO Need to expose Text::RENDER..... +const int ATLAS_RENDERER = 0; + +// This example shows how to create and display Hello World! using a simple TextActor +// +class EmojiExample : public ConnectionTracker +{ +public: + + typedef uint32_t SizeType; + + EmojiExample( Application& application ) + : mApplication( application ) + { + std::cout << "EmoticonController::EmoticonController" << std::endl; + + // Connect to the Application's Init signal + mApplication.InitSignal().Connect( this, &EmojiExample::Create ); + } + + ~EmojiExample() + { + // Nothing to do here; + } + + // The Init signal is received once (only) during the Application lifetime + void Create( Application& application ) + { + Stage stage = Stage::GetCurrent(); + stage.KeyEventSignal().Connect(this, &EmojiExample::OnKeyEvent); + + mTableView = Toolkit::TableView::New( NUMBER_OF_EMOJIS, 1 ); + mTableView.SetResizePolicy( FILL_TO_PARENT, WIDTH ); + mTableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT ); + mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT ); + mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mTableView.TouchedSignal().Connect( this, &EmojiExample::OnTouchEvent ); + stage.Add( mTableView ); + + for( unsigned int index = 0u; index < NUMBER_OF_EMOJIS; ++index ) + { + const Emoji& emoji = EMOJIS[index]; + const std::string text = emoji.mUTF8 + " " + emoji.mDescription; + + TextLabel label = TextLabel::New( text ); + label.SetParentOrigin( ParentOrigin::TOP_CENTER ); + label.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + label.SetProperty( TextLabel::Property::MULTI_LINE, true ); + + mTableView.SetFitHeight( index ); + mTableView.AddChild( label, Toolkit::TableView::CellPosition( index, 0 ) ); + } + } + + bool OnTouchEvent( Actor actor, const TouchEvent& event ) + { + if( 1u == event.GetPointCount() ) + { + const TouchPoint::State state = event.GetPoint(0u).state; + + // Clamp to integer values; this is to reduce flicking due to pixel misalignment + const float localPoint = static_cast( static_cast( event.GetPoint( 0 ).local.y ) ); + + if( TouchPoint::Down == state ) + { + mLastPoint = localPoint; + mAnimation = Animation::New( 0.25f ); + } + else if( TouchPoint::Motion == state ) + { + if( mAnimation ) + { + mAnimation.AnimateBy( Property(mTableView, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear ); + mAnimation.Play(); + mLastPoint = localPoint; + } + } + } + + return true; + } + + /** + * Main key event handler + */ + void OnKeyEvent(const KeyEvent& event) + { + if(event.state == KeyEvent::Down) + { + if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) + { + mApplication.Quit(); + } + } + } + + +private: + Application& mApplication; + TableView mTableView; + Animation mAnimation; + float mLastPoint; +}; + +void RunTest( Application& application ) +{ + EmojiExample test( application ); + + application.MainLoop(); +} + +// Entry point for Linux & SLP applications +// +int main( int argc, char **argv ) +{ + Application application = Application::New( &argc, &argv ); + + RunTest( application ); + + return 0; +} diff --git a/examples/text-label-multi-language/text-label-multi-language-example.cpp b/examples/text-label-multi-language/text-label-multi-language-example.cpp new file mode 100644 index 0000000..b25dea5 --- /dev/null +++ b/examples/text-label-multi-language/text-label-multi-language-example.cpp @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file text-label-example.cpp + * @brief Basic usage of TextLabel control + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include "shared/multi-language-strings.h" +#include "shared/view.h" + +using namespace Dali; +using namespace Dali::Toolkit; +using namespace MultiLanguageStrings; + +/** + * @brief The main class of the demo. + */ +class TextLabelMultiLanguageExample : public ConnectionTracker +{ +public: + + TextLabelMultiLanguageExample( Application& application ) + : mApplication( application ), + mLastPoint( 0.f ) + { + // Connect to the Application's Init signal + mApplication.InitSignal().Connect( this, &TextLabelMultiLanguageExample::Create ); + } + + ~TextLabelMultiLanguageExample() + { + // Nothing to do here. + } + + /** + * One-time setup in response to Application InitSignal. + */ + void Create( Application& application ) + { + DemoHelper::RequestThemeChange(); + + Stage stage = Stage::GetCurrent(); + + stage.KeyEventSignal().Connect(this, &TextLabelMultiLanguageExample::OnKeyEvent); + + mTableView = Toolkit::TableView::New( NUMBER_OF_LANGUAGES, 1 ); + mTableView.SetResizePolicy( FILL_TO_PARENT, WIDTH ); + mTableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT ); + mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT ); + mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mTableView.TouchedSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouchEvent ); + stage.Add( mTableView ); + + for( unsigned int index = 0u; index < NUMBER_OF_LANGUAGES; ++index ) + { + const Language& language = LANGUAGES[index]; + + TextLabel label = TextLabel::New(); + label.SetProperty( TextLabel::Property::MULTI_LINE, true ); + + const std::string text = language.languageName + " " + language.languageRomanName + " " + language.text; + label.SetProperty( TextLabel::Property::TEXT, text ); + + mTableView.SetFitHeight( index ); + mTableView.AddChild( label, Toolkit::TableView::CellPosition( index, 0 ) ); + } + } + + bool OnTouchEvent( Actor actor, const TouchEvent& event ) + { + if( 1u == event.GetPointCount() ) + { + const TouchPoint::State state = event.GetPoint(0u).state; + + // Clamp to integer values; this is to reduce flicking due to pixel misalignment + const float localPoint = static_cast( static_cast( event.GetPoint( 0 ).local.y ) ); + + if( TouchPoint::Down == state ) + { + mLastPoint = localPoint; + mAnimation = Animation::New( 0.25f ); + } + else if( TouchPoint::Motion == state ) + { + if( mAnimation ) + { + mAnimation.AnimateBy( Property(mTableView, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear ); + mAnimation.Play(); + mLastPoint = localPoint; + } + } + } + + return true; + } + + /** + * Main key event handler + */ + void OnKeyEvent(const KeyEvent& event) + { + if(event.state == KeyEvent::Down) + { + if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) + { + mApplication.Quit(); + } + } + } + +private: + + Application& mApplication; + TableView mTableView; + Animation mAnimation; + float mLastPoint; +}; + +void RunTest( Application& application ) +{ + TextLabelMultiLanguageExample test( application ); + + application.MainLoop(); +} + +/** Entry point for Linux & Tizen applications */ +int main( int argc, char **argv ) +{ + Application application = Application::New( &argc, &argv ); + + RunTest( application ); + + return 0; +} diff --git a/examples/text-label/text-label-example.cpp b/examples/text-label/text-label-example.cpp new file mode 100644 index 0000000..6271cc7 --- /dev/null +++ b/examples/text-label/text-label-example.cpp @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file text-label-example.cpp + * @brief Basic usage of TextLabel control + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include "shared/multi-language-strings.h" +#include "shared/view.h" + +using namespace Dali; +using namespace Dali::Toolkit; +using namespace MultiLanguageStrings; + +namespace +{ + const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; + + const unsigned int KEY_ZERO = 10; + const unsigned int KEY_ONE = 11; + const unsigned int KEY_H = 43; + const unsigned int KEY_V = 55; + const unsigned int KEY_M = 58; + const unsigned int KEY_L = 46; + const unsigned int KEY_S = 39; + const unsigned int KEY_PLUS = 21; + const unsigned int KEY_MINUS = 20; + + const char* H_ALIGNMENT_STRING_TABLE[] = + { + "BEGIN", + "CENTER", + "END" + }; + + const unsigned int H_ALIGNMENT_STRING_COUNT = sizeof( H_ALIGNMENT_STRING_TABLE ) / sizeof( H_ALIGNMENT_STRING_TABLE[0u] ); + + const char* V_ALIGNMENT_STRING_TABLE[] = + { + "TOP", + "CENTER", + "BOTTOM" + }; + + const unsigned int V_ALIGNMENT_STRING_COUNT = sizeof( V_ALIGNMENT_STRING_TABLE ) / sizeof( V_ALIGNMENT_STRING_TABLE[0u] ); + + int ConvertToEven(int value) + { + return (value % 2 == 0) ? value : (value + 1); + } +} + +/** + * @brief The main class of the demo. + */ +class TextLabelExample : public ConnectionTracker +{ +public: + + TextLabelExample( Application& application ) + : mApplication( application ), + mLanguageId( 0u ), + mAlignment( 0u ) + { + // Connect to the Application's Init signal + mApplication.InitSignal().Connect( this, &TextLabelExample::Create ); + } + + ~TextLabelExample() + { + // Nothing to do here. + } + + /** + * One-time setup in response to Application InitSignal. + */ + void Create( Application& application ) + { + DemoHelper::RequestThemeChange(); + + Stage stage = Stage::GetCurrent(); + + stage.KeyEventSignal().Connect(this, &TextLabelExample::OnKeyEvent); + Vector2 stageSize = stage.GetSize(); + + mContainer = Control::New(); + mContainer.SetName( "Container" ); + mContainer.SetParentOrigin( ParentOrigin::CENTER ); + mContainer.SetResizePolicy( FIXED, ALL_DIMENSIONS ); + mLayoutSize = Vector2(stageSize.width*0.6f, stageSize.width*0.6f); + mContainer.SetSize( mLayoutSize ); + mContainer.SetBackgroundImage( ResourceImage::New( BACKGROUND_IMAGE ) ); + mContainer.GetChildAt(0).SetZ(-1.0f); + stage.Add( mContainer ); + + // Resize the center layout when the corner is grabbed + mGrabCorner = Control::New(); + mGrabCorner.SetName( "GrabCorner" ); + mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); + mGrabCorner.SetResizePolicy( FIXED, ALL_DIMENSIONS ); + mGrabCorner.SetSize( Vector2(stageSize.width*0.1f, stageSize.width*0.1f) ); + mGrabCorner.SetZ(1.0f); + mContainer.Add( mGrabCorner ); + + mPanGestureDetector = PanGestureDetector::New(); + mPanGestureDetector.Attach( mGrabCorner ); + mPanGestureDetector.DetectedSignal().Connect( this, &TextLabelExample::OnPan ); + + mLabel = TextLabel::New( "A Quick Brown Fox Jumps Over The Lazy Dog" ); + mLabel.SetName( "TextLabel" ); + mLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + mLabel.SetResizePolicy( FILL_TO_PARENT, WIDTH ); + mLabel.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT ); + mLabel.SetProperty( TextLabel::Property::MULTI_LINE, true ); + mLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) ); + mLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK ); + mContainer.Add( mLabel ); + + Property::Value labelText = mLabel.GetProperty( TextLabel::Property::TEXT ); + std::cout << "Displaying text: \"" << labelText.Get< std::string >() << "\"" << std::endl; + } + + // Resize the text-label with pan gesture + void OnPan( Actor actor, const PanGesture& gesture ) + { + mLayoutSize.x += gesture.displacement.x * 2.0f; + mLayoutSize.y += gesture.displacement.y * 2.0f; + + if( mLayoutSize.x >= 2.0f && + mLayoutSize.y >= 2.0f ) + { + // Avoid pixel mis-alignment issue + Vector2 clampedSize = Vector2( ConvertToEven(static_cast(mLayoutSize.x)), + ConvertToEven(static_cast(mLayoutSize.y)) ); + + mContainer.SetSize( clampedSize ); + } + } + + /** + * Main key event handler + */ + void OnKeyEvent(const KeyEvent& event) + { + if(event.state == KeyEvent::Down) + { + if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) + { + mApplication.Quit(); + } + else if( event.IsCtrlModifier() ) + { + switch( event.keyCode ) + { + case KEY_ZERO: // fall through + case KEY_ONE: + { + mLabel.SetProperty( TextLabel::Property::RENDERING_BACKEND, event.keyCode - 10 ); + break; + } + case KEY_H: + { + if( ++mAlignment >= H_ALIGNMENT_STRING_COUNT ) + { + mAlignment = 0u; + } + + mLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, H_ALIGNMENT_STRING_TABLE[ mAlignment ] ); + break; + } + case KEY_V: + { + if( ++mAlignment >= V_ALIGNMENT_STRING_COUNT ) + { + mAlignment = 0u; + } + + mLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, V_ALIGNMENT_STRING_TABLE[ mAlignment ] ); + break; + } + case KEY_M: + { + bool multiLine = mLabel.GetProperty( TextLabel::Property::MULTI_LINE ); + mLabel.SetProperty( TextLabel::Property::MULTI_LINE, !multiLine ); + break; + } + case KEY_L: + { + const Language& language = LANGUAGES[ mLanguageId ]; + + mLabel.SetProperty( TextLabel::Property::TEXT, language.text ); + + if( ++mLanguageId >= NUMBER_OF_LANGUAGES ) + { + mLanguageId = 0u; + } + break; + } + case KEY_S: + { + if( Color::BLACK == mLabel.GetProperty( TextLabel::Property::SHADOW_COLOR ) ) + { + mLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::RED ); + } + else + { + mLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK ); + } + break; + } + case KEY_PLUS: + { + mLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, mLabel.GetProperty( TextLabel::Property::SHADOW_OFFSET ) + Vector2( 1.0f, 1.0f ) ); + break; + } + case KEY_MINUS: + { + mLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, mLabel.GetProperty( TextLabel::Property::SHADOW_OFFSET ) - Vector2( 1.0f, 1.0f ) ); + break; + } + + } + } + } + } + +private: + + Application& mApplication; + + TextLabel mLabel; + + Control mContainer; + Actor mGrabCorner; + + PanGestureDetector mPanGestureDetector; + + Vector2 mLayoutSize; + + unsigned int mLanguageId; + unsigned int mAlignment; +}; + +void RunTest( Application& application ) +{ + TextLabelExample test( application ); + + application.MainLoop(); +} + +/** Entry point for Linux & Tizen applications */ +int main( int argc, char **argv ) +{ + Application application = Application::New( &argc, &argv ); + + RunTest( application ); + + return 0; +} diff --git a/examples/text-view/text-view-example.cpp b/examples/text-view/text-view-example.cpp deleted file mode 100644 index c90b227..0000000 --- a/examples/text-view/text-view-example.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "shared/view.h" -#include -#include - -using namespace Dali; - -namespace -{ - -const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "background-gradient.jpg"; -const char* const TOOLBAR_IMAGE = DALI_IMAGE_DIR "top-bar.png"; - -const char* const TOOLBAR_TITLE = "Text View"; -const int TOOLBAR_HEIGHT = 80; - -const int NUM_TABLE_ROWS = 12; -const int NUM_TABLE_COLUMNS = 12; - -} // namespace - -/** - * Helper structs - */ -struct TableCell -{ - unsigned int row; - unsigned int column; - unsigned int rowSpan; - unsigned int columnSpan; -}; - -struct TableString -{ - std::string fontName; - std::string fontStyle; - float fontSize; - Dali::TextStyle::Weight fontWeight; - Vector4 fontColour; - - std::string text; - - Toolkit::Alignment::Type horizontalAlignment; - Toolkit::Alignment::Type verticalAlignment; - float padding; - - float orientation; - - TableCell cellPosition; -}; - -namespace -{ -// Font Font style Font point size Font weight Text colour Text Horizontal alignment Vertical alignment Padding Orientation Table cell position and span -const TableString TABLE_STRINGS[] = { { "HelveticaNue", "Regular", 8.0f, Dali::TextStyle::REGULAR, Vector4( 0.5f, 1.0f, 0.0f, 1.0f ), "Howdy", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalTop, 10.0f, 0.0f, { 0, 0, 2, 4 } }, - { "HelveticaNue", "Regular", 13.0f, Dali::TextStyle::EXTRABOLD, Vector4( 1.0f, 0.5f, 0.0f, 1.0f ), "Hello!", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalCenter, 10.0f, 0.0f, { 0, 4, 1, 4 } }, - { "HelveticaNue", "Regular", 18.0f, Dali::TextStyle::REGULAR, Vector4( 1.0f, 0.75f, 0.25f, 1.0f ), "שלום!", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalTop, 10.0f, 0.0f, { 1, 4, 1, 4 } }, - { "HelveticaNue", "Regular", 8.0f, Dali::TextStyle::REGULAR, Vector4( 0.5f, 0.0f, 1.0f, 1.0f ), "Hi there", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalBottom, 10.0f, 0.0f, { 0, 8, 2, 4 } }, - { "HelveticaNue", "Regular", 12.0f, Dali::TextStyle::REGULAR, Vector4( 0.5f, 1.0f, 1.0f, 1.0f ), "Hola", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalCenter, 10.0f, 90.0f, { 2, 0, 4, 2 } }, - { "HelveticaNue", "Regular", 18.0f, Dali::TextStyle::BOLD, Vector4( 0.5f, 1.0f, 0.5f, 1.0f ), "Bonjour", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalTop, 10.0f, 0.0f, { 2, 2, 2, 4 } }, - { "HelveticaNue", "Regular", 12.0f, Dali::TextStyle::REGULAR, Vector4( 1.0f, 1.0f, 0.5f, 1.0f ), "Ciao", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalCenter, 10.0f, 0.0f, { 2, 7, 2, 3 } }, - { "HelveticaNue", "Regular", 23.0f, Dali::TextStyle::EXTRABLACK, Vector4( 0.5f, 0.0f, 0.0f, 1.0f ), "안녕하세요", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalCenter, 20.0f, 0.0f, { 4, 3, 1, 6 } }, - { "HelveticaNue", "Regular", 8.0f, Dali::TextStyle::DEMIBOLD, Vector4( 0.0f, 0.5f, 0.0f, 1.0f ), "Top of the morning to you", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalCenter, 10.0f, 90.0f, { 4, 10, 8, 2 } }, - { "HelveticaNue", "Regular", 13.0f, Dali::TextStyle::DEMIBOLD, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ), "हैलो", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalTop, 10.0f, 0.0f, { 6, 1, 1, 3 } }, - { "HelveticaNue", "Regular", 8.0f, Dali::TextStyle::DEMIBOLD, Vector4( 1.0f, 1.0f, 0.0f, 1.0f ), "สวัสดี", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalTop, 10.0f, 90.0f, { 6, 5, 2, 1 } }, - { "HelveticaNue", "Regular", 18.0f, Dali::TextStyle::REGULAR, Vector4( 0.0f, 1.0f, 1.0f, 1.0f ), "你好", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalBottom, 10.0f, 0.0f, { 6, 6, 1, 3 } }, - { "HelveticaNue", "Regular", 34.0f, Dali::TextStyle::REGULAR, Vector4( 0.0f, 0.0f, 1.0f, 1.0f ), "G'day", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalCenter, 10.0f, 0.0f, { 7, 0, 2, 10 } }, - { "HelveticaNue", "Regular", 16.0f, Dali::TextStyle::EXTRABLACK, Vector4( 0.0f, 0.5f, 1.0f, 1.0f ), "مرحبا", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalTop, 10.0f, 0.0f, { 9, 1, 2, 4 } }, - { "HelveticaNue", "Regular", 10.0f, Dali::TextStyle::EXTRABLACK, Vector4( 1.0f, 0.0f, 0.0f, 1.0f ), "こんにちは", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalCenter, 10.0f, 0.0f, { 10, 0, 2, 6 } }, - { "HelveticaNue", "Regular", 14.0f, Dali::TextStyle::REGULAR, Vector4( 0.0f, 1.0f, 0.0f, 1.0f ), "aloha", Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::VerticalTop, 10.0f, 0.0f, { 10, 6, 2, 4 } } - }; - -const int NUM_TABLE_STRINGS = sizeof( TABLE_STRINGS ) / sizeof( TABLE_STRINGS[0] ); - -} // namespace - -/** - * This example shows the usage of TextView. - */ -class TextViewController: public ConnectionTracker -{ -public: - - TextViewController( Application& application ) - : mApplication( application ) - { - // Connect to the Application's Init signal - mApplication.InitSignal().Connect( this, &TextViewController::Create ); - } - - ~TextViewController() - { - // Nothing to do here - } - - void Create( Application& application ) - { - // The Init signal is received once (only) during the Application lifetime - - Stage stage = Stage::GetCurrent(); - - // Respond to key events - stage.KeyEventSignal().Connect(this, &TextViewController::OnKeyEvent); - - // Creates a default view with a default tool bar. - // The view is added to the stage. - mContentLayer = DemoHelper::CreateView( application, - mView, - mToolBar, - BACKGROUND_IMAGE, - TOOLBAR_IMAGE, - TOOLBAR_TITLE ); - - // Create a table view the height of the stage - Toolkit::TableView textContainer = Toolkit::TableView::New( NUM_TABLE_ROWS, NUM_TABLE_COLUMNS ); - textContainer.SetParentOrigin( ParentOrigin::TOP_LEFT ); - textContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - textContainer.SetPosition( 0, TOOLBAR_HEIGHT ); - textContainer.SetSize( stage.GetSize().width, stage.GetSize().height - TOOLBAR_HEIGHT ); - - mContentLayer.Add( textContainer ); - - // Add data - for( int i = 0; i < NUM_TABLE_STRINGS; ++i ) - { - const TableString& tableString = TABLE_STRINGS[ i ]; - - Dali::TextStyle textStyle; - textStyle.SetFontName( tableString.fontName ); - textStyle.SetFontStyle( tableString.fontStyle ); - textStyle.SetFontPointSize( Dali::PointSize( DemoHelper::ScalePointSize( tableString.fontSize ) ) ); - textStyle.SetWeight( tableString.fontWeight ); - textStyle.SetTextColor( tableString.fontColour ); - - Toolkit::TextView textView = Toolkit::TextView::New( tableString.text ); - textView.SetStyleToCurrentText( textStyle ); - textView.SetOrientation( Dali::Degree( tableString.orientation ), Vector3( 0.0f, 0.0f, 1.0f ) ); - textView.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS ); - - Toolkit::Alignment alignmentContainer = Toolkit::Alignment::New( tableString.horizontalAlignment, tableString.verticalAlignment ); - Actor alignmentContainerActor = alignmentContainer; - alignmentContainerActor.SetPadding( Padding( tableString.padding, tableString.padding, tableString.padding, tableString.padding ) ); - alignmentContainer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); - alignmentContainer.Add( textView ); - - textContainer.AddChild( alignmentContainer, Toolkit::TableView::CellPosition( tableString.cellPosition.row, tableString.cellPosition.column, tableString.cellPosition.rowSpan, tableString.cellPosition.columnSpan ) ); - } - } - - void OnKeyEvent( const KeyEvent& event ) - { - if( event.state == KeyEvent::Down ) - { - if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) - { - // Exit application when click back or escape. - mApplication.Quit(); - } - } - } - -private: - - Application& mApplication; - Toolkit::View mView; ///< The View instance. - Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - Layer mContentLayer; ///< Content layer - -}; - -void RunTest( Application& application ) -{ - TextViewController test( application ); - - application.MainLoop(); -} - -// Entry point for Linux & Tizen applications -// -int main( int argc, char **argv ) -{ - Application application = Application::New( &argc, &argv ); - - RunTest( application ); - - return 0; -} diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec index a24fa0a..68ba117 100755 --- a/packaging/com.samsung.dali-demo.spec +++ b/packaging/com.samsung.dali-demo.spec @@ -2,7 +2,7 @@ Name: com.samsung.dali-demo Summary: The OpenGLES Canvas Core Demo -Version: 1.0.36 +Version: 1.0.37 Release: 1 Group: System/Libraries License: Apache-2.0 @@ -22,6 +22,7 @@ BuildRequires: dali-toolkit-devel BuildRequires: dali-adaptor-devel BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(egl) +BuildRequires: gettext-tools %description The OpenGLES Canvas Core Demo is a collection of examples and demonstrations @@ -37,6 +38,8 @@ of the capability of the toolkit. %define dali_xml_file_dir /usr/share/packages/ %define dali_icon_dir /usr/share/icons/ %define smack_rule_dir /etc/smack/accesses2.d/ +%define locale_dir %{dali_app_ro_dir}/res/locale +%define local_style_dir ../../resources/style/mobile ############################## # Build @@ -50,7 +53,7 @@ LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -fPIC" CXXFLAGS+=" -D_ARCH_ARM_" %endif -cd %{_builddir}/%{name}-%{version}/build/tizen && cmake -DDALI_APP_DIR=%{dali_app_ro_dir} . +cd %{_builddir}/%{name}-%{version}/build/tizen && cmake -DDALI_APP_DIR=%{dali_app_ro_dir} -DLOCALE_DIR=%{locale_dir} -DLOCAL_STYLE_DIR=%{local_style_dir} . make %{?jobs:-j%jobs} @@ -108,8 +111,10 @@ exit 0 %{dali_app_ro_dir}/images/* %{dali_app_ro_dir}/models/* %{dali_app_ro_dir}/scripts/* +%{dali_app_ro_dir}/style/* %{dali_xml_file_dir}/%{name}.xml %{dali_icon_dir}/* +%{locale_dir}/* %if 0%{?enable_dali_smack_rules} && !%{with wayland} %config %{smack_rule_dir}/%{name}.rule %endif diff --git a/resources/scripts/animated-colors.json b/resources/scripts/animated-colors.json index 2b930e8..a7e268c 100644 --- a/resources/scripts/animated-colors.json +++ b/resources/scripts/animated-colors.json @@ -988,12 +988,12 @@ ] }, { - "type": "TextView", + "type": "TextLabel", "name": "text", "parent-origin": "CENTER", "anchor-point": "CENTER", - "text": "START", - "markup-enabled": true, + "text": "START", + "point-size": 20, "signals": [ { "name": "tapped", diff --git a/resources/scripts/animation.json b/resources/scripts/animation.json index 7a5f8aa..0383037 100644 --- a/resources/scripts/animation.json +++ b/resources/scripts/animation.json @@ -85,7 +85,7 @@ // a tree of actors "stage": [{ "name": "greeting", - "type": "TextView", + "type": "TextLabel", "text": "Touch me", "styles": ["basic-text"], "position": [0, -120, 0], @@ -98,7 +98,7 @@ }] }, { "name":"greeting2", - "type": "TextView", + "type": "TextLabel", "parent-origin": "CENTER", "anchor-point": "CENTER", "size": [200, 200, 1], @@ -111,7 +111,7 @@ "animation": "path-animation" }] }, { - "type": "TextView", // styles can be additive + "type": "TextLabel", // styles can be additive "parent-origin": "CENTER", "anchor-point": "CENTER", "size": [200, 200, 1], diff --git a/resources/scripts/background-color.json b/resources/scripts/background-color.json index dcf8103..4d6051b 100644 --- a/resources/scripts/background-color.json +++ b/resources/scripts/background-color.json @@ -16,9 +16,9 @@ */ { "stage": [ - // A TextView with a red background + // A TextLabel with a red background { - "type": "TextView", + "type": "TextLabel", "text": "Hello World", "parent-origin": "TOP_CENTER", "anchor-point": "TOP_CENTER", diff --git a/resources/scripts/button.json b/resources/scripts/button.json index 392f97d..cfb44df 100644 --- a/resources/scripts/button.json +++ b/resources/scripts/button.json @@ -25,7 +25,7 @@ "parent-origin": "TOP_CENTER", "anchor-point": "TOP_CENTER", "position": [0, 0, 0], - "size": [0, 200, 0], + "size": [400, 200, 0], "normal-state-actor": { "type": "ImageActor", "image": { @@ -39,7 +39,7 @@ } }, "label-actor": { - "type": "TextView", + "type": "TextLabel", "text": "Normal" } }, @@ -50,9 +50,9 @@ "parent-origin": "CENTER", "anchor-point": "CENTER", "position": [0, 0, 0], - "size": [0, 200, 0], + "size": [400, 200, 0], "label-actor": { - "type": "TextView", + "type": "TextLabel", "text": "Disabled" }, "disabled": true, @@ -83,9 +83,9 @@ "parent-origin": "BOTTOM_CENTER", "anchor-point": "BOTTOM_CENTER", "position": [0, 0, 0], - "size": [0, 200, 0], + "size": [400, 200, 0], "label-actor": { - "type": "TextView", + "type": "TextLabel", "text": "Toggle" }, "togglable": true, @@ -111,7 +111,7 @@ "actor": "toggle-button", "property": "label-actor", "value": { - "type": "TextView", + "type": "TextLabel", "text": "Using a 9-patch image" } }] diff --git a/resources/scripts/formatted-text.json b/resources/scripts/formatted-text.json deleted file mode 100644 index 82dac7c..0000000 --- a/resources/scripts/formatted-text.json +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - // a tree of actors - "stage": [{ - "type": "Actor", - "size": [400, 400, 1], - "parent-origin": "CENTER", - "actors": [{ - "type": "TextView", - "size": [400, 400, 1], - "text": "", - "markup-enabled": true, - "multiline-policy": "SplitByNewLineChar", - "horizontal-alignment": "HorizontalCenter", - "vertical-alignment": "VerticalBottom", - "width-exceed-policy": "Fade", - "line-justification": "Center", - "fade-boundary": [50, 50, 0, 0], - "line-height-offset": 25.0, - "parent-origin": "TOP_CENTER" - }, { - "type": "TextView", - "size": [400, 400, 1], - "text": "Text with\n'markup-enabled':false", - "markup-enabled": false, - "multiline-policy": "SplitByWord", - "horizontal-alignment": "HorizontalLeft", - "vertical-alignment": "VerticalTop", - "width-exceed-policy": "ShrinkToFit", - "height-exceed-policy": "Original", - "line-justification": "Right", - "line-height-offset": 5.0, - "parent-origin": "BOTTOM_CENTER" - }] - }] -} diff --git a/resources/scripts/hello-world.json b/resources/scripts/hello-world.json index abbeb5e..f92b710 100644 --- a/resources/scripts/hello-world.json +++ b/resources/scripts/hello-world.json @@ -17,7 +17,7 @@ { // a tree of actors "stage": [{ - "type": "TextView", + "type": "TextLabel", "text": "Hello World", "parent-origin": "CENTER" }] diff --git a/resources/scripts/music-library.json b/resources/scripts/music-library.json index f0a8e4f..163412b 100644 --- a/resources/scripts/music-library.json +++ b/resources/scripts/music-library.json @@ -132,7 +132,7 @@ "type": "Control", "actors": [ { - "type": "TextView", + "type": "TextLabel", "actors": [], "name": "Time", "position": [ @@ -147,8 +147,8 @@ 1 ], "sizeAspectRatio": false, - "markup-enabled": true, - "text": "12:30" + "text": "12:30", + "point-size": 10 } ], "name": "Indicators", diff --git a/resources/scripts/navigation.json b/resources/scripts/navigation.json index f54a71b..d09feac 100644 --- a/resources/scripts/navigation.json +++ b/resources/scripts/navigation.json @@ -31,7 +31,7 @@ "title": "title", "sub-title": "sub title", "actors": [{ - "type": "TextView", // styles can be additive + "type": "TextLabel", // styles can be additive "parent-origin": [0.5, 0.5, 0], "anchor-point": [0.5, 0.5, 0], "size": [200, 200, 1], @@ -47,13 +47,13 @@ "type": "Page", "name": "page2", "actors": [{ - "type": "TextView", // styles can be additive + "type": "TextLabel", // styles can be additive "parent-origin": [0.5, 0.5, 0.5], "anchor-point": [0.5, 0.5, 0.5], "size": [200, 200, 1], "text": "Hello World!" }, { - "type": "TextView", // styles can be additive + "type": "TextLabel", // styles can be additive "parent-origin": [0.0, 0.0, 0.5], "anchor-point": [0.0, 0.0, 0.5], "size": [200, 200, 1], @@ -64,7 +64,7 @@ "action": "pop" }] }, { - "type": "TextView", // styles can be additive + "type": "TextLabel", // styles can be additive "parent-origin": [1.0, 1.0, 0.5], "anchor-point": [1.0, 1.0, 0.5], "size": [200, 200, 1], diff --git a/resources/scripts/super-blur-view.json b/resources/scripts/super-blur-view.json index dd31564..a273fc6 100644 --- a/resources/scripts/super-blur-view.json +++ b/resources/scripts/super-blur-view.json @@ -65,9 +65,9 @@ "parent-origin": "BOTTOM_CENTER", "anchor-point": "BOTTOM_CENTER", "position": [0, 0, 0], - "size": [0, 100, 0], + "size": [200, 100, 0], "label-actor": { - "type": "TextView", + "type": "TextLabel", "text": "Blur" }, "normal-state-actor": { diff --git a/resources/scripts/table-view.json b/resources/scripts/table-view.json index 85940fa..0a9fdca 100644 --- a/resources/scripts/table-view.json +++ b/resources/scripts/table-view.json @@ -22,8 +22,6 @@ "background-color": [0.5,0.5,0,1], "parent-origin": "CENTER", "size":[400,500,1], - "rows": 4, - "columns":4, "cell-padding": [10, 5], "layout-rows": { // set the height of the rows "0": { "policy": "fixed", "value": 40 }, @@ -38,17 +36,21 @@ "actors": [{ "name":"gallery-1", "type":"ImageActor", + "width-resize-policy":"FILL_TO_PARENT", + "height-resize-policy":"FILL_TO_PARENT", "image": { "filename": "{DALI_IMAGE_DIR}gallery-large-1.jpg" }, "custom-properties": { // properties registered dynamically - "cell-indices": [0,0],// property to specify the top-left cell this child occupies + "cell-indices": [0,0], // property to specify the top-left cell this child occupies "row-span":4, // property to specify how many rows this child occupies, if not set, default value is 1 - "column-spam":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1 + "column-span":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1 } },{ "name":"gallery-2", "type":"ImageActor", + "width-resize-policy":"FILL_TO_PARENT", + "height-resize-policy":"FILL_TO_PARENT", "image": { "filename": "{DALI_IMAGE_DIR}gallery-large-2.jpg" }, @@ -59,6 +61,8 @@ }, { "name":"gallery-3", "type":"ImageActor", + "width-resize-policy":"FILL_TO_PARENT", + "height-resize-policy":"FILL_TO_PARENT", "image": { "filename": "{DALI_IMAGE_DIR}gallery-large-3.jpg" }, @@ -68,6 +72,8 @@ }, { "name":"gallery-4", "type":"ImageActor", + "width-resize-policy":"FILL_TO_PARENT", + "height-resize-policy":"FILL_TO_PARENT", "image": { "filename": "{DALI_IMAGE_DIR}gallery-large-4.jpg" }, diff --git a/resources/scripts/timing.json b/resources/scripts/timing.json index 74344c3..a5d8024 100644 --- a/resources/scripts/timing.json +++ b/resources/scripts/timing.json @@ -91,6 +91,8 @@ "name": "ControlBack", "parent-origin": "CENTER", "anchor-point": "CENTER", + "width-resize-policy": "FILL_TO_PARENT", + "height-resize-policy": "FILL_TO_PARENT", "position": [ 0, 0, diff --git a/resources/style/demo-theme.json b/resources/style/demo-theme.json new file mode 100644 index 0000000..89650ce --- /dev/null +++ b/resources/style/demo-theme.json @@ -0,0 +1,59 @@ +/* +Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved + +This file is part of Dali Toolkit + +PROPRIETARY/CONFIDENTIAL + +This software is the confidential and proprietary information of +SAMSUNG ELECTRONICS ("Confidential Information"). You shall not +disclose such Confidential Information and shall use it only in +accordance with the terms of the license agreement you entered +into with SAMSUNG ELECTRONICS. + +SAMSUNG make no representations or warranties about the suitability +of the software, either express or implied, including but not limited +to the implied warranties of merchantability, fitness for a particular +purpose, or non-infringement. SAMSUNG shall not be liable for any +damages suffered by licensee as a result of using, modifying or +distributing this software or its derivatives. +*/ + +{ + "styles": + { + "textlabel": + { + "font-family":"HelveticaNeue", + "font-style":"Regular", + "point-size":18 + }, + + "launcherlabel": + { + "point-size":18 + }, + + "toolbarlabel": + { + "point-size":18 + }, + + "builderlabel": + { + "point-size":13 + }, + + "textfield": + { + "font-family":"HelveticaNeue", + "font-style":"Regular", + "point-size":18 + }, + + "scrollview": + { + "overshoot-effect-color":"B018" + } + } +} diff --git a/resources/style/mobile/demo-theme.json b/resources/style/mobile/demo-theme.json new file mode 100644 index 0000000..7ecff98 --- /dev/null +++ b/resources/style/mobile/demo-theme.json @@ -0,0 +1,99 @@ +/* +Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved + +This file is part of Dali Toolkit + +PROPRIETARY/CONFIDENTIAL + +This software is the confidential and proprietary information of +SAMSUNG ELECTRONICS ("Confidential Information"). You shall not +disclose such Confidential Information and shall use it only in +accordance with the terms of the license agreement you entered +into with SAMSUNG ELECTRONICS. + +SAMSUNG make no representations or warranties about the suitability +of the software, either express or implied, including but not limited +to the implied warranties of merchantability, fitness for a particular +purpose, or non-infringement. SAMSUNG shall not be liable for any +damages suffered by licensee as a result of using, modifying or +distributing this software or its derivatives. +*/ + +{ + "styles": + { + "textlabel": + { + "font-family":"SamsungSans", + "font-style":"Regular" + }, + + "textlabel-font-size-0": + { + "point-size":8 + }, + "textlabel-font-size-1": + { + "point-size":10 + }, + "textlabel-font-size-2": + { + "point-size":15 + }, + "textlabel-font-size-3": + { + "point-size":19 + }, + "textlabel-font-size-4": + { + "point-size":25 + }, + + "launcherlabel": + { + "point-size":10 + }, + + "toolbarlabel": + { + "point-size":10 + }, + + "builderlabel": + { + "point-size":10 + }, + + "textfield": + { + "font-family":"SamsungSans", + "font-style":"Regular" + }, + + "textfield-font-size-0": + { + "point-size":10 + }, + "textfield-font-size-1": + { + "point-size":10 + }, + "textfield-font-size-2": + { + "point-size":10 + }, + "textfield-font-size-3": + { + "point-size":10 + }, + "textfield-font-size-4": + { + "point-size":10 + }, + + "scrollview": + { + "overshoot-effect-color":"B018" + } + } +} diff --git a/shared/dali-demo-strings.h b/shared/dali-demo-strings.h new file mode 100644 index 0000000..6354fa9 --- /dev/null +++ b/shared/dali-demo-strings.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* This header file includes all multi language strings which need display */ +#ifndef __DALI_DEMO_STRINGS_H__ +#define __DALI_DEMO_STRINGS_H__ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +#define DALI_DEMO_DOMAIN_LOCAL "dali-demo" + +#define DALI_DEMO_STR_EMPTY _("") + +#ifdef INTERNATIONALIZATION_ENABLED + +#define DALI_DEMO_STR_TITLE_BUBBLES dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_BUBBLES") +#define DALI_DEMO_STR_TITLE_BLOCKS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_BLOCKS") +#define DALI_DEMO_STR_TITLE_CLUSTER dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_CLUSTER") +#define DALI_DEMO_STR_TITLE_CUBE_TRANSITION dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_CUBE_TRANSITION") +#define DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION") +#define DALI_DEMO_STR_TITLE_ITEM_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ITEM_VIEW") +#define DALI_DEMO_STR_TITLE_MAGNIFIER dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MAGNIFIER") +#define DALI_DEMO_STR_TITLE_MOTION_BLUR dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MOTION_BLUR") +#define DALI_DEMO_STR_TITLE_MOTION_STRETCH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MOTION_STRETCH") +#define DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW") +#define DALI_DEMO_STR_TITLE_RADIAL_MENU dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RADIAL_MENU") +#define DALI_DEMO_STR_TITLE_REFRACTION dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_REFRACTION") +#define DALI_DEMO_STR_TITLE_SCROLL_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCROLL_VIEW") +#define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS") +#define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI") +#define DALI_DEMO_STR_TITLE_IMAGE_SCALING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_SCALING") +#define DALI_DEMO_STR_TITLE_TEXT_LABEL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_LABEL") +#define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE") +#define DALI_DEMO_STR_TITLE_EMOJI_TEXT dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_EMOJI_TEXT") +#define DALI_DEMO_STR_TITLE_ANIMATED_SHAPES dgettext(DALI_DEMO_STR_TITLE_ANIMATED_SHAPES) +#define DALI_DEMO_STR_TITLE_PATH_ANIMATION dgettext(DALI_DEMO_STR_TITLE_PATH_ANIMATION) + +#else // !INTERNATIONALIZATION_ENABLED + +#define DALI_DEMO_STR_TITLE_BUBBLES "Bubbles" +#define DALI_DEMO_STR_TITLE_BLOCKS "Blocks" +#define DALI_DEMO_STR_TITLE_CLUSTER "Cluster" +#define DALI_DEMO_STR_TITLE_CUBE_TRANSITION "Cube Effect" +#define DALI_DEMO_STR_TITLE_DISSOLVE_TRANSITION "Dissolve Effect" +#define DALI_DEMO_STR_TITLE_ITEM_VIEW "Item View" +#define DALI_DEMO_STR_TITLE_MAGNIFIER "Magnifier" +#define DALI_DEMO_STR_TITLE_MOTION_BLUR "Motion Blur" +#define DALI_DEMO_STR_TITLE_MOTION_STRETCH "Motion Stretch" +#define DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW "Page Turn View" +#define DALI_DEMO_STR_TITLE_RADIAL_MENU "Radial Menu" +#define DALI_DEMO_STR_TITLE_REFRACTION "Refract Effect" +#define DALI_DEMO_STR_TITLE_SCROLL_VIEW "Scroll View" +#define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS "Lights and shadows" +#define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI "Script Based UI" +#define DALI_DEMO_STR_TITLE_IMAGE_SCALING "Image Scaling Modes" +#define DALI_DEMO_STR_TITLE_TEXT_LABEL "Text Label" +#define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE "Text Scripts" +#define DALI_DEMO_STR_TITLE_EMOJI_TEXT "Emoji Text" +#define DALI_DEMO_STR_TITLE_ANIMATED_SHAPES "Animated Shapes" +#define DALI_DEMO_STR_TITLE_PATH_ANIMATION "Animated Path" + +#endif + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // __DALI_DEMO_STRINGS_H__ diff --git a/shared/multi-language-strings.h b/shared/multi-language-strings.h new file mode 100644 index 0000000..ffa8e6c --- /dev/null +++ b/shared/multi-language-strings.h @@ -0,0 +1,195 @@ +#ifndef __DALI_DEMO_MULTI_LANGUAGE_STRINGS_H__ +#define __DALI_DEMO_MULTI_LANGUAGE_STRINGS_H__ + +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +namespace MultiLanguageStrings +{ + struct Language + { + std::string languageName; + std::string languageRomanName; + std::string text; + }; + + const Language LANGUAGES[] = { + { + "العَرَبِيةُ", + "(Arabic)", + "لإعادة ترتيب الشاشات، يجب تغيير نوع العرض إلى شبكة قابلة للتخصيص." + }, + { + "অসমীয়া লিপি", + "(Assamese)", + "পৃষ্ঠাসমূহ পুনঃব্যৱস্থিত কৰিবলৈ, আপুনি দৰ্শনৰ প্ৰকাৰ এটা অনুকূলনযোগ্য গ্ৰীডলৈ পৰিৱৰ্তন কৰাটো আৱশ্যক৷" + }, + { + "বাংলা", + "(Bengali)", + "তথ্য লোড করতে অক্ষম৷ পুনরায় চেষ্টা করতে ট্যাপ করুন৷" + }, + { + "English", + "(English)", + "A Quick Brown Fox Jumps Over The Lazy Dog" + }, + { + "Español", + "(Spanish)", + "No se puede añadir más aplicaciones. Se alcanzó la cantidad máxima." + }, + { + "فارسی", + "(Persian)", + "برای مرتب کردن مجدد صفحه‌ها، باید نوع نمایش را به یک نمای شبکه‌ای قابل تنظیم تغییر دهید." + }, + { + "Français", + "(French)", + "La nouvelle page sera composée des Dynamic Box S Planner, Tâches et S Memo" + }, + { + "ગુજરાતી લિપિ", + "(Gujarati)", + "પૃષ્ઠોને ફરીથી ગોઠવવા માટે, તમારે દૃશ્ય પ્રકારને કસ્ટમાઇઝેશન યોગ્ય ગ્રિડ પર બદલવાની જરૂર છે." + }, + { + "हिन्दी", + "(Hindi)", + "पेज पुनः व्यवस्थित करने के लिए, आपको दृश्य प्रकार को अनुकूलित करने योग्य ग्रिड में बदलना होगा।" + }, + { + "Bahasa Indonesia", + "(Indonesian)", + "Tidak dapat menambahkan aplikasi lagi. Jumlah maksimum aplikasi tercapai." + }, + { + "ខេមរភាសា", + "(Cambodian)", + "ដើម្បី​រៀបចំ​ទំព័រ​ឡើងវិញ អ្នក​ត្រូវ​ប្ដូរ​ប្រភេទ​បង្ហាញ​ទៅ​ក្រឡាចត្រង្គ​ដែល​អាច​ប្ដូរ​តាមបំណង។" + }, + { + "ಕನ್ನಡ ", + "(Kannada)", + "ಪುಟಗಳನ್ನು ಮರುವ್ಯವಸ್ಥಿತವಾಗಿ ಇರಿಸಲು, ನೀವು ವೀಕ್ಷಣೆ ವಿಧವನ್ನು ಗ್ರಾಹಕೀಕರಿಸಬಲ್ಲ ಗ್ರಿಡ್‌ಗೆ ಬದಲಾಯಿಸುವುದು ಅಗತ್ಯವಿದೆ." + }, + { + "한국어", + "(Korean)", + "페이지 순서를 변경하려면 보기 방식을 격자 보기(직접 설정)로 변경하세요." + }, + { + "ພາສາລາວ", + "(Lao)", + "ເພື່ອຈັດລຽງໜ້າຄືນ, ທ່ານຈໍາເປັນຕ້ອງປ່ຽນຊະນິດຂອງມຸມມອງໄປຫາຕາຕະລາງທີ່ກຳນົດເອງໄດ້." + }, + { + "മലയാളം", + "(Malayalam)", + "പേജുകൾ പുനഃക്രമീകരിക്കുന്നതിന്, ഇഷ്ടാനുസൃതമാക്കാവുന്ന ഗ്രിഡിലേക്ക് കാഴ്ചയുടെ തരം നിങ്ങൾ മാറ്റേണ്ടതുണ്ട്." + }, + { + "मराठी", + "(Marathi)", + "पृष्‍ठांची पुनर्रचना करा, आपण सानुकूलित करण्‍यायोग्‍य ग्रिडमध्‍ये व्‍ह्यू प्रकार बदलणे गरजेचे आहे." + }, + { + "Bahasa Melayu", + "(Malay)", + "Tidak boleh menambah aplikasi lagi. Bilangan maksimum aplikasi dicapai." + }, + { + "မြန်မာဘာသာ", + "(Burmese)", + "စာမ်က္ႏွာမ်ား ျပန္စီစဥ္ရန္ အျမင္ပံုစံကို စိတ္ၾကိဳက္လုပ္ႏိုင္ေသာ ဂရစ္ တစ္ခုသို႔ ေျပာင္းဖို႔လိုသည္။" + }, + { + "नेपाली", + "(Nepali)", + "थप अनुप्रयोगहरू थप्न सकिएन। अनुप्रयोगहरूको अधिकतम संख्या पुग्यो।" + }, + { + "ଓଡ଼ିଆ", + "(Oriya)", + "ପରବର୍ତ୍ତୀ ପୃଷ୍ଠା ଦେଖିବା ପାଇଁ ଦୁଇ ଆଙ୍ଗୁଠିରେ ସ୍ୱାଇପ୍ କରନ୍ତୁ।" + }, + { + "ਗੁਰਮੁਖੀ", + "(Punjabi)", + "ਇਹ ਫੋਲਡਰ ਅਤੇ ਇਸ ਵਿੱਚ ਸ਼ਾਮਲ ਸਾਰੇ ਆਈਟਮਾਂ ਨੂੰ ਮਿਟਾ ਦੇਵੇਗਾ।" + }, + { + "Português", + "(Portuguese)", + "Para reorganizar páginas, é necessário alterar o tipo de exibição para uma grade personalizável." + }, + { + "සිංහල", + "(Sinhala)", + "පිටු නැවත පෙළ ගැස්වීම සඳහා ඔබ විසින් දසුන් ප්‍රවර්ගය අභිමතීකෘත්‍ය ජාලයකට වෙනස් කළ යුතුය." + }, + { + "தமிழ்", + "(Tamil)", + "பக்கங்களை மறுஒழுங்குபடுத்தவென காட்சி வகையை தனிப்பயனாக்கத்தக்க கட்டமைப்பிற்கு மாற்ற வேண்டியுள்ளது." + }, + { + "తెలుగు", + "(Telugu)", + "మరిన్ని అప్లికేషన్‌లను జోడించడం సాధ్యం కాలేదు. గరిష్ట అప్లికేషన్‌ల సంఖ్యను చేరుకున్నాయి." + }, + { + "ภาษาไทย", + "(Thai)", + "คุณต้องเปลี่ยนชนิดการแสดง เป็นตารางที่กำหนดเองได้ เพื่อจัดหน้าใหม่" + }, + { + "Tagalog", + "(Tagalog)", + "Hindi makapagdagdag ng extra na linya dahil sa paghihigpit sa espasyo" + }, + { + "Türkçe", + "(Turkish)", + "Sayfaları yeniden düzenlemek için özelleştirilebilir kılavuzun görünüm tipini değiştirmeniz gerekir." + }, + { + "اُردُو", + "(Urdu)", + "صفحات کو دوبارہ ترتیب دینے کے لئے، آپ کو منظر کی قسم کو ایک حسب ضرورت گرڈ میں تبدیل کرنا ہوگا۔" + }, + { + "tiếng Việt", + "(Vietnamese)", + "Để sắp xếp lại các trang, bạn cần thay đổi kiểu xem sang dạng lưới tùy chỉnh." + }, + { + "漢語", + "(Chinese)", + "若要重新排列页面,您需要将视图类型更改为可自定义网格。" + }, + }; + + const unsigned int NUMBER_OF_LANGUAGES = 31u; + +} // MultiLanguageStrings + +#endif // __DALI_DEMO_MULTI_LANGUAGE_STRINGS_H__ diff --git a/shared/view.h b/shared/view.h index f456182..1a87f67 100644 --- a/shared/view.h +++ b/shared/view.h @@ -45,15 +45,18 @@ const ViewStyle DEFAULT_VIEW_STYLE( 0.1f, 0.7f, 80.f, 4.f ); const char* DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNue"); const char* DEFAULT_TEXT_STYLE_FONT_STYLE("Regular"); -const Dali::PointSize DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); -const Dali::TextStyle::Weight DEFAULT_TEXT_STYLE_WEIGHT(Dali::TextStyle::EXTRALIGHT); +const float DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); const Dali::Vector4 DEFAULT_TEXT_STYLE_COLOR(0.0f, 0.0f, 0.0f, 1.0f); const Dali::Toolkit::Alignment::Padding DEFAULT_PLAY_PADDING(12.0f, 12.0f, 12.0f, 12.0f); const Dali::Toolkit::Alignment::Padding DEFAULT_MODE_SWITCH_PADDING(8.0f, 8.0f, 8.0f, 8.0f); -static Dali::TextStyle defaultTextStyle; -static bool textStyleSet=false; +void RequestThemeChange() +{ + // Provide the stylesheet + Dali::Toolkit::StyleManager styleManager = Dali::Toolkit::StyleManager::Get(); + styleManager.RequestThemeChange( DALI_DEMO_THEME_PATH ); +} float ScalePointSize(int pointSize) { @@ -62,27 +65,13 @@ float ScalePointSize(int pointSize) return pointSize * 220.0f / meanDpi; // 220 is the default horizontal DPI defined in adaptor Application } -Dali::TextStyle& GetDefaultTextStyle() -{ - if(!textStyleSet) - { - defaultTextStyle.SetFontName(DEFAULT_TEXT_STYLE_FONT_FAMILY); - defaultTextStyle.SetFontStyle(DEFAULT_TEXT_STYLE_FONT_STYLE); - defaultTextStyle.SetFontPointSize(Dali::PointSize(ScalePointSize(DEFAULT_TEXT_STYLE_POINT_SIZE))); - defaultTextStyle.SetWeight(DEFAULT_TEXT_STYLE_WEIGHT); - defaultTextStyle.SetTextColor(DEFAULT_TEXT_STYLE_COLOR); - textStyleSet = true; - } - - return defaultTextStyle; -} - Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, const std::string& toolbarImagePath, const std::string& title, - const ViewStyle& style, - const Dali::TextStyle& textStyle ) + const ViewStyle& style ) { + Dali::Stage stage = Dali::Stage::GetCurrent(); + Dali::Layer toolBarLayer = Dali::Layer::New(); toolBarLayer.SetName( "TOOLBAR_LAYER" ); toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); @@ -109,20 +98,22 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, // Add the tool bar to the too bar layer. toolBarLayer.Add( toolBar ); - Dali::Font font = Dali::Font::New(); - // Tool bar text. if( !title.empty() ) { - Dali::Toolkit::TextView titleActor = Dali::Toolkit::TextView::New(); - titleActor.SetName( "TOOLBAR_TITLE" ); - titleActor.SetText( title ); - titleActor.SetSize( font.MeasureText( title ) ); - titleActor.SetStyleToCurrentText(textStyle); + Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New(); + label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT ); + label.SetDrawMode( Dali::DrawMode::OVERLAY ); + label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" ); + label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title ); + label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); + label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); + label.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::HEIGHT ); + label.SetColor( DEFAULT_TEXT_STYLE_COLOR ); // Add title to the tool bar. const float padding( style.mToolBarPadding ); - toolBar.AddControl( titleActor, style.mToolBarTitlePercentage, Dali::Toolkit::Alignment::HorizontalCenter, Dali::Toolkit::Alignment::Padding( padding, padding, padding, padding ) ); + toolBar.AddControl( label, style.mToolBarTitlePercentage, Dali::Toolkit::Alignment::HorizontalCenter, Dali::Toolkit::Alignment::Padding( padding, padding, padding, padding ) ); } return toolBarLayer; @@ -134,8 +125,7 @@ Dali::Layer CreateView( Dali::Application& application, const std::string& backgroundImagePath, const std::string& toolbarImagePath, const std::string& title, - const ViewStyle& style, - const Dali::TextStyle& textStyle ) + const ViewStyle& style = DEFAULT_VIEW_STYLE ) { Dali::Stage stage = Dali::Stage::GetCurrent(); @@ -163,7 +153,7 @@ Dali::Layer CreateView( Dali::Application& application, //application.GetOrientation().ChangedSignal().Connect( &view, &Dali::Toolkit::View::OrientationChanged ); // Create default ToolBar - Dali::Layer toolBarLayer = CreateToolbar( toolBar, toolbarImagePath, title, style, textStyle ); + Dali::Layer toolBarLayer = CreateToolbar( toolBar, toolbarImagePath, title, style ); // Add tool bar layer to the view. view.AddContentLayer( toolBarLayer ); @@ -179,19 +169,19 @@ Dali::Layer CreateView( Dali::Application& application, return contentLayer; } -Dali::Layer CreateView( Dali::Application& application, - Dali::Toolkit::View& view, - Dali::Toolkit::ToolBar& toolBar, - const std::string& backgroundImagePath, - const std::string& toolbarImagePath, - const std::string& title, - const ViewStyle& style = DEFAULT_VIEW_STYLE ) +Dali::Toolkit::TextLabel CreateToolBarLabel( const std::string& text ) { - return CreateView( application, view, toolBar, backgroundImagePath, toolbarImagePath, title, style, - GetDefaultTextStyle() ); + Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( text ); + label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" ); + label.SetDrawMode( Dali::DrawMode::OVERLAY ); + label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); + label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); + label.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::HEIGHT ); + label.SetColor( DEFAULT_TEXT_STYLE_COLOR ); + + return label; } - } // DemoHelper #endif // __DALI_DEMO_HELPER_VIEW_H__