Module Interface

Module Interface

Synopsis

#include <gdk-pixbuf/gdk-pixbuf.h>

gboolean            gdk_pixbuf_set_option               (GdkPixbuf *pixbuf,
                                                         const gchar *key,
                                                         const gchar *value);
GSList *            gdk_pixbuf_get_formats              (void);
GdkPixbufFormat *   gdk_pixbuf_format_copy              (const GdkPixbufFormat *format);
void                gdk_pixbuf_format_free              (GdkPixbufFormat *format);
gchar *             gdk_pixbuf_format_get_name          (GdkPixbufFormat *format);
gchar *             gdk_pixbuf_format_get_description   (GdkPixbufFormat *format);
gchar **            gdk_pixbuf_format_get_mime_types    (GdkPixbufFormat *format);
gchar **            gdk_pixbuf_format_get_extensions    (GdkPixbufFormat *format);
gboolean            gdk_pixbuf_format_is_writable       (GdkPixbufFormat *format);
gboolean            gdk_pixbuf_format_is_scalable       (GdkPixbufFormat *format);
gboolean            gdk_pixbuf_format_is_disabled       (GdkPixbufFormat *format);
void                gdk_pixbuf_format_set_disabled      (GdkPixbufFormat *format,
                                                         gboolean disabled);
gchar *             gdk_pixbuf_format_get_license       (GdkPixbufFormat *format);
                    GdkPixbufFormat;
enum                GdkPixbufFormatFlags;
                    GdkPixbufModulePattern;
void                (*GdkPixbufModuleFillVtableFunc)    (GdkPixbufModule *module);
void                (*GdkPixbufModuleFillInfoFunc)      (GdkPixbufFormat *info);
void                (*GdkPixbufModuleSizeFunc)          (gint *width,
                                                         gint *height,
                                                         gpointer user_data);
void                (*GdkPixbufModulePreparedFunc)      (GdkPixbuf *pixbuf,
                                                         GdkPixbufAnimation *anim,
                                                         gpointer user_data);
void                (*GdkPixbufModuleUpdatedFunc)       (GdkPixbuf *pixbuf,
                                                         int x,
                                                         int y,
                                                         int width,
                                                         int height,
                                                         gpointer user_data);
                    GdkPixbufModule;

                    GdkPixbufAnimationClass;
                    GdkPixbufAnimationIterClass;

Description

Details

gdk_pixbuf_set_option ()

gboolean            gdk_pixbuf_set_option               (GdkPixbuf *pixbuf,
                                                         const gchar *key,
                                                         const gchar *value);

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


gdk_pixbuf_get_formats ()

GSList *            gdk_pixbuf_get_formats              (void);

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. [transfer container]

Since 2.2


gdk_pixbuf_format_copy ()

GdkPixbufFormat *   gdk_pixbuf_format_copy              (const GdkPixbufFormat *format);

Creates a copy of format

format :

a GdkPixbufFormat

Returns :

the newly allocated copy of a GdkPixbufFormat. Use gdk_pixbuf_format_free() to free the resources when done

Since 2.22


gdk_pixbuf_format_free ()

void                gdk_pixbuf_format_free              (GdkPixbufFormat *format);

Frees the resources allocated when copying a GdkPixbufFormat using gdk_pixbuf_format_copy()

format :

a GdkPixbufFormat

Since 2.22


gdk_pixbuf_format_get_name ()

gchar *             gdk_pixbuf_format_get_name          (GdkPixbufFormat *format);

Returns the name of the format.

format :

a GdkPixbufFormat

Returns :

the name of the format.

Since 2.2


gdk_pixbuf_format_get_description ()

gchar *             gdk_pixbuf_format_get_description   (GdkPixbufFormat *format);

Returns a description of the format.

format :

a GdkPixbufFormat

Returns :

a description of the format.

Since 2.2


gdk_pixbuf_format_get_mime_types ()

gchar **            gdk_pixbuf_format_get_mime_types    (GdkPixbufFormat *format);

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. [transfer full]

Since 2.2


gdk_pixbuf_format_get_extensions ()

gchar **            gdk_pixbuf_format_get_extensions    (GdkPixbufFormat *format);

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. [transfer full]

Since 2.2


gdk_pixbuf_format_is_writable ()

gboolean            gdk_pixbuf_format_is_writable       (GdkPixbufFormat *format);

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


gdk_pixbuf_format_is_scalable ()

gboolean            gdk_pixbuf_format_is_scalable       (GdkPixbufFormat *format);

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


gdk_pixbuf_format_is_disabled ()

gboolean            gdk_pixbuf_format_is_disabled       (GdkPixbufFormat *format);

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


gdk_pixbuf_format_set_disabled ()

void                gdk_pixbuf_format_set_disabled      (GdkPixbufFormat *format,
                                                         gboolean 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


gdk_pixbuf_format_get_license ()

gchar *             gdk_pixbuf_format_get_license       (GdkPixbufFormat *format);

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


GdkPixbufFormat

typedef struct {
  gchar *name;
  GdkPixbufModulePattern *signature;
  gchar *domain;
  gchar *description;
  gchar **mime_types;
  gchar **extensions;
  guint32 flags;
  gboolean disabled;
  gchar *license;
} GdkPixbufFormat;


enum GdkPixbufFormatFlags

typedef enum /*< skip >*/
{
  GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0,
  GDK_PIXBUF_FORMAT_SCALABLE = 1 << 1,
  GDK_PIXBUF_FORMAT_THREADSAFE = 1 << 2
} GdkPixbufFormatFlags;


GdkPixbufModulePattern

typedef struct {
	char *prefix;
	char *mask;
	int relevance;
} GdkPixbufModulePattern;


GdkPixbufModuleFillVtableFunc ()

void                (*GdkPixbufModuleFillVtableFunc)    (GdkPixbufModule *module);

module :


GdkPixbufModuleFillInfoFunc ()

void                (*GdkPixbufModuleFillInfoFunc)      (GdkPixbufFormat *info);

info :


GdkPixbufModuleSizeFunc ()

void                (*GdkPixbufModuleSizeFunc)          (gint *width,
                                                         gint *height,
                                                         gpointer user_data);

width :

height :

user_data :


GdkPixbufModulePreparedFunc ()

void                (*GdkPixbufModulePreparedFunc)      (GdkPixbuf *pixbuf,
                                                         GdkPixbufAnimation *anim,
                                                         gpointer user_data);

pixbuf :

anim :

user_data :


GdkPixbufModuleUpdatedFunc ()

void                (*GdkPixbufModuleUpdatedFunc)       (GdkPixbuf *pixbuf,
                                                         int x,
                                                         int y,
                                                         int width,
                                                         int height,
                                                         gpointer user_data);

pixbuf :

x :

y :

width :

height :

user_data :


GdkPixbufModule

typedef struct {
	char *module_name;
	char *module_path;
	GModule *module;
	GdkPixbufFormat *info;
	
        GdkPixbuf *(* load) (FILE    *f,
                             GError **error);
        GdkPixbuf *(* load_xpm_data) (const char **data);

        /* Incremental loading */

        gpointer (* begin_load)     (GdkPixbufModuleSizeFunc size_func,
                                     GdkPixbufModulePreparedFunc prepare_func,
                                     GdkPixbufModuleUpdatedFunc update_func,
                                     gpointer user_data,
                                     GError **error);
        gboolean (* stop_load)      (gpointer context,
                                     GError **error);
        gboolean (* load_increment) (gpointer      context,
                                     const guchar *buf,
                                     guint         size,
                                     GError      **error);

	/* Animation loading */
	GdkPixbufAnimation *(* load_animation) (FILE    *f,
                                                GError **error);

        /* Saving */
        gboolean (* save) (FILE      *f,
                           GdkPixbuf *pixbuf,
                           gchar    **param_keys,
                           gchar    **param_values,
                           GError   **error);

        gboolean (*save_to_callback) (GdkPixbufSaveFunc save_func,
				      gpointer user_data,
				      GdkPixbuf *pixbuf,
				      gchar **option_keys,
				      gchar **option_values,
				      GError **error);
} GdkPixbufModule;


GdkPixbufAnimationClass

typedef struct {
        GObjectClass parent_class;


        gboolean                (*is_static_image)  (GdkPixbufAnimation *anim);

        GdkPixbuf*              (*get_static_image) (GdkPixbufAnimation *anim);
        
        void                    (*get_size) (GdkPixbufAnimation *anim,
                                             int                 *width,
                                             int                 *height);
        
        GdkPixbufAnimationIter* (*get_iter) (GdkPixbufAnimation *anim,
                                             const GTimeVal     *start_time);
} GdkPixbufAnimationClass;


GdkPixbufAnimationIterClass

typedef struct {
        GObjectClass parent_class;


        int        (*get_delay_time)   (GdkPixbufAnimationIter *iter);

        GdkPixbuf* (*get_pixbuf)       (GdkPixbufAnimationIter *iter);

        gboolean   (*on_currently_loading_frame) (GdkPixbufAnimationIter *iter);

        gboolean   (*advance)          (GdkPixbufAnimationIter *iter,
                                        const GTimeVal         *current_time);
} GdkPixbufAnimationIterClass;