Gdk.Visual

g GObject.Object GObject.Object Gdk.Visual Gdk.Visual GObject.Object->Gdk.Visual

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_best ()

class

get_best_depth ()

class

get_best_type ()

class

get_best_with_both (depth, visual_type)

class

get_best_with_depth (depth)

class

get_best_with_type (visual_type)

class

get_system ()

get_bits_per_rgb ()

get_blue_pixel_details ()

get_byte_order ()

get_colormap_size ()

get_depth ()

get_green_pixel_details ()

get_red_pixel_details ()

get_screen ()

get_visual_type ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gdk.Visual(**kwargs)
Bases:

GObject.Object

Abstract:

No

A Gdk.Visual contains information about a particular visual.

classmethod get_best()[source]
Returns:

best visual

Return type:

Gdk.Visual

Get the visual with the most available colors for the default GDK screen. The return value should not be freed.

Deprecated since version 3.22: Visual selection should be done using Gdk.Screen.get_system_visual() and Gdk.Screen.get_rgba_visual()

classmethod get_best_depth()[source]
Returns:

best available depth

Return type:

int

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.

Deprecated since version 3.22: Visual selection should be done using Gdk.Screen.get_system_visual() and Gdk.Screen.get_rgba_visual()

classmethod get_best_type()[source]
Returns:

best visual type

Return type:

Gdk.VisualType

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

Deprecated since version 3.22: Visual selection should be done using Gdk.Screen.get_system_visual() and Gdk.Screen.get_rgba_visual()

classmethod get_best_with_both(depth, visual_type)[source]
Parameters:
Returns:

best visual with both depth and visual_type, or None if none

Return type:

Gdk.Visual or None

Combines Gdk.Visual.get_best_with_depth() and Gdk.Visual.get_best_with_type().

Deprecated since version 3.22: Visual selection should be done using Gdk.Screen.get_system_visual() and Gdk.Screen.get_rgba_visual()

classmethod get_best_with_depth(depth)[source]
Parameters:

depth (int) – a bit depth

Returns:

best visual for the given depth

Return type:

Gdk.Visual

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. None may be returned if no visual supports depth.

Deprecated since version 3.22: Visual selection should be done using Gdk.Screen.get_system_visual() and Gdk.Screen.get_rgba_visual()

classmethod get_best_with_type(visual_type)[source]
Parameters:

visual_type (Gdk.VisualType) – a visual type

Returns:

best visual of the given type

Return type:

Gdk.Visual

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. None may be returned if no visual has type visual_type.

Deprecated since version 3.22: Visual selection should be done using Gdk.Screen.get_system_visual() and Gdk.Screen.get_rgba_visual()

classmethod get_system()[source]
Returns:

system visual

Return type:

Gdk.Visual

Get the system’s default visual for the default GDK screen. This is the visual for the root window of the display. The return value should not be freed.

Deprecated since version 3.22: Use Gdk.Screen.get_system_visual (Gdk.Screen.get_default ()).

get_bits_per_rgb()[source]
Returns:

The number of significant bits per color value for self.

Return type:

int

Returns the number of significant bits per red, green and blue value.

Not all GDK backend provide a meaningful value for this function.

New in version 2.22.

Deprecated since version 3.22.: Use Gdk.Visual.get_red_pixel_details() and its variants to learn about the pixel layout of TrueColor and DirectColor visuals

get_blue_pixel_details()[source]
Returns:

mask:

A pointer to a #guint32 to be filled in, or None

shift:

A pointer to a int to be filled in, or None

precision:

A pointer to a int to be filled in, or None

Return type:

(mask: int, shift: int, precision: int)

Obtains values that are needed to calculate blue pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the “mask”). Finally, “precision” refers to how much precision the pixel value contains for a particular primary.

New in version 2.22.

get_byte_order()[source]
Returns:

A Gdk.ByteOrder stating the byte order of self.

Return type:

Gdk.ByteOrder

Returns the byte order of this visual.

The information returned by this function is only relevant when working with XImages, and not all backends return meaningful information for this.

New in version 2.22.

Deprecated since version 3.22: This information is not useful

get_colormap_size()[source]
Returns:

The size of a colormap that is suitable for self.

Return type:

int

Returns the size of a colormap for this visual.

You have to use platform-specific APIs to manipulate colormaps.

New in version 2.22.

Deprecated since version 3.22: This information is not useful, since GDK does not provide APIs to operate on colormaps.

get_depth()[source]
Returns:

The bit depth of this visual.

Return type:

int

Returns the bit depth of this visual.

New in version 2.22.

get_green_pixel_details()[source]
Returns:

mask:

A pointer to a #guint32 to be filled in, or None

shift:

A pointer to a int to be filled in, or None

precision:

A pointer to a int to be filled in, or None

Return type:

(mask: int, shift: int, precision: int)

Obtains values that are needed to calculate green pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the “mask”). Finally, “precision” refers to how much precision the pixel value contains for a particular primary.

New in version 2.22.

get_red_pixel_details()[source]
Returns:

mask:

A pointer to a #guint32 to be filled in, or None

shift:

A pointer to a int to be filled in, or None

precision:

A pointer to a int to be filled in, or None

Return type:

(mask: int, shift: int, precision: int)

Obtains values that are needed to calculate red pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the “mask”). Finally, “precision” refers to how much precision the pixel value contains for a particular primary.

New in version 2.22.

get_screen()[source]
Returns:

the screen to which this visual belongs.

Return type:

Gdk.Screen

Gets the screen to which this visual belongs

New in version 2.2.

get_visual_type()[source]
Returns:

A Gdk.VisualType stating the type of self.

Return type:

Gdk.VisualType

Returns the type of visual this is (PseudoColor, TrueColor, etc).

New in version 2.22.