cairomm: Cairo::Script Class Reference

cairomm 1.19.1

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

The script surface provides the ability to render to a native script that matches the cairo drawing model. More...

`#include <cairomm/script.h>`

Inheritance diagram for Cairo::Script:
[legend]

## Public Member Functions
| Script (cairo_device_t *cobject, bool has_reference=false)
| Create a C++ wrapper for the C instance.
| ~Script () override
void | add_from_recording_surface (const RefPtr< ScriptSurface > & recording_surface)
| Converts the record operations in recording_surface into a script.
ScriptMode | get_mode () const
| Queries the script for its current output mode.
void | set_mode (ScriptMode new_mode)
| Change the output mode of the script.
void | write_comment (const std::string & comment)
| Emit a string verbatim into the script.
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

## Static Public Member Functions
static RefPtr< Script > | create (const std::string & filename)
| Creates a output device for emitting the script, used when creating the individual surfaces.
static RefPtr< Script > | create_for_stream (const Surface::SlotWriteFunc & write_func)
| Creates a output device for emitting the script, used when creating the individual surfaces.

## 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

The script surface provides the ability to render to a native script that matches the cairo drawing model.

The scripts can be replayed using tools under the util/cairo-script directoriy, or with cairo-perf-trace.

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

Since
  1.12

## Constructor & Destructor Documentation

## ◆ Script()

Cairo::Script::Script | ( | 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
  1.12

## ◆ ~Script()

Cairo::Script::~Script | ( |  | ) |
| override

## Member Function Documentation

## ◆ add_from_recording_surface()

void Cairo::Script::add_from_recording_surface | ( | const RefPtr< ScriptSurface > & | recording_surface | ) |

Converts the record operations in recording_surface into a script.

Parameters

  recording_surface | The recording surface to replay

Throws an exception on error.

Since
  1.12

## ◆ create()

RefPtr< Script > Cairo::Script::create | ( | const std::string & | filename | ) |
| static

Creates a output device for emitting the script, used when creating the individual surfaces.

Parameters

  filename | The name (path) of the file to write the script to.

Throws an exception on error.

Since
  1.12

## ◆ create_for_stream()

RefPtr< Script > Cairo::Script::create_for_stream | ( | const Surface::SlotWriteFunc & | write_func | ) |
| static

Creates a output device for emitting the script, used when creating the individual surfaces.

Parameters

  write_func | Callback function passed the bytes written to the script

Since
  1.12

## ◆ get_mode()

ScriptMode Cairo::Script::get_mode | ( |  | ) | const

Queries the script for its current output mode.

Since
  1.12

## ◆ set_mode()

void Cairo::Script::set_mode | ( | ScriptMode | new_mode | ) |

Change the output mode of the script.

Parameters

  mode | The new mode.

Since
  1.12

## ◆ write_comment()

void Cairo::Script::write_comment | ( | const std::string & | comment | ) |

Emit a string verbatim into the script.

Parameters

  comment | The string to emit

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

- cairomm/script.h