Re: [Tuxpaint-devel] Magic API updated: switchin() and switchout()
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Bill K. <nb...@so...> - 2008-07-09 00:35:36
|
I understand the jist, but could you give me an example chunk of code (within a Magic tool) where this is used, so I can make sure I do it properly? (I don't want to forget to do this, which I will in a matter of days :^/ ) -bill! On Tue, Jul 08, 2008 at 04:48:24AM -0400, Albert Cahalan wrote: > On Mon, Jul 7, 2008 at 9:57 PM, Bill Kendrick <nb...@so...> wrote: > > > > Magic Tools now receive calls to "switchin()" and "switchout()" functions > > to tell them when they are being activated and deactivated. > > > > Currently, deactivation includes when temporary events happen, > > such as the user clicking Undo or Redo (or hitting Ctrl-Z, etc.), > > Quick, before this feature gets abused, add this: > > Each history level should have a void* that can be > filled in by a tool, and a void(fn*)(void*,etc) that gets > called when the history level is destroyed. This would > allow tool-private data. > > For example, suppose I paint with bricks. At long as > the top-most history level is the bricks tool, I want to > keep using the same old brick connectivity map. When > the user draws with something else, I need a fresh map. > If the user reverts via undo however, I want my old map. > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Tuxpaint-devel mailing list > Tux...@li... > https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel -- -bill! "Tux Paint" - free children's drawing software for Windows / Mac OS X / Linux! Download it today! http://www.tuxpaint.org/ |