mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
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:
parent
e7a94f5314
commit
93734fe673
1 changed files with 5 additions and 16 deletions
21
inc/thorvg.h
21
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);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue