Callbacks¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- GdkPixbuf.PixbufDestroyNotify(pixels, *data)¶
- Parameters:
A function of this type is responsible for freeing the pixel array of a pixbuf.
The
GdkPixbuf.Pixbuf.new_from_data() function lets you pass in a pre-allocated pixel array so that a pixbuf can be created from it; in this case you will need to pass in a function of typeGdkPixbufDestroyNotifyso that the pixel data can be freed when the pixbuf is finalized.
- GdkPixbuf.PixbufModuleFillInfoFunc(info)¶
- Parameters:
info (
GdkPixbuf.PixbufFormat) – aGdkPixbuf.PixbufFormat.
Defines the type of the function used to fill a
GdkPixbuf.PixbufFormatstructure with information about a module.New in version 2.2.
- GdkPixbuf.PixbufModuleFillVtableFunc(module)¶
- Parameters:
module (
GdkPixbuf.PixbufModule) – aGdkPixbuf.PixbufModule.
Defines the type of the function used to set the vtable of a
GdkPixbuf.PixbufModulewhen it is loaded.New in version 2.2.
- GdkPixbuf.PixbufModuleIncrementLoadFunc(context, buf)¶
- Parameters:
- Returns:
TRUEif the incremental load was successful- Return type:
Incrementally loads a buffer into the image data.
- GdkPixbuf.PixbufModuleLoadAnimationFunc(f)¶
- Parameters:
f (
objectorNone) – the file stream from which the image should be loaded- Returns:
a newly created
GdkPixbufAnimationfor the contents of the file- Return type:
Loads a file from a standard C file stream into a new
GdkPixbufAnimation.In case of error, this function should return
NULLand set theerrorargument.
- GdkPixbuf.PixbufModuleLoadFunc(f)¶
- Parameters:
f (
objectorNone) – the file stream from which the image should be loaded- Returns:
a newly created
GdkPixbuffor the contents of the file- Return type:
Loads a file from a standard C file stream into a new
GdkPixbuf.In case of error, this function should return
NULLand set theerrorargument.
- GdkPixbuf.PixbufModuleLoadXpmDataFunc(data)¶
- Parameters:
data ([
str]) – the XPM data- Returns:
a newly created
GdkPixbuffor the XPM data- Return type:
Loads XPM data into a new
GdkPixbuf.
- GdkPixbuf.PixbufModulePreparedFunc(pixbuf, anim, *user_data)¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf) – theGdkPixbuf.Pixbufthat is currently being loaded.anim (
GdkPixbuf.PixbufAnimation) – if an animation is being loaded, theGdkPixbuf.PixbufAnimation, elseNone.
Defines the type of the function that gets called once the initial setup of pixbuf is done.
GdkPixbuf.PixbufLoaderuses a function of this type to emit the “‘area_prepared [GdkPixbufLoader-area-prepared]’” signal.New in version 2.2.
- GdkPixbuf.PixbufModuleSaveFunc(f, pixbuf, param_keys, param_values)¶
- Parameters:
- Returns:
TRUEon success; in case of failure,FALSEis returned and theerroris set- Return type:
Saves a
GdkPixbufinto a standard C file stream.The optional
param_keysandparam_valuesarrays contain the keys and values (in the same order) for attributes to be saved alongside the image data.
- GdkPixbuf.PixbufModuleSaveOptionSupportedFunc(option_key)¶
- Parameters:
option_key (
str) – the option key to check- Returns:
TRUEif the option is supported- Return type:
Checks whether the given
option_keyis supported when saving.
- GdkPixbuf.PixbufModuleSizeFunc(width, height, *user_data)¶
- Parameters:
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.get_file_info() efficiently.New in version 2.2.
- GdkPixbuf.PixbufModuleStopLoadFunc(context)¶
- Parameters:
context (
objectorNone) – the state object created by [callback`GdkPixbuf`.PixbufModuleBeginLoadFunc]- Returns:
TRUEif the loading operation was successful- Return type:
Finalizes the image loading state.
This function is called on success and error states.
- GdkPixbuf.PixbufModuleUpdatedFunc(pixbuf, x, y, width, height, *user_data)¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf) – theGdkPixbuf.Pixbufthat is currently being loaded.x (
int) – the X origin of the updated area.y (
int) – the Y origin of the updated area.width (
int) – the width of the updated area.height (
int) – the height of the updated area.
Defines the type of the function that gets called every time a region of pixbuf is updated.
GdkPixbuf.PixbufLoaderuses a function of this type to emit the “‘area_updated [GdkPixbufLoader-area-updated]’” signal.New in version 2.2.
- GdkPixbuf.PixbufSaveFunc(buf, *data)¶
- Parameters:
- Returns:
TRUEif successful,FALSEotherwise- error:
A location to return an error.
- Return type:
(
bool, error:GLib.Error)
Save functions used by [method`GdkPixbuf`.Pixbuf.save_to_callback].
This function is called once for each block of bytes that is “written” by
gdk_pixbuf_save_to_callback().If successful it should return
TRUE; if an error occurs it should seterrorand returnFALSE, in which casegdk_pixbuf_save_to_callback()will fail with the same error.New in version 2.4.