// INTERNAL INCLUDES
#include "control-devel-wrap.h"
-
+#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
+#include <string>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
using namespace Dali::Toolkit::DevelControl;
+namespace
+{
+typedef void (*SavedCallbackType)(int32_t, int32_t, uint32_t, float *val1, float *val2, float *val3);
+SavedCallbackType gSavedRootCallback = nullptr;
+
+Dali::Property::Value RootCallback(int32_t id, VectorAnimationRenderer::VectorProperty property, uint32_t frameNumber)
+{
+ float val1, val2, val3;
+ if(gSavedRootCallback != nullptr)
+ {
+ gSavedRootCallback(id, (int)property, frameNumber, &val1, &val2, &val3);
+ }
+
+ switch(property)
+ {
+ case VectorAnimationRenderer::VectorProperty::FILL_COLOR :
+ case VectorAnimationRenderer::VectorProperty::STROKE_COLOR :
+ return Dali::Vector3(val1, val2, val3);
+ break;
+
+ case VectorAnimationRenderer::VectorProperty::TRANSFORM_ANCHOR :
+ case VectorAnimationRenderer::VectorProperty::TRANSFORM_POSITION :
+ case VectorAnimationRenderer::VectorProperty::TRANSFORM_SCALE :
+ return Dali::Vector2(val1, val2);
+ break;
+
+ case VectorAnimationRenderer::VectorProperty::FILL_OPACITY :
+ case VectorAnimationRenderer::VectorProperty::STROKE_OPACITY :
+ case VectorAnimationRenderer::VectorProperty::STROKE_WIDTH :
+ case VectorAnimationRenderer::VectorProperty::TRANSFORM_ROTATION :
+ case VectorAnimationRenderer::VectorProperty::TRANSFORM_OPACITY :
+ return val1;
+ break;
+
+ default:
+ return 0;
+ break;
+ }
+}
+} //unnamed namespace
+
#ifdef __cplusplus
extern "C" {
#endif
}));
}
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_View_DoActionExtension(void * control, int visualIndex, int actionId, int callbackId, char* keyPath, int property, void * callback)
+{
+ DevelAnimatedVectorImageVisual::DynamicPropertyInfo info;
+ info.id = callbackId;
+ std::string path(keyPath);
+ info.keyPath = path;
+ info.property = property;
+ gSavedRootCallback = (void (*)(int32_t, int32_t, uint32_t, float *val1, float *val2, float *val3))callback;
+ info.callback = Dali::MakeCallback((Dali::Property::Value (*)(int32_t, int32_t, uint32_t))RootCallback);
+
+ try
+ {
+ DevelControl::DoActionExtension(*((Dali::Toolkit::Control *)control), (Dali::Property::Index)visualIndex, (Dali::Property::Index)actionId, Dali::Any(info));
+ } CALL_CATCH_EXCEPTION();
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
}
}
-Dali::Actor SwigDirector_ViewImpl::GetNextKeyboardFocusableActor(Dali::Actor currentFocusedActor, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) {
- Dali::Actor c_result ;
- void * jresult = 0 ;
- void * jcurrentFocusedActor ;
- int jdirection ;
- unsigned int jloopEnabled ;
- if (!swig_callbackGetNextKeyboardFocusableActor) {
+Dali::Actor SwigDirector_ViewImpl::GetNextKeyboardFocusableActor(Dali::Actor currentFocusedActor, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled)
+{
+ Dali::Actor c_result;
+ void* jresult = 0;
+
+ if(!swig_callbackGetNextKeyboardFocusableActor)
+ {
return Dali::Toolkit::Internal::Control::GetNextKeyboardFocusableActor(currentFocusedActor,direction,loopEnabled);
- } else {
- jcurrentFocusedActor = (void *)new Dali::Actor((const Dali::Actor &)currentFocusedActor);
- jdirection = (int)direction;
- jloopEnabled = loopEnabled;
- jresult = (void *) swig_callbackGetNextKeyboardFocusableActor(jcurrentFocusedActor, jdirection, jloopEnabled);
- if (!jresult) {
+ }
+ else
+ {
+ jresult = (void*)swig_callbackGetNextKeyboardFocusableActor((void*)(¤tFocusedActor), (int)direction, loopEnabled);
+
+ if(!jresult)
+ {
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type Dali::Actor", 0);
return c_result;
}
- c_result = *(Dali::Actor *)jresult;
+ c_result = *(Dali::Actor*)jresult;
}
return c_result;
}
-void SwigDirector_ViewImpl::OnKeyboardFocusChangeCommitted(Dali::Actor commitedFocusableActor) {
- void * jcommitedFocusableActor ;
-
- if (!swig_callbackOnKeyboardFocusChangeCommitted) {
+void SwigDirector_ViewImpl::OnKeyboardFocusChangeCommitted(Dali::Actor commitedFocusableActor)
+{
+ if(!swig_callbackOnKeyboardFocusChangeCommitted)
+ {
Dali::Toolkit::Internal::Control::OnKeyboardFocusChangeCommitted(commitedFocusableActor);
return;
- } else {
- jcommitedFocusableActor = (void *)new Dali::Actor((const Dali::Actor &)commitedFocusableActor);
- swig_callbackOnKeyboardFocusChangeCommitted(jcommitedFocusableActor);
+ }
+ else
+ {
+ swig_callbackOnKeyboardFocusChangeCommitted((void*)(&commitedFocusableActor));
}
}
return c_result;
}
-void SwigDirector_ItemFactory::ItemReleased(unsigned int itemId, Dali::Actor actor) {
- unsigned int jitemId ;
- void * jactor ;
-
- if (!swig_callbackItemReleased) {
- Dali::Toolkit::ItemFactory::ItemReleased(itemId,actor);
+void SwigDirector_ItemFactory::ItemReleased(unsigned int itemId, Dali::Actor actor)
+{
+ if(!swig_callbackItemReleased)
+ {
+ Dali::Toolkit::ItemFactory::ItemReleased(itemId, actor);
return;
- } else {
- jitemId = itemId;
- jactor = (void *)new Dali::Actor((const Dali::Actor &)actor);
- swig_callbackItemReleased(jitemId, jactor);
+ }
+ else
+ {
+ swig_callbackItemReleased(itemId, (void*)(&actor));
}
}
}
-Dali::Actor SwigDirector_CustomAlgorithmInterface::GetNextFocusableActor(Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocus::Direction direction, const std::string& deviceName) {
- Dali::Actor c_result ;
- void * jresult = 0 ;
- void * jcurrent ;
- void * jproposed ;
- int jdirection ;
+Dali::Actor SwigDirector_CustomAlgorithmInterface::GetNextFocusableActor(Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocus::Direction direction, const std::string& deviceName)
+{
+ Dali::Actor c_result;
+ void* jresult = 0;
- if (!swig_callbackGetNextFocusableActor) {
+ if(!swig_callbackGetNextFocusableActor)
+ {
throw Swig::DirectorPureVirtualException("Dali::Toolkit::DevelKeyboardFocusManager::CustomAlgorithmInterface::GetNextFocusableActor");
- } else {
- jcurrent = (void *)new Dali::Actor((const Dali::Actor &)current);
- jproposed = (void *)new Dali::Actor((const Dali::Actor &)proposed);
- jdirection = (int)direction;
- jresult = (void *) swig_callbackGetNextFocusableActor(jcurrent, jproposed, jdirection, deviceName.c_str());
- if (!jresult) {
- DALI_LOG_ERROR("[ERROR][%s line:%d] Unexpected null return for type Dali::Actor! Next focus will be NULL, please be cautious to handle the keyboard foucs! ", __FILE__, __LINE__);
+ }
+ else
+ {
+ jresult = (void*)swig_callbackGetNextFocusableActor((void*)(¤t), (void*)(&proposed), direction, deviceName.c_str());
+ if(!jresult)
+ {
+ DALI_LOG_ERROR("[ERROR][%s line:%d] Unexpected null return for type Dali::Actor! Next focus will be NULL, please be cautious to handle the keyboard foucs!", __FILE__, __LINE__);
return c_result;
}
- c_result = *(Dali::Actor *)jresult;
+ c_result = *(Dali::Actor*)jresult;
}
return c_result;
}