zoom-tool.cpp revision 109f3a0a8c2bc2765677eeb98d84d394598c6d49
/*
* Handy zooming tool
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Frank Felfe <innerspace@iname.com>
* bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 1999-2002 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <gdk/gdkkeysyms.h>
#include "macros.h"
#include "rubberband.h"
#include "display/sp-canvas-item.h"
#include "display/sp-canvas-util.h"
#include "desktop.h"
#include "pixmaps/cursor-zoom.xpm"
#include "pixmaps/cursor-zoom-out.xpm"
#include "preferences.h"
#include "selection-chemistry.h"
#include "ui/tools/zoom-tool.h"
namespace Inkscape {
namespace UI {
namespace Tools {
}
, escaped(false)
{
}
}
this->enableGrDrag(false);
if (this->grabbed) {
}
}
this->enableSelectionCue();
}
this->enableGrDrag();
}
}
bool ret = false;
case GDK_BUTTON_PRESS:
{
// save drag origin
within_tolerance = true;
escaped = false;
ret = true;
? zoom_inc
: 1 / zoom_inc );
ret = true;
}
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK,
break;
}
case GDK_MOTION_NOTIFY:
ret = true;
if ( within_tolerance
break; // do not drag if we're within tolerance from origin
}
// Once the user has moved farther than tolerance from the original location
// (indicating they intend to move the object, not click), then always process the
// motion notify coordinates as given (no snapping back to origin)
within_tolerance = false;
}
break;
case GDK_BUTTON_RELEASE:
{
} else if (!escaped) {
? 1 / zoom_inc
: zoom_inc );
}
ret = true;
}
if (this->grabbed) {
}
escaped = false;
break;
}
case GDK_KEY_PRESS:
case GDK_KEY_Escape:
}
escaped = true;
ret = true;
break;
case GDK_KEY_Up:
case GDK_KEY_Down:
case GDK_KEY_KP_Up:
case GDK_KEY_KP_Down:
// prevent the zoom field from activation
if (!MOD__CTRL_ONLY(event))
ret = true;
break;
case GDK_KEY_Shift_L:
case GDK_KEY_Shift_R:
this->cursor_shape = cursor_zoom_out_xpm;
this->sp_event_context_update_cursor();
break;
case GDK_KEY_Delete:
case GDK_KEY_KP_Delete:
case GDK_KEY_BackSpace:
break;
default:
break;
}
break;
case GDK_KEY_RELEASE:
case GDK_KEY_Shift_L:
case GDK_KEY_Shift_R:
this->cursor_shape = cursor_zoom_xpm;
this->sp_event_context_update_cursor();
break;
default:
break;
}
break;
default:
break;
}
if (!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 :