1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /** @file 3 * TODO: insert short description here 4 *//* 5 * Authors: see git history 6 * 7 * Copyright (C) 2018 Authors 8 * Released under GNU GPL v2+, read the file 'COPYING' for more information. 9 */ 10 #ifndef SP_RADIAL_GRADIENT_H 11 #define SP_RADIAL_GRADIENT_H 12 13 /** \file 14 * SPRadialGradient: SVG <radialgradient> implementtion. 15 */ 16 17 #include "sp-gradient.h" 18 #include "svg/svg-length.h" 19 20 typedef struct _cairo cairo_t; 21 typedef struct _cairo_pattern cairo_pattern_t; 22 23 #define SP_RADIALGRADIENT(obj) (dynamic_cast<SPRadialGradient*>((SPObject*)obj)) 24 #define SP_IS_RADIALGRADIENT(obj) (dynamic_cast<const SPRadialGradient*>((SPObject*)obj) != NULL) 25 26 /** Radial gradient. */ 27 class SPRadialGradient : public SPGradient { 28 public: 29 SPRadialGradient(); 30 ~SPRadialGradient() override; 31 32 SVGLength cx; 33 SVGLength cy; 34 SVGLength r; 35 SVGLength fx; 36 SVGLength fy; 37 SVGLength fr; // Focus radius. Added in SVG 2 38 39 cairo_pattern_t* pattern_new(cairo_t *ct, Geom::OptRect const &bbox, double opacity) override; 40 41 protected: 42 void build(SPDocument *document, Inkscape::XML::Node *repr) override; 43 void set(SPAttr key, char const *value) override; 44 void update(SPCtx *ctx, unsigned int flags) override; 45 Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override; 46 }; 47 48 #endif /* !SP_RADIAL_GRADIENT_H */ 49 50 /* 51 Local Variables: 52 mode:c++ 53 c-file-style:"stroustrup" 54 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) 55 indent-tabs-mode:nil 56 fill-column:99 57 End: 58 */ 59 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : 60