cupertino-files / DrawableContainer
Class: DrawableContainer
Defined in: src/tsd/placement.ts:43
A list of drawables belonging to one page, slide or sheet.
zOrderField is separate where the app keeps one: Keynote records ownership and paint order independently, and a drawable added to only the first is owned but never drawn.
Constructors
Constructor
new DrawableContainer(
store,owner,listField,zOrderField?,host?,entryReferenceField?,onAttach?):DrawableContainer
Defined in: src/tsd/placement.ts:80
Parameters
store
owner
listField
number
zOrderField?
number
host?
entryReferenceField?
number
onAttach?
(id) => void
Returns
DrawableContainer
Properties
owner
readonlyowner:IwaObject
Defined in: src/tsd/placement.ts:46
The slide, sheet or section that owns the list.
store
readonlystore:ObjectStore
Defined in: src/tsd/placement.ts:44
Methods
addCopyOf()
addCopyOf(
source,placement?):DrawableModel
Defined in: src/tsd/placement.ts:144
Copy a drawable into this container.
The copy is deep, so the two drawables are independent — a shallow one would leave both sharing a text storage or an image reference, and editing either would change the other. Styles, stylesheets and themes are shared rather than copied, so the copy still looks like the document it lives in.
Parameters
source
placement?
DrawablePlacement = {}
Returns
attach()
attach(
id):void
Defined in: src/tsd/placement.ts:159
Put an existing object into this container without copying it.
Parameters
id
bigint
Returns
void
bringToFront()
bringToFront(
id):void
Defined in: src/tsd/placement.ts:218
Send to the back / bring to the front of the paint order.
Parameters
id
bigint
Returns
void
drawables()
drawables():
DrawableModel[]
Defined in: src/tsd/placement.ts:128
Returns
ids()
ids():
bigint[]
Defined in: src/tsd/placement.ts:121
Object ids in the container, in the order the app stores them.
Returns
bigint[]
moveInZOrder()
moveInZOrder(
id,to):void
Defined in: src/tsd/placement.ts:205
Move a drawable within the paint order; higher index paints later.
Parameters
id
bigint
to
number
Returns
void
remove()
remove(
id):boolean
Defined in: src/tsd/placement.ts:178
Take a drawable out of the container.
The object itself is left in the package: something else may still reference it, and this library never garbage-collects the graph.
Parameters
id
bigint
Returns
boolean
sendToBack()
sendToBack(
id):void
Defined in: src/tsd/placement.ts:222
Parameters
id
bigint
Returns
void
zOrder()
zOrder():
bigint[]
Defined in: src/tsd/placement.ts:196
Paint order, where the container keeps one separately.
Returns
bigint[]