StateSetProtocol

public protocol StateSetProtocol : ObjectProtocol

An AtkStateSet is a read-only representation of the full set of AtkStates that apply to an object at a given time. This set is not meant to be modified, but rather created when atk_object_ref_state_set() is called.

The StateSetProtocol protocol exposes the methods and properties of an underlying AtkStateSet instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see StateSet. Alternatively, use StateSetRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying AtkStateSet instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • state_set_ptr Default implementation

    Typed pointer to the underlying AtkStateSet instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the AtkStateSet instance.

    Declaration

    Swift

    var state_set_ptr: UnsafeMutablePointer<AtkStateSet>! { get }
  • Required Initialiser for types conforming to StateSetProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

StateSet Class: StateSetProtocol extension (methods and fields)

  • addState(type:) Extension method

    Adds the state of the specified type to the state set if it is not already present.

    Note that because an AtkStateSet is a read-only object, this method should be used to add a state to a newly-created set which will then be returned by atk_object_ref_state_set. It should not be used to modify the existing state of an object. See also atk_object_notify_state_change.

    Declaration

    Swift

    @inlinable
    func addState(type: AtkStateType) -> Bool
  • addStates(types:nTypes:) Extension method

    Adds the states of the specified types to the state set.

    Note that because an AtkStateSet is a read-only object, this method should be used to add states to a newly-created set which will then be returned by atk_object_ref_state_set. It should not be used to modify the existing state of an object. See also atk_object_notify_state_change.

    Declaration

    Swift

    @inlinable
    func addStates(types: UnsafeMutablePointer<AtkStateType>!, nTypes: Int)
  • andSets(compareSet:) Extension method

    Constructs the intersection of the two sets, returning nil if the intersection is empty.

    Declaration

    Swift

    @inlinable
    func andSets<StateSetT>(compareSet: StateSetT) -> Atk.StateSetRef! where StateSetT : StateSetProtocol
  • clearStates() Extension method

    Removes all states from the state set.

    Declaration

    Swift

    @inlinable
    func clearStates()
  • containsState(type:) Extension method

    Checks whether the state for the specified type is in the specified set.

    Declaration

    Swift

    @inlinable
    func containsState(type: AtkStateType) -> Bool
  • Checks whether the states for all the specified types are in the specified set.

    Declaration

    Swift

    @inlinable
    func containsStates(types: UnsafeMutablePointer<AtkStateType>!, nTypes: Int) -> Bool
  • orSets(compareSet:) Extension method

    Constructs the union of the two sets.

    Declaration

    Swift

    @inlinable
    func orSets<StateSetT>(compareSet: StateSetT) -> Atk.StateSetRef! where StateSetT : StateSetProtocol
  • removeState(type:) Extension method

    Removes the state for the specified type from the state set.

    Note that because an AtkStateSet is a read-only object, this method should be used to remove a state to a newly-created set which will then be returned by atk_object_ref_state_set. It should not be used to modify the existing state of an object. See also atk_object_notify_state_change.

    Declaration

    Swift

    @inlinable
    func removeState(type: AtkStateType) -> Bool
  • xorSets(compareSet:) Extension method

    Constructs the exclusive-or of the two sets, returning nil is empty. The set returned by this operation contains the states in exactly one of the two sets.

    Declaration

    Swift

    @inlinable
    func xorSets<StateSetT>(compareSet: StateSetT) -> Atk.StateSetRef! where StateSetT : StateSetProtocol
  • isEmpty Extension method

    Checks whether the state set is empty, i.e. has no states set.

    Declaration

    Swift

    @inlinable
    var isEmpty: Bool { get }
  • parent Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var parent: GObject { get }