1// included by gdk2.pp
2{$IFDEF read_forward_definitions}
3{ Types of visuals.
4     StaticGray:
5     Grayscale:
6     StaticColor:
7     PseudoColor:
8     TrueColor:
9     DirectColor:
10  }
11   PGdkVisualType = ^TGdkVisualType;
12   TGdkVisualType = (
13     GDK_VISUAL_STATIC_GRAY,
14     GDK_VISUAL_GRAYSCALE,
15     GDK_VISUAL_STATIC_COLOR,
16     GDK_VISUAL_PSEUDO_COLOR,
17     GDK_VISUAL_TRUE_COLOR,
18     GDK_VISUAL_DIRECT_COLOR
19     );
20
21{ The visual type.
22     "type" is the type of visual this is (PseudoColor, TrueColor, etc).
23     "depth" is the bit depth of this visual.
24     "colormap_size" is the size of a colormap for this visual.
25     "bits_per_rgb" is the number of significant bits per red, green and blue.
26    The red, green and blue masks, shifts and precisions refer
27     to value needed to calculate pixel values in TrueColor and DirectColor
28     visuals. The "mask" is the significant bits within the pixel. The
29     "shift" is the number of bits left we must shift a primary for it
30     to be in position (according to the "mask"). "prec" refers to how
31     much precision the pixel value contains for a particular primary.
32  }
33   PGdkVisual = ^TGdkVisual;
34   TGdkVisual = record
35        parent_instance : TGObject;
36        TheType : TGdkVisualType;
37        depth : gint;
38        byte_order : TGdkByteOrder;
39        colormap_size : gint;
40        bits_per_rgb : gint;
41        red_mask : guint32;
42        red_shift : gint;
43        red_prec : gint;
44        green_mask : guint32;
45        green_shift : gint;
46        green_prec : gint;
47        blue_mask : guint32;
48        blue_shift : gint;
49        blue_prec : gint;
50        screen : PGdkScreen;
51     end;
52
53{$ENDIF read_forward_definitions}
54
55//------------------------------------------------------------------------------
56
57{$IFDEF read_interface_types}
58{$ENDIF read_interface_types}
59
60//------------------------------------------------------------------------------
61
62{$IFDEF read_interface_rest}
63function GDK_TYPE_VISUAL : GType;
64function GDK_VISUAL(anObject : Pointer) : PGdkVisual;
65function GDK_VISUAL_CLASS(klass : Pointer) : PGdkVisualClass;
66function GDK_IS_VISUAL(anObject : Pointer) : boolean;
67function GDK_IS_VISUAL_CLASS(klass : Pointer) : boolean;
68function GDK_VISUAL_GET_CLASS(obj : Pointer) : PGdkVisualClass;
69
70function gdk_visual_get_type:GType; cdecl; external gdklib;
71
72{$ifndef GDK_MULTIHEAD_SAFE}
73function gdk_visual_get_best_depth:gint; cdecl; external gdklib;
74function gdk_visual_get_best_type:TGdkVisualType; cdecl; external gdklib;
75function gdk_visual_get_system:PGdkVisual; cdecl; external gdklib;
76function gdk_visual_get_best:PGdkVisual; cdecl; external gdklib;
77function gdk_visual_get_best_with_depth(depth:gint):PGdkVisual; cdecl; external gdklib;
78function gdk_visual_get_best_with_type(visual_type:TGdkVisualType):PGdkVisual; cdecl; external gdklib;
79function gdk_visual_get_best_with_both(depth:gint; visual_type:TGdkVisualType):PGdkVisual; cdecl; external gdklib;
80function gdk_visual_get_screen(visual: PGdkVisual): PGdkScreen; cdecl; external gdklib;
81procedure gdk_query_depths(var depths:Pgint; count:Pgint); cdecl; external gdklib;
82procedure gdk_query_visual_types(var visual_types:PGdkVisualType; count:Pgint); cdecl; external gdklib;
83function gdk_list_visuals:PGList; cdecl; external gdklib;
84{$endif}
85
86{$ifndef GDK_DISABLE_DEPRECATED}
87procedure gdk_visual_ref(v : PGdkVisual);
88procedure gdk_visual_unref(v : PGdkVisual);
89{$endif}
90{$endif read_interface_rest}
91
92//------------------------------------------------------------------------------
93
94{$IFDEF read_implementation}
95function GDK_TYPE_VISUAL : GType;
96begin
97  GDK_TYPE_VISUAL:=gdk_visual_get_type;
98end;
99
100function GDK_VISUAL(anObject : Pointer) : PGdkVisual;
101begin
102  GDK_VISUAL:=PGdkVisual(G_TYPE_CHECK_INSTANCE_CAST(anObject,GDK_TYPE_VISUAL));
103end;
104
105function GDK_VISUAL_CLASS(klass : Pointer) : PGdkVisualClass;
106begin
107  GDK_VISUAL_CLASS:=PGdkVisualClass(G_TYPE_CHECK_CLASS_CAST(klass,
108                                                              GDK_TYPE_VISUAL));
109end;
110
111function GDK_IS_VISUAL(anObject : Pointer) : boolean;
112begin
113  GDK_IS_VISUAL:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,GDK_TYPE_VISUAL);
114end;
115
116function GDK_IS_VISUAL_CLASS(klass : Pointer) : boolean;
117begin
118  GDK_IS_VISUAL_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GDK_TYPE_VISUAL);
119end;
120
121function GDK_VISUAL_GET_CLASS(obj : Pointer) : PGdkVisualClass;
122begin
123  GDK_VISUAL_GET_CLASS:=PGdkVisualClass(G_TYPE_INSTANCE_GET_CLASS(obj,
124                                                              GDK_TYPE_VISUAL));
125end;
126
127procedure gdk_visual_ref(v : PGdkVisual);
128begin
129  g_object_ref(v);
130end;
131
132procedure gdk_visual_unref(v : PGdkVisual);
133begin
134  g_object_unref(v);
135end;
136{$ENDIF}
137
138