Class PixbufModule

java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gdkpixbuf.PixbufModule
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class PixbufModule extends ProxyInstance

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)
  • Constructor Details

  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readModuleName

      public String readModuleName()
      Read the value of the field module_name.
      Returns:
      The value of the field module_name
    • writeModuleName

      public void writeModuleName(String moduleName, Arena _arena)
      Write a value in the field module_name.
      Parameters:
      moduleName - The new value for the field module_name
      _arena - to control the memory allocation scope
    • readModulePath

      public String readModulePath()
      Read the value of the field module_path.
      Returns:
      The value of the field module_path
    • writeModulePath

      public void writeModulePath(String modulePath, Arena _arena)
      Write a value in the field module_path.
      Parameters:
      modulePath - The new value for the field module_path
      _arena - to control the memory allocation scope
    • readInfo

      public PixbufFormat readInfo()
      Read the value of the field info.
      Returns:
      The value of the field info
    • writeInfo

      public void writeInfo(PixbufFormat info)
      Write a value in the field info.
      Parameters:
      info - The new value for the field info
    • readLoad

      public @Nullable PixbufModuleLoadFunc readLoad()
      Read the value of the field load.
      Returns:
      The value of the field load
    • writeLoad

      public void writeLoad(@Nullable PixbufModuleLoadFunc load, Arena _arena)
      Write a value in the field load.
      Parameters:
      load - The new value for the field load
      _arena - to control the memory allocation scope
    • readLoadXpmData

      public @Nullable PixbufModuleLoadXpmDataFunc readLoadXpmData()
      Read the value of the field load_xpm_data.
      Returns:
      The value of the field load_xpm_data
    • writeLoadXpmData

      public void writeLoadXpmData(@Nullable PixbufModuleLoadXpmDataFunc loadXpmData, Arena _arena)
      Write a value in the field load_xpm_data.
      Parameters:
      loadXpmData - The new value for the field load_xpm_data
      _arena - to control the memory allocation scope
    • readBeginLoad

      public @Nullable PixbufModuleBeginLoadFunc readBeginLoad()
      Read the value of the field begin_load.
      Returns:
      The value of the field begin_load
    • writeBeginLoad

      public void writeBeginLoad(@Nullable PixbufModuleBeginLoadFunc beginLoad, Arena _arena)
      Write a value in the field begin_load.
      Parameters:
      beginLoad - The new value for the field begin_load
      _arena - to control the memory allocation scope
    • readStopLoad

      public @Nullable PixbufModuleStopLoadFunc readStopLoad()
      Read the value of the field stop_load.
      Returns:
      The value of the field stop_load
    • writeStopLoad

      public void writeStopLoad(@Nullable PixbufModuleStopLoadFunc stopLoad, Arena _arena)
      Write a value in the field stop_load.
      Parameters:
      stopLoad - The new value for the field stop_load
      _arena - to control the memory allocation scope
    • readLoadIncrement

      public @Nullable PixbufModuleIncrementLoadFunc readLoadIncrement()
      Read the value of the field load_increment.
      Returns:
      The value of the field load_increment
    • writeLoadIncrement

      public void writeLoadIncrement(@Nullable PixbufModuleIncrementLoadFunc loadIncrement, Arena _arena)
      Write a value in the field load_increment.
      Parameters:
      loadIncrement - The new value for the field load_increment
      _arena - to control the memory allocation scope
    • readLoadAnimation

      public @Nullable PixbufModuleLoadAnimationFunc readLoadAnimation()
      Read the value of the field load_animation.
      Returns:
      The value of the field load_animation
    • writeLoadAnimation

      public void writeLoadAnimation(@Nullable PixbufModuleLoadAnimationFunc loadAnimation, Arena _arena)
      Write a value in the field load_animation.
      Parameters:
      loadAnimation - The new value for the field load_animation
      _arena - to control the memory allocation scope
    • readSave

      public @Nullable PixbufModuleSaveFunc readSave()
      Read the value of the field save.
      Returns:
      The value of the field save
    • writeSave

      public void writeSave(@Nullable PixbufModuleSaveFunc save, Arena _arena)
      Write a value in the field save.
      Parameters:
      save - The new value for the field save
      _arena - to control the memory allocation scope
    • readSaveToCallback

      public @Nullable PixbufModuleSaveCallbackFunc readSaveToCallback()
      Read the value of the field save_to_callback.
      Returns:
      The value of the field save_to_callback
    • writeSaveToCallback

      public void writeSaveToCallback(@Nullable PixbufModuleSaveCallbackFunc saveToCallback, Arena _arena)
      Write a value in the field save_to_callback.
      Parameters:
      saveToCallback - The new value for the field save_to_callback
      _arena - to control the memory allocation scope
    • readIsSaveOptionSupported

      public @Nullable PixbufModuleSaveOptionSupportedFunc readIsSaveOptionSupported()
      Read the value of the field is_save_option_supported.
      Returns:
      The value of the field is_save_option_supported
    • writeIsSaveOptionSupported

      public void writeIsSaveOptionSupported(@Nullable PixbufModuleSaveOptionSupportedFunc isSaveOptionSupported, Arena _arena)
      Write a value in the field is_save_option_supported.
      Parameters:
      isSaveOptionSupported - The new value for the field is_save_option_supported
      _arena - to control the memory allocation scope