~ubuntu-branches/ubuntu/oneiric/evince/oneiric-updates

« back to all changes in this revision

Viewing changes to backend/impress/render.c

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya, Josselin Mouette, Rodrigo Moya
  • Date: 2011-05-19 12:12:42 UTC
  • mfrom: (1.1.65 upstream) (1.3.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110519121242-967hbn2nh2hunp4y
Tags: 3.0.0-4ubuntu1
[ Josselin Mouette ]
* bug-presubj: please document where to report rendering bugs.
* evince.mime: dropped. We have desktop files to handle MIME 
  associations, no need to maintain an alternate system by hand.
  Closes: #619564, #627027, #551734, #581441.

[ Rodrigo Moya ]
* Rebase from Debian and GNOME3 PPA (thanks to Rico Tzschichholz).
  Remaining Ubuntu changes:
* debian/apparmor-profile:
* debian/apparmor-profile.abstraction:
* debian/evince.apport:
* debian/evince-common.dirs:
* debian/evince-common.postinst:
* debian/evince-common.postrm:
  - Add apparmor profile
* debian/control:
  - Build-Depend on debhelper (>= 7.4.20ubuntu5), gnome-common,
    hardening-includes and liblaunchpad-integration-3.0-dev
  - Standards-Version is 3.9.1
  - Depend on apparmor
* debian/rules:
  - Include hardening.make
  - Add rule to install apparmor files
* debian/watch:
  - Watch unstable series
* debian/patches/01_lpi.patch:
  - Launchpad integration patch
* debian/patches/04_gold.patch:
  - Link against libz
* debian/patches/05_library-path.patch:
  - Fix library path for g-ir-scanner

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* imposter (OO.org Impress viewer)
2
 
** Copyright (C) 2003-2005 Gurer Ozen
3
 
** This code is free software; you can redistribute it and/or
4
 
** modify it under the terms of GNU General Public License.
5
 
*/
6
 
 
7
 
#include <config.h>
8
 
#include "common.h"
9
 
#include "internal.h"
10
 
 
11
 
ImpRenderCtx *
12
 
imp_create_context(const ImpDrawer *drw)
13
 
{
14
 
        ImpRenderCtx *ctx;
15
 
 
16
 
        ctx = calloc(1, sizeof(ImpRenderCtx));
17
 
        if (!ctx) return NULL;
18
 
        ctx->drw = drw;
19
 
        return ctx;
20
 
}
21
 
 
22
 
void
23
 
imp_context_set_page(ImpRenderCtx *ctx, ImpPage *page)
24
 
{
25
 
        ctx->page = page;
26
 
        ctx->content = page->doc->content;
27
 
        ctx->styles = page->doc->styles;
28
 
}
29
 
 
30
 
void
31
 
imp_context_set_step(ImpRenderCtx *ctx, int step)
32
 
{
33
 
        ctx->step = step;
34
 
}
35
 
 
36
 
void
37
 
imp_render(ImpRenderCtx *ctx, void *drw_data)
38
 
{
39
 
        // find drawing area size
40
 
        ctx->drw->get_size(drw_data, &ctx->pix_w, &ctx->pix_h);
41
 
        // find page size
42
 
        ctx->page->doc->get_geometry(ctx);
43
 
        // calculate ratio
44
 
        ctx->fact_x = ctx->pix_w / ctx->cm_w;
45
 
        ctx->fact_y = ctx->pix_h / ctx->cm_h;
46
 
        // call renderer
47
 
        ctx->page->doc->render_page(ctx, drw_data);
48
 
}
49
 
 
50
 
void
51
 
imp_delete_context(ImpRenderCtx *ctx)
52
 
{
53
 
        free(ctx);
54
 
}