1 #define __SP_BOX3D_CONTEXT_C__
3 /*
4 * 3D box drawing context
5 *
6 * Author:
7 * Lauris Kaplinski <lauris@kaplinski.com>
8 * bulia byak <buliabyak@users.sf.net>
9 *
10 * Copyright (C) 2007 Maximilian Albert <Anhalter42@gmx.de>
11 * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
12 * Copyright (C) 2000-2005 authors
13 * Copyright (C) 2000-2001 Ximian, Inc.
14 *
15 * Released under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include "config.h"
20 #include <gdk/gdkkeysyms.h>
22 #include "macros.h"
23 #include "display/sp-canvas.h"
24 #include "document.h"
25 #include "sp-namedview.h"
26 #include "selection.h"
27 #include "selection-chemistry.h"
28 #include "desktop-handles.h"
29 #include "snap.h"
30 #include "display/curve.h"
31 #include "desktop.h"
32 #include "message-context.h"
33 #include "pixmaps/cursor-3dbox.xpm"
34 #include "box3d.h"
35 #include "box3d-context.h"
36 #include "sp-metrics.h"
37 #include <glibmm/i18n.h>
38 #include "object-edit.h"
39 #include "xml/repr.h"
40 #include "xml/node-event-vector.h"
41 #include "preferences.h"
42 #include "context-fns.h"
43 #include "desktop-style.h"
44 #include "transf_mat_3x4.h"
45 #include "perspective-line.h"
46 #include "persp3d.h"
47 #include "box3d-side.h"
48 #include "document-private.h"
49 #include "line-geometry.h"
50 #include "shape-editor.h"
52 static void sp_box3d_context_class_init(Box3DContextClass *klass);
53 static void sp_box3d_context_init(Box3DContext *box3d_context);
54 static void sp_box3d_context_dispose(GObject *object);
56 static void sp_box3d_context_setup(SPEventContext *ec);
58 static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEvent *event);
59 static gint sp_box3d_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event);
61 static void sp_box3d_drag(Box3DContext &bc, guint state);
62 static void sp_box3d_finish(Box3DContext *bc);
64 static SPEventContextClass *parent_class;
66 GtkType sp_box3d_context_get_type()
67 {
68 static GType type = 0;
69 if (!type) {
70 GTypeInfo info = {
71 sizeof(Box3DContextClass),
72 NULL, NULL,
73 (GClassInitFunc) sp_box3d_context_class_init,
74 NULL, NULL,
75 sizeof(Box3DContext),
76 4,
77 (GInstanceInitFunc) sp_box3d_context_init,
78 NULL, /* value_table */
79 };
80 type = g_type_register_static(SP_TYPE_EVENT_CONTEXT, "Box3DContext", &info, (GTypeFlags) 0);
81 }
82 return type;
83 }
85 static void sp_box3d_context_class_init(Box3DContextClass *klass)
86 {
87 GObjectClass *object_class = (GObjectClass *) klass;
88 SPEventContextClass *event_context_class = (SPEventContextClass *) klass;
90 parent_class = (SPEventContextClass *) g_type_class_peek_parent(klass);
92 object_class->dispose = sp_box3d_context_dispose;
94 event_context_class->setup = sp_box3d_context_setup;
95 event_context_class->root_handler = sp_box3d_context_root_handler;
96 event_context_class->item_handler = sp_box3d_context_item_handler;
97 }
99 static void sp_box3d_context_init(Box3DContext *box3d_context)
100 {
101 SPEventContext *event_context = SP_EVENT_CONTEXT(box3d_context);
103 event_context->cursor_shape = cursor_3dbox_xpm;
104 event_context->hot_x = 4;
105 event_context->hot_y = 4;
106 event_context->xp = 0;
107 event_context->yp = 0;
108 event_context->tolerance = 0;
109 event_context->within_tolerance = false;
110 event_context->item_to_select = NULL;
112 box3d_context->item = NULL;
114 box3d_context->ctrl_dragged = false;
115 box3d_context->extruded = false;
117 box3d_context->_vpdrag = NULL;
119 new (&box3d_context->sel_changed_connection) sigc::connection();
120 }
122 static void sp_box3d_context_dispose(GObject *object)
123 {
124 Box3DContext *bc = SP_BOX3D_CONTEXT(object);
125 SPEventContext *ec = SP_EVENT_CONTEXT(object);
127 ec->enableGrDrag(false);
129 delete (bc->_vpdrag);
130 bc->_vpdrag = NULL;
132 bc->sel_changed_connection.disconnect();
133 bc->sel_changed_connection.~connection();
135 delete ec->shape_editor;
136 ec->shape_editor = NULL;
138 /* fixme: This is necessary because we do not grab */
139 if (bc->item) {
140 sp_box3d_finish(bc);
141 }
143 if (bc->_message_context) {
144 delete bc->_message_context;
145 }
147 G_OBJECT_CLASS(parent_class)->dispose(object);
148 }
150 /**
151 \brief Callback that processes the "changed" signal on the selection;
152 destroys old and creates new knotholder
153 */
154 static void sp_box3d_context_selection_changed(Inkscape::Selection *selection, gpointer data)
155 {
156 Box3DContext *bc = SP_BOX3D_CONTEXT(data);
157 SPEventContext *ec = SP_EVENT_CONTEXT(bc);
159 ec->shape_editor->unset_item(SH_KNOTHOLDER);
160 SPItem *item = selection->singleItem();
161 ec->shape_editor->set_item(item, SH_KNOTHOLDER);
163 if (selection->perspList().size() == 1) {
164 // selecting a single box changes the current perspective
165 ec->desktop->doc()->current_persp3d = selection->perspList().front();
166 }
167 }
169 /* create a default perspective in document defs if none is present
170 (can happen after 'vacuum defs' or when a pre-0.46 file is opened) */
171 static void sp_box3d_context_check_for_persp_in_defs(SPDocument *document) {
172 SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document);
174 bool has_persp = false;
175 for (SPObject *child = sp_object_first_child(defs); child != NULL; child = SP_OBJECT_NEXT(child) ) {
176 if (SP_IS_PERSP3D(child)) {
177 has_persp = true;
178 break;
179 }
180 }
182 if (!has_persp) {
183 document->current_persp3d = persp3d_create_xml_element (document);
184 }
185 }
187 static void sp_box3d_context_setup(SPEventContext *ec)
188 {
189 Box3DContext *bc = SP_BOX3D_CONTEXT(ec);
191 if (((SPEventContextClass *) parent_class)->setup) {
192 ((SPEventContextClass *) parent_class)->setup(ec);
193 }
195 sp_box3d_context_check_for_persp_in_defs(sp_desktop_document (ec->desktop));
197 ec->shape_editor = new ShapeEditor(ec->desktop);
199 SPItem *item = sp_desktop_selection(ec->desktop)->singleItem();
200 if (item) {
201 ec->shape_editor->set_item(item, SH_KNOTHOLDER);
202 }
204 bc->sel_changed_connection.disconnect();
205 bc->sel_changed_connection = sp_desktop_selection(ec->desktop)->connectChanged(
206 sigc::bind(sigc::ptr_fun(&sp_box3d_context_selection_changed), (gpointer)bc)
207 );
209 bc->_vpdrag = new Box3D::VPDrag(sp_desktop_document (ec->desktop));
210 Inkscape::Preferences *prefs = Inkscape::Preferences::get();
212 if (prefs->getBool("/tools/shapes/selcue")) {
213 ec->enableSelectionCue();
214 }
216 if (prefs->getBool("/tools/shapes/gradientdrag")) {
217 ec->enableGrDrag();
218 }
220 bc->_message_context = new Inkscape::MessageContext((ec->desktop)->messageStack());
221 }
223 static gint sp_box3d_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event)
224 {
225 SPDesktop *desktop = event_context->desktop;
227 gint ret = FALSE;
229 switch (event->type) {
230 case GDK_BUTTON_PRESS:
231 if ( event->button.button == 1 && !event_context->space_panning) {
232 Inkscape::setup_for_drag_start(desktop, event_context, event);
233 ret = TRUE;
234 }
235 break;
236 // motion and release are always on root (why?)
237 default:
238 break;
239 }
241 if (((SPEventContextClass *) parent_class)->item_handler) {
242 ret = ((SPEventContextClass *) parent_class)->item_handler(event_context, item, event);
243 }
245 return ret;
246 }
248 static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEvent *event)
249 {
250 static bool dragging;
252 SPDesktop *desktop = event_context->desktop;
253 Inkscape::Selection *selection = sp_desktop_selection (desktop);
254 Inkscape::Preferences *prefs = Inkscape::Preferences::get();
255 int const snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12);
257 Box3DContext *bc = SP_BOX3D_CONTEXT(event_context);
258 g_assert (SP_ACTIVE_DOCUMENT->current_persp3d);
259 Persp3D *cur_persp = SP_ACTIVE_DOCUMENT->current_persp3d;
261 event_context->tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
263 gint ret = FALSE;
264 switch (event->type) {
265 case GDK_BUTTON_PRESS:
266 if ( event->button.button == 1 && !event_context->space_panning) {
267 Geom::Point const button_w(event->button.x,
268 event->button.y);
270 // save drag origin
271 event_context->xp = (gint) button_w[Geom::X];
272 event_context->yp = (gint) button_w[Geom::Y];
273 event_context->within_tolerance = true;
275 // remember clicked item, *not* disregarding groups (since a 3D box is a group), honoring Alt
276 event_context->item_to_select = sp_event_context_find_item (desktop, button_w, event->button.state & GDK_MOD1_MASK, event->button.state & GDK_CONTROL_MASK);
278 dragging = true;
279 sp_canvas_set_snap_delay_active(desktop->canvas, true);
281 /* */
282 Geom::Point button_dt(desktop->w2d(button_w));
283 bc->drag_origin = from_2geom(button_dt);
284 bc->drag_ptB = from_2geom(button_dt);
285 bc->drag_ptC = from_2geom(button_dt);
287 /* Projective preimages of clicked point under current perspective */
288 bc->drag_origin_proj = cur_persp->tmat.preimage (from_2geom(button_dt), 0, Proj::Z);
289 bc->drag_ptB_proj = bc->drag_origin_proj;
290 bc->drag_ptC_proj = bc->drag_origin_proj;
291 bc->drag_ptC_proj.normalize();
292 bc->drag_ptC_proj[Proj::Z] = 0.25;
294 /* Snap center */
295 SnapManager &m = desktop->namedview->snap_manager;
296 m.setup(desktop, true, bc->item);
297 m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, button_dt);
298 bc->center = from_2geom(button_dt);
300 sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
301 ( GDK_KEY_PRESS_MASK |
302 GDK_BUTTON_RELEASE_MASK |
303 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
304 GDK_BUTTON_PRESS_MASK ),
305 NULL, event->button.time);
306 ret = TRUE;
307 }
308 break;
309 case GDK_MOTION_NOTIFY:
310 if ( dragging
311 && ( event->motion.state & GDK_BUTTON1_MASK ) && !event_context->space_panning)
312 {
313 if ( event_context->within_tolerance
314 && ( abs( (gint) event->motion.x - event_context->xp ) < event_context->tolerance )
315 && ( abs( (gint) event->motion.y - event_context->yp ) < event_context->tolerance ) ) {
316 break; // do not drag if we're within tolerance from origin
317 }
318 // Once the user has moved farther than tolerance from the original location
319 // (indicating they intend to draw, not click), then always process the
320 // motion notify coordinates as given (no snapping back to origin)
321 event_context->within_tolerance = false;
323 Geom::Point const motion_w(event->motion.x,
324 event->motion.y);
325 Geom::Point motion_dt(desktop->w2d(motion_w));
327 SnapManager &m = desktop->namedview->snap_manager;
328 m.setup(desktop, true, bc->item);
329 m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, motion_dt);
331 bc->ctrl_dragged = event->motion.state & GDK_CONTROL_MASK;
333 if (event->motion.state & GDK_SHIFT_MASK && !bc->extruded && bc->item) {
334 // once shift is pressed, set bc->extruded
335 bc->extruded = true;
336 }
338 if (!bc->extruded) {
339 bc->drag_ptB = from_2geom(motion_dt);
340 bc->drag_ptC = from_2geom(motion_dt);
342 bc->drag_ptB_proj = cur_persp->tmat.preimage (from_2geom(motion_dt), 0, Proj::Z);
343 bc->drag_ptC_proj = bc->drag_ptB_proj;
344 bc->drag_ptC_proj.normalize();
345 bc->drag_ptC_proj[Proj::Z] = 0.25;
346 } else {
347 // Without Ctrl, motion of the extruded corner is constrained to the
348 // perspective line from drag_ptB to vanishing point Y.
349 if (!bc->ctrl_dragged) {
350 /* snapping */
351 Box3D::PerspectiveLine pline (bc->drag_ptB, Proj::Z, SP_ACTIVE_DOCUMENT->current_persp3d);
352 bc->drag_ptC = pline.closest_to (from_2geom(motion_dt));
354 bc->drag_ptB_proj.normalize();
355 bc->drag_ptC_proj = cur_persp->tmat.preimage (bc->drag_ptC, bc->drag_ptB_proj[Proj::X], Proj::X);
356 } else {
357 bc->drag_ptC = from_2geom(motion_dt);
359 bc->drag_ptB_proj.normalize();
360 bc->drag_ptC_proj = cur_persp->tmat.preimage (from_2geom(motion_dt), bc->drag_ptB_proj[Proj::X], Proj::X);
361 }
362 Geom::Point pt2g = to_2geom(bc->drag_ptC);
363 m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, pt2g);
364 bc->drag_ptC = from_2geom(pt2g);
365 }
367 sp_box3d_drag(*bc, event->motion.state);
369 ret = TRUE;
370 }
371 break;
372 case GDK_BUTTON_RELEASE:
373 event_context->xp = event_context->yp = 0;
374 if ( event->button.button == 1 && !event_context->space_panning) {
375 dragging = false;
376 sp_canvas_set_snap_delay_active(desktop->canvas, false);
378 if (!event_context->within_tolerance) {
379 // we've been dragging, finish the box
380 sp_box3d_finish(bc);
381 } else if (event_context->item_to_select) {
382 // no dragging, select clicked item if any
383 if (event->button.state & GDK_SHIFT_MASK) {
384 selection->toggle(event_context->item_to_select);
385 } else {
386 selection->set(event_context->item_to_select);
387 }
388 } else {
389 // click in an empty space
390 selection->clear();
391 }
393 event_context->item_to_select = NULL;
394 ret = TRUE;
395 sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate),
396 event->button.time);
397 }
398 break;
399 case GDK_KEY_PRESS:
400 switch (get_group0_keyval (&event->key)) {
401 case GDK_Up:
402 case GDK_Down:
403 case GDK_KP_Up:
404 case GDK_KP_Down:
405 // prevent the zoom field from activation
406 if (!MOD__CTRL_ONLY)
407 ret = TRUE;
408 break;
410 case GDK_bracketright:
411 persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::X, -180/snaps, MOD__ALT);
412 sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
413 _("Change perspective (angle of PLs)"));
414 ret = true;
415 break;
417 case GDK_bracketleft:
418 persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::X, 180/snaps, MOD__ALT);
419 sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
420 _("Change perspective (angle of PLs)"));
421 ret = true;
422 break;
424 case GDK_parenright:
425 persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::Y, -180/snaps, MOD__ALT);
426 sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
427 _("Change perspective (angle of PLs)"));
428 ret = true;
429 break;
431 case GDK_parenleft:
432 persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::Y, 180/snaps, MOD__ALT);
433 sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
434 _("Change perspective (angle of PLs)"));
435 ret = true;
436 break;
438 case GDK_braceright:
439 persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::Z, -180/snaps, MOD__ALT);
440 sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
441 _("Change perspective (angle of PLs)"));
442 ret = true;
443 break;
445 case GDK_braceleft:
446 persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::Z, 180/snaps, MOD__ALT);
447 sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
448 _("Change perspective (angle of PLs)"));
449 ret = true;
450 break;
452 case GDK_O:
453 if (MOD__CTRL && MOD__SHIFT) {
454 Box3D::create_canvas_point(persp3d_get_VP(inkscape_active_document()->current_persp3d, Proj::W).affine(),
455 6, 0xff00ff00);
456 }
457 ret = true;
458 break;
460 case GDK_g:
461 case GDK_G:
462 if (MOD__SHIFT_ONLY) {
463 sp_selection_to_guides(desktop);
464 ret = true;
465 }
466 break;
468 case GDK_x:
469 case GDK_X:
470 if (MOD__ALT_ONLY) {
471 desktop->setToolboxFocusTo ("altx-box3d");
472 ret = TRUE;
473 }
474 if (MOD__SHIFT_ONLY) {
475 persp3d_toggle_VPs(selection->perspList(), Proj::X);
476 bc->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically?
477 ret = true;
478 }
479 break;
481 case GDK_y:
482 case GDK_Y:
483 if (MOD__SHIFT_ONLY) {
484 persp3d_toggle_VPs(selection->perspList(), Proj::Y);
485 bc->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically?
486 ret = true;
487 }
488 break;
490 case GDK_z:
491 case GDK_Z:
492 if (MOD__SHIFT_ONLY) {
493 persp3d_toggle_VPs(selection->perspList(), Proj::Z);
494 bc->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically?
495 ret = true;
496 }
497 break;
499 case GDK_Escape:
500 sp_desktop_selection(desktop)->clear();
501 //TODO: make dragging escapable by Esc
502 break;
504 case GDK_space:
505 if (dragging) {
506 sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate),
507 event->button.time);
508 dragging = false;
509 sp_canvas_set_snap_delay_active(desktop->canvas, false);
510 if (!event_context->within_tolerance) {
511 // we've been dragging, finish the box
512 sp_box3d_finish(bc);
513 }
514 // do not return true, so that space would work switching to selector
515 }
516 break;
518 default:
519 break;
520 }
521 break;
522 default:
523 break;
524 }
526 if (!ret) {
527 if (((SPEventContextClass *) parent_class)->root_handler) {
528 ret = ((SPEventContextClass *) parent_class)->root_handler(event_context, event);
529 }
530 }
532 return ret;
533 }
535 static void sp_box3d_drag(Box3DContext &bc, guint /*state*/)
536 {
537 SPDesktop *desktop = SP_EVENT_CONTEXT(&bc)->desktop;
539 if (!bc.item) {
541 if (Inkscape::have_viable_layer(desktop, bc._message_context) == false) {
542 return;
543 }
545 /* Create object */
546 Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&bc));
547 Inkscape::XML::Node *repr = xml_doc->createElement("svg:g");
548 repr->setAttribute("sodipodi:type", "inkscape:box3d");
550 /* Set style */
551 sp_desktop_apply_style_tool (desktop, repr, "/tools/shapes/3dbox", false);
553 bc.item = (SPItem *) desktop->currentLayer()->appendChildRepr(repr);
554 Inkscape::GC::release(repr);
555 Inkscape::XML::Node *repr_side;
556 // TODO: Incorporate this in box3d-side.cpp!
557 for (int i = 0; i < 6; ++i) {
558 repr_side = xml_doc->createElement("svg:path");
559 repr_side->setAttribute("sodipodi:type", "inkscape:box3dside");
560 repr->addChild(repr_side, NULL);
562 Box3DSide *side = SP_BOX3D_SIDE(inkscape_active_document()->getObjectByRepr (repr_side));
564 guint desc = Box3D::int_to_face(i);
566 Box3D::Axis plane = (Box3D::Axis) (desc & 0x7);
567 plane = (Box3D::is_plane(plane) ? plane : Box3D::orth_plane_or_axis(plane));
568 side->dir1 = Box3D::extract_first_axis_direction(plane);
569 side->dir2 = Box3D::extract_second_axis_direction(plane);
570 side->front_or_rear = (Box3D::FrontOrRear) (desc & 0x8);
572 /* Set style */
573 box3d_side_apply_style(side);
575 SP_OBJECT(side)->updateRepr(); // calls box3d_side_write() and updates, e.g., the axes string description
576 }
578 box3d_set_z_orders(SP_BOX3D(bc.item));
579 bc.item->updateRepr();
581 // TODO: It would be nice to show the VPs during dragging, but since there is no selection
582 // at this point (only after finishing the box), we must do this "manually"
583 /**** bc._vpdrag->updateDraggers(); ****/
585 sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
586 }
588 g_assert(bc.item);
590 SPBox3D *box = SP_BOX3D(bc.item);
592 box->orig_corner0 = bc.drag_origin_proj;
593 box->orig_corner7 = bc.drag_ptC_proj;
595 box3d_check_for_swapped_coords(box);
597 /* we need to call this from here (instead of from box3d_position_set(), for example)
598 because z-order setting must not interfere with display updates during undo/redo */
599 box3d_set_z_orders (box);
601 box3d_position_set(box);
603 // status text
604 bc._message_context->setF(Inkscape::NORMAL_MESSAGE, _("<b>3D Box</b>; with <b>Shift</b> to extrude along the Z axis"));
605 }
607 static void sp_box3d_finish(Box3DContext *bc)
608 {
609 bc->_message_context->clear();
610 g_assert (SP_ACTIVE_DOCUMENT->current_persp3d);
612 if ( bc->item != NULL ) {
613 SPDesktop * desktop = SP_EVENT_CONTEXT_DESKTOP(bc);
615 SPBox3D *box = SP_BOX3D(bc->item);
617 box->orig_corner0 = bc->drag_origin_proj;
618 box->orig_corner7 = bc->drag_ptC_proj;
620 box->updateRepr();
622 box3d_relabel_corners(box);
624 sp_canvas_end_forced_full_redraws(desktop->canvas);
626 sp_desktop_selection(desktop)->set(bc->item);
627 sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
628 _("Create 3D box"));
630 bc->item = NULL;
631 }
633 bc->ctrl_dragged = false;
634 bc->extruded = false;
635 }
637 void sp_box3d_context_update_lines(SPEventContext *ec) {
638 /* update perspective lines if we are in the 3D box tool (so that infinite ones are shown correctly) */
639 if (SP_IS_BOX3D_CONTEXT (ec)) {
640 Box3DContext *bc = SP_BOX3D_CONTEXT (ec);
641 bc->_vpdrag->updateLines();
642 }
643 }
645 /*
646 Local Variables:
647 mode:c++
648 c-file-style:"stroustrup"
649 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
650 indent-tabs-mode:nil
651 fill-column:99
652 End:
653 */
654 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :