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

Revision 20920, 4.9 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20919, 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
41/**
42 * RsvgSizeFunc ():
43 * @width: Pointer to where to set/store the width
44 * @height: Pointer to where to set/store the height
45 * @user_data: User data pointer
46 *
47 * Function to let a user of the library specify the SVG's dimensions
48 * @width: the ouput width the SVG should be
49 * @height: the output height the SVG should be
50 * @user_data: user data
51 */
52typedef void (* RsvgSizeFunc) (gint     *width,
53                                                           gint     *height,
54                                                           gpointer  user_data);
55
56
57#ifndef RSVG_DISABLE_DEPRECATED
58void        rsvg_set_default_dpi          (double dpi);
59void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
60#endif
61
62void        rsvg_set_default_dpi_x_y          (double dpi_x, double dpi_y);
63void        rsvg_handle_set_dpi_x_y           (RsvgHandle * handle, double dpi_x, double dpi_y);
64
65RsvgHandle *rsvg_handle_new               (void);
66void        rsvg_handle_set_size_callback (RsvgHandle      *handle,
67                                                                                   RsvgSizeFunc     size_func,
68                                                                                   gpointer         user_data,
69                                                                                   GDestroyNotify   user_data_destroy);
70gboolean    rsvg_handle_write             (RsvgHandle      *handle,
71                                                                                   const guchar    *buf,
72                                                                                   gsize            count,
73                                                                                   GError         **error);
74gboolean    rsvg_handle_close             (RsvgHandle      *handle,
75                                                                                   GError         **error);
76GdkPixbuf  *rsvg_handle_get_pixbuf        (RsvgHandle      *handle);
77void        rsvg_handle_free              (RsvgHandle      *handle);
78
79/* Convenience API */
80
81GdkPixbuf  *rsvg_pixbuf_from_file                  (const gchar  *file_name,
82                                                                                                        GError      **error);
83GdkPixbuf  *rsvg_pixbuf_from_file_at_zoom          (const gchar  *file_name,
84                                                                                                        double        x_zoom,
85                                                                                                        double        y_zoom,
86                                                                                                        GError      **error);
87GdkPixbuf  *rsvg_pixbuf_from_file_at_size          (const gchar  *file_name,
88                                                                                                        gint          width,
89                                                                                                        gint          height,
90                                                                                                        GError      **error);
91GdkPixbuf  *rsvg_pixbuf_from_file_at_max_size      (const gchar  *file_name,
92                                                                                                        gint          max_width,
93                                                                                                        gint          max_height,
94                                                                                                        GError      **error);
95GdkPixbuf  *rsvg_pixbuf_from_file_at_zoom_with_max (const gchar  *file_name,
96                                                                                                        double        x_zoom,
97                                                                                                        double        y_zoom,
98                                                                                                        gint          max_width,
99                                                                                                        gint          max_height,
100                                                                                                        GError      **error);
101
102/* Accessibility API */
103
104G_CONST_RETURN char *rsvg_handle_get_title         (RsvgHandle *handle);
105G_CONST_RETURN char *rsvg_handle_get_desc          (RsvgHandle *handle);
106
107/* Extended Convenience API */
108
109GdkPixbuf  * rsvg_pixbuf_from_file_at_size_ex (RsvgHandle * handle,
110                                                                                           const gchar  *file_name,
111                                                                                           gint          width,
112                                                                                           gint          height,
113                                                                                           GError      **error);
114GdkPixbuf  * rsvg_pixbuf_from_file_ex (RsvgHandle * handle,
115                                                                           const gchar  *file_name,
116                                                                           GError      **error);
117GdkPixbuf  * rsvg_pixbuf_from_file_at_zoom_ex (RsvgHandle * handle,
118                                                                                           const gchar  *file_name,
119                                                                                           double        x_zoom,
120                                                                                           double        y_zoom,
121                                                                                           GError      **error);
122GdkPixbuf  * rsvg_pixbuf_from_file_at_max_size_ex (RsvgHandle * handle,
123                                                                                                   const gchar  *file_name,
124                                                                                                   gint          max_width,
125                                                                                                   gint          max_height,
126                                                                                                   GError      **error);
127GdkPixbuf  * rsvg_pixbuf_from_file_at_zoom_with_max_ex (RsvgHandle * handle,
128                                                                                                                const gchar  *file_name,
129                                                                                                                double        x_zoom,
130                                                                                                                double        y_zoom,
131                                                                                                                gint          max_width,
132                                                                                                                gint          max_height,
133                                                                                                                GError      **error);
134
135G_END_DECLS
136
137#endif /* RSVG_H */
Note: See TracBrowser for help on using the repository browser.