#include "ev-document-links.h"
#include "ev-document-images.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);
}
}
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),
}
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 ();