Esempio n. 1
0
int UtcDaliImageActorPropertyIndices(void)
{
  TestApplication application;
  Actor basicActor = Actor::New();
  ImageActor imageActor = ImageActor::New();

  Property::IndexContainer indices;
  imageActor.GetPropertyIndices( indices );
  DALI_TEST_CHECK( indices.size() > basicActor.GetPropertyCount() );
  DALI_TEST_EQUALS( indices.size(), imageActor.GetPropertyCount(), TEST_LOCATION );
  END_TEST;
}
Esempio n. 2
0
int UtcDaliImageActorDefaultProperties(void)
{
  TestApplication application;
  tet_infoline("Testing Dali::ImageActor DefaultProperties");

  BitmapImage img = BitmapImage::New( 10, 10 );
  ImageActor actor = ImageActor::New( img );

  std::vector<Property::Index> indices;
  indices.push_back(ImageActor::PIXEL_AREA      );
  indices.push_back(ImageActor::FADE_IN         );
  indices.push_back(ImageActor::FADE_IN_DURATION);
  indices.push_back(ImageActor::STYLE           );
  indices.push_back(ImageActor::BORDER          );
  indices.push_back(ImageActor::IMAGE           );

  DALI_TEST_CHECK(actor.GetPropertyCount() == ( Actor::New().GetPropertyCount() + indices.size() ) );

  for(std::vector<Property::Index>::iterator iter = indices.begin(); iter != indices.end(); ++iter)
  {
    DALI_TEST_CHECK( *iter == actor.GetPropertyIndex(actor.GetPropertyName(*iter)) );
    DALI_TEST_CHECK( actor.IsPropertyWritable(*iter) );
    DALI_TEST_CHECK( !actor.IsPropertyAnimatable(*iter) );
    DALI_TEST_CHECK( actor.GetPropertyType(*iter) == actor.GetPropertyType(*iter) );  // just checking call succeeds
  }

  // set/get one of them
  actor.SetPixelArea(ImageActor::PixelArea( 0, 0, 0, 0 ));

  ImageActor::PixelArea area( 1, 2, 3, 4 );
  actor.SetProperty(ImageActor::PIXEL_AREA, Property::Value(Rect<int>(area)));

  DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(ImageActor::PIXEL_AREA));

  Property::Value v = actor.GetProperty(ImageActor::PIXEL_AREA);

  DALI_TEST_CHECK(v.Get<Rect<int> >() == area);

  END_TEST;
}