Commit 85d87006 authored by Moritz Lipp's avatar Moritz Lipp

Save if annotation has an appearance stream

parent e62f8634
Pipeline #139 passed with stage
......@@ -32,6 +32,9 @@ zathura_annotation_new(zathura_page_t* page, zathura_annotation_t** annotation,
/* Save page */
(*annotation)->page = page;
/* Initialize defaults */
(*annotation)->has_appearance_stream = false;
/* Set type */
switch (type) {
case ZATHURA_ANNOTATION_UNKNOWN:
......@@ -450,6 +453,31 @@ zathura_annotation_get_page(zathura_annotation_t* annotation,
return ZATHURA_ERROR_OK;
}
zathura_error_t
zathura_annotation_has_appearance_stream(zathura_annotation_t* annotation,
bool* has_appearance_stream)
{
if (annotation == NULL || has_appearance_stream == NULL) {
return ZATHURA_ERROR_INVALID_ARGUMENTS;
}
*has_appearance_stream = annotation->has_appearance_stream;
return ZATHURA_ERROR_OK;
}
zathura_error_t zathura_annotation_set_appearance_stream(zathura_annotation_t*
annotation, bool has_appearance_stream)
{
if (annotation == NULL) {
return ZATHURA_ERROR_INVALID_ARGUMENTS;
}
annotation->has_appearance_stream = has_appearance_stream;
return ZATHURA_ERROR_OK;
}
zathura_error_t
zathura_annotation_set_user_data(zathura_annotation_t*
annotation, void* data, zathura_free_function_t free_function)
......
......@@ -408,6 +408,19 @@ zathura_error_t zathura_annotation_get_color(zathura_annotation_t* annotation,
zathura_error_t zathura_annotation_get_page(zathura_annotation_t* annotation,
zathura_page_t** page);
/**
* Checks if the annotation has an appearance stream
*
* @param[in] annotation The used annotation object
* @param[out] has_appearance_stream If the object has an appearance stream
*
* @return ZATHURA_ERROR_OK No error occurred
* @return ZATHURA_ERROR_INVALID_ARGUMENTS Invalid arguments have been passed
* @return ZATHURA_ERROR_UNKNOWN An unspecified error occurred
*/
zathura_error_t zathura_annotation_has_appearance_stream(zathura_annotation_t* annotation,
bool* has_appearance_stream);
/**
* Renders the annotation to a @a ::zathura_image_buffer_t image buffer
*
......
......@@ -63,6 +63,11 @@ struct zathura_annotation_s {
*/
zathura_annotation_color_t color;
/**
* Set by the plugin if the annotation has an appearance stream
*/
bool has_appearance_stream;
/**
* Describes if the annotation is a markup annotation
*/
......
......@@ -34,7 +34,21 @@ zathura_error_t zathura_annotation_set_user_data(zathura_annotation_t*
* @return ZATHURA_ERROR_INVALID_ARGUMENTS Invalid arguments have been passed
* @return ZATHURA_ERROR_UNKNOWN An unspecified error occurred
*/
zathura_error_t zathura_annotation_get_user_data(zathura_annotation_t* annotation, void** data);
zathura_error_t zathura_annotation_get_user_data(zathura_annotation_t*
annotation, void** data);
/**
* Sets if the annotation has an appearance stream
*
* @param[in] annotation The annotation object
* @param[out] has_appearance_stream If the annotation has an appearance stream
*
* @return ZATHURA_ERROR_OK No error occurred
* @return ZATHURA_ERROR_INVALID_ARGUMENTS Invalid arguments have been passed
* @return ZATHURA_ERROR_UNKNOWN An unspecified error occurred
*/
zathura_error_t zathura_annotation_set_appearance_stream(zathura_annotation_t*
annotation, bool has_appearance_stream);
#ifdef __cplusplus
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment