gi-gdk4-4.0.10: Gdk bindings

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

GI.Gdk.Structs.DmabufFormats

Contents

- Exported types
- Methods
  - contains
  - equal
  - getFormat
  - getNFormats
  - ref
  - unref

Description

Provides information about supported DMA buffer formats.

You can query whether a given format is supported with `dmabufFormatsContains` and you can iterate over the list of all supported formats with `dmabufFormatsGetNFormats` and `dmabufFormatsGetFormat`.

The list of supported formats is sorted by preference, with the best formats coming first.

The list may contains (format, modifier) pairs where the modifier is `DMA_FORMAT_MOD_INVALID`, indicating that _implicit modifiers_ may be used with this format.

See `DmabufTextureBuilder` for more information about DMA buffers.

Note that DMA buffers only exist on Linux.

Since: 4.14

Synopsis

- newtype DmabufFormats = DmabufFormats (ManagedPtr DmabufFormats)
- dmabufFormatsContains :: (HasCallStack, MonadIO m) => DmabufFormats -> Word32 -> Word64 -> m Bool
- dmabufFormatsEqual :: (HasCallStack, MonadIO m) => Maybe DmabufFormats -> Maybe DmabufFormats -> m Bool
- dmabufFormatsGetFormat :: (HasCallStack, MonadIO m) => DmabufFormats -> CSize -> m (Word32, Word64)
- dmabufFormatsGetNFormats :: (HasCallStack, MonadIO m) => DmabufFormats -> m CSize
- dmabufFormatsRef :: (HasCallStack, MonadIO m) => DmabufFormats -> m DmabufFormats
- dmabufFormatsUnref :: (HasCallStack, MonadIO m) => DmabufFormats -> m ()

# Exported types

newtype DmabufFormats Source #

Memory-managed wrapper type.

Constructors

DmabufFormats (ManagedPtr DmabufFormats) |

#### Instances

Instances details

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

# Methods

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

Expand

#### Methods

contains, equal, ref, unref.

#### Getters

getFormat, getNFormats.

#### Setters

None.

## contains

dmabufFormatsContains Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> DmabufFormats | `formats`: a `GdkDmabufFormats`
-> Word32 | `fourcc`: a format code
-> Word64 | `modifier`: a format modifier
-> m Bool | Returns: `TRUE` if the format specified by the arguments is part of `formats`

Returns whether a given format is contained in `formats`.

Since: 4.14

## equal

dmabufFormatsEqual Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Maybe DmabufFormats | `formats1`: a `GdkDmabufFormats`
-> Maybe DmabufFormats | `formats2`: another `GdkDmabufFormats`
-> m Bool | Returns: `TRUE` if `formats1` and `formats2` are equal

Returns whether `formats1` and `formats2` contain the same dmabuf formats, in the same order.

Since: 4.14

## getFormat

dmabufFormatsGetFormat Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> DmabufFormats | `formats`: a `GdkDmabufFormats`
-> CSize | `idx`: the index of the format to return
-> m (Word32, Word64) |

Gets the fourcc code and modifier for a format that is contained in `formats`.

Since: 4.14

## getNFormats

dmabufFormatsGetNFormats Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> DmabufFormats | `formats`: a `GdkDmabufFormats`
-> m CSize | Returns: the number of formats

Returns the number of formats that the `formats` object contains.

Note that DMA buffers are a Linux concept, so on other platforms, `dmabufFormatsGetNFormats` will always return zero.

Since: 4.14

## ref

dmabufFormatsRef Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> DmabufFormats | `formats`: a `GdkDmabufFormats`
-> m DmabufFormats | Returns: the passed-in object

Increases the reference count of `formats`.

Since: 4.14

## unref

dmabufFormatsUnref Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> DmabufFormats | `formats`: a `GdkDmabufFormats`
-> m () |

Decreases the reference count of `formats`.

When the reference count reaches zero, the object is freed.

Since: 4.14