- mdvi_set_shrink (dvi_document->context,
- (int)dvi_document->base_width * dvi_document->params->hshrink / thumb_width,
- (int)dvi_document->base_height * dvi_document->params->vshrink / thumb_height);
-
- proposed_width = dvi_document->context->dvi_page_w * dvi_document->context->params.conv;
- proposed_height = dvi_document->context->dvi_page_h * dvi_document->context->params.vconv;
-
- if (border) {
- mdvi_cairo_device_set_margins (&dvi_document->context->device,
- MAX (thumb_width - proposed_width, 0) / 2,
- MAX (thumb_height - proposed_height, 0) / 2);
- } else {
- mdvi_cairo_device_set_margins (&dvi_document->context->device,
- MAX (thumb_width - proposed_width - 2, 0) / 2,
- MAX (thumb_height - proposed_height - 2, 0) / 2);
- }
-
- mdvi_cairo_device_set_scale (&dvi_document->context->device, rc->scale);
- mdvi_cairo_device_render (dvi_document->context);
- surface = mdvi_cairo_device_get_surface (&dvi_document->context->device);
- g_mutex_unlock (dvi_context_mutex);
-
- pixbuf = ev_document_misc_pixbuf_from_surface (surface);
- cairo_surface_destroy (surface);
-
- rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, 360 - rc->rotation);
- g_object_unref (pixbuf);
-
- if (border) {
- GdkPixbuf *tmp_pixbuf = rotated_pixbuf;
-
- rotated_pixbuf = ev_document_misc_get_thumbnail_frame (-1, -1, tmp_pixbuf);
- g_object_unref (tmp_pixbuf);
- }
-
- return rotated_pixbuf;
-}
-
-static void
-dvi_document_document_thumbnails_iface_init (EvDocumentThumbnailsIface *iface)
-{
- iface->get_thumbnail = dvi_document_thumbnails_get_thumbnail;
- iface->get_dimensions = dvi_document_thumbnails_get_dimensions;
+ ev_document_class->load = dvi_document_load;
+ ev_document_class->save = dvi_document_save;
+ ev_document_class->get_n_pages = dvi_document_get_n_pages;
+ ev_document_class->get_page_size = dvi_document_get_page_size;
+ ev_document_class->render = dvi_document_render;
+ ev_document_class->support_synctex = dvi_document_support_synctex;