X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Fdali-script-v8%2Fsrc%2Factors%2Factor-wrapper.cpp;h=c9d3e1d52f17b029e845688f3e0ff6046538db80;hb=8c39cebb2a9fdaaad0492de1665bad112d3176f6;hp=c9a3536c7bae273a77a0c2e40eb7407737307b0d;hpb=a15b41d8a287aac7174a6df3cee708cfa0c2aeba;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/plugins/dali-script-v8/src/actors/actor-wrapper.cpp b/plugins/dali-script-v8/src/actors/actor-wrapper.cpp index c9a3536..c9d3e1d 100644 --- a/plugins/dali-script-v8/src/actors/actor-wrapper.cpp +++ b/plugins/dali-script-v8/src/actors/actor-wrapper.cpp @@ -67,9 +67,8 @@ const ActorTemplate ActorTemplateLookup[]= enum ActorApiBitMask { ACTOR_API = 1 << 0, - IMAGE_ACTOR_API = 1 << 1, - LAYER_API = 1 << 2, - CAMERA_ACTOR_API = 1 << 3, + LAYER_API = 1 << 1, + CAMERA_ACTOR_API = 1 << 2, }; /** @@ -85,7 +84,7 @@ struct ActorApiStruct /** * 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[]= { @@ -180,6 +179,7 @@ const ActorFunctions ActorFunctionTable[]= // 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 @@ -233,9 +233,9 @@ const ActorFunctions ActorFunctionTable[]= { "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 @@ -306,7 +306,7 @@ v8::Handle ActorWrapper::WrapActor( v8::Isolate* isolate, Actor acto // create an instance of the template v8::Local 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. @@ -393,42 +393,6 @@ void ActorWrapper::NewActor( const v8::FunctionCallbackInfo< v8::Value >& args) 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 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 */ @@ -444,8 +408,6 @@ ActorWrapper::ActorType ActorWrapper::GetActorType( const std::string& name ) return ActorWrapper::UNKNOWN_ACTOR; } - - } // namespace V8Plugin } // namespace Dali