gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Gdk.PixbufAnimation

Contents

- Class Hierarchy
- Types
- Constructors
- Methods

Description

Synopsis

- data PixbufAnimation
- class GObjectClass o => PixbufAnimationClass o
- castToPixbufAnimation :: GObjectClass obj => obj -> PixbufAnimation
- gTypePixbufAnimation :: GType
- toPixbufAnimation :: PixbufAnimationClass o => o -> PixbufAnimation
- data PixbufAnimationIter
- class GObjectClass o => PixbufAnimationIterClass o
- castToPixbufAnimationIter :: GObjectClass obj => obj -> PixbufAnimationIter
- gTypePixbufAnimationIter :: GType
- toPixbufAnimationIter :: PixbufAnimationIterClass o => o -> PixbufAnimationIter
- data PixbufSimpleAnim
- class PixbufAnimationClass o => PixbufSimpleAnimClass o
- castToPixbufSimpleAnim :: GObjectClass obj => obj -> PixbufSimpleAnim
- gTypePixbufSimpleAnim :: GType
- toPixbufSimpleAnim :: PixbufSimpleAnimClass o => o -> PixbufSimpleAnim
- pixbufAnimationNewFromFile :: GlibFilePath fp => fp -> IO PixbufAnimation
- pixbufSimpleAnimNew :: Int -> Int -> Float -> IO PixbufSimpleAnim
- pixbufAnimationGetWidth :: PixbufAnimation -> IO Int
- pixbufAnimationGetHeight :: PixbufAnimation -> IO Int
- pixbufAnimationGetIter :: PixbufAnimation -> Maybe GTimeVal -> IO PixbufAnimationIter
- pixbufAnimationIsStaticImage :: PixbufAnimation -> IO Bool
- pixbufAnimationGetStaticImage :: PixbufAnimation -> IO (Maybe Pixbuf)
- pixbufAnimationIterAdvance :: PixbufAnimationIter -> Maybe GTimeVal -> IO Bool
- pixbufAnimationIterGetDelayTime :: PixbufAnimationIter -> IO Int
- pixbufAnimationIterOnCurrentlyLoadingFrame :: PixbufAnimationIter -> IO Bool
- pixbufAnimationIterGetPixbuf :: PixbufAnimationIter -> IO Pixbuf
- pixbufSimpleAnimAddFrame :: PixbufSimpleAnim -> Pixbuf -> IO ()
- pixbufSimpleAnimSetLoop :: PixbufSimpleAnim -> Bool -> IO ()
- pixbufSimpleAnimGetLoop :: PixbufSimpleAnim -> IO Bool

# Class Hierarchy

    | GObject
    | +----PixbufAnimation
    | +----PixbufSimpleAnim

# Types

data PixbufAnimation Source #

#### Instances

Instances details

Eq PixbufAnimation Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: PixbufAnimation -> PixbufAnimation -> Bool Source # (/=) :: PixbufAnimation -> PixbufAnimation -> Bool Source #
Ord PixbufAnimation Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: PixbufAnimation -> PixbufAnimation -> Ordering Source #

(<) :: PixbufAnimation -> PixbufAnimation -> Bool Source #

(<=) :: PixbufAnimation -> PixbufAnimation -> Bool Source #

(>) :: PixbufAnimation -> PixbufAnimation -> Bool Source #

(>=) :: PixbufAnimation -> PixbufAnimation -> Bool Source #

max :: PixbufAnimation -> PixbufAnimation -> PixbufAnimation Source #

min :: PixbufAnimation -> PixbufAnimation -> PixbufAnimation Source #

GObjectClass PixbufAnimation Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: PixbufAnimation -> GObject Source # unsafeCastGObject :: GObject -> PixbufAnimation Source #
PixbufAnimationClass PixbufAnimation Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class GObjectClass o => PixbufAnimationClass o Source #

#### Instances

Instances details

PixbufAnimationClass PixbufAnimation Source # |
Instance details Defined in Graphics.UI.Gtk.Types
PixbufAnimationClass PixbufSimpleAnim Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToPixbufAnimation :: GObjectClass obj => obj -> PixbufAnimation Source #

gTypePixbufAnimation :: GType Source #

toPixbufAnimation :: PixbufAnimationClass o => o -> PixbufAnimation Source #

data PixbufAnimationIter Source #

#### Instances

Instances details

Eq PixbufAnimationIter Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: PixbufAnimationIter -> PixbufAnimationIter -> Bool Source # (/=) :: PixbufAnimationIter -> PixbufAnimationIter -> Bool Source #
Ord PixbufAnimationIter Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: PixbufAnimationIter -> PixbufAnimationIter -> Ordering Source #

(<) :: PixbufAnimationIter -> PixbufAnimationIter -> Bool Source #

(<=) :: PixbufAnimationIter -> PixbufAnimationIter -> Bool Source #

(>) :: PixbufAnimationIter -> PixbufAnimationIter -> Bool Source #

(>=) :: PixbufAnimationIter -> PixbufAnimationIter -> Bool Source #

max :: PixbufAnimationIter -> PixbufAnimationIter -> PixbufAnimationIter Source #

min :: PixbufAnimationIter -> PixbufAnimationIter -> PixbufAnimationIter Source #

GObjectClass PixbufAnimationIter Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: PixbufAnimationIter -> GObject Source # unsafeCastGObject :: GObject -> PixbufAnimationIter Source #
PixbufAnimationIterClass PixbufAnimationIter Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class GObjectClass o => PixbufAnimationIterClass o Source #

#### Instances

Instances details

PixbufAnimationIterClass PixbufAnimationIter Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToPixbufAnimationIter :: GObjectClass obj => obj -> PixbufAnimationIter Source #

gTypePixbufAnimationIter :: GType Source #

toPixbufAnimationIter :: PixbufAnimationIterClass o => o -> PixbufAnimationIter Source #

data PixbufSimpleAnim Source #

#### Instances

Instances details

Eq PixbufSimpleAnim Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: PixbufSimpleAnim -> PixbufSimpleAnim -> Bool Source # (/=) :: PixbufSimpleAnim -> PixbufSimpleAnim -> Bool Source #
Ord PixbufSimpleAnim Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: PixbufSimpleAnim -> PixbufSimpleAnim -> Ordering Source #

(<) :: PixbufSimpleAnim -> PixbufSimpleAnim -> Bool Source #

(<=) :: PixbufSimpleAnim -> PixbufSimpleAnim -> Bool Source #

(>) :: PixbufSimpleAnim -> PixbufSimpleAnim -> Bool Source #

(>=) :: PixbufSimpleAnim -> PixbufSimpleAnim -> Bool Source #

max :: PixbufSimpleAnim -> PixbufSimpleAnim -> PixbufSimpleAnim Source #

min :: PixbufSimpleAnim -> PixbufSimpleAnim -> PixbufSimpleAnim Source #

GObjectClass PixbufSimpleAnim Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: PixbufSimpleAnim -> GObject Source # unsafeCastGObject :: GObject -> PixbufSimpleAnim Source #
PixbufAnimationClass PixbufSimpleAnim Source # |
Instance details Defined in Graphics.UI.Gtk.Types
PixbufSimpleAnimClass PixbufSimpleAnim Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class PixbufAnimationClass o => PixbufSimpleAnimClass o Source #

#### Instances

Instances details

PixbufSimpleAnimClass PixbufSimpleAnim Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToPixbufSimpleAnim :: GObjectClass obj => obj -> PixbufSimpleAnim Source #

gTypePixbufSimpleAnim :: GType Source #

toPixbufSimpleAnim :: PixbufSimpleAnimClass o => o -> PixbufSimpleAnim Source #

# Constructors

pixbufAnimationNewFromFile Source #

Arguments

:: GlibFilePath fp |
=> fp | Name of file to load, in the GLib file name encoding
-> IO PixbufAnimation | A newly-created animation

Creates a new animation by loading it from a file. The file format is detected automatically. If the file's format does not support multi-frame images, then an animation with a single frame will be created. Possible errors are in the `PixbufError` and `GFileError` domains.

Any of several error conditions may occur: the file could not be opened, there was no loader for the file's format, there was not enough memory to allocate the image buffer, or the image file contained invalid data.

- If an error occurs, the function will throw an exception that can be caught using e.g. `catchGErrorJust` and one of the error codes in `PixbufError` or `GFileError`

pixbufSimpleAnimNew Source #

Arguments

:: Int | the width of the animation
-> Int | the height of the animation
-> Float | the speed of the animation, in frames per second
-> IO PixbufSimpleAnim | a newly allocated `PixbufSimpleAnim`

Creates a new, empty animation.

- Available since Gtk+ version 2.8

# Methods

pixbufAnimationGetWidth Source #

Arguments

:: PixbufAnimation | An animation.
-> IO Int | Width of the bounding box of the animation.

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

pixbufAnimationGetHeight Source #

Arguments

:: PixbufAnimation | An animation.
-> IO Int | Height of the bounding box of the animation.

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

pixbufAnimationGetIter Source #

Arguments

:: PixbufAnimation | a `PixbufAnimation`
-> Maybe GTimeVal | time when the animation starts playing
-> IO PixbufAnimationIter | an iterator to move over the animation

Get an iterator for displaying an animation. The iterator provides the frames that should be displayed at a given time. The start time would normally come from `gGetCurrentTime`, and marks the beginning of animation playback. After creating an iterator, you should immediately display the pixbuf returned by `pixbufAnimationIterGetPixbuf`. Then, you should install a timeout (with `timeoutAdd`) or by some other mechanism ensure that you'll update the image after `pixbufAnimationIterGetDelayTime` 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 `Nothing`, the result of `gGetCurrentTime` will be used automatically.

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

If you're using `PixbufLoader`, in addition to updating the image after the delay time, you should also update it whenever you receive the area_updated signal and `pixbufAnimationIterOnCurrentlyLoadingFrame` 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."

pixbufAnimationIsStaticImage Source #

Arguments

:: PixbufAnimation |
-> IO Bool | (!(0)) if the "animation" was really just an image

If you load a file with `pixbufAnimationNewFromFile` and it turns out to be a plain, unanimated image, then this function will return `True`. Use `pixbufAnimationGetStaticImage` to retrieve the image.

pixbufAnimationGetStaticImage Source #

Arguments

:: PixbufAnimation |
-> IO (Maybe Pixbuf) | unanimated image representing 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 thing to display as a static unanimated image, which might be the first frame, or something more sophisticated. If an animation hasn't loaded any frames yet, this function will return `Nothing`.

pixbufAnimationIterAdvance Source #

Arguments

:: PixbufAnimationIter | A `PixbufAnimationIter`
-> Maybe GTimeVal | current time
-> IO Bool | `True` if the image may need updating

Possibly advances an animation to a new frame. Chooses the frame based on the start time passed to `pixbufAnimationGetIter`.

current_time would normally come from `gGetCurrentTime`, and must be greater than or equal to the time passed to `pixbufAnimationGetIter`, and must increase or remain unchanged each time `pixbufAnimationIterGetPixbuf` is called. That is, you can't go backward in time; animations only play forward.

As a shortcut, pass `Nothing` for the current time and `gGetCurrentTime` will be invoked on your behalf. So you only need to explicitly pass current_time if you're doing something odd like playing the animation at double speed.

If this function returns `False`, there's no need to update the animation display, assuming the display had been rendered prior to advancing; if `True`, you need to call `animationIterGetPixbuf` and update the display with the new pixbuf.

pixbufAnimationIterGetDelayTime Source #

Arguments

:: PixbufAnimationIter | an animation iterator
-> IO Int | delay time in milliseconds (thousandths of a second)

Gets the number of milliseconds the current pixbuf should be displayed, or -1 if the current pixbuf should be displayed forever. `timeoutAdd` conveniently takes a timeout in milliseconds, so you can use a timeout to schedule the next update.

pixbufAnimationIterOnCurrentlyLoadingFrame Source #

Arguments

:: PixbufAnimationIter |
-> IO Bool | `True` if the frame we're on is partially loaded, or the last frame

Used to determine how to respond to the area_updated signal on `PixbufLoader` when loading an animation. area_updated is emitted for an area of the frame currently streaming in to the loader. So if you're on the currently loading frame, you need to redraw the screen for the updated area.

pixbufAnimationIterGetPixbuf Source #

Arguments

:: PixbufAnimationIter | an animation iterator
-> IO Pixbuf | the pixbuf to be displayed

Gets the current pixbuf which should be displayed; the pixbuf will be the same size as the animation itself (`pixbufAnimationGetWidth`, `pixbufAnimationGetHeight`). This pixbuf should be displayed for `pixbufAnimationIterGetDelayTime` milliseconds. The caller of this function does not own a reference to the returned pixbuf; the returned pixbuf will become invalid when the iterator advances to the next frame, which may happen anytime you call `pixbufAnimationIterAdvance`. Copy the pixbuf to keep it (don't just add a reference), as it may get recycled as you advance the iterator.

pixbufSimpleAnimAddFrame Source #

Arguments

:: PixbufSimpleAnim | a `PixbufSimpleAnim`
-> Pixbuf | the pixbuf to add
-> IO () |

Adds a new frame to animation. The pixbuf must have the dimensions specified when the animation was constructed.

- Available since Gtk+ version 2.8

pixbufSimpleAnimSetLoop Source #

Arguments

:: PixbufSimpleAnim | a `PixbufSimpleAnim`
-> Bool | whether to loop the animation
-> IO () |

Sets whether animation should loop indefinitely when it reaches the end.

- Available since Gtk+ version 2.18

pixbufSimpleAnimGetLoop Source #

Arguments

:: PixbufSimpleAnim | a `PixbufSimpleAnim`
-> IO Bool | `True` if the animation loops forever, `False` otherwise

Gets whether animation should loop indefinitely when it reaches the end.

- Available since Gtk+ version 2.18