]> Pileus Git - ~andy/gtk/blob - gdk/gdkvisual.h
Started
[~andy/gtk] / gdk / gdkvisual.h
1 #ifndef __GDK_VISUAL_H__
2 #define __GDK_VISUAL_H__
3
4 #include <gdk/gdktypes.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif /* __cplusplus */
9
10 /* Types of visuals.
11  *   StaticGray:
12  *   Grayscale:
13  *   StaticColor:
14  *   PseudoColor:
15  *   TrueColor:
16  *   DirectColor:
17  */
18 typedef enum
19 {
20   GDK_VISUAL_STATIC_GRAY,
21   GDK_VISUAL_GRAYSCALE,
22   GDK_VISUAL_STATIC_COLOR,
23   GDK_VISUAL_PSEUDO_COLOR,
24   GDK_VISUAL_TRUE_COLOR,
25   GDK_VISUAL_DIRECT_COLOR
26 } GdkVisualType;
27
28 /* The visual type.
29  *   "type" is the type of visual this is (PseudoColor, TrueColor, etc).
30  *   "depth" is the bit depth of this visual.
31  *   "colormap_size" is the size of a colormap for this visual.
32  *   "bits_per_rgb" is the number of significant bits per red, green and blue.
33  *  The red, green and blue masks, shifts and precisions refer
34  *   to value needed to calculate pixel values in TrueColor and DirectColor
35  *   visuals. The "mask" is the significant bits within the pixel. The
36  *   "shift" is the number of bits left we must shift a primary for it
37  *   to be in position (according to the "mask"). "prec" refers to how
38  *   much precision the pixel value contains for a particular primary.
39  */
40 struct _GdkVisual
41 {
42   GdkVisualType type;
43   gint depth;
44   GdkByteOrder byte_order;
45   gint colormap_size;
46   gint bits_per_rgb;
47
48   guint32 red_mask;
49   gint red_shift;
50   gint red_prec;
51
52   guint32 green_mask;
53   gint green_shift;
54   gint green_prec;
55
56   guint32 blue_mask;
57   gint blue_shift;
58   gint blue_prec;
59 };
60
61 gint          gdk_visual_get_best_depth      (void);
62 GdkVisualType gdk_visual_get_best_type       (void);
63 GdkVisual*    gdk_visual_get_system          (void);
64 GdkVisual*    gdk_visual_get_best            (void);
65 GdkVisual*    gdk_visual_get_best_with_depth (gint           depth);
66 GdkVisual*    gdk_visual_get_best_with_type  (GdkVisualType  visual_type);
67 GdkVisual*    gdk_visual_get_best_with_both  (gint           depth,
68                                               GdkVisualType  visual_type);
69
70 /* Actually, these are no-ops... */
71 GdkVisual* gdk_visual_ref (GdkVisual *visual);
72 void       gdk_visual_unref (GdkVisual *visual);
73
74 void gdk_query_depths       (gint           **depths,
75                              gint            *count);
76 void gdk_query_visual_types (GdkVisualType  **visual_types,
77                              gint            *count);
78
79 GList* gdk_list_visuals (void);
80
81 #ifdef __cplusplus
82 }
83 #endif /* __cplusplus */
84
85 #endif /* __GDK_VISUAL_H__ */