1 | /* |
---|
2 | rsvg.h: SAX-based renderer for SVG files into a GdkPixbuf. |
---|
3 | |
---|
4 | Copyright (C) 2000 Eazel, Inc. |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or |
---|
7 | modify it under the terms of the GNU Library General Public License as |
---|
8 | published by the Free Software Foundation; either version 2 of the |
---|
9 | License, or (at your option) any later version. |
---|
10 | |
---|
11 | This program 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 program; if not, write to the |
---|
18 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
19 | Boston, MA 02111-1307, USA. |
---|
20 | |
---|
21 | Author: Raph Levien <raph@artofcode.com> |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef RSVG_H |
---|
25 | #define RSVG_H |
---|
26 | |
---|
27 | #include <gdk-pixbuf/gdk-pixbuf.h> |
---|
28 | |
---|
29 | G_BEGIN_DECLS |
---|
30 | |
---|
31 | typedef enum { |
---|
32 | RSVG_ERROR_FAILED |
---|
33 | } RsvgError; |
---|
34 | |
---|
35 | #define RSVG_ERROR (rsvg_error_quark ()) |
---|
36 | GQuark rsvg_error_quark (void) G_GNUC_CONST; |
---|
37 | |
---|
38 | typedef struct RsvgHandle RsvgHandle; |
---|
39 | |
---|
40 | typedef void (* RsvgSizeFunc) (gint *width, |
---|
41 | gint *height, |
---|
42 | gpointer user_data); |
---|
43 | |
---|
44 | |
---|
45 | void rsvg_set_default_dpi (double dpi); |
---|
46 | |
---|
47 | RsvgHandle *rsvg_handle_new (void); |
---|
48 | void rsvg_handle_set_dpi (RsvgHandle * handle, double dpi); |
---|
49 | void rsvg_handle_set_size_callback (RsvgHandle *handle, |
---|
50 | RsvgSizeFunc size_func, |
---|
51 | gpointer user_data, |
---|
52 | GDestroyNotify user_data_destroy); |
---|
53 | gboolean rsvg_handle_write (RsvgHandle *handle, |
---|
54 | const guchar *buf, |
---|
55 | gsize count, |
---|
56 | GError **error); |
---|
57 | gboolean rsvg_handle_close (RsvgHandle *handle, |
---|
58 | GError **error); |
---|
59 | GdkPixbuf *rsvg_handle_get_pixbuf (RsvgHandle *handle); |
---|
60 | void rsvg_handle_free (RsvgHandle *handle); |
---|
61 | |
---|
62 | /* convenience API */ |
---|
63 | GdkPixbuf *rsvg_pixbuf_from_file (const gchar *file_name, |
---|
64 | GError **error); |
---|
65 | GdkPixbuf *rsvg_pixbuf_from_file_at_zoom (const gchar *file_name, |
---|
66 | double x_zoom, |
---|
67 | double y_zoom, |
---|
68 | GError **error); |
---|
69 | GdkPixbuf *rsvg_pixbuf_from_file_at_size (const gchar *file_name, |
---|
70 | gint width, |
---|
71 | gint height, |
---|
72 | GError **error); |
---|
73 | GdkPixbuf *rsvg_pixbuf_from_file_at_max_size (const gchar *file_name, |
---|
74 | gint max_width, |
---|
75 | gint max_height, |
---|
76 | GError **error); |
---|
77 | GdkPixbuf *rsvg_pixbuf_from_file_at_zoom_with_max (const gchar *file_name, |
---|
78 | double x_zoom, |
---|
79 | double y_zoom, |
---|
80 | gint max_width, |
---|
81 | gint max_height, |
---|
82 | GError **error); |
---|
83 | |
---|
84 | |
---|
85 | G_END_DECLS |
---|
86 | |
---|
87 | #endif |
---|