Code

fix include
[inkscape.git] / src / box3d-context.cpp
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)
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;
116     
117     box3d_context->_vpdrag = NULL;
119     new (&box3d_context->sel_changed_connection) sigc::connection();
122 static void sp_box3d_context_dispose(GObject *object)
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);
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)
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     }
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     }
187 static void sp_box3d_context_setup(SPEventContext *ec)
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());
223 static gint sp_box3d_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event)
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;
248 static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEvent *event)
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;
274             
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             
280             /*  */
281             Geom::Point button_dt(desktop->w2d(button_w));
282             bc->drag_origin = from_2geom(button_dt);
283             bc->drag_ptB = from_2geom(button_dt);
284             bc->drag_ptC = from_2geom(button_dt);
286             /* Projective preimages of clicked point under current perspective */
287             bc->drag_origin_proj = cur_persp->tmat.preimage (from_2geom(button_dt), 0, Proj::Z);
288             bc->drag_ptB_proj = bc->drag_origin_proj;
289             bc->drag_ptC_proj = bc->drag_origin_proj;
290             bc->drag_ptC_proj.normalize();
291             bc->drag_ptC_proj[Proj::Z] = 0.25;
293             /* Snap center */
294             SnapManager &m = desktop->namedview->snap_manager;
295             m.setup(desktop, true, bc->item);
296             m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, button_dt);
297             bc->center = from_2geom(button_dt);
299             sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
300                                 ( GDK_KEY_PRESS_MASK |
301                                   GDK_BUTTON_RELEASE_MASK       |
302                                   GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK       |
303                                   GDK_BUTTON_PRESS_MASK ),
304                                 NULL, event->button.time);
305             ret = TRUE;
306         }
307         break;
308     case GDK_MOTION_NOTIFY:
309         if ( dragging
310              && ( event->motion.state & GDK_BUTTON1_MASK )  && !event_context->space_panning)
311         {
312             if ( event_context->within_tolerance
313                  && ( abs( (gint) event->motion.x - event_context->xp ) < event_context->tolerance )
314                  && ( abs( (gint) event->motion.y - event_context->yp ) < event_context->tolerance ) ) {
315                 break; // do not drag if we're within tolerance from origin
316             }
317             // Once the user has moved farther than tolerance from the original location
318             // (indicating they intend to draw, not click), then always process the
319             // motion notify coordinates as given (no snapping back to origin)
320             event_context->within_tolerance = false;
322             Geom::Point const motion_w(event->motion.x,
323                                        event->motion.y);
324             Geom::Point motion_dt(desktop->w2d(motion_w));
326             SnapManager &m = desktop->namedview->snap_manager;
327             m.setup(desktop, true, bc->item);
328             m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, motion_dt);
330             bc->ctrl_dragged  = event->motion.state & GDK_CONTROL_MASK;
332             if (event->motion.state & GDK_SHIFT_MASK && !bc->extruded && bc->item) {
333                 // once shift is pressed, set bc->extruded
334                 bc->extruded = true;
335             }
337             if (!bc->extruded) {
338                 bc->drag_ptB = from_2geom(motion_dt);
339                 bc->drag_ptC = from_2geom(motion_dt);
341                 bc->drag_ptB_proj = cur_persp->tmat.preimage (from_2geom(motion_dt), 0, Proj::Z);
342                 bc->drag_ptC_proj = bc->drag_ptB_proj;
343                 bc->drag_ptC_proj.normalize();
344                 bc->drag_ptC_proj[Proj::Z] = 0.25;
345             } else {
346                 // Without Ctrl, motion of the extruded corner is constrained to the
347                 // perspective line from drag_ptB to vanishing point Y.
348                 if (!bc->ctrl_dragged) {
349                     /* snapping */
350                     Box3D::PerspectiveLine pline (bc->drag_ptB, Proj::Z, SP_ACTIVE_DOCUMENT->current_persp3d);
351                     bc->drag_ptC = pline.closest_to (from_2geom(motion_dt));
353                     bc->drag_ptB_proj.normalize();
354                     bc->drag_ptC_proj = cur_persp->tmat.preimage (bc->drag_ptC, bc->drag_ptB_proj[Proj::X], Proj::X);
355                 } else {
356                     bc->drag_ptC = from_2geom(motion_dt);
358                     bc->drag_ptB_proj.normalize();
359                     bc->drag_ptC_proj = cur_persp->tmat.preimage (from_2geom(motion_dt), bc->drag_ptB_proj[Proj::X], Proj::X);
360                 }
361                 Geom::Point pt2g = to_2geom(bc->drag_ptC);
362                 m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, pt2g);
363                 bc->drag_ptC = from_2geom(pt2g);
364             }
366             sp_box3d_drag(*bc, event->motion.state);
368             ret = TRUE;
369         }
370         break;
371     case GDK_BUTTON_RELEASE:
372         event_context->xp = event_context->yp = 0;
373         if ( event->button.button == 1  && !event_context->space_panning) {
374             dragging = false;
376             if (!event_context->within_tolerance) {
377                 // we've been dragging, finish the box
378                 sp_box3d_finish(bc);
379             } else if (event_context->item_to_select) {
380                 // no dragging, select clicked item if any
381                 if (event->button.state & GDK_SHIFT_MASK) {
382                     selection->toggle(event_context->item_to_select);
383                 } else {
384                     selection->set(event_context->item_to_select);
385                 }
386             } else {
387                 // click in an empty space
388                 selection->clear();
389             }
391             event_context->item_to_select = NULL;
392             ret = TRUE;
393             sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate),
394                                   event->button.time);
395         }
396         break;
397     case GDK_KEY_PRESS:
398         switch (get_group0_keyval (&event->key)) {
399         case GDK_Up:
400         case GDK_Down:
401         case GDK_KP_Up:
402         case GDK_KP_Down:
403             // prevent the zoom field from activation
404             if (!MOD__CTRL_ONLY)
405                 ret = TRUE;
406             break;
408         case GDK_bracketright:
409             persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::X, -180/snaps, MOD__ALT);
410             sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
411                              _("Change perspective (angle of PLs)"));
412             ret = true;
413             break;
415         case GDK_bracketleft:
416             persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::X, 180/snaps, MOD__ALT);
417             sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
418                              _("Change perspective (angle of PLs)"));
419             ret = true;
420             break;
422         case GDK_parenright:
423             persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::Y, -180/snaps, MOD__ALT);
424             sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
425                              _("Change perspective (angle of PLs)"));
426             ret = true;
427             break;
429         case GDK_parenleft:
430             persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::Y, 180/snaps, MOD__ALT);
431             sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
432                              _("Change perspective (angle of PLs)"));
433             ret = true;
434             break;
436         case GDK_braceright:
437             persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::Z, -180/snaps, MOD__ALT);
438             sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
439                              _("Change perspective (angle of PLs)"));
440             ret = true;
441             break;
443         case GDK_braceleft:
444             persp3d_rotate_VP (inkscape_active_document()->current_persp3d, Proj::Z, 180/snaps, MOD__ALT);
445             sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
446                              _("Change perspective (angle of PLs)"));
447             ret = true;
448             break;
450         case GDK_O:
451             if (MOD__CTRL && MOD__SHIFT) {
452                 Box3D::create_canvas_point(persp3d_get_VP(inkscape_active_document()->current_persp3d, Proj::W).affine(),
453                                            6, 0xff00ff00);
454             }
455             ret = true;
456             break;
458         case GDK_g:
459         case GDK_G:
460             if (MOD__SHIFT_ONLY) {
461                 sp_selection_to_guides(desktop);
462                 ret = true;
463             }
464             break;
466         case GDK_x:
467         case GDK_X:
468             if (MOD__ALT_ONLY) {
469                 desktop->setToolboxFocusTo ("altx-box3d");
470                 ret = TRUE;
471             }
472             if (MOD__SHIFT_ONLY) {
473                 persp3d_toggle_VPs(selection->perspList(), Proj::X);
474                 bc->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically?
475                 ret = true;
476             }
477             break;
479         case GDK_y:
480         case GDK_Y:
481             if (MOD__SHIFT_ONLY) {
482                 persp3d_toggle_VPs(selection->perspList(), Proj::Y);
483                 bc->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically?
484                 ret = true;
485             }
486             break;
488         case GDK_z:
489         case GDK_Z:
490             if (MOD__SHIFT_ONLY) {
491                 persp3d_toggle_VPs(selection->perspList(), Proj::Z);
492                 bc->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically?
493                 ret = true;
494             }
495             break;
497         case GDK_Escape:
498             sp_desktop_selection(desktop)->clear();
499             //TODO: make dragging escapable by Esc
500             break;
502         case GDK_space:
503             if (dragging) {
504                 sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate),
505                                       event->button.time);
506                 dragging = false;
507                 if (!event_context->within_tolerance) {
508                     // we've been dragging, finish the box
509                     sp_box3d_finish(bc);
510                 }
511                 // do not return true, so that space would work switching to selector
512             }
513             break;
515         default:
516             break;
517         }
518         break;
519     default:
520         break;
521     }
523     if (!ret) {
524         if (((SPEventContextClass *) parent_class)->root_handler) {
525             ret = ((SPEventContextClass *) parent_class)->root_handler(event_context, event);
526         }
527     }
529     return ret;
532 static void sp_box3d_drag(Box3DContext &bc, guint /*state*/)
534     SPDesktop *desktop = SP_EVENT_CONTEXT(&bc)->desktop;
536     if (!bc.item) {
538         if (Inkscape::have_viable_layer(desktop, bc._message_context) == false) {
539             return;
540         }
542         /* Create object */
543         Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&bc));
544         Inkscape::XML::Node *repr = xml_doc->createElement("svg:g");
545         repr->setAttribute("sodipodi:type", "inkscape:box3d");
547         /* Set style */
548         sp_desktop_apply_style_tool (desktop, repr, "/tools/shapes/3dbox", false);
550         bc.item = (SPItem *) desktop->currentLayer()->appendChildRepr(repr);
551         Inkscape::GC::release(repr);
552         Inkscape::XML::Node *repr_side;
553         // TODO: Incorporate this in box3d-side.cpp!
554         for (int i = 0; i < 6; ++i) {
555             repr_side = xml_doc->createElement("svg:path");
556             repr_side->setAttribute("sodipodi:type", "inkscape:box3dside");
557             repr->addChild(repr_side, NULL);
559             Box3DSide *side = SP_BOX3D_SIDE(inkscape_active_document()->getObjectByRepr (repr_side));
561             guint desc = Box3D::int_to_face(i);
563             Box3D::Axis plane = (Box3D::Axis) (desc & 0x7);
564             plane = (Box3D::is_plane(plane) ? plane : Box3D::orth_plane_or_axis(plane));
565             side->dir1 = Box3D::extract_first_axis_direction(plane);
566             side->dir2 = Box3D::extract_second_axis_direction(plane);
567             side->front_or_rear = (Box3D::FrontOrRear) (desc & 0x8);
569             /* Set style */
570             box3d_side_apply_style(side);
572             SP_OBJECT(side)->updateRepr(); // calls box3d_side_write() and updates, e.g., the axes string description
573         }
575         box3d_set_z_orders(SP_BOX3D(bc.item));
576         bc.item->updateRepr();
578         // TODO: It would be nice to show the VPs during dragging, but since there is no selection
579         //       at this point (only after finishing the box), we must do this "manually"
580         /**** bc._vpdrag->updateDraggers(); ****/
582         sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
583     }
585     g_assert(bc.item);
587     SPBox3D *box = SP_BOX3D(bc.item);
589     box->orig_corner0 = bc.drag_origin_proj;
590     box->orig_corner7 = bc.drag_ptC_proj;
592     box3d_check_for_swapped_coords(box);
594     /* we need to call this from here (instead of from box3d_position_set(), for example)
595        because z-order setting must not interfere with display updates during undo/redo */
596     box3d_set_z_orders (box);
598     box3d_position_set(box);
600     // status text
601     bc._message_context->setF(Inkscape::NORMAL_MESSAGE, _("<b>3D Box</b>; with <b>Shift</b> to extrude along the Z axis"));
604 static void sp_box3d_finish(Box3DContext *bc)
606     bc->_message_context->clear();
607     g_assert (SP_ACTIVE_DOCUMENT->current_persp3d);
609     if ( bc->item != NULL ) {
610         SPDesktop * desktop = SP_EVENT_CONTEXT_DESKTOP(bc);
612         SPBox3D *box = SP_BOX3D(bc->item);
614         box->orig_corner0 = bc->drag_origin_proj;
615         box->orig_corner7 = bc->drag_ptC_proj;
617         box->updateRepr();
619         box3d_relabel_corners(box);
621         sp_canvas_end_forced_full_redraws(desktop->canvas);
623         sp_desktop_selection(desktop)->set(bc->item);
624         sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
625                          _("Create 3D box"));
627         bc->item = NULL;
628     }
630     bc->ctrl_dragged = false;
631     bc->extruded = false;
634 void sp_box3d_context_update_lines(SPEventContext *ec) {
635     /*  update perspective lines if we are in the 3D box tool (so that infinite ones are shown correctly) */
636     if (SP_IS_BOX3D_CONTEXT (ec)) {
637         Box3DContext *bc = SP_BOX3D_CONTEXT (ec);
638         bc->_vpdrag->updateLines();
639     }
642 /*
643   Local Variables:
644   mode:c++
645   c-file-style:"stroustrup"
646   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
647   indent-tabs-mode:nil
648   fill-column:99
649   End:
650 */
651 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :