[XForms] Patch: Context Sharing + fdesign (real thing)

Angus Leeming angus.leeming at btopenworld.com
Mon May 17 05:47:39 EDT 2004


On Monday 17 May 2004 10:34 am, Jean-Marc Lasgouttes wrote:
> To subscribers of the xforms list
>
> >>>>> "Angus" == Angus Leeming <angus.leeming at btopenworld.com>
> >>>>> writes:
>
> Angus> However, I think we should resolve the GLCANVAS_H problem
> now.
>
> Angus> I think that header files should be self-contained. Ie
> #include Angus> "foo.h" int main() { return 0; } should compile. If
> it doesn't, Angus> then that's a problem.
>
> Angus> As you say, glcanvas.h contains code like: FL_EXPORT
> GLXContext Angus> fl_get_glcanvas_context(FL_OBJECT *ob); As we
> can't Angus> forward-declare GLXContext, the only permissible
> solution is to Angus> #include <GL/glx.h> in glcanvas.h.
>
> Angus> Thereafter, things should "just work" with my
> Angus> GLCANVAS_H_LOCATION patch.
>
> Angus, I tried to read the thread about this header problem, but I
> do not really understand what the issue is. Could you explain it to
> me?

Yes. 

forms.h is built automatically from the header files in lib/include.

One of these, canvas.h, used to #include glcanvas.h with the block:

#if defined(__GLX_glx_h__) || defined(GLX_H)
#include <X11/glcanvas.h>
#endif

This got removed (13 months ago, by me) because glcanvas.h is now part 
of a separate library, it doesn't get installed in the X11 directory, 
the guard was crappy and liable to break etc, etc.

Unfortunately, doing so breaks Jason's codes. So my solution is to add 
the #include back in, but in a more explicit manner:

#ifdef GLCANVAS_H_LOCATION
#include GLCANVAS_H_LOCATION
#endif

That seems like a reasonable compromise, don't you think?

This is all separate to the 'glcanvas.h should be self-contained' 
problem.

Angus



More information about the Xforms mailing list