sp-gradient.h revision 51dc158adbe2c9d1df3c941cbf78b90944d1afc2
#ifndef SEEN_SP_GRADIENT_H
#define SEEN_SP_GRADIENT_H
/*
* 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 <vector>
#include "sp-paint-server.h"
#include "sp-gradient-spread.h"
#include "sp-gradient-units.h"
#include "sp-gradient-vector.h"
#include "sp-mesh-array.h"
#include <stddef.h>
#include <sigc++/connection.h>
struct SPStop;
#define SP_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_GRADIENT, SPGradientClass))
enum SPGradientType {
};
enum SPGradientMeshType {
};
enum SPGradientState {
};
enum GrPointType {
POINT_LG_BEGIN = 0, //start enum at 0 (for indexing into gr_knot_shapes array for example)
// insert new point types here.
};
enum PaintTarget {
};
/**
* Convenience function to access a common vector of all enum values.
*/
} // namespace Inkscape
/**
* Gradient
*
* Implement spread, stops list
* \todo fixme: Implement more here (Lauris)
*/
/** gradientUnits attribute */
/** gradientTransform attribute */
/** spreadMethod attribute */
/** Gradient stops */
/** Gradient patches */
SPGradient() :
units(),
spread(),
state(2),
vector()
{}
/** Reference (href) */
/** State in Inkscape gradient system */
/** Linear and Radial Gradients */
/** Composed vector */
bool hasStops() const;
SPStop* getFirstStop();
int getStopCount() const;
/** Mesh Gradients **************/
/** Composed array (for mesh gradients) */
bool hasPatches() const;
/** All Gradients **************/
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();
/** Forces array (mesh) to be built, if not present (i.e. changed) */
void ensureArray();
/** Ensures that color array is populated */
void ensureColors();
/**
* Set spread property of gradient and emit modified.
*/
bool invalidateVector();
bool invalidateArray();
void rebuildVector();
void rebuildArray();
// friend class SPLGPainter;
// friend class SPRGPainter;
};
/**
* The SPGradient vtable.
*/
struct SPGradientClass {
};
virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
};
#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:fileencoding=utf-8:textwidth=99 :