Haiku API Bindings
ShapeIterator
Not logged in

Documentation | InterfaceKit | ShapeIterator

SYNOPSIS

Perl

use HaikuR1::ShapeIterator;

my $iterator = HaikuR1::ShapeIterator->new();
$iterator->Iterate($shape);

Python

from HaikuR1.InterfaceKit import ShapeIterator

iterator = ShapeIterator
iterator->Iterate(shape)

DESCRIPTION

Exposes the BShapeIterator object.

For more information on ShapeIterator, see the Be Book class description, the Be Book overview, and the Haiku Book class description.

METHODS

Constructor

Creates a ShapeIterator.

Perl

HaikuR1::ShapeIterator->new();

Python

ShapeIterator()

Iterate

Iterates over the drawing operations that make up the given shape.

Perl

$shapeiterator->Iterate($shape);

Python

shapeiterator.Iterate(shape)

HOOKS

IterateArcTo

Will be called once for each ArcTo operation in the Shape.

Perl

$shapeiterator->IterateArcTo(
    rx => $rx,
    ry => $ry,
    angle => $angle,
    largeArc => $largeArc,
    counterClockWise => $counterClockWise,
    point => $point,
);

Python

shapeiterator.IterateArcTo(
    rx = rx,
    ry = ry,
    angle = angle,
    largeArc = largeArc,
    counterClockWise = counterClockWise,
    point = point,
)

IterateBezierTo

Will be called for BezierTo operations in the Shape. If there is a sequence of consecutive BezierTo operations, then this hook will be called once for the sequence, and not once for each individual operation.

Perl

$shapeiterator->IterateBezierTo($bezierPts);

Python

shapeiterator.IterateBezierTo(bezierPts)

IterateClose

Will be called for the Close operation in the Shape. (There should only be one such operation, and it should be the final operation.)

Perl

$shapeiterator->IterateClose();

Python

shapeiterator.IterateClose()

IterateLineTo

Will be called for each LineTo operation in the Shape. If there is a sequence of consecutive LineTo operations, then this hook will be called once for the sequence, and not once for each individual operation.

Perl

$shapeiterator->IterateLineTo($linePts);

Python

shapeiterator.IterateLineTo(linePts)

IterateMoveTo

Will be called for each MoveTo operation in the Shape.

Perl

$shapeiterator->IterateMoveTo($point);

Python

shapeiterator.IterateMoveTo(point)