StylePropertiesProtocol

public protocol StylePropertiesProtocol : ObjectProtocol, StyleProviderProtocol

GtkStyleProperties provides the storage for style information that is used by GtkStyleContext and other GtkStyleProvider implementations.

Before style properties can be stored in GtkStyleProperties, they must be registered with gtk_style_properties_register_property().

Unless you are writing a GtkStyleProvider implementation, you are unlikely to use this API directly, as gtk_style_context_get() and its variants are the preferred way to access styling information from widget implementations and theming engine implementations should use the APIs provided by GtkThemingEngine instead.

GtkStyleProperties has been deprecated in GTK 3.16. The CSS machinery does not use it anymore and all users of this object have been deprecated.

The StylePropertiesProtocol protocol exposes the methods and properties of an underlying GtkStyleProperties 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 StyleProperties. Alternatively, use StylePropertiesRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkStyleProperties instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkStyleProperties instance.

    Default Implementation

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

    Declaration

    Swift

    var style_properties_ptr: UnsafeMutablePointer<GtkStyleProperties>! { get }
  • Required Initialiser for types conforming to StylePropertiesProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

StyleProperties Class: StylePropertiesProtocol extension (methods and fields)

  • clear() Extension method

    Clears all style information from props.

    clear is deprecated:

    GtkStyleProperties are deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func clear()
  • get(property:state:value:) Extension method

    Gets a style property from props for the given state. When done with value, g_value_unset() needs to be called to free any allocated memory.

    get_property is deprecated:

    GtkStyleProperties are deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func get<ValueT>(property: UnsafePointer<gchar>!, state: StateFlags, value: ValueT) -> Bool where ValueT : ValueProtocol
  • getValist(state:args:) Extension method

    Retrieves several style property values from props for a given state.

    get_valist is deprecated:

    GtkStyleProperties are deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getValist(state: StateFlags, args: CVaListPointer)
  • lookupColor(name:) Extension method

    Returns the symbolic color that is mapped to name.

    lookup_color is deprecated:

    GtkSymbolicColor is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func lookupColor(name: UnsafePointer<gchar>!) -> SymbolicColorRef!
  • mapColor(name:color:) Extension method

    Maps color so it can be referenced by name. See gtk_style_properties_lookup_color()

    map_color is deprecated:

    GtkSymbolicColor is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func mapColor<SymbolicColorT>(name: UnsafePointer<gchar>!, color: SymbolicColorT) where SymbolicColorT : SymbolicColorProtocol
  • merge(propsToMerge:replace:) Extension method

    Merges into props all the style information contained in props_to_merge. If replace is true, the values will be overwritten, if it is false, the older values will prevail.

    merge is deprecated:

    GtkStyleProperties are deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func merge<StylePropertiesT>(propsToMerge: StylePropertiesT, replace: Bool) where StylePropertiesT : StylePropertiesProtocol
  • set(property:state:value:) Extension method

    Sets a styling property in props.

    set_property is deprecated:

    GtkStyleProperties are deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func set<ValueT>(property: UnsafePointer<gchar>!, state: StateFlags, value: ValueT) where ValueT : ValueProtocol
  • setValist(state:args:) Extension method

    Sets several style properties on props.

    set_valist is deprecated:

    GtkStyleProperties are deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setValist(state: StateFlags, args: CVaListPointer)
  • unset(property:state:) Extension method

    Unsets a style property in props.

    unset_property is deprecated:

    GtkStyleProperties are deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func unset(property: UnsafePointer<gchar>!, state: StateFlags)