IconInfoProtocol

public protocol IconInfoProtocol : ObjectProtocol

Contains information found when looking up an icon in an icon theme.

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

  • ptr

    Untyped pointer to the underlying GtkIconInfo instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkIconInfo instance.

    Default Implementation

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

    Declaration

    Swift

    var icon_info_ptr: UnsafeMutablePointer<GtkIconInfo>! { get }
  • Required Initialiser for types conforming to IconInfoProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

IconInfo Class: IconInfoProtocol extension (methods and fields)

  • copy() Extension method

    Make a copy of a GtkIconInfo.

    copy is deprecated: Use g_object_ref()

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func copy() -> IconInfoRef!
  • free() Extension method

    Free a GtkIconInfo and associated information

    free is deprecated: Use g_object_unref()

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func free()
  • getAttach(points:nPoints:) Extension method

    This function is deprecated and always returns false.

    get_attach_points is deprecated: Attachment points are deprecated

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getAttach(points: UnsafeMutablePointer<UnsafeMutablePointer<GdkPoint>?>! = nil, nPoints: UnsafeMutablePointer<gint>! = nil) -> Bool
  • getBaseScale() Extension method

    Gets the base scale for the icon. The base scale is a scale for the icon that was specified by the icon theme creator. For instance an icon drawn for a high-dpi screen with window scale 2 for a base size of 32 will be 64 pixels tall and have a base scale of 2.

    Declaration

    Swift

    @inlinable
    func getBaseScale() -> Int
  • getBaseSize() Extension method

    Gets the base size for the icon. The base size is a size for the icon that was specified by the icon theme creator. This may be different than the actual size of image; an example of this is small emblem icons that can be attached to a larger icon. These icons will be given the same base size as the larger icons to which they are attached.

    Note that for scaled icons the base size does not include the base scale.

    Declaration

    Swift

    @inlinable
    func getBaseSize() -> Int
  • getBuiltinPixbuf() Extension method

    Gets the built-in image for this icon, if any. To allow GTK+ to use built in icon images, you must pass the GTK_ICON_LOOKUP_USE_BUILTIN to gtk_icon_theme_lookup_icon().

    get_builtin_pixbuf is deprecated: This function is deprecated, use gtk_icon_theme_add_resource_path() instead of builtin icons.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getBuiltinPixbuf() -> PixbufRef!
  • getDisplayName() Extension method

    This function is deprecated and always returns nil.

    get_display_name is deprecated: Display names are deprecated

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getDisplayName() -> String!
  • getEmbeddedRect(rectangle:) Extension method

    This function is deprecated and always returns false.

    get_embedded_rect is deprecated: Embedded rectangles are deprecated

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getEmbeddedRect<RectangleT>(rectangle: RectangleT) -> Bool where RectangleT : RectangleProtocol
  • getFilename() Extension method

    Gets the filename for the icon. If the GTK_ICON_LOOKUP_USE_BUILTIN flag was passed to gtk_icon_theme_lookup_icon(), there may be no filename if a builtin icon is returned; in this case, you should use gtk_icon_info_get_builtin_pixbuf().

    Declaration

    Swift

    @inlinable
    func getFilename() -> String!
  • loadIcon() Extension method

    Renders an icon previously looked up in an icon theme using gtk_icon_theme_lookup_icon(); the size will be based on the size passed to gtk_icon_theme_lookup_icon(). Note that the resulting pixbuf may not be exactly this size; an icon theme may have icons that differ slightly from their nominal sizes, and in addition GTK+ will avoid scaling icons that it considers sufficiently close to the requested size or for which the source image would have to be scaled up too far. (This maintains sharpness.). This behaviour can be changed by passing the GTK_ICON_LOOKUP_FORCE_SIZE flag when obtaining the GtkIconInfo. If this flag has been specified, the pixbuf returned by this function will be scaled to the exact size.

    Declaration

    Swift

    @inlinable
    func loadIcon() throws -> PixbufRef!
  • Asynchronously load, render and scale an icon previously looked up from the icon theme using gtk_icon_theme_lookup_icon().

    For more details, see gtk_icon_info_load_icon() which is the synchronous version of this call.

    Declaration

    Swift

    @inlinable
    func loadIconAsync(cancellable: GIO.CancellableRef? = nil, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil)
  • Asynchronously load, render and scale an icon previously looked up from the icon theme using gtk_icon_theme_lookup_icon().

    For more details, see gtk_icon_info_load_icon() which is the synchronous version of this call.

    Declaration

    Swift

    @inlinable
    func loadIconAsync<CancellableT>(cancellable: CancellableT?, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil) where CancellableT : CancellableProtocol
  • loadIconFinish(res:) Extension method

    Finishes an async icon load, see gtk_icon_info_load_icon_async().

    Declaration

    Swift

    @inlinable
    func loadIconFinish<AsyncResultT>(res: AsyncResultT) throws -> PixbufRef! where AsyncResultT : AsyncResultProtocol
  • loadSurface(for:) Extension method

    Renders an icon previously looked up in an icon theme using gtk_icon_theme_lookup_icon(); the size will be based on the size passed to gtk_icon_theme_lookup_icon(). Note that the resulting surface may not be exactly this size; an icon theme may have icons that differ slightly from their nominal sizes, and in addition GTK+ will avoid scaling icons that it considers sufficiently close to the requested size or for which the source image would have to be scaled up too far. (This maintains sharpness.). This behaviour can be changed by passing the GTK_ICON_LOOKUP_FORCE_SIZE flag when obtaining the GtkIconInfo. If this flag has been specified, the pixbuf returned by this function will be scaled to the exact size.

    Declaration

    Swift

    @inlinable
    func loadSurface(for window: Gdk.WindowRef? = nil) throws -> Cairo.SurfaceRef!
  • loadSurface(for:) Extension method

    Renders an icon previously looked up in an icon theme using gtk_icon_theme_lookup_icon(); the size will be based on the size passed to gtk_icon_theme_lookup_icon(). Note that the resulting surface may not be exactly this size; an icon theme may have icons that differ slightly from their nominal sizes, and in addition GTK+ will avoid scaling icons that it considers sufficiently close to the requested size or for which the source image would have to be scaled up too far. (This maintains sharpness.). This behaviour can be changed by passing the GTK_ICON_LOOKUP_FORCE_SIZE flag when obtaining the GtkIconInfo. If this flag has been specified, the pixbuf returned by this function will be scaled to the exact size.

    Declaration

    Swift

    @inlinable
    func loadSurface<WindowT>(for window: WindowT?) throws -> Cairo.SurfaceRef! where WindowT : WindowProtocol
  • Loads an icon, modifying it to match the system colours for the foreground, success, warning and error colors provided. If the icon is not a symbolic one, the function will return the result from gtk_icon_info_load_icon().

    This allows loading symbolic icons that will match the system theme.

    Unless you are implementing a widget, you will want to use g_themed_icon_new_with_default_fallbacks() to load the icon.

    As implementation details, the icon loaded needs to be of SVG type, contain the “symbolic” term as the last component of the icon name, and use the “fg”, “success”, “warning” and “error” CSS styles in the SVG file itself.

    See the Symbolic Icons Specification for more information about symbolic icons.

    Declaration

    Swift

    @inlinable
    func loadSymbolic<RGBAT>(fg: RGBAT, successColor: RGBAT?, warningColor: RGBAT?, errorColor: RGBAT?, wasSymbolic: UnsafeMutablePointer<gboolean>! = nil) throws -> PixbufRef! where RGBAT : RGBAProtocol
  • Asynchronously load, render and scale a symbolic icon previously looked up from the icon theme using gtk_icon_theme_lookup_icon().

    For more details, see gtk_icon_info_load_symbolic() which is the synchronous version of this call.

    Declaration

    Swift

    @inlinable
    func loadSymbolicAsync<RGBAT>(fg: RGBAT, successColor: Gdk.RGBARef? = nil, warningColor: Gdk.RGBARef? = nil, errorColor: Gdk.RGBARef? = nil, cancellable: GIO.CancellableRef? = nil, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil) where RGBAT : RGBAProtocol
  • Asynchronously load, render and scale a symbolic icon previously looked up from the icon theme using gtk_icon_theme_lookup_icon().

    For more details, see gtk_icon_info_load_symbolic() which is the synchronous version of this call.

    Declaration

    Swift

    @inlinable
    func loadSymbolicAsync<CancellableT, RGBAT>(fg: RGBAT, successColor: RGBAT?, warningColor: RGBAT?, errorColor: RGBAT?, cancellable: CancellableT?, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil) where CancellableT : CancellableProtocol, RGBAT : RGBAProtocol
  • Finishes an async icon load, see gtk_icon_info_load_symbolic_async().

    Declaration

    Swift

    @inlinable
    func loadSymbolicFinish<AsyncResultT>(res: AsyncResultT, wasSymbolic: UnsafeMutablePointer<gboolean>! = nil) throws -> PixbufRef! where AsyncResultT : AsyncResultProtocol
  • Loads an icon, modifying it to match the system colors for the foreground, success, warning and error colors provided. If the icon is not a symbolic one, the function will return the result from gtk_icon_info_load_icon(). This function uses the regular foreground color and the symbolic colors with the names “success_color”, “warning_color” and “error_color” from the context.

    This allows loading symbolic icons that will match the system theme.

    See gtk_icon_info_load_symbolic() for more details.

    Declaration

    Swift

    @inlinable
    func loadSymbolicFor<StyleContextT>(context: StyleContextT, wasSymbolic: UnsafeMutablePointer<gboolean>! = nil) throws -> PixbufRef! where StyleContextT : StyleContextProtocol
  • Asynchronously load, render and scale a symbolic icon previously looked up from the icon theme using gtk_icon_theme_lookup_icon().

    For more details, see gtk_icon_info_load_symbolic_for_context() which is the synchronous version of this call.

    Declaration

    Swift

    @inlinable
    func loadSymbolicForContextAsync<StyleContextT>(context: StyleContextT, cancellable: GIO.CancellableRef? = nil, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil) where StyleContextT : StyleContextProtocol
  • Asynchronously load, render and scale a symbolic icon previously looked up from the icon theme using gtk_icon_theme_lookup_icon().

    For more details, see gtk_icon_info_load_symbolic_for_context() which is the synchronous version of this call.

    Declaration

    Swift

    @inlinable
    func loadSymbolicForContextAsync<CancellableT, StyleContextT>(context: StyleContextT, cancellable: CancellableT?, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil) where CancellableT : CancellableProtocol, StyleContextT : StyleContextProtocol
  • Finishes an async icon load, see gtk_icon_info_load_symbolic_for_context_async().

    Declaration

    Swift

    @inlinable
    func loadSymbolicForContextFinish<AsyncResultT>(res: AsyncResultT, wasSymbolic: UnsafeMutablePointer<gboolean>! = nil) throws -> PixbufRef! where AsyncResultT : AsyncResultProtocol
  • Loads an icon, modifying it to match the system colours for the foreground, success, warning and error colors provided. If the icon is not a symbolic one, the function will return the result from gtk_icon_info_load_icon().

    This allows loading symbolic icons that will match the system theme.

    See gtk_icon_info_load_symbolic() for more details.

    load_symbolic_for_style is deprecated: Use gtk_icon_info_load_symbolic_for_context() instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func loadSymbolicFor<StyleT>(style: StyleT, state: GtkStateType, wasSymbolic: UnsafeMutablePointer<gboolean>! = nil) throws -> PixbufRef! where StyleT : StyleProtocol
  • set(rawCoordinates:) Extension method

    Sets whether the coordinates returned by gtk_icon_info_get_embedded_rect() and gtk_icon_info_get_attach_points() should be returned in their original form as specified in the icon theme, instead of scaled appropriately for the pixbuf returned by gtk_icon_info_load_icon().

    Raw coordinates are somewhat strange; they are specified to be with respect to the unscaled pixmap for PNG and XPM icons, but for SVG icons, they are in a 1000x1000 coordinate space that is scaled to the final size of the icon. You can determine if the icon is an SVG icon by using gtk_icon_info_get_filename(), and seeing if it is non-nil and ends in “.svg”.

    This function is provided primarily to allow compatibility wrappers for older API’s, and is not expected to be useful for applications.

    set_raw_coordinates is deprecated: Embedded rectangles and attachment points are deprecated

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func set(rawCoordinates: Bool)
  • baseScale Extension method

    Gets the base scale for the icon. The base scale is a scale for the icon that was specified by the icon theme creator. For instance an icon drawn for a high-dpi screen with window scale 2 for a base size of 32 will be 64 pixels tall and have a base scale of 2.

    Declaration

    Swift

    @inlinable
    var baseScale: Int { get }
  • baseSize Extension method

    Gets the base size for the icon. The base size is a size for the icon that was specified by the icon theme creator. This may be different than the actual size of image; an example of this is small emblem icons that can be attached to a larger icon. These icons will be given the same base size as the larger icons to which they are attached.

    Note that for scaled icons the base size does not include the base scale.

    Declaration

    Swift

    @inlinable
    var baseSize: Int { get }
  • builtinPixbuf Extension method

    Gets the built-in image for this icon, if any. To allow GTK+ to use built in icon images, you must pass the GTK_ICON_LOOKUP_USE_BUILTIN to gtk_icon_theme_lookup_icon().

    get_builtin_pixbuf is deprecated: This function is deprecated, use gtk_icon_theme_add_resource_path() instead of builtin icons.

    Declaration

    Swift

    @inlinable
    var builtinPixbuf: PixbufRef! { get }
  • displayName Extension method

    This function is deprecated and always returns nil.

    get_display_name is deprecated: Display names are deprecated

    Declaration

    Swift

    @inlinable
    var displayName: String! { get }
  • filename Extension method

    Gets the filename for the icon. If the GTK_ICON_LOOKUP_USE_BUILTIN flag was passed to gtk_icon_theme_lookup_icon(), there may be no filename if a builtin icon is returned; in this case, you should use gtk_icon_info_get_builtin_pixbuf().

    Declaration

    Swift

    @inlinable
    var filename: String! { get }
  • isSymbolic Extension method

    Checks if the icon is symbolic or not. This currently uses only the file name and not the file contents for determining this. This behaviour may change in the future.

    Declaration

    Swift

    @inlinable
    var isSymbolic: Bool { get }