#include "ev-document-security.h"
#include "ev-document-find.h"
#include "ev-document-layers.h"
+#include "ev-document-annotations.h"
#include "ev-debug.h"
#include <errno.h>
job_render->image_mapping =
ev_document_images_get_image_mapping (EV_DOCUMENT_IMAGES (job->document),
job_render->page);
+ if ((job_render->flags & EV_RENDER_INCLUDE_ANNOTS) && EV_IS_DOCUMENT_ANNOTATIONS (job->document))
+ job_render->annots_mapping =
+ ev_document_annotations_get_annotations (EV_DOCUMENT_ANNOTATIONS (job->document),
+ job_render->ev_page);
g_object_unref (rc);
ev_document_doc_mutex_unlock ();
EV_RENDER_INCLUDE_SELECTION = 1 << 2,
EV_RENDER_INCLUDE_IMAGES = 1 << 3,
EV_RENDER_INCLUDE_FORMS = 1 << 4,
- EV_RENDER_INCLUDE_ALL = (1 << 5) - 1
+ EV_RENDER_INCLUDE_ANNOTS = 1 << 5,
+ EV_RENDER_INCLUDE_ALL = (1 << 6) - 1
} EvRenderFlags;
struct _EvJobRender
GdkRegion *text_mapping;
GList *image_mapping;
GList *form_field_mapping;
+ GList *annots_mapping;
cairo_surface_t *selection;
GdkRegion *selection_region;
#include "ev-document-images.h"
#include "ev-document-forms.h"
#include "ev-document-links.h"
+#include "ev-document-annotations.h"
#include "ev-image.h"
#include "ev-form-field.h"
+#include "ev-annotation.h"
typedef struct _CacheJobInfo
{
GList *link_mapping;
GList *image_mapping;
GList *form_field_mapping;
+ GList *annots_mapping;
GdkRegion *text_mapping;
/* Selection data.
ev_form_field_mapping_free (job_info->form_field_mapping);
job_info->form_field_mapping = NULL;
}
+ if (job_info->annots_mapping) {
+ ev_annotation_mapping_free (job_info->annots_mapping);
+ job_info->annots_mapping = NULL;
+ }
if (job_info->text_mapping) {
gdk_region_destroy (job_info->text_mapping);
job_info->text_mapping = NULL;
job_info->link_mapping = NULL;
job_info->image_mapping = NULL;
job_info->form_field_mapping = NULL;
+ job_info->annots_mapping = NULL;
if (new_priority != priority && target_page->job) {
ev_job_scheduler_update_job (target_page->job, new_priority);
job_info->form_field_mapping = job_render->form_field_mapping;
}
+ if (job_render->flags & EV_RENDER_INCLUDE_ANNOTS) {
+ if (job_info->annots_mapping)
+ ev_annotation_mapping_free (job_info->annots_mapping);
+ job_info->annots_mapping = job_render->annots_mapping;
+ }
+
if (job_render->flags & EV_RENDER_INCLUDE_TEXT) {
if (job_info->text_mapping)
gdk_region_destroy (job_info->text_mapping);
flags |= EV_RENDER_INCLUDE_IMAGES;
if (job_info->form_field_mapping == NULL)
flags |= EV_RENDER_INCLUDE_FORMS;
+ if (job_info->annots_mapping == NULL)
+ flags |= EV_RENDER_INCLUDE_ANNOTS;
if (job_info->text_mapping == NULL)
flags |= EV_RENDER_INCLUDE_TEXT;
return job_info->form_field_mapping;
}
+GList *
+ev_pixbuf_cache_get_annots_mapping (EvPixbufCache *pixbuf_cache,
+ gint page)
+{
+ CacheJobInfo *job_info;
+
+ if (!EV_IS_DOCUMENT_ANNOTATIONS (pixbuf_cache->document))
+ return NULL;
+
+ job_info = find_job_cache (pixbuf_cache, page);
+ if (job_info == NULL)
+ return NULL;
+
+ /* We don't need to wait for the idle to handle the callback */
+ if (job_info->job &&
+ EV_JOB (job_info->job)->finished) {
+ copy_job_to_job_info (EV_JOB_RENDER (job_info->job), job_info, pixbuf_cache);
+ }
+
+ return job_info->annots_mapping;
+}
+
static gboolean
new_selection_surface_needed (EvPixbufCache *pixbuf_cache,
CacheJobInfo *job_info,