[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MCL color graphics
- To: email@example.com (Mike Engber)
- Subject: Re: MCL color graphics
- From: firstname.lastname@example.org
- Date: Thu, 23 Jan 92 17:50:39 EST
- Cc: email@example.com
- In-reply-to: Your message of Thu, 23 Jan 92 16:16:14 -0600. <9201232216.AA23534@aristotle.ils.nwu.edu>
- Reply-to: firstname.lastname@example.org
You could just have the sheets share their containing windows pallete.
You could define some paletted methods on sheets that would just operate
on their containing window pallete.
I don't know how to do this. As I understand it, when you create a
gworld you may pass it a colortable (not palette), which it copies.
Quickdraw ascertains whether two palettes are eq by seeing if their
ctseeds are the same. If they are equivalent, then quickdraw does no
translations of pixel values, if they aren't it does. Now the palette
manager changes the color table of the window, but since the color
table of the gworld is not the same one, it is not changed. You could
put a pointer to the window colortable into the gworld, but then you
run into problems with memory allocation and freeing. Each of the
gworld and window wants to free the memory when it is disposed. Also,
the behaviour of allocation when the gworld is updated (as in
updategworld) is not defined. Currently updategworld conses up a whole
new gworld and disposes the old one. I'm not sure which fields it
moves, and which it copies.
Sheets could keep a palette of their own, and then when their installed
into a window, could add their entries into the windows. This would also
make it posible to support palette ops on sheets not currently installed
in a window.
Again, the problem is that I don't know how to associate a palette
with a gworld, only a window. Now there is a section in IM 6 called
"Linking A Color Table To A Palette" which might be relevant, but I
haven't yet understood it, or tried it. (preferably in that order).
I'd give sheets a :palette-id and/or a :color-table-id initarg which
give rsrc id's of palette's or color-tables.
(don't know if one is more appropriate than the other - or if it makes sense
to offer both)
The colortable argument is supported.
Lately I've been playing with GWorlds, I have some macros like
with-focused-GWorld, with-locked-GWorld, that you're welcome to.
I've got equivalents to these, thanks though. What would be good is
for you to take a look at what I distribute and see that it
incorporates whatever knowledge you have.
How do accomplish getting all the drawing to go to the GWorld, i.e.
How do you keep the subview from calling with-focused view and sending
their drawing to the screen.
You have to be responsible. If you do (with-focused-view (view-window
foo) .. it will go to to the window. But I have modified focus-view so
that focusing on a sheet-view focuses on the gworld instead, and have made
substantial changes to invalidate-view that propogate the changes.
Using the system does require some concession. For instance, I used to
do things like have a dynamic display which changed by simply calling
view-draw-contents repeatedly (some instance variable would change).
But in this system, view draw contents only writes to the pixmap.
With this stuff I call invalidate-view repeatedly and that triggers
the call to view-draw-contents.
I've taken the liberty of including info-mcl on the cc list, since
others may have suggestions or comments.