source: trunk/third/librsvg/rsvg-paint-server.h @ 20920

Revision 20920, 3.3 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-paint-server.h : RSVG colors
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_PAINT_SERVER_H
27#define RSVG_PAINT_SERVER_H
28
29#include <glib/gtypes.h>
30#include <libart_lgpl/art_render_gradient.h>
31#include "rsvg-defs.h"
32
33G_BEGIN_DECLS
34
35typedef struct _RsvgGradientStop RsvgGradientStop;
36typedef struct _RsvgGradientStops RsvgGradientStops;
37typedef struct _RsvgLinearGradient RsvgLinearGradient;
38typedef struct _RsvgRadialGradient RsvgRadialGradient;
39typedef struct _RsvgPattern RsvgPattern;
40
41typedef struct _RsvgPaintServer RsvgPaintServer;
42
43typedef struct _RsvgPSCtx RsvgPSCtx;
44
45struct _RsvgPSCtx {
46        int x0;
47        int y0;
48        int x1;
49        int y1;
50
51        guint32 color;
52        double affine[6];
53        RsvgHandle *ctx;
54};
55
56struct _RsvgGradientStop {
57        double offset;
58        gboolean is_current_color;
59        guint32 rgba;
60};
61
62struct _RsvgGradientStops {
63        int n_stop;
64        RsvgGradientStop *stop;
65};
66
67struct _RsvgLinearGradient {
68        RsvgDefVal super;
69        gboolean obj_bbox;
70        double affine[6]; /* user space to actual at time of gradient def */
71        RsvgGradientStops *stops;
72        ArtGradientSpread spread;
73        double x1, y1;
74        double x2, y2;
75        guint32 current_color;
76        gboolean has_current_color;
77};
78
79struct _RsvgRadialGradient {
80        RsvgDefVal super;
81        gboolean obj_bbox;
82        double affine[6]; /* user space to actual at time of gradient def */
83        RsvgGradientStops *stops;
84        ArtGradientSpread spread;
85        double cx, cy;
86        double r;
87        double fx, fy;
88        guint32 current_color;
89        gboolean has_current_color;
90};
91
92struct _RsvgPattern {
93        RsvgDefVal super;
94        gboolean obj_cbbox;
95        gboolean obj_bbox;
96        gboolean vbox;
97        double affine[6]; /* user space to actual at time of gradient def */
98        double x, y, width, height;
99        double vbx, vby, vbh, vbw;
100        RsvgDefVal * g;
101        RsvgDefVal * gfallback;
102};
103
104/* Create a new paint server based on a specification string. */
105RsvgPaintServer *
106rsvg_paint_server_parse (RsvgPaintServer * current, const RsvgDefs *defs, const char *str,
107                                                 guint32 current_color);
108
109void
110rsvg_render_paint_server (ArtRender *ar, RsvgPaintServer *ps,
111                                                  const RsvgPSCtx *ctx);
112
113void
114rsvg_paint_server_ref (RsvgPaintServer *ps);
115
116void
117rsvg_paint_server_unref (RsvgPaintServer *ps);
118
119RsvgRadialGradient *
120rsvg_clone_radial_gradient (const RsvgRadialGradient *grad, gboolean * shallow_cloned);
121
122RsvgLinearGradient *
123rsvg_clone_linear_gradient (const RsvgLinearGradient *grad, gboolean * shallow_cloned);
124
125RsvgPattern *
126rsvg_clone_pattern (const RsvgPattern *pattern);
127
128G_END_DECLS
129
130#endif
Note: See TracBrowser for help on using the repository browser.