On 17 Nov 2000, Marcus Sundberg wrote:

> [EMAIL PROTECTED] (Christoph Egger) writes:
> 
> > Hi!
> > 
> > Patches attached.
> > 
> > Anyone here to commit them into CVS?
> > 
> > diff -uNr 20001115/degas/lib/libggi/extensions/misc/display/X/init.c 
>degas/lib/libggi/extensions/misc/display/X/init.c
> > --- 20001115/degas/lib/libggi/extensions/misc/display/X/init.c      Tue Apr 25 
>07:07:28 2000
> > +++ degas/lib/libggi/extensions/misc/display/X/init.c       Fri Nov 17 13:35:06 
>2000
> > @@ -62,7 +62,7 @@
> >  
> >     me->setsplitline = GGI_x_setsplitline;
> >  
> > -   *dlret = GGI_DL_EXTENSION;
> > +   *dlret = GGI_DL_OPDISPLAY;
> >     return 0;
> >  }
> 
> No, where did you get this idea?

On Tue, 7 Nov 2000, Jon M. Taylor wrote to me in a PM:
-------------------------------------------------------------------------
> I hacked libxmi since two days.
> The demos runs without segfaults.

        MUCH better!  I too got it to run without segfaults, and the X
target code looks OK.  Nice job!

> But I couldn't test the X-target yet, because the GGIopen() of the
> default-stubs-target overwrites the function-pointers of the X-target.

        Display-targets are always loaded first, so what you must do is to
hook your own setmode() function in the X display target, which in turn
hooks its own getapi() function.  _These_ function hooks will NOT be
replaced by the stubs code.  Thus, the X target will load, and then the
stubs target will load afterwards (as it does now) *at extension init
time*, but then when a mode is set, your X-target setmode() and getapi()
functions will be called, and will then replace the drawing functions with
its own.  This is necessary, because the display target might have to
re-load some default targets whenever the mode changes.  You should not be
hooking the _drawing_ functions (vis->opdraw) in GGIopen(), only the
_display_ functions (vis->opdisplay).

[...]

> I did the hack in the X-target as you said.
> The XMI_X_getapi() is called, but not the XMI_X_setmode() one.
> I don't know why. Maybe I got you wrong in some aspects you gave?
>
> Patch is attached. Please have a look at it and give me feedback.

        The problem is that your GGIopen() function is returning
GGI_DL_EXTENSION, when it should be returning GGI_DL_OPDISPLAY.  This
return type tells GGI what type of library it is, so it knows what actions
to take.  The X-target is a display target, not an extension.

-------------------------------------------------------------------------


> GGI_DL_EXTENSION is correct.

In the misc extension or in the libedemo?



Christoph Egger
E-Mail: [EMAIL PROTECTED]




Reply via email to