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.
22 #include <dali/devel-api/scripting/scripting.h>
23 #include <dali/devel-api/events/hit-test-algorithm.h>
24 #include <dali/devel-api/rendering/geometry.h>
25 #include <dali/devel-api/rendering/shader.h>
26 #include <dali/devel-api/rendering/sampler.h>
27 #include <dali/devel-api/rendering/texture-set.h>
28 #include <dali/devel-api/rendering/renderer.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 );
354 Dali::Geometry geometry = Dali::Geometry::QUAD();
355 Dali::Renderer renderer = Dali::Renderer::New( geometry, shader );
356 Dali::TextureSet textureSet = Dali::TextureSet::New();
357 textureSet.SetImage( 0u, imageData );
358 renderer.SetTextures( textureSet );
360 image.AddRenderer( renderer );
368 * Sets the callback to getting a glyph (from dali-wrapper.js/browser)
370 void SetCallbackGetGlyphImage(const emscripten::val& callback)
372 JSGetGlyphImage = callback;
376 * Sets the callback to get an image (from dali-wrapper.js/browser)
378 void SetCallbackGetImage(const emscripten::val& callback)
380 JSGetImage = callback;
384 * Sets the callback to get image meta data (from dali-wrapper.js/browser)
386 void SetCallbackGetImageMetadata(const emscripten::val& callback)
388 JSGetImageMetaData = callback;
392 * Sets the callback to signal render finished to dali-wrapper.js/browser
394 void SetCallbackRenderFinished(const emscripten::val& callback)
396 JSRenderFinished = callback;
400 * Generates control points for a Path
402 void GenerateControlPoints(Dali::Handle& handle, float curvature)
406 Dali::Path path = Dali::Path::DownCast(handle);
409 path.GenerateControlPoints(curvature);
413 EM_ASM( throw "Handle is not a path object" );
418 EM_ASM( throw "Handle is empty" );
424 * Creating property Value Objects
425 * javascript can't select on type so we have renamed constructors
427 * Emscripten can convert some basic types and ones we've declared as value_array(s)
428 * (These are given member access offsets/functions and are for simple structs etc)
430 * The composite types need converting.
432 Dali::Property::Value PropertyValueBoolean(bool v)
434 return Dali::Property::Value(v);
437 Dali::Property::Value PropertyValueFloat(float v)
439 return Dali::Property::Value(v);
442 Dali::Property::Value PropertyValueInteger(int v)
444 return Dali::Property::Value(v);
447 Dali::Property::Value PropertyValueVector2( const Dali::Vector2& v )
449 return Dali::Property::Value(v);
452 Dali::Property::Value PropertyValueVector3( const Dali::Vector3& v )
454 return Dali::Property::Value(v);
457 Dali::Property::Value PropertyValueVector4( const Dali::Vector4& v )
459 return Dali::Property::Value(v);
462 Dali::Property::Value PropertyValueIntRect( int a, int b, int c, int d )
464 return Dali::Property::Value(Dali::Rect<int>( a, b, c, d));
467 Dali::Property::Value PropertyValueMatrix( const Dali::Matrix& v )
469 return Dali::Property::Value(v);
472 Dali::Property::Value PropertyValueMatrix3( const Dali::Matrix3& v )
474 return Dali::Property::Value(v);
477 Dali::Property::Value PropertyValueEuler( const Dali::Vector3& v )
479 return Dali::Property::Value( Dali::Quaternion(
480 Dali::Radian(Dali::Degree(v.x)),
481 Dali::Radian(Dali::Degree(v.y)),
482 Dali::Radian(Dali::Degree(v.z)) ) );
485 Dali::Property::Value PropertyValueAxisAngle( const Dali::Vector4& v )
487 return Dali::Quaternion( Dali::Radian(Dali::Degree(v[3])), Dali::Vector3(v) );
490 Dali::Property::Value PropertyValueString( const std::string& v )
492 return Dali::Property::Value(v);
495 Dali::Property::Value PropertyValueContainer( const emscripten::val& v )
497 Dali::Property::Value ret;
498 RecursiveSetProperty( ret, v );
503 * Property value accessors from Dali Property Value
505 bool PropertyGetBoolean(const Dali::Property::Value& v)
507 return v.Get<bool>();
510 float PropertyGetFloat(const Dali::Property::Value& v)
512 return v.Get<float>();
515 int PropertyGetInteger(const Dali::Property::Value& v)
520 Dali::Vector2 PropertyGetVector2(const Dali::Property::Value& v)
522 return v.Get<Dali::Vector2>();
525 Dali::Vector3 PropertyGetVector3(const Dali::Property::Value& v)
527 return v.Get<Dali::Vector3>();
530 Dali::Vector4 PropertyGetVector4(const Dali::Property::Value& v)
532 return v.Get<Dali::Vector4>();
535 emscripten::val PropertyGetIntRect(const Dali::Property::Value& v)
537 return JavascriptValue(v);
540 std::string PropertyGetString(const Dali::Property::Value& v)
542 return v.Get<std::string>();
545 emscripten::val PropertyGetMap(const Dali::Property::Value& v)
547 return JavascriptValue(v);
550 emscripten::val PropertyGetArray(const Dali::Property::Value& v)
552 return JavascriptValue(v);
555 emscripten::val PropertyGetMatrix(const Dali::Property::Value& v)
557 return JavascriptValue(v);
560 emscripten::val PropertyGetMatrix3(const Dali::Property::Value& v)
562 return JavascriptValue(v);
565 emscripten::val PropertyGetEuler(const Dali::Property::Value& v)
567 return JavascriptValue(v);
570 emscripten::val PropertyGetRotation(const Dali::Property::Value& v)
572 return JavascriptValue(v);
575 int PropertyGetType(Dali::Property::Value& v)
577 return (int)v.GetType();
580 std::string PropertyGetTypeName(Dali::Property::Value& v)
582 return Dali::PropertyTypes::GetName(v.GetType());
585 template <typename T>
586 float MatrixGetter(T &v, int n)
588 return *(v.AsFloat() + n);
591 template <typename T>
592 void MatrixSetter(T &v, float f, int n)
594 *(v.AsFloat() + n) = f;
597 float MatrixGetter0(const Dali::Matrix &v) { return MatrixGetter(v, 0); }
598 float MatrixGetter1(const Dali::Matrix &v) { return MatrixGetter(v, 1); }
599 float MatrixGetter2(const Dali::Matrix &v) { return MatrixGetter(v, 2); }
600 float MatrixGetter3(const Dali::Matrix &v) { return MatrixGetter(v, 3); }
601 float MatrixGetter4(const Dali::Matrix &v) { return MatrixGetter(v, 4); }
602 float MatrixGetter5(const Dali::Matrix &v) { return MatrixGetter(v, 5); }
603 float MatrixGetter6(const Dali::Matrix &v) { return MatrixGetter(v, 6); }
604 float MatrixGetter7(const Dali::Matrix &v) { return MatrixGetter(v, 7); }
605 float MatrixGetter8(const Dali::Matrix &v) { return MatrixGetter(v, 8); }
606 float MatrixGetter9(const Dali::Matrix &v) { return MatrixGetter(v, 9); }
607 float MatrixGetter10(const Dali::Matrix &v) { return MatrixGetter(v,10); }
608 float MatrixGetter11(const Dali::Matrix &v) { return MatrixGetter(v,11); }
609 float MatrixGetter12(const Dali::Matrix &v) { return MatrixGetter(v,12); }
610 float MatrixGetter13(const Dali::Matrix &v) { return MatrixGetter(v,13); }
611 float MatrixGetter14(const Dali::Matrix &v) { return MatrixGetter(v,14); }
612 float MatrixGetter15(const Dali::Matrix &v) { return MatrixGetter(v,15); }
613 float MatrixGetter16(const Dali::Matrix &v) { return MatrixGetter(v,16); }
615 void MatrixSetter0(Dali::Matrix &v, float f) { MatrixSetter(v, f, 0); }
616 void MatrixSetter1(Dali::Matrix &v, float f) { MatrixSetter(v, f, 1); }
617 void MatrixSetter2(Dali::Matrix &v, float f) { MatrixSetter(v, f, 2); }
618 void MatrixSetter3(Dali::Matrix &v, float f) { MatrixSetter(v, f, 3); }
619 void MatrixSetter4(Dali::Matrix &v, float f) { MatrixSetter(v, f, 4); }
620 void MatrixSetter5(Dali::Matrix &v, float f) { MatrixSetter(v, f, 5); }
621 void MatrixSetter6(Dali::Matrix &v, float f) { MatrixSetter(v, f, 6); }
622 void MatrixSetter7(Dali::Matrix &v, float f) { MatrixSetter(v, f, 7); }
623 void MatrixSetter8(Dali::Matrix &v, float f) { MatrixSetter(v, f, 8); }
624 void MatrixSetter9(Dali::Matrix &v, float f) { MatrixSetter(v, f, 9); }
625 void MatrixSetter10(Dali::Matrix &v, float f) { MatrixSetter(v, f,10); }
626 void MatrixSetter11(Dali::Matrix &v, float f) { MatrixSetter(v, f,11); }
627 void MatrixSetter12(Dali::Matrix &v, float f) { MatrixSetter(v, f,12); }
628 void MatrixSetter13(Dali::Matrix &v, float f) { MatrixSetter(v, f,13); }
629 void MatrixSetter14(Dali::Matrix &v, float f) { MatrixSetter(v, f,14); }
630 void MatrixSetter15(Dali::Matrix &v, float f) { MatrixSetter(v, f,15); }
631 void MatrixSetter16(Dali::Matrix &v, float f) { MatrixSetter(v, f,16); }
633 float Matrix3Getter0(const Dali::Matrix3 &v) { return MatrixGetter(v, 0); }
634 float Matrix3Getter1(const Dali::Matrix3 &v) { return MatrixGetter(v, 1); }
635 float Matrix3Getter2(const Dali::Matrix3 &v) { return MatrixGetter(v, 2); }
636 float Matrix3Getter3(const Dali::Matrix3 &v) { return MatrixGetter(v, 3); }
637 float Matrix3Getter4(const Dali::Matrix3 &v) { return MatrixGetter(v, 4); }
638 float Matrix3Getter5(const Dali::Matrix3 &v) { return MatrixGetter(v, 5); }
639 float Matrix3Getter6(const Dali::Matrix3 &v) { return MatrixGetter(v, 6); }
640 float Matrix3Getter7(const Dali::Matrix3 &v) { return MatrixGetter(v, 7); }
641 float Matrix3Getter8(const Dali::Matrix3 &v) { return MatrixGetter(v, 8); }
643 void Matrix3Setter0(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 0); }
644 void Matrix3Setter1(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 1); }
645 void Matrix3Setter2(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 2); }
646 void Matrix3Setter3(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 3); }
647 void Matrix3Setter4(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 4); }
648 void Matrix3Setter5(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 5); }
649 void Matrix3Setter6(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 6); }
650 void Matrix3Setter7(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 7); }
651 void Matrix3Setter8(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 8); }
653 val JavascriptUpdateCallback( val::undefined() );
654 bool JavascriptUpdateCallbackSet = false;
656 void JavascriptUpdate(int dt)
658 if( JavascriptUpdateCallbackSet )
660 JavascriptUpdateCallback( val(dt) );
664 void SetUpdateFunction( const emscripten::val& function )
666 JavascriptUpdateCallback = function;
667 JavascriptUpdateCallbackSet = true;
670 const emscripten::val& GetUpdateFunction()
672 return JavascriptUpdateCallback;
676 * Emscripten Bindings
678 * This uses Emscripten 'bind' (similar in design to Boost's python wrapper library).
679 * It provides a simplified way to wrap C++ classes and wraps Emscriptens type
682 * A convention below is that where there is a function or method name prepended
683 * with '__' there is a corresponding Javascript helper function to help with
684 * marshalling parameters and return values.
687 EMSCRIPTEN_BINDINGS(dali_wrapper)
689 // With a little help embind knows about vectors so we tell it which ones to instantiate
690 register_dali_vector<int>("DaliVectorInt");
691 register_vector<std::string>("VectorString");
692 register_vector<int>("VectorInt");
693 register_vector<float>("VectorFloat");
694 register_vector<Dali::Actor>("VectorActor");
697 // Creation functions.
699 emscripten::function("VersionString", &VersionString);
700 emscripten::function("__createActor", &CreateActor);
701 emscripten::function("__createHandle", &CreateHandle);
702 emscripten::function("__createSolidColorActor", &CreateSolidColorActor);
707 emscripten::function("javascriptValue", &JavascriptValue);
708 emscripten::function("__hitTest", &HitTest);
709 emscripten::function("sendMouseEvent", &EmscriptenMouseEvent);
710 emscripten::function("__updateOnce", &EmscriptenUpdateOnce);
711 emscripten::function("__renderOnce", &EmscriptenRenderOnce);
712 emscripten::function("generateControlPoints", &GenerateControlPoints);
715 // Global callback functions
717 emscripten::function("setCallbackGetGlyphImage", &SetCallbackGetGlyphImage);
718 emscripten::function("setCallbackGetImage", &SetCallbackGetImage);
719 emscripten::function("setCallbackGetImageMetadata", &SetCallbackGetImageMetadata);
720 emscripten::function("setCallbackRenderFinished", &SetCallbackRenderFinished);
721 emscripten::function("setUpdateFunction", &SetUpdateFunction);
722 emscripten::function("getUpdateFunction", &GetUpdateFunction);
725 // Property value creation (Javascript can't select on type)
727 emscripten::function("PropertyValueBoolean", &PropertyValueBoolean);
728 emscripten::function("PropertyValueFloat", &PropertyValueFloat);
729 emscripten::function("PropertyValueInteger", &PropertyValueInteger);
730 emscripten::function("PropertyValueString", &PropertyValueString);
731 emscripten::function("PropertyValueVector2", &PropertyValueVector2);
732 emscripten::function("PropertyValueVector3", &PropertyValueVector3);
733 emscripten::function("PropertyValueVector4", &PropertyValueVector4);
734 emscripten::function("PropertyValueMatrix", &PropertyValueMatrix);
735 emscripten::function("PropertyValueMatrix3", &PropertyValueMatrix3);
736 emscripten::function("PropertyValueMap", &PropertyValueContainer);
737 emscripten::function("PropertyValueArray", &PropertyValueContainer);
738 emscripten::function("PropertyValueEuler", &PropertyValueEuler);
739 emscripten::function("PropertyValueAxisAngle", &PropertyValueAxisAngle);
740 emscripten::function("PropertyValueString", &PropertyValueString);
741 emscripten::function("PropertyValueIntRect", &PropertyValueIntRect);
744 // One unfortunate aspect of wrapping for the browser is that we get no notification
745 // of object deletion so all JS wrapper objects must be wrapper.delete() correctly.
747 // Embind has a mechanism around this for simple c style structs decared as value_arrays.
748 // These are immediately transformed to Javascript arrays and don't need explicit
749 // destruction, however the API needs a member offset.
751 value_array<Dali::Internal::Emscripten::Statistics>("Statistics")
752 .element(&Dali::Internal::Emscripten::Statistics::on)
753 .element(&Dali::Internal::Emscripten::Statistics::frameCount)
754 .element(&Dali::Internal::Emscripten::Statistics::lastFrameDeltaSeconds)
755 .element(&Dali::Internal::Emscripten::Statistics::lastSyncTimeMilliseconds)
756 .element(&Dali::Internal::Emscripten::Statistics::nextSyncTimeMilliseconds)
757 .element(&Dali::Internal::Emscripten::Statistics::keepUpdating)
758 .element(&Dali::Internal::Emscripten::Statistics::needsNotification)
759 .element(&Dali::Internal::Emscripten::Statistics::secondsFromLastFrame)
762 value_array<Dali::Vector2>("Vector2")
763 .element(&Dali::Vector2::x)
764 .element(&Dali::Vector2::y)
767 value_array<Dali::Vector3>("Vector3")
768 .element(&Dali::Vector3::x)
769 .element(&Dali::Vector3::y)
770 .element(&Dali::Vector3::z)
773 value_array<Dali::Vector4>("Vector4")
774 .element(&Dali::Vector4::x)
775 .element(&Dali::Vector4::y)
776 .element(&Dali::Vector4::z)
777 .element(&Dali::Vector4::w)
780 value_array<Dali::Matrix>("Matrix")
781 .element(&MatrixGetter0, &MatrixSetter0)
782 .element(&MatrixGetter1, &MatrixSetter1)
783 .element(&MatrixGetter2, &MatrixSetter2)
784 .element(&MatrixGetter3, &MatrixSetter3)
785 .element(&MatrixGetter4, &MatrixSetter4)
786 .element(&MatrixGetter5, &MatrixSetter5)
787 .element(&MatrixGetter6, &MatrixSetter6)
788 .element(&MatrixGetter7, &MatrixSetter7)
789 .element(&MatrixGetter8, &MatrixSetter8)
790 .element(&MatrixGetter9, &MatrixSetter9)
791 .element(&MatrixGetter10, &MatrixSetter10)
792 .element(&MatrixGetter11, &MatrixSetter11)
793 .element(&MatrixGetter12, &MatrixSetter12)
794 .element(&MatrixGetter13, &MatrixSetter13)
795 .element(&MatrixGetter14, &MatrixSetter14)
796 .element(&MatrixGetter15, &MatrixSetter15)
799 value_array<Dali::Matrix3>("Matrix3")
800 .element(&Matrix3Getter0, &Matrix3Setter0)
801 .element(&Matrix3Getter1, &Matrix3Setter1)
802 .element(&Matrix3Getter2, &Matrix3Setter2)
803 .element(&Matrix3Getter3, &Matrix3Setter3)
804 .element(&Matrix3Getter4, &Matrix3Setter4)
805 .element(&Matrix3Getter5, &Matrix3Setter5)
806 .element(&Matrix3Getter6, &Matrix3Setter6)
807 .element(&Matrix3Getter7, &Matrix3Setter7)
808 .element(&Matrix3Getter8, &Matrix3Setter8)
814 enum_<Dali::Property::Type>("PropertyType")
815 .value("NONE", Dali::Property::NONE)
816 .value("BOOLEAN", Dali::Property::BOOLEAN)
817 .value("FLOAT", Dali::Property::FLOAT)
818 .value("INTEGER", Dali::Property::INTEGER)
819 .value("VECTOR2", Dali::Property::VECTOR2)
820 .value("VECTOR3", Dali::Property::VECTOR3)
821 .value("VECTOR4", Dali::Property::VECTOR4)
822 .value("MATRIX3", Dali::Property::MATRIX3)
823 .value("MATRIX", Dali::Property::MATRIX)
824 .value("RECTANGLE", Dali::Property::RECTANGLE)
825 .value("ROTATION", Dali::Property::ROTATION)
826 .value("STRING", Dali::Property::STRING)
827 .value("ARRAY", Dali::Property::ARRAY)
828 .value("MAP", Dali::Property::MAP)
831 enum_<Dali::ShaderEffect::GeometryHints>("GeometryHints")
832 .value("HINT_NONE", Dali::ShaderEffect::HINT_NONE)
833 .value("HINT_GRID_X", Dali::ShaderEffect::HINT_GRID_X)
834 .value("HINT_GRID_Y", Dali::ShaderEffect::HINT_GRID_Y)
835 .value("HINT_GRID", Dali::ShaderEffect::HINT_GRID)
836 .value("HINT_DEPTH_BUFFER", Dali::ShaderEffect::HINT_DEPTH_BUFFER)
837 .value("HINT_BLENDING", Dali::ShaderEffect::HINT_BLENDING)
838 .value("HINT_DOESNT_MODIFY_GEOMETRY", Dali::ShaderEffect::HINT_DOESNT_MODIFY_GEOMETRY)
841 enum_<Dali::Shader::ShaderHints>("ShaderHints")
842 .value("HINT_NONE", Dali::Shader::HINT_NONE)
843 .value("HINT_OUTPUT_IS_TRANSPARENT", Dali::Shader::HINT_OUTPUT_IS_TRANSPARENT)
844 .value("HINT_MODIFIES_GEOMETRY", Dali::Shader::HINT_MODIFIES_GEOMETRY)
847 enum_<Dali::Animation::EndAction>("EndAction")
848 .value("Bake", Dali::Animation::Bake)
849 .value("Discard", Dali::Animation::Discard)
850 .value("BakeFinal", Dali::Animation::BakeFinal)
853 enum_<Dali::Animation::Interpolation>("Interpolation")
854 .value("Linear", Dali::Animation::Interpolation::Linear)
855 .value("Cubic", Dali::Animation::Interpolation::Cubic)
858 enum_<Dali::Geometry::GeometryType>("GeometryType")
859 .value("POINTS", Dali::Geometry::POINTS)
860 .value("LINES", Dali::Geometry::LINES)
861 .value("LINE_LOOP", Dali::Geometry::LINE_LOOP)
862 .value("LINE_STRIP", Dali::Geometry::LINE_STRIP)
863 .value("TRIANGLES", Dali::Geometry::TRIANGLES)
864 .value("TRIANGLE_FAN", Dali::Geometry::TRIANGLE_FAN)
865 .value("TRIANGLE_STRIP", Dali::Geometry::TRIANGLE_STRIP)
868 enum_<Dali::Image::ReleasePolicy>("ReleasePolicy")
869 .value("UNUSED", Dali::Image::UNUSED)
870 .value("NEVER", Dali::Image::NEVER)
873 enum_<Dali::Pixel::Format>("PixelFormat")
874 .value("A8", Dali::Pixel::Format::A8)
875 .value("L8", Dali::Pixel::Format::L8)
876 .value("LA88", Dali::Pixel::Format::LA88)
877 .value("RGB565", Dali::Pixel::Format::RGB565)
878 .value("BGR565", Dali::Pixel::Format::BGR565)
879 .value("RGBA4444", Dali::Pixel::Format::RGBA4444)
880 .value("BGRA4444", Dali::Pixel::Format::BGRA4444)
881 .value("RGBA5551", Dali::Pixel::Format::RGBA5551)
882 .value("BGRA5551", Dali::Pixel::Format::BGRA5551)
883 .value("RGB888", Dali::Pixel::Format::RGB888)
884 .value("RGB8888", Dali::Pixel::Format::RGB8888)
885 .value("BGR8888", Dali::Pixel::Format::BGR8888)
886 .value("RGBA8888", Dali::Pixel::Format::RGBA8888)
887 .value("BGRA8888", Dali::Pixel::Format::BGRA8888)
888 // GLES 3 Standard compressed formats:
889 .value("COMPRESSED_R11_EAC", Dali::Pixel::Format::COMPRESSED_R11_EAC)
890 .value("COMPRESSED_SIGNED_R11_EAC", Dali::Pixel::Format::COMPRESSED_SIGNED_R11_EAC)
891 .value("COMPRESSED_RG11_EAC", Dali::Pixel::Format::COMPRESSED_RG11_EAC)
892 .value("COMPRESSED_SIGNED_RG11_EAC", Dali::Pixel::Format::COMPRESSED_SIGNED_RG11_EAC)
893 .value("COMPRESSED_RGB8_ETC2", Dali::Pixel::Format::COMPRESSED_RGB8_ETC2)
894 .value("COMPRESSED_SRGB8_ETC2", Dali::Pixel::Format::COMPRESSED_SRGB8_ETC2)
895 .value("COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", Dali::Pixel::Format::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2)
896 .value("COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", Dali::Pixel::Format::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2)
897 .value("COMPRESSED_RGBA8_ETC2_EAC", Dali::Pixel::Format::COMPRESSED_RGBA8_ETC2_EAC)
898 .value("COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", Dali::Pixel::Format::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC)
899 // GLES 2 extension compressed formats:
900 .value("COMPRESSED_RGB8_ETC1", Dali::Pixel::Format::COMPRESSED_RGB8_ETC1)
901 .value("COMPRESSED_RGB_PVRTC_4BPPV1", Dali::Pixel::Format::COMPRESSED_RGB_PVRTC_4BPPV1)
904 enum_<Dali::FaceCullingMode::Type>("FaceCullingMode")
905 .value("NONE", Dali::FaceCullingMode::NONE)
906 .value("FRONT", Dali::FaceCullingMode::FRONT)
907 .value("BACK", Dali::FaceCullingMode::BACK)
908 .value("FRONT_AND_BACK", Dali::FaceCullingMode::FRONT_AND_BACK)
911 enum_<Dali::DepthWriteMode::Type>("DepthWriteMode")
912 .value("OFF", Dali::DepthWriteMode::OFF)
913 .value("AUTO", Dali::DepthWriteMode::AUTO)
914 .value("ON", Dali::DepthWriteMode::ON)
917 enum_<Dali::BlendMode::Type>("BlendMode")
918 .value("OFF", Dali::BlendMode::OFF)
919 .value("AUTO", Dali::BlendMode::AUTO)
920 .value("ON", Dali::BlendMode::ON)
923 enum_<Dali::AlphaFunction::BuiltinFunction>("AlphaFunction")
924 .value("DEFAULT", Dali::AlphaFunction::BuiltinFunction::DEFAULT)
925 .value("LINEAR", Dali::AlphaFunction::BuiltinFunction::LINEAR)
926 .value("REVERSE", Dali::AlphaFunction::BuiltinFunction::REVERSE)
927 .value("EASE_IN_SQUARE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_SQUARE)
928 .value("EASE_OUT_SQUARE", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_SQUARE)
929 .value("EASE_IN", Dali::AlphaFunction::BuiltinFunction::EASE_IN)
930 .value("EASE_OUT", Dali::AlphaFunction::BuiltinFunction::EASE_OUT)
931 .value("EASE_IN_OUT", Dali::AlphaFunction::BuiltinFunction::EASE_IN_OUT)
932 .value("EASE_IN_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_SINE)
933 .value("EASE_OUT_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_SINE)
934 .value("EASE_IN_OUT_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_OUT_SINE)
935 .value("BOUNCE", Dali::AlphaFunction::BuiltinFunction::BOUNCE)
936 .value("SIN", Dali::AlphaFunction::BuiltinFunction::SIN)
937 .value("EASE_OUT_BACK", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_BACK)
944 // we need property map as an object rather than straight conversion to javascript 'object'
945 // because its ordered. And PropertyBuffer needs an order.
946 class_<Dali::Property::Map>("PropertyMap")
948 .function("count", &Dali::Property::Map::Count)
949 .function("empty", &Dali::Property::Map::Empty)
950 .function("__insert", select_overload< void(const std::string&, const Dali::Property::Value&) > (&Dali::Property::Map::Insert))
951 .function("__get", &PropertyMapGet)
952 .function("__getValue", &Dali::Property::Map::GetValue)
953 .function("getKey", &Dali::Property::Map::GetKey)
954 .function("clear", &Dali::Property::Map::Clear)
955 .function("merge", &Dali::Property::Map::Merge)
958 class_<Dali::Property::Value>("PropertyValue")
960 .function("getType", &PropertyGetType)
961 .function("getTypeName", &PropertyGetTypeName)
962 .function("getBoolean", &PropertyGetBoolean)
963 .function("getFloat", &PropertyGetFloat)
964 .function("getInteger", &PropertyGetInteger)
965 .function("getVector2", &PropertyGetVector2)
966 .function("getVector3", &PropertyGetVector3)
967 .function("getVector4", &PropertyGetVector4)
968 .function("getString", &PropertyGetString)
969 .function("getMap", &PropertyGetMap)
970 .function("getArray", &PropertyGetArray)
971 .function("getMatrix", &PropertyGetMatrix)
972 .function("getMatrix3", &PropertyGetMatrix3)
973 .function("getEuler", &PropertyGetEuler)
974 .function("getRotation", &PropertyGetRotation)
975 .function("getIntRect", &PropertyGetIntRect)
978 class_<Dali::BaseHandle>("BaseHandle")
979 .function("ok", &BaseHandleOk)
980 .function("getTypeName", &BaseHandle::GetTypeName)
983 class_<Dali::TypeInfo, base<Dali::BaseHandle>>("TypeInfo")
984 .function("getName", &Dali::TypeInfo::GetName)
985 .function("getBaseName", &Dali::TypeInfo::GetBaseName)
986 .function("getProperties", &GetAllProperties)
987 .function("getActions", &GetActions)
988 .function("getSignals", &GetSignals)
989 .function("getPropertyIndices", &Dali::TypeInfo::GetPropertyIndices)
992 class_<Dali::TypeRegistry>("TypeRegistry")
993 .constructor<>(&Dali::TypeRegistry::Get)
994 .function("getTypeNameCount", &Dali::TypeRegistry::GetTypeNameCount)
995 .function("getTypeName", &Dali::TypeRegistry::GetTypeName)
996 .function("getTypeInfo", select_overload< Dali::TypeInfo(const std::string&) > (&Dali::TypeRegistry::GetTypeInfo))
999 class_<SignalHolder>("SignalHolder")
1003 class_<Dali::Handle, base<Dali::BaseHandle>>("Handle")
1004 .function("__registerProperty", &RegisterProperty)
1005 .function("__registerAnimatedProperty", &RegisterAnimatedProperty)
1006 .function("setSelf", &SetSelf)
1007 .function("setProperty", &SetProperty)
1008 .function("getProperty", &GetProperty)
1009 .function("getPropertyIndex", &GetPropertyIndex)
1010 .function("getProperties", &GetProperties)
1011 .function("getPropertyIndices", &Handle::GetPropertyIndices)
1012 .function("getPropertyTypeFromName", &GetPropertyTypeFromName)
1013 .function("getPropertyTypeName", &GetPropertyTypeName)
1014 .function("registerProperty", &RegisterProperty)
1015 .function("registerAnimatedProperty", &RegisterAnimatedProperty)
1016 .function("getTypeInfo", &GetTypeInfo)
1017 .function("isPropertyWritable", &Handle::IsPropertyWritable)
1018 .function("isPropertyAnimatable", &Handle::IsPropertyAnimatable)
1019 .function("isPropertyAConstraintInput", &Handle::IsPropertyAConstraintInput)
1022 class_<Dali::Path, base<Dali::Handle>>("Path")
1023 .constructor<>(&Dali::Path::New)
1024 .function("addPoint", &Dali::Path::AddPoint)
1025 .function("addControlPoint", &Dali::Path::AddControlPoint)
1026 .function("generateControlPoints", &Dali::Path::GenerateControlPoints)
1027 .function("sample", &Dali::Path::Sample)
1028 .function("getPoint", &Dali::Path::GetPoint)
1029 .function("getControlPoint", &Dali::Path::GetControlPoint)
1030 .function("getPointCount", &Dali::Path::GetPointCount)
1033 class_<Dali::KeyFrames>("KeyFrames")
1034 .constructor<>(&Dali::KeyFrames::New)
1035 .function("add", select_overload<void (float progress, Property::Value value)>(&Dali::KeyFrames::Add))
1036 .function("addWithAlpha", &KeyFramesAddWithAlpha)
1039 class_<Dali::Animation>("Animation")
1040 .constructor<float>(&Dali::Animation::New)
1041 .function("__animateTo", &AnimateTo)
1042 .function("__animateBy", &AnimateBy)
1043 .function("__animateBetween", &AnimateBetween)
1044 .function("__animatePath", &AnimatePath)
1045 .function("setDuration", &Dali::Animation::SetDuration)
1046 .function("getDuration", &Dali::Animation::GetDuration)
1047 .function("setLooping", &Dali::Animation::SetLooping)
1048 .function("isLooping", &Dali::Animation::IsLooping)
1049 .function("setEndAction", &Dali::Animation::SetEndAction)
1050 .function("getEndAction", &Dali::Animation::GetEndAction)
1051 .function("setDisconnectAction", &Dali::Animation::SetDisconnectAction)
1052 .function("getDisconnectAction", &Dali::Animation::GetDisconnectAction)
1053 .function("setCurrentProgress", &Dali::Animation::SetCurrentProgress)
1054 .function("getCurrentProgress", &Dali::Animation::GetCurrentProgress)
1055 .function("setSpeedFactor", &Dali::Animation::SetSpeedFactor)
1056 .function("getSpeedFactor", &Dali::Animation::GetSpeedFactor)
1057 .function("setPlayRange", &Dali::Animation::SetPlayRange)
1058 .function("getPlayRange", &Dali::Animation::GetPlayRange)
1059 .function("play", &Dali::Animation::Play)
1060 .function("playFrom", &Dali::Animation::PlayFrom)
1061 .function("pause", &Dali::Animation::Pause)
1062 .function("stop", &Dali::Animation::Stop)
1063 .function("clear", &Dali::Animation::Clear)
1066 class_<Dali::PropertyBuffer>("PropertyBuffer")
1067 .constructor<Dali::Property::Map&>(Dali::PropertyBuffer::New)
1068 .function("setData", &SetPropertyBufferDataRaw)
1071 class_<Dali::Geometry>("Geometry")
1072 .constructor<>(&Dali::Geometry::New)
1073 .function("addVertexBuffer", &Dali::Geometry::AddVertexBuffer)
1074 .function("getNumberOfVertexBuffers", &Dali::Geometry::GetNumberOfVertexBuffers)
1075 .function("setIndexBuffer", &SetIndexBufferDataRaw)
1076 .function("setGeometryType", &Dali::Geometry::SetGeometryType)
1077 .function("getGeometryType", &Dali::Geometry::GetGeometryType)
1080 class_<Dali::Image>("Image")
1083 class_<Dali::BufferImage, base<Dali::Image> >("BufferImage")
1084 .constructor<const std::string&, unsigned int, unsigned int, Dali::Pixel::Format>(&BufferImageNew)
1087 class_<Dali::EncodedBufferImage, base<Dali::Image> >("EncodedBufferImage")
1088 .constructor<const std::string&>(&EncodedBufferImageNew)
1091 class_<Dali::Sampler>("Sampler")
1092 .constructor<>(&Dali::Sampler::New)
1095 class_<Dali::Shader, base<Dali::Handle>>("Shader")
1096 .constructor<>(&Dali::Shader::New)
1099 class_<Dali::TextureSet>("TextureSet")
1100 .constructor<>(&Dali::TextureSet::New)
1101 .function("setImage", &Dali::TextureSet::SetImage)
1102 .function("setSampler", &Dali::TextureSet::SetSampler)
1103 .function("getImage", &Dali::TextureSet::GetImage)
1104 .function("getSampler", &Dali::TextureSet::GetSampler)
1105 .function("getTextureCount", &Dali::TextureSet::GetTextureCount)
1108 class_<Dali::Renderer, base<Dali::Handle>>("Renderer")
1109 .constructor<>(&Dali::Renderer::New)
1110 .function("setGeometry", &Dali::Renderer::SetGeometry)
1111 .function("getGeometry", &Dali::Renderer::GetGeometry)
1112 .function("SetTextures", &Dali::Renderer::SetTextures)
1113 .function("SetTextures", &Dali::Renderer::SetTextures)
1116 class_<Dali::ShaderEffect, base<Dali::Handle>>("ShaderEffect")
1117 .constructor<const std::string&, const std::string&,
1118 const std::string&, const std::string&,
1119 int >(&CreateShaderEffect)
1120 .function("setEffectImage", &Dali::ShaderEffect::SetEffectImage)
1121 .function("__setUniform", &SetUniform)
1124 class_<Dali::Actor, base<Dali::Handle>>("Actor")
1125 .constructor<>(&Dali::Actor::New)
1126 .function("add", &Dali::Actor::Add)
1127 .function("remove", &Dali::Actor::Remove)
1128 .function("getId", &Dali::Actor::GetId)
1129 .function("__getParent", &Dali::Actor::GetParent)
1130 .function("__findChildById", &Dali::Actor::FindChildById)
1131 .function("__findChildByName", &Dali::Actor::FindChildByName)
1132 .function("__getChildAt", &Dali::Actor::GetChildAt)
1133 .function("getChildCount", &Dali::Actor::GetChildCount)
1134 .function("__screenToLocal",
1135 select_overload<std::vector<float> (Dali::Actor, float, float)>(&ScreenToLocal))
1136 .function("addressOf", &AddressOf)
1137 .function("__connect", &ConnectSignal)
1138 .function("__setPropertyNotification", &SetPropertyNotification)
1139 .function("addRenderer", &Dali::Actor::AddRenderer)
1140 .function("getRendererCount", &Dali::Actor::GetRendererCount)
1141 .function("removeRenderer",
1142 select_overload<void(unsigned int)>(&Dali::Actor::RemoveRenderer))
1143 .function("__getRendererAt", &Dali::Actor::GetRendererAt)
1146 class_<Dali::CameraActor, base<Dali::Actor>>("CameraActor")
1147 .constructor<>( select_overload<Dali::CameraActor()>(&Dali::CameraActor::New))
1150 class_<Dali::Layer, base<Dali::Actor>>("Layer")
1151 .constructor<>(&Dali::Layer::New)
1152 .function("raise", &Dali::Layer::Raise)
1153 .function("lower", &Dali::Layer::Lower)
1156 class_<Dali::Stage>("Stage")
1157 .constructor<>(&Dali::Stage::GetCurrent)
1158 .function("add", &Dali::Stage::Add)
1159 .function("remove", &Dali::Stage::Remove)
1160 .function("__getRootLayer", &Dali::Stage::GetRootLayer)
1161 .function("getLayer", &Dali::Stage::GetLayer)
1162 .function("getRenderTaskList", &Dali::Stage::GetRenderTaskList)
1163 .function("setBackgroundColor", &Dali::Stage::SetBackgroundColor)
1166 class_<Dali::RenderTaskList>("RenderTaskList")
1167 .function("createTask", &Dali::RenderTaskList::CreateTask)
1168 .function("removeTask", &Dali::RenderTaskList::RemoveTask)
1169 .function("getTaskCount", &Dali::RenderTaskList::GetTaskCount)
1170 .function("getTask", &Dali::RenderTaskList::GetTask)
1173 class_<Dali::RenderTask>("RenderTask")
1174 .function("__getCameraActor", &Dali::RenderTask::GetCameraActor)
1175 .function("setCameraActor", &Dali::RenderTask::SetCameraActor)
1176 .function("setSourceActor", &Dali::RenderTask::SetSourceActor)
1177 .function("setExclusive", &Dali::RenderTask::SetExclusive)
1178 .function("setInputEnabled", &Dali::RenderTask::SetInputEnabled)
1179 .function("setViewportPosition", &Dali::RenderTask::SetViewportPosition)
1180 .function("setViewportSize", &Dali::RenderTask::SetViewportSize)
1181 .function("getCurrentViewportPosition", &Dali::RenderTask::GetCurrentViewportPosition)
1182 .function("getCurrentViewportSize", &Dali::RenderTask::GetCurrentViewportSize)
1183 .function("setClearColor", &Dali::RenderTask::SetClearColor)
1184 .function("getClearColor", &Dali::RenderTask::GetClearColor)
1185 .function("setClearEnabled", &Dali::RenderTask::SetClearEnabled)
1186 .function("getClearEnabled", &Dali::RenderTask::GetClearEnabled)
1187 .function("screenToLocal",
1188 select_overload<Dali::Vector2(Dali::RenderTask, Dali::Actor, float, float)>(&ScreenToLocal))
1189 .function("worldToScreen", &WorldToScreen)
1194 }; // namespace Emscripten
1195 }; // namespace Internal
1196 }; // namespace Dali