knot-holder-entity.cpp revision 3e26f3cb3cbdaed02dbd5d69fd0675e28d8c0419
#define __KNOT_HOLDER_ENTITY_C__
/** \file
* KnotHolderEntity definition.
*
* Authors:
* Mitsuru Oka <oka326@parkcity.ne.jp>
* Maximilian Albert <maximilian.albert@gmail.com>
*
* Copyright (C) 1999-2001 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
* Copyright (C) 2001 Mitsuru Oka
* Copyright (C) 2004 Monash University
* Copyright (C) 2008 Maximilian Albert
*
* Released under GNU GPL
*/
#include "knotholder.h"
#include "sp-item.h"
#include "style.h"
#include "prefs-utils.h"
#include "macros.h"
#include <libnr/nr-matrix-ops.h>
#include "sp-pattern.h"
#include "snap.h"
#include "desktop.h"
#include "sp-namedview.h"
int KnotHolderEntity::counter = 0;
void
{
this->parent_holder = parent;
update_knot();
_moved_connection = knot->_moved_signal.connect(sigc::mem_fun(*parent_holder, &KnotHolder::knot_moved_handler));
_click_connection = knot->_click_signal.connect(sigc::mem_fun(*parent_holder, &KnotHolder::knot_clicked_handler));
_ungrabbed_connection = knot->_ungrabbed_signal.connect(sigc::mem_fun(*parent_holder, &KnotHolder::knot_ungrabbed_handler));
}
{
/* unref should call destroy */
if (knot) {
} else {
// FIXME: This shouldn't occur. Perhaps it is caused by LPE PointParams being knotholder entities, too
// If so, it will likely be fixed with upcoming refactoring efforts.
}
}
void
{
}
{
}
/* Pattern manipulation */
/* TODO: this pattern manipulation is not able to handle general transformation matrices. Only matrices that are the result of a pure scale times a pure rotation. */
{
}
{
}
{
}
void
{
// FIXME: this snapping should be done together with knowing whether control was pressed. If GDK_CONTROL_MASK, then constrained snapping should be used.
if ( state & GDK_CONTROL_MASK ) {
} else {
}
}
if (state) {
}
}
{
return sp_pattern_extract_trans(pat);
}
{
gdouble y = 0;
return delta;
}
void
PatternKnotHolderEntityAngle::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
{
// get the angle from pattern 0,0 to the cursor pos
if ( state & GDK_CONTROL_MASK ) {
}
// get the scale from the current transform so we can keep it.
}
void
PatternKnotHolderEntityScale::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
{
// FIXME: this snapping should be done together with knowing whether control was pressed. If GDK_CONTROL_MASK, then constrained snapping should be used.
// get angle from current transform
// Get the new scale from the position of the knotholder
if ( state & GDK_CONTROL_MASK ) {
// if ctrl is pressed: use 1:1 scaling
} else {
}
}
{
a[4] = 0;
a[5] = 0;
return delta;
}
/*
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 :