sp-path.cpp revision af33014ef3896559f1521e15f1f1fe34c148ca48
#define __SP_PATH_C__
/*
* SVG <path> implementation
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* David Turner <novalis@gnu.org>
*
* Copyright (C) 2004 David Turner
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <libnr/n-art-bpath.h>
#include <libnr/nr-matrix-fns.h>
#include "attributes.h"
#include "sp-path.h"
#include "sp-guide.h"
#include "document.h"
#define noPATH_VERBOSE
static Inkscape::XML::Node *sp_path_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
static SPShapeClass *parent_class;
/**
* Gets the GType object for SPPathClass
*/
sp_path_get_type(void)
{
if (!type) {
sizeof(SPPathClass),
sizeof(SPPath),
16,
NULL, /* value_table */
};
}
return type;
}
/**
* Does the object-oriented work of initializing the class structure
* including parent class, and registers function pointers for
* the functions build, set, write, and set_transform.
*/
static void
{
}
{
if (!curve) return 0;
if (i > r) i = r; // sometimes after switching from node editor length is wrong, e.g. f6 - draw - f2 - tab - f1, this fixes it
for (; i >= 0; i --)
r --;
return r;
}
static gchar *
{
} else {
}
}
static void
{
if (!curve) return;
/* we only convert straight line segments (converting curve segments would be unintuitive) */
}
/* remember current point for potential reuse in the next step
(e.g., in case this was an NR_MOVETO or NR_MOVETO_OPEN) */
}
}
/**
* Initializes an SPPath.
*/
static void
{
}
static void
{
}
/**
* Given a repr, this sets the data items in the path object such as
* fill & style attributes, markers, and CSS properties.
*/
static void
{
/* Are these calls actually necessary? */
}
/* d is a required attribute */
if (d == NULL) {
}
}
static void
{
if (path->original_curve) {
}
}
}
/**
* Sets a value in the path object given by 'key', to 'value'. This is used
* for setting attributes and markers on a path object.
*/
static void
{
switch (key) {
if (value) {
if (curve) {
}
} else {
}
break;
case SP_ATTR_D:
if (value) {
if (curve) {
}
} else {
}
}
break;
case SP_PROP_MARKER:
case SP_PROP_MARKER_START:
case SP_PROP_MARKER_MID:
case SP_PROP_MARKER_END:
break;
case SP_ATTR_CONNECTOR_TYPE:
case SP_ATTR_CONNECTION_START:
case SP_ATTR_CONNECTION_END:
break;
default:
}
break;
}
}
/**
*
* Writes the path object into a Inkscape::XML::Node
*/
{
}
if (abp) {
} else {
}
} else {
}
if (abp) {
} else {
}
} else {
}
}
return repr;
}
static void
{
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // since we change the description, it's not a "just translation" anymore
}
}
}
/**
* Writes the given transform into the repr for the given item.
*/
{
}
if (origcurve) {
}
} else { /* Transform the path */
if (curve) {
}
}
// Adjust stroke
// Adjust pattern fill
// Adjust gradient fill
// Adjust LPE
// nothing remains - we've written all of the transform, so return identity
}
static void
{
if (path->original_curve) {
if (write) {
// could also do SP_OBJECT(shape)->updateRepr(); but only the d attribute needs updating.
if (abp) {
} else {
}
} else {
}
}
} else {
}
}
/**
* Adds a original_curve to the path. If owner is specified, a reference
* will be made, otherwise the curve will be copied into the path.
* Any existing curve in the path will be unreferenced first.
* This routine triggers reapplication of the an effect is present
* an also triggers a request to update the display. Does not write
* result to XML when write=false.
*/
void
{
if (path->original_curve) {
}
if (curve) {
if (owner) {
} else {
}
}
}
/**
* Return duplicate of original_curve (if any exists) or NULL if there is no curve
*/
SPCurve *
{
if (path->original_curve) {
}
return NULL;
}
/**
* Return duplicate of edittable curve which is original_curve if it exists or
* shape->curve if not.
*/
{
if (path->original_curve) {
return sp_path_get_original_curve(path);
} else {
}
}
/**
* Return a reference to original_curve if it exists or
* shape->curve if not.
*/
const SPCurve*
{
if (path->original_curve) {
return path->original_curve;
} else {
}
}
/*
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 :