BShape: use BShape::Private class to access private methods.

Avoid declaring random friend classes in public header. Allow to access
private methods from arbitrary source if needed.

Change-Id: Iac2cf0ca59e483aa0657e3fe1fc47080c661cf8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8534
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
X512
2024-11-11 16:56:19 +00:00
committed by waddlesplash
parent e892302909
commit 2b0aa4245b
6 changed files with 37 additions and 24 deletions
+3 -9
View File
@@ -87,6 +87,8 @@ public:
const BPoint& point);
status_t Close();
class Private;
private:
// FBC padding
virtual status_t Perform(perform_code code, void* data);
@@ -97,17 +99,9 @@ private:
virtual void _ReservedShape4();
private:
friend class Private;
friend class BShapeIterator;
friend class BView;
friend class BFont;
friend class BPrivate::PicturePlayer;
friend class BPrivate::ServerLink;
void GetData(int32* opCount, int32* ptCount,
uint32** opList, BPoint** ptList);
void SetData(int32 opCount, int32 ptCount,
const uint32* opList,
const BPoint* ptList);
void InitData();
bool AllocatePts(int32 count);
bool AllocateOps(int32 count);
+17
View File
@@ -9,6 +9,7 @@
#ifndef SHAPE_PRIVATE_H
#define SHAPE_PRIVATE_H
#include <Shape.h>
#include <Point.h>
#include <Rect.h>
#include <Referenceable.h>
@@ -97,4 +98,20 @@ public:
};
class BShape::Private {
public:
Private(BShape& shape) : fShape(shape) {}
void GetData(int32* opCount, int32* ptCount,
uint32** opList, BPoint** ptList);
void SetData(int32 opCount, int32 ptCount,
const uint32* opList,
const BPoint* ptList);
shape_data* PrivateData() {return (shape_data*)fShape.fPrivateData;}
private:
BShape& fShape;
};
#endif // SHAPE_PRIVATE_H