sp-conn-end-pair.cpp revision 031a094cece1123331bae8b916d3f79e805372d2
/*
* A class for handling connector endpoint movement and libavoid interaction.
*
* Authors:
* Peter Moulder <pmoulder@mail.csse.monash.edu.au>
* Michael Wybrow <mjwybrow@users.sourceforge.net>
*
* * Copyright (C) 2004-2005 Monash University
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "attributes.h"
#include "sp-conn-end.h"
#include "uri.h"
#include "sp-path.h"
#include "libavoid/vertices.h"
#include "document.h"
#include "sp-item-group.h"
{
}
}
{
}
if (_connRef) {
delete _connRef;
}
}
void
{
}
}
void
{
}
static void
{
// Reroute connector
}
void
{
if (key == SP_ATTR_CONNECTOR_TYPE) {
}
else {
if (_connRef) {
delete _connRef;
}
}
return;
}
}
void
{
char const * const attr_strs[] = {"inkscape:connection-start",
"inkscape:connection-end"};
}
}
}
void
for (unsigned h = 0; h < 2; ++h) {
// Deal with the case of the attached object being an empty group.
// A group containing no items does not have a valid bbox, so
// causes problems for the auto-routing code. Also, since such a
// group no longer has an onscreen representation and can only be
// selected through the XML editor, it makes sense just to detach
// connectors from them.
if (SP_IS_GROUP(h2attItem[h])) {
// This group is empty, so detach.
sp_conn_end_detach(_path, h);
}
}
}
}
void
for (unsigned h = 0; h < 2; ++h) {
if ( h2attItem[h] ) {
}
else
{
if (h == 0) {
}
else {
}
}
}
}
{
}
static void emitPathInvalidationNotification(void *ptr)
{
// We emit a signal here rather than just calling the reroute function
// since this allows all the movement action computation to happen,
// then all connectors (that require it) will be rerouted. Otherwise,
// one connector could get rerouted several times as a result of
// dragging a couple of shapes.
}
void
{
}
void
SPConnEndPair::reroute(void)
{
}
// Called from sp_path_update to initialise the endpoints.
void
SPConnEndPair::update(void)
{
if (_connType != SP_CONNECTOR_NOAVOID) {
if (!(_connRef->isInitialised())) {
}
// Store the ID of the objects attached to the connector.
storeIds();
}
}
void SPConnEndPair::storeIds(void)
{
// href begins with a '#' which we don't want.
}
else {
}
// href begins with a '#' which we don't want.
}
else {
}
}
bool
SPConnEndPair::isAutoRoutingConn(void)
{
if (_connType != SP_CONNECTOR_NOAVOID) {
return true;
}
return false;
}
void
SPConnEndPair::makePathInvalid(void)
{
}
void
SPConnEndPair::reroutePath(void)
{
if (!isAutoRoutingConn()) {
// Do nothing
return;
}
sp_curve_lineto(curve, p);
}
}
/*
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 :