common Accessor: removed deprecated api. 88/289788/1
authorHermet Park <hermetpark@gmail.com>
Sat, 26 Nov 2022 09:47:55 +0000 (18:47 +0900)
committerMichal Szczecinski <mihashco89@gmail.com>
Tue, 14 Mar 2023 08:43:34 +0000 (09:43 +0100)
the old version of Accessor::access() is redundant,
we replaced it with set().

It's still under the beta, we can remove it immediately.
Note that we've planned to promote them official APIs in v0.9.

Newly changed, tagging beta again...w

Change-Id: I1afa8424c81daabe214f5dd704678aa35da610ba

inc/thorvg.h
src/lib/tvgAccessor.cpp

index 8bc7f1880273378feffe5bf5c121f86198e07329..1429839f65c6f6a951c140eaf2490397da1ef0e2 100644 (file)
@@ -1597,24 +1597,14 @@ public:
  * The Accessor helps you search specific nodes to read the property information, figure out the structure of the scene tree and its size.
  *
  * @warning We strongly warn you not to change the paints of a scene unless you really know the design-structure.
+ *
+ * @BETA_API
  */
 class TVG_EXPORT Accessor final
 {
 public:
     ~Accessor();
 
-    /**
-     * @brief Access the Picture scene tree nodes.
-     *
-     * @param[in] picture The picture node to traverse the internal scene-tree.
-     * @param[in] func The callback function calling for every paint nodes of the Picture.
-     *
-     * @return Return the given @p picture instance.
-     *
-     * @note The bitmap based picture might not have the scene-tree.
-     */
-    std::unique_ptr<Picture> access(std::unique_ptr<Picture> picture, bool(*func)(const Paint* paint)) noexcept;
-
     /**
      * @brief Set the access function for traversing the Picture scene tree nodes.
      *
@@ -1633,6 +1623,8 @@ public:
      * @brief Creates a new Accessor object.
      *
      * @return A new Accessor object.
+     *
+     * @BETA_API
      */
     static std::unique_ptr<Accessor> gen() noexcept;
 
index 971f2dd4c53b8e999c9a8f09e317d15d6a50eb6c..b69c7665ccbb1ded8de33e6f2befb40bf3ad277f 100644 (file)
@@ -45,26 +45,6 @@ static bool accessChildren(Iterator* it, IteratorAccessor& itrAccessor, function
 /* External Class Implementation                                        */
 /************************************************************************/
 
-unique_ptr<Picture> Accessor::access(unique_ptr<Picture> picture, bool(*func)(const Paint* paint)) noexcept
-{
-    auto p = picture.get();
-    if (!p || !func) return picture;
-
-    //Use the Preorder Tree-Search
-
-    //Root
-    if (!func(p)) return picture;
-
-    //Children
-    IteratorAccessor itrAccessor;
-    if (auto it = itrAccessor.iterator(p)) {
-        accessChildren(it, itrAccessor, func);
-        delete(it);
-    }
-    return picture;
-}
-
-
 unique_ptr<Picture> Accessor::set(unique_ptr<Picture> picture, function<bool(const Paint* paint)> func) noexcept
 {
     auto p = picture.get();