cd automated-tests
./build.sh
-This will build dali and dali-internal test sets.
+This will build dali-toolkit and dali-toolkit-internal test sets.
Test sets can be built individually:
- ./build.sh dali
+ ./build.sh dali-toolkit
They can also be built without regenerating test case scripts (Useful for quicker rebuilds)
- ./build.sh -n dali-internal
+ ./build.sh -n dali-toolkit-internal
Or without cleaning down the build area (Useful for fast build/run/debug cycles)
- ./build.sh -n -r dali-internal
+ ./build.sh -n -r dali-toolkit-internal
Executing the tests
[enable_debug=$enableval],
[enable_debug=no])
-# option for JavaScript plugin
-AC_ARG_ENABLE(javascript,
+# option to build JavaScript plugin
+# configure settings and output
+# --enable-javascript // enable_javascript = yes
+# --enable-javascript=yes // enable_javascript = yes
+# --enable-javascript=no // enable_javascript = no
+# --disable-javascript // enable_javascript = no
+# no setting // enable_javascript = automatic ( enable if v8 present)
+AC_ARG_ENABLE([javascript],
[AC_HELP_STRING([--enable-javascript],
- [Enable JavaScript plugin])] ,
- [enable_javascript=yes],
- [enable_javascript=no])
+ [Enable JavaScript plugin])] ,
+ [enable_javascript=$enableval],
+ [enable_javascript=automatic])
+
if test "x$enable_debug" = "xyes"; then
DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDEBUG_ENABLED"
- DALI_SCRIPTV8_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDEBUG_ENABLED"
fi
if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
- DALI_SCRIPTV8_CFLAGS="$DALI_TOOLKIT_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
fi
-#set a variable for the makefile to conditionally compile the plugin
-AM_CONDITIONAL([ENABLE_JAVASCRIPT_PLUGIN], [test x$enable_javascript = xyes])
+
# Tizen Profile options
dataReadOnlyDir=${prefix}/share/dali/
fi
+# v8 version 4+ requires c++11
+PKG_CHECK_MODULES(V8, v8 = 3.32.7, [ pkg_check_v8=yes ], [ pkg_check_v8=no ] )
+
+# Rules for building JavaScript plugin
+# If enable_javascript=yes and v8 installed = build javascript
+# If enable_javascript=automatic and v8 installed = build javascript
+# If enable_javascript=yes and v8 not installed = throw an error
+build_javascript_plugin=no
+if test x$enable_javascript = xyes; then
+ if test x$pkg_check_v8 = xno; then
+ [build_javascript_plugin=no]
+ AC_MSG_ERROR("V8 not found or incorrect version installed")
+ AC_MSG_NOTICE("To disable building of JavaScript plugin use --disable-javascript")
+ else
+ [build_javascript_plugin=yes]
+ AC_MSG_NOTICE(V8 library found. Building DALi JavaScript plugin)
+ fi
+fi
+if test x$enable_javascript = xautomatic && test x$pkg_check_v8 = xyes; then
+ [build_javascript_plugin=yes]
+ AC_MSG_NOTICE( V8 library found. Automatic building of JavaScript plugin. Use use --disable-javascript to disable)
+fi
+
+
+#set a variable for the makefile to force compile the JAvaSplugin
+AM_CONDITIONAL([ENABLE_JAVASCRIPT_PLUGIN], [test x$build_javascript_plugin = xyes])
+
AC_SUBST(dataReadWriteDir)
AC_SUBST(dataReadOnlyDir)
AC_SUBST(DALI_TOOLKIT_CFLAGS)
-AC_SUBST(DALI_SCRIPTV8_CFLAGS)
-AC_SUBST(DALI_SCRIPTV8_LIBS)
+
# Specify the include directory for development headers
#devincludepath=${includedir}/dali/internal
-------------
Prefix: $prefix
Debug Build: $enable_debug
- JavaScript support (V8 required) $enable_javascript
+ JavaScript support (V8 required) $build_javascript_plugin
Profile: $dali_profile
Data Dir (Read/Write): $dataReadWriteDir
Data Dir (Read Only): $dataReadOnlyDir
include ../../../plugins/dali-script-v8/file.list
-DALI_SCRIPTV8_LIBS="-lv8 -lpthread"
lib_LTLIBRARIES = libdali-script-plugin-v8.la
-DDALI_DATA_READ_ONLY_DIR="\"${dataReadOnlyDir}\"" \
$(DALI_CFLAGS) \
$(DLOG_CFLAGS) \
- $(DALI_SCRIPTV8_CFLAGS) \
-I../../.. \
$(script_plugin_v8_includes) \
+ $(V8_CFLAGS) \
-Werror -Wall
libdali_script_plugin_v8_la_LIBADD = \
$(DALICORE_LIBS) \
$(DALI_LIBS) \
$(DLOG_LIBS) \
- $(DALI_SCRIPTV8_LIBS)
+ $(V8_LIBS)
libdali_script_plugin_v8_la_LDFLAGS = \
-rdynamic
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 34;
+const unsigned int TOOLKIT_MICRO_VERSION = 35;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.0.34
+Version: 1.0.35
Release: 1
Group: System/Libraries
License: Apache-2.0
var anim = new dali.Animation( 4 );
var rotation = new dali.Rotation( 90, 0, 0 ); // pitch, yaw, roll
- anim.animateBy( actor, "rotation", rotation );
+ anim.animateBy( actor, "orientation", rotation );
anim.play();
return true;
}
function createAnimation() {
var startRotation = new dali.Rotation(180, -180, 0);
- myActor1.rotation = startRotation;
- myActor2.rotation = startRotation;
+ myActor1.orientation = startRotation;
+ myActor2.orientation = startRotation;
dali.stage.add( myActor1 );
dali.stage.add( myActor2 );
var endRotation = new dali.Rotation(0,0,0);
animOptions.alpha = "easeInOutSine";
- anim.animateTo(myActor1, "rotation", endRotation, animOptions);
+ anim.animateTo(myActor1, "orientation", endRotation, animOptions);
// Delay the myActor2 by a second
animOptions.delay = 0.0;
// rotate back to correct orientation
animOptions.alpha = "easeInOutSine";
- anim.animateTo(myActor2, "rotation", endRotation, animOptions);
+ anim.animateTo(myActor2, "orientation", endRotation, animOptions);
return anim;
}
// also rotate the imageActor 90 degrees at the same time.
var rotation = new dali.Rotation(90,0,0,1);
-shaderAnim.animateTo(imageActor, "rotation", rotation, { alpha:"linear", duration:duration, delay:delay });
+shaderAnim.animateTo(imageActor, "orientation", rotation, { alpha:"linear", duration:duration, delay:delay });
shaderAnim.play();
Shader effects provide a visual effect for actors.
-For a Custom shader you can provide the vertex and fragment shader code as strings.
+You can create a type-registered shader effect by its type name.
+```
+// create a new shader effect
+var shader = new dali.ShaderEffect("BlindEffect");
+```
+
+Alternatively you can create a Custom shader by providing the vertex and fragment shader code as strings.
Each shader is provided with default uniforms and attributes.
For a vertex shader this part contains the following code:
```
dali.stage.add( imageActor );
// start it of tilted around the y-axis
-imageActor.rotation=new dali.Rotation(90, 0, 1, 0);
+imageActor.orientation=new dali.Rotation(90, 0, 1, 0);
var twistEffect = createTwistEffect();
imageActor.setShaderEffect( twistEffect );
bool found( false );
Property::Value rotation = V8Utils::GetPropertyValueParameter( PARAMETER_0, found, isolate, args );
- if( rotation.GetType() != Property::ORIENTATION )
+ if( rotation.GetType() != Property::ROTATION )
{
DALI_SCRIPT_EXCEPTION( isolate, "Rotation parameter missing" );
return;
MESH_ACTOR =3,
LAYER_ACTOR =4,
CAMERA_ACTOR =5,
- LIGHT_ACTOR =6,
- TEXT_VIEW =7
+ TEXT_VIEW =6
};
/**
// Context = multiple contexts can exist in a given Isolate, and share data between contexts
v8::Handle<v8::Context> context = v8::Context::New( mIsolate, NULL, global);
- mGlobalObjectTemplate.Reset( mIsolate, global);
+ mGlobalObjectTemplate.Reset( mIsolate, global);
mContext.Reset( mIsolate, context);
}
{
if( !mIsolate )
{
- v8::V8::Initialize();
v8::V8::InitializeICU();
+
+ v8::V8::Initialize();
+
+ // default isolate removed from V8 version 3.27.1 and beyond.
+ mIsolate = v8::Isolate::New();
+ mIsolate->Enter();
+
v8::V8::SetFatalErrorHandler( FatalErrorCallback );
- mIsolate = v8::Isolate::GetCurrent();
+
}
// if context is null, create it and add dali object to the global object.
if( mContext.IsEmpty())
// CLASS HEADER
#include "shader-effect-api.h"
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/type-registry.h>
+
// INTERNAL INCLUDES
#include <v8-utils.h>
#include <shader-effects/shader-effect-wrapper.h>
*/
ShaderEffect ShaderEffectApi::New( v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
{
-
-
v8::HandleScope handleScope( isolate );
- ShaderParameters shaderParams;
-
if( args[0]->IsObject() )
{
+ ShaderParameters shaderParams;
+
v8::Local<v8::Object > obj = args[0]->ToObject();
v8::Local<v8::Value> geometryTypeValue = obj->Get(v8::String::NewFromUtf8( isolate, "geometryType"));
}
shaderParams.ProcessHintsArray( hintsArray );
}
+
+ return shaderParams.NewShader();
}
- return shaderParams.NewShader();
+ else
+ {
+ ShaderEffect effect;
+
+ bool found( false );
+ std::string typeName = V8Utils::GetStringParameter( PARAMETER_0, found, isolate, args );
+ if( !found )
+ {
+ DALI_SCRIPT_EXCEPTION( isolate, "string parameter missing" );
+ }
+ else
+ {
+ // create a new shader effect based on type, using the type registry.
+ Dali::TypeInfo typeInfo = Dali::TypeRegistry::Get().GetTypeInfo( typeName );
+ if( typeInfo ) // handle, check if it has a value
+ {
+ Dali::BaseHandle handle = typeInfo.CreateInstance();
+ if( handle )
+ {
+ effect = ShaderEffect::DownCast( handle );
+ }
+ }
+ else
+ {
+ DALI_SCRIPT_EXCEPTION(isolate,"Unknown shader effect type");
+ }
+ }
+ return effect;
+ }
}
ShaderEffect ShaderEffectApi::GetShaderEffectFromParams( int paramIndex,
}
Dali::ShaderEffect shaderEffect = ShaderEffectApi::New( isolate, args );
- v8::Local<v8::Object> localObject = WrapShaderEffect( isolate, shaderEffect );
- args.GetReturnValue().Set( localObject );
+ if(shaderEffect)
+ {
+ v8::Local<v8::Object> localObject = WrapShaderEffect( isolate, shaderEffect );
+ args.GetReturnValue().Set( localObject );
+ }
}
else if (value->IsBooleanObject() )
{
const v8::Local<v8::BooleanObject> object = v8::Local<v8::BooleanObject>::Cast(value);
- return object->ValueOf();
+ return object->BooleanValue();
}
DALI_SCRIPT_EXCEPTION(isolate, "no bool found");
return false;