From: Dennis S. <sy...@yo...> - 2004-11-22 22:45:43
|
Some random thoughts on VisObject: Object hierachy: VisObject VisUI VisUI... VisActor VisInput VisPlugin etc Implement Ref counting at VisObject layer. Most important API addition for now: visual_object_ref (VisObject *object); visual_object_unref (VisObject *object); VisObject { int refcount; VisObjectDtorFunc dtor; } Example for a random structure: VisActor { VisObject object; blah; blah; } visual_actor_new () { VisActor *actor = ... VISUAL_OBJECT (actor)->dtor = dtor_actor; } visual_object_unref (obj) { obj->ref-- if (obj->ref <= 0) obj->dtor (obj); } Problems to be solved: How to implement the automatic dtorring. Being able to set a dtor for an object ? This could also exterminate the ugly switches in VisUI that are used for a VisUI object dtoring. Please comment on this :) |