]> Pileus Git - ~andy/gtk/blob - gdk/gdkvisual.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gdk / gdkvisual.h
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, see <http://www.gnu.org/licenses/>.
16  */
17
18 /*
19  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
20  * file for a list of people on the GTK+ Team.  See the ChangeLog
21  * files for a list of changes.  These files are distributed with
22  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23  */
24
25 #ifndef __GDK_VISUAL_H__
26 #define __GDK_VISUAL_H__
27
28 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
29 #error "Only <gdk/gdk.h> can be included directly."
30 #endif
31
32 #include <gdk/gdktypes.h>
33
34 G_BEGIN_DECLS
35
36 #define GDK_TYPE_VISUAL              (gdk_visual_get_type ())
37 #define GDK_VISUAL(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_VISUAL, GdkVisual))
38 #define GDK_IS_VISUAL(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_VISUAL))
39
40 /**
41  * GdkVisualType:
42  * @GDK_VISUAL_STATIC_GRAY: Each pixel value indexes a grayscale value
43  *     directly.
44  * @GDK_VISUAL_GRAYSCALE: Each pixel is an index into a color map that
45  *     maps pixel values into grayscale values. The color map can be
46  *     changed by an application.
47  * @GDK_VISUAL_STATIC_COLOR: Each pixel value is an index into a predefined,
48  *     unmodifiable color map that maps pixel values into RGB values.
49  * @GDK_VISUAL_PSEUDO_COLOR: Each pixel is an index into a color map that
50  *     maps pixel values into rgb values. The color map can be changed by
51  *     an application.
52  * @GDK_VISUAL_TRUE_COLOR: Each pixel value directly contains red, green,
53  *     and blue components. Use gdk_visual_get_red_pixel_details(), etc,
54  *     to obtain information about how the components are assembled into
55  *     a pixel value.
56  * @GDK_VISUAL_DIRECT_COLOR: Each pixel value contains red, green, and blue
57  *     components as for %GDK_VISUAL_TRUE_COLOR, but the components are
58  *     mapped via a color table into the final output table instead of
59  *     being converted directly.
60  *
61  * A set of values that describe the manner in which the pixel values
62  * for a visual are converted into RGB values for display.
63  */
64 typedef enum
65 {
66   GDK_VISUAL_STATIC_GRAY,
67   GDK_VISUAL_GRAYSCALE,
68   GDK_VISUAL_STATIC_COLOR,
69   GDK_VISUAL_PSEUDO_COLOR,
70   GDK_VISUAL_TRUE_COLOR,
71   GDK_VISUAL_DIRECT_COLOR
72 } GdkVisualType;
73
74 /**
75  * GdkVisual:
76  *
77  * The #GdkVisual structure contains information about
78  * a particular visual.
79  */
80
81 GType         gdk_visual_get_type            (void) G_GNUC_CONST;
82
83 #ifndef GDK_MULTIHEAD_SAFE
84 gint          gdk_visual_get_best_depth      (void);
85 GdkVisualType gdk_visual_get_best_type       (void);
86 GdkVisual*    gdk_visual_get_system          (void);
87 GdkVisual*    gdk_visual_get_best            (void);
88 GdkVisual*    gdk_visual_get_best_with_depth (gint           depth);
89 GdkVisual*    gdk_visual_get_best_with_type  (GdkVisualType  visual_type);
90 GdkVisual*    gdk_visual_get_best_with_both  (gint           depth,
91                                               GdkVisualType  visual_type);
92
93 void gdk_query_depths       (gint           **depths,
94                              gint            *count);
95 void gdk_query_visual_types (GdkVisualType  **visual_types,
96                              gint            *count);
97
98 GList* gdk_list_visuals (void);
99 #endif
100
101 GdkScreen    *gdk_visual_get_screen (GdkVisual *visual);
102
103 GdkVisualType gdk_visual_get_visual_type         (GdkVisual *visual);
104 gint          gdk_visual_get_depth               (GdkVisual *visual);
105 GdkByteOrder  gdk_visual_get_byte_order          (GdkVisual *visual);
106 gint          gdk_visual_get_colormap_size       (GdkVisual *visual);
107 gint          gdk_visual_get_bits_per_rgb        (GdkVisual *visual);
108 void          gdk_visual_get_red_pixel_details   (GdkVisual *visual,
109                                                   guint32   *mask,
110                                                   gint      *shift,
111                                                   gint      *precision);
112 void          gdk_visual_get_green_pixel_details (GdkVisual *visual,
113                                                   guint32   *mask,
114                                                   gint      *shift,
115                                                   gint      *precision);
116 void          gdk_visual_get_blue_pixel_details  (GdkVisual *visual,
117                                                   guint32   *mask,
118                                                   gint      *shift,
119                                                   gint      *precision);
120
121 G_END_DECLS
122
123 #endif /* __GDK_VISUAL_H__ */