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

Revision 18609, 3.0 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18608, which included commits to RCS files with non-trunk default branches.
Line 
1/* vim: set sw=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2/*
3   rsvg.h: SAX-based renderer for SVG files into a GdkPixbuf.
4 
5   Copyright (C) 2000 Eazel, Inc.
6 
7   This program is free software; you can redistribute it and/or
8   modify it under the terms of the GNU Library General Public License as
9   published by the Free Software Foundation; either version 2 of the
10   License, or (at your option) any later version.
11 
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   Library General Public License for more details.
16 
17   You should have received a copy of the GNU Library General Public
18   License along with this program; if not, write to the
19   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20   Boston, MA 02111-1307, USA.
21 
22   Author: Raph Levien <raph@artofcode.com>
23*/
24
25#ifndef RSVG_H
26#define RSVG_H
27
28#include <gdk-pixbuf/gdk-pixbuf.h>
29
30G_BEGIN_DECLS
31
32typedef enum {
33        RSVG_ERROR_FAILED
34} RsvgError;
35
36#define RSVG_ERROR (rsvg_error_quark ())
37GQuark rsvg_error_quark (void) G_GNUC_CONST;
38
39typedef struct RsvgHandle RsvgHandle;
40
41typedef void (* RsvgSizeFunc) (gint     *width,
42                               gint     *height,
43                               gpointer  user_data);
44
45
46void        rsvg_set_default_dpi          (double dpi);
47
48RsvgHandle *rsvg_handle_new               (void);
49void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
50void        rsvg_handle_set_size_callback (RsvgHandle      *handle,
51                                           RsvgSizeFunc     size_func,
52                                           gpointer         user_data,
53                                           GDestroyNotify   user_data_destroy);
54gboolean    rsvg_handle_write             (RsvgHandle      *handle,
55                                           const guchar    *buf,
56                                           gsize            count,
57                                           GError         **error);
58gboolean    rsvg_handle_close             (RsvgHandle      *handle,
59                                           GError         **error);
60GdkPixbuf  *rsvg_handle_get_pixbuf        (RsvgHandle      *handle);
61void        rsvg_handle_free              (RsvgHandle      *handle);
62
63/* convenience API */
64GdkPixbuf  *rsvg_pixbuf_from_file                  (const gchar  *file_name,
65                                                    GError      **error);
66GdkPixbuf  *rsvg_pixbuf_from_file_at_zoom          (const gchar  *file_name,
67                                                    double        x_zoom,
68                                                    double        y_zoom,
69                                                    GError      **error);
70GdkPixbuf  *rsvg_pixbuf_from_file_at_size          (const gchar  *file_name,
71                                                    gint          width,
72                                                    gint          height,
73                                                    GError      **error);
74GdkPixbuf  *rsvg_pixbuf_from_file_at_max_size      (const gchar  *file_name,
75                                                    gint          max_width,
76                                                    gint          max_height,
77                                                    GError      **error);
78GdkPixbuf  *rsvg_pixbuf_from_file_at_zoom_with_max (const gchar  *file_name,
79                                                    double        x_zoom,
80                                                    double        y_zoom,
81                                                    gint          max_width,
82                                                    gint          max_height,
83                                                    GError      **error);
84
85G_END_DECLS
86
87#endif /* RSVG_H */
Note: See TracBrowser for help on using the repository browser.