knotholder.cpp revision 15e3dcef1404b66dcfd4658e63d2323fc41b98f0
#define __KNOT_HOLDER_C__
/*
* Container for SPKnot visual handles
*
* Authors:
* Mitsuru Oka <oka326@parkcity.ne.jp>
* bulia byak <buliabyak@users.sf.net>
* Maximilian Albert <maximilian.albert@gmail.com>
*
* Copyright (C) 2001-2008 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "document.h"
#include "sp-shape.h"
#include "knot.h"
#include "knotholder.h"
#include "rect-context.h"
#include "sp-rect.h"
#include "arc-context.h"
#include "sp-ellipse.h"
#include "star-context.h"
#include "sp-star.h"
#include "spiral-context.h"
#include "sp-spiral.h"
#include "sp-offset.h"
#include "box3d.h"
#include "sp-pattern.h"
#include "style.h"
#include "live_effects/lpeobject.h"
class SPDesktop;
{
g_print ("Error! Throw an exception, please!\n");
}
this->released = relhandler;
this->local_change = FALSE;
}
KnotHolder::~KnotHolder() {
KnotHolderEntity* e = (*i);
if (e->isDeletable()) {
delete (*i);
} else {
// we must not delete the entity (since it's attached to an LPE parameter),
// but the handle should be destroyed
g_object_unref(e->knot);
}
(*i) = NULL;
}
}
/**
* \param p In desktop coordinates.
*/
void
{
KnotHolderEntity *e = *i;
e->update_knot();
}
}
void
{
KnotHolder *knot_holder = this;
for(std::list<KnotHolderEntity *>::iterator i = knot_holder->entity.begin(); i != knot_holder->entity.end(); ++i) {
KnotHolderEntity *e = *i;
// no need to test whether knot_click exists since it's virtual now
e->knot_click(state);
break;
}
}
if (SP_IS_SHAPE(item)) {
}
unsigned int object_verb = SP_VERB_NONE;
if (SP_IS_RECT(item))
else if (SP_IS_BOX3D(item))
else if (SP_IS_GENERICELLIPSE(item))
else if (SP_IS_STAR(item))
else if (SP_IS_SPIRAL(item))
else if (SP_IS_OFFSET(item)) {
else
}
// for drag, this is done by ungrabbed_handler, but for click we must do it here
_("Change handle"));
}
void
{
// this was a local change and the knotholder does not need to be recreated:
this->local_change = TRUE;
for(std::list<KnotHolderEntity *>::iterator i = this->entity.begin(); i != this->entity.end(); ++i) {
KnotHolderEntity *e = *i;
break;
}
}
if (SP_IS_SHAPE (item)) {
}
this->update_knots();
}
void
{
if (this->released) {
} else {
// Caution: this call involves a screen update, which may process events, and as a
// result the knotholder may be destructed. So, after the updateRepr, we cannot use any
// fields of this knotholder (such as this->item), but only values we have saved beforehand
// (such as object).
object->updateRepr();
/* do cleanup tasks (e.g., for LPE items write the parameter values
* that were changed by dragging the handle to SVG)
*/
if (SP_IS_LPE_ITEM(object)) {
// This writes all parameters to SVG. Is this sufficiently efficient or should we only
// write the ones that were changed?
if (lpe) {
}
}
unsigned int object_verb = SP_VERB_NONE;
if (SP_IS_RECT(object))
else if (SP_IS_BOX3D(object))
else if (SP_IS_GENERICELLIPSE(object))
else if (SP_IS_STAR(object))
else if (SP_IS_SPIRAL(object))
else if (SP_IS_OFFSET(object)) {
else
}
_("Move handle"));
}
}
void
{
}
void
{
{
// TRANSLATORS: This refers to the pattern that's inside the object
_("<b>Move</b> the pattern fill inside the object"),
_("<b>Scale</b> the pattern fill uniformly"),
_("<b>Rotate</b> the pattern fill; with <b>Ctrl</b> to snap angle"),
}
}
/*
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:encoding=utf-8:textwidth=99 :