path.cpp revision 3567021c833341b50efa625b193c8e9123d06ec3
/*
* Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/parameter/path.h"
#include "live_effects/effect.h"
#include "libnr/n-art-bpath-2geom.h"
#include <gtk/gtkstock.h>
#include "selection-chemistry.h"
#include "desktop.h"
#include "inkscape.h"
#include "message-stack.h"
#include "verbs.h"
#include "document.h"
// needed for on-canvas editting:
#include "tools-switch.h"
#include "shape-editor.h"
#include "node-context.h"
#include "desktop-handles.h"
#include "selection.h"
#include "nodepath.h"
// clipboard support
#include "ui/clipboard.h"
// required for linking to other paths
#include "uri.h"
#include "sp-shape.h"
#include "sp-text.h"
namespace Inkscape {
namespace LivePathEffect {
_pathvector(),
_pwd2(),
must_recalculate_pwd2(false),
{
oncanvas_editable = true;
ref_changed_connection = ref.changedSignal().connect(sigc::mem_fun(*this, &PathParam::ref_changed));
}
{
remove_link();
}
{
return _pathvector;
}
{
ensure_pwd2();
return _pwd2;
}
void
{
}
void
{
}
bool
{
if (strvalue) {
_pathvector.clear();
remove_link();
must_recalculate_pwd2 = true;
if (strvalue[0] == '#') {
if (href)
// Now do the attaching, which emits the changed signal.
try {
} catch (Inkscape::BadURIException &e) {
}
} else {
}
return true;
}
return false;
}
gchar *
PathParam::param_getSVGValue() const
{
if (href) {
return href;
} else {
return svgd;
}
}
{
}
void
{
// If not already in nodecontext, goto it!
}
if (!href) {
shape_editor->set_item_lpe_path_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str());
} else {
// set referred item for editing
}
}
void
{
np->show_helperpath = true;
}
void
{
if (!href) {
// TODO: recode this to apply transform to _pathvector instead?
// only apply transform when not referring to other path
ensure_pwd2();
}
}
void
{
remove_link();
// force value upon pwd2 and don't recalculate.
must_recalculate_pwd2 = false;
}
void
{
remove_link();
must_recalculate_pwd2 = true;
}
void
{
if (must_recalculate_pwd2) {
for (unsigned int i=0; i < _pathvector.size(); i++) {
}
must_recalculate_pwd2 = false;
}
}
void
{
return;
}
linked_modified_connection = to->connectModified(sigc::mem_fun(*this, &PathParam::linked_modified));
linked_modified(to, SP_OBJECT_MODIFIED_FLAG); // simulate linked_modified signal, so that path data is updated
}
void
PathParam::quit_listening(void)
{
}
void
{
if ( new_ref ) {
}
}
void
{
if (href) {
}
}
void
{
remove_link();
}
void
{
if (SP_IS_SHAPE(linked_obj)) {
}
if (SP_IS_TEXT(linked_obj)) {
}
// curve invalid, set default value
} else {
}
must_recalculate_pwd2 = true;
}
/* CALLBACK FUNCTIONS FOR THE BUTTONS */
void
{
}
}
void
{
if (svgd == "")
return;
// remove possible link to path
remove_link();
}
void
{
_("Paste path parameter"));
}
void
{
cm->copyPathParameter(this);
}
void
{
if (pathid == "") {
return;
}
// add '#' at start to make it an uri.
// no change, do nothing
return;
} else {
// TODO:
// check if id really exists in document, or only in clipboard document: if only in clipboard then invalid
// check if linking to object to which LPE is applied (maybe delegated to PathReference
_("Link path parameter to path"));
}
}
} /* namespace LivePathEffect */
} /* namespace Inkscape */
/*
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 :