stevem@ibmpcug.co.uk (Steve Marsden) (09/01/90)
Greetings! I am currently investigating the use of PostScript as a standard vehicle for a business graphics application running under AIX 3.1 on the RS/6000 series. Specifically, I'm looking at using the AIXwindows Display PostScript (DPS) for the graphics display and manipulation within a Motif application framework. The intention would be to also use PostScript as the hard-copy intermediate language, and to export Encapsulated PostScript for use by other applications. So far, I have done some prototyping of a simple application, using the Motif toolkit to build menus etc, and having a main DrawingArea widget, into whose window the DPS is drawn. Most of the stuff I want to do is okay, but I have now got some questions that I hope someone out there will be able to help me with. 1) Dynamic drawing In the past, when I have wanted to do a dynamic dragging operation, I have used XOR mode graphics to draw the object being dragged over the background, and then undraw it again, leaving the background as it was. As far as I can tell, this is not possible using DPS, as it adheres to the opaque painting model. How do I do this kind of operation using DPS? If I can't do it using DPS, do I resort to Xlib for this case, drawing into the same window with an XOR GContext? 2) Expose/Redraw What I would really like is for the picture in my window to be redrawn when the window gets exposed, without requiring the intervention of my application. Is there any way I can do this? 3) Input Correlation When the user wishes to select an object from the window display, my application has to determine which object it is that coincides with the point selected. It seems from the documentation that the inufill/inustroke etc operators should be used to do this - is this the case? 4) PostScript language output I am currently using the DPS client library to do my DPS output. Is there a way to get hold of the PostScript language text that is equivalent to the series of client library function calls that I'm doing? To explain further, take a simple piece of code that does this: DPSmoveto(ctxt, 100.0, 200.0); DPSlineto(ctxt, 500.0, 500.0); DPSstroke(ctxt); is there any way to re-execute this code and capture a set of PostScript operators in string form, such as: 100.0 200.0 moveto 500.0 500.0 lineto stroke which I could then send to a PostScript printer? Thanks in advance for your help. Steve Marsden - really working for Logica UK Ltd, London, England. -- Automatic Disclaimer: The views expressed above are those of the author alone and may not represent the views of the IBM PC User Group. --
kent@decwrl.dec.com (Christopher A. Kent) (09/02/90)
If you're doing any sort of color work, you probably don't want to use XOR for what you're doing. The most straightforward thing to do is do all your painting into a pixmap, not into the DrawingArea widget. The use XCOpyArea to copy the pixmap (probably just the affected area) to the window. You can keep as many generations of pixmap as you want (or as the server lets you). Having a backing pixmap also makes exposure handling very easy. (Using backing store is an alternative, but I don't know if the IBM server provides it.) To get a text copy of the output to your context, create a text context. That's what they're for. Depending on how your program is set up, either just re-traverse your database, generating DPS calls into the text context, or chain a text context to your drawing context and capture the PS as you go. chris Chris Kent Western Software Laboratory Digital Equipment Corporation kent@decwrl.dec.com decwrl!kent (415) 853-6639