From 49a274f32919fa63e96bb66e76b691afafda66ff Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Thu, 16 Jul 2009 14:55:16 +0000 Subject: Implement guide behaviour as discussed on the mailing list (bzr r8293) --- src/desktop-events.cpp | 169 +++++++++++++++++++++++++++++++------------------ 1 file changed, 108 insertions(+), 61 deletions(-) (limited to 'src/desktop-events.cpp') diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index cc2d49330..d8fb9d8d5 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -66,7 +66,6 @@ int sp_desktop_root_handler(SPCanvasItem */*item*/, GdkEvent *event, SPDesktop * return sp_event_context_root_handler(desktop->event_context, event); } - static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dtw, bool horiz) { static bool dragging = false; @@ -89,17 +88,20 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge if (event->button.button == 1) { dragging = true; - // FIXME: The snap delay mechanism won't work here, because it has been implemented for the event context. Dragging - // guides off the ruler will send event to the ruler and not to the context, which bypasses sp_event_context_snap_delay_handler - // The snap manager will not notice the difference, so it'll check if the snap delay has been activated (This check - // is only needed for catching coding errors, i.e. to warn if the snap window has not been implemented properly - // in some context) + // FIXME: The snap delay mechanism won't work here, because it has been implemented + // for the event context. Dragging guides off the ruler will send event to the ruler + // and not to the context, which bypasses sp_event_context_snap_delay_handler + // The snap manager will not notice the difference, so it'll check if the snap delay + // has been activated (This check is only needed for catching coding errors, i.e. + // to warn if the snap window has not been implemented properly in some context) if (desktop->event_context->_snap_window_open == false) { - // A dt_ruler_event might be emitted when dragging a guide off the rulers while drawing a Bezier curve - // In such a situation, we're already in that specific context and the snap delay is already active. We should - // not set the snap delay to active again, because that will trigger a similar warning to the one above - sp_event_context_snap_window_open(desktop->event_context); - snap_window_temporarily_open = true; + // A dt_ruler_event might be emitted when dragging a guide off the rulers + // while drawing a Bezier curve. In such a situation, we're already in that + // specific context and the snap delay is already active. We should not set + // the snap delay to active again, because that will trigger a similar warning + // to the one above + sp_event_context_snap_window_open(desktop->event_context); + snap_window_temporarily_open = true; } Geom::Point const event_w(sp_canvas_window_to_world(dtw->canvas, event_win)); @@ -159,8 +161,9 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop); - // We only have a temporary guide which is not stored in our document yet. Because the guide snapper only looks - // in the document for guides to snap to, we don't have to worry about a guide snapping to itself here + // We only have a temporary guide which is not stored in our document yet. + // Because the guide snapper only looks in the document for guides to snap to, + // we don't have to worry about a guide snapping to itself here m.guideFreeSnap(event_dt, normal); sp_guideline_set_position(SP_GUIDELINE(guide), from_2geom(event_dt)); @@ -176,8 +179,9 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop); - // We only have a temporary guide which is not stored in our document yet. Because the guide snapper only looks - // in the document for guides to snap to, we don't have to worry about a guide snapping to itself here + // We only have a temporary guide which is not stored in our document yet. + // Because the guide snapper only looks in the document for guides to snap to, + // we don't have to worry about a guide snapping to itself here m.guideFreeSnap(event_dt, normal); dragging = false; @@ -202,11 +206,13 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge } desktop->set_coordinate_status(from_2geom(event_dt)); - // A dt_ruler_event might be emitted when dragging a guide of the rulers while drawing a Bezier curve - // In such a situation, we're already in that specific context and the snap delay is already active. We should - // interfere with that context and we should therefore leave the snap delay status as it is. So although it might - // have been set to active above on GDK_BUTTON_PRESS, we should not set it back to inactive here. That must be - // done by the context + // A dt_ruler_event might be emitted when dragging a guide of the rulers + // while drawing a Bezier curve. In such a situation, we're already in that + // specific context and the snap delay is already active. We should interfere + // with that context and we should therefore leave the snap delay status + // as it is. So although it might have been set to active above on + // GDK_BUTTON_PRESS, we should not set it back to inactive here. That must be + // done by the context. } default: break; @@ -236,6 +242,8 @@ enum SPGuideDragType { static Geom::Point drag_origin; static SPGuideDragType drag_type = SP_DRAG_NONE; +//static bool reset_drag_origin = false; // when Ctrl is pressed while dragging, this is used to trigger resetting of the +// // drag origin to that location so that constrained movement is more intuitive // Min distance from anchor to initiate rotation, measured in screenpixels #define tol 40.0 @@ -260,14 +268,6 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) break; case GDK_BUTTON_PRESS: if (event->button.button == 1) { - if (event->button.state & GDK_CONTROL_MASK && !(event->button.state & GDK_SHIFT_MASK)) { - SPDocument *doc = SP_OBJECT_DOCUMENT(guide); - sp_guide_remove(guide); - sp_document_done(doc, SP_VERB_NONE, _("Delete guide")); - ret = TRUE; - break; - } - sp_event_context_snap_window_open(desktop->event_context); Geom::Point const event_w(event->button.x, event->button.y); Geom::Point const event_dt(desktop->w2d(event_w)); @@ -279,11 +279,18 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) // https://bugs.launchpad.net/inkscape/+bug/333762 drag_origin = Geom::projection(event_dt, Geom::Line(guide->point_on_line, guide->angle())); - if (Geom::L2(guide->point_on_line - event_dt) < tol/desktop->current_zoom()) { - // the click was on the guide 'anchor' - drag_type = (event->button.state & GDK_SHIFT_MASK) ? SP_DRAG_MOVE_ORIGIN : SP_DRAG_TRANSLATE; + if (event->button.state & GDK_SHIFT_MASK) { + // with shift we rotate the guide + drag_type = SP_DRAG_ROTATE; } else { - drag_type = (event->button.state & GDK_SHIFT_MASK) ? SP_DRAG_ROTATE : SP_DRAG_TRANSLATE; + if (event->button.state & GDK_CONTROL_MASK) { + drag_type = SP_DRAG_MOVE_ORIGIN; + } else { + drag_type = SP_DRAG_TRANSLATE; + } + } + + if (drag_type == SP_DRAG_ROTATE || drag_type == SP_DRAG_TRANSLATE) { sp_canvas_item_grab(item, ( GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | @@ -305,21 +312,23 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop, true, NULL, NULL, guide); if (drag_type == SP_DRAG_MOVE_ORIGIN) { - // If we snap in guideConstrainedSnap() below, then motion_dt will be forced to be on the guide - // If we don't snap however, then it the origin should still be constrained to the guide - // So let's do that explicitly first: - Geom::Line line(guide->point_on_line, guide->angle()); - Geom::Coord t = line.nearestPoint(motion_dt); - motion_dt = line.pointAt(t); - m.guideConstrainedSnap(motion_dt, *guide); + // If we snap in guideConstrainedSnap() below, then motion_dt will + // be forced to be on the guide. If we don't snap however, then + // the origin should still be constrained to the guide. So let's do + // that explicitly first: + + Geom::Line line(guide->point_on_line, guide->angle()); + Geom::Coord t = line.nearestPoint(motion_dt); + motion_dt = line.pointAt(t); + m.guideConstrainedSnap(motion_dt, *guide); } else { - m.guideFreeSnap(motion_dt, guide->normal_to_line); + m.guideFreeSnap(motion_dt, guide->normal_to_line); } switch (drag_type) { case SP_DRAG_TRANSLATE: { - sp_guide_moveto(*guide, guide->point_on_line + motion_dt - drag_origin, false); + sp_guide_moveto(*guide, motion_dt, false); break; } case SP_DRAG_TRANSLATE_CONSTRAINED: // Is not being used currently! @@ -330,7 +339,8 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) } case SP_DRAG_ROTATE: { - double angle = angle_between(drag_origin - guide->point_on_line, motion_dt - guide->point_on_line); + Geom::Point pt = motion_dt - guide->point_on_line; + double angle = std::atan2(pt[Geom::Y], pt[Geom::X]); if (event->motion.state & GDK_CONTROL_MASK) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); unsigned const snaps = abs(prefs->getInt("/options/rotationsnapsperpi/value", 12)); @@ -339,7 +349,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) angle = (M_PI / snaps) * sections; } } - sp_guide_set_normal(*guide, guide->normal_to_line * Geom::Rotate(angle), false); + sp_guide_set_normal(*guide, Geom::Point(1,0) * Geom::Rotate(angle + M_PI_2), false); break; } case SP_DRAG_MOVE_ORIGIN: @@ -368,22 +378,23 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop, true, NULL, NULL, guide); if (drag_type == SP_DRAG_MOVE_ORIGIN) { - // If we snap in guideConstrainedSnap() below, then motion_dt will be forced to be on the guide - // If we don't snap however, then it the origin should still be constrained to the guide - // So let's do that explicitly first: + // If we snap in guideConstrainedSnap() below, then motion_dt will + // be forced to be on the guide. If we don't snap however, then + // the origin should still be constrained to the guide. So let's + // do that explicitly first: Geom::Line line(guide->point_on_line, guide->angle()); - Geom::Coord t = line.nearestPoint(event_dt); - event_dt = line.pointAt(t); + Geom::Coord t = line.nearestPoint(event_dt); + event_dt = line.pointAt(t); m.guideConstrainedSnap(event_dt, *guide); - } else { - m.guideFreeSnap(event_dt, guide->normal_to_line); - } + } else { + m.guideFreeSnap(event_dt, guide->normal_to_line); + } if (sp_canvas_world_pt_inside_window(item->canvas, event_w)) { switch (drag_type) { case SP_DRAG_TRANSLATE: { - sp_guide_moveto(*guide, guide->point_on_line + event_dt - drag_origin, true); + sp_guide_moveto(*guide, event_dt, true); break; } case SP_DRAG_TRANSLATE_CONSTRAINED: // Is not being used currently! @@ -394,7 +405,8 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) } case SP_DRAG_ROTATE: { - double angle = angle_between(drag_origin - guide->point_on_line, event_dt - guide->point_on_line); + Geom::Point pt = event_dt - guide->point_on_line; + double angle = std::atan2(pt[Geom::Y], pt[Geom::X]); if (event->motion.state & GDK_CONTROL_MASK) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); unsigned const snaps = abs(prefs->getInt("/options/rotationsnapsperpi/value", 12)); @@ -403,7 +415,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) angle = (M_PI / snaps) * sections; } } - sp_guide_set_normal(*guide, guide->normal_to_line * Geom::Rotate(angle), true); + sp_guide_set_normal(*guide, Geom::Point(1,0) * Geom::Rotate(angle + M_PI_2), true); break; } case SP_DRAG_MOVE_ORIGIN: @@ -442,14 +454,12 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) Geom::Point const event_w(event->crossing.x, event->crossing.y); Geom::Point const event_dt(desktop->w2d(event_w)); - GdkCursor *guide_cursor; - if (Geom::L2(guide->point_on_line - event_dt) < tol/desktop->current_zoom() || !(event->crossing.state & GDK_SHIFT_MASK)) { - // the click was on the guide 'anchor' - guide_cursor = gdk_cursor_new (GDK_FLEUR); - } else { + if (event->crossing.state & GDK_SHIFT_MASK) { + GdkCursor *guide_cursor; guide_cursor = gdk_cursor_new (GDK_EXCHANGE); + gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, guide_cursor); + gdk_cursor_unref(guide_cursor); } - gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, guide_cursor); char *guide_description = sp_guide_description(guide); desktop->guidesMessageContext()->setF(Inkscape::NORMAL_MESSAGE, _("Guideline: %s"), guide_description); @@ -464,8 +474,45 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) desktop->guidesMessageContext()->clear(); break; - default: + case GDK_KEY_PRESS: + switch (get_group0_keyval (&event->key)) { + case GDK_Delete: + case GDK_KP_Delete: + case GDK_BackSpace: + { + SPDocument *doc = SP_OBJECT_DOCUMENT(guide); + sp_guide_remove(guide); + sp_document_done(doc, SP_VERB_NONE, _("Delete guide")); + ret = TRUE; + break; + } + case GDK_Shift_L: + case GDK_Shift_R: + GdkCursor *guide_cursor; + guide_cursor = gdk_cursor_new (GDK_EXCHANGE); + gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, guide_cursor); + gdk_cursor_unref(guide_cursor); + ret = TRUE; + default: + // do nothing; + break; + } break; + case GDK_KEY_RELEASE: + switch (get_group0_keyval (&event->key)) { + case GDK_Shift_L: + case GDK_Shift_R: + GdkCursor *guide_cursor; + guide_cursor = gdk_cursor_new (GDK_EXCHANGE); + gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, guide_cursor); + gdk_cursor_unref(guide_cursor); + break; + default: + // do nothing; + break; + } + default: + break; } return ret; -- cgit v1.2.3 From eae8322c8b968bbf076323eb68707124bfc810d9 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 18 Jul 2009 12:56:25 +0000 Subject: Make the snap delay mechanism easier to implement for the devs, and get rid of the related warning messages (bzr r8302) --- src/desktop-events.cpp | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'src/desktop-events.cpp') diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index d8fb9d8d5..1fae9367c 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -71,7 +71,6 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge static bool dragging = false; static SPCanvasItem *guide = NULL; static Geom::Point normal; - static bool snap_window_temporarily_open = false; int wx, wy; SPDesktop *desktop = dtw->desktop; @@ -88,21 +87,8 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge if (event->button.button == 1) { dragging = true; - // FIXME: The snap delay mechanism won't work here, because it has been implemented - // for the event context. Dragging guides off the ruler will send event to the ruler - // and not to the context, which bypasses sp_event_context_snap_delay_handler - // The snap manager will not notice the difference, so it'll check if the snap delay - // has been activated (This check is only needed for catching coding errors, i.e. - // to warn if the snap window has not been implemented properly in some context) - if (desktop->event_context->_snap_window_open == false) { - // A dt_ruler_event might be emitted when dragging a guide off the rulers - // while drawing a Bezier curve. In such a situation, we're already in that - // specific context and the snap delay is already active. We should not set - // the snap delay to active again, because that will trigger a similar warning - // to the one above - sp_event_context_snap_window_open(desktop->event_context); - snap_window_temporarily_open = true; - } + // FIXME: The snap delay mechanism won't work here, because it has been implemented for the event context. Dragging + // guides off the ruler will send event to the ruler and not to the context, which bypasses sp_event_context_snap_delay_handler Geom::Point const event_w(sp_canvas_window_to_world(dtw->canvas, event_win)); Geom::Point const event_dt(desktop->w2d(event_w)); @@ -186,11 +172,7 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge dragging = false; - // See the comments in GDK_BUTTON_PRESS - if (snap_window_temporarily_open) { - sp_event_context_snap_window_closed(desktop->event_context); - snap_window_temporarily_open = false; - } + sp_event_context_discard_delayed_snap_event(desktop->event_context); gtk_object_destroy(GTK_OBJECT(guide)); guide = NULL; @@ -209,7 +191,7 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge // A dt_ruler_event might be emitted when dragging a guide of the rulers // while drawing a Bezier curve. In such a situation, we're already in that // specific context and the snap delay is already active. We should interfere - // with that context and we should therefore leave the snap delay status + // with that context and we should therefore leave the snap delay status // as it is. So although it might have been set to active above on // GDK_BUTTON_PRESS, we should not set it back to inactive here. That must be // done by the context. @@ -246,7 +228,7 @@ static SPGuideDragType drag_type = SP_DRAG_NONE; // // drag origin to that location so that constrained movement is more intuitive // Min distance from anchor to initiate rotation, measured in screenpixels -#define tol 40.0 +#define tol 40.0 gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) { @@ -260,7 +242,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) case GDK_2BUTTON_PRESS: if (event->button.button == 1) { drag_type = SP_DRAG_NONE; - sp_event_context_snap_window_closed(desktop->event_context); + sp_event_context_discard_delayed_snap_event(desktop->event_context); sp_canvas_item_ungrab(item, event->button.time); Inkscape::UI::Dialogs::GuidelinePropertiesDialog::showDialog(guide, desktop); ret = TRUE; @@ -268,7 +250,6 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) break; case GDK_BUTTON_PRESS: if (event->button.button == 1) { - sp_event_context_snap_window_open(desktop->event_context); Geom::Point const event_w(event->button.x, event->button.y); Geom::Point const event_dt(desktop->w2d(event_w)); @@ -442,7 +423,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) desktop->setPosition (from_2geom(event_dt)); } drag_type = SP_DRAG_NONE; - sp_event_context_snap_window_closed(desktop->event_context); + sp_event_context_discard_delayed_snap_event(desktop->event_context); sp_canvas_item_ungrab(item, event->button.time); ret=TRUE; } -- cgit v1.2.3 From 211ec1ef762f2c2447fe8b5fc5c6ab8459a57558 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 2 Aug 2009 09:55:12 +0000 Subject: Snap guides to grids (fixes bug #170741) (bzr r8381) --- src/desktop-events.cpp | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'src/desktop-events.cpp') diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index 1fae9367c..cea478f85 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -150,7 +150,7 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge // We only have a temporary guide which is not stored in our document yet. // Because the guide snapper only looks in the document for guides to snap to, // we don't have to worry about a guide snapping to itself here - m.guideFreeSnap(event_dt, normal); + m.guideFreeSnap(event_dt, normal, SP_DRAG_MOVE_ORIGIN); sp_guideline_set_position(SP_GUIDELINE(guide), from_2geom(event_dt)); desktop->set_coordinate_status(to_2geom(event_dt)); @@ -168,7 +168,7 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge // We only have a temporary guide which is not stored in our document yet. // Because the guide snapper only looks in the document for guides to snap to, // we don't have to worry about a guide snapping to itself here - m.guideFreeSnap(event_dt, normal); + m.guideFreeSnap(event_dt, normal, SP_DRAG_MOVE_ORIGIN); dragging = false; @@ -213,15 +213,6 @@ int sp_dt_vruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dtw) return sp_dt_ruler_event(widget, event, dtw, false); } -/* Guides */ -enum SPGuideDragType { - SP_DRAG_TRANSLATE, - SP_DRAG_TRANSLATE_CONSTRAINED, // Is not being used currently! - SP_DRAG_ROTATE, - SP_DRAG_MOVE_ORIGIN, - SP_DRAG_NONE -}; - static Geom::Point drag_origin; static SPGuideDragType drag_type = SP_DRAG_NONE; //static bool reset_drag_origin = false; // when Ctrl is pressed while dragging, this is used to trigger resetting of the @@ -303,7 +294,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) motion_dt = line.pointAt(t); m.guideConstrainedSnap(motion_dt, *guide); } else { - m.guideFreeSnap(motion_dt, guide->normal_to_line); + m.guideFreeSnap(motion_dt, guide->normal_to_line, drag_type); } switch (drag_type) { @@ -312,12 +303,6 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) sp_guide_moveto(*guide, motion_dt, false); break; } - case SP_DRAG_TRANSLATE_CONSTRAINED: // Is not being used currently! - { - Geom::Point pt_constr = Geom::constrain_angle(guide->point_on_line, motion_dt); - sp_guide_moveto(*guide, pt_constr, false); - break; - } case SP_DRAG_ROTATE: { Geom::Point pt = motion_dt - guide->point_on_line; @@ -368,7 +353,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) event_dt = line.pointAt(t); m.guideConstrainedSnap(event_dt, *guide); } else { - m.guideFreeSnap(event_dt, guide->normal_to_line); + m.guideFreeSnap(event_dt, guide->normal_to_line, drag_type); } if (sp_canvas_world_pt_inside_window(item->canvas, event_w)) { @@ -378,12 +363,6 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) sp_guide_moveto(*guide, event_dt, true); break; } - case SP_DRAG_TRANSLATE_CONSTRAINED: // Is not being used currently! - { - Geom::Point pt_constr = Geom::constrain_angle(guide->point_on_line, event_dt); - sp_guide_moveto(*guide, pt_constr, true); - break; - } case SP_DRAG_ROTATE: { Geom::Point pt = event_dt - guide->point_on_line; -- cgit v1.2.3 From 8b04d0db6c55e36935690d37defb6f9b68945796 Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 05:40:36 +0000 Subject: SPDocument->Document (bzr r8404) --- src/desktop-events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/desktop-events.cpp') diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index cea478f85..41b7ab4da 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -440,7 +440,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) case GDK_KP_Delete: case GDK_BackSpace: { - SPDocument *doc = SP_OBJECT_DOCUMENT(guide); + Document *doc = SP_OBJECT_DOCUMENT(guide); sp_guide_remove(guide); sp_document_done(doc, SP_VERB_NONE, _("Delete guide")); ret = TRUE; -- cgit v1.2.3 From 51c2905fd3e99955db2d823b79abb763d8097028 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Thu, 6 Aug 2009 14:17:17 +0000 Subject: Revert recent refactoring changes by johnce because they break the build, which cannot be fixed easily. (bzr r8422) --- src/desktop-events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/desktop-events.cpp') diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index 41b7ab4da..cea478f85 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -440,7 +440,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) case GDK_KP_Delete: case GDK_BackSpace: { - Document *doc = SP_OBJECT_DOCUMENT(guide); + SPDocument *doc = SP_OBJECT_DOCUMENT(guide); sp_guide_remove(guide); sp_document_done(doc, SP_VERB_NONE, _("Delete guide")); ret = TRUE; -- cgit v1.2.3