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/material.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 "handle-wrapper.h"
41 #include "image-wrapper.h"
42 #include "property-buffer-wrapper.h"
43 #include "property-value-wrapper.h"
44 #include "render-task-wrapper.h"
45 #include "shader-effect-wrapper.h"
46 #include "signal-holder.h"
47 #include "type-info-wrapper.h"
49 ////////////////////////////////////////////////////////////////////////////////
51 // The browser javascript wrapper consists of this cpp file and a counterpart
54 // They work in tandem to help make the interface natural and convenient
55 // for a Javascript programmer.
57 // Unfortunately there is no finalize/destruction in javascript so any cpp
58 // objects created must be explicitly deleted. Sometimes this wrapper can
59 // hide the details and simple types can be immediately marshalled to and
60 // from javascript values. More often objects created must have
61 // object.delete() called at the correct time.
63 ////////////////////////////////////////////////////////////////////////////////
65 extern void EmscriptenMouseEvent(double x, double y, int mouseIsDown);
66 extern void EmscriptenUpdateOnce();
67 extern void EmscriptenRenderOnce();
76 // Javascript callbacks. These are set in the Javascript wrapper source and called
77 // from the c++ wrapper source
78 extern emscripten::val JSGetGlyphImage;
79 extern emscripten::val JSGetImage;
80 extern emscripten::val JSGetImageMetaData;
81 extern emscripten::val JSRenderFinished;
83 using namespace emscripten;
86 * Dali Vector access for Emscripten wrapping of Dali::Vector
88 template<typename DaliVectorType>
89 struct DaliVectorAccess
91 static emscripten::val Get( const DaliVectorType& v, typename DaliVectorType::SizeType index )
95 return emscripten::val(v[index]);
99 return emscripten::val::undefined();
103 static bool Set( DaliVectorType& v, typename DaliVectorType::SizeType index, const typename DaliVectorType::ItemType& value)
109 static size_t Size( DaliVectorType& v)
116 * Registering a Dali Vector with Emscripten to wrap for JavaScript
119 class_<Dali::Vector<T>> register_dali_vector(const char* name)
121 typedef Dali::Vector<T> DaliVecType;
123 void (DaliVecType::*PushBack)(const T&) = &DaliVecType::PushBack;
124 void (DaliVecType::*Resize)(const size_t, const T&) = &DaliVecType::Resize;
125 return class_<DaliVecType>(name)
126 .template constructor<>()
127 .function("push_back", PushBack)
128 .function("resize", Resize)
129 .function("size", &DaliVectorAccess<DaliVecType>::Size)
130 .function("get", &DaliVectorAccess<DaliVecType>::Get)
131 .function("set", &DaliVectorAccess<DaliVecType>::Set)
139 std::string VersionString()
141 std::stringstream versionString;
142 versionString << "DALi Core: " << Dali::CORE_MAJOR_VERSION << "." << Dali::CORE_MINOR_VERSION << "." << Dali::CORE_MICRO_VERSION << " (" << Dali::CORE_BUILD_DATE << ")" << std::endl;
143 return versionString.str();
148 * String conversions for C++ types. For PropertyValueToString() conversions.
150 template <typename T>
151 std::string ToString(const T& value)
153 std::stringstream ss;
159 * Dali Rect to string template specialization
162 std::string ToString(const Dali::Rect<int>& value)
164 std::stringstream ss;
165 ss << value.x << "," << value.y << "," << value.width << "," << value.height;
170 * Converts Dali Property Value to string
172 std::string PropertyValueToString( const Dali::Property::Value& value )
176 switch( value.GetType() )
178 case Dali::Property::NONE:
183 case Dali::Property::BOOLEAN:
185 ret = value.Get<bool>() ? "True" : "False";
188 case Dali::Property::FLOAT:
190 ret = ToString( value.Get<float>() );
193 case Dali::Property::INTEGER:
195 ret = ToString( value.Get<int>() );
198 case Dali::Property::VECTOR2:
200 ret = ToString( value.Get<Dali::Vector2>() );
203 case Dali::Property::VECTOR3:
205 ret = ToString( value.Get<Dali::Vector3>() );
208 case Dali::Property::VECTOR4:
210 ret = ToString( value.Get<Dali::Vector4>() );
213 case Dali::Property::MATRIX3:
215 ret = ToString( value.Get<Dali::Matrix3>() );
218 case Dali::Property::MATRIX:
220 ret = ToString( value.Get<Dali::Matrix>() );
223 case Dali::Property::RECTANGLE:
225 ret = ToString( value.Get< Dali::Rect<int> >() );
228 case Dali::Property::ROTATION:
232 case Dali::Property::STRING:
234 ret = value.Get<std::string>();
237 case Dali::Property::ARRAY:
239 Dali::Property::Array *array = value.GetArray();
240 DALI_ASSERT_ALWAYS(array);
241 ret = std::string("Array Size=") + ToString( array->Count() );
244 case Dali::Property::MAP:
246 Dali::Property::Map *map = value.GetMap();
247 DALI_ASSERT_ALWAYS(map);
248 ret = std::string("Map Size=") + ToString( map->Count() );
257 * Creates an Actor previously registered with the TypeRegistry by name
258 * Actors are currently differentiated in the dali-wrapper.js and have accessor functions
259 * to support 'property.name=' access in the Javascript side object
261 Dali::Actor CreateActor(const std::string& name)
265 Dali::TypeRegistry registry = Dali::TypeRegistry::Get();
267 Dali::TypeInfo typeInfo = registry.GetTypeInfo( name );
271 EM_ASM( throw "Invalid type name" );
275 Dali::BaseHandle handle = typeInfo.CreateInstance();
279 EM_ASM( throw "Invalid handle. Cannot downcast (not an actor)" );
282 if( Dali::Actor actor = Dali::Actor::DownCast(handle) )
292 * Creates any Handle from the TypeRegistry by name
294 Dali::Handle CreateHandle(const std::string& name)
298 Dali::TypeRegistry registry = Dali::TypeRegistry::Get();
300 Dali::TypeInfo typeInfo = registry.GetTypeInfo( name );
304 EM_ASM( throw "Invalid type name" );
308 Dali::BaseHandle base = typeInfo.CreateInstance();
311 EM_ASM( throw "Cannot create instance (not a handle)" );
313 Dali::Handle handle = Dali::Handle::DownCast(base);
317 EM_ASM( throw "Invalid handle. Cannot downcast" );
327 * The functor to be used in the hit-test algorithm to check whether the actor is hittable.
329 bool IsActorHittableFunction(Dali::Actor actor, Dali::HitTestAlgorithm::TraverseType type)
331 const std::string& name = actor.GetName();
332 // by convention if not visible, or with a * starting the name or if the root layer
333 return actor.IsVisible() && (name.size() ? name[0] != '*' : true);
340 Dali::Actor HitTest(float x, float y)
342 Dali::HitTestAlgorithm::Results results;
343 Dali::HitTestAlgorithm::HitTest( Dali::Stage::GetCurrent(), Dali::Vector2(x,y), results, IsActorHittableFunction );
344 return results.actor;
348 * Creates a solid colour actor
350 Dali::Actor CreateSolidColorActor( const Dali::Vector4& color, bool border, const Dali::Vector4& borderColor, const unsigned int borderSize )
352 static const unsigned int MAX_BORDER_SIZE( 9 );
354 Dali::ImageActor image;
355 if( borderSize > MAX_BORDER_SIZE )
360 const unsigned int bitmapWidth = borderSize * 2 + 2;
362 // Using a (2 + border) x (2 + border) image gives a better blend with the GL implementation
363 // than a (1 + border) x (1 + border) image
364 const unsigned int bitmapSize = bitmapWidth * bitmapWidth;
365 const unsigned int topLeft = bitmapWidth * borderSize + borderSize;
366 const unsigned int topRight = topLeft + 1;
367 const unsigned int bottomLeft = bitmapWidth * (borderSize + 1) + borderSize;
368 const unsigned int bottomRight = bottomLeft + 1;
370 Dali::BufferImage imageData;
371 if(color.a != 1.0 || borderColor.a != 1.0)
373 imageData = Dali::BufferImage::New( bitmapWidth, bitmapWidth, Dali::Pixel::RGBA8888 );
376 Dali::PixelBuffer* pixbuf = imageData.GetBuffer();
377 Dali::Vector4 outerColor = color;
380 outerColor = borderColor;
383 for( size_t i = 0; i < bitmapSize; ++i )
390 pixbuf[i*4+0] = 0xFF * color.r;
391 pixbuf[i*4+1] = 0xFF * color.g;
392 pixbuf[i*4+2] = 0xFF * color.b;
393 pixbuf[i*4+3] = 0xFF * color.a;
397 pixbuf[i*4+0] = 0xFF * outerColor.r;
398 pixbuf[i*4+1] = 0xFF * outerColor.g;
399 pixbuf[i*4+2] = 0xFF * outerColor.b;
400 pixbuf[i*4+3] = 0xFF * outerColor.a;
406 imageData = Dali::BufferImage::New( bitmapWidth, bitmapWidth, Dali::Pixel::RGB888 );
409 Dali::PixelBuffer* pixbuf = imageData.GetBuffer();
410 Dali::Vector4 outerColor = color;
413 outerColor = borderColor;
416 for( size_t i = 0; i < bitmapSize; ++i )
423 pixbuf[i*3+0] = 0xFF * color.r;
424 pixbuf[i*3+1] = 0xFF * color.g;
425 pixbuf[i*3+2] = 0xFF * color.b;
429 pixbuf[i*3+0] = 0xFF * outerColor.r;
430 pixbuf[i*3+1] = 0xFF * outerColor.g;
431 pixbuf[i*3+2] = 0xFF * outerColor.b;
437 image = Dali::ImageActor::New( imageData );
438 image.SetAnchorPoint( Dali::AnchorPoint::CENTER );
439 image.SetParentOrigin( Dali::ParentOrigin::CENTER );
443 // image.SetStyle( Dali::ImageActor::STYLE_NINE_PATCH );
444 // image.SetNinePatchBorder( Dali::Vector4::ONE * (float)borderSize * 2.0f );
453 * Sets the callback to getting a glyph (from dali-wrapper.js/browser)
455 void SetCallbackGetGlyphImage(const emscripten::val& callback)
457 JSGetGlyphImage = callback;
461 * Sets the callback to get an image (from dali-wrapper.js/browser)
463 void SetCallbackGetImage(const emscripten::val& callback)
465 JSGetImage = callback;
469 * Sets the callback to get image meta data (from dali-wrapper.js/browser)
471 void SetCallbackGetImageMetadata(const emscripten::val& callback)
473 JSGetImageMetaData = callback;
477 * Sets the callback to signal render finished to dali-wrapper.js/browser
479 void SetCallbackRenderFinished(const emscripten::val& callback)
481 JSRenderFinished = callback;
485 * Generates control points for a Path
487 void GenerateControlPoints(Dali::Handle& handle, float curvature)
491 Dali::Path path = Dali::Path::DownCast(handle);
494 path.GenerateControlPoints(curvature);
498 EM_ASM( throw "Handle is not a path object" );
503 EM_ASM( throw "Handle is empty" );
509 * Creating property Value Objects
510 * javascript can't select on type so we have renamed constructors
512 * Emscripten can convert some basic types and ones we've declared as value_array(s)
513 * (These are given member access offsets/functions and are for simple structs etc)
515 * The composite types need converting.
517 Dali::Property::Value PropertyValueBoolean(bool v)
519 return Dali::Property::Value(v);
522 Dali::Property::Value PropertyValueFloat(float v)
524 return Dali::Property::Value(v);
527 Dali::Property::Value PropertyValueInteger(int v)
529 return Dali::Property::Value(v);
532 Dali::Property::Value PropertyValueVector2( const Dali::Vector2& v )
534 return Dali::Property::Value(v);
537 Dali::Property::Value PropertyValueVector3( const Dali::Vector3& v )
539 return Dali::Property::Value(v);
542 Dali::Property::Value PropertyValueVector4( const Dali::Vector4& v )
544 return Dali::Property::Value(v);
547 Dali::Property::Value PropertyValueIntRect( int a, int b, int c, int d )
549 return Dali::Property::Value(Dali::Rect<int>( a, b, c, d));
552 Dali::Property::Value PropertyValueMatrix( const Dali::Matrix& v )
554 return Dali::Property::Value(v);
557 Dali::Property::Value PropertyValueMatrix3( const Dali::Matrix3& v )
559 return Dali::Property::Value(v);
562 Dali::Property::Value PropertyValueEuler( const Dali::Vector3& v )
564 return Dali::Property::Value( Dali::Quaternion(
565 Dali::Radian(Dali::Degree(v.x)),
566 Dali::Radian(Dali::Degree(v.y)),
567 Dali::Radian(Dali::Degree(v.z)) ) );
570 Dali::Property::Value PropertyValueAxisAngle( const Dali::Vector4& v )
572 return Dali::Quaternion( Dali::Radian(Dali::Degree(v[3])), Dali::Vector3(v) );
575 Dali::Property::Value PropertyValueString( const std::string& v )
577 return Dali::Property::Value(v);
580 Dali::Property::Value PropertyValueContainer( const emscripten::val& v )
582 Dali::Property::Value ret;
583 RecursiveSetProperty( ret, v );
588 * Property value accessors from Dali Property Value
590 bool PropertyGetBoolean(const Dali::Property::Value& v)
592 return v.Get<bool>();
595 float PropertyGetFloat(const Dali::Property::Value& v)
597 return v.Get<float>();
600 int PropertyGetInteger(const Dali::Property::Value& v)
605 Dali::Vector2 PropertyGetVector2(const Dali::Property::Value& v)
607 return v.Get<Dali::Vector2>();
610 Dali::Vector3 PropertyGetVector3(const Dali::Property::Value& v)
612 return v.Get<Dali::Vector3>();
615 Dali::Vector4 PropertyGetVector4(const Dali::Property::Value& v)
617 return v.Get<Dali::Vector4>();
620 emscripten::val PropertyGetIntRect(const Dali::Property::Value& v)
622 return JavascriptValue(v);
625 std::string PropertyGetString(const Dali::Property::Value& v)
627 return v.Get<std::string>();
630 emscripten::val PropertyGetMap(const Dali::Property::Value& v)
632 return JavascriptValue(v);
635 emscripten::val PropertyGetArray(const Dali::Property::Value& v)
637 return JavascriptValue(v);
640 emscripten::val PropertyGetMatrix(const Dali::Property::Value& v)
642 return JavascriptValue(v);
645 emscripten::val PropertyGetMatrix3(const Dali::Property::Value& v)
647 return JavascriptValue(v);
650 emscripten::val PropertyGetEuler(const Dali::Property::Value& v)
652 return JavascriptValue(v);
655 emscripten::val PropertyGetRotation(const Dali::Property::Value& v)
657 return JavascriptValue(v);
660 int PropertyGetType(Dali::Property::Value& v)
662 return (int)v.GetType();
665 std::string PropertyGetTypeName(Dali::Property::Value& v)
667 return Dali::PropertyTypes::GetName(v.GetType());
670 template <typename T>
671 float MatrixGetter(T &v, int n)
673 return *(v.AsFloat() + n);
676 template <typename T>
677 void MatrixSetter(T &v, float f, int n)
679 *(v.AsFloat() + n) = f;
682 float MatrixGetter0(const Dali::Matrix &v) { return MatrixGetter(v, 0); }
683 float MatrixGetter1(const Dali::Matrix &v) { return MatrixGetter(v, 1); }
684 float MatrixGetter2(const Dali::Matrix &v) { return MatrixGetter(v, 2); }
685 float MatrixGetter3(const Dali::Matrix &v) { return MatrixGetter(v, 3); }
686 float MatrixGetter4(const Dali::Matrix &v) { return MatrixGetter(v, 4); }
687 float MatrixGetter5(const Dali::Matrix &v) { return MatrixGetter(v, 5); }
688 float MatrixGetter6(const Dali::Matrix &v) { return MatrixGetter(v, 6); }
689 float MatrixGetter7(const Dali::Matrix &v) { return MatrixGetter(v, 7); }
690 float MatrixGetter8(const Dali::Matrix &v) { return MatrixGetter(v, 8); }
691 float MatrixGetter9(const Dali::Matrix &v) { return MatrixGetter(v, 9); }
692 float MatrixGetter10(const Dali::Matrix &v) { return MatrixGetter(v,10); }
693 float MatrixGetter11(const Dali::Matrix &v) { return MatrixGetter(v,11); }
694 float MatrixGetter12(const Dali::Matrix &v) { return MatrixGetter(v,12); }
695 float MatrixGetter13(const Dali::Matrix &v) { return MatrixGetter(v,13); }
696 float MatrixGetter14(const Dali::Matrix &v) { return MatrixGetter(v,14); }
697 float MatrixGetter15(const Dali::Matrix &v) { return MatrixGetter(v,15); }
698 float MatrixGetter16(const Dali::Matrix &v) { return MatrixGetter(v,16); }
700 void MatrixSetter0(Dali::Matrix &v, float f) { MatrixSetter(v, f, 0); }
701 void MatrixSetter1(Dali::Matrix &v, float f) { MatrixSetter(v, f, 1); }
702 void MatrixSetter2(Dali::Matrix &v, float f) { MatrixSetter(v, f, 2); }
703 void MatrixSetter3(Dali::Matrix &v, float f) { MatrixSetter(v, f, 3); }
704 void MatrixSetter4(Dali::Matrix &v, float f) { MatrixSetter(v, f, 4); }
705 void MatrixSetter5(Dali::Matrix &v, float f) { MatrixSetter(v, f, 5); }
706 void MatrixSetter6(Dali::Matrix &v, float f) { MatrixSetter(v, f, 6); }
707 void MatrixSetter7(Dali::Matrix &v, float f) { MatrixSetter(v, f, 7); }
708 void MatrixSetter8(Dali::Matrix &v, float f) { MatrixSetter(v, f, 8); }
709 void MatrixSetter9(Dali::Matrix &v, float f) { MatrixSetter(v, f, 9); }
710 void MatrixSetter10(Dali::Matrix &v, float f) { MatrixSetter(v, f,10); }
711 void MatrixSetter11(Dali::Matrix &v, float f) { MatrixSetter(v, f,11); }
712 void MatrixSetter12(Dali::Matrix &v, float f) { MatrixSetter(v, f,12); }
713 void MatrixSetter13(Dali::Matrix &v, float f) { MatrixSetter(v, f,13); }
714 void MatrixSetter14(Dali::Matrix &v, float f) { MatrixSetter(v, f,14); }
715 void MatrixSetter15(Dali::Matrix &v, float f) { MatrixSetter(v, f,15); }
716 void MatrixSetter16(Dali::Matrix &v, float f) { MatrixSetter(v, f,16); }
718 float Matrix3Getter0(const Dali::Matrix3 &v) { return MatrixGetter(v, 0); }
719 float Matrix3Getter1(const Dali::Matrix3 &v) { return MatrixGetter(v, 1); }
720 float Matrix3Getter2(const Dali::Matrix3 &v) { return MatrixGetter(v, 2); }
721 float Matrix3Getter3(const Dali::Matrix3 &v) { return MatrixGetter(v, 3); }
722 float Matrix3Getter4(const Dali::Matrix3 &v) { return MatrixGetter(v, 4); }
723 float Matrix3Getter5(const Dali::Matrix3 &v) { return MatrixGetter(v, 5); }
724 float Matrix3Getter6(const Dali::Matrix3 &v) { return MatrixGetter(v, 6); }
725 float Matrix3Getter7(const Dali::Matrix3 &v) { return MatrixGetter(v, 7); }
726 float Matrix3Getter8(const Dali::Matrix3 &v) { return MatrixGetter(v, 8); }
728 void Matrix3Setter0(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 0); }
729 void Matrix3Setter1(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 1); }
730 void Matrix3Setter2(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 2); }
731 void Matrix3Setter3(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 3); }
732 void Matrix3Setter4(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 4); }
733 void Matrix3Setter5(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 5); }
734 void Matrix3Setter6(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 6); }
735 void Matrix3Setter7(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 7); }
736 void Matrix3Setter8(Dali::Matrix3 &v, float f) { MatrixSetter(v, f, 8); }
738 val JavascriptUpdateCallback( val::undefined() );
739 bool JavascriptUpdateCallbackSet = false;
741 void JavascriptUpdate(int dt)
743 if( JavascriptUpdateCallbackSet )
745 JavascriptUpdateCallback( val(dt) );
749 void SetUpdateFunction( const emscripten::val& function )
751 JavascriptUpdateCallback = function;
752 JavascriptUpdateCallbackSet = true;
755 const emscripten::val& GetUpdateFunction()
757 return JavascriptUpdateCallback;
761 * Emscripten Bindings
763 * This uses Emscripten 'bind' (similar in design to Boost's python wrapper library).
764 * It provides a simplified way to wrap C++ classes and wraps Emscriptens type
767 * A convention below is that where there is a function or method name prepended
768 * with '__' there is a corresponding Javascript helper function to help with
769 * marshalling parameters and return values.
772 EMSCRIPTEN_BINDINGS(dali_wrapper)
774 // With a little help embind knows about vectors so we tell it which ones to instantiate
775 register_dali_vector<int>("DaliVectorInt");
776 register_vector<std::string>("VectorString");
777 register_vector<int>("VectorInt");
778 register_vector<float>("VectorFloat");
779 register_vector<Dali::Actor>("VectorActor");
782 // Creation functions.
784 emscripten::function("VersionString", &VersionString);
785 emscripten::function("__createActor", &CreateActor);
786 emscripten::function("__createHandle", &CreateHandle);
787 emscripten::function("__createSolidColorActor", &CreateSolidColorActor);
792 emscripten::function("javascriptValue", &JavascriptValue);
793 emscripten::function("__hitTest", &HitTest);
794 emscripten::function("sendMouseEvent", &EmscriptenMouseEvent);
795 emscripten::function("__updateOnce", &EmscriptenUpdateOnce);
796 emscripten::function("__renderOnce", &EmscriptenRenderOnce);
797 emscripten::function("generateControlPoints", &GenerateControlPoints);
800 // Global callback functions
802 emscripten::function("setCallbackGetGlyphImage", &SetCallbackGetGlyphImage);
803 emscripten::function("setCallbackGetImage", &SetCallbackGetImage);
804 emscripten::function("setCallbackGetImageMetadata", &SetCallbackGetImageMetadata);
805 emscripten::function("setCallbackRenderFinished", &SetCallbackRenderFinished);
806 emscripten::function("setUpdateFunction", &SetUpdateFunction);
807 emscripten::function("getUpdateFunction", &GetUpdateFunction);
810 // Property value creation (Javascript can't select on type)
812 emscripten::function("PropertyValueBoolean", &PropertyValueBoolean);
813 emscripten::function("PropertyValueFloat", &PropertyValueFloat);
814 emscripten::function("PropertyValueInteger", &PropertyValueInteger);
815 emscripten::function("PropertyValueString", &PropertyValueString);
816 emscripten::function("PropertyValueVector2", &PropertyValueVector2);
817 emscripten::function("PropertyValueVector3", &PropertyValueVector3);
818 emscripten::function("PropertyValueVector4", &PropertyValueVector4);
819 emscripten::function("PropertyValueMatrix", &PropertyValueMatrix);
820 emscripten::function("PropertyValueMatrix3", &PropertyValueMatrix3);
821 emscripten::function("PropertyValueMap", &PropertyValueContainer);
822 emscripten::function("PropertyValueArray", &PropertyValueContainer);
823 emscripten::function("PropertyValueEuler", &PropertyValueEuler);
824 emscripten::function("PropertyValueAxisAngle", &PropertyValueAxisAngle);
825 emscripten::function("PropertyValueString", &PropertyValueString);
826 emscripten::function("PropertyValueIntRect", &PropertyValueIntRect);
829 // One unfortunate aspect of wrapping for the browser is that we get no notification
830 // of object deletion so all JS wrapper objects must be wrapper.delete() correctly.
832 // Embind has a mechanism around this for simple c style structs decared as value_arrays.
833 // These are immediately transformed to Javascript arrays and don't need explicit
834 // destruction, however the API needs a member offset.
836 value_array<Dali::Internal::Emscripten::Statistics>("Statistics")
837 .element(&Dali::Internal::Emscripten::Statistics::on)
838 .element(&Dali::Internal::Emscripten::Statistics::frameCount)
839 .element(&Dali::Internal::Emscripten::Statistics::lastFrameDeltaSeconds)
840 .element(&Dali::Internal::Emscripten::Statistics::lastSyncTimeMilliseconds)
841 .element(&Dali::Internal::Emscripten::Statistics::nextSyncTimeMilliseconds)
842 .element(&Dali::Internal::Emscripten::Statistics::keepUpdating)
843 .element(&Dali::Internal::Emscripten::Statistics::needsNotification)
844 .element(&Dali::Internal::Emscripten::Statistics::secondsFromLastFrame)
847 value_array<Dali::Vector2>("Vector2")
848 .element(&Dali::Vector2::x)
849 .element(&Dali::Vector2::y)
852 value_array<Dali::Vector3>("Vector3")
853 .element(&Dali::Vector3::x)
854 .element(&Dali::Vector3::y)
855 .element(&Dali::Vector3::z)
858 value_array<Dali::Vector4>("Vector4")
859 .element(&Dali::Vector4::x)
860 .element(&Dali::Vector4::y)
861 .element(&Dali::Vector4::z)
862 .element(&Dali::Vector4::w)
865 value_array<Dali::Matrix>("Matrix")
866 .element(&MatrixGetter0, &MatrixSetter0)
867 .element(&MatrixGetter1, &MatrixSetter1)
868 .element(&MatrixGetter2, &MatrixSetter2)
869 .element(&MatrixGetter3, &MatrixSetter3)
870 .element(&MatrixGetter4, &MatrixSetter4)
871 .element(&MatrixGetter5, &MatrixSetter5)
872 .element(&MatrixGetter6, &MatrixSetter6)
873 .element(&MatrixGetter7, &MatrixSetter7)
874 .element(&MatrixGetter8, &MatrixSetter8)
875 .element(&MatrixGetter9, &MatrixSetter9)
876 .element(&MatrixGetter10, &MatrixSetter10)
877 .element(&MatrixGetter11, &MatrixSetter11)
878 .element(&MatrixGetter12, &MatrixSetter12)
879 .element(&MatrixGetter13, &MatrixSetter13)
880 .element(&MatrixGetter14, &MatrixSetter14)
881 .element(&MatrixGetter15, &MatrixSetter15)
884 value_array<Dali::Matrix3>("Matrix3")
885 .element(&Matrix3Getter0, &Matrix3Setter0)
886 .element(&Matrix3Getter1, &Matrix3Setter1)
887 .element(&Matrix3Getter2, &Matrix3Setter2)
888 .element(&Matrix3Getter3, &Matrix3Setter3)
889 .element(&Matrix3Getter4, &Matrix3Setter4)
890 .element(&Matrix3Getter5, &Matrix3Setter5)
891 .element(&Matrix3Getter6, &Matrix3Setter6)
892 .element(&Matrix3Getter7, &Matrix3Setter7)
893 .element(&Matrix3Getter8, &Matrix3Setter8)
899 enum_<Dali::Property::Type>("PropertyType")
900 .value("NONE", Dali::Property::NONE)
901 .value("BOOLEAN", Dali::Property::BOOLEAN)
902 .value("FLOAT", Dali::Property::FLOAT)
903 .value("INTEGER", Dali::Property::INTEGER)
904 .value("VECTOR2", Dali::Property::VECTOR2)
905 .value("VECTOR3", Dali::Property::VECTOR3)
906 .value("VECTOR4", Dali::Property::VECTOR4)
907 .value("MATRIX3", Dali::Property::MATRIX3)
908 .value("MATRIX", Dali::Property::MATRIX)
909 .value("RECTANGLE", Dali::Property::RECTANGLE)
910 .value("ROTATION", Dali::Property::ROTATION)
911 .value("STRING", Dali::Property::STRING)
912 .value("ARRAY", Dali::Property::ARRAY)
913 .value("MAP", Dali::Property::MAP)
916 enum_<Dali::ShaderEffect::GeometryHints>("GeometryHints")
917 .value("HINT_NONE", Dali::ShaderEffect::HINT_NONE)
918 .value("HINT_GRID_X", Dali::ShaderEffect::HINT_GRID_X)
919 .value("HINT_GRID_Y", Dali::ShaderEffect::HINT_GRID_Y)
920 .value("HINT_GRID", Dali::ShaderEffect::HINT_GRID)
921 .value("HINT_DEPTH_BUFFER", Dali::ShaderEffect::HINT_DEPTH_BUFFER)
922 .value("HINT_BLENDING", Dali::ShaderEffect::HINT_BLENDING)
923 .value("HINT_DOESNT_MODIFY_GEOMETRY", Dali::ShaderEffect::HINT_DOESNT_MODIFY_GEOMETRY)
926 enum_<Dali::Shader::ShaderHints>("ShaderHints")
927 .value("HINT_NONE", Dali::Shader::HINT_NONE)
928 .value("HINT_REQUIRES_SELF_DEPTH_TEST", Dali::Shader::HINT_REQUIRES_SELF_DEPTH_TEST)
929 .value("HINT_OUTPUT_IS_TRANSPARENT", Dali::Shader::HINT_OUTPUT_IS_TRANSPARENT)
930 .value("HINT_OUTPUT_IS_OPAQUE", Dali::Shader::HINT_OUTPUT_IS_OPAQUE)
931 .value("HINT_MODIFIES_GEOMETRY", Dali::Shader::HINT_MODIFIES_GEOMETRY)
934 enum_<Dali::Animation::EndAction>("EndAction")
935 .value("Bake", Dali::Animation::Bake)
936 .value("Discard", Dali::Animation::Discard)
937 .value("BakeFinal", Dali::Animation::BakeFinal)
940 enum_<Dali::Animation::Interpolation>("Interpolation")
941 .value("Linear", Dali::Animation::Interpolation::Linear)
942 .value("Cubic", Dali::Animation::Interpolation::Cubic)
945 enum_<Dali::Geometry::GeometryType>("GeometryType")
946 .value("POINTS", Dali::Geometry::POINTS)
947 .value("LINES", Dali::Geometry::LINES)
948 .value("LINE_LOOP", Dali::Geometry::LINE_LOOP)
949 .value("LINE_STRIP", Dali::Geometry::LINE_STRIP)
950 .value("TRIANGLES", Dali::Geometry::TRIANGLES)
951 .value("TRIANGLE_FAN", Dali::Geometry::TRIANGLE_FAN)
952 .value("TRIANGLE_STRIP", Dali::Geometry::TRIANGLE_STRIP)
955 enum_<Dali::Image::ReleasePolicy>("ReleasePolicy")
956 .value("UNUSED", Dali::Image::UNUSED)
957 .value("NEVER", Dali::Image::NEVER)
960 enum_<Dali::Pixel::Format>("PixelFormat")
961 .value("A8", Dali::Pixel::Format::A8)
962 .value("L8", Dali::Pixel::Format::L8)
963 .value("LA88", Dali::Pixel::Format::LA88)
964 .value("RGB565", Dali::Pixel::Format::RGB565)
965 .value("BGR565", Dali::Pixel::Format::BGR565)
966 .value("RGBA4444", Dali::Pixel::Format::RGBA4444)
967 .value("BGRA4444", Dali::Pixel::Format::BGRA4444)
968 .value("RGBA5551", Dali::Pixel::Format::RGBA5551)
969 .value("BGRA5551", Dali::Pixel::Format::BGRA5551)
970 .value("RGB888", Dali::Pixel::Format::RGB888)
971 .value("RGB8888", Dali::Pixel::Format::RGB8888)
972 .value("BGR8888", Dali::Pixel::Format::BGR8888)
973 .value("RGBA8888", Dali::Pixel::Format::RGBA8888)
974 .value("BGRA8888", Dali::Pixel::Format::BGRA8888)
975 // GLES 3 Standard compressed formats:
976 .value("COMPRESSED_R11_EAC", Dali::Pixel::Format::COMPRESSED_R11_EAC)
977 .value("COMPRESSED_SIGNED_R11_EAC", Dali::Pixel::Format::COMPRESSED_SIGNED_R11_EAC)
978 .value("COMPRESSED_RG11_EAC", Dali::Pixel::Format::COMPRESSED_RG11_EAC)
979 .value("COMPRESSED_SIGNED_RG11_EAC", Dali::Pixel::Format::COMPRESSED_SIGNED_RG11_EAC)
980 .value("COMPRESSED_RGB8_ETC2", Dali::Pixel::Format::COMPRESSED_RGB8_ETC2)
981 .value("COMPRESSED_SRGB8_ETC2", Dali::Pixel::Format::COMPRESSED_SRGB8_ETC2)
982 .value("COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", Dali::Pixel::Format::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2)
983 .value("COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", Dali::Pixel::Format::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2)
984 .value("COMPRESSED_RGBA8_ETC2_EAC", Dali::Pixel::Format::COMPRESSED_RGBA8_ETC2_EAC)
985 .value("COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", Dali::Pixel::Format::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC)
986 // GLES 2 extension compressed formats:
987 .value("COMPRESSED_RGB8_ETC1", Dali::Pixel::Format::COMPRESSED_RGB8_ETC1)
988 .value("COMPRESSED_RGB_PVRTC_4BPPV1", Dali::Pixel::Format::COMPRESSED_RGB_PVRTC_4BPPV1)
991 enum_<Dali::Renderer::FaceCullingMode>("FaceCullingMode")
992 .value("NONE", Dali::Renderer::NONE)
993 .value("CULL_BACK", Dali::Renderer::CULL_BACK)
994 .value("CULL_FRONT", Dali::Renderer::CULL_FRONT)
995 .value("CULL_BACK_AND_FRONT", Dali::Renderer::CULL_BACK_AND_FRONT)
998 enum_<Dali::BlendingMode::Type>("BlendingMode")
999 .value("OFF", Dali::BlendingMode::OFF)
1000 .value("AUTO", Dali::BlendingMode::AUTO)
1001 .value("ON", Dali::BlendingMode::ON)
1004 enum_<Dali::AlphaFunction::BuiltinFunction>("AlphaFunction")
1005 .value("DEFAULT", Dali::AlphaFunction::BuiltinFunction::DEFAULT)
1006 .value("LINEAR", Dali::AlphaFunction::BuiltinFunction::LINEAR)
1007 .value("REVERSE", Dali::AlphaFunction::BuiltinFunction::REVERSE)
1008 .value("EASE_IN_SQUARE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_SQUARE)
1009 .value("EASE_OUT_SQUARE", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_SQUARE)
1010 .value("EASE_IN", Dali::AlphaFunction::BuiltinFunction::EASE_IN)
1011 .value("EASE_OUT", Dali::AlphaFunction::BuiltinFunction::EASE_OUT)
1012 .value("EASE_IN_OUT", Dali::AlphaFunction::BuiltinFunction::EASE_IN_OUT)
1013 .value("EASE_IN_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_SINE)
1014 .value("EASE_OUT_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_SINE)
1015 .value("EASE_IN_OUT_SINE", Dali::AlphaFunction::BuiltinFunction::EASE_IN_OUT_SINE)
1016 .value("BOUNCE", Dali::AlphaFunction::BuiltinFunction::BOUNCE)
1017 .value("SIN", Dali::AlphaFunction::BuiltinFunction::SIN)
1018 .value("EASE_OUT_BACK", Dali::AlphaFunction::BuiltinFunction::EASE_OUT_BACK)
1025 // we need property map as an object rather than straight conversion to javascript 'object'
1026 // because its ordered. And PropertyBuffer needs an order.
1027 class_<Dali::Property::Map>("PropertyMap")
1029 .function("count", &Dali::Property::Map::Count)
1030 .function("empty", &Dali::Property::Map::Empty)
1031 .function("__insert", select_overload< void(const std::string&, const Dali::Property::Value&) > (&Dali::Property::Map::Insert))
1032 .function("__get", &PropertyMapGet)
1033 .function("__getValue", &Dali::Property::Map::GetValue)
1034 .function("getKey", &Dali::Property::Map::GetKey)
1035 .function("clear", &Dali::Property::Map::Clear)
1036 .function("merge", &Dali::Property::Map::Merge)
1039 class_<Dali::Property::Value>("PropertyValue")
1041 .function("getType", &PropertyGetType)
1042 .function("getTypeName", &PropertyGetTypeName)
1043 .function("getBoolean", &PropertyGetBoolean)
1044 .function("getFloat", &PropertyGetFloat)
1045 .function("getInteger", &PropertyGetInteger)
1046 .function("getVector2", &PropertyGetVector2)
1047 .function("getVector3", &PropertyGetVector3)
1048 .function("getVector4", &PropertyGetVector4)
1049 .function("getString", &PropertyGetString)
1050 .function("getMap", &PropertyGetMap)
1051 .function("getArray", &PropertyGetArray)
1052 .function("getMatrix", &PropertyGetMatrix)
1053 .function("getMatrix3", &PropertyGetMatrix3)
1054 .function("getEuler", &PropertyGetEuler)
1055 .function("getRotation", &PropertyGetRotation)
1056 .function("getIntRect", &PropertyGetIntRect)
1059 class_<Dali::BaseHandle>("BaseHandle")
1060 .function("ok", &BaseHandleOk)
1061 .function("getTypeName", &BaseHandle::GetTypeName)
1064 class_<Dali::TypeInfo, base<Dali::BaseHandle>>("TypeInfo")
1065 .function("getName", &Dali::TypeInfo::GetName)
1066 .function("getBaseName", &Dali::TypeInfo::GetBaseName)
1067 .function("getProperties", &GetAllProperties)
1068 .function("getActions", &GetActions)
1069 .function("getSignals", &GetSignals)
1070 .function("getPropertyIndices", &Dali::TypeInfo::GetPropertyIndices)
1073 class_<Dali::TypeRegistry>("TypeRegistry")
1074 .constructor<>(&Dali::TypeRegistry::Get)
1075 .function("getTypeNameCount", &Dali::TypeRegistry::GetTypeNameCount)
1076 .function("getTypeName", &Dali::TypeRegistry::GetTypeName)
1077 .function("getTypeInfo", select_overload< Dali::TypeInfo(const std::string&) > (&Dali::TypeRegistry::GetTypeInfo))
1080 class_<SignalHolder>("SignalHolder")
1084 class_<Dali::Handle, base<Dali::BaseHandle>>("Handle")
1085 .function("__registerProperty", &RegisterProperty)
1086 .function("__registerAnimatedProperty", &RegisterAnimatedProperty)
1087 .function("setSelf", &SetSelf)
1088 .function("setProperty", &SetProperty)
1089 .function("getProperty", &GetProperty)
1090 .function("getPropertyIndex", &GetPropertyIndex)
1091 .function("getProperties", &GetProperties)
1092 .function("getPropertyIndices", &Handle::GetPropertyIndices)
1093 .function("getPropertyTypeFromName", &GetPropertyTypeFromName)
1094 .function("getPropertyTypeName", &GetPropertyTypeName)
1095 .function("registerProperty", &RegisterProperty)
1096 .function("registerAnimatedProperty", &RegisterAnimatedProperty)
1097 .function("getTypeInfo", &GetTypeInfo)
1098 .function("isPropertyWritable", &Handle::IsPropertyWritable)
1099 .function("isPropertyAnimatable", &Handle::IsPropertyAnimatable)
1100 .function("isPropertyAConstraintInput", &Handle::IsPropertyAConstraintInput)
1103 class_<Dali::Path, base<Dali::Handle>>("Path")
1104 .constructor<>(&Dali::Path::New)
1105 .function("addPoint", &Dali::Path::AddPoint)
1106 .function("addControlPoint", &Dali::Path::AddControlPoint)
1107 .function("generateControlPoints", &Dali::Path::GenerateControlPoints)
1108 .function("sample", &Dali::Path::Sample)
1109 .function("getPoint", &Dali::Path::GetPoint)
1110 .function("getControlPoint", &Dali::Path::GetControlPoint)
1111 .function("getPointCount", &Dali::Path::GetPointCount)
1114 class_<Dali::KeyFrames>("KeyFrames")
1115 .constructor<>(&Dali::KeyFrames::New)
1116 .function("add", select_overload<void (float progress, Property::Value value)>(&Dali::KeyFrames::Add))
1117 .function("addWithAlpha", &KeyFramesAddWithAlpha)
1120 class_<Dali::Animation>("Animation")
1121 .constructor<float>(&Dali::Animation::New)
1122 .function("__animateTo", &AnimateTo)
1123 .function("__animateBy", &AnimateBy)
1124 .function("__animateBetween", &AnimateBetween)
1125 .function("__animatePath", &AnimatePath)
1126 .function("setDuration", &Dali::Animation::SetDuration)
1127 .function("getDuration", &Dali::Animation::GetDuration)
1128 .function("setLooping", &Dali::Animation::SetLooping)
1129 .function("isLooping", &Dali::Animation::IsLooping)
1130 .function("setEndAction", &Dali::Animation::SetEndAction)
1131 .function("getEndAction", &Dali::Animation::GetEndAction)
1132 .function("setDisconnectAction", &Dali::Animation::SetDisconnectAction)
1133 .function("getDisconnectAction", &Dali::Animation::GetDisconnectAction)
1134 .function("setCurrentProgress", &Dali::Animation::SetCurrentProgress)
1135 .function("getCurrentProgress", &Dali::Animation::GetCurrentProgress)
1136 .function("setSpeedFactor", &Dali::Animation::SetSpeedFactor)
1137 .function("getSpeedFactor", &Dali::Animation::GetSpeedFactor)
1138 .function("setPlayRange", &Dali::Animation::SetPlayRange)
1139 .function("getPlayRange", &Dali::Animation::GetPlayRange)
1140 .function("play", &Dali::Animation::Play)
1141 .function("playFrom", &Dali::Animation::PlayFrom)
1142 .function("pause", &Dali::Animation::Pause)
1143 .function("stop", &Dali::Animation::Stop)
1144 .function("clear", &Dali::Animation::Clear)
1147 class_<Dali::PropertyBuffer>("PropertyBuffer")
1148 .constructor<Dali::Property::Map&>(Dali::PropertyBuffer::New)
1149 .function("setData", &SetPropertyBufferDataRaw)
1152 class_<Dali::Geometry>("Geometry")
1153 .constructor<>(&Dali::Geometry::New)
1154 .function("addVertexBuffer", &Dali::Geometry::AddVertexBuffer)
1155 .function("getNumberOfVertexBuffers", &Dali::Geometry::GetNumberOfVertexBuffers)
1156 .function("setIndexBuffer", &Dali::Geometry::SetIndexBuffer)
1157 .function("setGeometryType", &Dali::Geometry::SetGeometryType)
1158 .function("getGeometryType", &Dali::Geometry::GetGeometryType)
1159 .function("setRequiresDepthTesting", &Dali::Geometry::SetRequiresDepthTesting)
1160 .function("getRequiresDepthTesting", &Dali::Geometry::GetRequiresDepthTesting)
1163 class_<Dali::Image>("Image")
1166 class_<Dali::BufferImage, base<Dali::Image> >("BufferImage")
1167 .constructor<const std::string&, unsigned int, unsigned int, Dali::Pixel::Format>(&BufferImageNew)
1170 class_<Dali::EncodedBufferImage, base<Dali::Image> >("EncodedBufferImage")
1171 .constructor<const std::string&>(&EncodedBufferImageNew)
1174 class_<Dali::Sampler>("Sampler")
1175 .constructor<>(&Dali::Sampler::New)
1178 class_<Dali::Shader, base<Dali::Handle>>("Shader")
1179 .constructor<>(&Dali::Shader::New)
1182 class_<Dali::Material, base<Dali::Handle>>("Material")
1183 .constructor<>(&Dali::Material::New)
1184 .function("setShader", &Dali::Material::SetShader)
1185 .function("getShader", &Dali::Material::GetShader)
1186 .function("addTexture", &Dali::Material::AddTexture)
1187 .function("getNumberOfTextures", &Dali::Material::GetNumberOfTextures)
1188 .function("removeTexture", &Dali::Material::RemoveTexture)
1191 class_<Dali::Renderer, base<Dali::Handle>>("Renderer")
1192 .constructor<>(&Dali::Renderer::New)
1193 .function("setGeometry", &Dali::Renderer::SetGeometry)
1194 .function("getGeometry", &Dali::Renderer::GetGeometry)
1195 .function("setMaterial", &Dali::Renderer::SetMaterial)
1196 .function("getMaterial", &Dali::Renderer::GetMaterial)
1199 class_<Dali::ShaderEffect, base<Dali::Handle>>("ShaderEffect")
1200 .constructor<const std::string&, const std::string&,
1201 const std::string&, const std::string&,
1202 int >(&CreateShaderEffect)
1203 .function("setEffectImage", &Dali::ShaderEffect::SetEffectImage)
1204 .function("__setUniform", &SetUniform)
1207 class_<Dali::Actor, base<Dali::Handle>>("Actor")
1208 .constructor<>(&Dali::Actor::New)
1209 .function("add", &Dali::Actor::Add)
1210 .function("remove", &Dali::Actor::Remove)
1211 .function("getId", &Dali::Actor::GetId)
1212 .function("__getParent", &Dali::Actor::GetParent)
1213 .function("__findChildById", &Dali::Actor::FindChildById)
1214 .function("__findChildByName", &Dali::Actor::FindChildByName)
1215 .function("__getChildAt", &Dali::Actor::GetChildAt)
1216 .function("getChildCount", &Dali::Actor::GetChildCount)
1217 .function("__screenToLocal",
1218 select_overload<std::vector<float> (Dali::Actor, float, float)>(&ScreenToLocal))
1219 .function("addressOf", &AddressOf)
1220 .function("__connect", &ConnectSignal)
1221 .function("__setPropertyNotification", &SetPropertyNotification)
1222 .function("addRenderer", &Dali::Actor::AddRenderer)
1223 .function("getRendererCount", &Dali::Actor::GetRendererCount)
1224 .function("removeRenderer",
1225 select_overload<void(unsigned int)>(&Dali::Actor::RemoveRenderer))
1226 .function("__getRendererAt", &Dali::Actor::GetRendererAt)
1229 class_<Dali::CameraActor, base<Dali::Actor>>("CameraActor")
1230 .constructor<>( select_overload<Dali::CameraActor()>(&Dali::CameraActor::New))
1233 class_<Dali::Layer, base<Dali::Actor>>("Layer")
1234 .constructor<>(&Dali::Layer::New)
1235 .function("raise", &Dali::Layer::Raise)
1236 .function("lower", &Dali::Layer::Lower)
1239 class_<Dali::Stage>("Stage")
1240 .constructor<>(&Dali::Stage::GetCurrent)
1241 .function("add", &Dali::Stage::Add)
1242 .function("remove", &Dali::Stage::Remove)
1243 .function("__getRootLayer", &Dali::Stage::GetRootLayer)
1244 .function("getLayer", &Dali::Stage::GetLayer)
1245 .function("getRenderTaskList", &Dali::Stage::GetRenderTaskList)
1246 .function("setBackgroundColor", &Dali::Stage::SetBackgroundColor)
1249 class_<Dali::RenderTaskList>("RenderTaskList")
1250 .function("createTask", &Dali::RenderTaskList::CreateTask)
1251 .function("removeTask", &Dali::RenderTaskList::RemoveTask)
1252 .function("getTaskCount", &Dali::RenderTaskList::GetTaskCount)
1253 .function("getTask", &Dali::RenderTaskList::GetTask)
1256 class_<Dali::RenderTask>("RenderTask")
1257 .function("__getCameraActor", &Dali::RenderTask::GetCameraActor)
1258 .function("setCameraActor", &Dali::RenderTask::SetCameraActor)
1259 .function("setSourceActor", &Dali::RenderTask::SetSourceActor)
1260 .function("setExclusive", &Dali::RenderTask::SetExclusive)
1261 .function("setInputEnabled", &Dali::RenderTask::SetInputEnabled)
1262 .function("setViewportPosition", &Dali::RenderTask::SetViewportPosition)
1263 .function("setViewportSize", &Dali::RenderTask::SetViewportSize)
1264 .function("getCurrentViewportPosition", &Dali::RenderTask::GetCurrentViewportPosition)
1265 .function("getCurrentViewportSize", &Dali::RenderTask::GetCurrentViewportSize)
1266 .function("setClearColor", &Dali::RenderTask::SetClearColor)
1267 .function("getClearColor", &Dali::RenderTask::GetClearColor)
1268 .function("setClearEnabled", &Dali::RenderTask::SetClearEnabled)
1269 .function("getClearEnabled", &Dali::RenderTask::GetClearEnabled)
1270 .function("screenToLocal",
1271 select_overload<Dali::Vector2(Dali::RenderTask, Dali::Actor, float, float)>(&ScreenToLocal))
1272 .function("worldToScreen", &WorldToScreen)
1277 }; // namespace Emscripten
1278 }; // namespace Internal
1279 }; // namespace Dali