Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# pixbuf-loader.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00023
    00024 #ifndef INTI_GDK_PIXBUF_LOADER_H
    00025 #define INTI_GDK_PIXBUF_LOADER_H
    00026
    00027 #ifndef INTI_G_OBJECT_H
    00028 #include <inti/glib/object.h>
    00029 #endif
    00030
    00031 #ifndef GDK_PIXBUF_H
    00032 #include <gdk-pixbuf/gdk-pixbuf.h>
    00033 #endif
    00034
    00035 #ifndef GDK_PIXBUF_LOADER_H
    00036 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
    00037 #endif
    00038
    00039 namespace Inti {
    00040
    00041 namespace G {
    00042 class Error;
    00043 }
    00044
    00045 namespace Gdk {
    00046
    00047 class Pixbuf;
    00048 class PixbufAnimation;
    00049 class PixbufFormat;
    00050 class PixbufLoaderClass;
    00051
    00083
    00084 class PixbufLoader : public G::Object
    00085 {
    00086         friend class G::Object;
    00087         friend class PixbufLoaderClass;
    00088
    00089         PixbufLoader(const PixbufLoader&);
    00090         PixbufLoader& operator=(const PixbufLoader&);
    00091
    00092 protected:
    00095
    00096         explicit PixbufLoader(GdkPixbufLoader *pixbuf_loader, bool reference = true);
    00103
    00107
    00108         void on_size_prepared(int width, int height);
    00116
    00117         void on_area_prepared();
    00121
    00122         void on_area_updated(int x, int y, int width, int height);
    00135
    00136         void on_closed();
    00140
    00142 //  Signals
    00143
    00144         typedef G::Signal2<void, int, int> SizePreparedSignalType;
    00145         typedef G::SignalProxy<TypeInstance, SizePreparedSignalType> SizePreparedSignalProxy;
    00146         static const SizePreparedSignalType size_prepared_signal;
    00147
    00148         typedef G::Signal0<void> AreaPreparedSignalType;
    00149         typedef G::SignalProxy<TypeInstance, AreaPreparedSignalType> AreaPreparedSignalProxy;
    00150         static const AreaPreparedSignalType area_prepared_signal;
    00151
    00152         typedef G::Signal4<void, int, int, int, int> AreaUpdatedSignalType;
    00153         typedef G::SignalProxy<TypeInstance, AreaUpdatedSignalType> AreaUpdatedSignalProxy;
    00154         static const AreaUpdatedSignalType area_updated_signal;
    00155
    00156         typedef G::Signal0<void> ClosedSignalType;
    00157         typedef G::SignalProxy<TypeInstance, ClosedSignalType> ClosedSignalProxy;
    00158         static const ClosedSignalType closed_signal;
    00159
    00160 public:
    00163
    00164         PixbufLoader();
    00166
    00167         PixbufLoader(const char *image_type, G::Error *error = 0);
    00179
    00180         virtual ~PixbufLoader();
    00182
    00186
    00187         GdkPixbufLoader* gdk_pixbuf_loader() const { return (GdkPixbufLoader*)instance; }
    00189
    00190         GdkPixbufLoaderClass* gdk_pixbuf_loader_class() const;
    00192
    00193         operator GdkPixbufLoader* () const;
    00195
    00196         Pointer<Pixbuf> get_pixbuf() const;
    00209
    00210         Pointer<PixbufAnimation> get_animation() const;
    00219
    00220         Pointer<PixbufFormat> get_format() const;
    00223
    00227
    00228         void set_size(int width, int height);
    00237
    00238         bool write(const unsigned char *buffer, size_t count, G::Error *error);
    00247
    00248         bool close(G::Error *error = 0);
    00261
    00265
    00266         const SizePreparedSignalProxy sig_size_prepared()
    00267         {
    00268                 return SizePreparedSignalProxy(this, &size_prepared_signal);
    00269         }
    00273
    00274         const AreaPreparedSignalProxy sig_area_prepared()
    00275         {
    00276                 return AreaPreparedSignalProxy(this, &area_prepared_signal);
    00277         }
    00280
    00281         const AreaUpdatedSignalProxy sig_area_updated()
    00282         {
    00283                 return AreaUpdatedSignalProxy(this, &area_updated_signal);
    00284         }
    00287
    00288         const ClosedSignalProxy sig_closed()
    00289         {
    00290                 return ClosedSignalProxy(this, &closed_signal);
    00291         }
    00293
    00295 };
    00296
    00297 } // namespace Gdk
    00298
    00299 } // namespace Inti
    00300
    00301 #endif // INTI_GDK_PIXBUF_LOADER_H
    00302

Main Page - Footer