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

GI.GdkPixbuf.Structs.PixbufModule

Description

A GdkPixbufModule contains the necessary functions to load and save images in a certain file format.

If GdkPixbuf has been compiled with GModule support, it can be extended by modules which can load (and perhaps also save) new image and animation formats.

Implementing modules

The GdkPixbuf interfaces needed for implementing modules are contained in gdk-pixbuf-io.h (and gdk-pixbuf-animation.h if the module supports animations). They are not covered by the same stability guarantees as the regular GdkPixbuf API. To underline this fact, they are protected by the GDK_PIXBUF_ENABLE_BACKEND pre-processor symbol.

Each loadable module must contain a GdkPixbufModuleFillVtableFunc function named fill_vtable, which will get called when the module is loaded and must set the function pointers of the GdkPixbufModule.

In order to make format-checking work before actually loading the modules (which may require calling dlopen to load image libraries), modules export their signatures (and other information) via the fill_info function. An external utility, gdk-pixbuf-query-loaders, uses this to create a text file containing a list of all available loaders and their signatures. This file is then read at runtime by GdkPixbuf to obtain the list of available loaders and their signatures.

Modules may only implement a subset of the functionality available via GdkPixbufModule. If a particular functionality is not implemented, the fill_vtable function will simply not set the corresponding function pointers of the GdkPixbufModule structure. If a module supports incremental loading (i.e. provides begin_load, stop_load and load_increment), it doesn't have to implement load, since GdkPixbuf can supply a generic load implementation wrapping the incremental loading.

Installing modules

Installing a module is a two-step process:

  • copy the module file(s) to the loader directory (normally $libdir/gdk-pixbuf-2.0/$version/loaders, unless overridden by the environment variable GDK_PIXBUF_MODULEDIR)
  • call gdk-pixbuf-query-loaders to update the module file (normally $libdir/gdk-pixbuf-2.0/$version/loaders.cache, unless overridden by the environment variable GDK_PIXBUF_MODULE_FILE)
Synopsis

Exported types

newZeroPixbufModule :: MonadIO m => m PixbufModule Source #

Construct a PixbufModule struct initialized to zero.

Methods

Properties

info

a GdkPixbufFormat holding information about the module.

clearPixbufModuleInfo :: MonadIO m => PixbufModule -> m () Source #

Set the value of the “info” field to Nothing. When overloading is enabled, this is equivalent to

clear #info

getPixbufModuleInfo :: MonadIO m => PixbufModule -> m (Maybe PixbufFormat) Source #

Get the value of the “info” field. When overloading is enabled, this is equivalent to

get pixbufModule #info

setPixbufModuleInfo :: MonadIO m => PixbufModule -> Ptr PixbufFormat -> m () Source #

Set the value of the “info” field. When overloading is enabled, this is equivalent to

set pixbufModule [ #info := value ]

isSaveOptionSupported

No description available in the introspection data.

clearPixbufModuleIsSaveOptionSupported :: MonadIO m => PixbufModule -> m () Source #

Set the value of the “is_save_option_supported” field to Nothing. When overloading is enabled, this is equivalent to

clear #isSaveOptionSupported

getPixbufModuleIsSaveOptionSupported :: MonadIO m => PixbufModule -> m (Maybe PixbufModuleIsSaveOptionSupportedFieldCallback) Source #

Get the value of the “is_save_option_supported” field. When overloading is enabled, this is equivalent to

get pixbufModule #isSaveOptionSupported

setPixbufModuleIsSaveOptionSupported :: MonadIO m => PixbufModule -> FunPtr C_PixbufModuleIsSaveOptionSupportedFieldCallback -> m () Source #

Set the value of the “is_save_option_supported” field. When overloading is enabled, this is equivalent to

set pixbufModule [ #isSaveOptionSupported := value ]

loadIncrement

No description available in the introspection data.

clearPixbufModuleLoadIncrement :: MonadIO m => PixbufModule -> m () Source #

Set the value of the “load_increment” field to Nothing. When overloading is enabled, this is equivalent to

clear #loadIncrement

getPixbufModuleLoadIncrement :: MonadIO m => PixbufModule -> m (Maybe PixbufModuleLoadIncrementFieldCallback) Source #

Get the value of the “load_increment” field. When overloading is enabled, this is equivalent to

get pixbufModule #loadIncrement

setPixbufModuleLoadIncrement :: MonadIO m => PixbufModule -> FunPtr C_PixbufModuleLoadIncrementFieldCallback -> m () Source #

Set the value of the “load_increment” field. When overloading is enabled, this is equivalent to

set pixbufModule [ #loadIncrement := value ]

module

the loaded GModule.

clearPixbufModuleModule :: MonadIO m => PixbufModule -> m () Source #

Set the value of the “module” field to Nothing. When overloading is enabled, this is equivalent to

clear #module

getPixbufModuleModule :: MonadIO m => PixbufModule -> m (Maybe Module) Source #

Get the value of the “module” field. When overloading is enabled, this is equivalent to

get pixbufModule #module

setPixbufModuleModule :: MonadIO m => PixbufModule -> Ptr Module -> m () Source #

Set the value of the “module” field. When overloading is enabled, this is equivalent to

set pixbufModule [ #module := value ]

moduleName

the name of the module, usually the same as the usual file extension for images of this type, eg. "xpm", "jpeg" or "png".

clearPixbufModuleModuleName :: MonadIO m => PixbufModule -> m () Source #

Set the value of the “module_name” field to Nothing. When overloading is enabled, this is equivalent to

clear #moduleName

getPixbufModuleModuleName :: MonadIO m => PixbufModule -> m (Maybe Text) Source #

Get the value of the “module_name” field. When overloading is enabled, this is equivalent to

get pixbufModule #moduleName

setPixbufModuleModuleName :: MonadIO m => PixbufModule -> CString -> m () Source #

Set the value of the “module_name” field. When overloading is enabled, this is equivalent to

set pixbufModule [ #moduleName := value ]

modulePath

the path from which the module is loaded.

clearPixbufModuleModulePath :: MonadIO m => PixbufModule -> m () Source #

Set the value of the “module_path” field to Nothing. When overloading is enabled, this is equivalent to

clear #modulePath

getPixbufModuleModulePath :: MonadIO m => PixbufModule -> m (Maybe Text) Source #

Get the value of the “module_path” field. When overloading is enabled, this is equivalent to

get pixbufModule #modulePath

setPixbufModuleModulePath :: MonadIO m => PixbufModule -> CString -> m () Source #

Set the value of the “module_path” field. When overloading is enabled, this is equivalent to

set pixbufModule [ #modulePath := value ]

save

No description available in the introspection data.

clearPixbufModuleSave :: MonadIO m => PixbufModule -> m () Source #

Set the value of the “save” field to Nothing. When overloading is enabled, this is equivalent to

clear #save

getPixbufModuleSave :: MonadIO m => PixbufModule -> m (Maybe PixbufModuleSaveFieldCallback) Source #

Get the value of the “save” field. When overloading is enabled, this is equivalent to

get pixbufModule #save

setPixbufModuleSave :: MonadIO m => PixbufModule -> FunPtr C_PixbufModuleSaveFieldCallback -> m () Source #

Set the value of the “save” field. When overloading is enabled, this is equivalent to

set pixbufModule [ #save := value ]

stopLoad

No description available in the introspection data.

clearPixbufModuleStopLoad :: MonadIO m => PixbufModule -> m () Source #

Set the value of the “stop_load” field to Nothing. When overloading is enabled, this is equivalent to

clear #stopLoad

getPixbufModuleStopLoad :: MonadIO m => PixbufModule -> m (Maybe PixbufModuleStopLoadFieldCallback) Source #

Get the value of the “stop_load” field. When overloading is enabled, this is equivalent to

get pixbufModule #stopLoad

setPixbufModuleStopLoad :: MonadIO m => PixbufModule -> FunPtr C_PixbufModuleStopLoadFieldCallback -> m () Source #

Set the value of the “stop_load” field. When overloading is enabled, this is equivalent to

set pixbufModule [ #stopLoad := value ]