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

Jean-Marc Lasgouttes Jean-Marc.Lasgouttes at inria.fr
Mon May 17 06:14:42 EDT 2004


>>>>> "Angus" == Angus Leeming <angus.leeming at btopenworld.com> writes:

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

Yes.

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

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

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

Yes.

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

Angus> #ifdef GLCANVAS_H_LOCATION #include GLCANVAS_H_LOCATION #endif

There are two separate issues:

1/ the easiest one: we need the xxx_LOCATION nonsense because
imake-based build systems tend to put header files in places like
X11/forms.h. This is not the case anymore, so we should assume now
that header files have to be on the search path. Thus a #include
"glcanvas.h" should be enough.

2/ the problem of including glcanvas.h: If we are serious about
separating the gl stuff from the rest, we want people to be able to
use forms.h without any gl stuff installed. I would prefer to make
people include "glcanvas.h" manually, but I agree that we can have a
backdoor for people who do not want to change their code. In this
case, we should probably rely on a HAVE_GLCANVAS_H define, which is
straightforward to define through autoconf, and add code like
#ifdef HAVE_GLCANVAS_H
#include "glcanvas.h"
#endif

However, I think that we should not make this way the preferred way,
because it is a bit unnatural to my eyes.

Do you think it would work correctly?

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

Concerning this later problem, I am not sure we want to enforce it.
Asking people to include forms.h seems rather reasonable to me.

JMarc



More information about the Xforms mailing list