cairomm: Cairo::XlibDevice Class Reference

cairomm 1.19.1

Public Member Functions | List of all members
Cairo::XlibDevice Class Reference

An Xlib device. More...

`#include <cairomm/xlib_device.h>`

Inheritance diagram for Cairo::XlibDevice:
[legend]

## Public Member Functions
| XlibDevice (cairo_device_t *cobject, bool has_reference=false)
| Create a C++ wrapper for the C instance.
| ~XlibDevice () override
void | debug_cap_xrender_version (int major_version, int minor_version)
| Restricts all future Xlib surfaces for this device to the specified version of the RENDER extension.
int | debug_get_precision () const
| Returns the Xrender precision mode.
void | debug_set_precision (int precision)
| The Xrender extension supports two modes of precision when rendering trapezoids.
Public Member Functions inherited from Cairo::Device
| Device (cairo_device_t *cobject, bool has_reference=false)
| Create a C++ wrapper for the C instance.
virtual | ~Device ()
DeviceType | get_type () const
| This function returns the type of the device.
void | flush ()
| Finish any pending operations for the device and also restore any temporary modifications cairo has made to the device's state.
void | finish ()
| This function finishes the device and drops all references to external resources.
void | acquire ()
| Acquires the device for the current thread.
void | release ()
| Releases a device previously acquired using acquire().
cobject * | cobj ()
const cobject * | cobj () const
void | reference () const
void | unreference () const

## Additional Inherited Members
Public Types inherited from Cairo::Device
enum class | DeviceType { DRM = CAIRO_DEVICE_TYPE_DRM , GL = CAIRO_DEVICE_TYPE_GL , SCRIPT = CAIRO_DEVICE_TYPE_SCRIPT , XCB = CAIRO_DEVICE_TYPE_XCB , XLIB = CAIRO_DEVICE_TYPE_XLIB , XML = CAIRO_DEVICE_TYPE_XML }
typedef cairo_device_t | cobject
Protected Attributes inherited from Cairo::Device
cobject * | m_cobject

## Detailed Description

An Xlib device.

An XlibDevice object can be created from an XlibSurface object with Surface::get_device(). It returns a RefPtr<Device>, which can be cast to a RefPtr<XlibDevice> if the Surface is an XlibSurface.

Cairo::RefPtr<Device> device = xlib_surface->get_device();
Cairo::RefPtr<XlibDevice> xlib_device = std::dynamic_pointer_cast<Cairo::XlibDevice>(device);
if (xlib_device)
do_something(xlib_device);
std::dynamic_pointer_cast
__shared_ptr< _Tp, _Lp > dynamic_pointer_cast(const __shared_ptr< _Tp1, _Lp > &__r) noexcept
Cairo::RefPtr
std::shared_ptr< T_CppObject > RefPtr
RefPtr<> is a reference-counting shared smartpointer.
Definition refptr.h:39

Note
  For this Device to be available, cairo must have been compiled with Xlib support.

Since cairomm 1.20

## Constructor & Destructor Documentation

## ◆ XlibDevice()

Cairo::XlibDevice::XlibDevice | ( | cairo_device_t * | cobject,
|  | bool | has_reference = false )
| explicit

Create a C++ wrapper for the C instance.

This C++ instance should then be given to a RefPtr.

Parameters

  cobject | The C instance.
  has_reference | Whether we already have a reference. Otherwise, the constructor will take an extra reference.

Since cairomm 1.20

## ◆ ~XlibDevice()

Cairo::XlibDevice::~XlibDevice | ( |  | ) |
| override

## Member Function Documentation

## ◆ debug_cap_xrender_version()

void Cairo::XlibDevice::debug_cap_xrender_version | ( | int | major_version,
|  | int | minor_version )

Restricts all future Xlib surfaces for this device to the specified version of the RENDER extension.

This function exists solely for debugging purpose. It lets you find out how Cairomm would behave with an older version of the RENDER extension.

Use the special values -1 and -1 for disabling the RENDER extension.

Parameters

  major_version | Major version to restrict to.
  minor_version | Minor version to restrict to.

Since cairomm 1.20

## ◆ debug_get_precision()

int Cairo::XlibDevice::debug_get_precision | ( |  | ) | const

Returns the Xrender precision mode.

Since cairomm 1.20

## ◆ debug_set_precision()

void Cairo::XlibDevice::debug_set_precision | ( | int | precision | ) |

The Xrender extension supports two modes of precision when rendering trapezoids.

Set the precision to the desired mode.

Since cairomm 1.20

The documentation for this class was generated from the following file:

- cairomm/xlib_device.h