[]Struct gdk::Visual

pub struct Visual(_, _);

A Visual contains information about a particular visual.

Implementations

impl Visual[src]

pub fn get_bits_per_rgb(&self) -> i32[src]

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

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

Deprecated since 3.22

Use Visual::get_red_pixel_details and its variants to learn about the pixel layout of TrueColor and DirectColor visuals

Returns

The number of significant bits per color value for self.

pub fn get_blue_pixel_details(&self) -> (u32, i32, i32)[src]

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.

mask

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

shift

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

precision

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

pub fn get_byte_order(&self) -> ByteOrder[src]

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.

Deprecated since 3.22

This information is not useful

Returns

A ByteOrder stating the byte order of self.

pub fn get_colormap_size(&self) -> i32[src]

Returns the size of a colormap for this visual.

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

Deprecated since 3.22

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

Returns

The size of a colormap that is suitable for self.

pub fn get_depth(&self) -> i32[src]

Returns the bit depth of this visual.

Returns

The bit depth of this visual.

pub fn get_green_pixel_details(&self) -> (u32, i32, i32)[src]

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.

mask

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

shift

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

precision

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

pub fn get_red_pixel_details(&self) -> (u32, i32, i32)[src]

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.

mask

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

shift

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

precision

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

pub fn get_screen(&self) -> Screen[src]

Gets the screen to which this visual belongs

Returns

the screen to which this visual belongs.

pub fn get_visual_type(&self) -> VisualType[src]

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

Returns

A VisualType stating the type of self.

pub fn get_best() -> Visual[src]

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

Deprecated since 3.22

Visual selection should be done using Screen::get_system_visual and Screen::get_rgba_visual

Returns

best visual

pub fn get_best_depth() -> i32[src]

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 3.22

Visual selection should be done using Screen::get_system_visual and Screen::get_rgba_visual

Returns

best available depth

pub fn get_best_type() -> VisualType[src]

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

Deprecated since 3.22

Visual selection should be done using Screen::get_system_visual and Screen::get_rgba_visual

Returns

best visual type

pub fn get_best_with_both(depth: i32, visual_type: VisualType) -> Option<Visual>[src]

Combines Visual::get_best_with_depth and Visual::get_best_with_type.

Deprecated since 3.22

Visual selection should be done using Screen::get_system_visual and Screen::get_rgba_visual

depth

a bit depth

visual_type

a visual type

Returns

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

pub fn get_best_with_depth(depth: i32) -> Option<Visual>[src]

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 3.22

Visual selection should be done using Screen::get_system_visual and Screen::get_rgba_visual

depth

a bit depth

Returns

best visual for the given depth

pub fn get_best_with_type(visual_type: VisualType) -> Option<Visual>[src]

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 3.22

Visual selection should be done using Screen::get_system_visual and Screen::get_rgba_visual

visual_type

a visual type

Returns

best visual of the given type

pub fn get_system() -> Visual[src]

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 3.22

Use gdk_screen_get_system_visual (gdk_screen_get_default ()).

Returns

system visual

impl Visual[src]

pub fn query_depths() -> Vec<i32>[src]

Trait Implementations

impl Clone for Visual

impl Debug for Visual

impl Display for Visual[src]

impl Eq for Visual

impl Hash for Visual

impl Ord for Visual

impl<T: ObjectType> PartialEq<T> for Visual

impl<T: ObjectType> PartialOrd<T> for Visual

impl StaticType for Visual

Auto Trait Implementations

impl RefUnwindSafe for Visual

impl !Send for Visual

impl !Sync for Visual

impl Unpin for Visual

impl UnwindSafe for Visual

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.