{
v8::HandleScope handleScope( isolate);
- Property::Value daliPropertyValue;// creates a property with Property::INVALID
+ Property::Value daliPropertyValue;// creates a property with Property::NONE
found = false;
v8::Local<v8::Number> v = value->ToNumber();
return Dali::Property::Value(static_cast<float>(v->Value()));
}
- else if( value->IsInt32() )
+ else if( value->IsInt32() || value->IsUint32() )
{
found = true;
v8::Local<v8::Int32> v = value->ToInt32();
return Dali::Property::Value(static_cast<int>(v->Value()));
}
- else if ( value->IsUint32() )
- {
- found = true;
- v8::Local<v8::Uint32> v = value->ToUint32();
- return Dali::Property::Value(static_cast<unsigned int>(v->Value()));
- }
return daliPropertyValue;
}
// Get the value
v8::Local<v8::Value> value = object->Get( key );
- std::string valueString = V8Utils::v8StringToStdString( value );
-
- propertyMap[ keyString ] = valueString.c_str();
+ if( value->IsBoolean() )
+ {
+ v8::Local<v8::Boolean> v = value->ToBoolean();
+ propertyMap[ keyString ] = v->Value();
+ }
+ else if( value->IsNumber() )
+ {
+ v8::Local<v8::Number> v = value->ToNumber();
+ propertyMap[ keyString ] = static_cast<float>(v->Value());
+ }
+ else if( value->IsInt32() || value->IsUint32() )
+ {
+ v8::Local<v8::Int32> v = value->ToInt32();
+ propertyMap[ keyString ] = static_cast<int>(v->Value());
+ }
+ else if( value->IsString() )
+ {
+ std::string valueString = V8Utils::v8StringToStdString( value );
+ propertyMap[ keyString ] = valueString.c_str();
+ }
+ else if( value->IsArray() )
+ {
+ propertyMap[ keyString ] = PropertyValueWrapper::VectorOrMatrixFromV8Array( isolate, value);
+ }
}
+
return propertyMap;
}
found = true;
return args[ index ]->Int32Value();
}
+ else
{
return defaultValue;
}
found = true;
return args[ index ]->NumberValue();
}
+ else
{
return defaultValue;
}
}
}
+void* GetArrayBufferViewParameter( unsigned int index, bool& found, v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
+{
+ found = false;
+ unsigned int length = args.Length();
+ if( index < length && args[index]->IsArrayBufferView() )
+ {
+ found = true;
+ v8::ArrayBufferView* bufferView = v8::ArrayBufferView::Cast(*(args[index]));
+ v8::Handle<v8::ArrayBuffer> buffer = bufferView->Buffer();
+ v8::ArrayBuffer::Contents contents = buffer->Externalize();
+ return contents.Data();
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
Handle GetHandleParameter( unsigned int index, bool& found, v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
{
v8::HandleScope handleScope( isolate);
}
}
+
RenderTask GetRenderTaskParameter( unsigned int paramIndex, bool& found, v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
{
found = false;
}
}
-
BaseWrappedObject* GetWrappedDaliObjectParameter( unsigned int index, BaseWrappedObject::Type type, v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
{
v8::HandleScope handleScope( isolate);
v8Value = v8::Integer::New( isolate, value.Get<int>());
break;
}
- case Dali::Property::UNSIGNED_INTEGER:
- {
- v8Value = v8::Integer::New( isolate, value.Get<unsigned int>());
- break;
- }
case Dali::Property::STRING:
{
std::string string = value.Get< std::string >();