NumerableIconProtocol

public protocol NumerableIconProtocol : EmblemedIconProtocol

GtkNumerableIcon is a subclass of GEmblemedIcon that can show a number or short string as an emblem. The number can be overlayed on top of another emblem, if desired.

It supports theming by taking font and color information from a provided GtkStyleContext; see gtk_numerable_icon_set_style_context().

Typical numerable icons:

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

  • ptr

    Untyped pointer to the underlying GtkNumerableIcon instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkNumerableIcon instance.

    Default Implementation

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

    Declaration

    Swift

    var numerable_icon_ptr: UnsafeMutablePointer<GtkNumerableIcon>! { get }
  • Required Initialiser for types conforming to NumerableIconProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

NumerableIcon Class

  • Bind a NumerableIconPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: NumerableIconPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a NumerableIcon property

    Declaration

    Swift

    @inlinable
    func get(property: NumerableIconPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a NumerableIcon property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: NumerableIconPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

NumerableIcon Class: NumerableIconProtocol extension (methods and fields)

  • getBackgroundIcon() Extension method

    Returns the GIcon that was set as the base background image, or nil if there’s none. The caller of this function does not own a reference to the returned GIcon.

    get_background_gicon is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getBackgroundIcon() -> GIO.IconRef!
  • getBackgroundIconName() Extension method

    Returns the icon name used as the base background image, or nil if there’s none.

    get_background_icon_name is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getBackgroundIconName() -> String!
  • getCount() Extension method

    Returns the value currently displayed by self.

    get_count is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getCount() -> Int
  • getLabel() Extension method

    Returns the currently displayed label of the icon, or nil.

    get_label is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getLabel() -> String!
  • getStyleContext() Extension method

    Returns the GtkStyleContext used by the icon for theming, or nil if there’s none.

    get_style_context is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getStyleContext() -> StyleContextRef!
  • setBackgroundIcon(icon:) Extension method

    Updates the icon to use icon as the base background image. If icon is nil, self will go back using style information or default theming for its background image.

    If this method is called and an icon name was already set as background for the icon, icon will be used, i.e. the last method called between gtk_numerable_icon_set_background_gicon() and gtk_numerable_icon_set_background_icon_name() has always priority.

    set_background_gicon is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setBackgroundIcon(icon: GIO.IconRef? = nil)
  • setBackgroundIcon(icon:) Extension method

    Updates the icon to use icon as the base background image. If icon is nil, self will go back using style information or default theming for its background image.

    If this method is called and an icon name was already set as background for the icon, icon will be used, i.e. the last method called between gtk_numerable_icon_set_background_gicon() and gtk_numerable_icon_set_background_icon_name() has always priority.

    set_background_gicon is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setBackgroundIcon<IconT>(icon: IconT?) where IconT : IconProtocol
  • setBackground(iconName:) Extension method

    Updates the icon to use the icon named icon_name from the current icon theme as the base background image. If icon_name is nil, self will go back using style information or default theming for its background image.

    If this method is called and a GIcon was already set as background for the icon, icon_name will be used, i.e. the last method called between gtk_numerable_icon_set_background_icon_name() and gtk_numerable_icon_set_background_gicon() has always priority.

    set_background_icon_name is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setBackground(iconName: UnsafePointer<gchar>? = nil)
  • set(count:) Extension method

    Sets the currently displayed value of self to count.

    The numeric value is always clamped to make it two digits, i.e. between -99 and 99. Setting a count of zero removes the emblem. If this method is called, and a label was already set on the icon, it will automatically be reset to nil before rendering the number, i.e. the last method called between gtk_numerable_icon_set_count() and gtk_numerable_icon_set_label() has always priority.

    set_count is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func set(count: Int)
  • set(label:) Extension method

    Sets the currently displayed value of self to the string in label. Setting an empty label removes the emblem.

    Note that this is meant for displaying short labels, such as roman numbers, or single letters. For roman numbers, consider using the Unicode characters U+2160 - U+217F. Strings longer than two characters will likely not be rendered very well.

    If this method is called, and a number was already set on the icon, it will automatically be reset to zero before rendering the label, i.e. the last method called between gtk_numerable_icon_set_label() and gtk_numerable_icon_set_count() has always priority.

    set_label is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func set(label: UnsafePointer<gchar>? = nil)
  • setStyleContext(style:) Extension method

    Updates the icon to fetch theme information from the given GtkStyleContext.

    set_style_context is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setStyleContext<StyleContextT>(style: StyleContextT) where StyleContextT : StyleContextProtocol
  • backgroundIcon Extension method

    Returns the GIcon that was set as the base background image, or nil if there’s none. The caller of this function does not own a reference to the returned GIcon.

    get_background_gicon is deprecated: This method is deprecated.

    Declaration

    Swift

    @inlinable
    var backgroundIcon: GIO.IconRef! { get nonmutating set }
  • backgroundIconName Extension method

    Returns the icon name used as the base background image, or nil if there’s none.

    get_background_icon_name is deprecated: This method is deprecated.

    Declaration

    Swift

    @inlinable
    var backgroundIconName: String! { get nonmutating set }
  • count Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var count: Int { get nonmutating set }
  • label Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var label: String! { get nonmutating set }
  • styleContext Extension method

    Returns the GtkStyleContext used by the icon for theming, or nil if there’s none.

    get_style_context is deprecated: This method is deprecated.

    Declaration

    Swift

    @inlinable
    var styleContext: StyleContextRef! { get nonmutating set }
  • parent Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var parent: GEmblemedIcon { get }