[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: UrShape definition Part I



Le mer, jun 27, 2001, à 06:17:45 +0200, Andre Kloss a écrit:

> > Could someone give a brief overview of what the ObjectOps and ObjectType
> > stuff do?  Is this still used or is it depricated in the StdProps code?
> Well, I don't know. I just found it in the source and it looked
> reasonable to me. Cyrille? James? Someone?

None of this is really deprecated ; some methods are replaced, in StdProp
objects, by standard handlers provided by the stdprop library.

This is somewhat of a mess now, but it's also the way to integrate into the
dia core without it really knowing the UrShapes are special (which it
shouldn't, until the UrShape code is considered "core" like stdprop now is).

Basically, ObjectOps is a pointer to the class' vtable (or interface method
pointer table), and ObjectTypeOps can be viewed as the class factory's
interface vtable (with ObjectType being a class descriptor bundled with a
pointer to the default icon xbm [in case it's not overridden in the sheet]).

I'm not really sure every instance of every UrShape really needs a pointer
to the ObjectTypeOps structure ; there's already a pointer to it in the
ObjectType structure (which is pointed to in Object). OTOH, every UrShape 
(if UrShape are really seen as objects by the core) should have at least 
an Object as their first member (usually named obj if it's an Object, elem 
if it's an Element, and so on). Object already provides a number of minimum 
things the core expects from an object, in the format it expects ; see 
lib/object.h for reference. Of course this "first member" and "cast frenzy"
thingy is just an excuse for the lack of proper inheritance in C.

   -- Cyrille

-- 
Grumpf.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK