gdkpixbuf.types

D types for gdkpixbuf2 library

Types 19

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

Parameters

infoa #GdkPixbufFormat.

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

Parameters

module_a #GdkPixbufModule.
aliasPixbufModuleIncrementLoadFunc = bool delegate(void * context, ubyte[] buf, GError * * _err)

Incrementally loads a buffer into the image data.

Parameters

contextthe state object created by [gdkpixbuf.types.PixbufModuleBeginLoadFunc]
bufthe data to load

Returns

TRUE if the incremental load was successful

Throws

[ErrorWrap]

Loads a file from a standard C file stream into a new [gdkpixbuf.pixbuf_animation.PixbufAnimation].

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

Parameters

fthe file stream from which the image should be loaded

Returns

a newly created [gdkpixbuf.pixbuf_animation.PixbufAnimation] for the contents of the file

Throws

[ErrorWrap]
aliasPixbufModuleLoadFunc = gdkpixbuf.pixbuf.Pixbuf delegate(void * f, GError * * _err)

Loads a file from a standard C file stream into a new [gdkpixbuf.pixbuf.Pixbuf].

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

Parameters

fthe file stream from which the image should be loaded

Returns

a newly created [gdkpixbuf.pixbuf.Pixbuf] for the contents of the file

Throws

[ErrorWrap]

Loads XPM data into a new [gdkpixbuf.pixbuf.Pixbuf].

Parameters

datathe XPM data

Returns

a newly created [gdkpixbuf.pixbuf.Pixbuf] for the XPM data

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

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

Parameters

pixbufthe #GdkPixbuf that is currently being loaded.
animif an animation is being loaded, the #GdkPixbufAnimation, else null.
aliasPixbufModuleSaveFunc = bool delegate(void * f, gdkpixbuf.pixbuf.Pixbuf pixbuf, string[] paramKeys, string[] paramValues, GError * * _err)

Saves a [gdkpixbuf.pixbuf.Pixbuf] 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.

Parameters

fthe file stream into which the image should be saved
pixbufthe image to save
paramKeysparameter keys to save
paramValuesparameter values to save

Returns

TRUE on success; in case of failure, FALSE is returned and

the error is set

Throws

[ErrorWrap]
aliasPixbufModuleSaveOptionSupportedFunc = bool delegate(string optionKey)

Checks whether the given option_key is supported when saving.

Parameters

optionKeythe option key to check

Returns

TRUE if the option is supported
aliasPixbufModuleSizeFunc = void delegate(out int width, out int height)

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 [gdkpixbuf.pixbuf.Pixbuf.getFileInfo] efficiently.

Parameters

widthpointer to a location containing the current image width
heightpointer to a location containing the current image height
aliasPixbufModuleStopLoadFunc = bool delegate(void * context, GError * * _err)

Finalizes the image loading state.

This function is called on success and error states.

Parameters

contextthe state object created by [gdkpixbuf.types.PixbufModuleBeginLoadFunc]

Returns

TRUE if the loading operation was successful

Throws

[ErrorWrap]
aliasPixbufModuleUpdatedFunc = void delegate(gdkpixbuf.pixbuf.Pixbuf pixbuf, int x, int y, int width, int height)

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

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

Parameters

pixbufthe #GdkPixbuf that is currently being loaded.
xthe X origin of the updated area.
ythe Y origin of the updated area.
widththe width of the updated area.
heightthe height of the updated area.
aliasPixbufSaveFunc = bool delegate(ubyte[] buf, out glib.error.ErrorWrap error)

Save functions used by [gdkpixbuf.pixbuf.Pixbuf.saveToCallback].

This function is called once for each block of bytes that is "written" by [gdkpixbuf.pixbuf.Pixbuf.saveToCallback].

If successful it should return TRUE; if an error occurs it should set error and return FALSE, in which case [gdkpixbuf.pixbuf.Pixbuf.saveToCallback] will fail with the same error.

Parameters

bufbytes to be written.
errorA location to return an error.

Returns

TRUE if successful, FALSE otherwise

Variables 4

enumvarPIXBUF_MAJOR = 2

Major version of gdk-pixbuf library, that is the "0" in "0.8.2" for example.

enumvarPIXBUF_MICRO = 10

Micro version of gdk-pixbuf library, that is the "2" in "0.8.2" for example.

enumvarPIXBUF_MINOR = 42

Minor version of gdk-pixbuf library, that is the "8" in "0.8.2" for example.

enumvarPIXBUF_VERSION = "2.42.10"

Contains the full version of GdkPixbuf as a string.

This is the version being compiled against; contrast with gdk_pixbuf_version.