Support of creating BufferImage from pixel buffer in JavaScript
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / src / actors / actor-wrapper.h
index 76eee47..fd12185 100644 (file)
@@ -41,18 +41,16 @@ class ActorWrapper : public HandleWrapper
 public:
 
   /**
-   * Actor type used an index
+   * Actor type used an index.
+   * These enums are used to index the ActorApiLookup table in actor-wrapper.cpp.
+   * Any changes made must be reflected in the ActorApiLookup otherwise it may segfault when creating an actor
    */
   enum ActorType
   {
     UNKNOWN_ACTOR = -1,
-    ACTOR       = 0,
-    IMAGE_ACTOR  =1,
-    TEXT_ACTOR   =2,
-    MESH_ACTOR   =3,
-    LAYER_ACTOR  =4,
-    CAMERA_ACTOR =5,
-    TEXT_VIEW    =6
+    ACTOR        = 0,
+    LAYER_ACTOR  = 1,
+    CAMERA_ACTOR = 2
   };
 
   /**
@@ -72,12 +70,19 @@ public:
 
   /**
    * @brief Creates a new Actor wrapped inside a Javascript Object.
-   * @note: the actor type ie 'ImageActor' is expected to be the name of the callee function.
+   * @note: the actor type ie 'CameraActor' is expected to be the name of the callee function.
    * @param[in] args v8 function call arguments interpreted
    */
   static void NewActor( const v8::FunctionCallbackInfo< v8::Value >& args);
 
   /**
+   * @brief Creates a new Control wrapped inside a Javascript Object.
+   * @note: the control type is passed as a parameter e.g. 'TextField'
+   * @param[in] args v8 function call arguments interpreted
+   */
+  static void NewControl( const v8::FunctionCallbackInfo< v8::Value >& args);
+
+  /**
    * @brief Wraps an actor of a given type
    */
   static v8::Handle<v8::Object> WrapActor(v8::Isolate* isolate, Dali::Actor actor,ActorType actorType);
@@ -89,12 +94,8 @@ public:
 
   // The Actor ObjectTemplates.
   static v8::Persistent<v8::ObjectTemplate> mActorTemplate;
-  static v8::Persistent<v8::ObjectTemplate> mImageActorTemplate;
-  static v8::Persistent<v8::ObjectTemplate> mTextActorTemplate;
-  static v8::Persistent<v8::ObjectTemplate> mMeshActorTemplate;
   static v8::Persistent<v8::ObjectTemplate> mCameraActorTemplate;
   static v8::Persistent<v8::ObjectTemplate> mLayerActorTemplate;
-  static v8::Persistent<v8::ObjectTemplate> mTextViewTemplate;
 
   /**
    * @return the wrapped actor