polygon intersector: added horizontal line reconstruction
[swftools.git] / lib / gfxsource.h
1 /* pdfswf.h
2    Header file for pdfswf.cc.
3
4    Part of the swftools package.
5
6    Copyright (c) 2001 Matthias Kramm <kramm@quiss.org> 
7  
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
21
22 #ifndef __gfxsource_h__
23 #define __gfxsource_h__
24
25 #include "gfxdevice.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 struct _gfxdocument;
32 struct _gfxpage;
33
34 typedef struct _gfxsource
35 {
36     void                 (*set_parameter)(struct _gfxsource*src, const char*name, const char*value);
37     struct _gfxdocument* (*open)(struct _gfxsource*src, const char*filename);
38     void  (*destroy)(struct _gfxsource*src);
39     void*internal;
40 } gfxsource_t;
41
42 typedef struct _gfxdocument
43 {
44     gfxsource_t*driver;
45     int num_pages;
46     void* (*get)(struct _gfxdocument*gfx, const char*name);
47     void  (*destroy)(struct _gfxdocument*gfx);
48     void  (*set_parameter)(struct _gfxdocument*gfx, const char*name, const char*value);
49     char* (*getinfo)(struct _gfxdocument*gfx, const char*key);
50     struct _gfxpage* (*getpage)(struct _gfxdocument*gfx, int page);
51     void  (*prepare)(struct _gfxdocument*gfx, gfxdevice_t*device);
52     void*internal;
53 } gfxdocument_t;
54
55 typedef struct _gfxpage
56 {
57     gfxdocument_t*parent;
58     gfxcoord_t width;
59     gfxcoord_t height;
60     int nr;
61     void (*render)(struct _gfxpage*gfx, gfxdevice_t*output);
62     void (*rendersection)(struct _gfxpage*gfx, gfxdevice_t*output, gfxcoord_t x, gfxcoord_t y, gfxcoord_t x1, gfxcoord_t y1, gfxcoord_t x2, gfxcoord_t y2);
63     void (*destroy)(struct _gfxpage*page);
64     void*internal;
65 } gfxpage_t;
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif //__gfxsource_h__