1 /* libsvg-cairo - Render SVG documents using the cairo library 2 * 3 * Copyright � 2002 University of Southern California 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * 19 * Author: Carl D. Worth <cworth@isi.edu> 20 */ 21 22 #ifndef SVG_CAIRO_H 23 #define SVG_CAIRO_H 24 25 #include <cairo.h> 26 27 #include <svg.h> 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 typedef enum svg_cairo_status { 34 SVG_CAIRO_STATUS_SUCCESS = SVG_STATUS_SUCCESS, 35 SVG_CAIRO_STATUS_NO_MEMORY = SVG_STATUS_NO_MEMORY, 36 SVG_CAIRO_STATUS_IO_ERROR = SVG_STATUS_IO_ERROR, 37 SVG_CAIRO_STATUS_FILE_NOT_FOUND = SVG_STATUS_FILE_NOT_FOUND, 38 SVG_CAIRO_STATUS_INVALID_VALUE = SVG_STATUS_INVALID_VALUE, 39 SVG_CAIRO_STATUS_INVALID_CALL = SVG_STATUS_INVALID_CALL, 40 SVG_CAIRO_STATUS_PARSE_ERROR = SVG_STATUS_PARSE_ERROR 41 } svg_cairo_status_t; 42 43 typedef struct svg_cairo svg_cairo_t; 44 45 svg_cairo_status_t 46 svg_cairo_create (svg_cairo_t **svg_cairo); 47 48 svg_cairo_status_t 49 svg_cairo_destroy (svg_cairo_t *svg_cairo); 50 51 svg_cairo_status_t 52 svg_cairo_parse (svg_cairo_t *svg_cairo, const char *filename); 53 54 svg_cairo_status_t 55 svg_cairo_parse_file (svg_cairo_t *svg_cairo, FILE *file); 56 57 svg_cairo_status_t 58 svg_cairo_parse_buffer (svg_cairo_t *svg_cairo, const char *buf, size_t count); 59 60 svg_cairo_status_t 61 svg_cairo_parse_chunk_begin (svg_cairo_t *svg_cairo); 62 63 svg_cairo_status_t 64 svg_cairo_parse_chunk (svg_cairo_t *svg_cairo, const char *buf, size_t count); 65 66 svg_cairo_status_t 67 svg_cairo_parse_chunk_end (svg_cairo_t *svg_cairo); 68 69 svg_cairo_status_t 70 svg_cairo_render (svg_cairo_t *svg_cairo, cairo_t *xrs); 71 72 /* XXX: Ugh... this inconsistent interface needs to be cleaned up. */ 73 svg_cairo_status_t 74 svg_cairo_set_viewport_dimension (svg_cairo_t *svg_cairo, unsigned int width, unsigned int height); 75 76 void 77 svg_cairo_get_size (svg_cairo_t *svg_cairo, 78 unsigned int *width, 79 unsigned int *height); 80 81 #ifdef __cplusplus 82 } 83 #endif 84 85 #endif 86