Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
The GdkPixbufLoader struct contains only private fields.
- newtype PixbufLoader = PixbufLoader (ManagedPtr PixbufLoader)
- class GObject o => IsPixbufLoader o
- toPixbufLoader :: IsPixbufLoader o => o -> IO PixbufLoader
- noPixbufLoader :: Maybe PixbufLoader
- data PixbufLoaderCloseMethodInfo
- pixbufLoaderClose :: (HasCallStack, MonadIO m, IsPixbufLoader a) => a -> m ()
- data PixbufLoaderGetAnimationMethodInfo
- pixbufLoaderGetAnimation :: (HasCallStack, MonadIO m, IsPixbufLoader a) => a -> m PixbufAnimation
- data PixbufLoaderGetFormatMethodInfo
- pixbufLoaderGetFormat :: (HasCallStack, MonadIO m, IsPixbufLoader a) => a -> m (Maybe PixbufFormat)
- data PixbufLoaderGetPixbufMethodInfo
- pixbufLoaderGetPixbuf :: (HasCallStack, MonadIO m, IsPixbufLoader a) => a -> m Pixbuf
- pixbufLoaderNew :: (HasCallStack, MonadIO m) => m PixbufLoader
- pixbufLoaderNewWithMimeType :: (HasCallStack, MonadIO m) => Text -> m PixbufLoader
- pixbufLoaderNewWithType :: (HasCallStack, MonadIO m) => Text -> m PixbufLoader
- data PixbufLoaderSetSizeMethodInfo
- pixbufLoaderSetSize :: (HasCallStack, MonadIO m, IsPixbufLoader a) => a -> Int32 -> Int32 -> m ()
- data PixbufLoaderWriteMethodInfo
- pixbufLoaderWrite :: (HasCallStack, MonadIO m, IsPixbufLoader a) => a -> ByteString -> m ()
- data PixbufLoaderWriteBytesMethodInfo
- pixbufLoaderWriteBytes :: (HasCallStack, MonadIO m, IsPixbufLoader a) => a -> Bytes -> m ()
- type C_PixbufLoaderAreaPreparedCallback = Ptr () -> Ptr () -> IO ()
- type PixbufLoaderAreaPreparedCallback = IO ()
- data PixbufLoaderAreaPreparedSignalInfo
- afterPixbufLoaderAreaPrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaPreparedCallback -> m SignalHandlerId
- genClosure_PixbufLoaderAreaPrepared :: PixbufLoaderAreaPreparedCallback -> IO Closure
- mk_PixbufLoaderAreaPreparedCallback :: C_PixbufLoaderAreaPreparedCallback -> IO (FunPtr C_PixbufLoaderAreaPreparedCallback)
- noPixbufLoaderAreaPreparedCallback :: Maybe PixbufLoaderAreaPreparedCallback
- onPixbufLoaderAreaPrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaPreparedCallback -> m SignalHandlerId
- wrap_PixbufLoaderAreaPreparedCallback :: PixbufLoaderAreaPreparedCallback -> Ptr () -> Ptr () -> IO ()
- type C_PixbufLoaderAreaUpdatedCallback = Ptr () -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> IO ()
- type PixbufLoaderAreaUpdatedCallback = Int32 -> Int32 -> Int32 -> Int32 -> IO ()
- data PixbufLoaderAreaUpdatedSignalInfo
- afterPixbufLoaderAreaUpdated :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId
- genClosure_PixbufLoaderAreaUpdated :: PixbufLoaderAreaUpdatedCallback -> IO Closure
- mk_PixbufLoaderAreaUpdatedCallback :: C_PixbufLoaderAreaUpdatedCallback -> IO (FunPtr C_PixbufLoaderAreaUpdatedCallback)
- noPixbufLoaderAreaUpdatedCallback :: Maybe PixbufLoaderAreaUpdatedCallback
- onPixbufLoaderAreaUpdated :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId
- wrap_PixbufLoaderAreaUpdatedCallback :: PixbufLoaderAreaUpdatedCallback -> Ptr () -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> IO ()
- type C_PixbufLoaderClosedCallback = Ptr () -> Ptr () -> IO ()
- type PixbufLoaderClosedCallback = IO ()
- data PixbufLoaderClosedSignalInfo
- afterPixbufLoaderClosed :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderClosedCallback -> m SignalHandlerId
- genClosure_PixbufLoaderClosed :: PixbufLoaderClosedCallback -> IO Closure
- mk_PixbufLoaderClosedCallback :: C_PixbufLoaderClosedCallback -> IO (FunPtr C_PixbufLoaderClosedCallback)
- noPixbufLoaderClosedCallback :: Maybe PixbufLoaderClosedCallback
- onPixbufLoaderClosed :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderClosedCallback -> m SignalHandlerId
- wrap_PixbufLoaderClosedCallback :: PixbufLoaderClosedCallback -> Ptr () -> Ptr () -> IO ()
- type C_PixbufLoaderSizePreparedCallback = Ptr () -> Int32 -> Int32 -> Ptr () -> IO ()
- type PixbufLoaderSizePreparedCallback = Int32 -> Int32 -> IO ()
- data PixbufLoaderSizePreparedSignalInfo
- afterPixbufLoaderSizePrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId
- genClosure_PixbufLoaderSizePrepared :: PixbufLoaderSizePreparedCallback -> IO Closure
- mk_PixbufLoaderSizePreparedCallback :: C_PixbufLoaderSizePreparedCallback -> IO (FunPtr C_PixbufLoaderSizePreparedCallback)
- noPixbufLoaderSizePreparedCallback :: Maybe PixbufLoaderSizePreparedCallback
- onPixbufLoaderSizePrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId
- wrap_PixbufLoaderSizePreparedCallback :: PixbufLoaderSizePreparedCallback -> Ptr () -> Int32 -> Int32 -> Ptr () -> IO ()
Exported types
newtype PixbufLoader Source #
GObject PixbufLoader Source # | |
IsObject PixbufLoader Source # | |
IsPixbufLoader PixbufLoader Source # | |
((~) * info (ResolvePixbufLoaderMethod t PixbufLoader), MethodInfo * info PixbufLoader p) => IsLabel t (PixbufLoader -> p) Source # | |
((~) * info (ResolvePixbufLoaderMethod t PixbufLoader), MethodInfo * info PixbufLoader p) => IsLabelProxy t (PixbufLoader -> p) Source # | |
HasAttributeList * PixbufLoader Source # | |
type AttributeList PixbufLoader Source # | |
type SignalList PixbufLoader Source # | |
class GObject o => IsPixbufLoader o Source #
toPixbufLoader :: IsPixbufLoader o => o -> IO PixbufLoader Source #
Methods
close
data PixbufLoaderCloseMethodInfo Source #
((~) * signature (m ()), MonadIO m, IsPixbufLoader a) => MethodInfo * PixbufLoaderCloseMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPixbufLoader a) | |
=> a |
|
-> m () | (Can throw |
Informs a pixbuf loader that no further writes with
pixbufLoaderWrite
will occur, so that it can free its
internal loading structures. Also, tries to parse any data that
hasn't yet been parsed; if the remaining data is partial or
corrupt, an error will be returned. If False
is returned, error
will be set to an error from the GDK_PIXBUF_ERROR
or G_FILE_ERROR
domains. If you're just cancelling a load rather than expecting it
to be finished, passing Nothing
for error
to ignore it is
reasonable.
Remember that this does not unref the loader, so if you plan not to
use it anymore, please objectUnref
it.
getAnimation
data PixbufLoaderGetAnimationMethodInfo Source #
((~) * signature (m PixbufAnimation), MonadIO m, IsPixbufLoader a) => MethodInfo * PixbufLoaderGetAnimationMethodInfo a signature Source # | |
pixbufLoaderGetAnimation Source #
:: (HasCallStack, MonadIO m, IsPixbufLoader a) | |
=> a |
|
-> m PixbufAnimation | Returns: The |
Queries the PixbufAnimation
that a pixbuf loader is currently creating.
In general it only makes sense to call this function after the "area-prepared"
signal has been emitted by the loader. If the loader doesn't have enough
bytes yet (hasn't emitted the "area-prepared" signal) this function will
return Nothing
.
getFormat
data PixbufLoaderGetFormatMethodInfo Source #
((~) * signature (m (Maybe PixbufFormat)), MonadIO m, IsPixbufLoader a) => MethodInfo * PixbufLoaderGetFormatMethodInfo a signature Source # | |
pixbufLoaderGetFormat Source #
:: (HasCallStack, MonadIO m, IsPixbufLoader a) | |
=> a |
|
-> m (Maybe PixbufFormat) | Returns: A |
Obtains the available information about the format of the currently loading image file.
Since: 2.2
getPixbuf
data PixbufLoaderGetPixbufMethodInfo Source #
((~) * signature (m Pixbuf), MonadIO m, IsPixbufLoader a) => MethodInfo * PixbufLoaderGetPixbufMethodInfo a signature Source # | |
pixbufLoaderGetPixbuf Source #
:: (HasCallStack, MonadIO m, IsPixbufLoader a) | |
=> a |
|
-> m Pixbuf | Returns: The |
Queries the Pixbuf
that a pixbuf loader is currently creating.
In general it only makes sense to call this function after the
"area-prepared" signal has been emitted by the loader; this means
that enough data has been read to know the size of the image that
will be allocated. If the loader has not received enough data via
pixbufLoaderWrite
, then this function returns Nothing
. The
returned pixbuf will be the same in all future calls to the loader,
so simply calling objectRef
should be sufficient to continue
using it. Additionally, if the loader is an animation, it will
return the "static image" of the animation
(see pixbufAnimationGetStaticImage
).
new
:: (HasCallStack, MonadIO m) | |
=> m PixbufLoader | Returns: A newly-created pixbuf loader. |
Creates a new pixbuf loader object.
newWithMimeType
pixbufLoaderNewWithMimeType Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m PixbufLoader | Returns: A newly-created pixbuf loader. (Can throw |
Creates a new pixbuf loader object that always attempts to parse
image data as if it were an image of mime type mimeType
, instead of
identifying the type automatically. Useful if you want an error if
the image isn't the expected mime type, for loading image formats
that can't be reliably identified by looking at the data, or if
the user manually forces a specific mime type.
The list of supported mime types depends on what image loaders
are installed, but typically "image/png", "image/jpeg", "image/gif",
"image/tiff" and "image/x-xpixmap" are among the supported mime types.
To obtain the full list of supported mime types, call
pixbufFormatGetMimeTypes
on each of the PixbufFormat
structs returned by pixbufGetFormats
.
Since: 2.4
newWithType
pixbufLoaderNewWithType Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m PixbufLoader | Returns: A newly-created pixbuf loader. (Can throw |
Creates a new pixbuf loader object that always attempts to parse
image data as if it were an image of type imageType
, instead of
identifying the type automatically. Useful if you want an error if
the image isn't the expected type, for loading image formats
that can't be reliably identified by looking at the data, or if
the user manually forces a specific type.
The list of supported image formats depends on what image loaders
are installed, but typically "png", "jpeg", "gif", "tiff" and
"xpm" are among the supported formats. To obtain the full list of
supported image formats, call pixbufFormatGetName
on each
of the PixbufFormat
structs returned by pixbufGetFormats
.
setSize
data PixbufLoaderSetSizeMethodInfo Source #
((~) * signature (Int32 -> Int32 -> m ()), MonadIO m, IsPixbufLoader a) => MethodInfo * PixbufLoaderSetSizeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPixbufLoader a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Causes the image to be scaled while it is loaded. The desired
image size can be determined relative to the original size of
the image by calling pixbufLoaderSetSize
from a
signal handler for the ::size-prepared signal.
Attempts to set the desired image size are ignored after the emission of the ::size-prepared signal.
Since: 2.2
write
data PixbufLoaderWriteMethodInfo Source #
((~) * signature (ByteString -> m ()), MonadIO m, IsPixbufLoader a) => MethodInfo * PixbufLoaderWriteMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPixbufLoader a) | |
=> a |
|
-> ByteString |
|
-> m () | (Can throw |
This will cause a pixbuf loader to parse the next count
bytes of
an image. It will return True
if the data was loaded successfully,
and False
if an error occurred. In the latter case, the loader
will be closed, and will not accept further writes. If False
is
returned, error
will be set to an error from the GDK_PIXBUF_ERROR
or G_FILE_ERROR
domains.
writeBytes
data PixbufLoaderWriteBytesMethodInfo Source #
((~) * signature (Bytes -> m ()), MonadIO m, IsPixbufLoader a) => MethodInfo * PixbufLoaderWriteBytesMethodInfo a signature Source # | |
pixbufLoaderWriteBytes Source #
:: (HasCallStack, MonadIO m, IsPixbufLoader a) | |
=> a |
|
-> Bytes |
|
-> m () | (Can throw |
This will cause a pixbuf loader to parse a buffer inside a Bytes
for an image. It will return True
if the data was loaded successfully,
and False
if an error occurred. In the latter case, the loader
will be closed, and will not accept further writes. If False
is
returned, error
will be set to an error from the GDK_PIXBUF_ERROR
or G_FILE_ERROR
domains.
See also: pixbufLoaderWrite
Since: 2.30
Signals
areaPrepared
type PixbufLoaderAreaPreparedCallback = IO () Source #
afterPixbufLoaderAreaPrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaPreparedCallback -> m SignalHandlerId Source #
mk_PixbufLoaderAreaPreparedCallback :: C_PixbufLoaderAreaPreparedCallback -> IO (FunPtr C_PixbufLoaderAreaPreparedCallback) Source #
onPixbufLoaderAreaPrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaPreparedCallback -> m SignalHandlerId Source #
wrap_PixbufLoaderAreaPreparedCallback :: PixbufLoaderAreaPreparedCallback -> Ptr () -> Ptr () -> IO () Source #
areaUpdated
type C_PixbufLoaderAreaUpdatedCallback = Ptr () -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> IO () Source #
afterPixbufLoaderAreaUpdated :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId Source #
mk_PixbufLoaderAreaUpdatedCallback :: C_PixbufLoaderAreaUpdatedCallback -> IO (FunPtr C_PixbufLoaderAreaUpdatedCallback) Source #
onPixbufLoaderAreaUpdated :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderAreaUpdatedCallback -> m SignalHandlerId Source #
wrap_PixbufLoaderAreaUpdatedCallback :: PixbufLoaderAreaUpdatedCallback -> Ptr () -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> IO () Source #
closed
type PixbufLoaderClosedCallback = IO () Source #
afterPixbufLoaderClosed :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderClosedCallback -> m SignalHandlerId Source #
mk_PixbufLoaderClosedCallback :: C_PixbufLoaderClosedCallback -> IO (FunPtr C_PixbufLoaderClosedCallback) Source #
onPixbufLoaderClosed :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderClosedCallback -> m SignalHandlerId Source #
wrap_PixbufLoaderClosedCallback :: PixbufLoaderClosedCallback -> Ptr () -> Ptr () -> IO () Source #
sizePrepared
afterPixbufLoaderSizePrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId Source #
mk_PixbufLoaderSizePreparedCallback :: C_PixbufLoaderSizePreparedCallback -> IO (FunPtr C_PixbufLoaderSizePreparedCallback) Source #
onPixbufLoaderSizePrepared :: (IsPixbufLoader a, MonadIO m) => a -> PixbufLoaderSizePreparedCallback -> m SignalHandlerId Source #
wrap_PixbufLoaderSizePreparedCallback :: PixbufLoaderSizePreparedCallback -> Ptr () -> Int32 -> Int32 -> Ptr () -> IO () Source #