GdkPixbufLoader

Name

GdkPixbufLoader — Application-driven image loading.

Synopsis


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


#define     GDK_PIXBUF_LOADER               (obj)
GdkPixbufLoader* gdk_pixbuf_loader_new      (void);
gboolean    gdk_pixbuf_loader_write         (GdkPixbufLoader *loader,
                                             const gchar *buf,
                                             size_t count);
GdkPixbuf*  gdk_pixbuf_loader_get_pixbuf    (GdkPixbufLoader *loader);
void        gdk_pixbuf_loader_close         (GdkPixbufLoader *loader);


Object Hierarchy


  GtkObject
   +----GdkPixbufLoader

Signal Prototypes


"area-updated"
            void        user_function      (GdkPixbufLoader *gdkpixbufloader,
                                            gint arg1,
                                            gint arg2,
                                            gint arg3,
                                            gint arg4,
                                            gpointer user_data);
"area-prepared"
            void        user_function      (GdkPixbufLoader *gdkpixbufloader,
                                            gpointer user_data);
"closed"    void        user_function      (GdkPixbufLoader *gdkpixbufloader,
                                            gpointer user_data);

Description

GdkPIxbufLoader provides a way for applications to drive the process of loading an image.

Details

GDK_PIXBUF_LOADER()

#define GDK_PIXBUF_LOADER(obj)		   (GTK_CHECK_CAST ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoader))

obj : 


gdk_pixbuf_loader_new ()

GdkPixbufLoader* gdk_pixbuf_loader_new      (void);

Creates a new pixbuf loader object.

Returns : A newly-created pixbuf loader.


gdk_pixbuf_loader_write ()

gboolean    gdk_pixbuf_loader_write         (GdkPixbufLoader *loader,
                                             const gchar *buf,
                                             size_t count);

This will load the next size bytes of the image. It will return TRUE if the data was loaded successfully, and FALSE if an error occurred. In this case, the loader will be closed, and will not accept further writes.

loader : A pixbuf loader.
buf : The image data.
count : The length of buf in bytes.
Returns : Returns TRUE if the write was successful -- FALSE if the loader cannot parse the buf.


gdk_pixbuf_loader_get_pixbuf ()

GdkPixbuf*  gdk_pixbuf_loader_get_pixbuf    (GdkPixbufLoader *loader);

Gets the GdkPixbuf that the loader is currently loading. If the loader hasn't been enough data via gdk_pixbuf_loader_write, then NULL is returned. Any application using this function should check for this value when it is used. The pixbuf returned will be the same in all future calls to the loader, so simply calling a gdk_pixbuf_ref() should be sufficient to continue using it.

loader : A pixbuf loader.
Returns : The GdkPixbuf that the loader is loading.


gdk_pixbuf_loader_close ()

void        gdk_pixbuf_loader_close         (GdkPixbufLoader *loader);

Tells the loader to stop accepting writes.

loader : A pixbuf loader.

Signals

The "area-updated" signal

void        user_function                  (GdkPixbufLoader *gdkpixbufloader,
                                            gint arg1,
                                            gint arg2,
                                            gint arg3,
                                            gint arg4,
                                            gpointer user_data);

gdkpixbufloader :the object which received the signal.
arg1 : 
arg2 : 
arg3 : 
arg4 : 
user_data :user data set when the signal handler was connected.


The "area-prepared" signal

void        user_function                  (GdkPixbufLoader *gdkpixbufloader,
                                            gpointer user_data);

gdkpixbufloader :the object which received the signal.
user_data :user data set when the signal handler was connected.


The "closed" signal

void        user_function                  (GdkPixbufLoader *gdkpixbufloader,
                                            gpointer user_data);

gdkpixbufloader :the object which received the signal.
user_data :user data set when the signal handler was connected.