XlRGBColorMapsImpl.mesa
Copyright Ó 1993 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, May 26, 1993 12:16:31 pm PDT
Christian Jacobi, May 26, 1993 3:09 pm PDT
DIRECTORY XlPredefinedAtoms, XlRGBColorMaps, Xl;
XlRGBColorMapsImpl: CEDAR MONITOR
IMPORTS Xl
EXPORTS XlRGBColorMaps ~
BEGIN OPEN XlRGBColorMaps;
GetRGBColorMaps: PUBLIC PROC [c: Xl.Connection, w: Xl.Window, mapKey: Xl.XAtom ¬ XlPredefinedAtoms.rgbDefaultMap] RETURNS [list: LIST OF StandardColorMap ¬ NIL] = {
pr: Xl.PropertyReturnRec;
pr ¬ Xl.GetProperty[c: c, w: w, property: mapKey, supposedType: XlPredefinedAtoms.rgbColorMap, delete: FALSE, supposedFormat: 32];
WITH pr.value SELECT FROM
s: REF Xl.Card32Sequence => {
wordsForCMap: INT = 10;
idxForVisualId: INT = 8;
idxForKillId: INT = 9;
restStart: INT ¬ 0;
restLeng: INT ¬ s.leng;
WHILE restLeng >= wordsForCMap-2 DO
cm: StandardColorMap ¬ NEW[StandardColorMapRec];
cm.colormap ¬ [s[restStart+0]];
cm.redMax ¬ s[restStart+1];
cm.redMult ¬ s[restStart+2];
cm.greenMax ¬ s[restStart+3];
cm.greenMult ¬ s[restStart+4];
cm.blueMax ¬ s[restStart+5];
cm.blueMult ¬ s[restStart+6];
cm.basePixel ¬ s[restStart+7];
IF idxForVisualId < restLeng
THEN cm.visualId ¬ [s[restStart+idxForVisualId]]
ELSE cm.visualId ¬ Xl.QueryScreen[c, w].rootVisual;
IF idxForKillId < restLeng
THEN cm.killId ¬ s[restStart+idxForKillId]
ELSE cm.killId ¬ Xl.nullID;
restLeng ¬ restLeng-wordsForCMap;
restStart ¬ restStart+wordsForCMap;
list ¬ CONS[cm, list];
ENDLOOP
};
ENDCASE => {};
};
END.