class GdkPixbuf::PixbufModule
- GdkPixbuf::PixbufModule
- Reference
- Object
Overview
A Gdk::PixbufModule
contains the necessary functions to load and save
images in a certain file format.
If Gdk::Pixbuf
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 Gdk::Pixbuf
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 Gdk::Pixbuf API. To underline this fact, they are protected by the
GDK_PIXBUF_ENABLE_BACKEND
pre-processor symbol.
Each loadable module must contain a Gdk::PixbufModuleFillVtableFunc
function
named fill_vtable
, which will get called when the module
is loaded and must set the function pointers of the Gdk::PixbufModule
.
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 Gdk::Pixbuf
to obtain the list of
available loaders and their signatures.
Modules may only implement a subset of the functionality available via
Gdk::PixbufModule
. If a particular functionality is not implemented, the
fill_vtable
function will simply not set the corresponding
function pointers of the Gdk::PixbufModule
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 Gdk::Pixbuf
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 variableGDK_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 variableGDK_PIXBUF_MODULE_FILE
)
Defined in:
lib/gi-crystal/src/auto/gdk_pixbuf-2.0/pixbuf_module.crConstructors
- .new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
- .new(data : LibGdkPixbuf::PixbufModule, transfer : GICrystal::Transfer)
- .new(load : GdkPixbuf::PixbufModuleLoadFunc | Nil = nil, load_xpm_data : GdkPixbuf::PixbufModuleLoadXpmDataFunc | Nil = nil, stop_load : GdkPixbuf::PixbufModuleStopLoadFunc | Nil = nil, load_increment : GdkPixbuf::PixbufModuleIncrementLoadFunc | Nil = nil, load_animation : GdkPixbuf::PixbufModuleLoadAnimationFunc | Nil = nil, save : GdkPixbuf::PixbufModuleSaveFunc | Nil = nil, is_save_option_supported : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc | Nil = nil)
Instance Method Summary
-
#==(other : self) : Bool
Returns
true
if this reference is the same as other. - #_reserved1 : Pointer(Void) | Nil
- #_reserved1!
- #_reserved2 : Pointer(Void) | Nil
- #_reserved2!
- #_reserved3 : Pointer(Void) | Nil
- #_reserved3!
- #_reserved4 : Pointer(Void) | Nil
- #_reserved4!
- #begin_load : Pointer(Void) | Nil
- #begin_load!
- #info : GdkPixbuf::PixbufFormat | Nil
- #info!
- #is_save_option_supported : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc
- #is_save_option_supported=(value : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc)
- #load : GdkPixbuf::PixbufModuleLoadFunc
- #load=(value : GdkPixbuf::PixbufModuleLoadFunc)
- #load_animation : GdkPixbuf::PixbufModuleLoadAnimationFunc
- #load_animation=(value : GdkPixbuf::PixbufModuleLoadAnimationFunc)
- #load_increment : GdkPixbuf::PixbufModuleIncrementLoadFunc
- #load_increment=(value : GdkPixbuf::PixbufModuleIncrementLoadFunc)
- #load_xpm_data : GdkPixbuf::PixbufModuleLoadXpmDataFunc
- #load_xpm_data=(value : GdkPixbuf::PixbufModuleLoadXpmDataFunc)
- #module : GModule::Module | Nil
- #module!
- #module_name : String | Nil
- #module_name!
- #module_path : String | Nil
- #module_path!
- #save : GdkPixbuf::PixbufModuleSaveFunc
- #save=(value : GdkPixbuf::PixbufModuleSaveFunc)
- #save_to_callback : Pointer(Void) | Nil
- #save_to_callback!
- #stop_load : GdkPixbuf::PixbufModuleStopLoadFunc
- #stop_load=(value : GdkPixbuf::PixbufModuleStopLoadFunc)
- #to_unsafe
Constructor Detail
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.