1 | /* viewer.h: PangoViewer class |
2 | * |
3 | * Copyright (C) 1999,2004,2005 Red Hat, Inc. |
4 | * Copyright (C) 2001 Sun Microsystems |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Library General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2 of the License, or (at your option) any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Library General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Library General Public |
17 | * License along with this library; if not, write to the |
18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | * Boston, MA 02111-1307, USA. |
20 | */ |
21 | #ifndef VIEWER_H |
22 | #define VIEWER_H |
23 | |
24 | #include <pango/pango.h> |
25 | |
26 | typedef struct _PangoViewer PangoViewer; |
27 | |
28 | struct _PangoViewer { |
29 | |
30 | const char *name; |
31 | |
32 | const char *id; |
33 | |
34 | const char *write_suffix; |
35 | |
36 | gpointer (*create) (const PangoViewer *klass); |
37 | |
38 | void (*destroy) (gpointer instance); |
39 | |
40 | PangoContext * (*get_context) (gpointer instance); |
41 | |
42 | gpointer (*create_surface) (gpointer instance, |
43 | int width, |
44 | int height); |
45 | |
46 | void (*destroy_surface) (gpointer instance, |
47 | gpointer surface); |
48 | |
49 | void (*render) (gpointer instance, |
50 | gpointer surface, |
51 | PangoContext *context, |
52 | int *width, |
53 | int *height, |
54 | gpointer state); |
55 | |
56 | /* The following can be NULL */ |
57 | |
58 | void (*write) (gpointer instance, |
59 | gpointer surface, |
60 | FILE *stream, |
61 | int width, |
62 | int height); |
63 | |
64 | gpointer (*create_window) (gpointer instance, |
65 | const char *title, |
66 | int width, |
67 | int height); |
68 | |
69 | void (*destroy_window) (gpointer instance, |
70 | gpointer window); |
71 | |
72 | gpointer (*display) (gpointer instance, |
73 | gpointer surface, |
74 | gpointer window, |
75 | int width, |
76 | int height, |
77 | gpointer state); |
78 | |
79 | void (*load) (gpointer instance, |
80 | gpointer surface, |
81 | guchar *buffer, |
82 | int width, |
83 | int height, |
84 | int stride); |
85 | |
86 | void (*save) (gpointer instance, |
87 | gpointer surface, |
88 | guchar *buffer, |
89 | int width, |
90 | int height, |
91 | int stride); |
92 | |
93 | GOptionGroup * (*get_option_group) (const PangoViewer *klass); |
94 | }; |
95 | |
96 | extern const PangoViewer *viewers[]; |
97 | |
98 | #endif /* VIEWER_H */ |
99 | |