cupertino-files / DrawableStyleHandle
Class: DrawableStyleHandle
Defined in: src/tsd/drawables.ts:333
A live view of one drawable's visual style.
Constructors
Constructor
new DrawableStyleHandle(
store,object,ownedBy?):DrawableStyleHandle
Defined in: src/tsd/drawables.ts:344
Parameters
store
object
ownedBy?
container
drawable
field
number
Returns
DrawableStyleHandle
Properties
store
readonlystore:ObjectStore
Defined in: src/tsd/drawables.ts:334
Accessors
id
Get Signature
get id():
bigint
Defined in: src/tsd/drawables.ts:358
Returns
bigint
isMedia
Get Signature
get isMedia():
boolean
Defined in: src/tsd/drawables.ts:371
True for images and movies, whose property bag omits fill and so numbers every later field one lower.
Decided by declared type where known, and structurally otherwise: field 2 is a stroke message in a shape bag but the float opacity in a media bag, so its wire type settles the question for wrapper types the registry does not name.
Returns
boolean
object
Get Signature
get object():
IwaObject
Defined in: src/tsd/drawables.ts:354
Returns
Methods
read()
read():
DrawableStyle
Defined in: src/tsd/drawables.ts:389
Everything this style sets, in one object.
Returns
set()
set(
style):this
Defined in: src/tsd/drawables.ts:431
Merge visual properties into this style.
null removes a property outright; omitting it leaves whatever was there. Note that a shadow with enabled: false is how the apps store "shadow configured but switched off" — removing the archive and disabling it are different states, and both are expressible.
Copies on write: a style archive is routinely shared — the theme lists one, templates hand one to every drawable using them, and a deep copy shares its source's — so writing through a shared archive would restyle every drawable holding it. When the handle knows its drawable and the archive has other referrers, the write goes to a private clone with the drawable's reference repointed, which is the app's own behaviour: styling one object never edits the shared style. A handle from drawableStylesOf has no owning drawable and edits the archive in place.
Parameters
style
Returns
this
setShadowEnabled()
setShadowEnabled(
enabled):this
Defined in: src/tsd/drawables.ts:490
Turn a shadow on or off without discarding its parameters.
Parameters
enabled
boolean
Returns
this
shadow()
shadow():
Shadow|undefined
Defined in: src/tsd/drawables.ts:409
Returns
Shadow | undefined