desktop-events.cpp revision e9c0d7ece2701baff137563c0d02ffd89e159f53
1494N/A#define __SP_DESKTOP_EVENTS_C__
1494N/A#ifdef HAVE_CONFIG_H
1494N/A#include "display/guideline.h"
1494N/A#include "display/snap-indicator.h"
1494N/A#include "helper/unit-menu.h"
1494N/A#include "document.h"
1494N/A#include "sp-guide.h"
1494N/A#include "sp-namedview.h"
1494N/A#include "desktop-handles.h"
1494N/A#include "event-context.h"
1494N/A#include "widgets/desktop-widget.h"
1494N/A#include "sp-metrics.h"
1494N/A#include "dialogs/dialog-events.h"
1494N/A#include "message-context.h"
1494N/A#include "dialogs/guidelinedialog.h"
1494N/A#include "display/canvas-grid.h"
1494N/A#include "display/canvas-axonomgrid.h"
1494N/A#include "prefs-utils.h"
1494N/A#include "tools-switch.h"
1494N/Astatic void init_extended();
1494N/Astatic gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dtw, bool horiz)
1494N/A gdk_window_get_geometry(GTK_WIDGET(dtw->canvas)->window, NULL /*x*/, NULL /*y*/, &width, &height, NULL/*depth*/);
1494N/A case GDK_BUTTON_PRESS:
1494N/A case GDK_MOTION_NOTIFY:
case GDK_BUTTON_RELEASE:
dragging = false;
return FALSE;
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;
case GDK_BUTTON_PRESS:
dragging = true;
NULL,
case GDK_MOTION_NOTIFY:
if (dragging) {
moved = true;
case GDK_BUTTON_RELEASE:
if (moved) {
moved = false;
dragging = false;
case GDK_ENTER_NOTIFY:
desktop->guidesMessageContext()->setF(Inkscape::NORMAL_MESSAGE, _("<b>Guideline</b>: %s"), guide_description);
case GDK_LEAVE_NOTIFY:
return ret;
static void init_extended()
if ( devices ) {
case GDK_SOURCE_PEN:
case GDK_SOURCE_ERASER:
case GDK_SOURCE_CURSOR:
case GDK_MOTION_NOTIFY:
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
case GDK_SCROLL:
case GDK_PROXIMITY_IN:
case GDK_PROXIMITY_OUT: