rsvg-paint-server.h 3.6 KB
Newer Older
1 2
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 expandtab: */
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*
   rsvg-paint-server.h : RSVG colors

   Copyright (C) 2000 Eazel, Inc.
   Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this program; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.

   Author: Raph Levien <raph@artofcode.com>
*/
26 27 28 29

#ifndef RSVG_PAINT_SERVER_H
#define RSVG_PAINT_SERVER_H

30
#include <glib.h>
31
#include <cairo.h>
32

33 34
G_BEGIN_DECLS 

35
typedef struct _RsvgSolidColor RsvgSolidColor;
36 37 38

typedef struct _RsvgPaintServer RsvgPaintServer;

39 40
/* Implemented in rust/src/gradient.rs */
G_GNUC_INTERNAL
41
RsvgNode *rsvg_node_linear_gradient_new (const char *element_name, RsvgNode *parent);
42

43
/* Implemented in rust/src/gradient.rs */
44
G_GNUC_INTERNAL
45
RsvgNode *rsvg_node_radial_gradient_new (const char *element_name, RsvgNode *parent);
46

47 48
/* Implemented in rust/src/gradient.rs */
G_GNUC_INTERNAL
49 50 51 52
gboolean gradient_resolve_fallbacks_and_set_pattern (RsvgNode       *node,
                                                     RsvgDrawingCtx *draw_ctx,
                                                     guint8          opacity,
                                                     RsvgBbox        bbox);
53 54
/* Implemented in rust/src/pattern.rs */
G_GNUC_INTERNAL
55
RsvgNode *rsvg_node_pattern_new (const char *element_name, RsvgNode *parent);
56 57 58

/* Implemented in rust/src/pattern.rs */
G_GNUC_INTERNAL
59
gboolean pattern_resolve_fallbacks_and_set_pattern (RsvgNode       *node,
60 61
                                                    RsvgDrawingCtx *draw_ctx,
                                                    RsvgBbox        bbox);
62

63 64
struct _RsvgSolidColor {
    gboolean currentcolor;
65
    guint32 argb;
66 67
};

68
typedef struct _RsvgSolidColor RsvgPaintServerColor;
69 70
typedef enum _RsvgPaintServerType RsvgPaintServerType;
typedef union _RsvgPaintServerCore RsvgPaintServerCore;
71 72 73 74 75 76 77
typedef struct _RsvgPaintServerIri RsvgPaintServerIri;

struct _RsvgPaintServerIri {
    char *iri_str;
    gboolean has_alternate;
    RsvgSolidColor alternate;
};
78 79

union _RsvgPaintServerCore {
80
    RsvgSolidColor *color;
81
    RsvgPaintServerIri *iri;
82 83 84
};

enum _RsvgPaintServerType {
85
    RSVG_PAINT_SERVER_SOLID,
86
    RSVG_PAINT_SERVER_IRI
87 88 89
};

struct _RsvgPaintServer {
90 91 92
    int refcnt;
    RsvgPaintServerType type;
    RsvgPaintServerCore core;
93 94
};

95
/* Create a new paint server based on a specification string. */
96
G_GNUC_INTERNAL
97
RsvgPaintServer	    *rsvg_paint_server_parse    (gboolean *inherit, const char *str);
98
G_GNUC_INTERNAL
99
void                 rsvg_paint_server_ref      (RsvgPaintServer * ps);
100
G_GNUC_INTERNAL
101
void                 rsvg_paint_server_unref    (RsvgPaintServer * ps);
102

103
G_GNUC_INTERNAL
104
RsvgNode *rsvg_new_linear_gradient  (const char *element_name, RsvgNode *parent);
105
G_GNUC_INTERNAL
106
RsvgNode *rsvg_new_radial_gradient  (const char *element_name, RsvgNode *parent);
107 108

/* Implemented in rust/src/stop.rs */
109
G_GNUC_INTERNAL
110
RsvgNode *rsvg_node_stop_new (const char *element_name, RsvgNode *parent);
111

112

113
G_END_DECLS
114

115
#endif