gdkpixbuf.PixbufFormat.PixbufFormat Class Reference

List of all members.

Detailed Description

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

Each loadable module must export a GdkPixbufModuleFillInfoFunc function named fill_info and a GdkPixbufModuleFillVtableFunc function named fill_vtable. In order to make format-checking work before actually loading the modules (which may require dlopening 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 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 gdk-pixbuf can supply a generic load implementation wrapping the incremental loading. Installing a module is a two-step process: copy the module file(s) to the loader directory (normally libdir/gtk-2.0/version/loaders, unless overridden by the environment variable GDK_PIXBUF_MODULEDIR) call gdk-pixbuf-query-loaders to update the module file (normally sysconfdir/gtk-2.0/gdk-pixbuf.loaders, unless overridden by the environment variable GDK_PIXBUF_MODULE_FILE) 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 ifdef GDK_PIXBUF_ENABLE_BACKEND.


Public Member Functions

GdkPixbufFormatgetPixbufFormatStruct ()
 this (GdkPixbufFormat *gdkPixbufFormat)
 Sets our main struct and passes it to the parent class.
char[] getName ()
 Returns the name of the format.
char[] getDescription ()
 Returns a description of the format.
char ** getMimeTypes ()
 Returns the mime types supported by the format.
char ** getExtensions ()
 Returns the filename extensions typically used for files in the given format.
int isWritable ()
 Returns whether pixbufs can be saved in the given format.
int isScalable ()
 Returns whether this image format is scalable.
int isDisabled ()
 Returns whether this image format is disabled.
void setDisabled (int disabled)
 Disables or enables an image format.
char[] getLicense ()
 Returns information about the license of the image loader for the format.

Static Public Member Functions

static int gdkPixbufSetOption (Pixbuf pixbuf, char[] key, char[] value)
 Attaches a key/value pair as an option to a GdkPixbuf.
static ListSG gdkPixbufGetFormats ()
 Obtains the available information about the image formats supported by GdkPixbuf.
static GdkPixbufFormatgetFileInfo (char[] filename, int *width, int *height)
 Parses an image file far enough to determine its format and size.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GdkPixbufFormatgdkPixbufFormat
 the main Gtk struct


Constructor & Destructor Documentation

gdkpixbuf.PixbufFormat.PixbufFormat.this ( GdkPixbufFormat gdkPixbufFormat  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

static ListSG gdkpixbuf.PixbufFormat.PixbufFormat.gdkPixbufGetFormats (  )  [static]

Obtains the available information about the image formats supported by GdkPixbuf.

Returns: A list of GdkPixbufFormats describing the supported image formats. The list should be freed when it is no longer needed, but the structures themselves are owned by GdkPixbuf and should not be freed. Since 2.2

static int gdkpixbuf.PixbufFormat.PixbufFormat.gdkPixbufSetOption ( Pixbuf  pixbuf,
char[]  key,
char[]  value 
) [static]

Attaches a key/value pair as an option to a GdkPixbuf.

If key already exists in the list of options attached to pixbuf, the new value is ignored and FALSE is returned. pixbuf: a GdkPixbuf key: a nul-terminated string. value: a nul-terminated string. Returns: TRUE on success. Since 2.2

char [] gdkpixbuf.PixbufFormat.PixbufFormat.getDescription (  ) 

Returns a description of the format.

format: a GdkPixbufFormat Returns: a description of the format. Since 2.2

char** gdkpixbuf.PixbufFormat.PixbufFormat.getExtensions (  ) 

Returns the filename extensions typically used for files in the given format.

format: a GdkPixbufFormat Returns: a NULL-terminated array of filename extensions which must be freed with g_strfreev() when it is no longer needed. Since 2.2

static GdkPixbufFormat* gdkpixbuf.PixbufFormat.PixbufFormat.getFileInfo ( char[]  filename,
int width,
int height 
) [static]

Parses an image file far enough to determine its format and size.

filename: The name of the file to identify. width: Return location for the width of the image, or NULL height: Return location for the height of the image, or NULL Returns: A GdkPixbufFormat describing the image format of the file or NULL if the image format wasn't recognized. The return value is owned by GdkPixbuf and should not be freed. Since 2.4 See Also GdkPixbufLoader.

char [] gdkpixbuf.PixbufFormat.PixbufFormat.getLicense (  ) 

Returns information about the license of the image loader for the format.

The returned string should be a shorthand for a wellknown license, e.g. "LGPL", "GPL", "QPL", "GPL/QPL", or "other" to indicate some other license. This string should be freed with g_free() when it's no longer needed. format: a GdkPixbufFormat Returns: a string describing the license of format. Since 2.6

char** gdkpixbuf.PixbufFormat.PixbufFormat.getMimeTypes (  ) 

Returns the mime types supported by the format.

format: a GdkPixbufFormat Returns: a NULL-terminated array of mime types which must be freed with g_strfreev() when it is no longer needed. Since 2.2

char [] gdkpixbuf.PixbufFormat.PixbufFormat.getName (  ) 

Returns the name of the format.

format: a GdkPixbufFormat Returns: the name of the format. Since 2.2

GdkPixbufFormat* gdkpixbuf.PixbufFormat.PixbufFormat.getPixbufFormatStruct (  ) 

void* gdkpixbuf.PixbufFormat.PixbufFormat.getStruct (  )  [protected]

the main Gtk struct as a void*

int gdkpixbuf.PixbufFormat.PixbufFormat.isDisabled (  ) 

Returns whether this image format is disabled.

See gdk_pixbuf_format_set_disabled(). format: a GdkPixbufFormat Returns: whether this image format is disabled. Since 2.6

int gdkpixbuf.PixbufFormat.PixbufFormat.isScalable (  ) 

Returns whether this image format is scalable.

If a file is in a scalable format, it is preferable to load it at the desired size, rather than loading it at the default size and scaling the resulting pixbuf to the desired size. format: a GdkPixbufFormat Returns: whether this image format is scalable. Since 2.6

int gdkpixbuf.PixbufFormat.PixbufFormat.isWritable (  ) 

Returns whether pixbufs can be saved in the given format.

format: a GdkPixbufFormat Returns: whether pixbufs can be saved in the given format. Since 2.2

void gdkpixbuf.PixbufFormat.PixbufFormat.setDisabled ( int  disabled  ) 

Disables or enables an image format.

If a format is disabled, gdk-pixbuf won't use the image loader for this format to load images. Applications can use this to avoid using image loaders with an inappropriate license, see gdk_pixbuf_format_get_license(). format: a GdkPixbufFormat disabled: TRUE to disable the format format Since 2.6


Member Data Documentation

GdkPixbufFormat* gdkpixbuf.PixbufFormat.PixbufFormat.gdkPixbufFormat [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo