star-context.cpp revision 82ea1619194ed558b2fd7bbbde4c6925cba1669e
1117N/A#ifdef HAVE_CONFIG_H
1117N/A#include "display/sp-canvas.h"
1117N/A#include "document.h"
1117N/A#include "document-undo.h"
1117N/A#include "sp-namedview.h"
1117N/A#include "selection.h"
1117N/A#include "desktop-handles.h"
1117N/A#include "desktop-style.h"
1117N/A#include "message-context.h"
1117N/A#include "pixmaps/cursor-star.xpm"
1117N/A#include "sp-metrics.h"
1117N/A#include "preferences.h"
1117N/A#include "xml/node-event-vector.h"
1117N/A#include "context-fns.h"
1117N/A#include "shape-editor.h"
1117N/A#include "display/sp-canvas-item.h"
1117N/A#include "star-context.h"
1117N/A#include "tool-factory.h"
1117N/A return new SPStarContext();
1117N/A bool starContextRegistered = ToolFactory::instance().registerObject("/tools/shapes/star", createStarContext);
1117N/A this->finishItem();
1117N/A this->enableGrDrag(false);
1117N/A delete this->shape_editor;
1117N/A this->finishItem();
1117N/A if (this->_message_context) {
1117N/A delete this->_message_context;
1117N/A this->sel_changed_connection = selection->connectChanged(sigc::mem_fun(this, &SPStarContext::selection_changed));
1117N/A this->enableSelectionCue();
1117N/A this->enableGrDrag();
static bool dragging;
case GDK_BUTTON_PRESS:
dragging = true;
m.unSetup();
case GDK_MOTION_NOTIFY:
if ( this->within_tolerance
this->within_tolerance = false;
} else if (!sp_event_context_knot_mouseover(this)) {
m.unSetup();
case GDK_BUTTON_RELEASE:
dragging = false;
if (!this->within_tolerance) {
this->finishItem();
} else if (this->item_to_select) {
case GDK_KEY_PRESS:
case GDK_KEY_Alt_R:
case GDK_KEY_Control_L:
case GDK_KEY_Control_R:
case GDK_KEY_Shift_L:
case GDK_KEY_Shift_R:
case GDK_KEY_Meta_R:
NULL,
NULL);
case GDK_KEY_Up:
case GDK_KEY_Down:
case GDK_KEY_KP_Up:
case GDK_KEY_KP_Down:
if (!MOD__CTRL_ONLY)
case GDK_KEY_x:
case GDK_KEY_X:
if (MOD__ALT_ONLY) {
case GDK_KEY_Escape:
if (dragging) {
dragging = false;
this->cancel();
case GDK_KEY_space:
if (dragging) {
dragging = false;
if (!this->within_tolerance) {
this->finishItem();
case GDK_KEY_Delete:
case GDK_KEY_KP_Delete:
case GDK_KEY_BackSpace:
case GDK_KEY_RELEASE:
case GDK_KEY_Alt_L:
case GDK_KEY_Alt_R:
case GDK_KEY_Control_L:
case GDK_KEY_Control_R:
case GDK_KEY_Shift_L:
case GDK_KEY_Shift_R:
case GDK_KEY_Meta_R:
if (!ret) {
return ret;
if (!this->star) {
m.unSetup();
( this->isflatsided?
this->cancel();
this->within_tolerance = false;
this->xp = 0;
this->yp = 0;