From f449fe60b01482b925fe09b75c4cf8aaa16b95cb Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 3 Mar 2018 11:18:36 +0100 Subject: Add annotation quadding accessor. --- source/pdf/pdf-annot-edit.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source') diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index 799fb9b7..b6cda909 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -479,6 +479,21 @@ pdf_set_annot_border(fz_context *ctx, pdf_annot *annot, float w) pdf_dirty_annot(ctx, annot); } +int +pdf_annot_quadding(fz_context *ctx, pdf_annot *annot) +{ + int q = pdf_to_int(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_Q)); + return (q < 0 || q > 2) ? 0 : q; +} + +void +pdf_set_annot_quadding(fz_context *ctx, pdf_annot *annot, int q) +{ + q = (q < 0 || q > 2) ? 0 : q; + pdf_dict_put_int(ctx, annot->obj, PDF_NAME_Q, q); + pdf_dirty_annot(ctx, annot); +} + float pdf_annot_opacity(fz_context *ctx, pdf_annot *annot) { pdf_obj *ca = pdf_dict_get(ctx, annot->obj, PDF_NAME_CA); -- cgit v1.2.3