PixbufAnimationProtocol

public protocol PixbufAnimationProtocol : ObjectProtocol

An opaque object representing an animation.

The GdkPixBuf library provides a simple mechanism to load and represent animations. An animation is conceptually a series of frames to be displayed over time.

The animation may not be represented as a series of frames internally; for example, it may be stored as a sprite and instructions for moving the sprite around a background.

To display an animation you don’t need to understand its representation, however; you just ask GdkPixbuf what should be displayed at a given point in time.

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

  • ptr

    Untyped pointer to the underlying GdkPixbufAnimation instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GdkPixbufAnimation instance.

    Default Implementation

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

    Declaration

    Swift

    var pixbuf_animation_ptr: UnsafeMutablePointer<GdkPixbufAnimation>! { get }
  • Required Initialiser for types conforming to PixbufAnimationProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

PixbufAnimation Class: PixbufAnimationProtocol extension (methods and fields)

  • getHeight() Extension method

    Queries the height of the bounding box of a pixbuf animation.

    Declaration

    Swift

    @inlinable
    func getHeight() -> Int
  • getIter(startTime:) Extension method

    Get an iterator for displaying an animation.

    The iterator provides the frames that should be displayed at a given time.

    start_time would normally come from g_get_current_time(), and marks the beginning of animation playback. After creating an iterator, you should immediately display the pixbuf returned by gdk_pixbuf_animation_iter_get_pixbuf(). Then, you should install a timeout (with g_timeout_add()) or by some other mechanism ensure that you’ll update the image after gdk_pixbuf_animation_iter_get_delay_time() milliseconds. Each time the image is updated, you should reinstall the timeout with the new, possibly-changed delay time.

    As a shortcut, if start_time is NULL, the result of g_get_current_time() will be used automatically.

    To update the image (i.e. possibly change the result of gdk_pixbuf_animation_iter_get_pixbuf() to a new frame of the animation), call gdk_pixbuf_animation_iter_advance().

    If you’re using GdkPixbufLoader, in addition to updating the image after the delay time, you should also update it whenever you receive the area_updated signal and gdk_pixbuf_animation_iter_on_currently_loading_frame() returns TRUE. In this case, the frame currently being fed into the loader has received new data, so needs to be refreshed. The delay time for a frame may also be modified after an area_updated signal, for example if the delay time for a frame is encoded in the data after the frame itself. So your timeout should be reinstalled after any area_updated signal.

    A delay time of -1 is possible, indicating “infinite”.

    Declaration

    Swift

    @inlinable
    func getIter(startTime: GLib.TimeValRef? = nil) -> GdkPixBuf.PixbufAnimationIterRef!
  • getIter(startTime:) Extension method

    Get an iterator for displaying an animation.

    The iterator provides the frames that should be displayed at a given time.

    start_time would normally come from g_get_current_time(), and marks the beginning of animation playback. After creating an iterator, you should immediately display the pixbuf returned by gdk_pixbuf_animation_iter_get_pixbuf(). Then, you should install a timeout (with g_timeout_add()) or by some other mechanism ensure that you’ll update the image after gdk_pixbuf_animation_iter_get_delay_time() milliseconds. Each time the image is updated, you should reinstall the timeout with the new, possibly-changed delay time.

    As a shortcut, if start_time is NULL, the result of g_get_current_time() will be used automatically.

    To update the image (i.e. possibly change the result of gdk_pixbuf_animation_iter_get_pixbuf() to a new frame of the animation), call gdk_pixbuf_animation_iter_advance().

    If you’re using GdkPixbufLoader, in addition to updating the image after the delay time, you should also update it whenever you receive the area_updated signal and gdk_pixbuf_animation_iter_on_currently_loading_frame() returns TRUE. In this case, the frame currently being fed into the loader has received new data, so needs to be refreshed. The delay time for a frame may also be modified after an area_updated signal, for example if the delay time for a frame is encoded in the data after the frame itself. So your timeout should be reinstalled after any area_updated signal.

    A delay time of -1 is possible, indicating “infinite”.

    Declaration

    Swift

    @inlinable
    func getIter<GLibTimeValT>(startTime: GLibTimeValT?) -> GdkPixBuf.PixbufAnimationIterRef! where GLibTimeValT : TimeValProtocol
  • getStaticImage() Extension method

    Retrieves a static image for the animation.

    If an animation is really just a plain image (has only one frame), this function returns that image.

    If the animation is an animation, this function returns a reasonable image to use as a static unanimated image, which might be the first frame, or something more sophisticated depending on the file format.

    If an animation hasn’t loaded any frames yet, this function will return NULL.

    Declaration

    Swift

    @inlinable
    func getStaticImage() -> GdkPixBuf.PixbufRef!
  • getWidth() Extension method

    Queries the width of the bounding box of a pixbuf animation.

    Declaration

    Swift

    @inlinable
    func getWidth() -> Int
  • ref() Extension method

    Adds a reference to an animation.

    ref is deprecated: Use g_object_ref().

    Declaration

    Swift

    @available(*, deprecated)
    @discardableResult
    @inlinable
    func ref() -> GdkPixBuf.PixbufAnimationRef!
  • unref() Extension method

    Removes a reference from an animation.

    unref is deprecated: Use g_object_unref().

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func unref()
  • height Extension method

    Queries the height of the bounding box of a pixbuf animation.

    Declaration

    Swift

    @inlinable
    var height: Int { get }
  • isStaticImage Extension method

    Checks whether the animation is a static image.

    If you load a file with gdk_pixbuf_animation_new_from_file() and it turns out to be a plain, unanimated image, then this function will return TRUE. Use gdk_pixbuf_animation_get_static_image() to retrieve the image.

    Declaration

    Swift

    @inlinable
    var isStaticImage: Bool { get }
  • staticImage Extension method

    Retrieves a static image for the animation.

    If an animation is really just a plain image (has only one frame), this function returns that image.

    If the animation is an animation, this function returns a reasonable image to use as a static unanimated image, which might be the first frame, or something more sophisticated depending on the file format.

    If an animation hasn’t loaded any frames yet, this function will return NULL.

    Declaration

    Swift

    @inlinable
    var staticImage: GdkPixBuf.PixbufRef! { get }
  • width Extension method

    Queries the width of the bounding box of a pixbuf animation.

    Declaration

    Swift

    @inlinable
    var width: Int { get }
  • parentInstance Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var parentInstance: GObject { get }