|
From: <jc...@fe...> - 2002-07-26 05:02:46
|
On Thursday 25 July 2002 21:37, Alan W. Irwin wrote:
=2E..
| Now for the big news. I split xwin.c into xwin.c and
| xwin_common.c, put xwin_common.c into libpltcl (no name change yet),
| and removing the special driver treatment of xwin that I had before.
| All these changes seem to work well on Linux --enable-dyndrivers.
|
| For example, repeating Joao's bash command:
|
| for i in nm -p libpltcld.so | fgrep " U "| awk '{print $2}'; do nm
| -p drivers/xwind_drv.so | fgrep $i | fgrep " T "; done
|
| now has no result.
|
| Note I am still using the old linking model of a long chain of
| library dependencies so that libplplot pulls in everything else.=20
| But that only works on Linux so I intend to change this along the
| lines I mentioned.
|
| Note there are 7 functions in xwin_common.c which are two more than
| the 5 I found via visual inspection. But the additions are not very
| long so I think it is a good solution. Also, there was some trouble
| with plplot_ccmap, but I resolved that (probably in a clumsy way) by
| defining it statically in plxwd.h, and dropping the extern from
| plframe, and dropping the definition from xwin.c.
|
| So far I have done only extremely superficial testing of x01c -dev
| tk and wish in plplot/tmp, but they work fine so I urge everybody
| else to give this a try.
|
| If everybody is happy with this splitting, the next step is to do
| exactly the same to tkwin.c.
|
| Alan
I agree with the splitting of the xwin into another auxiliary driver to=20
be used by xwin_drv and tk_drv. That is the obvious solution, other=20
than just replicate the needed code into tk_drv.
But I disagree in putting the common parts in libpltcl.
Let's see, the tk driver is a driver that uses infrastructures from the=20
tcl/tk bindings and also happens to use the xwin driver; this last=20
ocurrence is an accident. Let us supose that the tk driver did'nt need=20
the xwin driver (1). But it needs the tcl/tk bindings infrastructure.=20
How should you design it? In my view, creating a library with the=20
tcl/tk infrastructure, libtcltk, and the driver itself, tk_drv. The tk=20
driver would need to be linked with the tcl/tk and xwin libraries, as=20
other drivers do (and also to libtcltk, more on this latter).
This is similar to what happens with other drivers. Of course all=20
drivers depends on libplplot.
Now about the bindings. Bindings require a library that the user=20
program must be linked with (and with libplplot also). That's why=20
there is a libcxx and should exist a libf77. This is for compiled=20
languages, as for interpreted languages one generaly has run time=20
loading, such as plplot_octave.oct for Octave and plmodule.so for=20
Python.
And for mixed drivers/bindings? Lets take the incomplete gnome driver.=20
It already has a driver, but gnome users would like to have a library,=20
say libplgnome, to link theirs programs with. This is an hipotetical=20
example.
Now, finally, following the above "philosophy", the tk driver/bindings=20
should have a library that users programs links with, and a driver,=20
that could need to be linked with that library. Examples of tk user=20
programs are plserver, pltcl, plrender, etc. Thus they should need to=20
be linked with libtcltk. The tcl/tk bindings also has another library,=20
libtclmatrix, that is needed by the bindings but that was considered=20
to be of general usage, and as such was keept in a separated library. =20
The driver itself could be linked, or not, with libtcltk (but it=20
needs). Ideally, if some functions in libpltcltk are only needed by=20
the driver, than they should not go into libpltcltk, but make part of=20
the driver (a multi-file driver), but this would be too complicated by=20
now.
The fact that tk_drv *needs* , by design, xwin_drv, is no obstacle to=20
this reasoning.
So, to finish this rather long talk, how do I see that the problem=20
should be solved? a libtcltk library in the tmp directory, and a=20
tk_drv, a xwin_drv, and a tkxwin_drv, all in the drivers subdirectory.=20
In plD_init_tk() and plD_init_xw(), the tkxwin_drv file would be=20
dlopened to provide the common funcionalities. Not in a library!
Unfortunatelly I don't have the time to further work (talk would be=20
more correct) on this.
I will reply to the other e-mails tomorrow.
Jo=E3o
|