Attach user data to cr. To remove user data from a surface, call this function with the key that was used to set it and NULL for data. Since 1.4

class Context
void* userData
cairo_destroy_func_t destroy


key cairo_user_data_key_t*

the address of a cairo_user_data_key_t to attach the user data to

userData void*

the user data to attach to the cairo_t

destroy cairo_destroy_func_t

a cairo_destroy_func_t which will be called when the cairo_t is destroyed or when new user data is attached using the same key.

Return Value

CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY if a slot could not be allocated for the user data.