[dali_2.3.2] Merge branch 'devel/master' 68/302568/1
authorAdam Bialogonski <adam.b@samsung.com>
Fri, 8 Dec 2023 11:07:36 +0000 (11:07 +0000)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 8 Dec 2023 11:07:36 +0000 (11:07 +0000)
Change-Id: I33110b20b82b544493a638dc1bd13c542a399ba3

dali-csharp-binder/common/processor-controller.cpp
dali-csharp-binder/common/processor-controller.h
dali-csharp-binder/dali-scene3d/model-wrap.cpp
dali-csharp-binder/dali-scene3d/motion-data-wrap.cpp
dali-csharp-binder/dali-scene3d/scene-view-wrap.cpp
packaging/dali-csharp-binder.spec

index fa2222e..e1869d5 100644 (file)
 // EXTERNAL INCLUDES
 #include <dali/devel-api/common/stage-devel.h>
 #include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali/integration-api/debug.h>
+#include <dali/integration-api/trace.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+namespace
+{
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false);
+}
 
 ProcessorController::ProcessorController()
 : mHandler(nullptr),
   mPostHandler(nullptr),
+  mProcessRegistered(false),
   mKeepRenderingApplied(false),
   mProcessingEvents(false),
   mProcessEventsIdleRequested(false)
 {
-  {
-    try
-    {
-      Dali::Adaptor::Get().RegisterProcessor(*this);
-      Dali::Adaptor::Get().RegisterProcessor(*this, true);
-    }
-    CALL_CATCH_EXCEPTION();
-  }
 }
 
 ProcessorController::~ProcessorController()
@@ -48,8 +44,13 @@ ProcessorController::~ProcessorController()
   {
     try
     {
-      Dali::Adaptor::Get().UnregisterProcessor(*this);
-      Dali::Adaptor::Get().UnregisterProcessor(*this, true);
+      if(mProcessRegistered)
+      {
+        Dali::Adaptor::Get().UnregisterProcessor(*this);
+        Dali::Adaptor::Get().UnregisterProcessor(*this, true);
+
+        mProcessRegistered = false;
+      }
     }
     CALL_CATCH_EXCEPTION();
   }
@@ -67,13 +68,15 @@ void ProcessorController::Process(bool postProcessor)
 
     if(DALI_LIKELY(mHandler != nullptr))
     {
+      DALI_TRACE_SCOPE(gTraceFilter, "NUI_PROCESS");
       mHandler();
     }
   }
   else
   {
-    if(DALI_LIKELY(mPostHandler != nullptr))
+    if(mPostHandler != nullptr)
     {
+      DALI_TRACE_SCOPE(gTraceFilter, "NUI_POST_PROCESS");
       mPostHandler();
     }
     // Make awake events can be applied after PostProcess done.
@@ -106,6 +109,8 @@ void ProcessorController::RemovePostCallback(  ProcessorControllerProcessCallbac
 
 void ProcessorController::Awake()
 {
+  DALI_ASSERT_ALWAYS(mProcessRegistered && "ProcessorController should be initialized before call Awake");
+
   if(!mProcessingEvents && !mKeepRenderingApplied)
   {
     if(DALI_LIKELY(Dali::Stage::IsInstalled())) ///< Avoid worker thread calling.
@@ -126,6 +131,25 @@ void ProcessorController::Awake()
   }
 }
 
+void ProcessorController::RegisterProcess()
+{
+  if(!mProcessRegistered)
+  {
+    try
+    {
+      Dali::Adaptor::Get().RegisterProcessor(*this);
+      Dali::Adaptor::Get().RegisterProcessor(*this, true);
+
+      mProcessRegistered = true;
+    }
+    CALL_CATCH_EXCEPTION(); 
+  }
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 // ProcessorController Bindings
 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_ProcessorController() {
 
@@ -150,6 +174,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_ProcessorController(void * jarg1)
   }
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_ProcessorController_Initialize(void* jarg1)
+{
+  ProcessorController* processorController = (ProcessorController *) jarg1;
+
+  if( processorController )
+  {
+    processorController->RegisterProcess();
+  }
+}
+
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_ProcessorController_SetCallback( void* jarg1, ProcessorController::ProcessorControllerProcessCallback callback )
 {
   ProcessorController* processorController = (ProcessorController *) jarg1;
index e6569fc..9939e67 100644 (file)
@@ -38,7 +38,7 @@ public:
 
 public:
   /**
-   * @brief Constructor - creates a ProcessorController and registers it with dali-core.
+   * @brief Constructor - creates a ProcessorController.
    *
    */
   ProcessorController();
@@ -49,6 +49,11 @@ public:
   ~ProcessorController();
 
   /**
+   * @brief Register this processor into dali-core.
+   */
+  void RegisterProcess();
+
+  /**
    * @copydoc Dali::Integration::Processor::Process()
    */
   void Process(bool postProcessor) override;
@@ -89,6 +94,7 @@ private:
   ProcessorControllerProcessCallback mHandler;              ///< PreProcessHandler before Relayout
   ProcessorControllerProcessCallback mPostHandler;          ///< PostProcessHandler after Relayout
 
+  bool mProcessRegistered : 1;          ///< True if we call RegisterProcess. False otherwise.
   bool mKeepRenderingApplied : 1;       ///< True if we call Stage::KeepRendering(0.0f). It need to avoid duplicated keep rendering call
   bool mProcessingEvents : 1;           ///< True if we are running Process now.
   bool mProcessEventsIdleRequested : 1; ///< True if we call Adaptor::RequestProcessEventsOnIdle(). It need to avoid duplicated request call.
index 2f8a449..cfa56ea 100644 (file)
@@ -561,7 +561,7 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_LoadBvhAnimation_1(void* csModel,
   {
     try
     {
-      Dali::Scene3D::Loader::AnimationDefinition animationDefinition = Dali::Scene3D::Loader::LoadBvh(filename, "LoadedBvhAnimation", scale);
+      Dali::Scene3D::Loader::AnimationDefinition animationDefinition = Dali::Scene3D::Loader::LoadBvh(filename, "LoadedBvhAnimation", false, scale);
 
       if(csUseRootNodeTranslate && animationDefinition.GetPropertyCount() > 0u)
       {
@@ -634,7 +634,7 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_LoadBvhAnimation_2(void* csModel,
   {
     try
     {
-      Dali::Scene3D::Loader::AnimationDefinition animationDefinition = Dali::Scene3D::Loader::LoadBvhFromBuffer(rawBuffer, csBufferLength, "LoadedBvhAnimation", scale);
+      Dali::Scene3D::Loader::AnimationDefinition animationDefinition = Dali::Scene3D::Loader::LoadBvhFromBuffer(rawBuffer, csBufferLength, "LoadedBvhAnimation", false, scale);
 
       if(csUseRootNodeTranslate && animationDefinition.GetPropertyCount() > 0u)
       {
index 708e03e..50a9ff6 100644 (file)
@@ -302,7 +302,7 @@ SWIGEXPORT float SWIGSTDCALL CSharp_Dali_MotionData_GetDuration(void* csMotionDa
   return result;
 }
 
-SWIGEXPORT void SWIGSTDCALL CSharp_Dali_MotionData_LoadBvh(void* csMotionData, char* csFileName, void* csScale, bool csSynchronousLoad)
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_MotionData_LoadBvh(void* csMotionData, char* csFileName, bool csUseRootTranslationOnly, void* csScale, bool csSynchronousLoad)
 {
   Dali::Scene3D::MotionData* motionData = (Dali::Scene3D::MotionData*)csMotionData;
 
@@ -328,13 +328,13 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_MotionData_LoadBvh(void* csMotionData, c
   {
     try
     {
-      motionData->LoadBvh(filename, scale, csSynchronousLoad);
+      motionData->LoadBvh(filename, csUseRootTranslationOnly, scale, csSynchronousLoad);
     }
     CALL_CATCH_EXCEPTION();
   }
 }
 
-SWIGEXPORT void SWIGSTDCALL CSharp_Dali_MotionData_LoadBvhFromBuffer(void* csMotionData, char* csBuffer, int csBufferLength, void* csScale, bool csSynchronousLoad)
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_MotionData_LoadBvhFromBuffer(void* csMotionData, char* csBuffer, int csBufferLength, bool csUseRootTranslationOnly, void* csScale, bool csSynchronousLoad)
 {
   Dali::Scene3D::MotionData* motionData = (Dali::Scene3D::MotionData*)csMotionData;
 
@@ -360,7 +360,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_MotionData_LoadBvhFromBuffer(void* csMot
   {
     try
     {
-      motionData->LoadBvhFromBuffer(rawBuffer, csBufferLength, scale, csSynchronousLoad);
+      motionData->LoadBvhFromBuffer(rawBuffer, csBufferLength, csUseRootTranslationOnly, scale, csSynchronousLoad);
     }
     CALL_CATCH_EXCEPTION();
   }
index fd01ed8..1417ea8 100755 (executable)
@@ -391,6 +391,82 @@ extern "C"
     return result;
   }
 
+  SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_SetResolution(void *csSceneView, uint32_t width, uint32_t height)
+  {
+    Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView;
+
+    if (!sceneView)
+    {
+      SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0);
+      return;
+    }
+    {
+      try
+      {
+        sceneView->SetResolution(width, height);
+      }
+      CALL_CATCH_EXCEPTION();
+    }
+  }
+
+  SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_SceneView_GetResolutionWidth(void *csSceneView)
+  {
+    Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView;
+    uint32_t result = 0u;
+
+    if (!sceneView)
+    {
+      SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0);
+      return 0;
+    }
+    {
+      try
+      {
+        result = static_cast<uint32_t>(sceneView->GetResolutionWidth());
+      }
+      CALL_CATCH_EXCEPTION(0);
+    }
+    return result;
+  }
+
+  SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_SceneView_GetResolutionHeight(void *csSceneView)
+  {
+    Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView;
+    uint32_t result = 0u;
+
+    if (!sceneView)
+    {
+      SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0);
+      return 0;
+    }
+    {
+      try
+      {
+        result = static_cast<uint32_t>(sceneView->GetResolutionHeight());
+      }
+      CALL_CATCH_EXCEPTION(0);
+    }
+    return result;
+  }
+
+  SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_ResetResolution(void *csSceneView)
+  {
+    Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView;
+
+    if (!sceneView)
+    {
+      SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::SceneView", 0);
+      return;
+    }
+    {
+      try
+      {
+        sceneView->ResetResolution();
+      }
+      CALL_CATCH_EXCEPTION();
+    }
+  }
+
   SWIGEXPORT void SWIGSTDCALL CSharp_Dali_SceneView_SetFramebufferMultiSamplingLevel(void *csSceneView, uint32_t multiSamplingLevel)
   {
     Dali::Scene3D::SceneView *sceneView = (Dali::Scene3D::SceneView *)csSceneView;
@@ -557,6 +633,36 @@ extern "C"
     return result;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_SceneView_Property_AlphaMaskURL_get()
+  {
+    int jresult;
+    int result;
+
+    result = (int)Dali::Scene3D::SceneView::Property::ALPHA_MASK_URL;
+    jresult = (int)result;
+    return jresult;
+  }
+
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_SceneView_Property_MaskContentScale_get()
+  {
+    int jresult;
+    int result;
+
+    result = (int)Dali::Scene3D::SceneView::Property::MASK_CONTENT_SCALE;
+    jresult = (int)result;
+    return jresult;
+  }
+
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_SceneView_Property_CropToMask_get()
+  {
+    int jresult;
+    int result;
+
+    result = (int)Dali::Scene3D::SceneView::Property::CROP_TO_MASK;
+    jresult = (int)result;
+    return jresult;
+  }
+
 #ifdef __cplusplus
 }
 #endif
index d7dcfae..fbaf6e5 100644 (file)
@@ -21,7 +21,7 @@
 
 Name: dali2-csharp-binder
 Summary: The DALI Csharp Binder
-Version: 2.3.1
+Version: 2.3.2
 Release: 1
 Group: uifw/graphic
 License: Apache-2.0 and BSD-3-Clause and MIT