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 "draw-anchor.h"
25 #include "message-stack.h"
26 #include "message-context.h"
27 #include "modifier-fns.h"
28 #include "sp-path.h"
29 #include "prefs-utils.h"
30 #include "snap.h"
31 #include "pixmaps/cursor-pencil.xpm"
32 #include "display/bezier-utils.h"
33 #include "display/canvas-bpath.h"
34 #include <glibmm/i18n.h>
35 #include "libnr/in-svg-plane.h"
36 #include "libnr/n-art-bpath.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"
43 static void sp_pencil_context_class_init(SPPencilContextClass *klass);
44 static void sp_pencil_context_init(SPPencilContext *pc);
45 static void sp_pencil_context_setup(SPEventContext *ec);
46 static void sp_pencil_context_dispose(GObject *object);
48 static gint sp_pencil_context_root_handler(SPEventContext *event_context, GdkEvent *event);
49 static gint pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &bevent);
50 static gint pencil_handle_motion_notify(SPPencilContext *const pc, GdkEventMotion const &mevent);
51 static gint pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &revent);
52 static gint pencil_handle_key_press(SPPencilContext *const pc, guint const keyval, guint const state);
54 static void spdc_set_startpoint(SPPencilContext *pc, NR::Point const p);
55 static void spdc_set_endpoint(SPPencilContext *pc, NR::Point const p);
56 static void spdc_finish_endpoint(SPPencilContext *pc);
57 static void spdc_add_freehand_point(SPPencilContext *pc, NR::Point p, guint state);
58 static void fit_and_split(SPPencilContext *pc);
61 static SPDrawContextClass *pencil_parent_class;
63 /**
64 * Register SPPencilContext class with Gdk and return its type number.
65 */
66 GType
67 sp_pencil_context_get_type()
68 {
69 static GType type = 0;
70 if (!type) {
71 GTypeInfo info = {
72 sizeof(SPPencilContextClass),
73 NULL, NULL,
74 (GClassInitFunc) sp_pencil_context_class_init,
75 NULL, NULL,
76 sizeof(SPPencilContext),
77 4,
78 (GInstanceInitFunc) sp_pencil_context_init,
79 NULL, /* value_table */
80 };
81 type = g_type_register_static(SP_TYPE_DRAW_CONTEXT, "SPPencilContext", &info, (GTypeFlags)0);
82 }
83 return type;
84 }
86 /**
87 * Initialize SPPencilContext vtable.
88 */
89 static void
90 sp_pencil_context_class_init(SPPencilContextClass *klass)
91 {
92 GObjectClass *object_class;
93 SPEventContextClass *event_context_class;
95 object_class = (GObjectClass *) klass;
96 event_context_class = (SPEventContextClass *) klass;
98 pencil_parent_class = (SPDrawContextClass*)g_type_class_peek_parent(klass);
100 object_class->dispose = sp_pencil_context_dispose;
102 event_context_class->setup = sp_pencil_context_setup;
103 event_context_class->root_handler = sp_pencil_context_root_handler;
104 }
106 /**
107 * Callback to initialize SPPencilContext object.
108 */
109 static void
110 sp_pencil_context_init(SPPencilContext *pc)
111 {
112 SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
114 event_context->cursor_shape = cursor_pencil_xpm;
115 event_context->hot_x = 4;
116 event_context->hot_y = 4;
118 pc->npoints = 0;
119 pc->state = SP_PENCIL_CONTEXT_IDLE;
120 pc->req_tangent = NR::Point(0, 0);
121 }
123 /**
124 * Callback to setup SPPencilContext object.
125 */
126 static void
127 sp_pencil_context_setup(SPEventContext *ec)
128 {
129 if (prefs_get_int_attribute("tools.freehand.pencil", "selcue", 0) != 0) {
130 ec->enableSelectionCue();
131 }
133 if (((SPEventContextClass *) pencil_parent_class)->setup) {
134 ((SPEventContextClass *) pencil_parent_class)->setup(ec);
135 }
137 SPPencilContext *const pc = SP_PENCIL_CONTEXT(ec);
138 pc->is_drawing = false;
140 pc->anchor_statusbar = false;
141 }
143 static void
144 sp_pencil_context_dispose(GObject *object)
145 {
146 G_OBJECT_CLASS(pencil_parent_class)->dispose(object);
147 }
149 /** Snaps new node relative to the previous node. */
150 static void
151 spdc_endpoint_snap(SPPencilContext const *pc, NR::Point &p, guint const state)
152 {
153 spdc_endpoint_snap_rotation(pc, p, pc->p[0], state);
154 spdc_endpoint_snap_free(pc, p, state);
155 }
157 /**
158 * Callback for handling all pencil context events.
159 */
160 gint
161 sp_pencil_context_root_handler(SPEventContext *const ec, GdkEvent *event)
162 {
163 SPPencilContext *const pc = SP_PENCIL_CONTEXT(ec);
165 gint ret = FALSE;
167 switch (event->type) {
168 case GDK_BUTTON_PRESS:
169 ret = pencil_handle_button_press(pc, event->button);
170 break;
172 case GDK_MOTION_NOTIFY:
173 ret = pencil_handle_motion_notify(pc, event->motion);
174 break;
176 case GDK_BUTTON_RELEASE:
177 ret = pencil_handle_button_release(pc, event->button);
178 break;
180 case GDK_KEY_PRESS:
181 ret = pencil_handle_key_press(pc, get_group0_keyval (&event->key), event->key.state);
182 break;
184 default:
185 break;
186 }
188 if (!ret) {
189 gint (*const parent_root_handler)(SPEventContext *, GdkEvent *)
190 = ((SPEventContextClass *) pencil_parent_class)->root_handler;
191 if (parent_root_handler) {
192 ret = parent_root_handler(ec, event);
193 }
194 }
196 return ret;
197 }
199 static gint
200 pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &bevent)
201 {
202 gint ret = FALSE;
203 SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
204 if ( bevent.button == 1 && !event_context->space_panning) {
206 SPDrawContext *dc = SP_DRAW_CONTEXT (pc);
207 SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(dc);
208 Inkscape::Selection *selection = sp_desktop_selection(desktop);
210 if (Inkscape::have_viable_layer(desktop, dc->_message_context) == false) {
211 return TRUE;
212 }
214 NR::Point const button_w(bevent.x, bevent.y);
216 /* Find desktop coordinates */
217 NR::Point p = pc->desktop->w2d(button_w);
219 /* Test whether we hit any anchor. */
220 SPDrawAnchor *anchor = spdc_test_inside(pc, button_w);
222 switch (pc->state) {
223 case SP_PENCIL_CONTEXT_ADDLINE:
224 /* Current segment will be finished with release */
225 ret = TRUE;
226 break;
227 default:
228 /* Set first point of sequence */
229 if (bevent.state & GDK_CONTROL_MASK) {
230 /* Create object */
231 Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
232 Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
233 repr->setAttribute("sodipodi:type", "arc");
234 SPItem *item = SP_ITEM(desktop->currentLayer()->appendChildRepr(repr));
235 Inkscape::GC::release(repr);
236 NR::Matrix const i2d (sp_item_i2d_affine (item));
237 NR::Point pp = p * i2d;
238 sp_repr_set_svg_double (repr, "sodipodi:cx", pp[NR::X]);
239 sp_repr_set_svg_double (repr, "sodipodi:cy", pp[NR::Y]);
240 sp_repr_set_int (repr, "sodipodi:rx", 10);
241 sp_repr_set_int (repr, "sodipodi:ry", 10);
243 /* Set style */
244 sp_desktop_apply_style_tool(desktop, repr, "tools.shapes.arc", false);
246 item->updateRepr();
247 desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating single point"));
248 sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_PENCIL, _("Create single point"));
249 ret = true;
250 break;
252 }
253 if (anchor) {
254 p = anchor->dp;
255 desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Continuing selected path"));
256 } else {
258 if (!(bevent.state & GDK_SHIFT_MASK)) {
260 // This is the first click of a new curve; deselect item so that
261 // this curve is not combined with it (unless it is drawn from its
262 // anchor, which is handled by the sibling branch above)
263 selection->clear();
264 desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating new path"));
265 SnapManager const &m = desktop->namedview->snap_manager;
266 p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, p, NULL).getPoint();
267 } else if (selection->singleItem() && SP_IS_PATH(selection->singleItem())) {
268 desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Appending to selected path"));
269 }
270 }
271 pc->sa = anchor;
272 spdc_set_startpoint(pc, p);
273 ret = TRUE;
274 break;
275 }
277 pc->is_drawing = true;
278 }
279 return ret;
280 }
282 static gint
283 pencil_handle_motion_notify(SPPencilContext *const pc, GdkEventMotion const &mevent)
284 {
285 if (mevent.state & GDK_CONTROL_MASK) {
286 // mouse was accidentally moved during Ctrl+click;
287 // ignore the motion and create a single point
288 return TRUE;
289 }
290 gint ret = FALSE;
291 SPDesktop *const dt = pc->desktop;
293 SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
294 if (event_context->space_panning || mevent.state & GDK_BUTTON2_MASK || mevent.state & GDK_BUTTON3_MASK) {
295 // allow scrolling
296 return FALSE;
297 }
299 if ( ( mevent.state & GDK_BUTTON1_MASK ) && !pc->grab && pc->is_drawing) {
300 /* Grab mouse, so release will not pass unnoticed */
301 pc->grab = SP_CANVAS_ITEM(dt->acetate);
302 sp_canvas_item_grab(pc->grab, ( GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
303 GDK_BUTTON_RELEASE_MASK |
304 GDK_POINTER_MOTION_MASK ),
305 NULL, mevent.time);
306 }
308 /* Find desktop coordinates */
309 NR::Point p = dt->w2d(NR::Point(mevent.x, mevent.y));
311 /* Test whether we hit any anchor. */
312 SPDrawAnchor *anchor = spdc_test_inside(pc, NR::Point(mevent.x, mevent.y));
314 switch (pc->state) {
315 case SP_PENCIL_CONTEXT_ADDLINE:
316 /* Set red endpoint */
317 if (anchor) {
318 p = anchor->dp;
319 } else {
320 spdc_endpoint_snap(pc, p, mevent.state);
321 }
322 spdc_set_endpoint(pc, p);
323 ret = TRUE;
324 break;
325 default:
326 /* We may be idle or already freehand */
327 if ( mevent.state & GDK_BUTTON1_MASK && pc->is_drawing ) {
328 pc->state = SP_PENCIL_CONTEXT_FREEHAND;
329 if ( !pc->sa && !pc->green_anchor ) {
330 /* Create green anchor */
331 pc->green_anchor = sp_draw_anchor_new(pc, pc->green_curve, TRUE, pc->p[0]);
332 }
333 /** \todo
334 * fixme: I am not sure whether we want to snap to anchors
335 * in middle of freehand (Lauris)
336 */
337 if (anchor) {
338 p = anchor->dp;
339 } else if ((mevent.state & GDK_SHIFT_MASK) == 0) {
340 SnapManager const &m = dt->namedview->snap_manager;
341 p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, p, NULL).getPoint();
342 }
343 if ( pc->npoints != 0 ) { // buttonpress may have happened before we entered draw context!
344 spdc_add_freehand_point(pc, p, mevent.state);
345 ret = TRUE;
346 }
348 if (anchor && !pc->anchor_statusbar) {
349 pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Release</b> here to close and finish the path."));
350 pc->anchor_statusbar = true;
351 } else if (!anchor && pc->anchor_statusbar) {
352 pc->_message_context->clear();
353 pc->anchor_statusbar = false;
354 } else if (!anchor) {
355 pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("Drawing a freehand path"));
356 }
358 } else {
359 if (anchor && !pc->anchor_statusbar) {
360 pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Drag</b> to continue the path from this point."));
361 pc->anchor_statusbar = true;
362 } else if (!anchor && pc->anchor_statusbar) {
363 pc->_message_context->clear();
364 pc->anchor_statusbar = false;
365 }
366 }
367 break;
368 }
369 return ret;
370 }
372 static gint
373 pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &revent)
374 {
375 gint ret = FALSE;
377 SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
378 if ( revent.button == 1 && pc->is_drawing && !event_context->space_panning) {
379 SPDesktop *const dt = pc->desktop;
381 pc->is_drawing = false;
383 /* Find desktop coordinates */
384 NR::Point p = dt->w2d(NR::Point(revent.x, revent.y));
386 /* Test whether we hit any anchor. */
387 SPDrawAnchor *anchor = spdc_test_inside(pc, NR::Point(revent.x,
388 revent.y));
390 switch (pc->state) {
391 case SP_PENCIL_CONTEXT_IDLE:
392 /* Releasing button in idle mode means single click */
393 /* We have already set up start point/anchor in button_press */
394 if (!(revent.state & GDK_CONTROL_MASK)) {
395 // Ctrl+click creates a single point so only set context in ADDLINE mode when Ctrl isn't pressed
396 pc->state = SP_PENCIL_CONTEXT_ADDLINE;
397 }
398 ret = TRUE;
399 break;
400 case SP_PENCIL_CONTEXT_ADDLINE:
401 /* Finish segment now */
402 if (anchor) {
403 p = anchor->dp;
404 } else {
405 spdc_endpoint_snap(pc, p, revent.state);
406 }
407 pc->ea = anchor;
408 spdc_set_endpoint(pc, p);
409 spdc_finish_endpoint(pc);
410 pc->state = SP_PENCIL_CONTEXT_IDLE;
411 ret = TRUE;
412 break;
413 case SP_PENCIL_CONTEXT_FREEHAND:
414 /* Finish segment now */
415 /// \todo fixme: Clean up what follows (Lauris)
416 if (anchor) {
417 p = anchor->dp;
418 }
419 pc->ea = anchor;
420 /* Write curves to object */
422 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Finishing freehand"));
424 spdc_concat_colors_and_flush(pc, FALSE);
425 pc->sa = NULL;
426 pc->ea = NULL;
427 if (pc->green_anchor) {
428 pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor);
429 }
430 pc->state = SP_PENCIL_CONTEXT_IDLE;
431 ret = TRUE;
432 break;
433 default:
434 break;
435 }
437 if (pc->grab) {
438 /* Release grab now */
439 sp_canvas_item_ungrab(pc->grab, revent.time);
440 pc->grab = NULL;
441 }
443 ret = TRUE;
444 }
445 return ret;
446 }
448 static void
449 pencil_cancel (SPPencilContext *const pc)
450 {
451 if (pc->grab) {
452 /* Release grab now */
453 sp_canvas_item_ungrab(pc->grab, 0);
454 pc->grab = NULL;
455 }
457 pc->is_drawing = false;
459 pc->state = SP_PENCIL_CONTEXT_IDLE;
461 sp_curve_reset(pc->red_curve);
462 sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), NULL);
463 while (pc->green_bpaths) {
464 gtk_object_destroy(GTK_OBJECT(pc->green_bpaths->data));
465 pc->green_bpaths = g_slist_remove(pc->green_bpaths, pc->green_bpaths->data);
466 }
467 sp_curve_reset(pc->green_curve);
468 if (pc->green_anchor) {
469 pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor);
470 }
472 pc->_message_context->clear();
473 pc->_message_context->flash(Inkscape::NORMAL_MESSAGE, _("Drawing cancelled"));
475 sp_canvas_end_forced_full_redraws(pc->desktop->canvas);
476 }
479 static gint
480 pencil_handle_key_press(SPPencilContext *const pc, guint const keyval, guint const state)
481 {
482 gint ret = FALSE;
483 switch (keyval) {
484 case GDK_Up:
485 case GDK_Down:
486 case GDK_KP_Up:
487 case GDK_KP_Down:
488 // Prevent the zoom field from activation.
489 if (!mod_ctrl_only(state)) {
490 ret = TRUE;
491 }
492 break;
493 case GDK_Escape:
494 if (pc->npoints != 0) {
495 // if drawing, cancel, otherwise pass it up for deselecting
496 if (pc->is_drawing) {
497 pencil_cancel (pc);
498 ret = TRUE;
499 }
500 }
501 break;
502 case GDK_z:
503 case GDK_Z:
504 if (mod_ctrl_only(state) && pc->npoints != 0) {
505 // if drawing, cancel, otherwise pass it up for undo
506 if (pc->is_drawing) {
507 pencil_cancel (pc);
508 ret = TRUE;
509 }
510 }
511 break;
512 default:
513 break;
514 }
515 return ret;
516 }
518 /**
519 * Reset points and set new starting point.
520 */
521 static void
522 spdc_set_startpoint(SPPencilContext *const pc, NR::Point const p)
523 {
524 pc->npoints = 0;
525 pc->red_curve_is_valid = false;
526 if (in_svg_plane(p)) {
527 pc->p[pc->npoints++] = p;
528 }
529 }
531 /**
532 * Change moving endpoint position.
533 * <ul>
534 * <li>Ctrl constrains to moving to H/V direction, snapping in given direction.
535 * <li>Otherwise we snap freely to whatever attractors are available.
536 * </ul>
537 *
538 * Number of points is (re)set to 2 always, 2nd point is modified.
539 * We change RED curve.
540 */
541 static void
542 spdc_set_endpoint(SPPencilContext *const pc, NR::Point const p)
543 {
544 if (pc->npoints == 0) {
545 return;
546 /* May occur if first point wasn't in SVG plane (e.g. weird w2d transform, perhaps from bad
547 * zoom setting).
548 */
549 }
550 g_return_if_fail( pc->npoints > 0 );
552 sp_curve_reset(pc->red_curve);
553 if ( ( p == pc->p[0] )
554 || !in_svg_plane(p) )
555 {
556 pc->npoints = 1;
557 } else {
558 pc->p[1] = p;
559 pc->npoints = 2;
561 sp_curve_moveto(pc->red_curve, pc->p[0]);
562 sp_curve_lineto(pc->red_curve, pc->p[1]);
563 pc->red_curve_is_valid = true;
565 sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->red_curve);
566 }
567 }
569 /**
570 * Finalize addline.
571 *
572 * \todo
573 * fixme: I'd like remove red reset from concat colors (lauris).
574 * Still not sure, how it will make most sense.
575 */
576 static void
577 spdc_finish_endpoint(SPPencilContext *const pc)
578 {
579 if ( ( SP_CURVE_LENGTH(pc->red_curve) != 2 )
580 || ( SP_CURVE_SEGMENT(pc->red_curve, 0)->c(3) ==
581 SP_CURVE_SEGMENT(pc->red_curve, 1)->c(3) ) )
582 {
583 sp_curve_reset(pc->red_curve);
584 sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), NULL);
585 } else {
586 /* Write curves to object. */
587 spdc_concat_colors_and_flush(pc, FALSE);
588 pc->sa = NULL;
589 pc->ea = NULL;
590 }
591 }
593 static void
594 spdc_add_freehand_point(SPPencilContext *pc, NR::Point p, guint /*state*/)
595 {
596 g_assert( pc->npoints > 0 );
597 g_return_if_fail(unsigned(pc->npoints) < G_N_ELEMENTS(pc->p));
599 if ( ( p != pc->p[ pc->npoints - 1 ] )
600 && in_svg_plane(p) )
601 {
602 pc->p[pc->npoints++] = p;
603 fit_and_split(pc);
604 }
605 }
607 static inline double
608 square(double const x)
609 {
610 return x * x;
611 }
613 static void
614 fit_and_split(SPPencilContext *pc)
615 {
616 g_assert( pc->npoints > 1 );
618 double const tolerance_sq = square( NR::expansion(pc->desktop->w2d())
619 * prefs_get_double_attribute_limited("tools.freehand.pencil",
620 "tolerance", 10.0, 1.0, 100.0) );
622 NR::Point b[4];
623 g_assert(is_zero(pc->req_tangent)
624 || is_unit_vector(pc->req_tangent));
625 NR::Point const tHatEnd(0, 0);
626 int const n_segs = sp_bezier_fit_cubic_full(b, NULL, pc->p, pc->npoints,
627 pc->req_tangent, tHatEnd, tolerance_sq, 1);
628 if ( n_segs > 0
629 && unsigned(pc->npoints) < G_N_ELEMENTS(pc->p) )
630 {
631 /* Fit and draw and reset state */
632 sp_curve_reset(pc->red_curve);
633 sp_curve_moveto(pc->red_curve, b[0]);
634 sp_curve_curveto(pc->red_curve, b[1], b[2], b[3]);
635 sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->red_curve);
636 pc->red_curve_is_valid = true;
637 } else {
638 /* Fit and draw and copy last point */
640 g_assert(!sp_curve_empty(pc->red_curve));
642 /* Set up direction of next curve. */
643 {
644 NArtBpath const &last_seg = *sp_curve_last_bpath(pc->red_curve);
645 pc->p[0] = last_seg.c(3);
646 pc->npoints = 1;
647 g_assert( last_seg.code == NR_CURVETO );
648 /* Relevance: validity of last_seg.c(2). */
649 NR::Point const req_vec( pc->p[0] - last_seg.c(2) );
650 pc->req_tangent = ( ( NR::is_zero(req_vec) || !in_svg_plane(req_vec) )
651 ? NR::Point(0, 0)
652 : NR::unit_vector(req_vec) );
653 }
655 sp_curve_append_continuous(pc->green_curve, pc->red_curve, 0.0625);
656 SPCurve *curve = sp_curve_copy(pc->red_curve);
658 /// \todo fixme:
659 SPCanvasItem *cshape = sp_canvas_bpath_new(sp_desktop_sketch(pc->desktop), curve);
660 sp_curve_unref(curve);
661 sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(cshape), pc->green_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
663 pc->green_bpaths = g_slist_prepend(pc->green_bpaths, cshape);
665 pc->red_curve_is_valid = false;
666 }
667 }
670 /*
671 Local Variables:
672 mode:c++
673 c-file-style:"stroustrup"
674 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
675 indent-tabs-mode:nil
676 fill-column:99
677 End:
678 */
679 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :