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: Albert C. <aca...@gm...> - 2008-07-08 08:48:17
|
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. |