gtkmm  4.16.0
Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gdk::DmabufFormats Class Referencefinal

Gdk::DmabufFormats provides information about supported DMA buffer formats. More...

#include <gdkmm/dmabufformats.h>

Public Member Functions

void reference () const
 Increment the reference count for this object. More...
 
void unreference () const
 Decrement the reference count for this object. More...
 
GdkDmabufFormats* gobj ()
 Provides access to the underlying C instance. More...
 
const GdkDmabufFormats* gobj () const
 Provides access to the underlying C instance. More...
 
GdkDmabufFormats* gobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
 DmabufFormats ()=delete
 
 DmabufFormats (const DmabufFormats&)=delete
 
DmabufFormatsoperator= (const DmabufFormats&)=delete
 
gsize get_n_formats () const
 Returns the number of formats that the formats object contains. More...
 
std::pair< guint32, guint64 > get_format (gsize idx) const
 Gets the fourcc code and modifier for a format. More...
 
bool contains (guint32 fourcc, guint64 modifier) const
 Returns whether a given format is contained in formats. More...
 
bool equal (const Glib::RefPtr< const DmabufFormats >& formats2) const
 Returns whether formats1 and formats2 contain the same dmabuf formats, in the same order. More...
 

Protected Member Functions

void operator delete (void*, std::size_t)
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::DmabufFormatswrap (GdkDmabufFormats* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

Gdk::DmabufFormats provides information about supported DMA buffer formats.

You can query whether a given format is supported with contains() and you can iterate over the list of all supported formats with get_n_formats() and get_format().

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

See Gdk::DmabufTextureBuilder for more information about DMA buffers.

Get a DmabufFormats object with Gdk::Display::get_dmabuf_formats().

Note that DMA buffers only exist on Linux.

Since gtkmm 4.14:

Constructor & Destructor Documentation

Gdk::DmabufFormats::DmabufFormats ( )
delete
Gdk::DmabufFormats::DmabufFormats ( const DmabufFormats )
delete

Member Function Documentation

bool Gdk::DmabufFormats::contains ( guint32  fourcc,
guint64  modifier 
) const

Returns whether a given format is contained in formats.

Since gtkmm 4.14:
Parameters
fourccA format code.
modifierA format modifier.
Returns
true if the format specified by the arguments is part of formats.
bool Gdk::DmabufFormats::equal ( const Glib::RefPtr< const DmabufFormats >&  formats2) const

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

Since gtkmm 4.14:
Parameters
formats2Another Gdk::DmabufFormats.
Returns
true if formats1 and formats2 are equal.
std::pair<guint32, guint64> Gdk::DmabufFormats::get_format ( gsize  idx) const

Gets the fourcc code and modifier for a format.

Since gtkmm 4.14:
Parameters
idxThe index of the format to return.
Returns
{fourcc, modifier} The format code and the format modifier.
gsize Gdk::DmabufFormats::get_n_formats ( ) const

Returns the number of formats that the formats object contains.

Note that DMA buffers are a Linux concept, so on other platforms, get_n_formats() will always return zero.

Since gtkmm 4.14:
Returns
The number of formats.
GdkDmabufFormats* Gdk::DmabufFormats::gobj ( )

Provides access to the underlying C instance.

const GdkDmabufFormats* Gdk::DmabufFormats::gobj ( ) const

Provides access to the underlying C instance.

GdkDmabufFormats* Gdk::DmabufFormats::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

void Gdk::DmabufFormats::operator delete ( void *  ,
std::size_t   
)
protected
DmabufFormats& Gdk::DmabufFormats::operator= ( const DmabufFormats )
delete
void Gdk::DmabufFormats::reference ( ) const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

void Gdk::DmabufFormats::unreference ( ) const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

Friends And Related Function Documentation

Glib::RefPtr< Gdk::DmabufFormats > wrap ( GdkDmabufFormats *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.