Commit 7c99fa90 authored by Moritz Lipp's avatar Moritz Lipp

Init and clear functions for annotation border

parent d4646148
Pipeline #143 passed with stage
in 13 minutes and 10 seconds
......@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "../annotations.h"
#include "annotation-caret.h"
......
/* See LICENSE file for license and copyright information */
#include "border.h"
zathura_error_t
zathura_annotation_border_init(zathura_annotation_border_t* annotation_border)
{
if (annotation_border == NULL) {
return ZATHURA_ERROR_INVALID_ARGUMENTS;
}
annotation_border->width = 1;
annotation_border->style = ZATHURA_ANNOTATION_BORDER_STYLE_SOLID;
annotation_border->dash_pattern.dash_array = NULL;
annotation_border->dash_pattern.dash_phase = 0;
annotation_border->effect = ZATHURA_ANNOTATION_BORDER_EFFECT_NONE;
annotation_border->intensity = 0;
return ZATHURA_ERROR_OK;
}
zathura_error_t
zathura_annotation_border_clear(zathura_annotation_border_t* annotation_border)
{
if (annotation_border == NULL) {
return ZATHURA_ERROR_INVALID_ARGUMENTS;
}
if (annotation_border->dash_pattern.dash_array != NULL) {
zathura_list_free(annotation_border->dash_pattern.dash_array);
annotation_border->dash_pattern.dash_array = NULL;
}
return ZATHURA_ERROR_OK;
}
......@@ -8,6 +8,7 @@ extern "C" {
#endif
#include "../list.h"
#include "../error.h"
/**
* The border style.
......@@ -107,6 +108,9 @@ typedef struct zathura_annotation_border_s {
float intensity;
} zathura_annotation_border_t;
zathura_error_t zathura_annotation_border_init(zathura_annotation_border_t* annotation_border);
zathura_error_t zathura_annotation_border_clear(zathura_annotation_border_t* annotation_border);
#ifdef __cplusplus
}
#endif
......
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