8f330d2006-08-07Lance Dillon /* -*- C -*- */ class GDK2.Visual; inherit G.Object;
1e9f612007-04-29Martin Nilsson //! 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.
8f330d2006-08-07Lance Dillon void create(?int best, int|void depth, int|void type)
1e9f612007-04-29Martin Nilsson //! @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
8f330d2006-08-07Lance Dillon { pgtk2_verify_not_inited(); pgtk2_verify_setup(); { INT_TYPE best=0,depth=0,type=-1; GdkVisual *gv;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%i.%i%i",&best,&depth,&type);
8f330d2006-08-07Lance Dillon  if (best==0) { gv=gdk_visual_get_system(); } else { if (depth==0 && type==-1) gv=gdk_visual_get_best();
1e9f612007-04-29Martin Nilsson  else if (depth!=0 && type==-1)
8f330d2006-08-07Lance Dillon  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.