From 93734fe673b77d76adc084a1cc37637fc38d8b47 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Wed, 26 Jul 2023 00:47:13 +0900 Subject: [PATCH] infra: allow access to pImpl from the tvg internals. Since pImpl is an ambiguous pointer, visibility is not practically effective. On the other hand, this allows the tvg engine to easily pass data among instances. --- inc/thorvg.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/inc/thorvg.h b/inc/thorvg.h index 50fa7dba..897296fa 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -57,9 +57,9 @@ #endif #define _TVG_DECLARE_PRIVATE(A) \ -protected: \ struct Impl; \ Impl* pImpl; \ +protected: \ A(const A&) = delete; \ const A& operator=(const A&) = delete; \ A() @@ -68,25 +68,14 @@ protected: \ A() = delete; \ ~A() = delete -#define _TVG_DECLARE_ACCESSOR() \ - friend Canvas; \ - friend Scene; \ - friend Shape; \ - friend Picture; \ - friend Accessor; \ - friend IteratorAccessor - +#define _TVG_DECLARE_ACCESSOR(A) \ + friend A namespace tvg { class RenderMethod; -class IteratorAccessor; -class Scene; -class Shape; -class Picture; -class Canvas; -class Accessor; +class Animation; /** * @defgroup ThorVG ThorVG @@ -465,7 +454,6 @@ public: */ uint32_t identifier() const noexcept; - _TVG_DECLARE_ACCESSOR(); _TVG_DECLARE_PRIVATE(Paint); }; @@ -1392,6 +1380,7 @@ public: */ static uint32_t identifier() noexcept; + _TVG_DECLARE_ACCESSOR(Animation); _TVG_DECLARE_PRIVATE(Picture); };