|
From: James W. W. <ja...@wr...> - 2004-06-01 21:24:46
|
Dair Grant <da...@re...> wrote: >The alternative is that we build up a big list of custom elements for >all our additional state, but I can see that getting more and more >unwieldy over time (some state's held in a struct, some is attached to >an object, you don't really know which is where). > >I guess an ideal-looking API for me would be: > >- Version/size-tagged struct to create objects and do batch data get/set > >- A common Q3Object_GetValue/SetValue API to assign tagged values to an >object > > >The two Apple APIs that I've seen work really well have been >CarbonEvents.h and ControlDefinitions.h. Once you have a system in place >to get/set arbitary-sized values by name then extending the API becomes >a lot easier. If we had Q3Object_GetValue/SetValue (which I might prefer to call Q3Object_GetProperty/SetProperty), I'm not sure I see why we would need to modify any structs? The Q3Object_GetValue/SetValue APIs could be implemented using a single custom element. I think that it would be safer and easier to implement it that way, though perhaps a little less efficient at run time. -- James W. Walker, ScriptPerfection Enterprises, Inc. <http://www.write-brain.com/> |