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.
This commit is contained in:
Hermet Park 2023-07-26 00:47:13 +09:00 committed by Hermet Park
parent e7a94f5314
commit 93734fe673

View file

@ -57,9 +57,9 @@
#endif #endif
#define _TVG_DECLARE_PRIVATE(A) \ #define _TVG_DECLARE_PRIVATE(A) \
protected: \
struct Impl; \ struct Impl; \
Impl* pImpl; \ Impl* pImpl; \
protected: \
A(const A&) = delete; \ A(const A&) = delete; \
const A& operator=(const A&) = delete; \ const A& operator=(const A&) = delete; \
A() A()
@ -68,25 +68,14 @@ protected: \
A() = delete; \ A() = delete; \
~A() = delete ~A() = delete
#define _TVG_DECLARE_ACCESSOR() \ #define _TVG_DECLARE_ACCESSOR(A) \
friend Canvas; \ friend A
friend Scene; \
friend Shape; \
friend Picture; \
friend Accessor; \
friend IteratorAccessor
namespace tvg namespace tvg
{ {
class RenderMethod; class RenderMethod;
class IteratorAccessor; class Animation;
class Scene;
class Shape;
class Picture;
class Canvas;
class Accessor;
/** /**
* @defgroup ThorVG ThorVG * @defgroup ThorVG ThorVG
@ -465,7 +454,6 @@ public:
*/ */
uint32_t identifier() const noexcept; uint32_t identifier() const noexcept;
_TVG_DECLARE_ACCESSOR();
_TVG_DECLARE_PRIVATE(Paint); _TVG_DECLARE_PRIVATE(Paint);
}; };
@ -1392,6 +1380,7 @@ public:
*/ */
static uint32_t identifier() noexcept; static uint32_t identifier() noexcept;
_TVG_DECLARE_ACCESSOR(Animation);
_TVG_DECLARE_PRIVATE(Picture); _TVG_DECLARE_PRIVATE(Picture);
}; };