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.
 
 
 
 
 
 

146 lines
5.1 KiB

  1. /* GDK - The GIMP Drawing Kit
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. /*
  20. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
  26. #error "Only <gdk/gdk.h> can be included directly."
  27. #endif
  28. #ifndef __GDK_IMAGE_H__
  29. #define __GDK_IMAGE_H__
  30. #include <gdk/gdktypes.h>
  31. G_BEGIN_DECLS
  32. /* Types of images.
  33. * Normal: Normal X image type. These are slow as they involve passing
  34. * the entire image through the X connection each time a draw
  35. * request is required. On Win32, a bitmap.
  36. * Shared: Shared memory X image type. These are fast as the X server
  37. * and the program actually use the same piece of memory. They
  38. * should be used with care though as there is the possibility
  39. * for both the X server and the program to be reading/writing
  40. * the image simultaneously and producing undesired results.
  41. * On Win32, also a bitmap.
  42. */
  43. typedef enum
  44. {
  45. GDK_IMAGE_NORMAL,
  46. GDK_IMAGE_SHARED,
  47. GDK_IMAGE_FASTEST
  48. } GdkImageType;
  49. typedef struct _GdkImageClass GdkImageClass;
  50. #define GDK_TYPE_IMAGE (gdk_image_get_type ())
  51. #define GDK_IMAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_IMAGE, GdkImage))
  52. #define GDK_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_IMAGE, GdkImageClass))
  53. #define GDK_IS_IMAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_IMAGE))
  54. #define GDK_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_IMAGE))
  55. #define GDK_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_IMAGE, GdkImageClass))
  56. struct _GdkImage
  57. {
  58. GObject parent_instance;
  59. /*< public >*/
  60. GdkImageType GSEAL (type); /* read only. */
  61. GdkVisual *GSEAL (visual); /* read only. visual used to create the image */
  62. GdkByteOrder GSEAL (byte_order); /* read only. */
  63. gint GSEAL (width); /* read only. */
  64. gint GSEAL (height); /* read only. */
  65. guint16 GSEAL (depth); /* read only. */
  66. guint16 GSEAL (bpp); /* read only. bytes per pixel */
  67. guint16 GSEAL (bpl); /* read only. bytes per line */
  68. guint16 GSEAL (bits_per_pixel); /* read only. bits per pixel */
  69. gpointer GSEAL (mem);
  70. GdkColormap *GSEAL (colormap); /* read only. */
  71. /*< private >*/
  72. gpointer GSEAL (windowing_data); /* read only. */
  73. };
  74. struct _GdkImageClass
  75. {
  76. GObjectClass parent_class;
  77. };
  78. GType gdk_image_get_type (void) G_GNUC_CONST;
  79. #ifndef GDK_DISABLE_DEPRECATED
  80. GdkImage* gdk_image_new (GdkImageType type,
  81. GdkVisual *visual,
  82. gint width,
  83. gint height);
  84. GdkImage* gdk_image_get (GdkDrawable *drawable,
  85. gint x,
  86. gint y,
  87. gint width,
  88. gint height);
  89. GdkImage * gdk_image_ref (GdkImage *image);
  90. void gdk_image_unref (GdkImage *image);
  91. void gdk_image_put_pixel (GdkImage *image,
  92. gint x,
  93. gint y,
  94. guint32 pixel);
  95. guint32 gdk_image_get_pixel (GdkImage *image,
  96. gint x,
  97. gint y);
  98. void gdk_image_set_colormap (GdkImage *image,
  99. GdkColormap *colormap);
  100. GdkColormap* gdk_image_get_colormap (GdkImage *image);
  101. GdkImageType gdk_image_get_image_type (GdkImage *image);
  102. GdkVisual *gdk_image_get_visual (GdkImage *image);
  103. GdkByteOrder gdk_image_get_byte_order (GdkImage *image);
  104. gint gdk_image_get_width (GdkImage *image);
  105. gint gdk_image_get_height (GdkImage *image);
  106. guint16 gdk_image_get_depth (GdkImage *image);
  107. guint16 gdk_image_get_bytes_per_pixel(GdkImage *image);
  108. guint16 gdk_image_get_bytes_per_line (GdkImage *image);
  109. guint16 gdk_image_get_bits_per_pixel (GdkImage *image);
  110. gpointer gdk_image_get_pixels (GdkImage *image);
  111. #ifdef GDK_ENABLE_BROKEN
  112. GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
  113. gpointer data,
  114. gint width,
  115. gint height);
  116. #endif /* GDK_ENABLE_BROKEN */
  117. #define gdk_image_destroy g_object_unref
  118. #endif /* GDK_DISABLE_DEPRECATED */
  119. G_END_DECLS
  120. #endif /* __GDK_IMAGE_H__ */