selection.cpp revision 1a533c9a1013fdc90b0181206e1c6ae488041bee
/*
* Per-desktop selection container
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
* bulia byak <buliabyak@users.sf.net>
* Andrius R. <knutux@gmail.com>
* Abhishek Sharma
*
* Copyright (C) 2006 Andrius R.
* Copyright (C) 2004-2005 MenTaLguY
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "macros.h"
#include "inkscape-private.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "document.h"
#include "selection.h"
#include "helper/recthull.h"
#include "preferences.h"
#include "sp-shape.h"
#include "sp-path.h"
#include "sp-item-group.h"
#include "box3d.h"
#include "box3d.h"
#include "persp3d.h"
namespace Inkscape {
_flags(0),
_idle(0)
{
}
_clear();
if (_idle) {
_idle = 0;
}
}
/* Handler for selected objects "modified" signal */
if (!this->_idle) {
/* Request handling to be run in _idle loop */
this->_idle = g_idle_add_full(SP_SELECTION_UPDATE_PRIORITY, GSourceFunc(&Selection::_emit_modified), this, NULL);
}
/* Collect all flags */
}
{
/* force new handler to be created if requested before we return */
/* drop this handler */
return FALSE;
}
inkscape_selection_modified(this, flags);
}
if (persist_selection_context) {
if (NULL == _selection_context) {
_context_release_connection = _selection_context->connectRelease(sigc::mem_fun(*this, &Selection::_releaseContext));
}
} else {
}
inkscape_selection_changed(this);
_changed_signal.emit(this);
}
void
{
return;
}
void Selection::_invalidateCachedLists() {
}
while (_objs) {
}
}
if (NULL != _selection_context)
return _selection_context;
return desktop()->currentLayer();
}
return FALSE;
}
return;
}
}
}
}
// unselect any of the item's ancestors and descendants which may be selected
// (to prevent double-selection)
_release_connections[obj] = obj->connectRelease(sigc::mem_fun(*this, (void (Selection::*)(SPObject *))&Selection::remove));
_modified_connections[obj] = obj->connectModified(sigc::mem_fun(*this, &Selection::_schedule_modified));
}
_clear();
}
} else {
}
}
_emitChanged();
}
g_print ("Warning! Trying to remove unselected box from selection.\n");
return;
}
}
}
}
_clear();
}
}
_emitChanged();
}
return;
continue;
}
}
_emitChanged();
}
_clear();
if (obj) {
}
}
_emitChanged();
}
_clear();
_emitChanged();
}
return _objs;
}
if (_items) {
return _items;
}
if (SP_IS_ITEM(obj)) {
}
}
return _items;
}
}
return _reprs;
}
}
return pl;
}
if (persp) {
box = *i;
}
} else {
}
return boxes;
}
} else {
return NULL;
}
}
} else {
return NULL;
}
}
}
{
geometricBounds() : visualBounds();
}
{
}
return bbox;
}
{
}
return bbox;
}
{
} else {
}
}
{
}
return bbox;
}
// If we have a selection of multiple items, then the center of the first item
// will be returned; this is also the case in SelTrans::centerRequest()
if (items) {
SPItem *first = reinterpret_cast<SPItem*>(g_slist_last(items)->data); // from the first item in selection
}
}
bbox = visualBounds();
} else{
bbox = geometricBounds();
}
if (bbox) {
} else {
}
}
std::vector<Inkscape::SnapCandidatePoint> Selection::getSnapPoints(SnapPreferences const *snapprefs) const {
snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_ROTATION_CENTER, false); // locally disable snapping to the item center
//snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_NODE_CUSP, true); // consider any type of nodes as a snap source
//snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_NODE_SMOOTH, true); // i.e. disregard the smooth / cusp node preference
//Include the transformation origin for snapping
//For a selection or group only the overall origin is considered
}
}
return p;
}
// TODO: both getSnapPoints and getSnapPointsConvexHull are called, subsequently. Can we do this more efficient?
// Why do we need to include the transformation center in one case and not the other?
std::vector<Inkscape::SnapCandidatePoint> Selection::getSnapPointsConvexHull(SnapPreferences const *snapprefs) const {
snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_NODE_CUSP, true); // consider any type of nodes as a snap source
snapprefs_dummy.setTargetSnappable(Inkscape::SNAPTARGET_NODE_SMOOTH, true); // i.e. disregard the smooth / cusp node preference
}
if (!p.empty()) {
// these are the points we get back
}
if (rHull) {
for ( unsigned i = 0 ; i < 4 ; ++i ) {
}
}
}
return pHull;
}
while (parent) {
break;
}
}
}
}
while (parent) {
}
}
}
return object;
}
}
}
return ret;
}
}
}
return ret;
}
}
/*
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:fileencoding=utf-8:textwidth=99 :