cairomm 1.19.0
|
The script surface provides the ability to render to a native script that matches the cairo drawing model. More...
#include <cairomm/script.h>
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. | |
![]() | |
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 | |
![]() | |
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 |
![]() | |
cobject * | m_cobject |
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.
|
explicit |
Create a C++ wrapper for the C instance.
This C++ instance should then be given to a RefPtr.
cobject | The C instance. |
has_reference | whether we already have a reference. Otherwise, the constructor will take an extra reference. |
|
override |
void Cairo::Script::add_from_recording_surface | ( | const RefPtr< ScriptSurface > & | recording_surface | ) |
Converts the record operations in recording_surface into a script.
recording_surface | The recording surface to replay |
Throws an exception on error.
|
static |
Creates a output device for emitting the script, used when creating the individual surfaces.
filename | The name (path) of the file to write the script to. |
Throws an exception on error.
|
static |
Creates a output device for emitting the script, used when creating the individual surfaces.
write_func | Callback function passed the bytes written to the script |
ScriptMode Cairo::Script::get_mode | ( | ) | const |
Queries the script for its current output mode.
void Cairo::Script::set_mode | ( | ScriptMode | new_mode | ) |
Change the output mode of the script.
mode | The new mode. |
void Cairo::Script::write_comment | ( | const std::string & | comment | ) |
Emit a string verbatim into the script.
comment | The string to emit |