desktop-events.cpp revision 355bd03d9ea9dbb0b19e231da8875cf914362bc2
#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 "display/guideline.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"
/* Root item handler */
{
}
{
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 */
{
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:
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;
}
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;
}
/*
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 :