Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-device.h File Reference
#include <glib.h>
#include <cairo.h>
#include "mdvi.h"
+ Include dependency graph for cairo-device.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

G_BEGIN_DECLS void mdvi_cairo_device_init (DviDevice *device)
 
void mdvi_cairo_device_free (DviDevice *device)
 
cairo_surface_t * mdvi_cairo_device_get_surface (DviDevice *device)
 
void mdvi_cairo_device_render (DviContext *dvi)
 
void mdvi_cairo_device_set_margins (DviDevice *device, gint xmargin, gint ymargin)
 
void mdvi_cairo_device_set_scale (DviDevice *device, gdouble xscale, gdouble yscale)
 

Function Documentation

void mdvi_cairo_device_free ( DviDevice device)

Definition at line 300 of file cairo-device.c.

301 {
302  DviCairoDevice *cairo_device;
303 
304  cairo_device = (DviCairoDevice *) device->device_data;
305 
306  if (cairo_device->cr)
307  cairo_destroy (cairo_device->cr);
308 
309  g_free (cairo_device);
310 }

+ Here is the caller graph for this function:

cairo_surface_t* mdvi_cairo_device_get_surface ( DviDevice device)

Definition at line 313 of file cairo-device.c.

314 {
315  DviCairoDevice *cairo_device;
316 
317  cairo_device = (DviCairoDevice *) device->device_data;
318 
319  return cairo_surface_reference (cairo_get_target (cairo_device->cr));
320 }

+ Here is the caller graph for this function:

G_BEGIN_DECLS void mdvi_cairo_device_init ( DviDevice device)

Definition at line 279 of file cairo-device.c.

280 {
281  device->device_data = g_new0 (DviCairoDevice, 1);
282 
284  device->draw_rule = dvi_cairo_draw_rule;
288  device->put_pixel = dvi_cairo_put_pixel;
290  device->set_color = dvi_cairo_set_color;
291 #ifdef HAVE_SPECTRE
292  device->draw_ps = dvi_cairo_draw_ps;
293 #else
294  device->draw_ps = NULL;
295 #endif
296  device->refresh = NULL;
297 }

+ Here is the caller graph for this function:

void mdvi_cairo_device_render ( DviContext dvi)

Definition at line 323 of file cairo-device.c.

324 {
325  DviCairoDevice *cairo_device;
326  gint page_width;
327  gint page_height;
328  cairo_surface_t *surface;
329 
330  cairo_device = (DviCairoDevice *) dvi->device.device_data;
331 
332  if (cairo_device->cr)
333  cairo_destroy (cairo_device->cr);
334 
335  page_width = dvi->dvi_page_w * dvi->params.conv + 2 * cairo_device->xmargin;
336  page_height = dvi->dvi_page_h * dvi->params.vconv + 2 * cairo_device->ymargin;
337 
338  surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
339  page_width, page_height);
340 
341  cairo_device->cr = cairo_create (surface);
342  cairo_surface_destroy (surface);
343 
344  cairo_set_source_rgb (cairo_device->cr, 1., 1., 1.);
345  cairo_paint (cairo_device->cr);
346 
347  mdvi_dopage (dvi, dvi->currpage);
348 }

+ Here is the caller graph for this function:

void mdvi_cairo_device_set_margins ( DviDevice device,
gint  xmargin,
gint  ymargin 
)

Definition at line 351 of file cairo-device.c.

354 {
355  DviCairoDevice *cairo_device;
356 
357  cairo_device = (DviCairoDevice *) device->device_data;
358 
359  cairo_device->xmargin = xmargin;
360  cairo_device->ymargin = ymargin;
361 }

+ Here is the caller graph for this function:

void mdvi_cairo_device_set_scale ( DviDevice device,
gdouble  xscale,
gdouble  yscale 
)

Definition at line 364 of file cairo-device.c.

367 {
368  DviCairoDevice *cairo_device;
369 
370  cairo_device = (DviCairoDevice *) device->device_data;
371 
372  cairo_device->xscale = xscale;
373  cairo_device->yscale = yscale;
374 }

+ Here is the caller graph for this function: