#include "ev-document-thumbnails.h"
#include "ev-document-links.h"
#include "ev-document-images.h"
+#include "ev-document-forms.h"
#include "ev-document-factory.h"
+#include "ev-document-misc.h"
#include "ev-file-helpers.h"
#include "ev-document-fonts.h"
#include "ev-selection.h"
job = EV_JOB_RENDER (object);
- if (job->pixbuf) {
- g_object_unref (job->pixbuf);
- job->pixbuf = NULL;
+ if (job->surface) {
+ cairo_surface_destroy (job->surface);
+ job->surface = NULL;
}
if (job->rc) {
}
if (job->selection) {
- g_object_unref (job->selection);
+ cairo_surface_destroy (job->selection);
job->selection = NULL;
}
job->thumbnail = NULL;
}
+ if (job->rc) {
+ g_object_unref (job->rc);
+ job->rc = NULL;
+ }
+
(* G_OBJECT_CLASS (ev_job_thumbnail_parent_class)->dispose) (object);
}
EvRectangle *selection_points,
GdkColor *text,
GdkColor *base,
+ gboolean include_forms,
gboolean include_links,
gboolean include_images,
gboolean include_text,
job->target_height = height;
job->text = *text;
job->base = *base;
+ job->include_forms = include_forms;
job->include_links = include_links;
job->include_images = include_images;
job->include_text = include_text;
}
static void
-render_finished_cb (EvDocument *document, GdkPixbuf *pixbuf, EvJobRender *job)
+render_finished_cb (EvDocument *document,
+ GdkPixbuf *pixbuf,
+ EvJobRender *job)
{
g_signal_handlers_disconnect_by_func (EV_JOB (job)->document,
render_finished_cb, job);
+ /* FIXME: ps backend should be ported to cairo */
+ job->surface = ev_document_misc_surface_from_pixbuf (pixbuf);
EV_JOB (job)->finished = TRUE;
- job->pixbuf = g_object_ref (pixbuf);
ev_job_finished (EV_JOB (job));
}
} else {
ev_document_fc_mutex_lock ();
- job->pixbuf = ev_document_render_pixbuf (EV_JOB (job)->document, job->rc);
+ job->surface = ev_document_render (EV_JOB (job)->document, job->rc);
+
if (job->include_links && EV_IS_DOCUMENT_LINKS (EV_JOB (job)->document))
job->link_mapping =
ev_document_links_get_links (EV_DOCUMENT_LINKS (EV_JOB (job)->document),
job->image_mapping =
ev_document_images_get_images (EV_DOCUMENT_IMAGES (EV_JOB (job)->document),
job->rc->page);
+ if (job->include_forms && EV_IS_DOCUMENT_FORMS (EV_JOB (job)->document))
+ job->form_field_mapping =
+ ev_document_forms_get_form_fields (EV_DOCUMENT_FORMS (EV_JOB(job)->document),
+ job->rc->page);
if (job->include_text && EV_IS_SELECTION (EV_JOB (job)->document))
job->text_mapping =
ev_selection_get_selection_map (EV_SELECTION (EV_JOB (job)->document),
}
EvJob *
-ev_job_thumbnail_new (EvDocument *document,
- gint page,
- int rotation,
- gint requested_width)
+ev_job_thumbnail_new (EvDocument *document,
+ EvRenderContext *rc)
{
EvJobThumbnail *job;
job = g_object_new (EV_TYPE_JOB_THUMBNAIL, NULL);
EV_JOB (job)->document = g_object_ref (document);
- job->page = page;
- job->rotation = rotation;
- job->requested_width = requested_width;
+ job->rc = g_object_ref (rc);
return EV_JOB (job);
}
job->thumbnail =
ev_document_thumbnails_get_thumbnail (EV_DOCUMENT_THUMBNAILS (EV_JOB (job)->document),
- job->page,
- job->rotation,
- job->requested_width,
- TRUE);
+ job->rc, TRUE);
EV_JOB (job)->finished = TRUE;
ev_document_doc_mutex_unlock ();