gdk.Visual.Visual Class Reference

List of all members.

Detailed Description

Description 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. For example, a piece of display hardware might support 24-bit color, 16-bit color, or 8-bit color; meaning 24/16/8-bit pixel sizes. For a given pixel size, pixels can be in different formats; for example the "red" element of an RGB pixel may be in the top 8 bits of the pixel, or may be in the lower 4 bits. Usually you can avoid thinking about visuals in GTK+. Visuals are useful to interpret the contents of a GdkImage, but you should avoid GdkImage precisely because its contents depend on the display hardware; use GdkPixbuf instead, for all but the most low-level purposes. Also, anytime you provide a GdkColormap, the visual is implied as part of the colormap (gdk_colormap_get_visual()), so you won't have to provide a visual in addition. There are several standard visuals. The visual returned by gdk_visual_get_system() is the system's default visual. gdk_rgb_get_visual() return the visual most suited to displaying full-color image data. If you use the calls in GdkRGB, you should create your windows using this visual (and the colormap returned by gdk_rgb_get_colormap()). A number of functions are provided for determining the "best" available visual. For the purposes of making this determination, higher bit depths are considered better, and for visuals of the same bit depth, GDK_VISUAL_PSEUDO_COLOR is preferred at 8bpp, otherwise, the visual types are ranked in the order of (highest to lowest) GDK_VISUAL_DIRECT_COLOR, GDK_VISUAL_TRUE_COLOR, GDK_VISUAL_PSEUDO_COLOR, GDK_VISUAL_STATIC_COLOR, GDK_VISUAL_GRAYSCALE, then GDK_VISUAL_STATIC_GRAY.


Public Member Functions

GdkVisualgetVisualStruct ()
 this (GdkVisual *gdkVisual)
 Sets our main struct and passes it to the parent class.
Screen getScreen ()
 Gets the screen to which this visual belongs visual: a GdkVisual Returns: the screen to which this visual belongs.

Static Public Member Functions

static void gdkQueryDepths (int **depths, int *count)
 This function returns the available bit depths for the default screen.
static void gdkQueryVisualTypes (GdkVisualType **visualTypes, int *count)
 This function returns the available visual types for the default screen.
static ListG gdkListVisuals ()
 Lists the available visuals for the default screen.
static int getBestDepth ()
 Get the best available depth for the default GDK screen.
static GdkVisualType getBestType ()
 Return the best available visual type for the default GDK screen.
static Visual getSystem ()
 Get the system'sdefault visual for the default GDK screen.
static Visual getBest ()
 Get the visual with the most available colors for the default GDK screen.
static Visual getBestWithDepth (int depth)
 Get the best visual with depth depth for the default GDK screen.
static Visual getBestWithType (GdkVisualType visualType)
 Get the best visual of the given visual_type for the default GDK screen.
static Visual getBestWithBoth (int depth, GdkVisualType visualType)
 Combines gdk_visual_get_best_with_depth() and gdk_visual_get_best_with_type().

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GdkVisualgdkVisual
 the main Gtk struct


Constructor & Destructor Documentation

gdk.Visual.Visual.this ( GdkVisual gdkVisual  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

static ListG gdk.Visual.Visual.gdkListVisuals (  )  [static]

Lists the available visuals for the default screen.

(See gdk_screen_list_visuals()) A visual describes a hardware image data format. For example, a visual might support 24-bit color, or 8-bit color, and might expect pixels to be in a certain format. Call g_list_free() on the return value when you're finished with it. Returns: a list of visuals; the list must be freed, but not its contents

static void gdk.Visual.Visual.gdkQueryDepths ( int **  depths,
int count 
) [static]

This function returns the available bit depths for the default screen.

It's equivalent to listing the visuals (gdk_list_visuals()) and then looking at the depth field in each visual, removing duplicates. The array returned by this function should not be freed. depths: return location for available depths count: return location for number of available depths

static void gdk.Visual.Visual.gdkQueryVisualTypes ( GdkVisualType **  visualTypes,
int count 
) [static]

This function returns the available visual types for the default screen.

It's equivalent to listing the visuals (gdk_list_visuals()) and then looking at the type field in each visual, removing duplicates. The array returned by this function should not be freed. visual_types: return location for the available visual types count: return location for the number of available visual types

static Visual gdk.Visual.Visual.getBest (  )  [static]

Get the visual with the most available colors for the default GDK screen.

The return value should not be freed. Returns: best visual

static int gdk.Visual.Visual.getBestDepth (  )  [static]

Get the best available depth for the default GDK screen.

"Best" means "largest," i.e. 32 preferred over 24 preferred over 8 bits per pixel. Returns: best available depth

static GdkVisualType gdk.Visual.Visual.getBestType (  )  [static]

Return the best available visual type for the default GDK screen.

Returns: best visual type

static Visual gdk.Visual.Visual.getBestWithBoth ( int  depth,
GdkVisualType  visualType 
) [static]

Combines gdk_visual_get_best_with_depth() and gdk_visual_get_best_with_type().

depth: a bit depth visual_type: a visual type Returns: best visual with both depth and visual_type, or NULL if none

static Visual gdk.Visual.Visual.getBestWithDepth ( int  depth  )  [static]

Get the best visual with depth depth for the default GDK screen.

Color visuals and visuals with mutable colormaps are preferred over grayscale or fixed-colormap visuals. The return value should not be freed. NULL may be returned if no visual supports depth. depth: a bit depth Returns: best visual for the given depth

static Visual gdk.Visual.Visual.getBestWithType ( GdkVisualType  visualType  )  [static]

Get the best visual of the given visual_type for the default GDK screen.

Visuals with higher color depths are considered better. The return value should not be freed. NULL may be returned if no visual has type visual_type. visual_type: a visual type Returns: best visual of the given type

Screen gdk.Visual.Visual.getScreen (  ) 

Gets the screen to which this visual belongs visual: a GdkVisual Returns: the screen to which this visual belongs.

Since 2.2 See Also GdkImage, GdkColormap, GdkRGB

void* gdk.Visual.Visual.getStruct (  )  [protected]

the main Gtk struct as a void*

static Visual gdk.Visual.Visual.getSystem (  )  [static]

Get the system'sdefault visual for the default GDK screen.

This is the visual for the root window of the display. The return value should not be freed. Returns: system visual

GdkVisual* gdk.Visual.Visual.getVisualStruct (  ) 


Member Data Documentation

GdkVisual* gdk.Visual.Visual.gdkVisual [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo