This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tcl/Tk Interface Unification (was Re: New Xconq WindowsExecutable)


>Pieces of the X11 Tcl/Tk app are actually built in the x11
>directory rather than the tcltk directory. If we really want to
>be consistent, then we would also need to move the X11 Tcl/Tk
>stuff into the tcltk directory, not just the Win32 Tcl/Tk stuff.

That's right. The tcltk app (xconq) is built in the x11 directory for
purely historical reasons, as well as the sdl app (sdlconq). However,
neither of these apps use any of the x11 code. Nor does the x11 app
(xtconq) use the single source file shared by xconq and sdlconq (xconq.c,
which contains the main function) since it has its own main function in
xtconq.c. So the code is already completely separated between the x11 and
tcltk/sdl interfaces. What remains to do is to untangle it further by
giving each of the latter its own main function file which lives in the
tcltk or sdl directory, respectively, instead of in the x11 directory.

I would suggest doing this in two steps. First, we should copy xconq.c to
the tcltk directory (and rename it to tkunix.c if we want to be really
consistent with how the tcltk mac and win32 source files are named). After
this, it is easy to rearrange the Makefiles so that we have a single
Makefile for the tcltk apps in the tcltk directory. The sdl-specific hacks
such as using_sdl can of course be removed from tkunix.c at this point.

A second step would be to do exactly the same thing with the sdl code, i.e.
copy xconq.c to a new file sdlunix.c in the sdl directory and change the
Makefiles so that sdlconq builds there instead of in the x11 directory.
Once this has been done, the old x11/xconq.c can be retired.

We also have the tcltk app ximfapp. It's main function file, ximfapp.c is
not used by the sdl interface (or by the x11 interface) so in this case we
can just move it to the tcltk directory (and rename it iappunix.c for
consistency). The Makefiles would of course have to be updated, too. The
other utility programs are all true x11 apps and should be left to build in
the x11 directory together with xtconq.

The advantage of these rearrangements are two-fold. First, it will be
easier keep track of what files belong to what interfaces. Second, one
would no longer need hacks supporting several different interfaces within
the same source file, as is now the case for xconq.c. The only disadvantage
is the slight code duplication. However, I think we can live with this. The
entire xconq.c is only 241 lines including the comments.

Hans



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]