// pressDirs.sr // Bcpl/f pressDirs.sr // last modified // RML March 27, 1980 5:20 PM underlined offset fiddle // RML April 3, 1978 10:56 AM single page color Press file // RML November 22, 1977 5:12 PM - bug fix, add lv to emitPressOp! // RML November 21, 1977 4:06 PM - pressSetOp // RML September 28, 1977 3:31 PM - pressHighlight // RML September 23, 1977 6:12 PM - color additives // Last modified November 3, 1979 1:07 PM by Taft get "BRAVO1.DF" get "Q.DF" get "ALTOFILESYS.D" get "PRESS.DF" get "PCOLOR.DF" // Incoming Procedures external [ DlPosition doublesub EvenByte move movec MyFrame PressInitTranslate PutChar PutWds QLength LengthQ RoundRatio ]; // Incoming Statics external [ El ElTrailer mpcuncatt vpep vPress vsgh ] // Outgoing Procedures external [ emitPressOp pressHighlight pressSetColor pressSetOp pressShowChars pressShowRectangle pressUnderline pressXpdBorder updateEtFrame ]; //********** For Pressery, see **************// // Sproull, Bob,and Newman, William; January 26, 1977 // "Press File Format", on Press.Ears //******************************************// // U P D A T E E T F R A M E // let updateEtFrame(xLeft, xRight, yBase) be [ if xLeft < ElTrailer>>ELTRAILER.left then ElTrailer>>ELTRAILER.left = xLeft let t = (yBase-RoundRatio(vsgh>>SG.blmax, pttomicamlt, pttomicadiv)) if t < ElTrailer>>ELTRAILER.bottom then ElTrailer>>ELTRAILER.bottom = t t = xRight-xLeft if t > ElTrailer>>ELTRAILER.width then ElTrailer>>ELTRAILER.width = t t = (yBase+RoundRatio(vsgh>>SG.topmax, pttomicamlt, pttomicadiv)) if t > ElTrailer>>ELTRAILER.height then ElTrailer>>ELTRAILER.height = t ] // S E T O P // and pressSetOp(index, var) be [ // index is the offset of an item in the vPress array // var is the value to set it to. let ptr = lv vPress ! index unless var eq ptr >> vPRESS.value do [ ptr >> vPRESS.value = var ptr >> vPRESS.State = true ] ] // E M I T P R E S S O P // and emitPressOp(index) be [ let ptr = lv vPress ! index if ptr >> vPRESS.State then [ let val = ptr >> vPRESS.value switchon index into [ case vPressX: pressSetX(val); endcase case vPressY: pressSetY(val); endcase case vPressFont: pressSetFont(val); endcase case vPressSpace: pressSetSpaceX(val); endcase case vPressHue: pressSetHue(val); endcase case vPressValue : pressSetBrightness(val); endcase case vPressChroma : pressSetSaturation(val); endcase ] ] ptr >> vPRESS.State = false ] // S E T X // and pressSetX(x) = valof [ PutChar(pressSetXm,El) PutChar(x<> vPRESS.value = -1 // x is advanced by Show Char emitPressOp(vPressY) emitPressOp(vPressFont) emitPressOp(vPressSpace) emitPressOp(vPressHue) emitPressOp(vPressValue) emitPressOp(vPressChroma) test n le 32 ifso [ // generate short form PutChar(pressShowCharsShortm+(n-1),El) ] ifnot [ PutChar(pressShowCharsm,El) PutChar(n,El) ] ] // S E T F O N T // and pressSetFont(font) be [ PutChar(pressSetFontm+(font&17b),El) ] // S E T C O L O R // and pressSetColor(colorx) be [ let ptr = lv mpcuncatt! (colorx lshift 1) pressSetOp(vPressHue, ptr>>vColor.hue) pressSetOp(vPressValue, ptr>>vColor.value) pressSetOp(vPressChroma, ptr>>vColor.chroma) ] // S E T B R I G H T N E S S // and pressSetBrightness(value) be [ PutChar(pressSetBrightnessm,El) PutChar(value,El) ] // S E T H U E // and pressSetHue(hugh) be [ PutChar(pressSetHuem,El) PutChar(hugh,El) ] // S E T S A T U R A T I O N // and pressSetSaturation(value) be [ PutChar(pressSetSaturationm,El) PutChar(value,El) ] // S E T S P A C E X // and pressSetSpaceX(spc) be [ PutChar(pressSetSpaceXm,El) PutChar(spc<>SG.blmax pressSetColor(lastColor+cWhitex+1) pressSetOp(vPressX, xStart) // may not be needed // in case offset is pending let oldY = pressRetrieveValue(vPressY) pressSetOp(vPressY, yStart-RoundRatio(t, pttomicamlt, pttomicadiv)) pressShowRectangle(xCurrent-xStart, RoundRatio((vsgh>>SG.ldTop gr 0 ? 1,0)+vsgh>>SG.topmax+t , pttomicamlt, pttomicadiv)) pressSetOp(vPressY, oldY eq 0 ? yStart, oldY) // if underlining, highlighting is done before show chars, pressSetColor(lastColor) ] // P R E S S R E T R I E V E V A L U E // and pressRetrieveValue(index) = valof [ // 0 if State = 0, else // value let ptr = lv vPress!index resultis ptr>>vPRESS.State ? ptr>>vPRESS.value, 0 ] // The end of Press Directives