desktop-events.cpp revision bfbccf9b9c594a0558ff69b15b2ec94305263a52
#define __SP_DESKTOP_EVENTS_C__
/*
* Event handlers for SPDesktop
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 1999-2002 Lauris Kaplinski
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <map>
#include <string>
#include "display/guideline.h"
#include "display/snap-indicator.h"
#include "helper/unit-menu.h"
#include "desktop.h"
#include "document.h"
#include "sp-guide.h"
#include "sp-namedview.h"
#include "desktop-handles.h"
#include "event-context.h"
#include "widgets/desktop-widget.h"
#include "sp-metrics.h"
#include "dialogs/dialog-events.h"
#include "message-context.h"
#include "dialogs/guidelinedialog.h"
#include "snap.h"
#include "display/canvas-grid.h"
#include "display/canvas-axonomgrid.h"
#include "preferences.h"
#include "tools-switch.h"
static void init_extended();
/* Root item handler */
{
static bool watch = false;
static bool first = true;
if ( first ) {
watch = true;
}
first = false;
}
if ( watch ) {
}
}
{
static bool dragging = false;
gdk_window_get_geometry(GTK_WIDGET(dtw->canvas)->window, NULL /*x*/, NULL /*y*/, &width, &height, NULL/*depth*/);
case GDK_BUTTON_PRESS:
dragging = true;
// explicitly show guidelines; if I draw a guide, I want them on
// calculate the normal of the guidelines when dragged from the edges of rulers.
// guidelines normal to gridlines
} else {
}
}
if (horiz) {
if (wx < 50) {
} else {
}
} else {
if (wy < 50) {
} else {
}
}
}
break;
case GDK_MOTION_NOTIFY:
if (dragging) {
}
break;
case GDK_BUTTON_RELEASE:
dragging = false;
_("Create guide"));
}
}
default:
break;
}
return FALSE;
}
{
}
{
}
/* Guides */
enum SPGuideDragType {
};
{
static bool moved = false;
SPDesktop *desktop = static_cast<SPDesktop*>(gtk_object_get_data(GTK_OBJECT(item->canvas), "SPDesktop"));
case GDK_2BUTTON_PRESS:
}
break;
case GDK_BUTTON_PRESS:
break;
}
double tol = 40.0;
// the click was on the guide 'anchor'
} else {
NULL,
}
}
break;
case GDK_MOTION_NOTIFY:
if (drag_type != SP_DRAG_NONE) {
// This is for snapping while dragging existing guidelines. New guidelines,
// which are dragged off the ruler, are being snapped in sp_dt_ruler_event
switch (drag_type) {
case SP_DRAG_TRANSLATE:
{
break;
}
{
break;
}
case SP_DRAG_ROTATE:
{
break;
}
case SP_DRAG_MOVE_ORIGIN:
{
break;
}
case SP_DRAG_NONE:
break;
}
moved = true;
}
break;
case GDK_BUTTON_RELEASE:
if (moved) {
switch (drag_type) {
case SP_DRAG_TRANSLATE:
{
break;
}
{
break;
}
case SP_DRAG_ROTATE:
{
break;
}
case SP_DRAG_MOVE_ORIGIN:
{
break;
}
case SP_DRAG_NONE:
break;
}
_("Move guide"));
} else {
/* Undo movement of any attached shapes. */
_("Delete guide"));
}
moved = false;
}
}
case GDK_ENTER_NOTIFY:
{
desktop->guidesMessageContext()->setF(Inkscape::NORMAL_MESSAGE, _("<b>Guideline</b>: %s"), guide_description);
break;
}
case GDK_LEAVE_NOTIFY:
break;
default:
break;
}
return ret;
}
//static std::map<GdkInputSource, std::string> switchMap;
static void init_extended()
{
if ( devices ) {
// g_message("Adding '%s' as [%d]", dev->name, dev->source);
// Set the initial tool for the device
case GDK_SOURCE_PEN:
break;
case GDK_SOURCE_ERASER:
break;
case GDK_SOURCE_CURSOR:
break;
default:
; // do not add
}
// } else if (dev->name) {
// g_message("Skippn '%s' as [%s]", dev->name, dev->source);
}
}
}
}
{
case GDK_MOTION_NOTIFY:
{
}
}
break;
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
{
}
}
break;
case GDK_SCROLL:
{
}
}
break;
case GDK_PROXIMITY_IN:
case GDK_PROXIMITY_OUT:
{
}
}
break;
default:
;
}
// The device switched. See if it is one we 'count'
//g_message("Changed device %s -> %s", lastName.c_str(), name.c_str());
// Save the tool currently selected for next time the input
// device shows up.
}
}
}
}
}
/*
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 :