Code

remove many needless references to n-art-bpath.h
[inkscape.git] / src / pencil-context.cpp
1 /** \file
2  * Pencil event context implementation.
3  */
5 /*
6  * Authors:
7  *   Lauris Kaplinski <lauris@kaplinski.com>
8  *   bulia byak <buliabyak@users.sf.net>
9  *
10  * Copyright (C) 2000 Lauris Kaplinski
11  * Copyright (C) 2000-2001 Ximian, Inc.
12  * Copyright (C) 2002 Lauris Kaplinski
13  * Copyright (C) 2004 Monash University
14  *
15  * Released under GNU GPL, read the file 'COPYING' for more information
16  */
18 #include <gdk/gdkkeysyms.h>
20 #include "pencil-context.h"
21 #include "desktop.h"
22 #include "desktop-handles.h"
23 #include "selection.h"
24 #include "selection-chemistry.h"
25 #include "draw-anchor.h"
26 #include "message-stack.h"
27 #include "message-context.h"
28 #include "modifier-fns.h"
29 #include "sp-path.h"
30 #include "prefs-utils.h"
31 #include "snap.h"
32 #include "pixmaps/cursor-pencil.xpm"
33 #include "display/bezier-utils.h"
34 #include "display/canvas-bpath.h"
35 #include <glibmm/i18n.h>
36 #include "libnr/in-svg-plane.h"
37 #include "context-fns.h"
38 #include "sp-namedview.h"
39 #include "xml/repr.h"
40 #include "document.h"
41 #include "desktop-style.h"
42 #include "macros.h"
43 #include "display/curve.h"
45 static void sp_pencil_context_class_init(SPPencilContextClass *klass);
46 static void sp_pencil_context_init(SPPencilContext *pc);
47 static void sp_pencil_context_setup(SPEventContext *ec);
48 static void sp_pencil_context_dispose(GObject *object);
50 static gint sp_pencil_context_root_handler(SPEventContext *event_context, GdkEvent *event);
51 static gint pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &bevent);
52 static gint pencil_handle_motion_notify(SPPencilContext *const pc, GdkEventMotion const &mevent);
53 static gint pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &revent);
54 static gint pencil_handle_key_press(SPPencilContext *const pc, guint const keyval, guint const state);
56 static void spdc_set_startpoint(SPPencilContext *pc, NR::Point const p);
57 static void spdc_set_endpoint(SPPencilContext *pc, NR::Point const p);
58 static void spdc_finish_endpoint(SPPencilContext *pc);
59 static void spdc_add_freehand_point(SPPencilContext *pc, NR::Point p, guint state);
60 static void fit_and_split(SPPencilContext *pc);
63 static SPDrawContextClass *pencil_parent_class;
64 static NR::Point pencil_drag_origin_w(0, 0);
65 static bool pencil_within_tolerance = false;
67 /**
68  * Register SPPencilContext class with Gdk and return its type number.
69  */
70 GType
71 sp_pencil_context_get_type()
72 {
73     static GType type = 0;
74     if (!type) {
75         GTypeInfo info = {
76             sizeof(SPPencilContextClass),
77             NULL, NULL,
78             (GClassInitFunc) sp_pencil_context_class_init,
79             NULL, NULL,
80             sizeof(SPPencilContext),
81             4,
82             (GInstanceInitFunc) sp_pencil_context_init,
83             NULL,   /* value_table */
84         };
85         type = g_type_register_static(SP_TYPE_DRAW_CONTEXT, "SPPencilContext", &info, (GTypeFlags)0);
86     }
87     return type;
88 }
90 /**
91  * Initialize SPPencilContext vtable.
92  */
93 static void
94 sp_pencil_context_class_init(SPPencilContextClass *klass)
95 {
96     GObjectClass *object_class;
97     SPEventContextClass *event_context_class;
99     object_class = (GObjectClass *) klass;
100     event_context_class = (SPEventContextClass *) klass;
102     pencil_parent_class = (SPDrawContextClass*)g_type_class_peek_parent(klass);
104     object_class->dispose = sp_pencil_context_dispose;
106     event_context_class->setup = sp_pencil_context_setup;
107     event_context_class->root_handler = sp_pencil_context_root_handler;
110 /**
111  * Callback to initialize SPPencilContext object.
112  */
113 static void
114 sp_pencil_context_init(SPPencilContext *pc)
116     SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
118     event_context->cursor_shape = cursor_pencil_xpm;
119     event_context->hot_x = 4;
120     event_context->hot_y = 4;
122     pc->npoints = 0;
123     pc->state = SP_PENCIL_CONTEXT_IDLE;
124     pc->req_tangent = NR::Point(0, 0);
127 /**
128  * Callback to setup SPPencilContext object.
129  */
130 static void
131 sp_pencil_context_setup(SPEventContext *ec)
133     if (prefs_get_int_attribute("tools.freehand.pencil", "selcue", 0) != 0) {
134         ec->enableSelectionCue();
135     }
137     if (((SPEventContextClass *) pencil_parent_class)->setup) {
138         ((SPEventContextClass *) pencil_parent_class)->setup(ec);
139     }
141     SPPencilContext *const pc = SP_PENCIL_CONTEXT(ec);
142     pc->is_drawing = false;
144     pc->anchor_statusbar = false;
147 static void
148 sp_pencil_context_dispose(GObject *object)
150     G_OBJECT_CLASS(pencil_parent_class)->dispose(object);
153 /** Snaps new node relative to the previous node. */
154 static void
155 spdc_endpoint_snap(SPPencilContext const *pc, NR::Point &p, guint const state)
157     spdc_endpoint_snap_rotation(pc, p, pc->p[0], state);
158     spdc_endpoint_snap_free(pc, p, state);
161 /**
162  * Callback for handling all pencil context events.
163  */
164 gint
165 sp_pencil_context_root_handler(SPEventContext *const ec, GdkEvent *event)
167     SPPencilContext *const pc = SP_PENCIL_CONTEXT(ec);
169     gint ret = FALSE;
171     switch (event->type) {
172         case GDK_BUTTON_PRESS:
173             ret = pencil_handle_button_press(pc, event->button);
174             break;
176         case GDK_MOTION_NOTIFY:
177             ret = pencil_handle_motion_notify(pc, event->motion);
178             break;
180         case GDK_BUTTON_RELEASE:
181             ret = pencil_handle_button_release(pc, event->button);
182             break;
184         case GDK_KEY_PRESS:
185             ret = pencil_handle_key_press(pc, get_group0_keyval (&event->key), event->key.state);
186             break;
188         default:
189             break;
190     }
192     if (!ret) {
193         gint (*const parent_root_handler)(SPEventContext *, GdkEvent *)
194             = ((SPEventContextClass *) pencil_parent_class)->root_handler;
195         if (parent_root_handler) {
196             ret = parent_root_handler(ec, event);
197         }
198     }
200     return ret;
203 static gint
204 pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &bevent)
206     gint ret = FALSE;
207     SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
208     if ( bevent.button == 1  && !event_context->space_panning) {
210         SPDrawContext *dc = SP_DRAW_CONTEXT (pc);
211         SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(dc);
212         Inkscape::Selection *selection = sp_desktop_selection(desktop);
214         if (Inkscape::have_viable_layer(desktop, dc->_message_context) == false) {
215             return TRUE;
216         }
218         NR::Point const button_w(bevent.x, bevent.y);
220         /* Find desktop coordinates */
221         NR::Point p = pc->desktop->w2d(button_w);
223         /* Test whether we hit any anchor. */
224         SPDrawAnchor *anchor = spdc_test_inside(pc, button_w);
226         pencil_drag_origin_w = NR::Point(bevent.x,bevent.y);
227         pencil_within_tolerance = true;
229         switch (pc->state) {
230             case SP_PENCIL_CONTEXT_ADDLINE:
231                 /* Current segment will be finished with release */
232                 ret = TRUE;
233                 break;
234             default:
235                 /* Set first point of sequence */
236                 if (bevent.state & GDK_CONTROL_MASK) {
237                     freehand_create_single_dot(event_context, p, "tools.freehand.pencil", bevent.state);
238                     ret = true;
239                     break;
240                 }
241                 if (anchor) {
242                     p = anchor->dp;
243                     desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Continuing selected path"));
244                 } else {
246                     if (!(bevent.state & GDK_SHIFT_MASK)) {
248                         // This is the first click of a new curve; deselect item so that
249                         // this curve is not combined with it (unless it is drawn from its
250                         // anchor, which is handled by the sibling branch above)
251                         selection->clear();
252                         desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating new path"));
253                         SnapManager &m = desktop->namedview->snap_manager;
254                         m.setup(desktop);
255                         m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, p);
256                     } else if (selection->singleItem() && SP_IS_PATH(selection->singleItem())) {
257                         desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Appending to selected path"));
258                     }
259                 }
260                 pc->sa = anchor;
261                 spdc_set_startpoint(pc, p);
262                 ret = TRUE;
263                 break;
264         }
266         pc->is_drawing = true;
267     }
268     return ret;
271 static gint
272 pencil_handle_motion_notify(SPPencilContext *const pc, GdkEventMotion const &mevent)
274     if ((mevent.state & GDK_CONTROL_MASK) && (mevent.state & GDK_BUTTON1_MASK)) {
275         // mouse was accidentally moved during Ctrl+click;
276         // ignore the motion and create a single point
277         pc->is_drawing = false;
278         return TRUE;
279     }
280     gint ret = FALSE;
281     SPDesktop *const dt = pc->desktop;
283     SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
284     if (event_context->space_panning || mevent.state & GDK_BUTTON2_MASK || mevent.state & GDK_BUTTON3_MASK) {
285         // allow scrolling
286         return FALSE;
287     }
289     if ( ( mevent.state & GDK_BUTTON1_MASK ) && !pc->grab && pc->is_drawing) {
290         /* Grab mouse, so release will not pass unnoticed */
291         pc->grab = SP_CANVAS_ITEM(dt->acetate);
292         sp_canvas_item_grab(pc->grab, ( GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK   |
293                                         GDK_BUTTON_RELEASE_MASK |
294                                         GDK_POINTER_MOTION_MASK  ),
295                             NULL, mevent.time);
296     }
298     /* Find desktop coordinates */
299     NR::Point p = dt->w2d(NR::Point(mevent.x, mevent.y));
301     /* Test whether we hit any anchor. */
302     SPDrawAnchor *anchor = spdc_test_inside(pc, NR::Point(mevent.x, mevent.y));
304     if (pencil_within_tolerance) {
305         gint const tolerance = prefs_get_int_attribute_limited("options.dragtolerance",
306                                                                "value", 0, 0, 100);
307         if ( NR::LInfty( NR::Point(mevent.x,mevent.y) - pencil_drag_origin_w ) < tolerance ) {
308             return FALSE;   // Do not drag if we're within tolerance from origin.
309         }
310     }
312     // Once the user has moved farther than tolerance from the original location
313     // (indicating they intend to move the object, not click), then always process the
314     // motion notify coordinates as given (no snapping back to origin)
315     pencil_within_tolerance = false;
317     switch (pc->state) {
318         case SP_PENCIL_CONTEXT_ADDLINE:
319             /* Set red endpoint */
320             if (anchor) {
321                 p = anchor->dp;
322             } else {
323                 spdc_endpoint_snap(pc, p, mevent.state);
324             }
325             spdc_set_endpoint(pc, p);
326             ret = TRUE;
327             break;
328         default:
329             /* We may be idle or already freehand */
330             if ( mevent.state & GDK_BUTTON1_MASK && pc->is_drawing ) {
331                 pc->state = SP_PENCIL_CONTEXT_FREEHAND;
332                 if ( !pc->sa && !pc->green_anchor ) {
333                     /* Create green anchor */
334                     pc->green_anchor = sp_draw_anchor_new(pc, pc->green_curve, TRUE, pc->p[0]);
335                 }
336                 /** \todo
337                  * fixme: I am not sure whether we want to snap to anchors
338                  * in middle of freehand (Lauris)
339                  */
340                 if (anchor) {
341                     p = anchor->dp;
342                 } else if ((mevent.state & GDK_SHIFT_MASK) == 0) {
343                     SnapManager &m = dt->namedview->snap_manager;
344                     m.setup(dt, NULL);
345                     m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, p);
346                 }
347                 if ( pc->npoints != 0 ) { // buttonpress may have happened before we entered draw context!
348                     spdc_add_freehand_point(pc, p, mevent.state);
349                     ret = TRUE;
350                 }
352                 if (anchor && !pc->anchor_statusbar) {
353                     pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Release</b> here to close and finish the path."));
354                     pc->anchor_statusbar = true;
355                 } else if (!anchor && pc->anchor_statusbar) {
356                     pc->_message_context->clear();
357                     pc->anchor_statusbar = false;
358                 } else if (!anchor) {
359                     pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("Drawing a freehand path"));
360                 }
362             } else {
363                 if (anchor && !pc->anchor_statusbar) {
364                     pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Drag</b> to continue the path from this point."));
365                     pc->anchor_statusbar = true;
366                 } else if (!anchor && pc->anchor_statusbar) {
367                     pc->_message_context->clear();
368                     pc->anchor_statusbar = false;
369                 }
370             }
371             break;
372     }
373     return ret;
376 static gint
377 pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &revent)
379     gint ret = FALSE;
381     SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
382     if ( revent.button == 1 && pc->is_drawing && !event_context->space_panning) {
383         SPDesktop *const dt = pc->desktop;
385         pc->is_drawing = false;
387         /* Find desktop coordinates */
388         NR::Point p = dt->w2d(NR::Point(revent.x, revent.y));
390         /* Test whether we hit any anchor. */
391         SPDrawAnchor *anchor = spdc_test_inside(pc, NR::Point(revent.x,
392                                                               revent.y));
394         switch (pc->state) {
395             case SP_PENCIL_CONTEXT_IDLE:
396                 /* Releasing button in idle mode means single click */
397                 /* We have already set up start point/anchor in button_press */
398                 if (!(revent.state & GDK_CONTROL_MASK)) {
399                     // Ctrl+click creates a single point so only set context in ADDLINE mode when Ctrl isn't pressed
400                     pc->state = SP_PENCIL_CONTEXT_ADDLINE;
401                 }
402                 ret = TRUE;
403                 break;
404             case SP_PENCIL_CONTEXT_ADDLINE:
405                 /* Finish segment now */
406                 if (anchor) {
407                     p = anchor->dp;
408                 } else {
409                     spdc_endpoint_snap(pc, p, revent.state);
410                 }
411                 pc->ea = anchor;
412                 spdc_set_endpoint(pc, p);
413                 spdc_finish_endpoint(pc);
414                 pc->state = SP_PENCIL_CONTEXT_IDLE;
415                 ret = TRUE;
416                 break;
417             case SP_PENCIL_CONTEXT_FREEHAND:
418                 /* Finish segment now */
419                 /// \todo fixme: Clean up what follows (Lauris)
420                 if (anchor) {
421                     p = anchor->dp;
422                 }
423                 pc->ea = anchor;
424                 /* Write curves to object */
426                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Finishing freehand"));
428                 spdc_concat_colors_and_flush(pc, FALSE);
429                 pc->sa = NULL;
430                 pc->ea = NULL;
431                 if (pc->green_anchor) {
432                     pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor);
433                 }
434                 pc->state = SP_PENCIL_CONTEXT_IDLE;
435                 ret = TRUE;
436                 break;
437             default:
438                 break;
439         }
441         if (pc->grab) {
442             /* Release grab now */
443             sp_canvas_item_ungrab(pc->grab, revent.time);
444             pc->grab = NULL;
445         }
447         ret = TRUE;
448     }
449     return ret;
452 static void
453 pencil_cancel (SPPencilContext *const pc) 
455     if (pc->grab) {
456         /* Release grab now */
457         sp_canvas_item_ungrab(pc->grab, 0);
458         pc->grab = NULL;
459     }
461     pc->is_drawing = false;
463     pc->state = SP_PENCIL_CONTEXT_IDLE;
465     pc->red_curve->reset();
466     sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), NULL);
467     while (pc->green_bpaths) {
468         gtk_object_destroy(GTK_OBJECT(pc->green_bpaths->data));
469         pc->green_bpaths = g_slist_remove(pc->green_bpaths, pc->green_bpaths->data);
470     }
471     pc->green_curve->reset();
472     if (pc->green_anchor) {
473         pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor);
474     }
476     pc->_message_context->clear();
477     pc->_message_context->flash(Inkscape::NORMAL_MESSAGE, _("Drawing cancelled"));
479     sp_canvas_end_forced_full_redraws(pc->desktop->canvas);
483 static gint
484 pencil_handle_key_press(SPPencilContext *const pc, guint const keyval, guint const state)
486     gint ret = FALSE;
487     switch (keyval) {
488         case GDK_Up:
489         case GDK_Down:
490         case GDK_KP_Up:
491         case GDK_KP_Down:
492             // Prevent the zoom field from activation.
493             if (!mod_ctrl_only(state)) {
494                 ret = TRUE;
495             }
496             break;
497         case GDK_Escape:
498             if (pc->npoints != 0) {
499                 // if drawing, cancel, otherwise pass it up for deselecting
500                 if (pc->is_drawing) {
501                     pencil_cancel (pc);
502                     ret = TRUE;
503                 }
504             }
505             break;
506         case GDK_z:
507         case GDK_Z:
508             if (mod_ctrl_only(state) && pc->npoints != 0) {
509                 // if drawing, cancel, otherwise pass it up for undo
510                 if (pc->is_drawing) {
511                     pencil_cancel (pc);
512                     ret = TRUE;
513                 }
514             }
515             break;
516         case GDK_g:
517         case GDK_G:
518             if (mod_shift_only(state)) {
519                 sp_selection_to_guides();
520                 ret = true;
521             }
522             break;
523         default:
524             break;
525     }
526     return ret;
529 /**
530  * Reset points and set new starting point.
531  */
532 static void
533 spdc_set_startpoint(SPPencilContext *const pc, NR::Point const p)
535     pc->npoints = 0;
536     pc->red_curve_is_valid = false;
537     if (in_svg_plane(p)) {
538         pc->p[pc->npoints++] = p;
539     }
542 /**
543  * Change moving endpoint position.
544  * <ul>
545  * <li>Ctrl constrains to moving to H/V direction, snapping in given direction.
546  * <li>Otherwise we snap freely to whatever attractors are available.
547  * </ul>
548  *
549  * Number of points is (re)set to 2 always, 2nd point is modified.
550  * We change RED curve.
551  */
552 static void
553 spdc_set_endpoint(SPPencilContext *const pc, NR::Point const p)
555     if (pc->npoints == 0) {
556         return;
557         /* May occur if first point wasn't in SVG plane (e.g. weird w2d transform, perhaps from bad
558          * zoom setting).
559          */
560     }
561     g_return_if_fail( pc->npoints > 0 );
563     pc->red_curve->reset();
564     if ( ( p == pc->p[0] )
565          || !in_svg_plane(p) )
566     {
567         pc->npoints = 1;
568     } else {
569         pc->p[1] = p;
570         pc->npoints = 2;
572         pc->red_curve->moveto(pc->p[0]);
573         pc->red_curve->lineto(pc->p[1]);
574         pc->red_curve_is_valid = true;
576         sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->red_curve);
577     }
580 /**
581  * Finalize addline.
582  *
583  * \todo
584  * fixme: I'd like remove red reset from concat colors (lauris).
585  * Still not sure, how it will make most sense.
586  */
587 static void
588 spdc_finish_endpoint(SPPencilContext *const pc)
590     if ( ( pc->red_curve->is_empty() )
591          || ( pc->red_curve->first_point() == pc->red_curve->second_point()   ) )
592     {
593         pc->red_curve->reset();
594         sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), NULL);
595     } else {
596         /* Write curves to object. */
597         spdc_concat_colors_and_flush(pc, FALSE);
598         pc->sa = NULL;
599         pc->ea = NULL;
600     }
603 static void
604 spdc_add_freehand_point(SPPencilContext *pc, NR::Point p, guint /*state*/)
606     g_assert( pc->npoints > 0 );
607     g_return_if_fail(unsigned(pc->npoints) < G_N_ELEMENTS(pc->p));
609     if ( ( p != pc->p[ pc->npoints - 1 ] )
610          && in_svg_plane(p) )
611     {
612         pc->p[pc->npoints++] = p;
613         fit_and_split(pc);
614     }
617 static inline double
618 square(double const x)
620     return x * x;
623 static void
624 fit_and_split(SPPencilContext *pc)
626     g_assert( pc->npoints > 1 );
628     double const tol = prefs_get_double_attribute_limited("tools.freehand.pencil",                                                                             "tolerance", 10.0, 1.0, 100.0);
629     double const tolerance_sq = 0.02 * square( NR::expansion(pc->desktop->w2d()) * tol) 
630         * exp(0.2*tol - 2);
632     NR::Point b[4];
633     g_assert(is_zero(pc->req_tangent)
634              || is_unit_vector(pc->req_tangent));
635     NR::Point const tHatEnd(0, 0);
636     int const n_segs = sp_bezier_fit_cubic_full(b, NULL, pc->p, pc->npoints,
637                                                 pc->req_tangent, tHatEnd, tolerance_sq, 1);
638     if ( n_segs > 0
639          && unsigned(pc->npoints) < G_N_ELEMENTS(pc->p) )
640     {
641         /* Fit and draw and reset state */
642         pc->red_curve->reset();
643         pc->red_curve->moveto(b[0]);
644         pc->red_curve->curveto(b[1], b[2], b[3]);
645         sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->red_curve);
646         pc->red_curve_is_valid = true;
647     } else {
648         /* Fit and draw and copy last point */
650         g_assert(!pc->red_curve->is_empty());
652         /* Set up direction of next curve. */
653         {
654             Geom::CubicBezier const * last_seg = dynamic_cast<Geom::CubicBezier const *>(pc->red_curve->last_segment());
655             g_assert( last_seg );      // Relevance: validity of (*last_seg)[2]
656             pc->p[0] = last_seg->finalPoint();
657             pc->npoints = 1;
658             NR::Point const req_vec( pc->p[0] - (*last_seg)[2] );
659             pc->req_tangent = ( ( NR::is_zero(req_vec) || !in_svg_plane(req_vec) )
660                                 ? NR::Point(0, 0)
661                                 : NR::unit_vector(req_vec) );
662         }
664         pc->green_curve->append_continuous(pc->red_curve, 0.0625);
665         SPCurve *curve = pc->red_curve->copy();
667         /// \todo fixme:
668         SPCanvasItem *cshape = sp_canvas_bpath_new(sp_desktop_sketch(pc->desktop), curve);
669         curve->unref();
670         sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(cshape), pc->green_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
672         pc->green_bpaths = g_slist_prepend(pc->green_bpaths, cshape);
674         pc->red_curve_is_valid = false;
675     }
679 /*
680   Local Variables:
681   mode:c++
682   c-file-style:"stroustrup"
683   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
684   indent-tabs-mode:nil
685   fill-column:99
686   End:
687 */
688 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :