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.
11 imp_create_context(const ImpDrawer *drw)
15 ctx = calloc(1, sizeof(ImpRenderCtx));
16 if (!ctx) return NULL;
22 imp_context_set_page(ImpRenderCtx *ctx, ImpPage *page)
25 ctx->content = page->doc->content;
26 ctx->styles = page->doc->styles;
30 imp_context_set_step(ImpRenderCtx *ctx, int step)
36 imp_render(ImpRenderCtx *ctx, void *drw_data)
38 // find drawing area size
39 ctx->drw->get_size(drw_data, &ctx->pix_w, &ctx->pix_h);
41 ctx->page->doc->get_geometry(ctx);
43 ctx->fact_x = ctx->pix_w / ctx->cm_w;
44 ctx->fact_y = ctx->pix_h / ctx->cm_h;
46 ctx->page->doc->render_page(ctx, drw_data);
50 imp_delete_context(ImpRenderCtx *ctx)