> > to use an extension you attach it after opening the visual, it's
> > that simple.
> Is there a way to check if an extension has been added, like you might
> check to see if a pointer is NULL?
No. Don't know if my other mail made it clear. You attach it, use it, detach
it. Nothing bad happens if that happens multiple times.
> Would it help to have subclasses created instead? This could be a bit more
> expressive and allow for compile time type checking.
That makes it difficult to have multiple extensions attached. It can be
solved that way as well, but if you do it like
ggi_3d_visual_t *ggiAttach3d(ggi_visual_t t) {};
you will then need
ggi_3d_wmh_visual_t *ggiAttach3d_to_wmh(ggi_wmh_visual_t t) {}; and
and more strange stuff.
If you want compiletime typechecking, you can fake it relatively easy by
making a few wrappers like
typedef struct vis_with_bla_ext_attached {
ggi_visual_t vis;
} vis_with_bla_ext_attached;
and let the wrappers just dereference and call the original function. I
suppose when you inline it, it shouldn't even generate extra code.
Other than that runtime-typechecking can be built into extensions really
easily.
CU, ANdy
--
= Andreas Beck | Email : <[EMAIL PROTECTED]> =