[dali_2.1.36] Merge branch 'devel/master' 60/279960/1
authorAdam Bialogonski <adam.b@samsung.com>
Fri, 19 Aug 2022 10:09:06 +0000 (11:09 +0100)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 19 Aug 2022 10:09:07 +0000 (11:09 +0100)
Change-Id: I59617ac6d5d36af2777a4643385d333c25b1d14d

dali-csharp-binder/src/control-devel-wrap.cpp
dali-csharp-binder/src/dali-wrap.cpp
dali-csharp-binder/src/window-wrap.cpp
packaging/dali-csharp-binder.spec

index 174cd41..853ec89 100644 (file)
 
 // 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
@@ -488,6 +538,22 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Accessibility_Accessible_SetHighlightAct
   }));
 }
 
+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
index f18ce0c..43a46e5 100755 (executable)
@@ -2054,38 +2054,40 @@ void SwigDirector_ViewImpl::OnKeyInputFocusLost() {
   }
 }
 
-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*)(&currentFocusedActor), (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));
   }
 }
 
@@ -2299,17 +2301,16 @@ Dali::Actor SwigDirector_ItemFactory::NewItem(unsigned int itemId) {
   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));
   }
 }
 
@@ -2338,25 +2339,24 @@ SwigDirector_CustomAlgorithmInterface::~SwigDirector_CustomAlgorithmInterface()
 }
 
 
-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*)(&current), (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;
 }
index 72da3a2..292798d 100644 (file)
@@ -2658,7 +2658,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Window_GetLastKeyEvent(void* winHandle
     } CALL_CATCH_EXCEPTION(0);
   }
   jresult = (void *)result;
-  return result;
+  return jresult;
 }
 
 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Window_GetLastTouchEvent(void* winHandle)
@@ -2676,7 +2676,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Window_GetLastTouchEvent(void* winHand
     } CALL_CATCH_EXCEPTION(0);
   }
   jresult = (void *)result;
-  return result;
+  return jresult;
 }
 
 /* Moved signal binding */
index c80c184..e77179e 100644 (file)
@@ -21,7 +21,7 @@
 
 Name: dali2-csharp-binder
 Summary: The DALI Csharp Binder
-Version: 2.1.35
+Version: 2.1.36
 Release: 1
 Group: uifw/graphic
 License: Apache-2.0 and BSD-3-Clause and MIT