desktop-events.cpp revision c0730cd203da4bff902711ee9ce32513a6691c2e
#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 "prefs-utils.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) {
} else {
}
}
break;
case GDK_BUTTON_RELEASE:
dragging = false;
_("Create guide"));
}
}
default:
break;
}
return FALSE;
}
{
}
{
}
/* Guides */
{
static bool dragging = false;
static bool moved = false;
SPDesktop *desktop = static_cast<SPDesktop*>(gtk_object_get_data(GTK_OBJECT(item->canvas), "SPDesktop"));
case GDK_2BUTTON_PRESS:
dragging = false;
}
break;
case GDK_BUTTON_PRESS:
break;
}
dragging = true;
NULL,
}
break;
case GDK_MOTION_NOTIFY:
if (dragging) {
// This is for snapping while dragging existing guidelines. New guidelines,
// which are dragged off the ruler, are being snapped in sp_dt_ruler_event
moved = true;
} else {
}
}
break;
case GDK_BUTTON_RELEASE:
if (moved) {
_("Move guide"));
} else {
/* Undo movement of any attached shapes. */
_("Delete guide"));
}
moved = false;
}
dragging = 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 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 {
// g_message("Skippn '%s' as [%s]", dev->name, namefor(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'
// 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 :