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.
10 #include <sys/types.h>
22 typedef struct ImpDoc_struct ImpDoc;
24 struct ImpPage_struct;
25 typedef struct ImpPage_struct ImpPage;
27 typedef struct ImpPointStruct {
32 typedef struct ImpColorStruct {
41 #define IMP_UNDERLINE 4
43 typedef struct ImpDrawer_struct {
44 void (*get_size)(void *drw_data, int *w, int *h);
45 void (*set_fg_color)(void *drw_data, ImpColor *color);
46 void (*draw_line)(void *drw_data, int x1, int y1, int x2, int y2);
47 void (*draw_rect)(void *drw_data, int fill, int x, int y, int w, int h);
48 void (*draw_polygon)(void *drw_data, int fill, ImpPoint *pts, int nr_pts);
49 void (*draw_arc)(void *drw_data, int fill, int x, int y, int w, int h, int sa, int ea);
50 void (*draw_bezier)(void *drw_data, int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
51 void *(*open_image)(void *drw_data, const unsigned char *pix, size_t size);
52 void (*get_image_size)(void *drw_data, void *img_data, int *w, int *h);
53 void *(*scale_image)(void *drw_data, void *img_data, int w, int h);
54 void (*draw_image)(void *drw_data, void *img_data, int x, int y, int w, int h);
55 void (*close_image)(void *drw_data, void *img_data);
56 void (*get_text_size)(void *drw_data, const char *text, size_t len, int size, int styles, int *w, int *h);
57 void (*draw_text)(void *drw_data, int x, int y, const char *text, size_t len, int size, int styles);
60 struct ImpRenderCtx_struct;
61 typedef struct ImpRenderCtx_struct ImpRenderCtx;
63 #define IMP_LAST_PAGE -1
65 ImpDoc *imp_open(const char *filename, int *err);
66 int imp_nr_pages(ImpDoc *doc);
67 ImpPage *imp_get_page(ImpDoc *doc, int page_no);
68 void imp_close(ImpDoc *doc);
70 void *imp_get_xml(ImpDoc *doc, const char *filename);
72 ImpPage *imp_next_page(ImpPage *page);
73 ImpPage *imp_prev_page(ImpPage *page);
74 int imp_get_page_no(ImpPage *page);
75 const char *imp_get_page_name(ImpPage *page);
77 ImpRenderCtx *imp_create_context(const ImpDrawer *drw);
78 void imp_context_set_page(ImpRenderCtx *ctx, ImpPage *page);
79 void imp_context_set_step(ImpRenderCtx *ctx, int step);
80 void imp_render(ImpRenderCtx *ctx, void *drw_data);
81 void imp_delete_context(ImpRenderCtx *ctx);
84 #endif /* IMPOSTER_H */