Re: Replacing GTypeInterface instances.



murrayc t-online de (Murray Cumming) writes: 
> *** Similar stuff needed for Interfaces:
> 
> We need to be able to replace the GTypeInterface-derived struct (e.g.
> GtkTreeModelIFace) that was registered in the implementing type (e.g. in
> gtk_tree_store_get_type()) with a derived GTypeInterface instance, or at
> least a different instance of the GTypeInterface struct.
> 
> We will still need to have access to a copy of the original
> GTypeInterface so that we can call the original functions if our C++
> hooks have not been used to override them.
> 
> I'm hoping that you can tell me how this might be done.

It's going to suck. Owen and I discussed it extensively. Unfortunately
we didn't write any of it down. ;-)

IIRC the best solution that was reasonably transparent to C++ users
involved dynamically generating proxy classes for C++ classes based on
RTTI on the C++ class. i.e. you keep a hash from list of interfaces
implemented to proxy class, and you yank the right proxy out of your
hash on object construction. Or something. I never actually tried to
implement it...

You might be better off just requiring C++ users to put in some funky
boilerplate, instead of trying to do it magically.

Havoc



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