[comp.windows.x] Finding allocated colormap entries

madd@bu-cs.BU.EDU (Jim Frost) (09/27/89)

In article <8909111158.AA06574@expire.lcs.mit.edu> rws@EXPO.LCS.MIT.EDU (Bob Scheifler) writes:
|it looks like we'll still be
|missing a way to find out which non-window depths are supported on each
|screen.  We'll look at this.

On a related issue, is there any way of finding which colormap entries
are defined on a particular colormap?  I have been unable to find such
information in the manuals.

What I would like to do is try very hard to re-use colormap entries on
colors that are "close enough" to those in the colormap.  Using the
XAllocColor() call doesn't work very well for this since it will only
return already-allocated colors if it's an exact match for the server.
A nice feature might be XGetClosestAllocatedColor() or some such
(which I do internally in my application now), which would also
alleviate the need to figure out which colors are allocated already
for some applications.

Another feature that I would really appreciate is to be able to find
out just how many colors are available in a colormap (at least
approximately, given asynchronicity) without having to call
XAllocColorCells() multiple times or having the call fail until my
request fits.  Am I missing something here, too?

E-mail replies appreciated at the address below, but replies here will
be found too.  Thanks in advance.

jim frost
software tool & die
madd@std.com

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (09/27/89)

    On a related issue, is there any way of finding which colormap entries
    are defined on a particular colormap?

Nope.  If I understand you, this would require a protocol extension to do right.

    Another feature that I would really appreciate is to be able to find
    out just how many colors are available in a colormap (at least
    approximately, given asynchronicity) without having to call
    XAllocColorCells() multiple times or having the call fail until my
    request fits.  Am I missing something here, too?

This has also been asked about before.  There is no support for this.  The only
thing you are missing is that, unless you grab the server, the answer you get
back could be useless (either too large or too small) by the time you get
around to allocating.