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.
 
 
 
 
 
 

98 lines
3.6 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_LOADABLE_ICON_H__
  26. #define __G_LOADABLE_ICON_H__
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_LOADABLE_ICON (g_loadable_icon_get_type ())
  30. #define G_LOADABLE_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_LOADABLE_ICON, GLoadableIcon))
  31. #define G_IS_LOADABLE_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_LOADABLE_ICON))
  32. #define G_LOADABLE_ICON_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_LOADABLE_ICON, GLoadableIconIface))
  33. /**
  34. * GLoadableIcon:
  35. *
  36. * Generic type for all kinds of icons that can be loaded
  37. * as a stream.
  38. **/
  39. typedef struct _GLoadableIconIface GLoadableIconIface;
  40. /**
  41. * GLoadableIconIface:
  42. * @g_iface: The parent interface.
  43. * @load: Loads an icon.
  44. * @load_async: Loads an icon asynchronously.
  45. * @load_finish: Finishes an asynchronous icon load.
  46. *
  47. * Interface for icons that can be loaded as a stream.
  48. **/
  49. struct _GLoadableIconIface
  50. {
  51. GTypeInterface g_iface;
  52. /* Virtual Table */
  53. GInputStream * (* load) (GLoadableIcon *icon,
  54. int size,
  55. char **type,
  56. GCancellable *cancellable,
  57. GError **error);
  58. void (* load_async) (GLoadableIcon *icon,
  59. int size,
  60. GCancellable *cancellable,
  61. GAsyncReadyCallback callback,
  62. gpointer user_data);
  63. GInputStream * (* load_finish) (GLoadableIcon *icon,
  64. GAsyncResult *res,
  65. char **type,
  66. GError **error);
  67. };
  68. GType g_loadable_icon_get_type (void) G_GNUC_CONST;
  69. GInputStream *g_loadable_icon_load (GLoadableIcon *icon,
  70. int size,
  71. char **type,
  72. GCancellable *cancellable,
  73. GError **error);
  74. void g_loadable_icon_load_async (GLoadableIcon *icon,
  75. int size,
  76. GCancellable *cancellable,
  77. GAsyncReadyCallback callback,
  78. gpointer user_data);
  79. GInputStream *g_loadable_icon_load_finish (GLoadableIcon *icon,
  80. GAsyncResult *res,
  81. char **type,
  82. GError **error);
  83. G_END_DECLS
  84. #endif /* __G_LOADABLE_ICON_H__ */