Krita Source Code Documentation
Loading...
Searching...
No Matches
ShapeBackgroundFetchPolicy Struct Reference

Public Types

typedef QSharedPointer< KoShapeBackgroundPointerType
 
typedef KoFlake::FillType Type
 

Static Public Member Functions

static QColor color (KoShape *shape)
 
static bool compareTo (PointerType p1, PointerType p2)
 
static PointerType getBackground (KoShape *shape)
 
static const QGradient * gradient (KoShape *shape)
 
static QTransform gradientTransform (KoShape *shape)
 
static const SvgMeshGradientmeshgradient (KoShape *shape)
 
static QTransform meshgradientTransform (KoShape *shape)
 
static Type type (KoShape *shape)
 

Detailed Description

Definition at line 27 of file KoShapeFillWrapper.cpp.

Member Typedef Documentation

◆ PointerType

◆ Type

Member Function Documentation

◆ color()

static QColor ShapeBackgroundFetchPolicy::color ( KoShape * shape)
inlinestatic

Definition at line 62 of file KoShapeFillWrapper.cpp.

62 {
63 QSharedPointer<KoColorBackground> colorBackground = qSharedPointerDynamicCast<KoColorBackground>(shape->background());
64 return colorBackground ? colorBackground->color() : QColor();
65 }
virtual QSharedPointer< KoShapeBackground > background() const
Definition KoShape.cpp:926

References KoShape::background().

◆ compareTo()

static bool ShapeBackgroundFetchPolicy::compareTo ( PointerType p1,
PointerType p2 )
inlinestatic

Definition at line 87 of file KoShapeFillWrapper.cpp.

87 {
88 return p1->compareTo(p2.data());
89 }
QPointF p2
QPointF p1

References p1, and p2.

◆ getBackground()

static PointerType ShapeBackgroundFetchPolicy::getBackground ( KoShape * shape)
inlinestatic

Definition at line 32 of file KoShapeFillWrapper.cpp.

32 {
33 return shape->background();
34 }

References KoShape::background().

◆ gradient()

static const QGradient * ShapeBackgroundFetchPolicy::gradient ( KoShape * shape)
inlinestatic

Definition at line 67 of file KoShapeFillWrapper.cpp.

67 {
68 QSharedPointer<KoGradientBackground> gradientBackground = qSharedPointerDynamicCast<KoGradientBackground>(shape->background());
69 return gradientBackground ? gradientBackground->gradient() : 0;
70 }

References KoShape::background().

◆ gradientTransform()

static QTransform ShapeBackgroundFetchPolicy::gradientTransform ( KoShape * shape)
inlinestatic

Definition at line 72 of file KoShapeFillWrapper.cpp.

72 {
73 QSharedPointer<KoGradientBackground> gradientBackground = qSharedPointerDynamicCast<KoGradientBackground>(shape->background());
74 return gradientBackground ? gradientBackground->transform() : QTransform();
75 }

References KoShape::background().

◆ meshgradient()

static const SvgMeshGradient * ShapeBackgroundFetchPolicy::meshgradient ( KoShape * shape)
inlinestatic

Definition at line 77 of file KoShapeFillWrapper.cpp.

77 {
78 QSharedPointer<KoMeshGradientBackground> meshgradientBackground = qSharedPointerDynamicCast<KoMeshGradientBackground>(shape->background());
79 return meshgradientBackground ? meshgradientBackground->gradient() : nullptr;
80 }

References KoShape::background().

◆ meshgradientTransform()

static QTransform ShapeBackgroundFetchPolicy::meshgradientTransform ( KoShape * shape)
inlinestatic

Definition at line 82 of file KoShapeFillWrapper.cpp.

82 {
83 QSharedPointer<KoMeshGradientBackground> meshgradientBackground = qSharedPointerDynamicCast<KoMeshGradientBackground>(shape->background());
84 return meshgradientBackground ? meshgradientBackground->transform() : QTransform();
85 }

References KoShape::background().

◆ type()

static Type ShapeBackgroundFetchPolicy::type ( KoShape * shape)
inlinestatic

Definition at line 35 of file KoShapeFillWrapper.cpp.

35 {
37 QSharedPointer<KoColorBackground> colorBackground = qSharedPointerDynamicCast<KoColorBackground>(background);
38 QSharedPointer<KoGradientBackground> gradientBackground = qSharedPointerDynamicCast<KoGradientBackground>(background);
39 QSharedPointer<KoPatternBackground> patternBackground = qSharedPointerDynamicCast<KoPatternBackground>(background);
40 QSharedPointer<KoMeshGradientBackground> meshgradientBackground = qSharedPointerDynamicCast<KoMeshGradientBackground>(background);
41
42
43 if(gradientBackground) {
44 return Type::Gradient;
45 }
46
47 if (patternBackground) {
48 return Type::Pattern;
49 }
50
51 if (colorBackground) {
52 return Type::Solid;
53 }
54
55 if (meshgradientBackground) {
56 return Type::MeshGradient;
57 }
58
59 return Type::None;
60 }

References KoShape::background().


The documentation for this struct was generated from the following file: