[17276] | 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 |
---|
[18274] | 7 | modify it under the terms of the GNU Library General Public License as |
---|
[17276] | 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 |
---|
[18274] | 14 | Library General Public License for more details. |
---|
[17276] | 15 | |
---|
[18274] | 16 | You should have received a copy of the GNU Library General Public |
---|
[17276] | 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 | |
---|
[18274] | 29 | G_BEGIN_DECLS |
---|
[17276] | 30 | |
---|
[18274] | 31 | typedef enum { |
---|
| 32 | RSVG_ERROR_FAILED |
---|
| 33 | } RsvgError; |
---|
[17276] | 34 | |
---|
[18274] | 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 | RsvgHandle *rsvg_handle_new (void); |
---|
| 46 | void rsvg_handle_set_size_callback (RsvgHandle *handle, |
---|
| 47 | RsvgSizeFunc size_func, |
---|
| 48 | gpointer user_data, |
---|
| 49 | GDestroyNotify user_data_destroy); |
---|
| 50 | gboolean rsvg_handle_write (RsvgHandle *handle, |
---|
| 51 | const guchar *buf, |
---|
| 52 | gsize count, |
---|
| 53 | GError **error); |
---|
| 54 | gboolean rsvg_handle_close (RsvgHandle *handle, |
---|
| 55 | GError **error); |
---|
| 56 | GdkPixbuf *rsvg_handle_get_pixbuf (RsvgHandle *handle); |
---|
| 57 | void rsvg_handle_free (RsvgHandle *handle); |
---|
| 58 | |
---|
| 59 | /* convenience API */ |
---|
| 60 | GdkPixbuf *rsvg_pixbuf_from_file (const gchar *file_name, |
---|
| 61 | GError **error); |
---|
| 62 | GdkPixbuf *rsvg_pixbuf_from_file_at_zoom (const gchar *file_name, |
---|
| 63 | double x_zoom, |
---|
| 64 | double y_zoom, |
---|
| 65 | GError **error); |
---|
| 66 | GdkPixbuf *rsvg_pixbuf_from_file_at_size (const gchar *file_name, |
---|
| 67 | gint width, |
---|
| 68 | gint height, |
---|
| 69 | GError **error); |
---|
| 70 | GdkPixbuf *rsvg_pixbuf_from_file_at_max_size (const gchar *file_name, |
---|
| 71 | gint max_width, |
---|
| 72 | gint max_height, |
---|
| 73 | GError **error); |
---|
| 74 | GdkPixbuf *rsvg_pixbuf_from_file_at_zoom_with_max (const gchar *file_name, |
---|
| 75 | double x_zoom, |
---|
| 76 | double y_zoom, |
---|
| 77 | gint max_width, |
---|
| 78 | gint max_height, |
---|
| 79 | GError **error); |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | G_END_DECLS |
---|
| 83 | |
---|
[17276] | 84 | #endif |
---|