gi-gdk-3.0.28: Gdk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | Safe-Inferred
Language | Haskell2010

GI.Gdk.Objects.Visual

Contents

- Exported types
- Methods
  - getBest
  - getBestDepth
  - getBestType
  - getBestWithBoth
  - getBestWithDepth
  - getBestWithType
  - getBitsPerRgb
  - getBluePixelDetails
  - getByteOrder
  - getColormapSize
  - getDepth
  - getGreenPixelDetails
  - getRedPixelDetails
  - getScreen
  - getSystem
  - getVisualType

Description

A `Visual` contains information about a particular visual.

Synopsis

- newtype Visual = Visual (ManagedPtr Visual)
- class (GObject o, IsDescendantOf Visual o) => IsVisual o
- toVisual :: (MonadIO m, IsVisual o) => o -> m Visual
- visualGetBest :: (HasCallStack, MonadIO m) => m Visual
- visualGetBestDepth :: (HasCallStack, MonadIO m) => m Int32
- visualGetBestType :: (HasCallStack, MonadIO m) => m VisualType
- visualGetBestWithBoth :: (HasCallStack, MonadIO m) => Int32 -> VisualType -> m (Maybe Visual)
- visualGetBestWithDepth :: (HasCallStack, MonadIO m) => Int32 -> m Visual
- visualGetBestWithType :: (HasCallStack, MonadIO m) => VisualType -> m Visual
- visualGetBitsPerRgb :: (HasCallStack, MonadIO m, IsVisual a) => a -> m Int32
- visualGetBluePixelDetails :: (HasCallStack, MonadIO m, IsVisual a) => a -> m (Word32, Int32, Int32)
- visualGetByteOrder :: (HasCallStack, MonadIO m, IsVisual a) => a -> m ByteOrder
- visualGetColormapSize :: (HasCallStack, MonadIO m, IsVisual a) => a -> m Int32
- visualGetDepth :: (HasCallStack, MonadIO m, IsVisual a) => a -> m Int32
- visualGetGreenPixelDetails :: (HasCallStack, MonadIO m, IsVisual a) => a -> m (Word32, Int32, Int32)
- visualGetRedPixelDetails :: (HasCallStack, MonadIO m, IsVisual a) => a -> m (Word32, Int32, Int32)
- visualGetScreen :: (HasCallStack, MonadIO m, IsVisual a) => a -> m Screen
- visualGetSystem :: (HasCallStack, MonadIO m) => m Visual
- visualGetVisualType :: (HasCallStack, MonadIO m, IsVisual a) => a -> m VisualType

# Exported types

newtype Visual Source #

Memory-managed wrapper type.

Constructors

Visual (ManagedPtr Visual) |

#### Instances

Instances details

Eq Visual Source # |
Instance details Defined in GI.Gdk.Objects.Visual Methods (==) :: Visual -> Visual -> Bool Source # (/=) :: Visual -> Visual -> Bool Source #
GObject Visual Source # |
Instance details Defined in GI.Gdk.Objects.Visual
ManagedPtrNewtype Visual Source # |
Instance details Defined in GI.Gdk.Objects.Visual Methods toManagedPtr :: Visual -> ManagedPtr Visual Source #
TypedObject Visual Source # |
Instance details Defined in GI.Gdk.Objects.Visual Methods glibType :: IO GType Source #
HasParentTypes Visual Source # |
Instance details Defined in GI.Gdk.Objects.Visual
IsGValue (Maybe Visual) Source # | Convert `Visual` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gdk.Objects.Visual Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Visual -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Visual) Source #
type ParentTypes Visual Source # |
Instance details Defined in GI.Gdk.Objects.Visual type ParentTypes Visual = '[Object]

class (GObject o, IsDescendantOf Visual o) => IsVisual o Source #

Type class for types which can be safely cast to `Visual`, for instance with `toVisual`.

#### Instances

Instances details

(GObject o, IsDescendantOf Visual o) => IsVisual o Source # |
Instance details Defined in GI.Gdk.Objects.Visual

toVisual :: (MonadIO m, IsVisual o) => o -> m Visual Source #

Cast to `Visual`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getBitsPerRgb, getBluePixelDetails, getByteOrder, getColormapSize, getData, getDepth, getGreenPixelDetails, getProperty, getQdata, getRedPixelDetails, getScreen, getVisualType.

#### Setters

setData, setDataFull, setProperty.

## getBest

visualGetBest Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Visual | Returns: best visual

Deprecated: (Since version 3.22)Visual selection should be done using `screenGetSystemVisual` and `screenGetRgbaVisual`

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

## getBestDepth

visualGetBestDepth Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Int32 | Returns: best available depth

Deprecated: (Since version 3.22)Visual selection should be done using `screenGetSystemVisual` and `screenGetRgbaVisual`

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.

## getBestType

visualGetBestType Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m VisualType | Returns: best visual type

Deprecated: (Since version 3.22)Visual selection should be done using `screenGetSystemVisual` and `screenGetRgbaVisual`

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

## getBestWithBoth

visualGetBestWithBoth Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Int32 | `depth`: a bit depth
-> VisualType | `visualType`: a visual type
-> m (Maybe Visual) | Returns: best visual with both `depth` and `visualType`, or `Nothing` if none

Deprecated: (Since version 3.22)Visual selection should be done using `screenGetSystemVisual` and `screenGetRgbaVisual`

Combines `visualGetBestWithDepth` and `visualGetBestWithType`.

## getBestWithDepth

visualGetBestWithDepth Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Int32 | `depth`: a bit depth
-> m Visual | Returns: best visual for the given depth

Deprecated: (Since version 3.22)Visual selection should be done using `screenGetSystemVisual` and `screenGetRgbaVisual`

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

## getBestWithType

visualGetBestWithType Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> VisualType | `visualType`: a visual type
-> m Visual | Returns: best visual of the given type

Deprecated: (Since version 3.22)Visual selection should be done using `screenGetSystemVisual` and `screenGetRgbaVisual`

Get the best visual of the given `visualType` for the default GDK screen. Visuals with higher color depths are considered better. The return value should not be freed. `Nothing` may be returned if no visual has type `visualType`.

## getBitsPerRgb

visualGetBitsPerRgb Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: a `Visual`
-> m Int32 | Returns: The number of significant bits per color value for `visual`.

Deprecated: (Since version 3.22.)Use `visualGetRedPixelDetails` and its variants to learn about the pixel layout of TrueColor and DirectColor visuals

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

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

Since: 2.22

## getBluePixelDetails

visualGetBluePixelDetails Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: a `Visual`
-> m (Word32, Int32, Int32) |

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.

Since: 2.22

## getByteOrder

visualGetByteOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: A `Visual`.
-> m ByteOrder | Returns: A `ByteOrder` stating the byte order of `visual`.

Deprecated: (Since version 3.22)This information is not useful

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.

Since: 2.22

## getColormapSize

visualGetColormapSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: A `Visual`.
-> m Int32 | Returns: The size of a colormap that is suitable for `visual`.

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

Returns the size of a colormap for this visual.

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

Since: 2.22

## getDepth

visualGetDepth Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: A `Visual`.
-> m Int32 | Returns: The bit depth of this visual.

Returns the bit depth of this visual.

Since: 2.22

## getGreenPixelDetails

visualGetGreenPixelDetails Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: a `Visual`
-> m (Word32, Int32, Int32) |

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.

Since: 2.22

## getRedPixelDetails

visualGetRedPixelDetails Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: A `Visual`
-> m (Word32, Int32, Int32) |

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.

Since: 2.22

## getScreen

visualGetScreen Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: a `Visual`
-> m Screen | Returns: the screen to which this visual belongs.

Gets the screen to which this visual belongs

Since: 2.2

## getSystem

visualGetSystem Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Visual | Returns: system visual

Deprecated: (Since version 3.22)Use gdk_screen_get_system_visual (gdk_screen_get_default ()).

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.

## getVisualType

visualGetVisualType Source #

Arguments

:: (HasCallStack, MonadIO m, IsVisual a) |
=> a | `visual`: A `Visual`.
-> m VisualType | Returns: A `VisualType` stating the type of `visual`.

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

Since: 2.22