From: rouquett@Aig.Jpl.Nasa.Gov (Nicolas Rouquette)
Subject: Re: ToolTalk, PageView, Filemgr
Reply-To: rouquett@aig.jpl.nasa.gov
Organization: NASA/Jet Propulsion Laboratory
Date: Mon, 7 Sep 1992 17:47:43 GMT

In article <1992Sep6.225229.5472@sq.sq.com>, lee@sq.sq.com (Liam R. E. Quin) writes:
|> km@mathcs.emory.edu writes:
|> > rouquett@Aig.Jpl.Nasa.Gov (Nicolas Rouquette) writes:
|> >>
|> >>With 'strings pageview' I can tell that the program can respond
|> >>to a tooltalk protocol. Does anyone know what message format needs to be
|> >>broadcasted for a pageview to accept it and display a postscript file?
|> 
|> I don't know...

Since then, I fiddled around with ttmon (a point & click interface
to watch and send tt messages), ttsession (in trace mode allows one
to see all the tt traffic in terms of messages sent, matched, delivered...)
and whatever tooltalk demo I could find. Looking at 
${OPENWINHOME}/lib/cetables/cetables.ascii, one can find some useful
information about the classes of messages the sun deskset tools use:

(
        (TYPE_NAME,type-id,<audio-file>)
	(TYPE_OPEN_TT,tt,<audiotool>)
	(TYPE_ICON,icon-file,<$OPENWINHOME/include/images/SunAudio_Alt_glyph.icon>)
	(TYPE_ICON_MASK,icon-file,<$OPENWINHOME/include/images/Generic_Doc_glyph_mask.icon>)
	(TYPE_FILE_TEMPLATE,string,<audio%t.au>)
	(TYPE_COMPRESSION_METHOD, compress-id, <adpcm-compress>)
	(TYPE_OPEN,call,<audiotool $FILE>)
	(TYPE_PRINT,call,<>)
   )


Apparently, this means that whenever this file classification is used by the
filemgr, audio files are sent to the audiotool via tooltalk. Besides the fact
that Sun apparently doesn't document how the deskset tools use tooltalk (and the
classification engine as well) this is not yet sufficient to determine the adequate
tooltalk protocol.

Thanks to the trace mode of ttsession(1) it seems that the TYPE_OPEN_TT line
describes how tooltalk is used. I watched the protocol used for coloredit and tried
to use ttmon to duplicate it for pageview. Apparently, the classing engine recognizes 
'launch' but I coudn't pass the locale, display depth and color type as arguments for
the message to really launch pageview. I also tried to start pageview and send load-like 
messages without success. 

|> 
|> >As it sits, pageview is less flexible than suntroff since it can only
|> >take a file (or a drop) as input.
|> 
I woudn't be surprised if it recognized an undocumented tooltalk message to load a ps file. 

|> You can also do
|> 	programs | that | generate -PostScript | pageview -
|> to get pageview to read stdin.
|> You can't edit the postScript for some reason, but you can still Print.
|> 
|> >What I
|> >really want is an application that brings up a textedit window, with a
|> >button that runs the window contents through a specified pipeline, and
|> >uses tooltalk to bring up (or reuse) a pageview to rasterize the
|> >output. No temp files, no multiple clicks, just one click to update the
|> >preview.
|> 
|> Hmm, the old xvps demo did this for simple PostScript.
|> 
Well, this brings the point that if is really too much pain to find out how
to tooltalk pageview into loading a ps file, the solution may be to embed a simple
tooltalk protocol into a wrapper on xvps or ghostscript. In fact, Sun's better half
had the good idea to include a tooltalk version of textedit (See ${OPENWINHOME}/share/srfc/tooltalk).

|> >If there was a program that would take its stdin, use tooltalk to 
|> >bring up (or reuse) a pageview, triggering the rasterize, you could
|> >approximate this with editor side mapping/macros.
|> >
That's exactly what I'd like to get: a simple shell program that somehow
asks the ps previewer to load a file. That program could be invoked 
as an extra from textedit, an open method for filemgr, or a preview command
for the (la)tex mode of emacs.

|> 
|> The help viewer also takes ToolTalk messages, I think, as that seems to be
|> how AnswerBook controls it.  It might be worth looking at.
|> 
Yep. I haven't looked at it yet.

|> Lee
|> 
|> -- 
|> Liam Quin, lee@sq.com, SoftQuad, Toronto, 416 239-4801; the barefoot programmer
|>   lq-text (Unix text retrieval package) mailing list: lq-text-request@sq.com
|>   latest released version: 1.10; ftp: ftp.cs.toronto.edu in directory: pub
|>   If Adultery is for Adults, is Juvenal for Juveniles?

-- 
----------Nicolas Rouquette----------rouquett@aig.jpl.nasa.gov
    Artificial Intelligence Group
      Jet Propulsion Laboratory