jpayne@68: jpayne@68: jpayne@68:
jpayne@68: jpayne@68:jpayne@68: Top jpayne@68: | jpayne@68:![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68:
jpayne@68: Script Surfacesjpayne@68:Script Surfaces — Rendering to replayable scripts jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: cairo_device_t * jpayne@68: | jpayne@68:jpayne@68: cairo_script_create () jpayne@68: | jpayne@68:
jpayne@68: cairo_device_t * jpayne@68: | jpayne@68:jpayne@68: cairo_script_create_for_stream () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_script_from_recording_surface () jpayne@68: | jpayne@68:
jpayne@68: cairo_script_mode_t jpayne@68: | jpayne@68:jpayne@68: cairo_script_get_mode () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_script_set_mode () jpayne@68: | jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_script_surface_create () jpayne@68: | jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_script_surface_create_for_target () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_script_write_comment () jpayne@68: | jpayne@68:
#define | jpayne@68:CAIRO_HAS_SCRIPT_SURFACE | jpayne@68:
enum | jpayne@68:cairo_script_mode_t | jpayne@68:
The script surface provides the ability to render to a native jpayne@68: script that matches the cairo drawing model. The scripts can jpayne@68: be replayed using tools under the util/cairo-script directory, jpayne@68: or with cairo-perf-trace.
jpayne@68:cairo_device_t *
jpayne@68: cairo_script_create (const char *filename
);
jpayne@68: Creates a output device for emitting the script, used when jpayne@68: creating the individual surfaces.
jpayne@68:filename |
jpayne@68: the name (path) of the file to write the script to |
jpayne@68: jpayne@68: |
a pointer to the newly created device. The caller
jpayne@68: owns the surface and should call cairo_device_destroy()
when done
jpayne@68: with it.
This function always returns a valid pointer, but it will return a
jpayne@68: pointer to a "nil" device if an error such as out of memory
jpayne@68: occurs. You can use cairo_device_status()
to check for this.
Since: 1.12
jpayne@68:cairo_device_t * jpayne@68: cairo_script_create_for_stream (jpayne@68:cairo_write_func_t write_func
, jpayne@68:void *closure
);
Creates a output device for emitting the script, used when jpayne@68: creating the individual surfaces.
jpayne@68:write_func |
jpayne@68: callback function passed the bytes written to the script |
jpayne@68: jpayne@68: |
closure |
jpayne@68: user data to be passed to the callback |
jpayne@68: jpayne@68: |
a pointer to the newly created device. The caller
jpayne@68: owns the surface and should call cairo_device_destroy()
when done
jpayne@68: with it.
This function always returns a valid pointer, but it will return a
jpayne@68: pointer to a "nil" device if an error such as out of memory
jpayne@68: occurs. You can use cairo_device_status()
to check for this.
Since: 1.12
jpayne@68:cairo_status_t jpayne@68: cairo_script_from_recording_surface (jpayne@68:cairo_device_t *script
, jpayne@68:cairo_surface_t *recording_surface
);
Converts the record operations in recording_surface
jpayne@68: into a script.
script |
jpayne@68: the script (output device) |
jpayne@68: jpayne@68: |
recording_surface |
jpayne@68: the recording surface to replay |
jpayne@68: jpayne@68: |
CAIRO_STATUS_SUCCESS on successful completion or an error code.
jpayne@68:Since: 1.12
jpayne@68:cairo_script_mode_t
jpayne@68: cairo_script_get_mode (cairo_device_t *script
);
jpayne@68: Queries the script for its current output mode.
jpayne@68:script |
jpayne@68: The script (output device) to query |
jpayne@68: jpayne@68: |
Since: 1.12
jpayne@68:void jpayne@68: cairo_script_set_mode (jpayne@68:cairo_device_t *script
, jpayne@68:cairo_script_mode_t mode
);
Change the output mode of the script
jpayne@68:script |
jpayne@68: The script (output device) |
jpayne@68: jpayne@68: |
mode |
jpayne@68: the new mode |
jpayne@68: jpayne@68: |
Since: 1.12
jpayne@68:cairo_surface_t * jpayne@68: cairo_script_surface_create (jpayne@68:cairo_device_t *script
, jpayne@68:cairo_content_t content
, jpayne@68:double width
, jpayne@68:double height
);
Create a new surface that will emit its rendering through script
jpayne@68:
script |
jpayne@68: the script (output device) |
jpayne@68: jpayne@68: |
content |
jpayne@68: the content of the surface |
jpayne@68: jpayne@68: |
width |
jpayne@68: width in pixels |
jpayne@68: jpayne@68: |
height |
jpayne@68: height in pixels |
jpayne@68: jpayne@68: |
a pointer to the newly created surface. The caller
jpayne@68: owns the surface and should call cairo_surface_destroy()
when done
jpayne@68: with it.
This function always returns a valid pointer, but it will return a
jpayne@68: pointer to a "nil" surface if an error such as out of memory
jpayne@68: occurs. You can use cairo_surface_status()
to check for this.
Since: 1.12
jpayne@68:cairo_surface_t * jpayne@68: cairo_script_surface_create_for_target jpayne@68: (jpayne@68:cairo_device_t *script
, jpayne@68:cairo_surface_t *target
);
Create a pxoy surface that will render to target
jpayne@68: and record
jpayne@68: the operations to device
jpayne@68: .
script |
jpayne@68: the script (output device) |
jpayne@68: jpayne@68: |
target |
jpayne@68: a target surface to wrap |
jpayne@68: jpayne@68: |
a pointer to the newly created surface. The caller
jpayne@68: owns the surface and should call cairo_surface_destroy()
when done
jpayne@68: with it.
This function always returns a valid pointer, but it will return a
jpayne@68: pointer to a "nil" surface if an error such as out of memory
jpayne@68: occurs. You can use cairo_surface_status()
to check for this.
Since: 1.12
jpayne@68:void jpayne@68: cairo_script_write_comment (jpayne@68:cairo_device_t *script
, jpayne@68:const char *comment
, jpayne@68:int len
);
Emit a string verbatim into the script.
jpayne@68:script |
jpayne@68: the script (output device) |
jpayne@68: jpayne@68: |
comment |
jpayne@68: the string to emit |
jpayne@68: jpayne@68: |
len |
jpayne@68: the length of the sting to write, or -1 to use |
jpayne@68: jpayne@68: |
Since: 1.12
jpayne@68:#define CAIRO_HAS_SCRIPT_SURFACE 1 jpayne@68:jpayne@68:
Defined if the script surface backend is available. jpayne@68: The script surface backend is always built in since 1.12.
jpayne@68:Since: 1.12
jpayne@68:A set of script output variants.
jpayne@68:jpayne@68: |
jpayne@68: the output will be in readable text (default). (Since 1.12) jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: the output will use byte codes. (Since 1.12) jpayne@68: |
jpayne@68: jpayne@68: |
Since: 1.12
jpayne@68: