/**
* Lookup table to match a actor type with a constructor and supported API's.
- * HandleWrapper::ActorType is used to index this table
+ * ActorWrapper::ActorType is used to index this table
*/
const ActorApiStruct ActorApiLookup[]=
{
// ignore. SetSize() use Actor.size
// ignore. GetCurrentSize() use Actor.size
{ "GetNaturalSize", ActorApi::GetNaturalSize, ACTOR_API },
+ { "GetRelayoutSize", ActorApi::GetRelayoutSize, ACTOR_API },
{ "GetWidthForHeight",ActorApi::GetWidthForHeight, ACTOR_API },
{ "GetHeightForWidth",ActorApi::GetHeightForWidth, ACTOR_API },
// ignore. SetPosition(....) use Actor.position
{ "Raise", LayerApi::Raise, LAYER_API },
{ "Lower", LayerApi::Lower, LAYER_API },
{ "RaiseAbove", LayerApi::RaiseAbove, LAYER_API },
- { "RaiseBelow", LayerApi::LowerBelow, LAYER_API },
+ { "LowerBelow", LayerApi::LowerBelow, LAYER_API },
{ "RaiseToTop", LayerApi::RaiseToTop, LAYER_API },
- { "LowerToBottom", LayerApi::ToBottom, LAYER_API },
+ { "LowerToBottom", LayerApi::LowerToBottom, LAYER_API },
{ "MoveAbove", LayerApi::MoveAbove, LAYER_API },
{ "MoveBelow", LayerApi::MoveBelow, LAYER_API },
// ignore SetClipping, use layer.clippingEnable
// create an instance of the template
v8::Local<v8::Object> localObject = objectTemplate->NewInstance();
- // create teh actor object
+ // create the actor object
ActorWrapper* pointer = new ActorWrapper( actor, Dali::V8Plugin::DaliWrapper::Get().GetDaliGarbageCollector() );
// assign the JavaScript object to the wrapper.
args.GetReturnValue().Set( localObject );
}
-void ActorWrapper::NewControl( const v8::FunctionCallbackInfo< v8::Value >& args)
-{
- v8::Isolate* isolate = args.GetIsolate();
- v8::HandleScope handleScope( isolate );
-
- if( !args.IsConstructCall() )
- {
- DALI_SCRIPT_EXCEPTION( isolate, "constructor called without 'new" );
- return;
- }
-
- bool found( false );
- std::string controlName = V8Utils::GetStringParameter( PARAMETER_0, found, isolate, args );
-
- if( !found )
- {
- DALI_SCRIPT_EXCEPTION( isolate, "missing control name" );
- return;
- }
- Actor control;
- Dali::TypeInfo typeInfo = Dali::TypeRegistry::Get().GetTypeInfo( controlName );
- if( typeInfo ) // handle, check if it has a value
- {
- Dali::BaseHandle handle = typeInfo.CreateInstance();
- if( handle )
- {
- control = Actor::DownCast( handle );
- }
- }
-
- v8::Local<v8::Object> localObject = WrapActor( isolate, control, ACTOR );
-
- args.GetReturnValue().Set( localObject );
-}
-
-
/**
* given an actor type name, e.g. CameraActor returns the type, e.g. ActorWrapper::CAMERA_ACTOR
*/
return ActorWrapper::UNKNOWN_ACTOR;
}
-
-
} // namespace V8Plugin
} // namespace Dali