Bind GetPropertyObject for VisualObject 99/319799/6
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 1 Nov 2024 09:47:49 +0000 (18:47 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Wed, 13 Nov 2024 01:26:34 +0000 (01:26 +0000)
Change-Id: Ib818a04bcbf5deac951fd8bd047547a7ea642c12
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-csharp-binder/common/visual-objects/visual-object-impl.cpp
dali-csharp-binder/common/visual-objects/visual-object-impl.h
dali-csharp-binder/common/visual-objects/visual-object.cpp
dali-csharp-binder/common/visual-objects/visual-object.h

index 8f54d61cc9850d82443d43c9683c11a8ce1ec996..7cd347b3f28c76e9df9772a78e3388e8fa8763ca 100644 (file)
@@ -194,6 +194,17 @@ void VisualObject::LowerBelow(Dali::Internal::VisualObject& target)
   }
 }
 
+Dali::Property VisualObject::GetPropertyObject(Dali::Property::Key visualPropertyKey)
+{
+  if(mVisual)
+  {
+    return mVisual.GetPropertyObject(std::move(visualPropertyKey));
+  }
+
+  Handle handle;
+  return Dali::Property(handle, Property::INVALID_INDEX);
+}
+
 // Private and internal
 
 void VisualObject::AttachToContainerInternal(Dali::VisualObjectsContainer container)
index 954cdb1ec399c310aeba19effe7198b3172d0340..ac14d708e394e4c7a20512f467dc9ac13824186f 100644 (file)
@@ -120,6 +120,11 @@ public: ///< Public API
    */
   void LowerBelow(Dali::Internal::VisualObject& target);
 
+  /**
+   * @copydoc Dali::VisualObject::GetPropertyObject()
+   */
+  Dali::Property GetPropertyObject(Dali::Property::Key visualPropertyKey);
+
 public: ///< Called from Internal::VisualObjectsContainer
   /**
    * @brief Set the container who contain this visual object.
index 60d3c9c66eaa361732cb514d3e38ba8fc7270a5d..56b2a2fdfea98167702cd76b98ab46c273190f94 100644 (file)
@@ -108,6 +108,11 @@ void VisualObject::LowerBelow(Dali::VisualObject target)
   GetImplementation(*this).LowerBelow(GetImplementation(target));
 }
 
+Dali::Property VisualObject::GetPropertyObject(Dali::Property::Key visualPropertyKey)
+{
+  return GetImplementation(*this).GetPropertyObject(std::move(visualPropertyKey));
+}
+
 } // namespace Dali
 
 #ifdef __cplusplus
@@ -352,6 +357,22 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_VisualObject_LowerBelow(void* nuiVisualO
   }));
 }
 
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_VisualObject_GetPropertyObject(void* nuiVisualObject, int visualPropertyIndex)
+{
+  Dali::VisualObject* visualObject = (Dali::VisualObject*)0;
+
+  GUARD_ON_NULL_RET0(nuiVisualObject);
+  visualObject = (Dali::VisualObject*)nuiVisualObject;
+
+  void* result = 0;
+  try_catch(([&]() {
+    Dali::Property property = visualObject->GetPropertyObject((Dali::Property::Index)visualPropertyIndex);
+    result = new Dali::Property(property.object, property.propertyIndex, property.componentIndex);
+  }));
+
+  return result;
+}
+
 #ifdef __cplusplus
 }
 #endif
\ No newline at end of file
index a06c98d6facc3a870ddd3f58c96090e1b0a59c64..32ac1cbfeff810069d79a268f19fb7b3be2a1bac 100644 (file)
@@ -207,6 +207,17 @@ public: ///< Public API
    */
   void LowerBelow(VisualObject target);
 
+  /**
+   * @brief Retrieve the property object associated with the given visual property key.
+   * It will return invalid property if visual object is not be attached to any control.
+   * @note Returned Property will be invalidated after we call CreateVisual method.
+   *
+   * @SINCE_2_3.50
+   * @param[in] visualPropertyKey The key of the visual's property.
+   * @return The Property object
+   */
+  Dali::Property GetPropertyObject(Dali::Property::Key visualPropertyKey);
+
 public:
   VisualObject()                           = default;
   ~VisualObject()                          = default;