I have reworked what I did yesterday to remove, hopefully all of, the evilness Michael referred to. I have attached a tar file containing zvt_aaccessible.c and zvt_accessible.h. ZvtAccessible is the accessible object for a ZvtTerm. The pooints of interest are 1) zvt_accessible_get_type() which calculates the sizes of the class and instance to be the sizes of class and instance for the accessible object of the parent type of ZvtTerm; these values are not known at compile time but are calculated at run time. 2) zvt_accessible_real_initialize() is ZvtAccessible's implementation of atk_object_initialize; it calls zvt_accessible_get_private_data() to get a pointer to the object's private data. 3) zvt_accessible_private_data() uses GObject data to store the pointer to the object's private data. Padraig > > Hi Padraig, > > On Thu, 2002-01-24 at 11:00, Padraig O'Briain wrote: > > What I have done is put the data you had in the ZvtAccessible structure into a > > new ZvtAccessiblePriv structure and provide a function > > zvt_accessible_get_private_data() which returns a pointer to the > > ZvtAccessiblePriv structure for a ZvtAccessible structure > > > > The code in the _get_type() which calculates the size of the instance data is > > changed, compared to the code in htmlviewaccessible.c, to be the size of the > > instance data for the parent class plus the size of the ZvtAccessiblePriv > > structure. > > I havn't looked at the code; but this sounds just horribly evil, and > "not the done thing" - it is normal to use GObject data for this sort of > thing, instead of something like this - that is unless you need to > override virtual methods or something; even so I'd be inclined to > inherit with the same size instance/class and use the GObject data. > > Really. > > Michael. > > -- > mmeeks gnu org <><, Pseudo Engineer, itinerant idiot > > _______________________________________________ > Gnome-accessibility-devel mailing list > Gnome-accessibility-devel gnome org > http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel
Attachment:
zvtaccessible.tar.gz
Description: zvtaccessible.tar.gz