Hi,

On Fri, 9 May 2008 10:38:54 +0200, Dennis Schridde <[EMAIL PROTECTED]>
wrote:
> Just something I experimented with:
> #define CALL(OBJECT, METHOD) ((OBJECT)->vtable->METHOD)
> CALL(xob, xme)(p1, p2);

Currently the way virtual methods (i.e., those which use the vtable) are
called is exactly the same as that of non-virtual methods:
<className><methodName>, so: wigetSetLayout(...).

This is somewhat useful, as in the virtual method functions (e.g.
widgetDoDraw), which is a pure virtual method, we can ASSERT that
object->vtable->method is NOT NULL. A macro may complicate this somewhat.

It may seem a bit strange, if, in the code we get:
button *btn = buttonCreate(...);
widget *root = widgetGetRoot(WIDGET(btn));
CALL(btn, setLayout)(...);

Regards, Freddie.


_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to