[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Graphics questions +
- To: info-mcl@ministry.cambridge.apple.com
- Subject: Graphics questions +
- From: Andrew Newell Mickish <am2q+@andrew.cmu.edu>
- Date: Fri, 14 Jan 1994 16:17:07 -0500
- Newsgroups: comp.lang.lisp.mcl
- Organization: School of Computer Science, Carnegie Mellon, Pittsburgh, PA
Dear MCL users,
I have collected a list of outstanding problems I'm having while transferring
my application from X windows to the Mac. The focus of my current work is to
create a graphics module that abstracts away differences between the X and Mac
interface, so that users of my system can write one piece of code that looks
the same on both platforms.
I spent a lot of time last week trying to figure out colors on the Mac, before
being informed by 50 people that all I needed to do was to set my windows'
:color-p slot to T. That question was certainly a candidate for a FAQ sheet.
Does a FAQ sheet exist for this newsgroup? I submit the following questions
as additional entries, and I would appreciate it if anyone could lend me their
insight about these problems. Thanks!
1) How do you make stippled (grayed-out) text? The ccl:*gray-pattern*, etc.,
patterns are documented along with fonts in Chapter 3 of the MCL manual,
but ccl:set-pen-pattern does not seem to affect text (I am using the
function ccl:grafport-write-string to draw text, which seems to be the only
string output function that draws in color).
2) All of the documentation for drawing text recommends that the Src modes
be used for text, instead of the Pat modes. What is the reason for this?
So far, the Pat modes seem to work OK. The Inside Macintosh documentation
on transfer modes seems to indicate that srcCopy = patCopy, etc.
3) Should I call ccl:dispose-record on dead MACPTRs, or is that redundant?
4) My event processing seems to get killed occasionally. I noticed in my
list of restart actions that I sometimes have the option to "abort event
processing", but I never select it. Assuming that it actually does get
aborted, how do I restart it?
5) The MCL manual says that the color you get when you draw with the XOR mode
is undefined. With X windows, two colors XOR'ed together also gave an
unpredictable result, but at least we got the original color back when it
was XOR'ed with white. Is there a hack I can use such that if I XOR a
color over a white background, I will get the original color back?
6) In X, we determined that it took so long to change attributes of the
display (line thicknesses, etc.) that it was more efficient to set up our
own data structures to maintain a copy of the graphics state. This way,
we could check our copy of the state and find out what the current line
thickness was, to see if it was what we wanted, before spending all the time
it took to change the line thickness. Is this approach warranted in MCL,
or are functions like ccl:set-pen-thickness optimized sufficiently?
7) Is there an MCL function equivalent to xlib:drawable-id, which returns the
unique number identifying the Mac window? For example, given
#<MAC-DRAWABLE "Opal 4" #x3F3BA1>, I want a function that returns #x3F3BA1.
8) The coordinate system is apparently different for mouse-down and mouse-up
events. Why is the (x,y) of *current-event* given in screen coordinates
when inside by the window-mouse-up-event-handler, but in window coordinates
when inside by view-click-event-handler? Could I use different methods for
more homogenaiety?
9) What effect does RAM have on MCL performance? I currently have 8Mb on my
Mac IIx, and increasing the claimed memory of MCL (via cmd-i) seems to
improve its performance. Would more RAM help even more?
10) While developing my application, I frequently need to quit my lisp
listener and load my files from scratch. However, this also kills all
the FRED windows that I have brought up during my session. Is there
any way to spawn a new lisp process without dumping my FRED windows?
--Andrew Mickish
amickish@cs.cmu.edu