source: trunk/third/librsvg/rsvg.h @ 18352

Revision 18352, 2.8 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18351, which included commits to RCS files with non-trunk default branches.
Line 
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
29G_BEGIN_DECLS
30
31typedef enum {
32        RSVG_ERROR_FAILED
33} RsvgError;
34
35#define RSVG_ERROR (rsvg_error_quark ())
36GQuark rsvg_error_quark (void) G_GNUC_CONST;
37
38typedef struct RsvgHandle RsvgHandle;
39
40typedef void (* RsvgSizeFunc) (gint     *width,
41                               gint     *height,
42                               gpointer  user_data);
43
44
45RsvgHandle *rsvg_handle_new               (void);
46void        rsvg_handle_set_size_callback (RsvgHandle      *handle,
47                                           RsvgSizeFunc     size_func,
48                                           gpointer         user_data,
49                                           GDestroyNotify   user_data_destroy);
50gboolean    rsvg_handle_write             (RsvgHandle      *handle,
51                                           const guchar    *buf,
52                                           gsize            count,
53                                           GError         **error);
54gboolean    rsvg_handle_close             (RsvgHandle      *handle,
55                                           GError         **error);
56GdkPixbuf  *rsvg_handle_get_pixbuf        (RsvgHandle      *handle);
57void        rsvg_handle_free              (RsvgHandle      *handle);
58
59/* convenience API */
60GdkPixbuf  *rsvg_pixbuf_from_file                  (const gchar  *file_name,
61                                                    GError      **error);
62GdkPixbuf  *rsvg_pixbuf_from_file_at_zoom          (const gchar  *file_name,
63                                                    double        x_zoom,
64                                                    double        y_zoom,
65                                                    GError      **error);
66GdkPixbuf  *rsvg_pixbuf_from_file_at_size          (const gchar  *file_name,
67                                                    gint          width,
68                                                    gint          height,
69                                                    GError      **error);
70GdkPixbuf  *rsvg_pixbuf_from_file_at_max_size      (const gchar  *file_name,
71                                                    gint          max_width,
72                                                    gint          max_height,
73                                                    GError      **error);
74GdkPixbuf  *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
82G_END_DECLS
83
84#endif
Note: See TracBrowser for help on using the repository browser.