comparison mde/setup/InitStage.d @ 95:2a364c7d82c9

Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes. Fixed a minor bug where layouts with the same id but without shared alignments would be messed up. Tracked down the "nothing trawn until a resize" bug (see jobs.txt). If widgets throw during creation they're now replaced by debug widgets. Function pointers are converted to delegates using a safer method.
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 06 Nov 2008 11:07:18 +0000
parents 4d5d53e4f881
children 1655693702fc
comparison
equal deleted inserted replaced
94:9520cc0448e5 95:2a364c7d82c9
17 * The infrastructure for handling external startup/shutdown code. 17 * The infrastructure for handling external startup/shutdown code.
18 *************************************************************************************************/ 18 *************************************************************************************************/
19 module mde.setup.InitStage; 19 module mde.setup.InitStage;
20 20
21 public import mde.setup.exception; 21 public import mde.setup.exception;
22 import mde.util;
23
22 import tango.util.container.HashMap; 24 import tango.util.container.HashMap;
23 import tango.util.log.Log : Log, Logger; 25 import tango.util.log.Log : Log, Logger;
24 26
25 // use as hash type for better performance than char[] 27 // use as hash type for better performance than char[]
26 alias uint StageName; 28 alias uint StageName;
53 stage.name = name; 55 stage.name = name;
54 stages[toStageName(name)] = stage; 56 stages[toStageName(name)] = stage;
55 } 57 }
56 /// Add a stage to be initialized. 58 /// Add a stage to be initialized.
57 void addInitStage (char[4] name, StageState function() init, StageState function() cleanup = null, char[4][] depends = null) { 59 void addInitStage (char[4] name, StageState function() init, StageState function() cleanup = null, char[4][] depends = null) {
58 StageState delegate() i,c; 60 addInitStage (name, toDg(init), toDg(cleanup), depends);
59 i.funcptr = init;
60 c.funcptr = cleanup;
61 addInitStage (name, i, c, depends);
62 } 61 }
63 /// Add a stage to be initialized. 62 /// Add a stage to be initialized.
64 void addInitStage (char[4] name, StageState delegate() init, StageState delegate() cleanup = null, char[4][] depends = null) { 63 void addInitStage (char[4] name, StageState delegate() init, StageState delegate() cleanup = null, char[4][] depends = null) {
65 InitStage* stage = new InitStage; 64 InitStage* stage = new InitStage;
66 stage.name = name; 65 stage.name = name;