1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
/* -*- C -*- */ 
class GDK2.Visual; 
inherit G.Object; 
 
//! A GdkVisual describes a particular video hardware display format. 
//! It includes information about the number of bits used for each 
//! color, the way the bits are translated into an RGB value for 
//! display, and the way the bits are stored in memory. 
 
void create(?int best, int|void depth, int|void type) 
//! @param best 
//!   If best is false the systems default GDK screen is returned, 
//!   otherwise the screen that best fulfills the given depth and 
//!   type. If none is given, the one with most colors is selected. 
//! @param depth 
//!   The requested bit depth, or 0. 
//! @param type 
//!   The requested visual type. 
//!   @int 
//!     @value GDK_VISUAL_STATIC_GRAY 
//!       Each pixel value indexes a grayscale value directly. 
//!     @value GDK_VISUAL_GRAYSCALE 
//!       Each pixel is an index into a color map that maps pixel 
//!       values into grayscale values. The color map can be changed 
//!       by an application. 
//!     @value GDK_VISUAL_STATIC_COLOR 
//!       Each pixel value is an index into a predefined, unmodifiable 
//!       color map that maps pixel values into RGB values. 
//!     @value GDK_VISUAL_PSEUDO_COLOR 
//!       Each pixel is an index into a color map that maps pixel 
//!       values into rgb values. The color map can be changed by an 
//!       application. 
//!     @value GDK_VISUAL_TRUE_COLOR 
//!       Each pixel value directly contains red, green, and blue 
//!       components. The red_mask, green_mask, and blue_mask fields 
//!       of the GdkVisual structure describe how the components are 
//!       assembled into a pixel value. 
//!     @value GDK_VISUAL_DIRECT_COLOR 
//!       Each pixel value contains red, green, and blue components as 
//!       for @[GDK_VISUAL_TRUE_COLOR], but the components are mapped via 
//!       a color table into the final output table instead of being 
//!       converted directly. 
//!   @endint 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  { 
    INT_TYPE best=0,depth=0,type=-1; 
    GdkVisual *gv; 
 
    get_all_args(NULL,args,"%i.%i%i",&best,&depth,&type); 
    if (best==0) { 
      gv=gdk_visual_get_system(); 
    } else { 
      if (depth==0 && type==-1) 
        gv=gdk_visual_get_best(); 
      else if (depth!=0 && type==-1) 
        gv=gdk_visual_get_best_with_depth(depth); 
      else if (depth==0  && type!=-1) 
        gv=gdk_visual_get_best_with_type(type); 
      else 
        gv=gdk_visual_get_best_with_both(depth,type); 
    } 
    THIS->obj=(void *)gv; 
  } 
  pgtk2__init_this_object(); 
} 
 
+GDK2.Screen get_screen(); 
//! Gets the screen to which this visual belongs.