]> Pileus Git - ~andy/gtk/blob - gdk/gdkimage.h
Doc comment fixing. (Mostly non-matching parameter names.)
[~andy/gtk] / gdk / gdkimage.h
1 #ifndef __GDK_IMAGE_H__
2 #define __GDK_IMAGE_H__
3
4 #include <gdk/gdktypes.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif /* __cplusplus */
9
10 /* Types of images.
11  *   Normal: Normal X image type. These are slow as they involve passing
12  *           the entire image through the X connection each time a draw
13  *           request is required. On Win32, a bitmap.
14  *   Shared: Shared memory X image type. These are fast as the X server
15  *           and the program actually use the same piece of memory. They
16  *           should be used with care though as there is the possibility
17  *           for both the X server and the program to be reading/writing
18  *           the image simultaneously and producing undesired results.
19  *           On Win32, also a bitmap.
20  */
21 typedef enum
22 {
23   GDK_IMAGE_NORMAL,
24   GDK_IMAGE_SHARED,
25   GDK_IMAGE_FASTEST
26 } GdkImageType;
27
28 typedef struct _GdkImageClass GdkImageClass;
29
30 #define GDK_TYPE_IMAGE              (gdk_image_get_type ())
31 #define GDK_IMAGE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_IMAGE, GdkImage))
32 #define GDK_IMAGE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_IMAGE, GdkImageClass))
33 #define GDK_IS_IMAGE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_IMAGE))
34 #define GDK_IS_IMAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_IMAGE))
35 #define GDK_IMAGE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_IMAGE, GdkImageClass))
36
37 struct _GdkImage
38 {
39   GObject parent_instance;
40   
41   GdkImageType  type;
42   GdkVisual    *visual;     /* visual used to create the image */
43   GdkByteOrder  byte_order;
44   gint          width;
45   gint          height;
46   guint16       depth;
47   guint16       bpp;        /* bytes per pixel */
48   guint16       bpl;        /* bytes per line */
49   gpointer      mem;
50
51   gpointer windowing_data;
52 };
53
54 struct _GdkImageClass
55 {
56   GObjectClass parent_class;
57 };
58
59 GType     gdk_image_get_type   (void) G_GNUC_CONST;
60
61 GdkImage* gdk_image_new_bitmap (GdkVisual     *visual,
62                                 gpointer      data,
63                                 gint          width,
64                                 gint          height);
65 GdkImage*  gdk_image_new       (GdkImageType  type,
66                                 GdkVisual    *visual,
67                                 gint          width,
68                                 gint          height);
69
70 GdkImage*  gdk_image_get       (GdkDrawable  *drawable,
71                                 gint          x,
72                                 gint          y,
73                                 gint          width,
74                                 gint          height);
75
76 GdkImage * gdk_image_ref       (GdkImage     *image);
77 void       gdk_image_unref     (GdkImage     *image);
78
79 void       gdk_image_put_pixel (GdkImage     *image,
80                                 gint          x,
81                                 gint          y,
82                                 guint32       pixel);
83 guint32    gdk_image_get_pixel (GdkImage     *image,
84                                 gint          x,
85                                 gint          y);
86
87 #ifdef __cplusplus
88 }
89 #endif /* __cplusplus */
90
91 #endif /* __GDK_IMAGE_H__ */