You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

177 lines
5.9 KiB

  1. /* GdkPixbuf library - Io handling. This is an internal header for
  2. * GdkPixbuf. You should never use it unless you are doing development for
  3. * GdkPixbuf itself.
  4. *
  5. * Copyright (C) 1999 The Free Software Foundation
  6. *
  7. * Authors: Mark Crichton <crichton@gimp.org>
  8. * Miguel de Icaza <miguel@gnu.org>
  9. * Federico Mena-Quintero <federico@gimp.org>
  10. * Jonathan Blandford <jrb@redhat.com>
  11. * Michael Fulbright <drmike@redhat.com>
  12. *
  13. * This library is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU Lesser General Public
  15. * License as published by the Free Software Foundation; either
  16. * version 2 of the License, or (at your option) any later version.
  17. *
  18. * This library is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. * Lesser General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public
  24. * License along with this library; if not, write to the
  25. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  26. * Boston, MA 02111-1307, USA.
  27. */
  28. #if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION)
  29. #error "Only <gdk-pixbuf/gdk-pixbuf.h> can be included directly."
  30. #endif
  31. #ifndef GDK_PIXBUF_IO_H
  32. #define GDK_PIXBUF_IO_H
  33. #include <stdio.h>
  34. #include <glib.h>
  35. #include <gmodule.h>
  36. #include <gdk-pixbuf/gdk-pixbuf-core.h>
  37. #include <gdk-pixbuf/gdk-pixbuf-animation.h>
  38. G_BEGIN_DECLS
  39. typedef struct _GdkPixbufFormat GdkPixbufFormat;
  40. GType gdk_pixbuf_format_get_type (void) G_GNUC_CONST;
  41. GSList *gdk_pixbuf_get_formats (void);
  42. gchar *gdk_pixbuf_format_get_name (GdkPixbufFormat *format);
  43. gchar *gdk_pixbuf_format_get_description (GdkPixbufFormat *format);
  44. gchar **gdk_pixbuf_format_get_mime_types (GdkPixbufFormat *format);
  45. gchar **gdk_pixbuf_format_get_extensions (GdkPixbufFormat *format);
  46. gboolean gdk_pixbuf_format_is_writable (GdkPixbufFormat *format);
  47. gboolean gdk_pixbuf_format_is_scalable (GdkPixbufFormat *format);
  48. gboolean gdk_pixbuf_format_is_disabled (GdkPixbufFormat *format);
  49. void gdk_pixbuf_format_set_disabled (GdkPixbufFormat *format,
  50. gboolean disabled);
  51. gchar *gdk_pixbuf_format_get_license (GdkPixbufFormat *format);
  52. GdkPixbufFormat *gdk_pixbuf_get_file_info (const gchar *filename,
  53. gint *width,
  54. gint *height);
  55. GdkPixbufFormat *gdk_pixbuf_format_copy (const GdkPixbufFormat *format);
  56. void gdk_pixbuf_format_free (GdkPixbufFormat *format);
  57. #ifdef GDK_PIXBUF_ENABLE_BACKEND
  58. typedef void (* GdkPixbufModuleSizeFunc) (gint *width,
  59. gint *height,
  60. gpointer user_data);
  61. typedef void (* GdkPixbufModulePreparedFunc) (GdkPixbuf *pixbuf,
  62. GdkPixbufAnimation *anim,
  63. gpointer user_data);
  64. typedef void (* GdkPixbufModuleUpdatedFunc) (GdkPixbuf *pixbuf,
  65. int x,
  66. int y,
  67. int width,
  68. int height,
  69. gpointer user_data);
  70. typedef struct _GdkPixbufModulePattern GdkPixbufModulePattern;
  71. struct _GdkPixbufModulePattern {
  72. char *prefix;
  73. char *mask;
  74. int relevance;
  75. };
  76. typedef struct _GdkPixbufModule GdkPixbufModule;
  77. struct _GdkPixbufModule {
  78. char *module_name;
  79. char *module_path;
  80. GModule *module;
  81. GdkPixbufFormat *info;
  82. GdkPixbuf *(* load) (FILE *f,
  83. GError **error);
  84. GdkPixbuf *(* load_xpm_data) (const char **data);
  85. /* Incremental loading */
  86. gpointer (* begin_load) (GdkPixbufModuleSizeFunc size_func,
  87. GdkPixbufModulePreparedFunc prepare_func,
  88. GdkPixbufModuleUpdatedFunc update_func,
  89. gpointer user_data,
  90. GError **error);
  91. gboolean (* stop_load) (gpointer context,
  92. GError **error);
  93. gboolean (* load_increment) (gpointer context,
  94. const guchar *buf,
  95. guint size,
  96. GError **error);
  97. /* Animation loading */
  98. GdkPixbufAnimation *(* load_animation) (FILE *f,
  99. GError **error);
  100. /* Saving */
  101. gboolean (* save) (FILE *f,
  102. GdkPixbuf *pixbuf,
  103. gchar **param_keys,
  104. gchar **param_values,
  105. GError **error);
  106. gboolean (*save_to_callback) (GdkPixbufSaveFunc save_func,
  107. gpointer user_data,
  108. GdkPixbuf *pixbuf,
  109. gchar **option_keys,
  110. gchar **option_values,
  111. GError **error);
  112. /*< private >*/
  113. void (*_reserved1) (void);
  114. void (*_reserved2) (void);
  115. void (*_reserved3) (void);
  116. void (*_reserved4) (void);
  117. void (*_reserved5) (void);
  118. };
  119. typedef void (* GdkPixbufModuleFillVtableFunc) (GdkPixbufModule *module);
  120. typedef void (* GdkPixbufModuleFillInfoFunc) (GdkPixbufFormat *info);
  121. /* key/value pairs that can be attached by the pixbuf loader */
  122. gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf,
  123. const gchar *key,
  124. const gchar *value);
  125. typedef enum /*< skip >*/
  126. {
  127. GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0,
  128. GDK_PIXBUF_FORMAT_SCALABLE = 1 << 1,
  129. GDK_PIXBUF_FORMAT_THREADSAFE = 1 << 2
  130. } GdkPixbufFormatFlags;
  131. struct _GdkPixbufFormat {
  132. gchar *name;
  133. GdkPixbufModulePattern *signature;
  134. gchar *domain;
  135. gchar *description;
  136. gchar **mime_types;
  137. gchar **extensions;
  138. guint32 flags;
  139. gboolean disabled;
  140. gchar *license;
  141. };
  142. #endif /* GDK_PIXBUF_ENABLE_BACKEND */
  143. G_END_DECLS
  144. #endif /* GDK_PIXBUF_IO_H */