sp-gradient.h revision 214a2dca4418a9937d7142e42ed91fdfdb86ae16
#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 <cstddef>
#include <sigc++/connection.h>
#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"
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)
*/
SPGradient();
virtual ~SPGradient();
/** gradientUnits attribute */
unsigned int units_set : 1;
/** gradientTransform attribute */
unsigned int gradientTransform_set : 1;
/** spreadMethod attribute */
unsigned int spread_set : 1;
/** Gradient stops */
unsigned int has_stops : 1;
/** Gradient patches */
unsigned int has_patches : 1;
/** Reference (href) */
/** State in Inkscape gradient system */
unsigned int state;
/** Linear and Radial Gradients */
/** Composed vector */
bool hasStops() const;
SPStop* getFirstStop();
int getStopCount() const;
bool isEquivalent(SPGradient *b);
bool isAligned(SPGradient *b);
/** 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.
*/
//static GType getType();
/** 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();
virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags);
};
void
SPGradient *gr,
double opacity);
/* Gradient repr methods */
#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 :