"{"
"\"stage\":"
"[{"
- "\"type\": \"Actor\","
+ "\"type\": \"Layer\","
"\"size\": [100,100,1],"
"\"parentOrigin\": \"TOP_LEFT\","
"\"anchorPoint\": \"TOP_LEFT\","
+ "\"maximumSize\": [100,100],"
+ "\"orientation\": [10,10,10,10],"
+ "\"clippingBox\": [10,10,10,10],"
"\"signals\": [{"
- "\"name\": \"touched\","
+ "\"name\": \"touch\","
"\"action\": \"quit\""
"}]"
"}]"
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- touchEvent.points.push_back( TouchPoint ( 0, TouchPoint::Down, 10.0f, 10.0f ) );
+ Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ touchEvent.points.push_back( point );
application.ProcessEvent( touchEvent );
DALI_TEST_CHECK( functorCalled );
" \"size\": [200, 200, 1],"
" \"orientation\": [0, 0, 30],"
" \"signals\": [{"
- " \"name\": \"touched\","
+ " \"name\": \"touch\","
" \"action\": \"play\","
" \"animation\": \"animate\""
" }]"
// trigger play
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- touchEvent.points.push_back( TouchPoint ( 0, TouchPoint::Down, 10.0f, 10.0f ) );
+ Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ touchEvent.points.push_back( point );
application.ProcessEvent( touchEvent );
// Render and notify
" \"size\": [200, 200, 1],"
" \"orientation\": [0, 0, 30],"
" \"signals\": [{"
- " \"name\": \"touched\","
+ " \"name\": \"touch\","
" \"action\": \"play\","
" \"animation\": \"animate\""
" }]"
" \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
" \"sizeWidth\": \"{WIDTH}\","
" \"signals\": [{"
- " \"name\": \"touched\","
+ " \"name\": \"touch\","
" \"action\": \"quit\""
" }]"
"}]"
" \"color\": [1,0,0,1],\n"
" \"actors\": {\n"
" \"childImage\": {\n"
- " \"color\": [0,1,0,1]\n"
+ " \"color\": \"34\"\n"
" }\n"
" }\n"
" }\n"
"},\n"
"\"templates\":\n"
"{\n"
+ " \"imageViewTemplate\": { \n"
+ " \"type\": \"ImageView\",\n"
+ " \"styles\": [\"imageStyle\"]\n"
+ " },\n"
" \"imageTree\": { \n"
" \"type\": \"ImageView\",\n"
" \"styles\": [\"imageStyle\"],\n"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" {\n"
" \"type\":\"ImageView\",\n"
- " \"name\":\"childImage\" \n"
+ " \"name\":\"childImage\", \n"
+ " \"color\": \n"
+ " {\n"
+ " \"r\": 10,\n"
+ " \"g\": 10,\n"
+ " \"b\": 10,\n"
+ " \"a\": 100\n"
+ " }\n"
+ " },\n"
+ " {\n"
+ " \"type\":\"imageViewTemplate\",\n"
+ " \"name\":\"childImage2\"\n"
" }\n"
" ]\n"
" }\n"
" \"color\": [1,0,0,1],\n"
" \"actors\": {\n"
" \"childImage\": {\n"
- " \"color\": [0,1,0,1]\n"
+ " \"color\": \"#344353\"\n"
" }\n"
" }\n"
"}\n"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
"[\n"
" { \n"
" \"type\": \"CameraActor\",\n"
- " \"name\": \"image\"\n"
+ " \"name\": \"camera\"\n"
" }, \n"
" { \n"
" \"type\": \"ImageView\",\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"hide\",\n"
" \"actor\": \"actor\",\n"
" \"childActor\": \"subActor\"\n"
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- touchEvent.points.push_back( TouchPoint ( 0, TouchPoint::Down, 10.0f, 10.0f ) );
+ Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ touchEvent.points.push_back( point );
application.ProcessEvent( touchEvent );
// Render and notify
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"set\",\n"
" \"actor\": \"subActor\",\n"
" \"property\": \"visible\",\n"
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- touchEvent.points.push_back( TouchPoint ( 0, TouchPoint::Down, 10.0f, 10.0f ) );
+ Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ touchEvent.points.push_back( point );
application.ProcessEvent( touchEvent );
// Render and notify
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"hide\"\n"
" }]\n"
" }]\n"
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- touchEvent.points.push_back( TouchPoint ( 0, TouchPoint::Down, 10.0f, 10.0f ) );
+ Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ touchEvent.points.push_back( point );
application.ProcessEvent( touchEvent );
// Render and notify
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"hide\"\n"
" }],\n"
" \"notifications\": [{\n"
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- touchEvent.points.push_back( TouchPoint ( 0, TouchPoint::Down, 10.0f, 10.0f ) );
+ Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ touchEvent.points.push_back( point );
application.ProcessEvent( touchEvent );
// Render and notify
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"properties\": {\n"
"\"parentOrigin\": \"TOP_LEFT\","
"\"anchorPoint\": \"TOP_LEFT\","
"\"signals\": [{"
- "\"name\": \"touched\","
+ "\"name\": \"touch\","
"\"action\": \"quit\""
"}]"
"}]"
" \"visible\": false\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touched\",\n"
+ " \"name\": \"touch\",\n"
" \"action\": \"hide\",\n"
" \"actor\": \"actor\",\n"
" \"childActor\": \"subActor\"\n"
END_TEST;
}
+
+int UtcDaliBuilderTypeCasts(void)
+{
+ ToolkitTestApplication application;
+
+ std::string json(
+ "{"
+ "\"stage\":"
+ "[{"
+ "\"type\": \"Layer\","
+ "\"maximumSize\": { \"typeCast\":\"vector2\", \"value\":[100,15] },"
+ "\"position\": { \"typeCast\":\"vector3\", \"value\":[100,10,1] },"
+ "\"color\": { \"typeCast\":\"vector4\", \"value\":[0.5,0.5,0.5,1] },"
+ "\"sensitive\": { \"typeCast\":\"boolean\", \"value\":false },"
+ "\"orientation\": { \"typeCast\":\"rotation\", \"value\":[10,10,10,10] },"
+ "\"colorMode\": { \"typeCast\":\"string\", \"value\":\"USE_OWN_MULTIPLY_PARENT_COLOR\" },"
+ "\"clippingBox\": { \"typeCast\":\"rect\", \"value\":[10,10,10,10] }"
+ "}]"
+ "}"
+ );
+
+ Actor rootActor = Actor::New();
+ Stage::GetCurrent().Add( rootActor );
+
+ Builder builder = Builder::New();
+ builder.LoadFromString( json );
+ builder.AddActors( rootActor );
+
+ application.SendNotification();
+ application.Render();
+
+ Actor createdActor = rootActor.GetChildAt( 0 );
+ DALI_TEST_EQUALS( createdActor.GetMaximumSize(), Vector2(100.0f,15.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS( createdActor.GetCurrentPosition(), Vector3(100.0f,10.0f,1.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS( createdActor.GetCurrentColor(), Vector4(0.5f,0.5f,0.5f,1.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS( createdActor.IsSensitive(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( createdActor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
+
+ END_TEST;
+}