REF XTkShellWidgets.ICCCMHints, baseFileNamePart, maskFileNamePart: Rope.
IF sm#
NIL
THEN {
screen: Xl.Screen ~ shell.screenDepth.screen;
szVec: ImagerSample.Vec ~ ImagerSample.GetSize[sm];
size: Xl.Size ~ [width: szVec.f, height: szVec.s];
base: LONG POINTER ~ LOOPHOLE[ImagerSample.GetBase[sm].word];
scanLineBytes: INT ~ ImagerSample.GetBitsPerLine[sm]/8;
iconPixmap: Xl.Pixmap ~ Xl.CreatePixmap[shell.connection, screen.root.drawable, size, 1]; --A pixmap of depth 1 is always supported (Protocol; in prose for connection set up)
gc: Xl.GContext ~ Xl.MakeGContext[shell.connection, iconPixmap.drawable];
Xl.SetGCGrounds[gc, 1, 0];
Xl.PutImage[c: shell.connection, drawable: iconPixmap.drawable, gc: gc, base: base, size: size, dest: [0, 0], offx: 0, offy: 0, scanLineBytes: scanLineBytes, bitsPerPixel: 1];
icccmHints.wmHints.iconPixmap ¬ iconPixmap;
icccmHints.wmHintsChanged ¬ TRUE;
IF Rope.Equal[baseFileNamePart, maskFileNamePart]
THEN {
icccmHints.wmHints.iconMask ¬ iconPixmap;
icccmHints.wmHintsChanged ¬ TRUE;
RETURN;
};
IF maskFileNamePart#
NIL
THEN {
sm: ImagerSample.RasterSampleMap ¬ SMFromName[maskFileNamePart];
IF sm#
NIL
THEN {
szVec: ImagerSample.Vec ~ ImagerSample.GetSize[sm];
size: Xl.Size ~ [width: szVec.f, height: szVec.s];
base: LONG POINTER ~ LOOPHOLE[ImagerSample.GetBase[sm].word];
scanLineBytes: INT ~ ImagerSample.GetBitsPerLine[sm]/8;
maskPixmap: Xl.Pixmap ~ Xl.CreatePixmap[shell.connection, screen.root.drawable, size, 1]; --A pixmap of depth 1 is always supported (Protocol; in prose for connection set up)
Xl.PutImage[c: shell.connection, drawable: maskPixmap.drawable, gc: gc, base: base, size: size, dest: [0, 0], offx: 0, offy: 0, scanLineBytes: scanLineBytes, bitsPerPixel: 1];
icccmHints.wmHints.iconMask ¬ maskPixmap;
icccmHints.wmHintsChanged ¬ TRUE;
};
};
};