> Well I thought this had been fixed, and maybe it has in some
> way I'm not able to fathom:
> 
> What is the right way to get an extension's generic-stubs to 
> load _before_ the extension's target specific sublib so the
> functions can be overloaded?
> 
> (And, why do all the targets' getapi functions load it afterwards?)

This is a chicken/egg problem.

The target lib needs to be loaded first, because it contains setmode, and
thus can figure out what libs should be loaded at all after a setmode.
Moreover it might want to run extra setup code, especially in an extension.

For now we had solved the case where this leads to a conflict (i.e. where
target specific stuff overloads stubs) by either explicitly overloading in
the setmode call after the targets were all loaded, or by using a special
rendering lib like display-kgi, which will tunnel the commands back to the
target code.

IMHO that's a bit of a hack, and we should set it right.

The problem is: The display lib might need to load first (as it will need to
set up stuff required by later rendering libs, like providing a kgicommand-
pointer to the kgi renderer) as well as last to overload functions provided
by the lower renderers.

One possibility to solve it would be to always load a default-$targetname
module by convention at the end of the rendering chain or maybe in a
suitable place near the end (the target might want to add more fine grained
overrides, like in: default-X, default-XF86DGAisthere ).

I think this would be a nice and clean solution which as well doesn't break
anything.

That is: If you need to override drawing functions, you just write both the
target code which is there for setting up modes and such and a renderer for
it, which is there for drawing. They can communicate via the ->priv
mechanism that is used for similar tasks anyway.

That might as well clean up some of the more messy targets.

All that would be needed would be relatively slight changes to the way the
API-list is built.

Comments welcome.

CU, Andy

-- 
= Andreas Beck                    |  Email :  <[EMAIL PROTECTED]>        =

Reply via email to