shape-editor.cpp revision 08ff610afd206b66a72d448ab6738d398ea74d80
/*
* Inkscape::ShapeEditor
*
* Authors:
* bulia byak <buliabyak@users.sf.net>
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "sp-object.h"
#include "sp-item.h"
#include "sp-lpe-item.h"
#include "live_effects/lpeobject.h"
#include "selection.h"
#include "desktop.h"
#include "document.h"
#include "desktop-handles.h"
#include "knotholder.h"
#include "live_effects/parameter/point.h"
#include "xml/node-event-vector.h"
#include "preferences.h"
#include "object-edit.h"
#include "style.h"
#include "shape-editor.h"
using Inkscape::createKnotHolder;
this->knotholder = NULL;
this->knotholder_listener_attached_for = NULL;
}
ShapeEditor::~ShapeEditor() {
}
switch (type) {
case SH_NODEPATH:
// defunct
break;
case SH_KNOTHOLDER:
if (this->knotholder) {
}
if (!keep_knotholder) {
delete this->knotholder;
this->knotholder = NULL;
}
}
break;
}
}
bool ShapeEditor::has_nodepath () {
return false;
}
bool ShapeEditor::has_knotholder () {
return (this->knotholder != NULL);
}
void ShapeEditor::update_knotholder () {
if (this->knotholder)
this->knotholder->update_knots();
}
switch (type) {
case SH_NODEPATH:
// defunct
return false;
case SH_KNOTHOLDER:
default:
}
}
switch (type) {
case SH_NODEPATH:
// defunct
break;
case SH_KNOTHOLDER:
if (this->knotholder) {
}
break;
default:
}
}
switch (type) {
case SH_NODEPATH:
// defunct
break;
case SH_KNOTHOLDER:
if (this->has_knotholder()) {
}
break;
}
return item;
}
// defunct stub
return NULL;
}
// defunct stub
}
{
if (has_knotholder())
{
if (changed_kh) {
// this can happen if an LPEItem's knotholder handle was dragged, in which case we want
// to keep the knotholder; in all other cases (e.g., if the LPE itself changes) we delete it
}
}
}
{
}
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
// this happens (and should only happen) when for an LPEItem having both knotholder and
// nodepath the knotholder is adapted; in this case we don't want to delete the knotholder
// since this freezes the handles
if (item) {
switch(type) {
case SH_NODEPATH:
// defunct
break;
case SH_KNOTHOLDER:
if (!this->knotholder) {
// only recreate knotholder if none is present
}
if (this->knotholder) {
this->knotholder->update_knots();
// setting new listener
if (repr != knotholder_listener_attached_for) {
}
}
break;
}
}
}
/** FIXME: This thing is only called when the item needs to be updated in response to repr change.
Why not make a reload function in NodePath and in KnotHolder? */
{
switch (type) {
case SH_NODEPATH:
// defunct
break;
case SH_KNOTHOLDER:
if ( knotholder ) {
SPObject *obj = sp_desktop_document(desktop)->getObjectByRepr(knotholder_listener_attached_for); /// note that it is not certain that this is an SPItem; it could be a LivePathEffectObject.
}
break;
}
}
void ShapeEditor::nodepath_destroyed () {
}
bool ShapeEditor::has_selection() {
return false; // so far, knotholder cannot have selection
}
/**
* Returns true if this ShapeEditor has a knot above which the mouse currently hovers.
*/
bool ShapeEditor::knot_mouseover()
{
if (this->knotholder) {
return knotholder->knot_mouseover();
}
return false;
}
/*
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 :