diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2008-03-22 18:29:40 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2008-03-22 18:29:40 +0000 |
| commit | 454a66aa12442146b02bda954fee3ff1077fc238 (patch) | |
| tree | 21dfaabd2c739e7c880fb55ac0ac017ec5617e22 /src/display/snap-indicator.cpp | |
| parent | Removed Win32 keep-dialogs-on-top preference, now set permanently to true (diff) | |
| download | inkscape-454a66aa12442146b02bda954fee3ff1077fc238.tar.gz inkscape-454a66aa12442146b02bda954fee3ff1077fc238.zip | |
Line-end fixups
(bzr r5161)
Diffstat (limited to 'src/display/snap-indicator.cpp')
| -rw-r--r-- | src/display/snap-indicator.cpp | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp index b6046e88c..f5e754d90 100644 --- a/src/display/snap-indicator.cpp +++ b/src/display/snap-indicator.cpp @@ -1,78 +1,78 @@ -/** \file
- * Provides a class that shows a temporary indicator on the canvas of where the snap was, and what kind of snap
- *
- * Authors:
- * Johan Engelen
- *
- * Copyright (C) Johan Engelen 2008 <j.b.c.engelen@utwente.nl>
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#include "display/snap-indicator.h"
-
-#include "desktop.h"
-#include "desktop-handles.h"
-#include "display/sodipodi-ctrl.h"
-#include "knot.h"
-
-namespace Inkscape {
-namespace Display {
-
-SnapIndicator::SnapIndicator(SPDesktop * desktop)
- : tempitem(NULL),
- desktop(desktop)
-{
-}
-
-SnapIndicator::~SnapIndicator()
-{
- // remove item that might be present
- remove_snappoint();
-}
-
-void
-SnapIndicator::set_new_snappoint(Geom::Point p)
-{
- remove_snappoint();
-
- bool enabled = false; // TODO add preference for snap indicator.
- if (enabled) {
- // TODO add many different kinds of snap indicator :-)
- SPCanvasItem * canvasitem = sp_canvas_item_new( sp_desktop_tempgroup (desktop),
- SP_TYPE_CTRL,
- "anchor", GTK_ANCHOR_CENTER,
- "size", 10.0,
- "stroked", TRUE,
- "stroke_color", 0xf000f0ff,
- "mode", SP_KNOT_MODE_XOR,
- "shape", SP_KNOT_SHAPE_CROSS,
- NULL );
- SP_CTRL(canvasitem)->moveto ( p );
- tempitem = desktop->add_temporary_canvasitem(canvasitem, 1000); // TODO add preference for snap indicator timeout
- }
-}
-
-void
-SnapIndicator::remove_snappoint()
-{
- if (tempitem) {
- desktop->remove_temporary_canvasitem(tempitem);
- tempitem = NULL;
- }
-}
-
-
-} //namespace Display
-} /* namespace Inkscape */
-
-/*
- Local Variables:
- mode:c++
- c-file-style:"stroustrup"
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
- indent-tabs-mode:nil
- fill-column:99
- End:
-*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
+/** \file + * Provides a class that shows a temporary indicator on the canvas of where the snap was, and what kind of snap + * + * Authors: + * Johan Engelen + * + * Copyright (C) Johan Engelen 2008 <j.b.c.engelen@utwente.nl> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "display/snap-indicator.h" + +#include "desktop.h" +#include "desktop-handles.h" +#include "display/sodipodi-ctrl.h" +#include "knot.h" + +namespace Inkscape { +namespace Display { + +SnapIndicator::SnapIndicator(SPDesktop * desktop) + : tempitem(NULL), + desktop(desktop) +{ +} + +SnapIndicator::~SnapIndicator() +{ + // remove item that might be present + remove_snappoint(); +} + +void +SnapIndicator::set_new_snappoint(Geom::Point p) +{ + remove_snappoint(); + + bool enabled = false; // TODO add preference for snap indicator. + if (enabled) { + // TODO add many different kinds of snap indicator :-) + SPCanvasItem * canvasitem = sp_canvas_item_new( sp_desktop_tempgroup (desktop), + SP_TYPE_CTRL, + "anchor", GTK_ANCHOR_CENTER, + "size", 10.0, + "stroked", TRUE, + "stroke_color", 0xf000f0ff, + "mode", SP_KNOT_MODE_XOR, + "shape", SP_KNOT_SHAPE_CROSS, + NULL ); + SP_CTRL(canvasitem)->moveto ( p ); + tempitem = desktop->add_temporary_canvasitem(canvasitem, 1000); // TODO add preference for snap indicator timeout + } +} + +void +SnapIndicator::remove_snappoint() +{ + if (tempitem) { + desktop->remove_temporary_canvasitem(tempitem); + tempitem = NULL; + } +} + + +} //namespace Display +} /* namespace Inkscape */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : |
