Code

Fix #338838, in which zooming and panning with the middle mouse button made Inkscape...
[inkscape.git] / src / knot.cpp
1 #define __SP_KNOT_C__
3 /** \file
4  * SPKnot implementation
5  *
6  * Authors:
7  *   Lauris Kaplinski <lauris@kaplinski.com>
8  *   bulia byak <buliabyak@users.sf.net>
9  *
10  * Copyright (C) 1999-2005 authors
11  * Copyright (C) 2001-2002 Ximian, Inc.
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 #ifdef HAVE_CONFIG_H
17 # include <config.h>
18 #endif
19 #include <gdk/gdkkeysyms.h>
20 #include <glibmm/i18n.h>
21 #include "helper/sp-marshal.h"
22 #include "display/sodipodi-ctrl.h"
23 #include "desktop.h"
24 #include "desktop-handles.h"
25 #include "knot.h"
26 #include "document.h"
27 #include "preferences.h"
28 #include "message-stack.h"
29 #include "message-context.h"
30 #include "event-context.h"
33 #define KNOT_EVENT_MASK (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | \
34                          GDK_POINTER_MOTION_MASK | \
35                          GDK_POINTER_MOTION_HINT_MASK | \
36                          GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK)
38 static bool nograb = false;
40 static bool grabbed = FALSE;
41 static bool moved = FALSE;
43 static gint xp = 0, yp = 0; // where drag started
44 static gint tolerance = 0;
45 static bool within_tolerance = false;
47 static bool transform_escaped = false; // true iff resize or rotate was cancelled by esc.
49 enum {
50     EVENT,
51     CLICKED,
52     DOUBLECLICKED,
53     GRABBED,
54     UNGRABBED,
55     MOVED,
56     REQUEST,
57     DISTANCE,
58     LAST_SIGNAL
59 };
61 static void sp_knot_class_init(SPKnotClass *klass);
62 static void sp_knot_init(SPKnot *knot);
63 static void sp_knot_dispose(GObject *object);
65 static int sp_knot_handler(SPCanvasItem *item, GdkEvent *event, SPKnot *knot);
66 static void sp_knot_set_ctrl_state(SPKnot *knot);
68 static GObjectClass *parent_class;
69 static guint knot_signals[LAST_SIGNAL] = { 0 };
71 /**
72  * Registers SPKnot class and returns its type number.
73  */
74 GType sp_knot_get_type()
75 {
76     static GType type = 0;
77     if (!type) {
78         GTypeInfo info = {
79             sizeof(SPKnotClass),
80             NULL,       /* base_init */
81             NULL,       /* base_finalize */
82             (GClassInitFunc) sp_knot_class_init,
83             NULL,       /* class_finalize */
84             NULL,       /* class_data */
85             sizeof (SPKnot),
86             16, /* n_preallocs */
87             (GInstanceInitFunc) sp_knot_init,
88             NULL
89         };
90         type = g_type_register_static (G_TYPE_OBJECT, "SPKnot", &info, (GTypeFlags) 0);
91     }
92     return type;
93 }
95 /**
96  * SPKnot vtable initialization.
97  */
98 static void sp_knot_class_init(SPKnotClass *klass)
99 {
100     GObjectClass *object_class = (GObjectClass*)klass;
102     parent_class = (GObjectClass*) g_type_class_peek_parent(klass);
104     object_class->dispose = sp_knot_dispose;
106     knot_signals[EVENT] = g_signal_new("event",
107                                        G_TYPE_FROM_CLASS(klass),
108                                        G_SIGNAL_RUN_LAST,
109                                        G_STRUCT_OFFSET(SPKnotClass, event),
110                                        NULL, NULL,
111                                        sp_marshal_BOOLEAN__POINTER,
112                                        G_TYPE_BOOLEAN, 1,
113                                        GDK_TYPE_EVENT);
115     knot_signals[CLICKED] = g_signal_new("clicked",
116                                          G_TYPE_FROM_CLASS(klass),
117                                          G_SIGNAL_RUN_FIRST,
118                                          G_STRUCT_OFFSET(SPKnotClass, clicked),
119                                          NULL, NULL,
120                                          sp_marshal_NONE__UINT,
121                                          G_TYPE_NONE, 1,
122                                          G_TYPE_UINT);
124     knot_signals[DOUBLECLICKED] = g_signal_new("doubleclicked",
125                                                G_TYPE_FROM_CLASS(klass),
126                                                G_SIGNAL_RUN_FIRST,
127                                                G_STRUCT_OFFSET(SPKnotClass, doubleclicked),
128                                                NULL, NULL,
129                                                sp_marshal_NONE__UINT,
130                                                G_TYPE_NONE, 1,
131                                                G_TYPE_UINT);
133     knot_signals[GRABBED] = g_signal_new("grabbed",
134                                           G_TYPE_FROM_CLASS(klass),
135                                           G_SIGNAL_RUN_FIRST,
136                                           G_STRUCT_OFFSET(SPKnotClass, grabbed),
137                                           NULL, NULL,
138                                           sp_marshal_NONE__UINT,
139                                           G_TYPE_NONE, 1,
140                                           G_TYPE_UINT);
142     knot_signals[UNGRABBED] = g_signal_new("ungrabbed",
143                                             G_TYPE_FROM_CLASS(klass),
144                                             G_SIGNAL_RUN_FIRST,
145                                             G_STRUCT_OFFSET(SPKnotClass, ungrabbed),
146                                             NULL, NULL,
147                                             sp_marshal_NONE__UINT,
148                                             G_TYPE_NONE, 1,
149                                             G_TYPE_UINT);
151     knot_signals[MOVED] = g_signal_new("moved",
152                                         G_TYPE_FROM_CLASS(klass),
153                                         G_SIGNAL_RUN_FIRST,
154                                         G_STRUCT_OFFSET(SPKnotClass, moved),
155                                         NULL, NULL,
156                                         sp_marshal_NONE__POINTER_UINT,
157                                         G_TYPE_NONE, 2,
158                                         G_TYPE_POINTER, G_TYPE_UINT);
160     knot_signals[REQUEST] = g_signal_new("request",
161                                          G_TYPE_FROM_CLASS(klass),
162                                          G_SIGNAL_RUN_LAST,
163                                          G_STRUCT_OFFSET(SPKnotClass, request),
164                                          NULL, NULL,
165                                          sp_marshal_BOOLEAN__POINTER_UINT,
166                                          G_TYPE_BOOLEAN, 2,
167                                          G_TYPE_POINTER, G_TYPE_UINT);
169     knot_signals[DISTANCE] = g_signal_new("distance",
170                                            G_TYPE_FROM_CLASS(klass),
171                                            G_SIGNAL_RUN_LAST,
172                                            G_STRUCT_OFFSET(SPKnotClass, distance),
173                                            NULL, NULL,
174                                            sp_marshal_DOUBLE__POINTER_UINT,
175                                            G_TYPE_DOUBLE, 2,
176                                            G_TYPE_POINTER, G_TYPE_UINT);
178     const gchar *nograbenv = getenv("INKSCAPE_NO_GRAB");
179     nograb = (nograbenv && *nograbenv && (*nograbenv != '0'));
182 /**
183  * Callback for SPKnot initialization.
184  */
185 static void sp_knot_init(SPKnot *knot)
187     knot->desktop = NULL;
188     knot->item = NULL;
189     knot->flags = 0;
191     knot->size = 8;
192     knot->pos = Geom::Point(0, 0);
193     knot->grabbed_rel_pos = Geom::Point(0, 0);
194     knot->anchor = GTK_ANCHOR_CENTER;
195     knot->shape = SP_KNOT_SHAPE_SQUARE;
196     knot->mode = SP_KNOT_MODE_XOR;
197     knot->tip = NULL;
198     knot->_event_handler_id = 0;
199     knot->pressure = 0;
201     knot->fill[SP_KNOT_STATE_NORMAL] = 0xffffff00;
202     knot->fill[SP_KNOT_STATE_MOUSEOVER] = 0xff0000ff;
203     knot->fill[SP_KNOT_STATE_DRAGGING] = 0x0000ffff;
205     knot->stroke[SP_KNOT_STATE_NORMAL] = 0x01000000;
206     knot->stroke[SP_KNOT_STATE_MOUSEOVER] = 0x01000000;
207     knot->stroke[SP_KNOT_STATE_DRAGGING] = 0x01000000;
209     knot->image[SP_KNOT_STATE_NORMAL] = NULL;
210     knot->image[SP_KNOT_STATE_MOUSEOVER] = NULL;
211     knot->image[SP_KNOT_STATE_DRAGGING] = NULL;
213     knot->cursor[SP_KNOT_STATE_NORMAL] = NULL;
214     knot->cursor[SP_KNOT_STATE_MOUSEOVER] = NULL;
215     knot->cursor[SP_KNOT_STATE_DRAGGING] = NULL;
217     knot->saved_cursor = NULL;
218     knot->pixbuf = NULL;
221 /**
222  * Called before SPKnot destruction.
223  */
224 static void sp_knot_dispose(GObject *object)
226     SPKnot *knot = (SPKnot *) object;
228     if ((knot->flags & SP_KNOT_GRABBED) && gdk_pointer_is_grabbed ()) {
229         // This happens e.g. when deleting a node in node tool while dragging it
230         gdk_pointer_ungrab (GDK_CURRENT_TIME);
231     }
233     if (knot->_event_handler_id > 0)
234         {
235         g_signal_handler_disconnect(G_OBJECT (knot->item), knot->_event_handler_id);
236         knot->_event_handler_id = 0;
237         }
239     if (knot->item) {
240         gtk_object_destroy (GTK_OBJECT (knot->item));
241         knot->item = NULL;
242     }
244     for (gint i = 0; i < SP_KNOT_VISIBLE_STATES; i++) {
245         if (knot->cursor[i]) {
246             gdk_cursor_unref(knot->cursor[i]);
247             knot->cursor[i] = NULL;
248         }
249     }
251     if (knot->tip) {
252         g_free(knot->tip);
253         knot->tip = NULL;
254     }
256     if (parent_class->dispose) {
257         (*parent_class->dispose) (object);
258     }
261 /**
262  * Update knot for dragging and tell canvas an item was grabbed.
263  */
264 void sp_knot_start_dragging(SPKnot *knot, Geom::Point const &p, gint x, gint y, guint32 etime)
266     // save drag origin
267     xp = x;
268     yp = y;
269     within_tolerance = true;
271     knot->grabbed_rel_pos = p - knot->pos;
272     knot->drag_origin = knot->pos;
273     if (!nograb) {
274         sp_canvas_item_grab(knot->item,
275                             KNOT_EVENT_MASK,
276                             knot->cursor[SP_KNOT_STATE_DRAGGING],
277                             etime);
278     }
279     sp_knot_set_flag(knot, SP_KNOT_GRABBED, TRUE);
280     grabbed = TRUE;
283 /**
284  * Called to handle events on knots.
285  */
286 static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot)
288         static bool snap_delay_temporarily_active = false;
290         g_assert(knot != NULL);
291     g_assert(SP_IS_KNOT(knot));
293     /* Run client universal event handler, if present */
295     gboolean consumed = FALSE;
297     g_signal_emit(knot, knot_signals[EVENT], 0, event, &consumed);
299     if (consumed) {
300         return TRUE;
301     }
303     g_object_ref(knot);
304     Inkscape::Preferences *prefs = Inkscape::Preferences::get();
305     tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
307     switch (event->type) {
308         case GDK_2BUTTON_PRESS:
309             if (event->button.button == 1) {
310                 g_signal_emit(knot, knot_signals[DOUBLECLICKED], 0, event->button.state);
312                 grabbed = FALSE;
313                 moved = FALSE;
314                 consumed = TRUE;
315             }
316             break;
317         case GDK_BUTTON_PRESS:
318             if (event->button.button == 1 && !knot->desktop->event_context->space_panning) {
319                 Geom::Point const p = knot->desktop->w2d(Geom::Point(event->button.x, event->button.y));
320                 sp_knot_start_dragging(knot, p, (gint) event->button.x, (gint) event->button.y, event->button.time);
321                 if (knot->desktop->canvas->context_snap_delay_active == false) {
322                                         sp_canvas_set_snap_delay_active(knot->desktop->canvas, true);
323                                         snap_delay_temporarily_active = true;
324                                 }
325                 consumed = TRUE;
326             }
327             break;
328         case GDK_BUTTON_RELEASE:
329             if (event->button.button == 1 && !knot->desktop->event_context->space_panning) {
330                 knot->pressure = 0;
331                 if (transform_escaped) {
332                     transform_escaped = false;
333                     consumed = TRUE;
334                 } else {
335                     sp_knot_set_flag(knot, SP_KNOT_GRABBED, FALSE);
336                     if (!nograb) {
337                         sp_canvas_item_ungrab(knot->item, event->button.time);
338                     }
339                     if (moved) {
340                         sp_knot_set_flag(knot,
341                                          SP_KNOT_DRAGGING,
342                                          FALSE);
343                         g_signal_emit(knot,
344                                       knot_signals[UNGRABBED], 0,
345                                       event->button.state);
346                         knot->_ungrabbed_signal.emit(knot);
347                     } else {
348                         g_signal_emit(knot,
349                                       knot_signals[CLICKED], 0,
350                                       event->button.state);
351                         knot->_click_signal.emit(knot, event->button.state);
352                     }
353                     grabbed = FALSE;
354                     moved = FALSE;
355                     consumed = TRUE;
357                     if (snap_delay_temporarily_active) {
358                         if (knot->desktop->canvas->context_snap_delay_active == true) {
359                                 sp_canvas_set_snap_delay_active(knot->desktop->canvas, false);
360                         }
361                                                 snap_delay_temporarily_active = false;
362                                         }
363                 }
364             }
365             break;
366         case GDK_MOTION_NOTIFY:
367             if (grabbed && !knot->desktop->event_context->space_panning) {
368                 consumed = TRUE;
370                 if ( within_tolerance
371                      && ( abs( (gint) event->motion.x - xp ) < tolerance )
372                      && ( abs( (gint) event->motion.y - yp ) < tolerance ) ) {
373                     break; // do not drag if we're within tolerance from origin
374                 }
376                 // Once the user has moved farther than tolerance from the original location
377                 // (indicating they intend to move the object, not click), then always process the
378                 // motion notify coordinates as given (no snapping back to origin)
379                 within_tolerance = false;
381                 if (gdk_event_get_axis (event, GDK_AXIS_PRESSURE, &knot->pressure))
382                     knot->pressure = CLAMP (knot->pressure, 0, 1);
383                 else
384                     knot->pressure = 0.5;
386                 if (!moved) {
387                     g_signal_emit(knot,
388                                   knot_signals[GRABBED], 0,
389                                   event->motion.state);
390                     sp_knot_set_flag(knot,
391                                      SP_KNOT_DRAGGING,
392                                      TRUE);
393                 }
394                 Geom::Point const motion_w(event->motion.x, event->motion.y);
395                 Geom::Point const motion_dt = knot->desktop->w2d(motion_w);
396                 Geom::Point p = motion_dt - knot->grabbed_rel_pos;
397                 sp_knot_request_position (knot, p, event->motion.state);
398                 knot->desktop->scroll_to_point (motion_dt);
399                 knot->desktop->set_coordinate_status(knot->pos); // display the coordinate of knot, not cursor - they may be different!
400                 if (event->motion.state & GDK_BUTTON1_MASK)
401                     gobble_motion_events(GDK_BUTTON1_MASK);
402                 moved = TRUE;
403             }
404             break;
405         case GDK_ENTER_NOTIFY:
406             sp_knot_set_flag(knot, SP_KNOT_MOUSEOVER, TRUE);
407             sp_knot_set_flag(knot, SP_KNOT_GRABBED, FALSE);
409             if (knot->tip) {
410                 knot->desktop->event_context->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, knot->tip);
411             }
413             grabbed = FALSE;
414             moved = FALSE;
415             consumed = TRUE;
416             break;
417         case GDK_LEAVE_NOTIFY:
418             sp_knot_set_flag(knot, SP_KNOT_MOUSEOVER, FALSE);
419             sp_knot_set_flag(knot, SP_KNOT_GRABBED, FALSE);
421             if (knot->tip) {
422                 knot->desktop->event_context->defaultMessageContext()->clear();
423             }
425             grabbed = FALSE;
426             moved = FALSE;
427             consumed = TRUE;
428             break;
429         case GDK_KEY_PRESS: // keybindings for knot
430             switch (get_group0_keyval(&event->key)) {
431                 case GDK_Escape:
432                     sp_knot_set_flag(knot, SP_KNOT_GRABBED, FALSE);
433                     if (!nograb) {
434                         sp_canvas_item_ungrab(knot->item, event->button.time);
435                     }
436                     if (moved) {
437                         sp_knot_set_flag(knot,
438                                          SP_KNOT_DRAGGING,
439                                          FALSE);
440                         g_signal_emit(knot,
441                                       knot_signals[UNGRABBED], 0,
442                                       event->button.state);
443                         sp_document_undo(sp_desktop_document(knot->desktop));
444                         knot->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Node or handle drag canceled."));
445                         transform_escaped = true;
446                         consumed = TRUE;
447                     }
448                     grabbed = FALSE;
449                     moved = FALSE;
450                     if (snap_delay_temporarily_active) {
451                                                 sp_canvas_set_snap_delay_active(knot->desktop->canvas, false);
452                                                 snap_delay_temporarily_active = false;
453                                         }
454                     break;
455                 default:
456                     consumed = FALSE;
457                     break;
458             }
459             break;
460         default:
461             break;
462     }
464     g_object_unref(knot);
466     return consumed;
469 /**
470  * Return new knot object.
471  */
472 SPKnot *sp_knot_new(SPDesktop *desktop, const gchar *tip)
474     g_return_val_if_fail(desktop != NULL, NULL);
476     SPKnot * knot = (SPKnot*) g_object_new(SP_TYPE_KNOT, 0);
478     knot->desktop = desktop;
479     knot->flags = SP_KNOT_VISIBLE;
480     if (tip) {
481         knot->tip = g_strdup (tip);
482     }
484     knot->item = sp_canvas_item_new(sp_desktop_controls (desktop),
485                                     SP_TYPE_CTRL,
486                                     "anchor", GTK_ANCHOR_CENTER,
487                                     "size", 8.0,
488                                     "filled", TRUE,
489                                     "fill_color", 0xffffff00,
490                                     "stroked", TRUE,
491                                     "stroke_color", 0x01000000,
492                                     "mode", SP_KNOT_MODE_XOR,
493                                     NULL);
495     knot->_event_handler_id = gtk_signal_connect(GTK_OBJECT(knot->item), "event",
496                                                  GTK_SIGNAL_FUNC(sp_knot_handler), knot);
498     return knot;
501 /**
502  * Show knot on its canvas.
503  */
504 void sp_knot_show(SPKnot *knot)
506     g_return_if_fail(knot != NULL);
507     g_return_if_fail(SP_IS_KNOT (knot));
509     sp_knot_set_flag(knot, SP_KNOT_VISIBLE, TRUE);
512 /**
513  * Hide knot on its canvas.
514  */
515 void sp_knot_hide(SPKnot *knot)
517     g_return_if_fail(knot != NULL);
518     g_return_if_fail(SP_IS_KNOT(knot));
520     sp_knot_set_flag(knot, SP_KNOT_VISIBLE, FALSE);
523 /**
524  * Request or set new position for knot.
525  */
526 void sp_knot_request_position(SPKnot *knot, Geom::Point const &p, guint state)
528     g_return_if_fail(knot != NULL);
529     g_return_if_fail(SP_IS_KNOT(knot));
531     gboolean done = FALSE;
533     g_signal_emit(knot,
534                   knot_signals[REQUEST], 0,
535                   &p,
536                   state,
537                   &done);
539     /* If user did not complete, we simply move knot to new position */
541     if (!done) {
542         sp_knot_set_position (knot, p, state);
543     }
546 /**
547  * Return distance of point to knot's position; unused.
548  */
549 gdouble sp_knot_distance(SPKnot * knot, Geom::Point const &p, guint state)
551     g_return_val_if_fail(knot != NULL, 1e18);
552     g_return_val_if_fail(SP_IS_KNOT(knot), 1e18);
554     gdouble distance = Geom::L2(p - knot->pos);
556     g_signal_emit(knot,
557                   knot_signals[DISTANCE], 0,
558                   &p,
559                   state,
560                   &distance);
562     return distance;
565 /**
566  * Move knot to new position.
567  */
568 void sp_knot_set_position(SPKnot *knot, Geom::Point const &p, guint state)
570     g_return_if_fail(knot != NULL);
571     g_return_if_fail(SP_IS_KNOT (knot));
573     knot->pos = p;
575     if (knot->item) {
576         SP_CTRL(knot->item)->moveto (p);
577     }
579     g_signal_emit(knot,
580                   knot_signals[MOVED], 0,
581                   &p,
582                   state);
583     knot->_moved_signal.emit(knot, p, state);
586 /**
587  * Move knot to new position, without emitting a MOVED signal.
588  */
589 void sp_knot_moveto(SPKnot *knot, Geom::Point const &p)
591     g_return_if_fail(knot != NULL);
592     g_return_if_fail(SP_IS_KNOT(knot));
594     knot->pos = p;
596     if (knot->item) {
597         SP_CTRL(knot->item)->moveto (p);
598     }
601 /**
602  * Returns position of knot.
603  */
604 Geom::Point sp_knot_position(SPKnot const *knot)
606     g_assert(knot != NULL);
607     g_assert(SP_IS_KNOT (knot));
609     return knot->pos;
612 /**
613  * Set flag in knot, with side effects.
614  */
615 void sp_knot_set_flag(SPKnot *knot, guint flag, bool set)
617     g_assert(knot != NULL);
618     g_assert(SP_IS_KNOT(knot));
620     if (set) {
621         knot->flags |= flag;
622     } else {
623         knot->flags &= ~flag;
624     }
626     switch (flag) {
627         case SP_KNOT_VISIBLE:
628             if (set) {
629                 sp_canvas_item_show(knot->item);
630             } else {
631                 sp_canvas_item_hide(knot->item);
632             }
633             break;
634         case SP_KNOT_MOUSEOVER:
635         case SP_KNOT_DRAGGING:
636             sp_knot_set_ctrl_state(knot);
637             break;
638         case SP_KNOT_GRABBED:
639             break;
640         default:
641             g_assert_not_reached();
642             break;
643     }
646 /**
647  * Update knot's pixbuf and set its control state.
648  */
649 void sp_knot_update_ctrl(SPKnot *knot)
651     if (!knot->item) {
652         return;
653     }
655     gtk_object_set(GTK_OBJECT(knot->item), "shape", knot->shape, NULL);
656     gtk_object_set(GTK_OBJECT(knot->item), "mode", knot->mode, NULL);
657     gtk_object_set(GTK_OBJECT(knot->item), "size", (gdouble) knot->size, NULL);
658     gtk_object_set(GTK_OBJECT(knot->item), "anchor", knot->anchor, NULL);
659     if (knot->pixbuf) {
660         gtk_object_set(GTK_OBJECT (knot->item), "pixbuf", knot->pixbuf, NULL);
661     }
663     sp_knot_set_ctrl_state(knot);
666 /**
667  * Set knot control state (dragging/mouseover/normal).
668  */
669 static void sp_knot_set_ctrl_state(SPKnot *knot)
671     if (knot->flags & SP_KNOT_DRAGGING) {
672         gtk_object_set(GTK_OBJECT (knot->item),
673                        "fill_color",
674                        knot->fill[SP_KNOT_STATE_DRAGGING],
675                        NULL);
676         gtk_object_set(GTK_OBJECT (knot->item),
677                        "stroke_color",
678                        knot->stroke[SP_KNOT_STATE_DRAGGING],
679                        NULL);
680     } else if (knot->flags & SP_KNOT_MOUSEOVER) {
681         gtk_object_set(GTK_OBJECT(knot->item),
682                        "fill_color",
683                        knot->fill[SP_KNOT_STATE_MOUSEOVER],
684                        NULL);
685         gtk_object_set(GTK_OBJECT(knot->item),
686                        "stroke_color",
687                        knot->stroke[SP_KNOT_STATE_MOUSEOVER],
688                        NULL);
689     } else {
690         gtk_object_set(GTK_OBJECT(knot->item),
691                        "fill_color",
692                         knot->fill[SP_KNOT_STATE_NORMAL],
693                        NULL);
694         gtk_object_set(GTK_OBJECT(knot->item),
695                        "stroke_color",
696                        knot->stroke[SP_KNOT_STATE_NORMAL],
697                        NULL);
698     }
703 /*
704   Local Variables:
705   mode:c++
706   c-file-style:"stroustrup"
707   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
708   indent-tabs-mode:nil
709   fill-column:99
710   End:
711 */
712 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :