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.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

newtype PixbufModule Source #

Memory-managed wrapper type.

Constructors

PixbufModule (ManagedPtr PixbufModule) 

Instances

Instances details
Eq PixbufModule Source # 
Instance details

Defined in GI.GdkPixbuf.Structs.PixbufModule

BoxedPtr PixbufModule Source # 
Instance details

Defined in GI.GdkPixbuf.Structs.PixbufModule

CallocPtr PixbufModule Source # 
Instance details

Defined in GI.GdkPixbuf.Structs.PixbufModule

ManagedPtrNewtype PixbufModule Source # 
Instance details

Defined in GI.GdkPixbuf.Structs.PixbufModule

Methods

toManagedPtr :: PixbufModule -> ManagedPtr PixbufModule

tag ~ 'AttrSet => Constructible PixbufModule tag Source # 
Instance details

Defined in GI.GdkPixbuf.Structs.PixbufModule

Methods

new :: MonadIO m => (ManagedPtr PixbufModule -> PixbufModule) -> [AttrOp PixbufModule tag] -> m PixbufModule

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

returns whether a save option key is supported by the module

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 PixbufModuleSaveOptionSupportedFunc) 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_PixbufModuleSaveOptionSupportedFunc -> m () Source #

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

set pixbufModule [ #isSaveOptionSupported := value ]

load

loads an image from a file.

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

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

clear #load

getPixbufModuleLoad :: MonadIO m => PixbufModule -> m (Maybe PixbufModuleLoadFunc) Source #

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

get pixbufModule #load

setPixbufModuleLoad :: MonadIO m => PixbufModule -> FunPtr C_PixbufModuleLoadFunc -> m () Source #

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

set pixbufModule [ #load := value ]

loadAnimation

loads an animation from a file.

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

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

clear #loadAnimation

getPixbufModuleLoadAnimation :: MonadIO m => PixbufModule -> m (Maybe PixbufModuleLoadAnimationFunc) Source #

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

get pixbufModule #loadAnimation

setPixbufModuleLoadAnimation :: MonadIO m => PixbufModule -> FunPtr C_PixbufModuleLoadAnimationFunc -> m () Source #

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

set pixbufModule [ #loadAnimation := value ]

loadIncrement

continues an incremental load.

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 PixbufModuleIncrementLoadFunc) 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_PixbufModuleIncrementLoadFunc -> m () Source #

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

set pixbufModule [ #loadIncrement := value ]

loadXpmData

loads an image from data in memory.

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

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

clear #loadXpmData

getPixbufModuleLoadXpmData :: MonadIO m => PixbufModule -> m (Maybe PixbufModuleLoadXpmDataFunc) Source #

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

get pixbufModule #loadXpmData

setPixbufModuleLoadXpmData :: MonadIO m => PixbufModule -> FunPtr C_PixbufModuleLoadXpmDataFunc -> m () Source #

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

set pixbufModule [ #loadXpmData := 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

saves a GdkPixbuf to a file.

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 PixbufModuleSaveFunc) 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_PixbufModuleSaveFunc -> m () Source #

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

set pixbufModule [ #save := value ]

stopLoad

stops an incremental load.

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 PixbufModuleStopLoadFunc) 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_PixbufModuleStopLoadFunc -> m () Source #

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

set pixbufModule [ #stopLoad := value ]