]> Pileus Git - ~andy/gtk/blob - gdk/gdkvisual.h
Deprecate.
[~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 #define GDK_TYPE_VISUAL              (gdk_visual_get_type ())
11 #define GDK_VISUAL(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_VISUAL, GdkVisual))
12 #define GDK_VISUAL_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_VISUAL, GdkVisualClass))
13 #define GDK_IS_VISUAL(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_VISUAL))
14 #define GDK_IS_VISUAL_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_VISUAL))
15 #define GDK_VISUAL_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_VISUAL, GdkVisualClass))
16
17 typedef struct _GdkVisualClass    GdkVisualClass;
18
19 /* Types of visuals.
20  *   StaticGray:
21  *   Grayscale:
22  *   StaticColor:
23  *   PseudoColor:
24  *   TrueColor:
25  *   DirectColor:
26  */
27 typedef enum
28 {
29   GDK_VISUAL_STATIC_GRAY,
30   GDK_VISUAL_GRAYSCALE,
31   GDK_VISUAL_STATIC_COLOR,
32   GDK_VISUAL_PSEUDO_COLOR,
33   GDK_VISUAL_TRUE_COLOR,
34   GDK_VISUAL_DIRECT_COLOR
35 } GdkVisualType;
36
37 /* The visual type.
38  *   "type" is the type of visual this is (PseudoColor, TrueColor, etc).
39  *   "depth" is the bit depth of this visual.
40  *   "colormap_size" is the size of a colormap for this visual.
41  *   "bits_per_rgb" is the number of significant bits per red, green and blue.
42  *  The red, green and blue masks, shifts and precisions refer
43  *   to value needed to calculate pixel values in TrueColor and DirectColor
44  *   visuals. The "mask" is the significant bits within the pixel. The
45  *   "shift" is the number of bits left we must shift a primary for it
46  *   to be in position (according to the "mask"). "prec" refers to how
47  *   much precision the pixel value contains for a particular primary.
48  */
49 struct _GdkVisual
50 {
51   GObject parent_instance;
52   
53   GdkVisualType type;
54   gint depth;
55   GdkByteOrder byte_order;
56   gint colormap_size;
57   gint bits_per_rgb;
58
59   guint32 red_mask;
60   gint red_shift;
61   gint red_prec;
62
63   guint32 green_mask;
64   gint green_shift;
65   gint green_prec;
66
67   guint32 blue_mask;
68   gint blue_shift;
69   gint blue_prec;
70 };
71
72 GType         gdk_visual_get_type            (void);
73
74 gint          gdk_visual_get_best_depth      (void);
75 GdkVisualType gdk_visual_get_best_type       (void);
76 GdkVisual*    gdk_visual_get_system          (void);
77 GdkVisual*    gdk_visual_get_best            (void);
78 GdkVisual*    gdk_visual_get_best_with_depth (gint           depth);
79 GdkVisual*    gdk_visual_get_best_with_type  (GdkVisualType  visual_type);
80 GdkVisual*    gdk_visual_get_best_with_both  (gint           depth,
81                                               GdkVisualType  visual_type);
82
83 #ifndef GDK_DISABLE_DEPRECATED
84 #define gdk_visual_ref(v) g_object_ref(v)
85 #define gdk_visual_unref(v) g_object_unref(v)
86 #endif
87
88 void gdk_query_depths       (gint           **depths,
89                              gint            *count);
90 void gdk_query_visual_types (GdkVisualType  **visual_types,
91                              gint            *count);
92
93 GList* gdk_list_visuals (void);
94
95 #ifdef __cplusplus
96 }
97 #endif /* __cplusplus */
98
99 #endif /* __GDK_VISUAL_H__ */