Hi Diederik and others,
First of all, I am very sorry if I broke compile on Linux, please fix what needs to be fixed, I cannot check if it works! (makefile?)
I have just committed a new feature: temporary canvasitems. Now, it is possible to create a canvasitem, and pass it to SPDesktop saying it should be displayed for a certain timelength. When that time has elapsed, the object is automatically deleted.
To make a canvasitem temporary, do this: spdesktop->add_temporary_canvasitem(canvasitem, 2000); This will destroy the canvasitem automatically after 2000 milliseconds. One can also prematurely delete the canvasitem (handy for showing snapping). One should do this: Inkscape::Display::TemporaryItem * tempitem; tempitem = spdesktop->add_temporary_canvasitem(canvasitem, 2000); And then later on to remove the item: spdesktop->remove_temporary_canvasitem(tempitem); It is perfectly safe to call this function even after the 2 seconds have elapsed, because it checks whether the object has already been deleted or not.
In order to demonstrate and test the code, I have enabled the test LPEs, and added a Point parameter to lpe-Stacktest that is briefly flashed on-canvas when you press the edit oncanvas button. Draw a freehand path, apply lpe-'doEffect stack test', then press the edit oncanvas button next to the 'test' parameter; it should show a cross at the location of the parameter oncanvas. I have tested a bit, it *seems* bug-free... :)
Special request to Diederik: Can you use the code from /live_effects/parameter/point.cpp, method param_editOncanvas, to flash the location of a snap ? This was my main motivation for writing all this!
I hope people find other interesting things that can be briefly shown on canvas; like an arrow pointing to the parent object of a clone? :-)
Cheers, Johan