/*
* LPEToolContext: a context for a generic tool composed of subtools that are given by LPEs
*
* Authors:
* Maximilian Albert <maximilian.albert@gmail.com>
* Lauris Kaplinski <lauris@kaplinski.com>
* Abhishek Sharma
*
* Copyright (C) 1998 The Free Software Foundation
* Copyright (C) 1999-2005 authors
* Copyright (C) 2001-2002 Ximian, Inc.
* Copyright (C) 2008 Maximilian Albert
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gdk/gdkkeysyms.h>
#include "macros.h"
#include "pixmaps/cursor-crosshairs.xpm"
#include "desktop.h"
#include "message-context.h"
#include "preferences.h"
#include "ui/shape-editor.h"
#include "selection.h"
#include "document.h"
#include "display/canvas-bpath.h"
#include "display/canvas-text.h"
#include "message-stack.h"
#include "sp-path.h"
#include "ui/tools/lpe-tool.h"
// this must be here to account for the "all inactive" action
};
namespace Inkscape {
namespace UI {
namespace Tools {
}
, shape_editor(NULL)
, canvas_bbox(NULL)
// TODO: pointer?
{
}
delete this->shape_editor;
this->shape_editor = NULL;
if (this->canvas_bbox) {
this->canvas_bbox = NULL;
}
delete this->measuring_items;
this->measuring_items = NULL;
this->sel_changed_connection.disconnect();
}
this->sel_changed_connection.disconnect();
this->sel_changed_connection =
selection->connectChanged(sigc::bind(sigc::ptr_fun(&sp_lpetool_context_selection_changed), (gpointer)this));
// TODO temp force:
this->enableSelectionCue();
if (item) {
}
this->enableSelectionCue();
}
}
/**
* Callback that processes the "changed" signal on the selection;
* destroys old and creates new nodepath and reassigns listeners to the new selected item's repr.
*/
{
}
}
}
case GDK_BUTTON_PRESS:
{
// select the clicked item but do nothing else
break;
}
case GDK_BUTTON_RELEASE:
// TODO: do we need to catch this or can we pass it on to the parent handler?
break;
default:
break;
}
if (!ret) {
}
return ret;
}
bool ret = false;
if (this->hasWaitingLPE()) {
// quit when we are waiting for a LPE to be applied
//ret = ((ToolBaseClass *) sp_lpetool_context_parent_class)->root_handler(event_context, event);
}
case GDK_BUTTON_PRESS:
// don't do anything for now if we are inactive (except clearing the selection
// since this was a click into empty space)
desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Choose a construction tool from the toolbar."));
ret = true;
break;
}
// save drag origin
this->within_tolerance = true;
using namespace Inkscape::LivePathEffect;
//bool over_stroke = lc->shape_editor->is_over_stroke(Geom::Point(event->button.x, event->button.y), true);
// we pass the mouse click on to pen tool as the first click which it should collect
//ret = ((ToolBaseClass *) sp_lpetool_context_parent_class)->root_handler(event_context, event);
}
break;
case GDK_BUTTON_RELEASE:
{
/**
break;
**/
}
case GDK_KEY_PRESS:
/**
switch (get_group0_keyval (&event->key)) {
}
break;
**/
case GDK_KEY_RELEASE:
/**
switch (get_group0_keyval(&event->key)) {
case GDK_Control_L:
case GDK_Control_R:
dc->_message_context->clear();
break;
default:
break;
}
**/
default:
break;
}
if (!ret) {
}
return ret;
}
/*
* Finds the index in the list of geometric subtools corresponding to the given LPE type.
* Returns -1 if no subtool is found.
*/
int
for (int i = 0; i < num_subtools; ++i) {
return i;
}
}
return -1;
}
/*
* Checks whether an item has a construction applied as LPE and if so returns the index in
* lpesubtools of this construction
*/
{
if (!SP_IS_LPE_ITEM(item)) {
return -1;
}
if (!lpe) {
return -1;
}
}
/*
* Attempts to perform the construction of the given type (i.e., to apply the corresponding LPE) to
* a single selected item. Returns whether we succeeded.
*/
bool
{
// TODO: should we check whether type represents a valid geometric construction?
if (item && SP_IS_LPE_ITEM(item) && Inkscape::LivePathEffect::Effect::acceptsNumClicks(type) == 0) {
return true;
}
return false;
}
void
{
if (index != -1) {
} else {
return;
}
}
void
}
/*
* Reads the limiting bounding box from preferences and draws it on the screen
*/
// TODO: Note that currently the bbox is not user-settable; we simply use the page borders
void
{
if (lc->canvas_bbox) {
}
return;
A *= doc2dt;
B *= doc2dt;
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(lc->canvas_bbox), 0x0000ffff, 0.8, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT, 5, 5);
}
static void
const double t, const double length, bool /*use_curvature*/ = false)
{
using namespace Geom;
}
void
{
if (!selection) {
}
double lengthval;
if (SP_IS_PATH(*i)) {
if (!show)
} else {
}
// TODO: must we free arc_length?
}
}
}
void
{
}
}
void
{
++i )
{
} else {
}
// TODO: must we free arc_length?
}
}
void
{
if (show) {
} else {
}
}
}
}
}
}
/*
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 :