gi-gdkpixbuf-2.0.31: GdkPixbuf bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GdkPixbuf.Callbacks

Description

 
Synopsis

Signals

PixbufDestroyNotify

type C_PixbufDestroyNotify = Ptr Word8 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type PixbufDestroyNotify Source #

Arguments

 = Ptr Word8

pixels: The pixel array of the pixbuf that is being finalized.

-> IO () 

A function of this type is responsible for freeing the pixel array of a pixbuf.

The pixbufNewFromData function lets you pass in a pre-allocated pixel array so that a pixbuf can be created from it; in this case you will need to pass in a function of type GdkPixbufDestroyNotify so that the pixel data can be freed when the pixbuf is finalized.

type PixbufDestroyNotify_WithClosures Source #

Arguments

 = Ptr Word8

pixels: The pixel array of the pixbuf that is being finalized.

-> Ptr ()

data: User closure data.

-> IO () 

A function of this type is responsible for freeing the pixel array of a pixbuf.

The pixbufNewFromData function lets you pass in a pre-allocated pixel array so that a pixbuf can be created from it; in this case you will need to pass in a function of type GdkPixbufDestroyNotify so that the pixel data can be freed when the pixbuf is finalized.

drop_closures_PixbufDestroyNotify :: PixbufDestroyNotify -> PixbufDestroyNotify_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_PixbufDestroyNotify Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufDestroyNotify 
-> Ptr Word8

pixels: The pixel array of the pixbuf that is being finalized.

-> Ptr ()

data: User closure data.

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_PixbufDestroyNotify :: MonadIO m => PixbufDestroyNotify -> m (GClosure C_PixbufDestroyNotify) Source #

Wrap the callback into a GClosure.

mk_PixbufDestroyNotify :: C_PixbufDestroyNotify -> IO (FunPtr C_PixbufDestroyNotify) Source #

Generate a function pointer callable from C code, from a C_PixbufDestroyNotify.

PixbufModuleFillInfoFunc

type C_PixbufModuleFillInfoFunc = Ptr PixbufFormat -> IO () Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleFillInfoFunc Source #

Arguments

 = PixbufFormat

info: a PixbufFormat.

-> IO () 

Defines the type of the function used to fill a PixbufFormat structure with information about a module.

Since: 2.2

dynamic_PixbufModuleFillInfoFunc Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufModuleFillVtableFunc

type C_PixbufModuleFillVtableFunc = Ptr PixbufModule -> IO () Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleFillVtableFunc Source #

Arguments

 = PixbufModule

module: a PixbufModule.

-> IO () 

Defines the type of the function used to set the vtable of a PixbufModule when it is loaded.

Since: 2.2

dynamic_PixbufModuleFillVtableFunc Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufModuleIncrementLoadFunc

type C_PixbufModuleIncrementLoadFunc = Ptr () -> Ptr Word8 -> Word32 -> Ptr (Ptr GError) -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleIncrementLoadFunc Source #

Arguments

 = Ptr ()

context: the state object created by [callbackgdkPixbuf.PixbufModuleBeginLoadFunc]

-> ByteString

buf: the data to load

-> IO ()

Returns: TRUE if the incremental load was successful (Can throw GError)

Incrementally loads a buffer into the image data.

dynamic_PixbufModuleIncrementLoadFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufModuleIncrementLoadFunc 
-> Ptr ()

context: the state object created by [callbackgdkPixbuf.PixbufModuleBeginLoadFunc]

-> ByteString

buf: the data to load

-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufModuleLoadAnimationFunc

type C_PixbufModuleLoadAnimationFunc = Ptr () -> Ptr (Ptr GError) -> IO (Ptr PixbufAnimation) Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleLoadAnimationFunc Source #

Arguments

 = Ptr ()

f: the file stream from which the image should be loaded

-> IO PixbufAnimation

Returns: a newly created GdkPixbufAnimation for the contents of the file (Can throw GError)

Loads a file from a standard C file stream into a new GdkPixbufAnimation.

In case of error, this function should return NULL and set the error argument.

dynamic_PixbufModuleLoadAnimationFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufModuleLoadAnimationFunc 
-> Ptr ()

f: the file stream from which the image should be loaded

-> m PixbufAnimation

Returns: a newly created GdkPixbufAnimation for the contents of the file (Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufModuleLoadFunc

type C_PixbufModuleLoadFunc = Ptr () -> Ptr (Ptr GError) -> IO (Ptr Pixbuf) Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleLoadFunc Source #

Arguments

 = Ptr ()

f: the file stream from which the image should be loaded

-> IO Pixbuf

Returns: a newly created GdkPixbuf for the contents of the file (Can throw GError)

Loads a file from a standard C file stream into a new GdkPixbuf.

In case of error, this function should return NULL and set the error argument.

dynamic_PixbufModuleLoadFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufModuleLoadFunc 
-> Ptr ()

f: the file stream from which the image should be loaded

-> m Pixbuf

Returns: a newly created GdkPixbuf for the contents of the file (Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_PixbufModuleLoadFunc :: C_PixbufModuleLoadFunc -> IO (FunPtr C_PixbufModuleLoadFunc) Source #

Generate a function pointer callable from C code, from a C_PixbufModuleLoadFunc.

PixbufModuleLoadXpmDataFunc

type C_PixbufModuleLoadXpmDataFunc = Ptr CString -> IO (Ptr Pixbuf) Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleLoadXpmDataFunc Source #

Arguments

 = [Text]

data: the XPM data

-> IO Pixbuf

Returns: a newly created GdkPixbuf for the XPM data

Loads XPM data into a new GdkPixbuf.

dynamic_PixbufModuleLoadXpmDataFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufModuleLoadXpmDataFunc 
-> [Text]

data: the XPM data

-> m Pixbuf

Returns: a newly created GdkPixbuf for the XPM data

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufModulePreparedFunc

type C_PixbufModulePreparedFunc = Ptr Pixbuf -> Ptr PixbufAnimation -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type PixbufModulePreparedFunc Source #

Arguments

 = Pixbuf

pixbuf: the Pixbuf that is currently being loaded.

-> PixbufAnimation

anim: if an animation is being loaded, the PixbufAnimation, else Nothing.

-> IO () 

Defines the type of the function that gets called once the initial setup of pixbuf is done.

PixbufLoader uses a function of this type to emit the "<link linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" signal.

Since: 2.2

type PixbufModulePreparedFunc_WithClosures Source #

Arguments

 = Pixbuf

pixbuf: the Pixbuf that is currently being loaded.

-> PixbufAnimation

anim: if an animation is being loaded, the PixbufAnimation, else Nothing.

-> Ptr ()

userData: the loader.

-> IO () 

Defines the type of the function that gets called once the initial setup of pixbuf is done.

PixbufLoader uses a function of this type to emit the "<link linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" signal.

Since: 2.2

dynamic_PixbufModulePreparedFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsPixbuf a, IsPixbufAnimation b) 
=> FunPtr C_PixbufModulePreparedFunc 
-> a

pixbuf: the Pixbuf that is currently being loaded.

-> b

anim: if an animation is being loaded, the PixbufAnimation, else Nothing.

-> Ptr ()

userData: the loader.

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufModuleSaveFunc

type C_PixbufModuleSaveFunc = Ptr () -> Ptr Pixbuf -> Ptr CString -> Ptr CString -> Ptr (Ptr GError) -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleSaveFunc Source #

Arguments

 = Ptr ()

f: the file stream into which the image should be saved

-> Pixbuf

pixbuf: the image to save

-> Maybe [Text]

paramKeys: parameter keys to save

-> Maybe [Text]

paramValues: parameter values to save

-> IO ()

Returns: TRUE on success; in case of failure, FALSE is returned and the error is set (Can throw GError)

Saves a GdkPixbuf into a standard C file stream.

The optional param_keys and param_values arrays contain the keys and values (in the same order) for attributes to be saved alongside the image data.

dynamic_PixbufModuleSaveFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsPixbuf a) 
=> FunPtr C_PixbufModuleSaveFunc 
-> Ptr ()

f: the file stream into which the image should be saved

-> a

pixbuf: the image to save

-> Maybe [Text]

paramKeys: parameter keys to save

-> Maybe [Text]

paramValues: parameter values to save

-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_PixbufModuleSaveFunc :: C_PixbufModuleSaveFunc -> IO (FunPtr C_PixbufModuleSaveFunc) Source #

Generate a function pointer callable from C code, from a C_PixbufModuleSaveFunc.

PixbufModuleSaveOptionSupportedFunc

type C_PixbufModuleSaveOptionSupportedFunc = CString -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleSaveOptionSupportedFunc Source #

Arguments

 = Text

optionKey: the option key to check

-> IO Bool

Returns: TRUE if the option is supported

Checks whether the given option_key is supported when saving.

dynamic_PixbufModuleSaveOptionSupportedFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufModuleSaveOptionSupportedFunc 
-> Text

optionKey: the option key to check

-> m Bool

Returns: TRUE if the option is supported

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufModuleSizeFunc

type C_PixbufModuleSizeFunc = Int32 -> Int32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleSizeFunc Source #

Arguments

 = Int32

width: pointer to a location containing the current image width

-> Int32

height: pointer to a location containing the current image height

-> IO () 

Defines the type of the function that gets called once the size of the loaded image is known.

The function is expected to set width and height to the desired size to which the image should be scaled. If a module has no efficient way to achieve the desired scaling during the loading of the image, it may either ignore the size request, or only approximate it - gdk-pixbuf will then perform the required scaling on the completely loaded image.

If the function sets width or height to zero, the module should interpret this as a hint that it will be closed soon and shouldn't allocate further resources. This convention is used to implement pixbufGetFileInfo efficiently.

Since: 2.2

type PixbufModuleSizeFunc_WithClosures Source #

Arguments

 = Int32

width: pointer to a location containing the current image width

-> Int32

height: pointer to a location containing the current image height

-> Ptr ()

userData: the loader.

-> IO () 

Defines the type of the function that gets called once the size of the loaded image is known.

The function is expected to set width and height to the desired size to which the image should be scaled. If a module has no efficient way to achieve the desired scaling during the loading of the image, it may either ignore the size request, or only approximate it - gdk-pixbuf will then perform the required scaling on the completely loaded image.

If the function sets width or height to zero, the module should interpret this as a hint that it will be closed soon and shouldn't allocate further resources. This convention is used to implement pixbufGetFileInfo efficiently.

Since: 2.2

dynamic_PixbufModuleSizeFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufModuleSizeFunc 
-> Int32

width: pointer to a location containing the current image width

-> Int32

height: pointer to a location containing the current image height

-> Ptr ()

userData: the loader.

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_PixbufModuleSizeFunc :: MonadIO m => PixbufModuleSizeFunc -> m (GClosure C_PixbufModuleSizeFunc) Source #

Wrap the callback into a GClosure.

mk_PixbufModuleSizeFunc :: C_PixbufModuleSizeFunc -> IO (FunPtr C_PixbufModuleSizeFunc) Source #

Generate a function pointer callable from C code, from a C_PixbufModuleSizeFunc.

PixbufModuleStopLoadFunc

type C_PixbufModuleStopLoadFunc = Ptr () -> Ptr (Ptr GError) -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleStopLoadFunc Source #

Arguments

 = Ptr ()

context: the state object created by [callbackgdkPixbuf.PixbufModuleBeginLoadFunc]

-> IO ()

Returns: TRUE if the loading operation was successful (Can throw GError)

Finalizes the image loading state.

This function is called on success and error states.

dynamic_PixbufModuleStopLoadFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufModuleStopLoadFunc 
-> Ptr ()

context: the state object created by [callbackgdkPixbuf.PixbufModuleBeginLoadFunc]

-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufModuleUpdatedFunc

type C_PixbufModuleUpdatedFunc = Ptr Pixbuf -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type PixbufModuleUpdatedFunc Source #

Arguments

 = Pixbuf

pixbuf: the Pixbuf that is currently being loaded.

-> Int32

x: the X origin of the updated area.

-> Int32

y: the Y origin of the updated area.

-> Int32

width: the width of the updated area.

-> Int32

height: the height of the updated area.

-> IO () 

Defines the type of the function that gets called every time a region of pixbuf is updated.

PixbufLoader uses a function of this type to emit the "<link linkend="GdkPixbufLoader-area-updated">area_updated</link>" signal.

Since: 2.2

type PixbufModuleUpdatedFunc_WithClosures Source #

Arguments

 = Pixbuf

pixbuf: the Pixbuf that is currently being loaded.

-> Int32

x: the X origin of the updated area.

-> Int32

y: the Y origin of the updated area.

-> Int32

width: the width of the updated area.

-> Int32

height: the height of the updated area.

-> Ptr ()

userData: the loader.

-> IO () 

Defines the type of the function that gets called every time a region of pixbuf is updated.

PixbufLoader uses a function of this type to emit the "<link linkend="GdkPixbufLoader-area-updated">area_updated</link>" signal.

Since: 2.2

dynamic_PixbufModuleUpdatedFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsPixbuf a) 
=> FunPtr C_PixbufModuleUpdatedFunc 
-> a

pixbuf: the Pixbuf that is currently being loaded.

-> Int32

x: the X origin of the updated area.

-> Int32

y: the Y origin of the updated area.

-> Int32

width: the width of the updated area.

-> Int32

height: the height of the updated area.

-> Ptr ()

userData: the loader.

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

PixbufSaveFunc

type C_PixbufSaveFunc = Ptr Word8 -> Word64 -> Ptr (Ptr GError) -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PixbufSaveFunc Source #

Arguments

 = ByteString

buf: bytes to be written.

-> IO (Bool, GError)

Returns: TRUE if successful, FALSE otherwise

Save functions used by Pixbuf.save_to_callback().

This function is called once for each block of bytes that is "written" by gdk_pixbuf_save_to_callback().

If successful it should return TRUE; if an error occurs it should set error and return FALSE, in which case gdk_pixbuf_save_to_callback() will fail with the same error.

Since: 2.4

type PixbufSaveFunc_WithClosures Source #

Arguments

 = ByteString

buf: bytes to be written.

-> Ptr ()

data: user data passed to gdk_pixbuf_save_to_callback().

-> IO (Bool, GError)

Returns: TRUE if successful, FALSE otherwise

Save functions used by Pixbuf.save_to_callback().

This function is called once for each block of bytes that is "written" by gdk_pixbuf_save_to_callback().

If successful it should return TRUE; if an error occurs it should set error and return FALSE, in which case gdk_pixbuf_save_to_callback() will fail with the same error.

Since: 2.4

drop_closures_PixbufSaveFunc :: PixbufSaveFunc -> PixbufSaveFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_PixbufSaveFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PixbufSaveFunc 
-> ByteString

buf: bytes to be written.

-> Ptr ()

data: user data passed to gdk_pixbuf_save_to_callback().

-> m (Bool, GError)

Returns: TRUE if successful, FALSE otherwise

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_PixbufSaveFunc :: MonadIO m => PixbufSaveFunc -> m (GClosure C_PixbufSaveFunc) Source #

Wrap the callback into a GClosure.

mk_PixbufSaveFunc :: C_PixbufSaveFunc -> IO (FunPtr C_PixbufSaveFunc) Source #

Generate a function pointer callable from C code, from a C_PixbufSaveFunc.