Class
GSBaseObject
The abstract base class for objects positioned on a layer.
Declaration
class GSBaseObjectDeclaration
@interface GSBaseObject : NSObjectDeclaration
class GSBaseObject(NSObject)Overview
GSBaseObject provides common ownership, geometry, metadata, change notification, and encoding behavior. Not every inherited operation has the same significance for every subclass; consult the concrete type for its specific contract.
A base object has a weak parent, meaning the object that directly contains it. Its layer and glyph are resolved through this ownership hierarchy and can be nil when the object is detached. Attach and detach objects through the collection APIs of their container to keep both sides of the relationship consistent.
Regular editing APIs can register undo and propagate changes through the parent hierarchy, while fast APIs omit that coordination for callers that manage it separately.
Topics
Owners
The object that directly contains the receiver, or
nilwhen the receiver is detached.The layer containing the receiver, or
nilwhen the receiver is detached from a layer.The glyph containing the receiver, or
nilwhen the receiver is detached from a glyph.
Position
The position in layer coordinates.
The position in layer coordinates for a layer width.
Sets the position in layer coordinates for a layer width.
The position without orientation adjustment.
Sets the position without registering undo or notifying the parent.
Sets the unrounded position and rounds the position to a grid without registering undo or notifying the parent.
The unrounded position in layer coordinates.
The unrounded position in layer coordinates for a layer width.
The unrounded position without orientation adjustment.
Rounds the position to a grid.
Rounds the position to a grid without registering undo or notifying the parent.
The orientation of the element position.
Bounds
The geometric bounds of the object.
The geometric bounds of the object after applying a transform.
The geometric bounds of the object after applying a transform.
The overestimated bounds of the object.
The overestimated bounds of the object after applying a transform.
Attributes
Additional values associated with the object.
The number of attributes.
The value for an attribute key, or
nilif no value is set.Sets or removes an attribute.
Replaces all attributes using values encoded for a file format version.
Replaces all attributes without registering undo or notifying the parent.
Removes an attribute.
Edit Locking
Whether editing operations should leave the object unchanged.
Temporary Data
Values associated with the object for transient use.
The number of temporary values.
The temporary value for a key, or
nilif no value is set.Sets or removes a temporary value.
Change Tracking
Notifies the parent that an element changed.
The undo manager provided by the parent, or
nilwhen none is available.The undo manager provided by the parent when undo registration is enabled, or
nilotherwise.
Encoding
A property-list representation in a Glyphs source format, or
nilwhen the object cannot be encoded.Writes a Glyphs source representation to a file.
Thread Synchronization
Prepares the object for synchronized access.
Relationships
Inherits From
NSObject
Inherited By
Conforms To
NSCopying- GSSelectableElementProtocol
- GSUserDataProtocol
ObjectiveC.NSObjectProtocolSwift.CVarArgSwift.CustomDebugStringConvertibleSwift.CustomStringConvertibleSwift.EquatableSwift.Hashable
Relationships
Inherits From
NSObject