]> Pileus Git - ~andy/gtk/blob - gdk/gdkrgb.h
gdk/gdkdisplay.h gdk/gdkdrawable.h gdk/gdkevents.h gdk/gdkpango.h
[~andy/gtk] / gdk / gdkrgb.h
1 /* GTK - The GIMP Toolkit
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 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #ifndef __GDK_RGB_H__
28 #define __GDK_RGB_H__
29
30 #include <gdk/gdktypes.h>
31
32 G_BEGIN_DECLS
33
34 typedef struct _GdkRgbCmap GdkRgbCmap;
35
36 struct _GdkRgbCmap {
37   guint32 colors[256];
38   gint n_colors;
39
40   /*< private >*/
41   GSList *info_list;
42 };
43
44 #ifndef GDK_DISABLE_DEPRECATED
45 void gdk_rgb_init (void);
46
47 gulong gdk_rgb_xpixel_from_rgb   (guint32      rgb) G_GNUC_CONST;
48 void   gdk_rgb_gc_set_foreground (GdkGC       *gc,
49                                   guint32      rgb);
50 void   gdk_rgb_gc_set_background (GdkGC       *gc,
51                                   guint32      rgb);
52 #define gdk_rgb_get_cmap               gdk_rgb_get_colormap
53 #endif /* GDK_DISABLE_DEPRECATED */
54
55 void   gdk_rgb_find_color        (GdkColormap *colormap,
56                                   GdkColor    *color);
57
58 typedef enum
59 {
60   GDK_RGB_DITHER_NONE,
61   GDK_RGB_DITHER_NORMAL,
62   GDK_RGB_DITHER_MAX
63 } GdkRgbDither;
64
65 void        gdk_draw_rgb_image              (GdkDrawable  *drawable,
66                                              GdkGC        *gc,
67                                              gint          x,
68                                              gint          y,
69                                              gint          width,
70                                              gint          height,
71                                              GdkRgbDither  dith,
72                                              const guchar *rgb_buf,
73                                              gint          rowstride);
74 void        gdk_draw_rgb_image_dithalign    (GdkDrawable  *drawable,
75                                              GdkGC        *gc,
76                                              gint          x,
77                                              gint          y,
78                                              gint          width,
79                                              gint          height,
80                                              GdkRgbDither  dith,
81                                              const guchar *rgb_buf,
82                                              gint          rowstride,
83                                              gint          xdith,
84                                              gint          ydith);
85 void        gdk_draw_rgb_32_image           (GdkDrawable  *drawable,
86                                              GdkGC        *gc,
87                                              gint          x,
88                                              gint          y,
89                                              gint          width,
90                                              gint          height,
91                                              GdkRgbDither  dith,
92                                              const guchar *buf,
93                                              gint          rowstride);
94 void        gdk_draw_rgb_32_image_dithalign (GdkDrawable  *drawable,
95                                              GdkGC        *gc,
96                                              gint          x,
97                                              gint          y,
98                                              gint          width,
99                                              gint          height,
100                                              GdkRgbDither  dith,
101                                              const guchar *buf,
102                                              gint          rowstride,
103                                              gint          xdith,
104                                              gint          ydith);
105 void        gdk_draw_gray_image             (GdkDrawable  *drawable,
106                                              GdkGC        *gc,
107                                              gint          x,
108                                              gint          y,
109                                              gint          width,
110                                              gint          height,
111                                              GdkRgbDither  dith,
112                                              const guchar *buf,
113                                              gint          rowstride);
114 void        gdk_draw_indexed_image          (GdkDrawable  *drawable,
115                                              GdkGC        *gc,
116                                              gint          x,
117                                              gint          y,
118                                              gint          width,
119                                              gint          height,
120                                              GdkRgbDither  dith,
121                                              const guchar *buf,
122                                              gint          rowstride,
123                                              GdkRgbCmap   *cmap);
124 GdkRgbCmap *gdk_rgb_cmap_new                (guint32      *colors,
125                                              gint          n_colors);
126 void        gdk_rgb_cmap_free               (GdkRgbCmap   *cmap);
127
128 void     gdk_rgb_set_verbose (gboolean verbose);
129
130 /* experimental colormap stuff */
131 void gdk_rgb_set_install    (gboolean install);
132 void gdk_rgb_set_min_colors (gint     min_colors);
133
134 #ifndef GDK_MULTIHEAD_SAFE
135 GdkColormap *gdk_rgb_get_colormap (void);
136 GdkVisual *  gdk_rgb_get_visual   (void);
137 gboolean     gdk_rgb_ditherable   (void);
138 gboolean     gdk_rgb_colormap_ditherable (GdkColormap *cmap);
139 #endif
140
141 G_END_DECLS
142
143
144 #endif /* __GDK_RGB_H__ */