[comp.windows.x] Interception of X-Windows drawing commands

gil@jtsv16.UUCP (gil) (08/01/89)

This question is regarding the interception of X-windows text drawing
commands within a window.

First, a little background:

We are using several third-party terminal emulators on our Sun network
(Honeywell, 3270, VT100) for communication with our mainframes. We
need to write some programs that interface with these terminal
emulators in order to "view" what is in the window. Essentially, we
require to "fake out" the host application to make is think there is a
user at the terminal.

The whole thing looks somewhat like this:




                  ~                ~               ~
                  ~                ~               ~
                  ~ Com A          ~ Com B         ~ Com C
                  ~                ~               ~
                  ~                ~               ~
            +------------+  +------------+  +------------+
            | "listener" |  | "listener" |  | "listener" |
            |  +------+  |  |  +------+  |  |  +------+  |
            |  | T.E. |  |  |  | T.E. |  |  |  | T.E. |  |
            |  |  1   |  |  |  |  2   |  |  |  |  n   |  |
            |  +------+  |  |  +------+  |  |  +------+  |
            |            |  |            |  |            |
            +-----+------+  +-----+------+  +-----+------+
                  |               |               |
                  +---------------+---------------+
                                  |
                        +-------------------+
                        | LOCAL APPLICATION |
                        |     PROGRAM       |
                        +-------------------+

The ideal implementation would be some sort of "listener" window that
would get a copy of the text drawing commands that usually go to the
terminal emulator window (i.e. draw-text-at(coord, string)) and pass
that along to the local application which would keep track of the
terminal emulator window contents. This would in effect be a
mini-emulator with only one protocol to understand (X-windows
protocol).

The second alternative would be to use a programmatic interface to the
terminal emulators to do the sending/receiving of the data streams.
This, however, would mean that we have to program each of the
protocols that we wish to emulate (not as acceptable in terms of
development and maintenance).

Does anybody know whether it is possible to intercept X-Windows
commands that go to another window? If so, how is it done?

We would appreciate any comments.


	Sincerely,

	G. Hauer

mlm@calmasd.Prime.COM (Monte Meals) (08/03/89)

I think the xghost program from Jim Becker jim@athsys.uucp
I think it might do what you want.

Monte