Go to the documentation of this file.
18 #ifndef _PSX_SVG_ANIMATION_H_
19 #define _PSX_SVG_ANIMATION_H_
psx_result
Status code return by call APIs.
PEXPORT psx_svg_player *PICAPI psx_svg_player_create(const psx_svg *root, psx_result *err)
Create a new animation player from an already-parsed SVG document.
PEXPORT void PICAPI psx_svg_player_seek(psx_svg_player *p, float seconds)
Seek the animation to an absolute time position.
PEXPORT void PICAPI psx_svg_player_tick(psx_svg_player *p, float delta_seconds)
Advance the animation by a relative time delta.
@ PSX_SVG_ANIM_EVENT_BEGIN
struct _psx_svg_player psx_svg_player
An opaque type represents an svg animation player.
void(* psx_svg_anim_event_cb)(psx_svg_anim_event_type type, const char *anim_id, void *user_data)
The callback for SVG animation event.
psx_svg_player_state
SVG animation player status.
PEXPORT void PICAPI psx_svg_player_trigger(psx_svg_player *p, const char *target_id, const char *event_name)
Send an external event trigger to the player.
PEXPORT void PICAPI psx_svg_player_send_key(psx_svg_player *p, char key)
Forward a keyboard event to the player.
PEXPORT bool PICAPI psx_svg_player_get_loop(const psx_svg_player *p)
Return whether the animation looping is enabled.
PEXPORT void PICAPI psx_svg_player_destroy(psx_svg_player *p)
Destroy the psx_svg_player object and release resources.
psx_svg_anim_event_type
SVG animation event callback types.
PEXPORT void PICAPI psx_svg_player_set_event_callback(psx_svg_player *p, psx_svg_anim_event_cb cb, void *user)
Set a callback to receive animation events (begin, end, repeat).
PEXPORT psx_svg_player_state PICAPI psx_svg_player_get_state(const psx_svg_player *p)
Return the current playback state of the player.
PEXPORT float PICAPI psx_svg_player_get_duration(const psx_svg_player *p)
Return the total duration of the animation.
PEXPORT void PICAPI psx_svg_player_pause(psx_svg_player *p)
Pause the animation at the current time.
PEXPORT int32_t PICAPI psx_svg_player_get_dpi(const psx_svg_player *p)
Return the current DPI value.
PEXPORT void PICAPI psx_svg_player_draw(psx_svg_player *p, ps_context *ctx)
Draw the current animation frame into the provided Picasso context.
PEXPORT float PICAPI psx_svg_player_get_time(const psx_svg_player *p)
Return the current playback time in seconds.
PEXPORT void PICAPI psx_svg_player_stop(psx_svg_player *p)
Stop the animation and seek to time 0.
PEXPORT void PICAPI psx_svg_player_set_loop(psx_svg_player *p, bool loop)
Set whether the animation should loop when it reaches the end.
struct _ps_context ps_context
An opaque type represents a Picasso drawing environment.
struct _psx_svg psx_svg
An opaque type represents an svg document.
PEXPORT void PICAPI psx_svg_player_set_dpi(psx_svg_player *p, int32_t dpi)
Set the DPI (dots per inch) used for unit conversion.
@ PSX_SVG_ANIM_EVENT_REPEAT
PEXPORT void PICAPI psx_svg_player_play(psx_svg_player *p)
Start or resume playback of the animation.