sp-gradient.h revision e11d953841f9fb3d42e9a1655ecaf43e825b1058
#ifndef SEEN_SP_GRADIENT_H
#define SEEN_SP_GRADIENT_H
/** \file
* SVG <stop> <linearGradient> and <radialGradient> implementation
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
* Jon A. Cruz <jon@joncruz.org>
*
* Copyrigt (C) 2010 Jon A. Cruz
* Copyright (C) 2007 Johan Engelen
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <gdk/gdktypes.h>
#include "libnr/nr-matrix.h"
#include "sp-paint-server.h"
#include "sp-gradient-spread.h"
#include "sp-gradient-units.h"
#include "sp-gradient-vector.h"
#include <sigc++/connection.h>
struct SPGradientReference;
#define SP_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_GRADIENT, SPGradientClass))
typedef enum {
typedef enum {
typedef enum {
POINT_LG_BEGIN =0, //start enum at 0 (for indexing into gr_knot_shapes array for example)
// insert new point types here.
} GrPointType;
/**
* Gradient
*
* Implement spread, stops list
* \todo fixme: Implement more here (Lauris)
*/
/** Reference (href) */
/** State in Inkscape gradient system */
/** gradientUnits attribute */
/** gradientTransform attribute */
/** spreadMethod attribute */
/** Gradient stops */
/** Composed vector */
/** Rendered color array (4 * 1024 bytes) */
bool hasStops() const;
SPStop* getFirstStop();
int getStopCount() const;
bool isUnitsSet() const;
SPGradientUnits getUnits() const;
bool isSpreadSet() const;
SPGradientSpread getSpread() const;
/**
* Returns private vector of given gradient (the gradient at the end of the href chain which has
* stops), optionally normalizing it.
*
* \pre SP_IS_GRADIENT(gradient).
* \pre There exists a gradient in the chain that has stops.
*/
/** Forces vector to be built, if not present (i.e. changed) */
void ensureVector();
/** Ensures that color array is populated */
void ensureColors();
/**
* Set spread property of gradient and emit modified.
*/
bool invalidateVector();
void rebuildVector();
};
/**
* The SPGradient vtable.
*/
struct SPGradientClass {
};
#include "sp-gradient-fns.h"
#endif // SEEN_SP_GRADIENT_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :