gdk-pixbuf-loader.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* GdkPixbuf library - Progressive loader object
  2. *
  3. * Copyright (C) 1999 The Free Software Foundation
  4. *
  5. * Authors: Mark Crichton <crichton@gimp.org>
  6. * Miguel de Icaza <miguel@gnu.org>
  7. * Federico Mena-Quintero <federico@gimp.org>
  8. * Jonathan Blandford <jrb@redhat.com>
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2 of the License, or (at your option) any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  22. */
  23. #ifndef GDK_PIXBUF_LOADER_H
  24. #define GDK_PIXBUF_LOADER_H
  25. #if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION)
  26. #error "Only <gdk-pixbuf/gdk-pixbuf.h> can be included directly."
  27. #endif
  28. #include <glib.h>
  29. #include <glib-object.h>
  30. #include <gdk-pixbuf/gdk-pixbuf-core.h>
  31. #include <gdk-pixbuf/gdk-pixbuf-animation.h>
  32. #include <gdk-pixbuf/gdk-pixbuf-io.h>
  33. G_BEGIN_DECLS
  34. #define GDK_TYPE_PIXBUF_LOADER (gdk_pixbuf_loader_get_type ())
  35. #define GDK_PIXBUF_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoader))
  36. #define GDK_PIXBUF_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoaderClass))
  37. #define GDK_IS_PIXBUF_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_PIXBUF_LOADER))
  38. #define GDK_IS_PIXBUF_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_LOADER))
  39. #define GDK_PIXBUF_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoaderClass))
  40. typedef struct _GdkPixbufLoader GdkPixbufLoader;
  41. struct _GdkPixbufLoader
  42. {
  43. /*< private >*/
  44. GObject parent_instance;
  45. gpointer priv;
  46. };
  47. typedef struct _GdkPixbufLoaderClass GdkPixbufLoaderClass;
  48. struct _GdkPixbufLoaderClass
  49. {
  50. GObjectClass parent_class;
  51. void (*size_prepared) (GdkPixbufLoader *loader,
  52. int width,
  53. int height);
  54. void (*area_prepared) (GdkPixbufLoader *loader);
  55. /* Last known frame needs a redraw for x, y, width, height */
  56. void (*area_updated) (GdkPixbufLoader *loader,
  57. int x,
  58. int y,
  59. int width,
  60. int height);
  61. void (*closed) (GdkPixbufLoader *loader);
  62. };
  63. GDK_PIXBUF_AVAILABLE_IN_ALL
  64. GType gdk_pixbuf_loader_get_type (void) G_GNUC_CONST;
  65. GDK_PIXBUF_AVAILABLE_IN_ALL
  66. GdkPixbufLoader * gdk_pixbuf_loader_new (void);
  67. GDK_PIXBUF_AVAILABLE_IN_ALL
  68. GdkPixbufLoader * gdk_pixbuf_loader_new_with_type (const char *image_type,
  69. GError **error);
  70. GDK_PIXBUF_AVAILABLE_IN_2_4
  71. GdkPixbufLoader * gdk_pixbuf_loader_new_with_mime_type (const char *mime_type,
  72. GError **error);
  73. GDK_PIXBUF_AVAILABLE_IN_2_2
  74. void gdk_pixbuf_loader_set_size (GdkPixbufLoader *loader,
  75. int width,
  76. int height);
  77. GDK_PIXBUF_AVAILABLE_IN_ALL
  78. gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
  79. const guchar *buf,
  80. gsize count,
  81. GError **error);
  82. GDK_PIXBUF_AVAILABLE_IN_2_30
  83. gboolean gdk_pixbuf_loader_write_bytes (GdkPixbufLoader *loader,
  84. GBytes *buffer,
  85. GError **error);
  86. GDK_PIXBUF_AVAILABLE_IN_ALL
  87. GdkPixbuf * gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader);
  88. GDK_PIXBUF_AVAILABLE_IN_ALL
  89. GdkPixbufAnimation * gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader);
  90. GDK_PIXBUF_AVAILABLE_IN_ALL
  91. gboolean gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
  92. GError **error);
  93. GDK_PIXBUF_AVAILABLE_IN_2_2
  94. GdkPixbufFormat *gdk_pixbuf_loader_get_format (GdkPixbufLoader *loader);
  95. G_END_DECLS
  96. #endif