2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <dali/public-api/rendering/geometry.h>
22 #include <dali/public-api/rendering/sampler.h>
23 #include <dali/public-api/rendering/shader.h>
24 #include <dali/public-api/rendering/texture-set.h>
25 #include <dali/public-api/rendering/renderer.h>
26 #include <dali/devel-api/scripting/scripting.h>
27 #include <dali/devel-api/events/hit-test-algorithm.h>
28 #include <dali/devel-api/images/texture-set-image.h>
29 #include "emscripten/emscripten.h"
30 #include "emscripten/bind.h"
31 #include "emscripten/val.h"
34 #include "platform-abstractions/emscripten/emscripten-callbacks.h"
35 #include "platform-abstractions/emscripten/emscripten-platform-abstraction.h"
36 #include "sdl-application.h"
37 #include "actor-wrapper.h"
38 #include "animation-wrapper.h"
39 #include "emscripten-utils.h"
40 #include "geometry-wrapper.h"
41 #include "handle-wrapper.h"
42 #include "image-wrapper.h"
43 #include "property-buffer-wrapper.h"
44 #include "property-value-wrapper.h"
45 #include "render-task-wrapper.h"
46 #include "shader-effect-wrapper.h"
47 #include "signal-holder.h"
48 #include "type-info-wrapper.h"
50 ////////////////////////////////////////////////////////////////////////////////
52 // The browser javascript wrapper consists of this cpp file and a counterpart
55 // They work in tandem to help make the interface natural and convenient
56 // for a Javascript programmer.
58 // Unfortunately there is no finalize/destruction in javascript so any cpp
59 // objects created must be explicitly deleted. Sometimes this wrapper can
60 // hide the details and simple types can be immediately marshalled to and
61 // from javascript values. More often objects created must have
62 // object.delete() called at the correct time.
64 ////////////////////////////////////////////////////////////////////////////////
66 extern void EmscriptenMouseEvent(double x, double y, int mouseIsDown);
67 extern void EmscriptenUpdateOnce();
68 extern void EmscriptenRenderOnce();
77 // Javascript callbacks. These are set in the Javascript wrapper source and called
78 // from the c++ wrapper source
79 extern emscripten::val JSGetGlyphImage;
80 extern emscripten::val JSGetImage;
81 extern emscripten::val JSGetImageMetaData;
82 extern emscripten::val JSRenderFinished;
84 using namespace emscripten;
87 * Dali Vector access for Emscripten wrapping of Dali::Vector
89 template<typename DaliVectorType>
90 struct DaliVectorAccess
92 static emscripten::val Get( const DaliVectorType& v, typename DaliVectorType::SizeType index )
96 return emscripten::val(v[index]);
100 return emscripten::val::undefined();
104 static bool Set( DaliVectorType& v, typename DaliVectorType::SizeType index, const typename DaliVectorType::ItemType& value)
110 static size_t Size( DaliVectorType& v)
117 * Registering a Dali Vector with Emscripten to wrap for JavaScript
120 class_<Dali::Vector<T>> register_dali_vector(const char* name)
122 typedef Dali::Vector<T> DaliVecType;
124 void (DaliVecType::*PushBack)(const T&) = &DaliVecType::PushBack;
125 void (DaliVecType::*Resize)(const size_t, const T&) = &DaliVecType::Resize;
126 return class_<DaliVecType>(name)
127 .template constructor<>()
128 .function("push_back", PushBack)
129 .function("resize", Resize)
130 .function("size", &DaliVectorAccess<DaliVecType>::Size)
131 .function("get", &DaliVectorAccess<DaliVecType>::Get)
132 .function("set", &DaliVectorAccess<DaliVecType>::Set)
140 std::string VersionString()
142 std::stringstream versionString;
143 versionString << "DALi Core: " << Dali::CORE_MAJOR_VERSION << "." << Dali::CORE_MINOR_VERSION << "." << Dali::CORE_MICRO_VERSION << " (" << Dali::CORE_BUILD_DATE << ")" << std::endl;
144 return versionString.str();
148 * Creates an Actor previously registered with the TypeRegistry by name
149 * Actors are currently differentiated in the dali-wrapper.js and have accessor functions
150 * to support 'property.name=' access in the Javascript side object
152 Dali::Actor CreateActor(const std::string& name)
156 Dali::TypeRegistry registry = Dali::TypeRegistry::Get();
158 Dali::TypeInfo typeInfo = registry.GetTypeInfo( name );
162 EM_ASM( throw "Invalid type name" );
166 Dali::BaseHandle handle = typeInfo.CreateInstance();
170 EM_ASM( throw "Invalid handle. Cannot downcast (not an actor)" );
173 if( Dali::Actor actor = Dali::Actor::DownCast(handle) )
183 * Creates any Handle from the TypeRegistry by name
185 Dali::Handle CreateHandle(const std::string& name)
189 Dali::TypeRegistry registry = Dali::TypeRegistry::Get();
191 Dali::TypeInfo typeInfo = registry.GetTypeInfo( name );
195 EM_ASM( throw "Invalid type name" );
199 Dali::BaseHandle base = typeInfo.CreateInstance();
202 EM_ASM( throw "Cannot create instance (not a handle)" );
204 Dali::Handle handle = Dali::Handle::DownCast(base);
208 EM_ASM( throw "Invalid handle. Cannot downcast" );
218 * The functor to be used in the hit-test algorithm to check whether the actor is hittable.
220 bool IsActorHittableFunction(Dali::Actor actor, Dali::HitTestAlgorithm::TraverseType type)
222 const std::string& name = actor.GetName();
223 // by convention if not visible, or with a * starting the name or if the root layer
224 return actor.IsVisible() && (name.size() ? name[0] != '*' : true);
231 Dali::Actor HitTest(float x, float y)
233 Dali::HitTestAlgorithm::Results results;
234 Dali::HitTestAlgorithm::HitTest( Dali::Stage::GetCurrent(), Dali::Vector2(x,y), results, IsActorHittableFunction );
235 return results.actor;
239 * Creates a solid colour actor
241 Dali::Actor CreateSolidColorActor( const Dali::Vector4& color, bool border, const Dali::Vector4& borderColor, const unsigned int borderSize )
243 static const unsigned int MAX_BORDER_SIZE( 9 );
246 if( borderSize > MAX_BORDER_SIZE )
251 const unsigned int bitmapWidth = borderSize * 2 + 2;
253 // Using a (2 + border) x (2 + border) image gives a better blend with the GL implementation
254 // than a (1 + border) x (1 + border) image
255 const unsigned int bitmapSize = bitmapWidth * bitmapWidth;
256 const unsigned int topLeft = bitmapWidth * borderSize + borderSize;
257 const unsigned int topRight = topLeft + 1;
258 const unsigned int bottomLeft = bitmapWidth * (borderSize + 1) + borderSize;
259 const unsigned int bottomRight = bottomLeft + 1;
261 Dali::BufferImage imageData;
262 if(color.a != 1.0 || borderColor.a != 1.0)
264 imageData = Dali::BufferImage::New( bitmapWidth, bitmapWidth, Dali::Pixel::RGBA8888 );
267 Dali::PixelBuffer* pixbuf = imageData.GetBuffer();
268 Dali::Vector4 outerColor = color;
271 outerColor = borderColor;
274 for( size_t i = 0; i < bitmapSize; ++i )
281 pixbuf[i*4+0] = 0xFF * color.r;
282 pixbuf[i*4+1] = 0xFF * color.g;
283 pixbuf[i*4+2] = 0xFF * color.b;
284 pixbuf[i*4+3] = 0xFF * color.a;
288 pixbuf[i*4+0] = 0xFF * outerColor.r;
289 pixbuf[i*4+1] = 0xFF * outerColor.g;
290 pixbuf[i*4+2] = 0xFF * outerColor.b;
291 pixbuf[i*4+3] = 0xFF * outerColor.a;
297 imageData = Dali::BufferImage::New( bitmapWidth, bitmapWidth, Dali::Pixel::RGB888 );
300 Dali::PixelBuffer* pixbuf = imageData.GetBuffer();
301 Dali::Vector4 outerColor = color;
304 outerColor = borderColor;
307 for( size_t i = 0; i < bitmapSize; ++i )
314 pixbuf[i*3+0] = 0xFF * color.r;
315 pixbuf[i*3+1] = 0xFF * color.g;
316 pixbuf[i*3+2] = 0xFF * color.b;
320 pixbuf[i*3+0] = 0xFF * outerColor.r;
321 pixbuf[i*3+1] = 0xFF * outerColor.g;
322 pixbuf[i*3+2] = 0xFF * outerColor.b;
328 image = Dali::Actor::New();
329 image.SetAnchorPoint( Dali::AnchorPoint::CENTER );
330 image.SetParentOrigin( Dali::ParentOrigin::CENTER );
332 std::string vertexShader(
333 "attribute mediump vec2 aPosition;\n"
334 "varying mediump vec2 vTexCoord;\n"
335 "uniform mediump mat4 uMvpMatrix;\n"
336 "uniform mediump vec3 uSize;\n"
337 "uniform mediump vec4 sTextureRect;\n"
340 " gl_Position = uMvpMatrix * vec4(aPosition * uSize.xy, 0.0, 1.0);\n"
341 " vTexCoord = aPosition + vec2(0.5);\n"
344 std::string fragmentShader(
345 "varying mediump vec2 vTexCoord;\n"
346 "uniform sampler2D sTexture;\n"
347 "uniform lowp vec4 uColor;\n"
350 " gl_FragColor = texture2D( sTexture, vTexCoord )*uColor;\n"
353 Dali::Shader shader = Dali::Shader::New( vertexShader, fragmentShader );
355 // Create Quad geometry
356 Dali::Property::Map quadVertexFormat;
357 quadVertexFormat["aPosition"] = Dali::Property::VECTOR2;
358 Dali::PropertyBuffer vertexData = Dali::PropertyBuffer::New( quadVertexFormat );
359 const float halfQuadSize = .5f;
360 struct QuadVertex { Dali::Vector2 position; };
361 QuadVertex quadVertexData[4] = {
362 { Dali::Vector2(-halfQuadSize, -halfQuadSize) },
363 { Dali::Vector2(-halfQuadSize, halfQuadSize) },
364 { Dali::Vector2( halfQuadSize, -halfQuadSize) },
365 { Dali::Vector2( halfQuadSize, halfQuadSize) } };
366 vertexData.SetData(quadVertexData, 4);
368 Dali::Geometry quad = Dali::Geometry::New();
369 quad.AddVertexBuffer( vertexData );
370 quad.SetType( Dali::Geometry::TRIANGLE_STRIP );
372 Dali::Renderer renderer = Dali::Renderer::New( quad, shader );
373 Dali::TextureSet textureSet = Dali::TextureSet::New();
374 TextureSetImage( textureSet, 0u, imageData );
375 renderer.SetTextures( textureSet );
377 image.AddRenderer( renderer );
385 * Sets the callback to getting a glyph (from dali-wrapper.js/browser)
387 void SetCallbackGetGlyphImage(const emscripten::val& callback)
389 JSGetGlyphImage = callback;
393 * Sets the callback to get an image (from dali-wrapper.js/browser)
395 void SetCallbackGetImage(const emscripten::val& callback)
397 JSGetImage = callback;
401 * Sets the callback to get image meta data (from dali-wrapper.js/browser)
403 void SetCallbackGetImageMetadata(const emscripten::val& callback)
405 JSGetImageMetaData = callback;
409 * Sets the callback to signal render finished to dali-wrapper.js/browser
411 void SetCallbackRenderFinished(const emscripten::val& callback)
413 JSRenderFinished = callback;
417 * Generates control points for a Path
419 void GenerateControlPoints(Dali::Handle& handle, float curvature)
423 Dali::Path path = Dali::Path::DownCast(handle);
426 path.GenerateControlPoints(curvature);
430 EM_ASM( throw "Handle is not a path object" );
435 EM_ASM( throw "Handle is empty" );
441 * Creating property Value Objects
442 * javascript can't select on type so we have renamed constructors
444 * Emscripten can convert some basic types and ones we've declared as value_array(s)
445 * (These are given member access offsets/functions and are for simple structs etc)
447 * The composite types need converting.
449 Dali::Property::Value PropertyValueBoolean(bool v)
451 return Dali::Property::Value(v);
454 Dali::Property::Value PropertyValueFloat(float v)
456 return Dali::Property::Value(v);
459 Dali::Property::Value PropertyValueInteger(int v)
461 return Dali::Property::Value(v);
464 Dali::Property::Value PropertyValueVector2( const Dali::Vector2& v )
466 return Dali::Property::Value(v);
469 Dali::Property::Value PropertyValueVector3( const Dali::Vector3& v )
471 return Dali::Property::Value(v);
474 Dali::Property::Value PropertyValueVector4( const Dali::Vector4& v )
476 return Dali::Property::Value(v);
479 Dali::Property::Value PropertyValueIntRect( int a, int b, int c, int d )
481 return Dali::Property::Value(Dali::Rect<int>( a, b, c, d));
484 Dali::Property::Value PropertyValueMatrix( const Dali::Matrix& v )
486 return Dali::Property::Value(v);
489 Dali::Property::Value PropertyValueMatrix3( const Dali::Matrix3& v )
491 return Dali::Property::Value(v);
494 Dali::Property::Value PropertyValueEuler( const Dali::Vector3& v )
496 return Dali::Property::Value( Dali::Quaternion(
497 Dali::Radian(Dali::Degree(v.x)),
498 Dali::Radian(Dali::Degree(v.y)),
499 Dali::Radian(Dali::Degree(v.z)) ) );
502 Dali::Property::Value PropertyValueAxisAngle( const Dali::Vector4& v )
504 return Dali::Quaternion( Dali::Radian(Dali::Degree(v[3])), Dali::Vector3(v) );
507 Dali::Property::Value PropertyValueString( const std::string& v )
509 return Dali::Property::Value(v);
512 Dali::Property::Value PropertyValueContainer( const emscripten::val& v )
514 Dali::Property::Value ret;
515 RecursiveSetProperty( ret, v );
520 * Property value accessors from Dali Property Value
522 bool PropertyGetBoolean(const Dali::Property::Value& v)
524 return v.Get<bool>();
527 float PropertyGetFloat(const Dali::Property::Value& v)
529 return v.Get<float>();
532 int PropertyGetInteger(const Dali::Property::Value& v)
537 Dali::Vector2 PropertyGetVector2(const Dali::Property::Value& v)
539 return v.Get<Dali::Vector2>();
542 Dali::Vector3 PropertyGetVector3(const Dali::Property::Value& v)
544 return v.Get<Dali::Vector3>();
547 Dali::Vector4 PropertyGetVector4(const Dali::Property::Value& v)
549 return v.Get<Dali::Vector4>();
552 emscripten::val PropertyGetIntRect(const Dali::Property::Value& v)
554 return JavascriptValue(v);
557 std::string PropertyGetString(const Dali::Property::Value& v)
559 return v.Get<std::string>();
562 emscripten::val PropertyGetMap(const Dali::Property::Value& v)
564 return JavascriptValue(v);
567 emscripten::val PropertyGetArray(const Dali::Property::Value& v)
569 return JavascriptValue(v);
572 emscripten::val PropertyGetMatrix(const Dali::Property::Value& v)
574 return JavascriptValue(v);
577 emscripten::val PropertyGetMatrix3(const Dali::Property::Value& v)
579 return JavascriptValue(v);
582 emscripten::val PropertyGetEuler(const Dali::Property::Value& v)
584 return JavascriptValue(v);
587 emscripten::val PropertyGetRotation(const Dali::Property::Value& v)
589 return JavascriptValue(v);
592 int PropertyGetType(Dali::Property::Value& v)
594 return (int)v.GetType();
597 std::string PropertyGetTypeName(Dali::Property::Value& v)
599 return Dali::PropertyTypes::GetName(v.GetType());
602 template <typename T>
603 float MatrixGetter(T &v, int n)
605 return *(v.AsFloat() + n);
608 template <typename T>
609 void MatrixSetter(T &v, float f, int n)
611 *(v.AsFloat() + n) = f;
614 float MatrixGetter0(const Dali::Matrix &v) { return MatrixGetter(v, 0); }
615 float MatrixGetter1(const Dali::Matrix &v) { return MatrixGetter(v, 1); }
616 float MatrixGetter2(const Dali::Matrix &v) { return MatrixGetter(v, 2); }
617 float MatrixGetter3(const Dali::Matrix &v) { return MatrixGetter(v, 3); }
618 float MatrixGetter4(const Dali::Matrix &v) { return MatrixGetter(v, 4); }
619 float MatrixGetter5(const Dali::Matrix &v) { return MatrixGetter(v, 5); }
620 float MatrixGetter6(const Dali::Matrix &v) { return MatrixGetter(v, 6); }
621 float MatrixGetter7(const Dali::Matrix &v) { return MatrixGetter(v, 7); }
622 float MatrixGetter8(const Dali::Matrix &v) { return MatrixGetter(v, 8); }
623 float MatrixGetter9(const Dali::Matrix &v) { return MatrixGetter(v, 9); }
624 float MatrixGetter10(const Dali::Matrix &v) { return MatrixGetter(v,10); }
625 float MatrixGetter11(const Dali::Matrix &v) { return MatrixGetter(v,11); }
626 float MatrixGetter12(const Dali::Matrix &v) { return MatrixGetter(v,12); }
627 float MatrixGetter13(const Dali::Matrix &v) { return MatrixGetter(v,13); }
628 float MatrixGetter14(const Dali::Matrix &v) { return MatrixGetter(v,14); }
629 float MatrixGetter15(const Dali::Matrix &v) { return MatrixGetter(v,15); }
630 float MatrixGetter16(const Dali::Matrix &v) { return MatrixGetter(v,16); }
632 void MatrixSetter0(Dali::Matrix &v, float f) { MatrixSetter(v, f, 0); }
633 void MatrixSetter1(Dali::Matrix &v, float f) { MatrixSetter(v, f, 1); }
634 void MatrixSetter2(Dali::Matrix &v, float f) { MatrixSetter(v, f, 2); }
635 void MatrixSetter3(Dali::Matrix &v, float f) { MatrixSetter(v, f, 3); }
636 void MatrixSetter4(Dali::Matrix &v, float f) { MatrixSetter(v, f, 4); }
637 void MatrixSetter5(Dali::Matrix &v, float f) { MatrixSetter(v, f, 5); }
638 void MatrixSetter6(Dali::Matrix &v, float f) { MatrixSetter(v, f, 6); }
639 void MatrixSetter7(Dali::Matrix &v, float f) { MatrixSetter(v, f, 7); }
640 void MatrixSetter8(Dali::Matrix &v, float f) { MatrixSetter(v, f, 8); }
641 void MatrixSetter9(Dali::Matrix &v, float f) { MatrixSetter(v, f, 9); }
642 void MatrixSetter10(Dali::Matrix &v, float f) { MatrixSetter(v, f,10); }
643 void MatrixSetter11(Dali::Matrix &v, float f) { MatrixSetter(v, f,11); }
644 void MatrixSetter12(Dali::Matrix &v, float f) { MatrixSetter(v, f,12); }
645 void MatrixSetter13(Dali::Matrix &v, float f) { MatrixSetter(v, f,13); }
646 void MatrixSetter14(Dali::Matrix &v, float f) { MatrixSetter(v, f,14); }
647 void MatrixSetter15(Dali::Matrix &v, float f) { MatrixSetter(v, f,15); }
648 void MatrixSetter16(Dali::Matrix &v, float f) { MatrixSetter(v, f,16); }
650 float Matrix3Getter0(const Dali::Matrix3 &v) { return MatrixGetter(v, 0); }
651 float Matrix3Getter1(const Dali::Matrix3 &v) { return MatrixGetter(v, 1); }
652 float Matrix3Getter2(const Dali::Matrix3 &v) { return MatrixGetter(v, 2); }
653 float Matrix3Getter3(const Dali::Matrix3 &v) { return MatrixGetter(v, 3); }
654 float Matrix3Getter4(const Dali::Matrix3 &v) { return MatrixGetter(v, 4); }
655 float Matrix3Getter5(const Dali::Matrix3 &v) { return MatrixGetter(v, 5); }
656 float Matrix3Getter6(const Dali::Matrix3 &v) { return MatrixGetter(v, 6); }
657 float Matrix3Getter7(const Dali::Matrix3 &v) { return MatrixGetter(v, 7); }
658 float Matrix3Getter8(const Dali::Matrix3 &v) { return MatrixGetter(v, 8); }
660 void Matrix3Setter0(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 0); }
661 void Matrix3Setter1(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 1); }
662 void Matrix3Setter2(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 2); }
663 void Matrix3Setter3(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 3); }
664 void Matrix3Setter4(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 4); }
665 void Matrix3Setter5(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 5); }
666 void Matrix3Setter6(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 6); }
667 void Matrix3Setter7(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 7); }
668 void Matrix3Setter8(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 8); }
670 val JavascriptUpdateCallback( val::undefined() );
671 bool JavascriptUpdateCallbackSet = false;
673 void JavascriptUpdate(int dt)
675 if( JavascriptUpdateCallbackSet )
677 JavascriptUpdateCallback( val(dt) );
681 void SetUpdateFunction( const emscripten::val& function )
683 JavascriptUpdateCallback = function;
684 JavascriptUpdateCallbackSet = true;
687 const emscripten::val& GetUpdateFunction()
689 return JavascriptUpdateCallback;
693 * Emscripten Bindings
695 * This uses Emscripten 'bind' (similar in design to Boost's python wrapper library).
696 * It provides a simplified way to wrap C++ classes and wraps Emscriptens type
699 * A convention below is that where there is a function or method name prepended
700 * with '__' there is a corresponding Javascript helper function to help with
701 * marshalling parameters and return values.
704 EMSCRIPTEN_BINDINGS(dali_wrapper)
706 // With a little help embind knows about vectors so we tell it which ones to instantiate
707 register_dali_vector<int>("DaliVectorInt");
708 register_vector<std::string>("VectorString");
709 register_vector<int>("VectorInt");
710 register_vector<float>("VectorFloat");
711 register_vector<Dali::Actor>("VectorActor");
714 // Creation functions.
716 emscripten::function("VersionString", &VersionString);
717 emscripten::function("__createActor", &CreateActor);
718 emscripten::function("__createHandle", &CreateHandle);
719 emscripten::function("__createSolidColorActor", &CreateSolidColorActor);
724 emscripten::function("javascriptValue", &JavascriptValue);
725 emscripten::function("__hitTest", &HitTest);
726 emscripten::function("sendMouseEvent", &EmscriptenMouseEvent);
727 emscripten::function("__updateOnce", &EmscriptenUpdateOnce);
728 emscripten::function("__renderOnce", &EmscriptenRenderOnce);
729 emscripten::function("generateControlPoints", &GenerateControlPoints);
732 // Global callback functions
734 emscripten::function("setCallbackGetGlyphImage", &SetCallbackGetGlyphImage);
735 emscripten::function("setCallbackGetImage", &SetCallbackGetImage);
736 emscripten::function("setCallbackGetImageMetadata", &SetCallbackGetImageMetadata);
737 emscripten::function("setCallbackRenderFinished", &SetCallbackRenderFinished);
738 emscripten::function("setUpdateFunction", &SetUpdateFunction);
739 emscripten::function("getUpdateFunction", &GetUpdateFunction);
742 // Property value creation (Javascript can't select on type)
744 emscripten::function("PropertyValueBoolean", &PropertyValueBoolean);
745 emscripten::function("PropertyValueFloat", &PropertyValueFloat);
746 emscripten::function("PropertyValueInteger", &PropertyValueInteger);
747 emscripten::function("PropertyValueString", &PropertyValueString);
748 emscripten::function("PropertyValueVector2", &PropertyValueVector2);
749 emscripten::function("PropertyValueVector3", &PropertyValueVector3);
750 emscripten::function("PropertyValueVector4", &PropertyValueVector4);
751 emscripten::function("PropertyValueMatrix", &PropertyValueMatrix);
752 emscripten::function("PropertyValueMatrix3", &PropertyValueMatrix3);
753 emscripten::function("PropertyValueMap", &PropertyValueContainer);
754 emscripten::function("PropertyValueArray", &PropertyValueContainer);
755 emscripten::function("PropertyValueEuler", &PropertyValueEuler);
756 emscripten::function("PropertyValueAxisAngle", &PropertyValueAxisAngle);
757 emscripten::function("PropertyValueString", &PropertyValueString);
758 emscripten::function("PropertyValueIntRect", &PropertyValueIntRect);
761 // One unfortunate aspect of wrapping for the browser is that we get no notification
762 // of object deletion so all JS wrapper objects must be wrapper.delete() correctly.
764 // Embind has a mechanism around this for simple c style structs decared as value_arrays.
765 // These are immediately transformed to Javascript arrays and don't need explicit
766 // destruction, however the API needs a member offset.
768 value_array<Dali::Internal::Emscripten::Statistics>("Statistics")
769 .element(&Dali::Internal::Emscripten::Statistics::on)
770 .element(&Dali::Internal::Emscripten::Statistics::frameCount)
771 .element(&Dali::Internal::Emscripten::Statistics::lastFrameDeltaSeconds)
772 .element(&Dali::Internal::Emscripten::Statistics::lastSyncTimeMilliseconds)
773 .element(&Dali::Internal::Emscripten::Statistics::nextSyncTimeMilliseconds)
774 .element(&Dali::Internal::Emscripten::Statistics::keepUpdating)
775 .element(&Dali::Internal::Emscripten::Statistics::needsNotification)
776 .element(&Dali::Internal::Emscripten::Statistics::secondsFromLastFrame)
779 value_array<Dali::Vector2>("Vector2")
780 .element(&Dali::Vector2::x)
781 .element(&Dali::Vector2::y)
784 value_array<Dali::Vector3>("Vector3")
785 .element(&Dali::Vector3::x)
786 .element(&Dali::Vector3::y)
787 .element(&Dali::Vector3::z)
790 value_array<Dali::Vector4>("Vector4")
791 .element(&Dali::Vector4::x)
792 .element(&Dali::Vector4::y)
793 .element(&Dali::Vector4::z)
794 .element(&Dali::Vector4::w)
797 value_array<Dali::Matrix>("Matrix")
798 .element(&MatrixGetter0, &MatrixSetter0)
799 .element(&MatrixGetter1, &MatrixSetter1)
800 .element(&MatrixGetter2, &MatrixSetter2)
801 .element(&MatrixGetter3, &MatrixSetter3)
802 .element(&MatrixGetter4, &MatrixSetter4)
803 .element(&MatrixGetter5, &MatrixSetter5)
804 .element(&MatrixGetter6, &MatrixSetter6)
805 .element(&MatrixGetter7, &MatrixSetter7)
806 .element(&MatrixGetter8, &MatrixSetter8)
807 .element(&MatrixGetter9, &MatrixSetter9)
808 .element(&MatrixGetter10, &MatrixSetter10)
809 .element(&MatrixGetter11, &MatrixSetter11)
810 .element(&MatrixGetter12, &MatrixSetter12)
811 .element(&MatrixGetter13, &MatrixSetter13)
812 .element(&MatrixGetter14, &MatrixSetter14)
813 .element(&MatrixGetter15, &MatrixSetter15)
816 value_array<Dali::Matrix3>("Matrix3")
817 .element(&Matrix3Getter0, &Matrix3Setter0)
818 .element(&Matrix3Getter1, &Matrix3Setter1)
819 .element(&Matrix3Getter2, &Matrix3Setter2)
820 .element(&Matrix3Getter3, &Matrix3Setter3)
821 .element(&Matrix3Getter4, &Matrix3Setter4)
822 .element(&Matrix3Getter5, &Matrix3Setter5)
823 .element(&Matrix3Getter6, &Matrix3Setter6)
824 .element(&Matrix3Getter7, &Matrix3Setter7)
825 .element(&Matrix3Getter8, &Matrix3Setter8)
831 enum_<Dali::Property::Type>("PropertyType")
832 .value("NONE", Dali::Property::NONE)
833 .value("BOOLEAN", Dali::Property::BOOLEAN)
834 .value("FLOAT", Dali::Property::FLOAT)
835 .value("INTEGER", Dali::Property::INTEGER)
836 .value("VECTOR2", Dali::Property::VECTOR2)
837 .value("VECTOR3", Dali::Property::VECTOR3)
838 .value("VECTOR4", Dali::Property::VECTOR4)
839 .value("MATRIX3", Dali::Property::MATRIX3)
840 .value("MATRIX", Dali::Property::MATRIX)
841 .value("RECTANGLE", Dali::Property::RECTANGLE)
842 .value("ROTATION", Dali::Property::ROTATION)
843 .value("STRING", Dali::Property::STRING)
844 .value("ARRAY", Dali::Property::ARRAY)
845 .value("MAP", Dali::Property::MAP)
848 enum_<Dali::ShaderEffect::GeometryHints>("GeometryHints")
849 .value("HINT_NONE", Dali::ShaderEffect::HINT_NONE)
850 .value("HINT_GRID_X", Dali::ShaderEffect::HINT_GRID_X)
851 .value("HINT_GRID_Y", Dali::ShaderEffect::HINT_GRID_Y)
852 .value("HINT_GRID", Dali::ShaderEffect::HINT_GRID)
853 .value("HINT_DEPTH_BUFFER", Dali::ShaderEffect::HINT_DEPTH_BUFFER)
854 .value("HINT_BLENDING", Dali::ShaderEffect::HINT_BLENDING)
855 .value("HINT_DOESNT_MODIFY_GEOMETRY", Dali::ShaderEffect::HINT_DOESNT_MODIFY_GEOMETRY)
858 enum_<Dali::Shader::Hint::Value>("ShaderHints")
859 .value("NONE", Dali::Shader::Hint::NONE)
860 .value("OUTPUT_IS_TRANSPARENT", Dali::Shader::Hint::OUTPUT_IS_TRANSPARENT)
861 .value("MODIFIES_GEOMETRY", Dali::Shader::Hint::MODIFIES_GEOMETRY)
864 enum_<Dali::Animation::EndAction>("EndAction")
865 .value("Bake", Dali::Animation::Bake)
866 .value("Discard", Dali::Animation::Discard)
867 .value("BakeFinal", Dali::Animation::BakeFinal)
870 enum_<Dali::Animation::Interpolation>("Interpolation")
871 .value("Linear", Dali::Animation::Interpolation::Linear)
872 .value("Cubic", Dali::Animation::Interpolation::Cubic)
875 enum_<Dali::Geometry::Type>("Type")
876 .value("POINTS", Dali::Geometry::POINTS)
877 .value("LINES", Dali::Geometry::LINES)
878 .value("LINE_LOOP", Dali::Geometry::LINE_LOOP)
879 .value("LINE_STRIP", Dali::Geometry::LINE_STRIP)
880 .value("TRIANGLES", Dali::Geometry::TRIANGLES)
881 .value("TRIANGLE_FAN", Dali::Geometry::TRIANGLE_FAN)
882 .value("TRIANGLE_STRIP", Dali::Geometry::TRIANGLE_STRIP)
885 enum_<Dali::Image::ReleasePolicy>("ReleasePolicy")
886 .value("UNUSED", Dali::Image::UNUSED)
887 .value("NEVER", Dali::Image::NEVER)
890 enum_<Dali::Pixel::Format>("PixelFormat")
891 .value("A8", Dali::Pixel::Format::A8)
892 .value("L8", Dali::Pixel::Format::L8)
893 .value("LA88", Dali::Pixel::Format::LA88)
894 .value("RGB565", Dali::Pixel::Format::RGB565)
895 .value("BGR565", Dali::Pixel::Format::BGR565)
896 .value("RGBA4444", Dali::Pixel::Format::RGBA4444)
897 .value("BGRA4444", Dali::Pixel::Format::BGRA4444)
898 .value("RGBA5551", Dali::Pixel::Format::RGBA5551)
899 .value("BGRA5551", Dali::Pixel::Format::BGRA5551)
900 .value("RGB888", Dali::Pixel::Format::RGB888)
901 .value("RGB8888", Dali::Pixel::Format::RGB8888)
902 .value("BGR8888", Dali::Pixel::Format::BGR8888)
903 .value("RGBA8888", Dali::Pixel::Format::RGBA8888)
904 .value("BGRA8888", Dali::Pixel::Format::BGRA8888)
905 // GLES 3 Standard compressed formats:
906 .value("COMPRESSED_R11_EAC", Dali::Pixel::Format::COMPRESSED_R11_EAC)
907 .value("COMPRESSED_SIGNED_R11_EAC", Dali::Pixel::Format::COMPRESSED_SIGNED_R11_EAC)
908 .value("COMPRESSED_RG11_EAC", Dali::Pixel::Format::COMPRESSED_RG11_EAC)
909 .value("COMPRESSED_SIGNED_RG11_EAC", Dali::Pixel::Format::COMPRESSED_SIGNED_RG11_EAC)
910 .value("COMPRESSED_RGB8_ETC2", Dali::Pixel::Format::COMPRESSED_RGB8_ETC2)
911 .value("COMPRESSED_SRGB8_ETC2", Dali::Pixel::Format::COMPRESSED_SRGB8_ETC2)
912 .value("COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", Dali::Pixel::Format::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2)
913 .value("COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", Dali::Pixel::Format::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2)
914 .value("COMPRESSED_RGBA8_ETC2_EAC", Dali::Pixel::Format::COMPRESSED_RGBA8_ETC2_EAC)
915 .value("COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", Dali::Pixel::Format::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC)
916 // GLES 2 extension compressed formats:
917 .value("COMPRESSED_RGB8_ETC1", Dali::Pixel::Format::COMPRESSED_RGB8_ETC1)
918 .value("COMPRESSED_RGB_PVRTC_4BPPV1", Dali::Pixel::Format::COMPRESSED_RGB_PVRTC_4BPPV1)
921 enum_<Dali::FaceCullingMode::Type>("FaceCullingMode")
922 .value("NONE", Dali::FaceCullingMode::NONE)
923 .value("FRONT", Dali::FaceCullingMode::FRONT)
924 .value("BACK", Dali::FaceCullingMode::BACK)
925 .value("FRONT_AND_BACK", Dali::FaceCullingMode::FRONT_AND_BACK)
928 enum_<Dali::DepthWriteMode::Type>("DepthWriteMode")
929 .value("OFF", Dali::DepthWriteMode::OFF)
930 .value("AUTO", Dali::DepthWriteMode::AUTO)
931 .value("ON", Dali::DepthWriteMode::ON)
934 enum_<Dali::BlendMode::Type>("BlendMode")
935 .value("OFF", Dali::BlendMode::OFF)
936 .value("AUTO", Dali::BlendMode::AUTO)
937 .value("ON", Dali::BlendMode::ON)
940 enum_<Dali::AlphaFunction::BuiltinFunction>("AlphaFunction")
941 .value("DEFAULT", Dali::AlphaFunction::BuiltinFunction::DEFAULT)
942 .value("LINEAR", Dali::AlphaFunction::BuiltinFunction::LINEAR)
943 .value("REVERSE", Dali::AlphaFunction::BuiltinFunction::REVERSE)
944 .value("EASE_IN_SQUARE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_SQUARE)
945 .value("EASE_OUT_SQUARE", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_SQUARE)
946 .value("EASE_IN", Dali::AlphaFunction::BuiltinFunction::EASE_IN)
947 .value("EASE_OUT", Dali::AlphaFunction::BuiltinFunction::EASE_OUT)
948 .value("EASE_IN_OUT", Dali::AlphaFunction::BuiltinFunction::EASE_IN_OUT)
949 .value("EASE_IN_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_SINE)
950 .value("EASE_OUT_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_SINE)
951 .value("EASE_IN_OUT_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_OUT_SINE)
952 .value("BOUNCE", Dali::AlphaFunction::BuiltinFunction::BOUNCE)
953 .value("SIN", Dali::AlphaFunction::BuiltinFunction::SIN)
954 .value("EASE_OUT_BACK", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_BACK)
961 // we need property map as an object rather than straight conversion to javascript 'object'
962 // because its ordered. And PropertyBuffer needs an order.
963 class_<Dali::Property::Map>("PropertyMap")
965 .function("count", &Dali::Property::Map::Count)
966 .function("empty", &Dali::Property::Map::Empty)
967 .function("__insert", select_overload< void(const std::string&, const Dali::Property::Value&) > (&Dali::Property::Map::Insert))
968 .function("__get", &PropertyMapGet)
969 .function("__getValue", &Dali::Property::Map::GetValue)
970 .function("getKey", &Dali::Property::Map::GetKey)
971 .function("clear", &Dali::Property::Map::Clear)
972 .function("merge", &Dali::Property::Map::Merge)
975 class_<Dali::Property::Value>("PropertyValue")
977 .function("getType", &PropertyGetType)
978 .function("getTypeName", &PropertyGetTypeName)
979 .function("getBoolean", &PropertyGetBoolean)
980 .function("getFloat", &PropertyGetFloat)
981 .function("getInteger", &PropertyGetInteger)
982 .function("getVector2", &PropertyGetVector2)
983 .function("getVector3", &PropertyGetVector3)
984 .function("getVector4", &PropertyGetVector4)
985 .function("getString", &PropertyGetString)
986 .function("getMap", &PropertyGetMap)
987 .function("getArray", &PropertyGetArray)
988 .function("getMatrix", &PropertyGetMatrix)
989 .function("getMatrix3", &PropertyGetMatrix3)
990 .function("getEuler", &PropertyGetEuler)
991 .function("getRotation", &PropertyGetRotation)
992 .function("getIntRect", &PropertyGetIntRect)
995 class_<Dali::BaseHandle>("BaseHandle")
996 .function("ok", &BaseHandleOk)
997 .function("getTypeName", &BaseHandle::GetTypeName)
1000 class_<Dali::TypeInfo, base<Dali::BaseHandle>>("TypeInfo")
1001 .function("getName", &Dali::TypeInfo::GetName)
1002 .function("getBaseName", &Dali::TypeInfo::GetBaseName)
1003 .function("getProperties", &GetAllProperties)
1004 .function("getActions", &GetActions)
1005 .function("getSignals", &GetSignals)
1006 .function("getPropertyIndices", &Dali::TypeInfo::GetPropertyIndices)
1009 class_<Dali::TypeRegistry>("TypeRegistry")
1010 .constructor<>(&Dali::TypeRegistry::Get)
1011 .function("getTypeNameCount", &Dali::TypeRegistry::GetTypeNameCount)
1012 .function("getTypeName", &Dali::TypeRegistry::GetTypeName)
1013 .function("getTypeInfo", select_overload< Dali::TypeInfo(const std::string&) > (&Dali::TypeRegistry::GetTypeInfo))
1016 class_<SignalHolder>("SignalHolder")
1020 class_<Dali::Handle, base<Dali::BaseHandle>>("Handle")
1021 .function("__registerProperty", &RegisterProperty)
1022 .function("__registerAnimatedProperty", &RegisterAnimatedProperty)
1023 .function("setSelf", &SetSelf)
1024 .function("setProperty", &SetProperty)
1025 .function("getProperty", &GetProperty)
1026 .function("getPropertyIndex", &GetPropertyIndex)
1027 .function("getProperties", &GetProperties)
1028 .function("getPropertyIndices", &Handle::GetPropertyIndices)
1029 .function("getPropertyTypeFromName", &GetPropertyTypeFromName)
1030 .function("getPropertyTypeName", &GetPropertyTypeName)
1031 .function("registerProperty", &RegisterProperty)
1032 .function("registerAnimatedProperty", &RegisterAnimatedProperty)
1033 .function("getTypeInfo", &GetTypeInfo)
1034 .function("isPropertyWritable", &Handle::IsPropertyWritable)
1035 .function("isPropertyAnimatable", &Handle::IsPropertyAnimatable)
1036 .function("isPropertyAConstraintInput", &Handle::IsPropertyAConstraintInput)
1039 class_<Dali::Path, base<Dali::Handle>>("Path")
1040 .constructor<>(&Dali::Path::New)
1041 .function("addPoint", &Dali::Path::AddPoint)
1042 .function("addControlPoint", &Dali::Path::AddControlPoint)
1043 .function("generateControlPoints", &Dali::Path::GenerateControlPoints)
1044 .function("sample", &Dali::Path::Sample)
1045 .function("getPoint", &Dali::Path::GetPoint)
1046 .function("getControlPoint", &Dali::Path::GetControlPoint)
1047 .function("getPointCount", &Dali::Path::GetPointCount)
1050 class_<Dali::KeyFrames>("KeyFrames")
1051 .constructor<>(&Dali::KeyFrames::New)
1052 .function("add", select_overload<void (float progress, Property::Value value)>(&Dali::KeyFrames::Add))
1053 .function("addWithAlpha", &KeyFramesAddWithAlpha)
1056 class_<Dali::Animation>("Animation")
1057 .constructor<float>(&Dali::Animation::New)
1058 .function("__animateTo", &AnimateTo)
1059 .function("__animateBy", &AnimateBy)
1060 .function("__animateBetween", &AnimateBetween)
1061 .function("__animatePath", &AnimatePath)
1062 .function("setDuration", &Dali::Animation::SetDuration)
1063 .function("getDuration", &Dali::Animation::GetDuration)
1064 .function("setLooping", &Dali::Animation::SetLooping)
1065 .function("isLooping", &Dali::Animation::IsLooping)
1066 .function("setEndAction", &Dali::Animation::SetEndAction)
1067 .function("getEndAction", &Dali::Animation::GetEndAction)
1068 .function("setDisconnectAction", &Dali::Animation::SetDisconnectAction)
1069 .function("getDisconnectAction", &Dali::Animation::GetDisconnectAction)
1070 .function("setCurrentProgress", &Dali::Animation::SetCurrentProgress)
1071 .function("getCurrentProgress", &Dali::Animation::GetCurrentProgress)
1072 .function("setSpeedFactor", &Dali::Animation::SetSpeedFactor)
1073 .function("getSpeedFactor", &Dali::Animation::GetSpeedFactor)
1074 .function("setPlayRange", &Dali::Animation::SetPlayRange)
1075 .function("getPlayRange", &Dali::Animation::GetPlayRange)
1076 .function("play", &Dali::Animation::Play)
1077 .function("playFrom", &Dali::Animation::PlayFrom)
1078 .function("pause", &Dali::Animation::Pause)
1079 .function("stop", &Dali::Animation::Stop)
1080 .function("clear", &Dali::Animation::Clear)
1083 class_<Dali::PropertyBuffer>("PropertyBuffer")
1084 .constructor<Dali::Property::Map&>(Dali::PropertyBuffer::New)
1085 .function("setData", &SetPropertyBufferDataRaw)
1088 class_<Dali::Geometry>("Geometry")
1089 .constructor<>(&Dali::Geometry::New)
1090 .function("addVertexBuffer", &Dali::Geometry::AddVertexBuffer)
1091 .function("getNumberOfVertexBuffers", &Dali::Geometry::GetNumberOfVertexBuffers)
1092 .function("setIndexBuffer", &SetIndexBufferDataRaw)
1093 .function("setType", &Dali::Geometry::SetType)
1094 .function("getType", &Dali::Geometry::GetType)
1097 class_<Dali::Image>("Image")
1100 class_<Dali::BufferImage, base<Dali::Image> >("BufferImage")
1101 .constructor<const std::string&, unsigned int, unsigned int, Dali::Pixel::Format>(&BufferImageNew)
1104 class_<Dali::EncodedBufferImage, base<Dali::Image> >("EncodedBufferImage")
1105 .constructor<const std::string&>(&EncodedBufferImageNew)
1108 class_<Dali::Sampler>("Sampler")
1109 .constructor<>(&Dali::Sampler::New)
1112 class_<Dali::Shader, base<Dali::Handle>>("Shader")
1113 .constructor<>(&Dali::Shader::New)
1116 class_<Dali::TextureSet>("TextureSet")
1117 .constructor<>(&Dali::TextureSet::New)
1118 .function("setTexture", &Dali::TextureSet::SetTexture)
1119 .function("setSampler", &Dali::TextureSet::SetSampler)
1120 .function("getTexture", &Dali::TextureSet::GetTexture)
1121 .function("getSampler", &Dali::TextureSet::GetSampler)
1122 .function("getTextureCount", &Dali::TextureSet::GetTextureCount)
1125 class_<Dali::Renderer, base<Dali::Handle>>("Renderer")
1126 .constructor<>(&Dali::Renderer::New)
1127 .function("setGeometry", &Dali::Renderer::SetGeometry)
1128 .function("getGeometry", &Dali::Renderer::GetGeometry)
1129 .function("SetTextures", &Dali::Renderer::SetTextures)
1130 .function("SetTextures", &Dali::Renderer::SetTextures)
1133 class_<Dali::ShaderEffect, base<Dali::Handle>>("ShaderEffect")
1134 .constructor<const std::string&, const std::string&,
1135 const std::string&, const std::string&,
1136 int >(&CreateShaderEffect)
1137 .function("setEffectImage", &Dali::ShaderEffect::SetEffectImage)
1138 .function("__setUniform", &SetUniform)
1141 class_<Dali::Actor, base<Dali::Handle>>("Actor")
1142 .constructor<>(&Dali::Actor::New)
1143 .function("add", &Dali::Actor::Add)
1144 .function("remove", &Dali::Actor::Remove)
1145 .function("getId", &Dali::Actor::GetId)
1146 .function("__getParent", &Dali::Actor::GetParent)
1147 .function("__findChildById", &Dali::Actor::FindChildById)
1148 .function("__findChildByName", &Dali::Actor::FindChildByName)
1149 .function("__getChildAt", &Dali::Actor::GetChildAt)
1150 .function("getChildCount", &Dali::Actor::GetChildCount)
1151 .function("__screenToLocal",
1152 select_overload<std::vector<float> (Dali::Actor, float, float)>(&ScreenToLocal))
1153 .function("addressOf", &AddressOf)
1154 .function("__connect", &ConnectSignal)
1155 .function("__setPropertyNotification", &SetPropertyNotification)
1156 .function("addRenderer", &Dali::Actor::AddRenderer)
1157 .function("getRendererCount", &Dali::Actor::GetRendererCount)
1158 .function("removeRenderer",
1159 select_overload<void(unsigned int)>(&Dali::Actor::RemoveRenderer))
1160 .function("__getRendererAt", &Dali::Actor::GetRendererAt)
1163 class_<Dali::CameraActor, base<Dali::Actor>>("CameraActor")
1164 .constructor<>( select_overload<Dali::CameraActor()>(&Dali::CameraActor::New))
1167 class_<Dali::Layer, base<Dali::Actor>>("Layer")
1168 .constructor<>(&Dali::Layer::New)
1169 .function("raise", &Dali::Layer::Raise)
1170 .function("lower", &Dali::Layer::Lower)
1173 class_<Dali::Stage>("Stage")
1174 .constructor<>(&Dali::Stage::GetCurrent)
1175 .function("add", &Dali::Stage::Add)
1176 .function("remove", &Dali::Stage::Remove)
1177 .function("__getRootLayer", &Dali::Stage::GetRootLayer)
1178 .function("getLayer", &Dali::Stage::GetLayer)
1179 .function("getRenderTaskList", &Dali::Stage::GetRenderTaskList)
1180 .function("setBackgroundColor", &Dali::Stage::SetBackgroundColor)
1183 class_<Dali::RenderTaskList>("RenderTaskList")
1184 .function("createTask", &Dali::RenderTaskList::CreateTask)
1185 .function("removeTask", &Dali::RenderTaskList::RemoveTask)
1186 .function("getTaskCount", &Dali::RenderTaskList::GetTaskCount)
1187 .function("getTask", &Dali::RenderTaskList::GetTask)
1190 class_<Dali::RenderTask>("RenderTask")
1191 .function("__getCameraActor", &Dali::RenderTask::GetCameraActor)
1192 .function("setCameraActor", &Dali::RenderTask::SetCameraActor)
1193 .function("setSourceActor", &Dali::RenderTask::SetSourceActor)
1194 .function("setExclusive", &Dali::RenderTask::SetExclusive)
1195 .function("setInputEnabled", &Dali::RenderTask::SetInputEnabled)
1196 .function("setViewportPosition", &Dali::RenderTask::SetViewportPosition)
1197 .function("setViewportSize", &Dali::RenderTask::SetViewportSize)
1198 .function("getCurrentViewportPosition", &Dali::RenderTask::GetCurrentViewportPosition)
1199 .function("getCurrentViewportSize", &Dali::RenderTask::GetCurrentViewportSize)
1200 .function("setClearColor", &Dali::RenderTask::SetClearColor)
1201 .function("getClearColor", &Dali::RenderTask::GetClearColor)
1202 .function("setClearEnabled", &Dali::RenderTask::SetClearEnabled)
1203 .function("getClearEnabled", &Dali::RenderTask::GetClearEnabled)
1204 .function("screenToLocal",
1205 select_overload<Dali::Vector2(Dali::RenderTask, Dali::Actor, float, float)>(&ScreenToLocal))
1206 .function("worldToScreen", &WorldToScreen)
1211 }; // namespace Emscripten
1212 }; // namespace Internal
1213 }; // namespace Dali