[18608] | 1 | /* vim: set sw=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
---|
| 2 | /* |
---|
| 3 | rsvg-private.h: Internals of RSVG |
---|
| 4 | |
---|
| 5 | Copyright (C) 2000 Eazel, Inc. |
---|
| 6 | Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com> |
---|
| 7 | |
---|
| 8 | This program is free software; you can redistribute it and/or |
---|
| 9 | modify it under the terms of the GNU Library General Public License as |
---|
| 10 | published by the Free Software Foundation; either version 2 of the |
---|
| 11 | License, or (at your option) any later version. |
---|
| 12 | |
---|
| 13 | This program is distributed in the hope that it will be useful, |
---|
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 16 | Library General Public License for more details. |
---|
| 17 | |
---|
| 18 | You should have received a copy of the GNU Library General Public |
---|
| 19 | License along with this program; if not, write to the |
---|
| 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
| 21 | Boston, MA 02111-1307, USA. |
---|
| 22 | |
---|
| 23 | Author: Raph Levien <raph@artofcode.com> |
---|
| 24 | */ |
---|
| 25 | |
---|
| 26 | #ifndef RSVG_PRIVATE_H |
---|
| 27 | #define RSVG_PRIVATE_H |
---|
| 28 | |
---|
| 29 | #include "rsvg.h" |
---|
| 30 | #include "rsvg-styles.h" |
---|
| 31 | |
---|
| 32 | #include <libxml/SAX.h> |
---|
| 33 | #include <libxml/xmlmemory.h> |
---|
| 34 | |
---|
| 35 | G_BEGIN_DECLS |
---|
| 36 | |
---|
| 37 | typedef struct RsvgSaxHandler RsvgSaxHandler; |
---|
| 38 | |
---|
| 39 | struct RsvgSaxHandler { |
---|
[18804] | 40 | void (*free) (RsvgSaxHandler *self); |
---|
| 41 | void (*start_element) (RsvgSaxHandler *self, const xmlChar *name, const xmlChar **atts); |
---|
| 42 | void (*end_element) (RsvgSaxHandler *self, const xmlChar *name); |
---|
| 43 | void (*characters) (RsvgSaxHandler *self, const xmlChar *ch, int len); |
---|
[18608] | 44 | }; |
---|
| 45 | |
---|
| 46 | struct RsvgHandle { |
---|
[18804] | 47 | RsvgSizeFunc size_func; |
---|
| 48 | gpointer user_data; |
---|
| 49 | GDestroyNotify user_data_destroy; |
---|
| 50 | GdkPixbuf *pixbuf; |
---|
| 51 | |
---|
| 52 | /* stack; there is a state for each element */ |
---|
| 53 | RsvgState *state; |
---|
| 54 | int n_state; |
---|
| 55 | int n_state_max; |
---|
| 56 | |
---|
| 57 | RsvgDefs *defs; |
---|
| 58 | gboolean in_defs; |
---|
| 59 | GHashTable *css_props; |
---|
| 60 | |
---|
| 61 | /* not a handler stack. each nested handler keeps |
---|
| 62 | * track of its parent |
---|
| 63 | */ |
---|
| 64 | RsvgSaxHandler *handler; |
---|
| 65 | int handler_nest; |
---|
| 66 | |
---|
| 67 | GHashTable *entities; /* g_malloc'd string -> xmlEntityPtr */ |
---|
| 68 | |
---|
| 69 | PangoContext *pango_context; |
---|
| 70 | xmlParserCtxtPtr ctxt; |
---|
| 71 | GError **error; |
---|
| 72 | |
---|
| 73 | int width; |
---|
| 74 | int height; |
---|
| 75 | double dpi; |
---|
| 76 | |
---|
| 77 | /* virtual fns */ |
---|
| 78 | gboolean (* write) (RsvgHandle *handle, |
---|
| 79 | const guchar *buf, |
---|
| 80 | gsize count, |
---|
| 81 | GError **error); |
---|
| 82 | |
---|
| 83 | gboolean (* close) (RsvgHandle *handle, |
---|
| 84 | GError **error); |
---|
[18608] | 85 | |
---|
[18804] | 86 | void (* free) (RsvgHandle * handle); |
---|
[18608] | 87 | }; |
---|
| 88 | |
---|
| 89 | void rsvg_linear_gradient_free (RsvgDefVal *self); |
---|
| 90 | void rsvg_radial_gradient_free (RsvgDefVal *self); |
---|
| 91 | |
---|
[18804] | 92 | /* "super"/parent calls */ |
---|
| 93 | void rsvg_handle_init (RsvgHandle * handle); |
---|
| 94 | gboolean rsvg_handle_write_impl (RsvgHandle *handle, |
---|
| 95 | const guchar *buf, |
---|
| 96 | gsize count, |
---|
| 97 | GError **error); |
---|
| 98 | gboolean rsvg_handle_close_impl (RsvgHandle *handle, |
---|
| 99 | GError **error); |
---|
| 100 | void rsvg_handle_free_impl (RsvgHandle *handle); |
---|
| 101 | |
---|
[18608] | 102 | G_END_DECLS |
---|
| 103 | |
---|
| 104 | #endif |
---|