summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2013-01-30 16:49:43 +0000
committerRobin Watts <robin.watts@artifex.com>2013-01-31 11:17:32 +0000
commitaeed1e16e440cefbf5137eef7f4af608b0c70569 (patch)
tree40a55a1bff17a6ef632eaab053437f40123d1f4e /fitz
parent0203bd8921ffa9569273a077c1cb8bb92a35e520 (diff)
downloadmupdf-aeed1e16e440cefbf5137eef7f4af608b0c70569.tar.xz
Add support for annotation creation
Diffstat (limited to 'fitz')
-rw-r--r--fitz/doc_interactive.c10
-rw-r--r--fitz/fitz-internal.h18
-rw-r--r--fitz/fitz.h1
3 files changed, 29 insertions, 0 deletions
diff --git a/fitz/doc_interactive.c b/fitz/doc_interactive.c
index f2fb059d..ea08577d 100644
--- a/fitz/doc_interactive.c
+++ b/fitz/doc_interactive.c
@@ -81,6 +81,16 @@ void fz_choice_widget_set_value(fz_interactive *idoc, fz_widget *tw, int n, char
pdf_choice_widget_set_value((pdf_document *)idoc, tw, n, opts);
}
+fz_annot *fz_create_annot(fz_interactive *idoc, fz_page *page, fz_annot_type type)
+{
+ return (fz_annot *)pdf_create_annot((pdf_document *)idoc, (pdf_page *)page, type);
+}
+
+void fz_set_annot_appearance(fz_interactive *idoc, fz_annot *annot, fz_display_list *disp_list)
+{
+ pdf_set_annot_appearance((pdf_document *)idoc, (pdf_annot *)annot, disp_list);
+}
+
void fz_set_doc_event_callback(fz_interactive *idoc, fz_doc_event_cb *event_cb, void *data)
{
pdf_set_doc_event_callback((pdf_document *)idoc, event_cb, data);
diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h
index 13fd94de..4839af7d 100644
--- a/fitz/fitz-internal.h
+++ b/fitz/fitz-internal.h
@@ -1194,6 +1194,24 @@ fz_pixmap *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix, fz
void fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, fz_matrix trm, void *gstate, int nestedDepth);
void fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nestedDepth);
+typedef enum
+{
+ FZ_ANNOT_STRIKEOUT
+} fz_annot_type;
+
+/*
+ fz_create_annot: create a new annotation of the specified type on the
+ specified page. The returned pdf_annot structure is owned by the page
+ and does not need to be freed.
+*/
+fz_annot *fz_create_annot(fz_interactive *idoc, fz_page *page, fz_annot_type type);
+
+/*
+ fz_set_annot_appearance: update the appearance of an annotation based
+ on a display list.
+*/
+void fz_set_annot_appearance(fz_interactive *idoc, fz_annot *annot, fz_display_list *disp_list);
+
/*
* Text buffer.
*
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 8f39d3f4..43634dd9 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -2511,6 +2511,7 @@ fz_transition *fz_page_presentation(fz_document *doc, fz_page *page, float *dura
/* Types of widget */
enum
{
+ FZ_WIDGET_TYPE_NOT_WIDGET = -1,
FZ_WIDGET_TYPE_PUSHBUTTON,
FZ_WIDGET_TYPE_CHECKBOX,
FZ_WIDGET_TYPE_RADIOBUTTON,