1 #ifndef __DALI_ACTOR_WRAPPER_H__
2 #define __DALI_ACTOR_WRAPPER_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/dali-core.h>
23 #include "emscripten/emscripten.h"
24 #include "emscripten/val.h"
27 #include "signal-holder.h"
37 * Exposes a representation of the actor base object pointer for javascript debugging
39 * @param[in] self The dali actor
41 * @return the address as an int
43 unsigned int AddressOf(Dali::Actor self);
46 * Provides screen to local values conveniently for javascript
48 * @param[in] self The dali actor
49 * @param[in] screenX The screen X coordinate
50 * @param[in] screenY The screen Y coordinate
52 * @return the local coordinates
54 std::vector<float> ScreenToLocal(Dali::Actor self, float screenX, float screenY);
57 * Connect a javascript function to a dali signal.
59 * Handles touched and hovered specially to provide more context than Dali provides.
61 * @param[in] actor The dali actor
62 * @param[in] signalHolder The Dali signal holder
63 * @param[in] signalName The name of the signal
64 * @param[in] javascriptFunction The function to call back when the signal is triggered
66 * @return the local coordinates
69 bool ConnectSignal( Dali::Actor actor,
70 SignalHolder& signalHolder,
71 const std::string& signalName,
72 const emscripten::val& javascriptFunction );
75 * Sets a javascript function to an actor property notification
77 * @param[in] self The dali actor
78 * @param[in] signalHolder The Dali signal holder
79 * @param[in] index The property Index
80 * @param[in] propertyConditionType The condition type name
81 * @param[in] arg0 The property notification arg0
82 * @param[in] arg1 The property notification arg1
83 * @param[in] propertyConditionType The condition type name
84 * @param[in] javascriptFunction The function to call back when the signal is triggered
86 * @return the local coordinates
89 void SetPropertyNotification( Dali::Actor self,
90 SignalHolder& signalHolder,
91 Dali::Property::Index index, const std::string& propertyConditionType, float arg0, float arg1,
92 const emscripten::val& javascriptFunction);
95 }; // namespace Emscripten
96 }; // namespace Internal